diff --git a/reco/detectors/trd/CbmTrdClusterFinder.cxx b/reco/detectors/trd/CbmTrdClusterFinder.cxx index 40c5d2bb2e0d16918d2ba301b62e68e688fba1ad..6324b16fd6c6f8d2406301ab58d253066e0966b8 100644 --- a/reco/detectors/trd/CbmTrdClusterFinder.cxx +++ b/reco/detectors/trd/CbmTrdClusterFinder.cxx @@ -123,9 +123,11 @@ void CbmTrdClusterFinder::processDigisInModules(UInt_t ndigis, CbmEvent* event) fNrDigis += ndigis; fNrClusters += clsCounter; - LOG(debug) << GetName() << "::Exec : Digis : " << ndigis << " / " << digiCounter << " above threshold (" - << 1e6 * fgMinimumChargeTH << " keV)"; - LOG(debug) << GetName() << "::Exec : Clusters : " << clsCounter; + if (DoDebugPrintouts()) { + LOG(info) << GetName() << "::Exec : Digis : " << ndigis << " / " << digiCounter << " above threshold (" + << 1e6 * fgMinimumChargeTH << " keV)"; + LOG(info) << GetName() << "::Exec : Clusters : " << clsCounter; + } } //____________________________________________________________________________________ @@ -254,45 +256,53 @@ InitStatus CbmTrdClusterFinder::Init() void CbmTrdClusterFinder::Exec(Option_t* /*option*/) { /** -* Digis are sorted according to the moduleAddress. A combiId is calculted based -* on the rowId and the colId to have a neighbouring criterion for digis within -* the same pad row. The digis of each module are sorted according to this combiId. -* All sorted digis of one pad row are 'clustered' into rowCluster. For a new row -* the rowClusters are compared to the rowClusters of the last row. If an overlap -* is found they are marked to be parents(last row) and childrens(activ row) -* (mergeRowCluster()). After this, the finale clusters are created. Therefor -* walkCluster() walks along the list of marked parents and markes every visited -* rowCluster to avoid multiple usage of one rowCluster. drawCluster() can be used to -* get a visual output. -*/ + * Digis are sorted according to the moduleAddress. A combiId is calculted based + * on the rowId and the colId to have a neighbouring criterion for digis within + * the same pad row. The digis of each module are sorted according to this combiId. + * All sorted digis of one pad row are 'clustered' into rowCluster. For a new row + * the rowClusters are compared to the rowClusters of the last row. If an overlap + * is found they are marked to be parents(last row) and childrens(activ row) + * (mergeRowCluster()). After this, the finale clusters are created. Therefor + * walkCluster() walks along the list of marked parents and markes every visited + * rowCluster to avoid multiple usage of one rowCluster. drawCluster() can be used to + * get a visual output. + */ fClusters->Delete(); TStopwatch timer; - timer.Start(); UInt_t nDigis = 0; if (UseOnlyEventDigis()) { for (auto eventobj : *fEvents) { + timer.Start(); auto event = static_cast<CbmEvent*>(eventobj); nDigis = addDigisToModules(event); processDigisInModules(nDigis, event); fNrEvents++; + timer.Stop(); + if (DoDebugPrintouts()) { + LOG(info) << GetName() << "::Exec : Event Nr: " << fNrEvents; + LOG(info) << GetName() << "::Exec : real time=" << timer.RealTime() << " CPU time=" << timer.CpuTime(); + } + fProcessTime += timer.RealTime(); + timer.Reset(); } } if (!UseOnlyEventDigis()) { + timer.Start(); nDigis = addDigisToModules(); processDigisInModules(nDigis); fNrEvents++; + timer.Stop(); + if (DoDebugPrintouts()) { + LOG(info) << GetName() << "::Exec : Event Nr: " << fNrEvents; + LOG(info) << GetName() << "::Exec : real time=" << timer.RealTime() << " CPU time=" << timer.CpuTime(); + } + fProcessTime += timer.RealTime(); + timer.Reset(); } - - - timer.Stop(); - - LOG(debug) << GetName() << "::Exec : real time=" << timer.RealTime() << " CPU time=" << timer.CpuTime(); - - fProcessTime += timer.RealTime(); } //_____________________________________________________________________ diff --git a/reco/detectors/trd/CbmTrdClusterFinder.h b/reco/detectors/trd/CbmTrdClusterFinder.h index d7d88315575e9555a7a1fe7731dc389e3d8c0809..4c8ac96027375953a5637915775b5c633ad3280c 100644 --- a/reco/detectors/trd/CbmTrdClusterFinder.h +++ b/reco/detectors/trd/CbmTrdClusterFinder.h @@ -56,14 +56,15 @@ class CbmTrdClusterFinder : public FairTask { public: enum CbmTrdRecDef { - kTime = 0, ///< select Time based/Event by event reconstruction - kMultiHit, ///< multi hit detection - kRowMerger, ///< merge clusters over neighbour rows - kNeighbourCol, ///< use neighbour trigger; column wise - kNeighbourRow, ///< use neighbour trigger; row wise - kDumpClusters, ///< write clustered digis to output - kFASP, ///< use FASP ASIC for triangular pad plane geometry - kOnlyEventDigis ///< use only digis connected to a CbmEvent + kTime = 0, ///< select Time based/Event by event reconstruction + kMultiHit, ///< multi hit detection + kRowMerger, ///< merge clusters over neighbour rows + kNeighbourCol, ///< use neighbour trigger; column wise + kNeighbourRow, ///< use neighbour trigger; row wise + kDumpClusters, ///< write clustered digis to output + kFASP, ///< use FASP ASIC for triangular pad plane geometry + kOnlyEventDigis, ///< use only digis connected to a CbmEvent + kDebugStatements ///< print out debug statements with LOG(info) }; /** @@ -83,6 +84,7 @@ public: static Bool_t HasNeighbourRow() { return TESTBIT(fgConfig, kNeighbourRow); } static Bool_t HasRowMerger() { return TESTBIT(fgConfig, kRowMerger); } static Bool_t IsTimeBased() { return TESTBIT(fgConfig, kTime); } + static Bool_t DoDebugPrintouts() { return TESTBIT(fgConfig, kDebugStatements); } /** * @brief If true only digis connected ro a CbmEvent are processed @@ -119,6 +121,12 @@ public: static void SetMinimumChargeTH(Float_t th) { fgMinimumChargeTH = th; } static void SetTimeBased(Bool_t set = kTRUE) { set ? SETBIT(fgConfig, kTime) : CLRBIT(fgConfig, kTime); } + static void SetDoDebugPrintouts(Bool_t set = kTRUE) + { + set ? SETBIT(fgConfig, kDebugStatements) : CLRBIT(fgConfig, kDebugStatements); + } + + /** * @brief Set the Use Only Event Digis * Per default this is activated on construction, such that the user can diff --git a/reco/detectors/trd/CbmTrdHitProducer.cxx b/reco/detectors/trd/CbmTrdHitProducer.cxx index 3606b64af03d74ccbb6ac20992fdd7492d523304..93e9039e15d87f33b39937b43435b345ea947a51 100644 --- a/reco/detectors/trd/CbmTrdHitProducer.cxx +++ b/reco/detectors/trd/CbmTrdHitProducer.cxx @@ -129,15 +129,17 @@ CbmTrdModuleRec* CbmTrdHitProducer::AddModule(Int_t address, TGeoPhysicalNode* n UInt_t CbmTrdHitProducer::processClusters() { Int_t nclusters = fClusters->GetEntries(); - LOG(debug) << GetName() << "::Exec: " - << " Clusters : " << nclusters; for (Int_t icluster = 0; icluster < nclusters; icluster++) { processCluster(icluster); } auto nhits = addHits(); - LOG(debug) << GetName() << "::Exec: " - << " Hits : " << nhits; + if (CbmTrdClusterFinder::DoDebugPrintouts()) { + LOG(info) << GetName() << "::processClusters: " + << " Clusters : " << nclusters; + LOG(info) << GetName() << "::processClusters: " + << " Hits : " << nhits; + } return nhits; } @@ -145,16 +147,19 @@ UInt_t CbmTrdHitProducer::processClusters() UInt_t CbmTrdHitProducer::processClusters(CbmEvent* event) { Int_t nclusters = event->GetNofData(ECbmDataType::kTrdCluster); - LOG(debug) << GetName() << "::Exec : " - << " Clusters : " << nclusters; for (Int_t icluster = 0; icluster < nclusters; icluster++) { auto clusterIdx = event->GetIndex(ECbmDataType::kTrdCluster, icluster); processCluster(clusterIdx); } auto nhits = addHits(event); - LOG(debug) << GetName() << "::Exec : " - << " Hits : " << nhits; + + if (CbmTrdClusterFinder::DoDebugPrintouts()) { + LOG(info) << GetName() << "::processClusters: " + << " Clusters : " << nclusters; + LOG(info) << GetName() << "::processClusters: " + << " Hits : " << nhits; + } return nhits; } @@ -257,28 +262,44 @@ void CbmTrdHitProducer::Exec(Option_t*) fHits->Delete(); TStopwatch timer; - timer.Start(); UInt_t hitCounter = 0; if (CbmTrdClusterFinder::UseOnlyEventDigis()) { for (auto eventobj : *fEvents) { + timer.Start(); hitCounter = 0; auto event = static_cast<CbmEvent*>(eventobj); if (!event) continue; hitCounter += processClusters(event); fNrEvents++; + timer.Stop(); + if (CbmTrdClusterFinder::DoDebugPrintouts()) { + LOG(info) << GetName() << "::Exec : Event Nr: " << fNrEvents; + LOG(info) << GetName() << "::Exec : real time=" << timer.RealTime() << " CPU time=" << timer.CpuTime(); + } + fProcessTime += timer.RealTime(); + timer.Reset(); } } if (!CbmTrdClusterFinder::UseOnlyEventDigis()) { + timer.Start(); hitCounter = processClusters(); fNrEvents++; + timer.Stop(); + if (CbmTrdClusterFinder::DoDebugPrintouts()) { + LOG(info) << GetName() << "::Exec : Event Nr: " << fNrEvents; + LOG(info) << GetName() << "::Exec : real time=" << timer.RealTime() << " CPU time=" << timer.CpuTime(); + } + fProcessTime += timer.RealTime(); + timer.Reset(); } timer.Stop(); - LOG(debug) << GetName() << "::Exec: real time=" << timer.RealTime() << " CPU time=" << timer.CpuTime(); + if (CbmTrdClusterFinder::DoDebugPrintouts()) + LOG(info) << GetName() << "::Exec: real time=" << timer.RealTime() << " CPU time=" << timer.CpuTime(); fProcessTime += timer.RealTime(); }