diff --git a/core/base/CbmMatchRecoToMC.cxx b/core/base/CbmMatchRecoToMC.cxx index a47936a52854ac99a2fc383f29999a9c24263dc1..6e35585a1f40bbdfb654da8cddd7adeff4f684fd 100644 --- a/core/base/CbmMatchRecoToMC.cxx +++ b/core/base/CbmMatchRecoToMC.cxx @@ -123,7 +123,7 @@ InitStatus CbmMatchRecoToMC::Init() ReadAndCreateDataBranches(); // Notification to a user about matching suppression - if (fbSuppressReMatching) { + if (fbSuppressHitReMatching) { std::stringstream msg; msg << "\033[1;31mCbmMatchRecoToMC (\"" << fName << "\"): the cluster and hit matching routines for MVD, STS, "; msg << "MuCh, TRD, TOF, FSD will be suppressed by a request from CbmMatchRecoToMC::SuppressHitMatching():\033[0m\n"; @@ -135,7 +135,7 @@ InitStatus CbmMatchRecoToMC::Init() void CbmMatchRecoToMC::Exec(Option_t* /*opt*/) { - if (!fbSuppressReMatching) { + if (!fbSuppressHitReMatching) { if (fMvdHitMatches != nullptr) fMvdHitMatches->Delete(); if (fMvdClusterMatches != nullptr) fMvdClusterMatches->Delete(); if (fStsClusterMatches != nullptr) fStsClusterMatches->Delete(); @@ -155,7 +155,7 @@ void CbmMatchRecoToMC::Exec(Option_t* /*opt*/) // ----- MVD ----- - if (!fbSuppressReMatching) { + if (!fbSuppressHitReMatching) { // MVD: digi->hit if (fMvdHits && fMvdHitMatches && !fMvdCluster) { MatchHitsMvd(fMvdHits, fMvdHitMatches); } else { @@ -167,7 +167,7 @@ void CbmMatchRecoToMC::Exec(Option_t* /*opt*/) } // ----- STS ----- - if (!fbSuppressReMatching) { + if (!fbSuppressHitReMatching) { // STS: digi->cluster MatchClusters(ECbmModuleId::kSts, fStsClusters, fStsClusterMatches); // STS: cluster->hit @@ -177,7 +177,7 @@ void CbmMatchRecoToMC::Exec(Option_t* /*opt*/) MatchStsTracks(fMvdHitMatches, fStsHitMatches, fMvdPoints, fStsPoints, fStsTracks, fStsTrackMatches); // ----- MUCH ----- - if (!fbSuppressReMatching) { + if (!fbSuppressHitReMatching) { // MUCH: digi->cluster MatchClusters(ECbmModuleId::kMuch, fMuchClusters, fMuchClusterMatches); // MUCH: cluster->hit @@ -194,22 +194,22 @@ void CbmMatchRecoToMC::Exec(Option_t* /*opt*/) // TRD if (fTrdClusters && fTrdHits) { // MC->digi->cluster->hit->track - if (!fbSuppressReMatching) { + if (!fbSuppressHitReMatching) { MatchClusters(ECbmModuleId::kTrd, fTrdClusters, fTrdClusterMatches); MatchHits(fTrdClusterMatches, fTrdHits, fTrdHitMatches); } MatchTracks(fTrdHitMatches, fTrdPoints, fTrdTracks, fTrdTrackMatches); } else if (fTrdHits) { // MC->hit->track - if (!fbSuppressReMatching) { MatchHitsToPoints(fTrdPoints, fTrdHits, fTrdHitMatches); } + if (!fbSuppressHitReMatching) { MatchHitsToPoints(fTrdPoints, fTrdHits, fTrdHitMatches); } MatchTracks(fTrdHitMatches, fTrdPoints, fTrdTracks, fTrdTrackMatches); } // TOF: (Digi->MC)+(Hit->Digi)=>(Hit->MC) - if (!fbSuppressReMatching) { MatchHitsTof(fTofHitDigiMatches, fTofHits, fTofHitMatches); } + if (!fbSuppressHitReMatching) { MatchHitsTof(fTofHitDigiMatches, fTofHits, fTofHitMatches); } // ----- FSD ----- - if (!fbSuppressReMatching) { + if (!fbSuppressHitReMatching) { // FSD: digi->hit if (fFsdHits && fFsdHitMatches) { MatchHitsFsd(fFsdHits, fFsdHitMatches); } } @@ -250,8 +250,8 @@ void CbmMatchRecoToMC::ReadAndCreateDataBranches() if (nullptr != fStsClusters) { fStsClusterMatches = static_cast<TClonesArray*>(ioman->GetObject("StsClusterMatch")); if (nullptr == fStsClusterMatches) { - fbSuppressReMatching = false; // Ensure, that matching is done, if matches are absent - fStsClusterMatches = new TClonesArray("CbmMatch", 100); + fbSuppressHitReMatching = false; // Ensure, that matching is done, if matches are absent + fStsClusterMatches = new TClonesArray("CbmMatch", 100); ioman->Register("StsClusterMatch", "STS", fStsClusterMatches, IsOutputBranchPersistent("StsClusterMatch")); } } @@ -260,8 +260,8 @@ void CbmMatchRecoToMC::ReadAndCreateDataBranches() if (nullptr != fStsHits) { fStsHitMatches = static_cast<TClonesArray*>(ioman->GetObject("StsHitMatch")); if (nullptr == fStsHitMatches) { - fbSuppressReMatching = false; // Ensure, that matching is done, if matches are absent - fStsHitMatches = new TClonesArray("CbmMatch", 100); + fbSuppressHitReMatching = false; // Ensure, that matching is done, if matches are absent + fStsHitMatches = new TClonesArray("CbmMatch", 100); ioman->Register("StsHitMatch", "STS", fStsHitMatches, IsOutputBranchPersistent("StsHitMatch")); } } @@ -294,8 +294,8 @@ void CbmMatchRecoToMC::ReadAndCreateDataBranches() if (nullptr != fTrdClusters) { fTrdClusterMatches = static_cast<TClonesArray*>(ioman->GetObject("TrdClusterMatch")); if (nullptr == fTrdClusterMatches) { - fbSuppressReMatching = false; // Ensure, that matching is done, if matches are absent - fTrdClusterMatches = new TClonesArray("CbmMatch", 100); + fbSuppressHitReMatching = false; // Ensure, that matching is done, if matches are absent + fTrdClusterMatches = new TClonesArray("CbmMatch", 100); ioman->Register("TrdClusterMatch", "TRD", fTrdClusterMatches, IsOutputBranchPersistent("TrdClusterMatch")); } } @@ -304,8 +304,8 @@ void CbmMatchRecoToMC::ReadAndCreateDataBranches() if (nullptr != fTrdHits) { fTrdHitMatches = static_cast<TClonesArray*>(ioman->GetObject("TrdHitMatch")); if (nullptr == fTrdHitMatches) { - fbSuppressReMatching = false; // Ensure, that matching is done, if matches are absent - fTrdHitMatches = new TClonesArray("CbmMatch", 100); + fbSuppressHitReMatching = false; // Ensure, that matching is done, if matches are absent + fTrdHitMatches = new TClonesArray("CbmMatch", 100); ioman->Register("TrdHitMatch", "TRD", fTrdHitMatches, IsOutputBranchPersistent("TrdHitMatch")); } } @@ -328,8 +328,8 @@ void CbmMatchRecoToMC::ReadAndCreateDataBranches() if (nullptr != fMuchClusters) { fMuchClusterMatches = static_cast<TClonesArray*>(ioman->GetObject("MuchClusterMatch")); if (nullptr == fMuchClusterMatches) { - fbSuppressReMatching = false; // Ensure, that matching is done, if matches are absent - fMuchClusterMatches = new TClonesArray("CbmMatch", 100); + fbSuppressHitReMatching = false; // Ensure, that matching is done, if matches are absent + fMuchClusterMatches = new TClonesArray("CbmMatch", 100); ioman->Register("MuchClusterMatch", "MUCH", fMuchClusterMatches, IsOutputBranchPersistent("MuchClusterMatch")); } } @@ -338,8 +338,8 @@ void CbmMatchRecoToMC::ReadAndCreateDataBranches() if (nullptr != fMuchPixelHits) { fMuchPixelHitMatches = static_cast<TClonesArray*>(ioman->GetObject("MuchPixelHitMatch")); if (nullptr == fMuchPixelHitMatches) { - fbSuppressReMatching = false; // Ensure, that matching is done, if matches are absent - fMuchPixelHitMatches = new TClonesArray("CbmMatch", 100); + fbSuppressHitReMatching = false; // Ensure, that matching is done, if matches are absent + fMuchPixelHitMatches = new TClonesArray("CbmMatch", 100); ioman->Register("MuchPixelHitMatch", "MUCH", fMuchPixelHitMatches, IsOutputBranchPersistent("MuchPixelHitMatch")); } } @@ -360,8 +360,8 @@ void CbmMatchRecoToMC::ReadAndCreateDataBranches() if (nullptr != fMvdCluster) { fMvdClusterMatches = static_cast<TClonesArray*>(ioman->GetObject("MvdClusterMatch")); if (nullptr == fMvdClusterMatches) { - fbSuppressReMatching = false; // Ensure, that matching is done, if matches are absent - fMvdClusterMatches = new TClonesArray("CbmMatch", 100); + fbSuppressHitReMatching = false; // Ensure, that matching is done, if matches are absent + fMvdClusterMatches = new TClonesArray("CbmMatch", 100); ioman->Register("MvdClusterMatch", "MVD", fMvdClusterMatches, IsOutputBranchPersistent("MvdClusterMatch")); } } @@ -370,8 +370,8 @@ void CbmMatchRecoToMC::ReadAndCreateDataBranches() if (nullptr != fMvdHits) { fMvdHitMatches = static_cast<TClonesArray*>(ioman->GetObject("MvdHitMatch")); if (nullptr == fMvdHitMatches) { - fbSuppressReMatching = false; // Ensure, that matching is done, if matches are absent - fMvdHitMatches = new TClonesArray("CbmMatch", 100); + fbSuppressHitReMatching = false; // Ensure, that matching is done, if matches are absent + fMvdHitMatches = new TClonesArray("CbmMatch", 100); ioman->Register("MvdHitMatch", "MVD", fMvdHitMatches, IsOutputBranchPersistent("MvdHitMatch")); } } @@ -441,8 +441,8 @@ void CbmMatchRecoToMC::ReadAndCreateDataBranches() if (nullptr != fFsdHits) { fFsdHitMatches = static_cast<TClonesArray*>(ioman->GetObject("FsdHitMatch")); if (nullptr == fFsdHitMatches) { - fbSuppressReMatching = false; // Ensure, that matching is done, if matches are absent - fFsdHitMatches = new TClonesArray("CbmMatch", 100); + fbSuppressHitReMatching = false; // Ensure, that matching is done, if matches are absent + fFsdHitMatches = new TClonesArray("CbmMatch", 100); ioman->Register("FsdHitMatch", "FSD", fFsdHitMatches, IsOutputBranchPersistent("FsdHitMatch")); } } diff --git a/core/base/CbmMatchRecoToMC.h b/core/base/CbmMatchRecoToMC.h index cca18d74b3339847b3f2e62fda4872a85ca55994..9ab07054aa0f4d3a2c7719828f3758e07303e34a 100644 --- a/core/base/CbmMatchRecoToMC.h +++ b/core/base/CbmMatchRecoToMC.h @@ -137,14 +137,14 @@ public: ** of the branch is absent (and the corresponding cluster and hit branches are present), the flag will be set to ** false, and the cluster/hit matching will be executed. **/ - void SuppressReMatching() { fbSuppressReMatching = true; } + void SuppressHitReMatching() { fbSuppressHitReMatching = true; } private: static Int_t fEventNumber; Bool_t fIsMvdActive = kTRUE; // is the Mvd module active Bool_t fbDigiExpUsed = kTRUE; // Usage of CbmTofDigiExp instead of CbmTofDigi - bool fbSuppressReMatching = false; // Suppression of MC->hit matching, if the matches are already there + bool fbSuppressHitReMatching = false; // Suppression of MC->hit matching, if the matches are already there CbmMCDataArray* fMCTracks = nullptr; //! Monte-Carlo tracks CbmDigiManager* fDigiManager = nullptr; //! Interface to digi branches diff --git a/macro/KF/kf_kfparticle.C b/macro/KF/kf_kfparticle.C index f3495a84306ce0340c4c31ef95f29af779166fee..e5d3ce5e47c4375677b6f086078bca70e31f47da 100644 --- a/macro/KF/kf_kfparticle.C +++ b/macro/KF/kf_kfparticle.C @@ -126,7 +126,12 @@ void kf_kfparticle(Int_t nEvents = 2, const TString setupName = "sis100_electron run->AddTask(mcManager); // ------------------------------------------------------------------------ - run->AddTask(new CbmMatchRecoToMC()); + { + CbmMatchRecoToMC* matchTask = new CbmMatchRecoToMC(); + // NOTE: Matching of hits and clusters is suppressed when the matches are already present in the tree. + matchTask->SuppressHitReMatching(); + run->AddTask(matchTask); + } // ----- KF and L1 are needed for field and material -------------------- run->AddTask(new CbmTrackingDetectorInterfaceInit()); diff --git a/macro/mcbm/mcbm_qa.C b/macro/mcbm/mcbm_qa.C index febe63f12e5918df6a35ced8748b561265dab5da..c048add5099250b6a3991cf7c1a6135c08c1c419 100644 --- a/macro/mcbm/mcbm_qa.C +++ b/macro/mcbm/mcbm_qa.C @@ -175,7 +175,7 @@ void mcbm_qa(Int_t nEvents = 0, TString dataset = "data/mcbm_beam_2020_03_test", auto* matchRecoToMC = new CbmMatchRecoToMC(); // NOTE: Matching is suppressed, if there are hit and cluster matches already in the tree. If there // are no hit matches, they are produced on this stage. - matchRecoToMC->SuppressReMatching(); + matchRecoToMC->SuppressHitReMatching(); run->AddTask(matchRecoToMC); } // ------------------------------------------------------------------------ diff --git a/macro/run/run_qa.C b/macro/run/run_qa.C index 153bd2833d6a3020be8dcd4cbaf2892839d4e784..fc72c75f70cc9abdcb174a819433d440a1584bd2 100644 --- a/macro/run/run_qa.C +++ b/macro/run/run_qa.C @@ -188,9 +188,8 @@ void run_qa(TString dataTra = "data/sis100_muon_jpsi_test", TString dataRaw = "d // ----- Match reco to MC ------ if (bUseMC) { CbmMatchRecoToMC* matchTask = new CbmMatchRecoToMC(); - // NOTE: Matching is suppressed, if there are hit and cluster matches already in the tree. If there - // are no hit matches, they are produced on this stage. - matchTask->SuppressReMatching(); + // NOTE: Matching of hits and clusters is suppressed when the matches are already present in the tree. + matchTask->SuppressHitReMatching(); run->AddTask(matchTask); } // ----- MUCH QA ---------------------------------