diff --git a/reco/L1/CbmL1.cxx b/reco/L1/CbmL1.cxx index 54cb749c5daa14ae9b523bc12241a0427252ee5b..d2469ffd5e2e5a7c126b9e92f16ad7d122292fda 100644 --- a/reco/L1/CbmL1.cxx +++ b/reco/L1/CbmL1.cxx @@ -137,6 +137,13 @@ void CbmL1::CheckDetectorPresence() } } +// --------------------------------------------------------------------------------------------------------------------- +// +void CbmL1::DisableTrackingStation(L1DetectorID detID, int iSt) +{ + if (L1DetectorID::kEND != detID) { fvmDisabledStationIDs[detID].insert(iSt); } +} + // --------------------------------------------------------------------------------------------------------------------- // InitStatus CbmL1::ReInit() @@ -481,6 +488,9 @@ InitStatus CbmL1::Init() stationInfo.SetFrontBackStripsGeometry((fscal) mvdInterface->GetStripsStereoAngleFront(iSt), (fscal) mvdInterface->GetStripsStereoAngleBack(iSt)); stationInfo.SetTrackingStatus(target.z < stationInfo.GetZdouble() ? true : false); + if (fvmDisabledStationIDs[L1DetectorID::kMvd].find(iSt) != fvmDisabledStationIDs[L1DetectorID::kMvd].cend()) { + stationInfo.SetTrackingStatus(false); + } fInitManager.AddStation(stationInfo); LOG(info) << "- MVD station " << iSt << " at z = " << stationInfo.GetZdouble() << " cm"; } @@ -507,6 +517,9 @@ InitStatus CbmL1::Init() stationInfo.SetFrontBackStripsGeometry((fscal) stsInterface->GetStripsStereoAngleFront(iSt), (fscal) stsInterface->GetStripsStereoAngleBack(iSt)); stationInfo.SetTrackingStatus(target.z < stationInfo.GetZdouble() ? true : false); + if (fvmDisabledStationIDs[L1DetectorID::kSts].find(iSt) != fvmDisabledStationIDs[L1DetectorID::kSts].cend()) { + stationInfo.SetTrackingStatus(false); + } fInitManager.AddStation(stationInfo); LOG(info) << "- STS station " << iSt << " at z = " << stationInfo.GetZdouble() << " cm"; } @@ -533,6 +546,9 @@ InitStatus CbmL1::Init() stationInfo.SetFrontBackStripsGeometry((fscal) muchInterface->GetStripsStereoAngleFront(iSt), (fscal) muchInterface->GetStripsStereoAngleBack(iSt)); stationInfo.SetTrackingStatus(target.z < stationInfo.GetZdouble() ? true : false); + if (fvmDisabledStationIDs[L1DetectorID::kMuch].find(iSt) != fvmDisabledStationIDs[L1DetectorID::kMuch].cend()) { + stationInfo.SetTrackingStatus(false); + } fInitManager.AddStation(stationInfo); LOG(info) << "- MuCh station " << iSt << " at z = " << stationInfo.GetZdouble() << " cm"; } @@ -563,6 +579,9 @@ InitStatus CbmL1::Init() if (iSt == 1 && L1Algo::TrackingMode::kMcbm == fTrackingMode && fMissingHits) { stationInfo.SetTrackingStatus(false); } + if (fvmDisabledStationIDs[L1DetectorID::kTrd].find(iSt) != fvmDisabledStationIDs[L1DetectorID::kTrd].cend()) { + stationInfo.SetTrackingStatus(false); + } fInitManager.AddStation(stationInfo); LOG(info) << "- TRD station " << iSt << " at z = " << stationInfo.GetZdouble() << " cm"; } @@ -590,6 +609,9 @@ InitStatus CbmL1::Init() fscal tofBackPhi = tofInterface->GetStripsStereoAngleBack(iSt); stationInfo.SetFrontBackStripsGeometry(tofFrontPhi, tofBackPhi); stationInfo.SetTrackingStatus(target.z < stationInfo.GetZdouble() ? true : false); + if (fvmDisabledStationIDs[L1DetectorID::kTof].find(iSt) != fvmDisabledStationIDs[L1DetectorID::kTof].cend()) { + stationInfo.SetTrackingStatus(false); + } fInitManager.AddStation(stationInfo); LOG(info) << "- TOF station " << iSt << " at z = " << stationInfo.GetZdouble() << " cm"; } diff --git a/reco/L1/CbmL1.h b/reco/L1/CbmL1.h index c7d8f1de2046f58a9b5f4ec5fcec86c7ec5d9ff8..85608d727df3f472967998948eb93713a2009a6b 100644 --- a/reco/L1/CbmL1.h +++ b/reco/L1/CbmL1.h @@ -202,6 +202,12 @@ public: /// If a particular subsystem is absent, it is not used in tracking. void CheckDetectorPresence(); + /// @brief Disables tracking station for a given detector subsystem + /// @param detID Detector ID + /// @param iSt Index of station in tracking station interface + /// + /// Possible entries of Detector ID are listed in CbmL1DetectorID.h. + void DisableTrackingStation(L1DetectorID detID, int iSt); /// Sets material budget file name for MVD void SetMvdMaterialBudgetFileName(const TString& fileName) @@ -615,6 +621,7 @@ private: std::unordered_map<CbmL1LinkKey, int> fmMCPointsLinksMap = {}; /// Internal MC point index vs. link std::unordered_map<CbmL1LinkKey, int> fmMCTracksLinksMap = {}; /// Internal MC track index vs. link + CbmCaDetIdArr_t<std::set<int>> fvmDisabledStationIDs; /// Array of local indices of disabled tracking stations // ***************************** // ** Tracking performance QA ** diff --git a/reco/L1/CbmL1Performance.cxx b/reco/L1/CbmL1Performance.cxx index 9457caa3db2e1f79546698cbfe6d202b6d377f49..38dca67a4bacdfd37d772efbd6a43d7e4cad051e 100644 --- a/reco/L1/CbmL1Performance.cxx +++ b/reco/L1/CbmL1Performance.cxx @@ -578,6 +578,10 @@ void CbmL1::HistoPerformance() // TODO: check if works correctly. Change vHitFa static TH1F* h_reco_phi; static TH1F* h_notfound_phi; + static TH2F* h2_fst_hit_yz; // occupancy of track first hit in y-z plane + static TH2F* h2_lst_hit_yz; // occupancy of track last hit in y-z plane + static TH2F* h2_all_hit_yz; // occupancy of track all hits in y-z plane + static bool first_call = 1; if (first_call) { @@ -586,6 +590,12 @@ void CbmL1::HistoPerformance() // TODO: check if works correctly. Change vHitFa TDirectory* curdir = gDirectory; gDirectory = fHistoDir; + h2_fst_hit_yz = + new TH2F("h2_fst_hit_yz", "Track first hit occupancy in y-z plane;z [cm];y [cm]", 80, 0, 0, 80, 0, 0); + h2_lst_hit_yz = + new TH2F("h2_lst_hit_yz", "Track last hit occupancy in y-z plane;z[ cm];y [cm]", 80, 0, 0, 80, 0, 0); + h2_all_hit_yz = new TH2F("h2_all_hit_yz", "Track hit occupancy in y-z plane;z[ cm];y [cm]", 80, 0, 0, 80, 0, 0); + p_eff_all_vs_mom = new TProfile("p_eff_all_vs_mom", "AllSet Efficiency vs Momentum", 100, 0.0, 5.0, 0.0, 100.0); p_eff_prim_vs_mom = new TProfile("p_eff_prim_vs_mom", "Primary Set Efficiency vs Momentum", 100, 0.0, 5.0, 0.0, 100.0); @@ -842,8 +852,24 @@ void CbmL1::HistoPerformance() // TODO: check if works correctly. Change vHitFa h_reco_nhits->Fill((prtra->Hits).size()); CbmL1HitDebugInfo& mh = fvHitDebugInfo[prtra->Hits[0]]; h_reco_station->Fill(mh.iStation); + + int iFstHit = prtra->GetFirstHitIndex(); + auto& fstHit = fvHitDebugInfo[iFstHit]; + h2_fst_hit_yz->Fill(fpAlgo->GetParameters()->GetStation(fstHit.iStation).fZ[0], fstHit.GetY()); + + int iLstHit = prtra->GetLastHitIndex(); + auto& lstHit = fvHitDebugInfo[iLstHit]; + h2_lst_hit_yz->Fill(fpAlgo->GetParameters()->GetStation(lstHit.iStation).fZ[0], lstHit.GetY()); + + for (int iH : prtra->Hits) { + const auto& hit = fvHitDebugInfo[iH]; + int y = hit.GetY(); + int z = fpAlgo->GetParameters()->GetStation(hit.iStation).fZ[0]; + h2_all_hit_yz->Fill(z, y); + } } + h_reco_purity->Fill(100 * prtra->GetMaxPurity()); if (prtra->NDF > 0) { diff --git a/reco/L1/CbmL1ReadEvent.cxx b/reco/L1/CbmL1ReadEvent.cxx index f9c68efd9d8f8a31bbadea912dc4ca09f3d49ddf..a87bd4748b8bd3874637031be5310a1013bea397 100644 --- a/reco/L1/CbmL1ReadEvent.cxx +++ b/reco/L1/CbmL1ReadEvent.cxx @@ -243,11 +243,7 @@ int CbmL1::MatchHitWithMc<L1DetectorID::kTrd>(int iHit) const int iPoint = -1; const auto* hitMatch = dynamic_cast<const CbmMatch*>(fpTrdHitMatches->At(iHit)); if (hitMatch) { - int iMC = -1; if (hitMatch->GetNofLinks() > 0) { - iMC = hitMatch->GetLink(0).GetIndex(); - assert(iMC >= 0 && iMC < fNpointsTrd); - int iMc = hitMatch->GetLink(0).GetIndex(); if (iMc < 0) return iPoint; int iIndex = iMc + fNpointsMvdAll + fNpointsStsAll + fNpointsMuchAll; @@ -944,8 +940,8 @@ void CbmL1::ReadEvent(CbmEvent* event) th.Det = 3; int stIdx = fpAlgo->GetParameters()->GetStationIndexActive(h->GetPlaneId(), L1DetectorID::kTrd); - assert(stIdx != -1); - //if (stIdx == -1) continue; + //assert(stIdx != -1); + if (stIdx == -1) continue; // Station was disabled and thus should not be proceede th.iStation = stIdx; diff --git a/reco/L1/L1LinkDef.h b/reco/L1/L1LinkDef.h index 9423ce3d123d2f4c4b222835fa864eb30f542ab6..ad9b390b8c78b25641fe023de28ebe4793ff7447 100644 --- a/reco/L1/L1LinkDef.h +++ b/reco/L1/L1LinkDef.h @@ -35,6 +35,7 @@ #pragma link C++ class CbmCaInputQaTrd + ; #pragma link C++ class CbmCaInputQaTof + ; #pragma link C++ enum cbm::ca::ETrackType; +#pragma link C++ enum L1DetectorID; #pragma link C++ class cbm::ca::OutputQa + ; #pragma link C++ class ca::tools::WindowFinder + ;