diff --git a/core/detectors/tof/CbmTofTrackingInterface.h b/core/detectors/tof/CbmTofTrackingInterface.h index 47b0b37eddde8d3bb9affbe003153590e5ac018e..f6370fc7891744aced28093ef731ba2f9f8b8edf 100644 --- a/core/detectors/tof/CbmTofTrackingInterface.h +++ b/core/detectors/tof/CbmTofTrackingInterface.h @@ -19,6 +19,7 @@ #include "CbmTrackingDetectorInterfaceBase.h" #include "FairTask.h" +#include "Logger.h" #include "TMath.h" @@ -102,14 +103,20 @@ public: /// Gets a tracking station by the address of element /// \param address Unique element address /// \return Local index of the tracking station - int GetTrackingStationIndex(int /*address*/) const + int GetTrackingStationIndex(int address) const { - // int iSt = fDigiBdfPar->GetTrackingStation(CbmTofAddress::GetSmType(address), - // CbmTofAddress::GetSmId(address), - // CbmTofAddress::GetRpcId(address)); + LOG(fatal) << "CbmTofTrackingInterface::GetTrackingStationIndex(int address): Unfortunately this function cannot be" + << " currently used. Please, use its overloaded version " + << "CbmTofTrackingInterface::GetTrackingStationIndex(const CbmPixelHit* hit) instead"; + int iSt = fDigiBdfPar->GetTrackingStation(CbmTofAddress::GetSmType(address), CbmTofAddress::GetSmId(address), + CbmTofAddress::GetRpcId(address)); // NOTE: Implement, when the "mcbm_beam_2021_07_surveyed" parameters will be fixed // TODO: Invesitgate problem in mcbm_beam_2021_07_surveyed - return -1; // iSt; + //if (fIfMissingHits) { + // // Recalculate station index for inconsistent hits + // if (hit->GetX() > 20. && hit->GetZ() > 270. && 1 == iSt) { iSt = 2; } + //} + return iSt; } diff --git a/macro/mcbm/mcbm_qa.C b/macro/mcbm/mcbm_qa.C index a6305fc5d35f6d093745a57c323cf20a9414d124..a8d95846eae557a9a50406d6de46bd9887735e93 100644 --- a/macro/mcbm/mcbm_qa.C +++ b/macro/mcbm/mcbm_qa.C @@ -35,7 +35,8 @@ #include <TStopwatch.h> #endif -void mcbm_qa(Int_t nEvents = 0, TString dataset = "data/mcbm_beam_2020_03_test", TString setup = "mcbm_beam_2020_03") +void mcbm_qa(Int_t nEvents = 0, TString dataset = "data/mcbm_beam_2020_03_test", + TString setupName = "mcbm_beam_2020_03") { // ======================================================================== @@ -47,6 +48,8 @@ void mcbm_qa(Int_t nEvents = 0, TString dataset = "data/mcbm_beam_2020_03_test", // ------------------------------------------------------------------------ // ----- Environment -------------------------------------------------- + bool bUseMC = true; // flag: true - MC information is used + int verbose = 6; // verbose level TString myName = "mcbm_qa"; // this macro's name for screen output TString srcDir = gSystem->Getenv("VMCWORKDIR"); // top source directory // ------------------------------------------------------------------------ @@ -60,25 +63,46 @@ void mcbm_qa(Int_t nEvents = 0, TString dataset = "data/mcbm_beam_2020_03_test", // ------------------------------------------------------------------------ // ----- Load the geometry setup ------------------------------------- - std::cout << std::endl; - std::cout << "-I- " << myName << ": Loading setup " << setup << std::endl; - CbmSetup::Instance()->LoadSetup(setup); - // You can modify the pre-defined setup by using - // CbmSetup::Instance()->RemoveModule(ESystemId) or - // CbmSetup::Instance()->SetModule(ESystemId, const char*, Bool_t) or - // CbmSetup::Instance()->SetActive(ESystemId, Bool_t) - // See the class documentation of CbmSetup. + std::cout << '\n'; + TString setupFile = srcDir + "/geometry/setup/setup_" + setupName + ".C"; + TString setupFunct = "setup_"; + setupFunct = setupFunct + setupName + "()"; + std::cout << "-I- " << myName << ": Loading macro " << setupFile << '\n'; + gROOT->LoadMacro(setupFile); + gROOT->ProcessLine(setupFunct); + CbmSetup* setup = CbmSetup::Instance(); + // setup->RemoveModule(ECbmModuleId::kTrd); + // ------------------------------------------------------------------------ + + // ----- Some global switches ----------------------------------------- + if (setupName == "mcbm_beam_2022_05_23_nickel") { setup->RemoveModule(ECbmModuleId::kMuch); } + + //bool eventBased = !sEvBuildRaw.IsNull(); + bool bUseMvd = setup->IsActive(ECbmModuleId::kMvd); + bool bUseSts = setup->IsActive(ECbmModuleId::kSts); + bool bUseRich = setup->IsActive(ECbmModuleId::kRich); + bool bUseMuch = setup->IsActive(ECbmModuleId::kMuch); + bool bUseTrd = setup->IsActive(ECbmModuleId::kTrd); + bool bUseTof = setup->IsActive(ECbmModuleId::kTof); + bool bUsePsd = setup->IsActive(ECbmModuleId::kPsd); + std::cout << " MVD: " << (bUseMvd ? "ON" : "OFF") << '\n'; + std::cout << " STS: " << (bUseSts ? "ON" : "OFF") << '\n'; + std::cout << " RICH: " << (bUseRich ? "ON" : "OFF") << '\n'; + std::cout << " MUCH: " << (bUseMuch ? "ON" : "OFF") << '\n'; + std::cout << " TRD: " << (bUseTrd ? "ON" : "OFF") << '\n'; + std::cout << " TOF: " << (bUseTof ? "ON" : "OFF") << '\n'; + std::cout << " PSD: " << (bUsePsd ? "ON" : "OFF") << '\n'; // ------------------------------------------------------------------------ // ----- Parameter files as input to the runtime database ------------- - std::cout << std::endl; - std::cout << "-I- " << myName << ": Defining paramete files " << std::endl; + std::cout << '\n'; + std::cout << "-I- " << myName << ": Defining paramete files\n"; TList* parFileList = new TList(); TString geoTag; // - MUCH digitisation parameters TString muchParFile {}; - if (CbmSetup::Instance()->GetGeoTag(ECbmModuleId::kMuch, geoTag)) { + if (setup->GetGeoTag(ECbmModuleId::kMuch, geoTag)) { bool mcbmFlag = geoTag.Contains("mcbm", TString::kIgnoreCase); muchParFile = srcDir + "/parameters/much/much_"; muchParFile += (mcbmFlag) ? geoTag : geoTag(0, 4); @@ -92,7 +116,7 @@ void mcbm_qa(Int_t nEvents = 0, TString dataset = "data/mcbm_beam_2020_03_test", } // - TRD digitisation parameters - if (CbmSetup::Instance()->GetGeoTag(ECbmModuleId::kTrd, geoTag)) { + if (setup->GetGeoTag(ECbmModuleId::kTrd, geoTag)) { const Char_t* npar[4] = {"asic", "digi", "gas", "gain"}; TObjString* trdParFile(NULL); for (Int_t i(0); i < 4; i++) { @@ -103,7 +127,7 @@ void mcbm_qa(Int_t nEvents = 0, TString dataset = "data/mcbm_beam_2020_03_test", } // - TOF digitisation parameters - if (CbmSetup::Instance()->GetGeoTag(ECbmModuleId::kTof, geoTag)) { + if (setup->GetGeoTag(ECbmModuleId::kTof, geoTag)) { TObjString* tofBdfFile = new TObjString(srcDir + "/parameters/tof/tof_" + geoTag + ".digibdf.par"); parFileList->Add(tofBdfFile); std::cout << "-I- " << myName << ": Using parameter file " << tofBdfFile->GetString() << std::endl; @@ -146,7 +170,7 @@ void mcbm_qa(Int_t nEvents = 0, TString dataset = "data/mcbm_beam_2020_03_test", // ------------------------------------------------------------------------ // ----- MUCH QA --------------------------------- - if (CbmSetup::Instance()->IsActive(ECbmModuleId::kMuch)) { + if (setup->IsActive(ECbmModuleId::kMuch)) { run->AddTask(new CbmMuchTransportQa()); run->AddTask(new CbmMuchDigitizerQa()); CbmMuchHitFinderQa* muchHitFinderQa = new CbmMuchHitFinderQa(); @@ -155,6 +179,29 @@ void mcbm_qa(Int_t nEvents = 0, TString dataset = "data/mcbm_beam_2020_03_test", } // ------------------------------------------------------------------------ + // ----- CA tracking QA --------------------------------------------------- + // Tracking detector interface initialization + run->AddTask(new CbmTrackingDetectorInterfaceInit()); + + // Kalman Filter (currently needed to access the magnetic filed, to be + // removed soon) + run->AddTask(new CbmKF()); + + // Tracking parameters file is required + TString caParFile = recFile; + caParFile.ReplaceAll(".root", ".L1Parameters.dat"); + + auto* pCaOutputQa = new cbm::ca::OutputQa(verbose, bUseMC); + pCaOutputQa->SetMcbmTrackingMode(); + pCaOutputQa->ReadParameters(caParFile.Data()); + pCaOutputQa->SetUseSts(bUseSts); + //pCaOutputQa->SetUseMuch(bUseMuch); + pCaOutputQa->SetUseTrd(bUseTrd); + pCaOutputQa->SetUseTof(bUseTof); + run->AddTask(pCaOutputQa); + + // ------------------------------------------------------------------------ + // ----- Parameter database -------------------------------------------- std::cout << std::endl << std::endl; std::cout << "-I- " << myName << ": Set runtime DB" << std::endl; diff --git a/macro/mcbm/mcbm_reco_event.C b/macro/mcbm/mcbm_reco_event.C index 18176217b7f7f4316cf5d475e807172a4d07c843..86875f639f932e22ee1e2a994682956e92af20e1 100644 --- a/macro/mcbm/mcbm_reco_event.C +++ b/macro/mcbm/mcbm_reco_event.C @@ -375,7 +375,7 @@ void mcbm_reco_event(Int_t nEvents = 10, TString dataset = "data/test", run->AddTask(kalman); // L1 tracking - auto l1 = (debugWithMC) ? new CbmL1("L1", 1, 3, 0) : new CbmL1(); + auto l1 = (debugWithMC) ? new CbmL1("CA", 5, 3, 4) : new CbmL1("CA", 0, 0, 4); l1->SetMcbmMode(); if (strcmp(setupName, "mcbm_beam_2021_07_surveyed") == 0) l1->SetMissingHits(1); diff --git a/macro/run/run_qa.C b/macro/run/run_qa.C index 296094afc51e063592954152089135073c82a224..aa3b57db2ddc3c08f0f56e41da76fb1af11f4502 100644 --- a/macro/run/run_qa.C +++ b/macro/run/run_qa.C @@ -58,8 +58,8 @@ void run_qa(TString dataTra = "data/sis100_muon_jpsi_test", TString dataRaw = "d // ------------------------------------------------------------------------ // ----- Environment -------------------------------------------------- - bool bUseMC = true; // MC flag: used or not - int verbose = 3; + bool bUseMC = true; // MC flag: used or not + int verbose = 3; // verbose level TString myName = "run_qa"; // this macro's name for screen output TString srcDir = gSystem->Getenv("VMCWORKDIR"); // top source directory // ------------------------------------------------------------------------ diff --git a/macro/run/run_reco.C b/macro/run/run_reco.C index 19a4e638c8d53f6f7bc238f9d15b64c00f8a78cc..d303df579488713d0f62782d35d580834c0a1512 100644 --- a/macro/run/run_reco.C +++ b/macro/run/run_reco.C @@ -382,7 +382,7 @@ void run_reco(TString input = "", Int_t nTimeSlices = -1, Int_t firstTimeSlice = run->AddTask(kalman); // L1 tracking - auto l1 = (debugWithMC) ? new CbmL1("L1", 2, 3, 4) : new CbmL1("L1", 0, 0, 4); + auto l1 = (debugWithMC) ? new CbmL1("CA", 2, 3, 4) : new CbmL1("CA", 0, 0, 4); // L1 configuration file (optional) // At the moment, the YAML configuration file defines different parameters for a sequence of track finder diff --git a/reco/L1/CbmCaMCModule.cxx b/reco/L1/CbmCaMCModule.cxx index 60ac9e5a06f3b2ecb5f49cf7112e4d5b3fb8a880..d636d9bbf4c7ef7ec8e51e2f913659eb49a8ea3c 100644 --- a/reco/L1/CbmCaMCModule.cxx +++ b/reco/L1/CbmCaMCModule.cxx @@ -596,18 +596,11 @@ void CbmCaMCModule::ReadMCPointsForDetector<L1DetectorID::kTof>(CbmMCDataArray* if (pExtPoint->GetTrackID() < 0) { continue; } // Point does not have a track - // Cut on time-slice time - if (!fbLegacyEventMode) { - double pointT = pExtPoint->GetTime() + fpMCEventList->GetEventTime(iEvent, iFile); - double startT = fpTimeSlice->GetStartTime(); - double endT = fpTimeSlice->GetEndTime(); - if ((startT > 0. && pointT < startT) || (endT > 0. && pointT > endT)) { continue; } // does not fit into TS - } - // Select station index for a point double zPos = pExtPoint->GetZ(); float bestDist = 1000.; // arbitrary large length [cm] int iStSelected = -1; // local geometry index of TOF station + for (int iStLocGeo = 0; iStLocGeo < nTofStationsGeo; ++iStLocGeo) { int iStActive = fpParameters->GetStationIndexActive(iStLocGeo, L1DetectorID::kTof); if (iStActive < 0) { continue; } // station is not used in tracking diff --git a/reco/L1/CbmCaMCModule.h b/reco/L1/CbmCaMCModule.h index 61efa6695f364d21096c262bbe5e5d9428cbf075..c5ceef1cabc0a9a26237aac40d5d8817262ec075 100644 --- a/reco/L1/CbmCaMCModule.h +++ b/reco/L1/CbmCaMCModule.h @@ -400,24 +400,25 @@ bool CbmCaMCModule::FillMCPoint(int iExtId, int iEvent, int iFile, ca::tools::MC } } + // Update point time with event time + time += fpMCEventList->GetEventTime(iEvent, iFile); + // ----- Reject MC points falling out of the time slice // STS, MuCh, TRD, TOF if constexpr (DetID != L1DetectorID::kMvd) { - if (!fbLegacyEventMode) { // fpTimeSlice != nullptr - double startT = fpTimeSlice->GetStartTime(); - double endT = fpTimeSlice->GetEndTime(); - double mcGlobT = time + fpMCEventList->GetEventTime(iEvent, iFile); - - if ((startT > 0. && mcGlobT < startT) || (endT > 0. && mcGlobT > endT)) { - LOG(warn) << "CbmCaMCModule: MC point with iExtId = " << iExtId << ", iEvent = " << iEvent - << ", iFile = " << iFile << " and det id " << int(DetID) << " fell out of the TS duration [" << startT - << ", " << endT << "] with measured time = " << mcGlobT << " [ns]"; - return false; - } + double startT = fpTimeSlice->GetStartTime(); + double endT = fpTimeSlice->GetEndTime(); + + if ((startT > 0. && time < startT) || (endT > 0. && time > endT)) { + LOG(warn) << "CbmCaMCModule: MC point with iExtId = " << iExtId << ", iEvent = " << iEvent + << ", iFile = " << iFile << " and det id " << int(DetID) << " fell out of the TS duration [" << startT + << ", " << endT << "] with measured time = " << time << " [ns]"; + return false; } } // ----- Fill MC point + point.SetExternalId(iExtId); point.SetEventId(iEvent); point.SetFileId(iFile); point.SetTime(time); diff --git a/reco/L1/CbmCaTimeSliceReader.cxx b/reco/L1/CbmCaTimeSliceReader.cxx index 63607559f2aee601aadca8a2dc112edc1849e374..64dc3dd247c456ce8eaa9295b6dfac194749227d 100644 --- a/reco/L1/CbmCaTimeSliceReader.cxx +++ b/reco/L1/CbmCaTimeSliceReader.cxx @@ -11,7 +11,10 @@ #include "CbmGlobalTrack.h" #include "CbmKFMath.h" // for CopyTrackParam2TC +#include "CbmMuchTrack.h" #include "CbmStsTrack.h" +#include "CbmTofTrack.h" +#include "CbmTrdTrack.h" #include "FairRootManager.h" #include "Logger.h" @@ -208,8 +211,76 @@ void TimeSliceReader::ReadRecoTracks() break; case ECbmTrackingMode::kMCBM: - LOG(fatal) << "Sorry, mCBM mode has not been implemented yet. Stay tuned :)"; - // TODO: fill Global track here + //LOG(fatal) << "Sorry, mCBM mode has not been implemented yet. Stay tuned :)"; + // Fill tracks from GlobalTrack branch + for (int iT = 0; iT < nTracks; ++iT) { + auto* pInputTrack = static_cast<CbmGlobalTrack*>(fpBrRecoTracks->At(iT)); + auto& track = (*fpvTracks)[iT]; + CbmKFMath::CopyTrackParam2TC(pInputTrack->GetParamFirst(), track.T, track.C); + CbmKFMath::CopyTrackParam2TC(pInputTrack->GetParamLast(), track.TLast, track.CLast); + track.chi2 = pInputTrack->GetChi2(); + track.NDF = pInputTrack->GetNDF(); + + // ** Fill information from local tracks ** + // STS tracks (+ MVD) + if (fbUseSts) { + int iStsTrkId = pInputTrack->GetStsTrackIndex(); + if (iStsTrkId > -1) { + auto* pStsTrack = static_cast<CbmStsTrack*>(fpBrStsTracks->At(iStsTrkId)); + if (fbUseMvd) { + for (int iH = 0; iH < pStsTrack->GetNofMvdHits(); ++iH) { + int iHext = pStsTrack->GetMvdHitIndex(iH); + int iHint = vHitMvdIds[iHext]; + track.Hits.push_back(iHint); + } + } + for (int iH = 0; iH < pStsTrack->GetNofStsHits(); ++iH) { + int iHext = pStsTrack->GetStsHitIndex(iH); + int iHint = vHitStsIds[iHext]; + track.Hits.push_back(iHint); + } + } + } + + // MUCH tracks + if (fbUseMuch) { + int iMuchTrkId = pInputTrack->GetMuchTrackIndex(); + if (iMuchTrkId > -1) { + auto* pMuchTrack = static_cast<CbmMuchTrack*>(fpBrMuchTracks->At(iMuchTrkId)); + for (int iH = 0; iH < pMuchTrack->GetNofHits(); ++iH) { + int iHext = pMuchTrack->GetHitIndex(iH); + int iHint = vHitMuchIds[iHext]; + track.Hits.push_back(iHint); + } + } + } + + // TRD tracks + if (fbUseTrd) { + int iTrdTrkId = pInputTrack->GetTrdTrackIndex(); + if (iTrdTrkId > -1) { + const auto* pTrdTrack = static_cast<const CbmTrdTrack*>(fpBrTrdTracks->At(iTrdTrkId)); + for (int iH = 0; iH < pTrdTrack->GetNofHits(); ++iH) { + int iHext = pTrdTrack->GetHitIndex(iH); + int iHint = vHitTrdIds[iHext]; + track.Hits.push_back(iHint); + } // iH + } + } + + // TOF tracks + if (fbUseTof) { + int iTofTrkId = pInputTrack->GetTofTrackIndex(); + if (iTofTrkId > -1) { + const auto* pTofTrack = static_cast<const CbmTofTrack*>(fpBrTofTracks->At(iTofTrkId)); + for (int iH = 0; iH < pTofTrack->GetNofHits(); ++iH) { + int iHext = pTofTrack->GetHitIndex(iH); + int iHint = vHitTofIds[iHext]; + track.Hits.push_back(iHint); + } // iH + } // if iTofTrkId > -1 + } // if fbUseTof + } // iT break; } } diff --git a/reco/L1/CbmCaTimeSliceReader.h b/reco/L1/CbmCaTimeSliceReader.h index ac4ffa17b7d3741c849e48fbe3e559ccdc7409ef..32668cab1fafe43c966e0480684b24916a070b1c 100644 --- a/reco/L1/CbmCaTimeSliceReader.h +++ b/reco/L1/CbmCaTimeSliceReader.h @@ -301,12 +301,15 @@ int cbm::ca::TimeSliceReader::ReadHitsForDetector(const TClonesArray* pBrHits) } else if constexpr (L1DetectorID::kTof == DetID) { CbmTofHit* pTofHit = static_cast<CbmTofHit*>(pBrHits->At(iHext)); - iStGeom = fpTofInterface->GetTrackingStationIndex(pTofHit->GetAddress()); - phiF = fpTofInterface->GetStripsStereoAngleFront(iStGeom); - phiB = fpTofInterface->GetStripsStereoAngleBack(iStGeom); - pPixelHit = static_cast<CbmPixelHit*>(pTofHit); - hitRecord.fDu = pTofHit->GetDx(); - hitRecord.fDv = pTofHit->GetDy(); + // NOTE: In TOF we can take station index only from hit, because the function needs information on x and z + // of the hit in case of "beam_mcbm_2021_07_surveyed" (missingHits flag = true). + // TODO: Investigate this case or apply the hack to the TOF level + iStGeom = fpTofInterface->GetTrackingStationIndex(pTofHit); + phiF = fpTofInterface->GetStripsStereoAngleFront(iStGeom); + phiB = fpTofInterface->GetStripsStereoAngleBack(iStGeom); + pPixelHit = static_cast<CbmPixelHit*>(pTofHit); + hitRecord.fDu = pTofHit->GetDx(); + hitRecord.fDv = pTofHit->GetDy(); // *** Additional cuts for TOF *** // Skip T0 hits diff --git a/reco/L1/CbmL1.cxx b/reco/L1/CbmL1.cxx index 0804bbf7a39a2f7a1d6c4b4563cd9c6178bed626..54cb749c5daa14ae9b523bc12241a0427252ee5b 100644 --- a/reco/L1/CbmL1.cxx +++ b/reco/L1/CbmL1.cxx @@ -1010,6 +1010,8 @@ void CbmL1::Reconstruct(CbmEvent* event) // output performance if (fPerformance) { if (fVerbose > 1) { LOG(info) << "Performance..."; } + + TrackMatch(); EfficienciesPerformance(); HistoPerformance(); diff --git a/reco/L1/CbmL1Hit.h b/reco/L1/CbmL1Hit.h index e6a2901336dcffbfa966871024a64038db7291e7..3c5c66caf91ebd9da4569273dbe1f7e2a9ec3d99 100644 --- a/reco/L1/CbmL1Hit.h +++ b/reco/L1/CbmL1Hit.h @@ -1,6 +1,6 @@ -/* Copyright (C) 2010-2021 Frankfurt Institute for Advanced Studies, Goethe-Universität Frankfurt, Frankfurt +/* Copyright (C) 2010-2023 Frankfurt Institute for Advanced Studies, Goethe-Universität Frankfurt, Frankfurt SPDX-License-Identifier: GPL-3.0-only - Authors: Igor Kulakov [committer], Valentina Akishina, Maksym Zyzak */ + Authors: Igor Kulakov [committer], Valentina Akishina, Maksym Zyzak, Sergei Zharko */ #ifndef _CbmL1Hit_h_ #define _CbmL1Hit_h_ @@ -85,7 +85,7 @@ public: /// @brief String representation of the object /// @param verbose Verbosity level /// @param header If true, header will be printed - std::string ToString(int verbose = 10, bool header = false) const + std::string ToString(int verbose = 0, bool header = false) const { using std::setfill; using std::setw; @@ -94,24 +94,32 @@ public: msg << setw(8) << setfill(' ') << "ext. ID" << ' '; msg << setw(8) << setfill(' ') << "int. ID" << ' '; msg << setw(8) << setfill(' ') << "st. ID" << ' '; - msg << setw(12) << setfill(' ') << "x [cm]" << ' '; - msg << setw(12) << setfill(' ') << "y [cm]" << ' '; - msg << setw(12) << setfill(' ') << "time [ns]" << ' '; msg << setw(8) << setfill(' ') << "Det. ID" << ' '; + msg << setw(8) << setfill(' ') << "MC p. ID" << ' '; + msg << setw(14) << setfill(' ') << "x [cm]" << ' '; + msg << setw(14) << setfill(' ') << "y [cm]" << ' '; + msg << setw(14) << setfill(' ') << "time [ns]" << ' '; + if (verbose > 0) { + msg << setw(14) << setfill(' ') << "dx [cm]" << ' '; + msg << setw(14) << setfill(' ') << "dy [cm]" << ' '; + msg << setw(14) << setfill(' ') << "dxy [cm]" << ' '; + msg << setw(14) << setfill(' ') << "dt [ns]" << ' '; + } } else { msg << setw(8) << setfill(' ') << ExtIndex << ' '; msg << setw(8) << setfill(' ') << IntIndex << ' '; msg << setw(8) << setfill(' ') << iStation << ' '; - msg << setw(12) << setfill(' ') << x << ' '; - msg << setw(12) << setfill(' ') << y << ' '; - msg << setw(12) << setfill(' ') << time << ' '; msg << setw(8) << setfill(' ') << Det << ' '; + msg << setw(8) << setfill(' ') << GetMCPointIndex() << ' '; + msg << setw(14) << setfill(' ') << x << ' '; + msg << setw(14) << setfill(' ') << y << ' '; + msg << setw(14) << setfill(' ') << time << ' '; if (verbose > 0) { - msg << "\n\tMC point indexes: "; - for (int iP : mcPointIds) { - msg << iP << ' '; - } + msg << setw(14) << setfill(' ') << dx << ' '; + msg << setw(14) << setfill(' ') << dy << ' '; + msg << setw(14) << setfill(' ') << dxy << ' '; + msg << setw(14) << setfill(' ') << dt << ' '; } } return msg.str(); diff --git a/reco/L1/CbmL1MCPoint.h b/reco/L1/CbmL1MCPoint.h index 6cab8ceb58ea1c6448433fd29c8a32846f46c3ac..3760a0a4e0fa87fee80287068e9059d3b8775a97 100644 --- a/reco/L1/CbmL1MCPoint.h +++ b/reco/L1/CbmL1MCPoint.h @@ -73,7 +73,7 @@ struct CbmL1MCPoint { L1Vector<int> hitIds {"CbmL1MCPoint::hitIds"}; // indices of CbmL1Hits in L1->vStsHits array /// Temporary log function for debugging - std::string ToString(int verbose, bool printHeader = false) const + std::string ToString(int verbose = 3, bool printHeader = false) const { if (verbose < 1) { return std::string(); } diff --git a/reco/L1/catools/CaToolsMCData.cxx b/reco/L1/catools/CaToolsMCData.cxx index 5a38d5b3354164dee76c7ad2c81fc6bd4fd49de6..d4b8cdf36c0e203c8baca9ce98570b0fd2ccbc4c 100644 --- a/reco/L1/catools/CaToolsMCData.cxx +++ b/reco/L1/catools/CaToolsMCData.cxx @@ -123,16 +123,17 @@ std::string MCData::ToString(int verbose) const if (verbose > 1) { using std::setfill; using std::setw; - constexpr int kNofTracksToPrint = 40; - constexpr int kNofPointsToPrint = 40; - msg << "\n Track sample (first " << kNofTracksToPrint << " tracks):"; + constexpr int kMaxLines = 100; + int nTracks = std::min(kMaxLines, GetNofTracks()); + int nPoints = std::min(kMaxLines, GetNofPoints()); + msg << "\n Track sample (first " << nTracks << " tracks):"; msg << '\n' << setw(10) << setfill(' ') << fvTracks[0].ToString(verbose, true); // header of the table - for (int i = 0; i < kNofTracksToPrint; ++i) { + for (int i = 0; i < nTracks; ++i) { msg << '\n' << setw(10) << setfill(' ') << fvTracks[i].ToString(verbose); } - msg << "\n Point sample (first " << kNofPointsToPrint << " points):"; + msg << "\n Point sample (first " << nPoints << " points):"; msg << '\n' << setw(10) << setfill(' ') << fvPoints[0].ToString(verbose, true); // header of the table - for (int i = 0; i < kNofPointsToPrint; ++i) { + for (int i = 0; i < nPoints; ++i) { msg << '\n' << setw(10) << setfill(' ') << fvPoints[i].ToString(verbose); } }