14#include <fairlogger/Logger.h>
34 LOG(fatal) <<
"init() was not done yet";
39 while (loadTOFCalibInfo()) {
40 for (
int ihit = 0; ihit < mTOFCalibInfo->size(); ihit++) {
41 addHit((*mTOFCalibInfo)[ihit]);
61 LOG(error) <<
"Initialization was already done";
69 mOutputTree->Branch(mOutputBranchName.data(), &mTOFCalibInfoOut);
70 LOG(info) <<
"Accumulated calib info TOF will be stored in " << mOutputBranchName <<
" branch of tree "
71 << mOutputTree->GetName();
73 LOG(error) <<
"Output tree is not attached, accumulated CalibInfoTOFshort will not be stored";
90 LOG(info) <<
"****** component for calibration of TOF channels ******";
92 LOG(info) <<
"init is not done yet - nothing to print";
96 LOG(info) <<
"**********************************************************************";
100void CollectCalibInfoTOF::attachInputTrees()
104 if (!mTreeTOFCalibInfo) {
105 LOG(fatal) <<
"Input tree with TOF calib infos is not set";
108 if (!mTreeTOFCalibInfo->GetBranch(mTOFCalibInfoBranchName.data())) {
109 LOG(fatal) <<
"Did not find TOF calib info branch " << mTOFCalibInfoBranchName <<
" in the input tree";
111 mTreeTOFCalibInfo->SetBranchAddress(mTOFCalibInfoBranchName.data(), &mTOFCalibInfo);
112 LOG(info) <<
"Attached tracksTOF calib info " << mTOFCalibInfoBranchName <<
" branch with " << mTreeTOFCalibInfo->GetEntries()
115 mCurrTOFInfoTreeEntry = -1;
119bool CollectCalibInfoTOF::loadTOFCalibInfo()
122 printf(
"Loading TOF calib infos: number of entries in tree = %lld\n", mTreeTOFCalibInfo->GetEntries());
124 while (++mCurrTOFInfoTreeEntry < mTreeTOFCalibInfo->GetEntries()) {
125 mTreeTOFCalibInfo->GetEntry(mCurrTOFInfoTreeEntry);
126 LOG(info) <<
"Loading TOF calib info entry " << mCurrTOFInfoTreeEntry <<
" -> " << mTOFCalibInfo->size() <<
" infos";
128 if (!mTOFCalibInfo->size()) {
133 --mCurrTOFInfoTreeEntry;
148 if (calibInfo.
getTimestamp() < mMinTimestamp.GetVal() || mMinTimestamp.GetVal() == -1) {
150 }
else if (calibInfo.
getTimestamp() > mMaxTimestamp.GetVal()) {
155void CollectCalibInfoTOF::fillTree()
161 mTOFCalibInfoOut = &mTOFCollectedCalibInfo[ich];
163 mTOFCollectedCalibInfo[ich].clear();
ClassImp(CollectCalibInfoTOF)
void run()
perform all initializations
static constexpr int MAXNUMBEROFHITS
void init()
set tree/chain containing TOF calib info
static constexpr int NCHANNELS
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"