From 5a3166810022f9d4b51df13ab44e70a35551427d Mon Sep 17 00:00:00 2001 From: Pascal Raisig <praisig@ikf.uni-frankfurt.de> Date: Mon, 19 Jul 2021 12:37:54 +0200 Subject: [PATCH] Minor upgrades mainly to the printout statements --- reco/base/CbmRecoUnpackAlgo.tmpl | 14 +++++++------- reco/base/CbmRecoUnpackConfig.tmpl | 20 +++++++++----------- reco/steer/CbmRecoUnpack.cxx | 6 +++--- 3 files changed, 19 insertions(+), 21 deletions(-) diff --git a/reco/base/CbmRecoUnpackAlgo.tmpl b/reco/base/CbmRecoUnpackAlgo.tmpl index 9e3de1f7cf..639dfd1553 100644 --- a/reco/base/CbmRecoUnpackAlgo.tmpl +++ b/reco/base/CbmRecoUnpackAlgo.tmpl @@ -256,16 +256,16 @@ public: */ void Finish() { - LOG(info) << fName << "::Finish. Unpacked \n " << fNrProcessedTs << " Timeslices with \n " << fNrCreatedRawMsgs - << " Raw Messages,\n " << fNrCreatedDigis << " Digis,\n " << fNrEpochMsgs << " Epoch Messages,\n " - << fNrCreatedInfoMsgs << " Info Messages.\n "; - - LOG(info) << fName << "::Finish. \n Number of CrcValidFlags " << fNrCrcValidFlags - << " \n Number of OverflowFlimFlags " << fNrOverflowFlimFlags << " \n Number of OverflowUserFlags " - << fNrOverflowUserFlags << " \n Number of DataErrorFlags " << fNrDataErrorFlags << "\n"; + LOG(info) << fName << "::Finish.-------------------------\n Unpack process : \n " << fNrProcessedTs + << " Timeslices with \n " << fNrCreatedRawMsgs << " Raw Messages,\n " << fNrCreatedDigis << " Digis,\n " + << fNrEpochMsgs << " Epoch Messages,\n " << fNrCreatedInfoMsgs << " Info Messages.\n " << fNrCrcValidFlags + << " CrcValidFlags \n " << fNrOverflowFlimFlags << " OverflowFlimFlags \n " << fNrOverflowUserFlags + << " OverflowUserFlags \n " << fNrDataErrorFlags << " DataErrorFlags \n "; // Additional explicit finish of the derived class used during runtime. finish(); + + LOG(info) << fName << "::Finish. Done! ------------------\n"; } /** diff --git a/reco/base/CbmRecoUnpackConfig.tmpl b/reco/base/CbmRecoUnpackConfig.tmpl index 4826ba54cc..9f16717fe2 100644 --- a/reco/base/CbmRecoUnpackConfig.tmpl +++ b/reco/base/CbmRecoUnpackConfig.tmpl @@ -153,19 +153,15 @@ public: * @param ioman Pointer to the FairRootManager instance * @param branchname by default TOutput::GetBranchName() is used for the first output. If branchname is not empty that branchname is used. */ - void Init(FairRootManager* ioman, std::string branchname = "") + void Init(FairRootManager* ioman) { + LOG(info) << fName << "::Init() ---------------------------------"; + if (fDoWriteOutput) { - if (branchname.empty()) { - fOutputVec = new std::vector<TOutput>(); - ioman->RegisterAny(TOutput::GetBranchName(), fOutputVec, kTRUE); - LOG(info) << fName << "::registerBranchToTree(" << TOutput::GetBranchName() << ")"; - } - else { - fOutputVec = new std::vector<TOutput>(); - ioman->RegisterAny(branchname.data(), fOutputVec, kTRUE); - LOG(info) << fName << "::registerBranchToTree(" << branchname.data() << ")"; - } + + fOutputVec = new std::vector<TOutput>(); + ioman->RegisterAny(GetOutputBranchName().data(), fOutputVec, kTRUE); + LOG(info) << fName << "::registerBranchToTree(" << GetOutputBranchName().data() << ")"; } /** @todo for the optional outputs it is more complicated to check if they exist. Needs exceptions for the std::nullptr_t. Should be added at some point in time. */ @@ -188,6 +184,8 @@ public: // Set the global system time offset if (fAlgo) fAlgo->SetSystemTimeOffset(fSystemTimeOffset); + + LOG(info) << fName << " succesful initialized -----------------\n"; } /** @brief Prepare the Unpacker algorithm for the run, to be implemented in the derived classes. */ diff --git a/reco/steer/CbmRecoUnpack.cxx b/reco/steer/CbmRecoUnpack.cxx index 162ee19954..68b1e08887 100644 --- a/reco/steer/CbmRecoUnpack.cxx +++ b/reco/steer/CbmRecoUnpack.cxx @@ -57,7 +57,7 @@ Bool_t CbmRecoUnpack::Init() // --- Register the branch for the Timeslice start time fCbmTsEventHeader = new CbmTsEventHeader(); ioman->RegisterAny("TsEventHeader", fCbmTsEventHeader, kTRUE); - LOG(info) << "CbmRecoUnpack::Init() registered CbmTsEventHeader to output tree!"; + LOG(info) << "CbmRecoUnpack::Init() registered CbmTsEventHeader to output tree!\n"; // --- Psd @@ -71,12 +71,12 @@ Bool_t CbmRecoUnpack::Init() // --- Trd if (fTrdConfig) fTrdConfig->Init(ioman); // --- TRD2D - if (fTrdConfig2D->GetOutputBranchName() == CbmTrdDigi::GetBranchName()) { + if (fTrdConfig2D->GetOutputBranchName() == fTrdConfig->GetOutputBranchName()) { fTrdConfig2D->SetOutputVec(fTrdConfig->GetOutputVec()); if (fTrdConfig2D) fTrdConfig2D->InitUnpacker(); } else { - if (fTrdConfig2D) fTrdConfig2D->Init(ioman, fTrdConfig2D->GetOutputBranchName()); + if (fTrdConfig2D) fTrdConfig2D->Init(ioman); } // This is an ugly work around, because the TRD and TRD2D want to access the same vector and there is no function to retrieve a writeable vector<obj> from the FairRootManager, especially before the branches are created, as far as I am aware. The second option workaround is in in Init() to look for the fasp config and create a separate branch for fasp created CbmTrdDigis PR 072021 -- GitLab