69#include <unordered_map>
89 updateTimeDependentParams(pc);
119 for (
const auto& trackRef : primVer2TRefs) {
120 processTracksOfVertex(trackRef, recoData);
140 LOG(info) <<
"ITS cluster dictionary updated";
150void FilteringSpec::clear()
154 mGIDToTableID.clear();
155 mITSTrackIDCache.clear();
156 mITSClusterIDCache.clear();
164 if (!mITSTrackIDCache.empty()) {
169 auto trIt = mITSTrackIDCache.begin();
170 for (
unsigned irof = 0; irof < rofsOrig.size() && trIt != mITSTrackIDCache.end(); irof++) {
171 const auto& rofOrig = rofsOrig[irof];
172 int startID = rofOrig.getFirstEntry(), endID = startID + rofOrig.getNEntries();
173 if (trIt->first >= endID) {
176 auto& rofSave = mFTF.
ITSTrackROFs.emplace_back(rofOrig);
177 rofSave.setFirstEntry(mFTF.
ITSTracks.size());
178 while (trIt != mITSTrackIDCache.end() && trIt->first < endID) {
180 const auto& trOr = tracksOrig[trIt->first];
181 auto& trSave = mFTF.
ITSTracks.emplace_back(trOr);
183 for (
int i = 0;
i < trOr.getNClusters();
i++) {
184 int clID = trOr.getClusterEntry(
i);
186 mITSClusterIDCache[clID] = 0;
193 rofSave.setNEntries(mFTF.
ITSTracks.size() - rofSave.getFirstEntry());
197 if (!mITSClusterIDCache.empty()) {
201 auto clIt = mITSClusterIDCache.begin();
202 auto pattItOrig = pattOrig.begin(), pattItOrigPrev = pattItOrig;
203 for (
unsigned irof = 0; irof < rofsOrig.size() && clIt != mITSClusterIDCache.end(); irof++) {
204 const auto& rofOrig = rofsOrig[irof];
205 int startID = rofOrig.getFirstEntry(), endID = startID + rofOrig.getNEntries();
206 if (clIt->first >= endID) {
210 rofSave.setFirstEntry(mFTF.
ITSTracks.size());
211 while (clIt != mITSClusterIDCache.end() && clIt->first < endID) {
213 const auto& clOr = clusOrig[clIt->first];
214 auto& clSave = mFTF.
ITSClusters.emplace_back(clOr);
216 auto pattID = clOr.getPatternID();
221 while (pattItOrigPrev != pattItOrig) {
227 rofSave.setNEntries(mFTF.
ITSClusters.size() - rofSave.getFirstEntry());
231 for (
auto& clID : mFTF.ITSClusterIndices) {
232 clID = mITSClusterIDCache[clID];
244 for (
int ti =
start; ti <
end; ti++) {
245 auto& trackIndex = GIndices[ti];
246 if (GIndex::includesSource(
src, mInputSources)) {
248 if (trackIndex.isAmbiguous()) {
249 const auto res = mGIDToTableID.find(trackIndex);
250 if (
res != mGIDToTableID.end()) {
251 if (
res->second < 0) {
262 int selRes = processBarrelTrack(trackIndex, recoData);
263 if (trackIndex.isAmbiguous()) {
264 mGIDToTableID[trackIndex] = selRes;
273 int res = selectTrack(idx, recoData);
281 if (contributorsGID[
GID::ITS].isIndexSet()) {
282 mITSTrackIDCache[contributorsGID[
GID::ITS]] = 0;
291 auto src =
id.getSource();
302 if (t.getPt() < 2.) {
310 LOGF(info,
"data filtering total timing: Cpu: %.3e Real: %.3e s in %d slots", mTimer.CpuTime(), mTimer.RealTime(), mTimer.Counter() - 1);
315 static bool initOnceDone =
false;
323 std::vector<OutputSpec> outputs;
324 outputs.emplace_back(
"GLO",
"FILTERED_RECO_TF", 0, o2::framework::Lifetime::Sporadic);
326 auto dataRequest = std::make_shared<DataRequest>();
328 dataRequest->requestTracks(
src, useMC);
329 dataRequest->requestPrimaryVertices(useMC);
331 LOGF(info,
"Requesting CTP digits");
332 dataRequest->requestCTPDigits(useMC);
335 dataRequest->requestSecondaryVertices(useMC);
341 dataRequest->requestEMCALCells(useMC);
348 AlgorithmSpec{adaptFromTask<FilteringSpec>(
src, dataRequest, enableSV, useMC)},
General auxilliary methods.
Definition of the GeometryManager class.
definition of CTPDigit, CTPInputDigit
Base definition of FV0 geometry.
Global Forward Muon tracks.
Global index for barrel track: provides provenance (detectors combination), index in respective array...
Definition of the MCTrack class.
Definition of a container to keep Monte Carlo truth external to simulation objects.
Utility functions for MC particles.
Class to perform TOF matching to global tracks.
Definition of the Names Generator class.
Definition of the parameter class for the detector electronics.
Header to collect physics constants.
Definition of the FDD RecPoint class.
Definition of the ITS track.
Definition of the MCH track.
Definition of the MCH track parameters for internal use.
Result of refitting TPC-ITS matched track.
Extention of GlobalTrackID by flags relevant for verter-track association.
Referenc on track indices contributing to the vertex, with possibility chose tracks from specific sou...
Container class to store energy released in the ZDC.
Container class to store a TDC hit in a ZDC channel.
Static class with identifiers, bitmasks and names for ALICE detectors.
void init(InitContext &ic) final
void finaliseCCDB(ConcreteDataMatcher &, void *) final
void run(ProcessingContext &pc) final
void endOfStream(framework::EndOfStreamContext &ec) final
This is invoked whenever we have an EndOfStream event.
void snapshot(const Output &spec, T const &object)
DataAllocator & outputs()
The data allocator is used to allocate memory for the output data.
ServiceRegistryRef services()
The services registry associated with this processing context.
void acquirePattern(iterator &pattIt)
static constexpr unsigned short InvalidPatternID
bool isGroup(int n) const
Returns true if the element corresponds to a group of rare topologies.
DataProcessorSpec getDataFilteringSpec(GID::mask_t src, bool enableSV, bool useMC)
create a processor spec
Defining PrimaryVertex explicitly as messageable.
std::vector< ConfigParamSpec > Options
auto getITSTracks() const
const U & getTrack(int src, int id) const
o2::InteractionRecord startIR
GlobalIDSet getSingleDetectorRefs(GTrackID gidx) const
auto getITSTracksClusterRefs() const
auto getTPCTRDTOFMatches() const
auto getPrimaryVertexMatchedTracks() const
auto getPrimaryVertexMatchedTrackRefs() const
auto getITSClustersPatterns() const
auto getITSClustersROFRecords() const
void collectData(o2::framework::ProcessingContext &pc, const DataRequest &request)
auto getITSTracksROFRecords() const
auto getITSTPCTRDTOFMatches() const
auto getITSTracksMCLabels() const
auto getITSClusters() const
const o2::dataformats::MatchInfoTOF & getTOFMatch(GTrackID id) const
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"