70#include <unordered_map>
90 updateTimeDependentParams(pc);
120 for (
const auto& trackRef : primVer2TRefs) {
121 processTracksOfVertex(trackRef, recoData);
141 LOG(info) <<
"ITS cluster dictionary updated";
151void FilteringSpec::clear()
155 mGIDToTableID.clear();
156 mITSTrackIDCache.clear();
157 mITSClusterIDCache.clear();
165 if (!mITSTrackIDCache.empty()) {
170 auto trIt = mITSTrackIDCache.begin();
171 for (
unsigned irof = 0; irof < rofsOrig.size() && trIt != mITSTrackIDCache.end(); irof++) {
172 const auto& rofOrig = rofsOrig[irof];
173 int startID = rofOrig.getFirstEntry(), endID = startID + rofOrig.getNEntries();
174 if (trIt->first >= endID) {
177 auto& rofSave = mFTF.
ITSTrackROFs.emplace_back(rofOrig);
178 rofSave.setFirstEntry(mFTF.
ITSTracks.size());
179 while (trIt != mITSTrackIDCache.end() && trIt->first < endID) {
181 const auto& trOr = tracksOrig[trIt->first];
182 auto& trSave = mFTF.
ITSTracks.emplace_back(trOr);
184 for (
int i = 0;
i < trOr.getNClusters();
i++) {
185 int clID = trOr.getClusterEntry(
i);
187 mITSClusterIDCache[clID] = 0;
194 rofSave.setNEntries(mFTF.
ITSTracks.size() - rofSave.getFirstEntry());
198 if (!mITSClusterIDCache.empty()) {
202 auto clIt = mITSClusterIDCache.begin();
203 auto pattItOrig = pattOrig.begin(), pattItOrigPrev = pattItOrig;
204 for (
unsigned irof = 0; irof < rofsOrig.size() && clIt != mITSClusterIDCache.end(); irof++) {
205 const auto& rofOrig = rofsOrig[irof];
206 int startID = rofOrig.getFirstEntry(), endID = startID + rofOrig.getNEntries();
207 if (clIt->first >= endID) {
211 rofSave.setFirstEntry(mFTF.
ITSTracks.size());
212 while (clIt != mITSClusterIDCache.end() && clIt->first < endID) {
214 const auto& clOr = clusOrig[clIt->first];
215 auto& clSave = mFTF.
ITSClusters.emplace_back(clOr);
217 auto pattID = clOr.getPatternID();
222 while (pattItOrigPrev != pattItOrig) {
228 rofSave.setNEntries(mFTF.
ITSClusters.size() - rofSave.getFirstEntry());
232 for (
auto& clID : mFTF.ITSClusterIndices) {
233 clID = mITSClusterIDCache[clID];
245 for (
int ti =
start; ti <
end; ti++) {
246 auto& trackIndex = GIndices[ti];
247 if (GIndex::includesSource(
src, mInputSources)) {
249 if (trackIndex.isAmbiguous()) {
250 const auto res = mGIDToTableID.find(trackIndex);
251 if (
res != mGIDToTableID.end()) {
252 if (
res->second < 0) {
263 int selRes = processBarrelTrack(trackIndex, recoData);
264 if (trackIndex.isAmbiguous()) {
265 mGIDToTableID[trackIndex] = selRes;
274 int res = selectTrack(idx, recoData);
282 if (contributorsGID[
GID::ITS].isIndexSet()) {
283 mITSTrackIDCache[contributorsGID[
GID::ITS]] = 0;
292 auto src =
id.getSource();
303 if (t.getPt() < 2.) {
311 LOGF(info,
"data filtering total timing: Cpu: %.3e Real: %.3e s in %d slots", mTimer.CpuTime(), mTimer.RealTime(), mTimer.Counter() - 1);
316 static bool initOnceDone =
false;
324 std::vector<OutputSpec> outputs;
325 outputs.emplace_back(
"GLO",
"FILTERED_RECO_TF", 0, o2::framework::Lifetime::Sporadic);
327 auto dataRequest = std::make_shared<DataRequest>();
329 dataRequest->requestTracks(
src, useMC);
330 dataRequest->requestPrimaryVertices(useMC);
332 LOGF(info,
"Requesting CTP digits");
333 dataRequest->requestCTPDigits(useMC);
336 dataRequest->requestSecondaryVertices(useMC);
342 dataRequest->requestEMCALCells(useMC);
349 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"