From 7e08c3244f6ff47a9366481d971dee60f43b0108 Mon Sep 17 00:00:00 2001 From: Xin Dong Date: Thu, 17 Mar 2022 13:13:03 -0700 Subject: [PATCH] Fix in EmcRawMaker for BEMC data size in StEvent/MuDst (#329) * mSaveAllBTOW switch added for daq->picoDst production configuration enabled in StBFChain.cxx * comment added to the non-persistent variable mSaveAllBTOW Co-authored-by: Xin Dong Co-authored-by: Xin Dong --- StRoot/StBFChain/StBFChain.cxx | 8 +++--- StRoot/StEmcRawMaker/StBemcRaw.cxx | 37 +++++++++++++++----------- StRoot/StEmcRawMaker/StBemcRaw.h | 5 ++++ StRoot/StEmcRawMaker/StEmcRawMaker.cxx | 5 ++++ 4 files changed, 35 insertions(+), 20 deletions(-) diff --git a/StRoot/StBFChain/StBFChain.cxx b/StRoot/StBFChain/StBFChain.cxx index 8ed97cf10d9..ea47f651f46 100644 --- a/StRoot/StBFChain/StBFChain.cxx +++ b/StRoot/StBFChain/StBFChain.cxx @@ -655,11 +655,11 @@ Int_t StBFChain::Instantiate() if ( maker == "StEmcRawMaker" && GetOption("BEmcChkStat")) mk->SetAttr("BEmcCheckStatus",kTRUE); - // - if ( maker == "StEmcRawMaker" && GetOption("picoWrite")) { - mk->SetMode(1); // saveAllStEvent for picoDst + // trigger simu maker + if ( maker == "StEmcRawMaker" && GetOption("picoWrite") ) { + mk->SetMode(10); // picoDst production - save all BTOW hits for triggerSimuMaker } - + // trigger simu maker if ( maker == "StTriggerSimuMaker" && GetOption("picoWrite") ) { mk->SetMode(10); // picoDst production diff --git a/StRoot/StEmcRawMaker/StBemcRaw.cxx b/StRoot/StEmcRawMaker/StBemcRaw.cxx index e3f57b7b174..77c8d1d34e1 100644 --- a/StRoot/StEmcRawMaker/StBemcRaw.cxx +++ b/StRoot/StEmcRawMaker/StBemcRaw.cxx @@ -160,6 +160,7 @@ ClassImp(StBemcRaw) StBemcRaw::StBemcRaw() { mSaveAllStEvent = kFALSE; + mSaveAllBTOW = kFALSE; mPsdMapBug = kFALSE; mPsdMapBug2 = kFALSE; mTowerMapBug = kFALSE; @@ -681,40 +682,44 @@ Int_t StBemcRaw::makeHit(StEmcCollection* emc, Int_t det, Int_t id, Int_t ADC, I if(id+shift < 0) return kZero; //mask lost channels id+=shift; } + + // dongx - save all BTOW hits + Bool_t skipSave = !mSaveAllStEvent && ( !mSaveAllBTOW || det!=BTOW ); + if(CRATE>0 && CRATE<=MAXCRATES && mControlADCtoE->CheckCrate[det-1]==1) if((mCrateStatus[det-1][CRATE-1]!=crateOK && mCrateStatus[det-1][CRATE-1]!=crateUnknown) && - !mSaveAllStEvent) + skipSave) return kCrate; - if(!mSaveAllStEvent && mCrateVeto && mAnyCorrupted) + if(skipSave && mCrateVeto && mAnyCorrupted) return kCrate; - if(ADC==0 && !mSaveAllStEvent) + if(ADC==0 && skipSave) return kZero; if(mControlADCtoE->CheckStatus[det-1]==1) { - if(mCheckStatus[det-1][0]==1 && !mSaveAllStEvent){ + if(mCheckStatus[det-1][0]==1 && skipSave){ Int_t STATUS; mTables->getStatus(det,id,STATUS); - if(STATUS!=STATUS_OK && !mSaveAllStEvent) + if(STATUS!=STATUS_OK && skipSave) return kStatus; } - if(mCheckStatus[det-1][1]==1 && !mSaveAllStEvent){ + if(mCheckStatus[det-1][1]==1 && skipSave){ Int_t pedSTATUS; mTables->getStatus(det,id,pedSTATUS,"pedestal"); - if(pedSTATUS!=STATUS_OK && !mSaveAllStEvent)return kStatus; + if(pedSTATUS!=STATUS_OK && skipSave)return kStatus; } - if(mCheckStatus[det-1][2]==1 && !mSaveAllStEvent){ + if(mCheckStatus[det-1][2]==1 && skipSave){ Int_t calibSTATUS; mTables->getStatus(det,id,calibSTATUS,"calib"); - if(calibSTATUS!=STATUS_OK && !mSaveAllStEvent)return kStatus; + if(calibSTATUS!=STATUS_OK && skipSave)return kStatus; } - if(mCheckStatus[det-1][3]==1 && !mSaveAllStEvent){ + if(mCheckStatus[det-1][3]==1 && skipSave){ Int_t gainSTATUS; mTables->getStatus(det,id,gainSTATUS,"gain"); - if(gainSTATUS!=STATUS_OK && !mSaveAllStEvent)return kStatus; + if(gainSTATUS!=STATUS_OK && skipSave)return kStatus; } } @@ -728,12 +733,12 @@ Int_t StBemcRaw::makeHit(StEmcCollection* emc, Int_t det, Int_t id, Int_t ADC, I // PSD and SMD as valid hits // for 2006 keep these hits by setting DeductPedestal == 2 if(mControlADCtoE->DeductPedestal[det-1]==1) - if(det>=BPRS && !mSaveAllStEvent) + if(det>=BPRS && skipSave) if(CAP==CAP1 || CAP==CAP2) return kPed; } - if(mControlADCtoE->CutOffType[det-1]==1 && !mSaveAllStEvent && mControlADCtoE->DeductPedestal[det-1] > 0) // pedestal cut + if(mControlADCtoE->CutOffType[det-1]==1 && skipSave && mControlADCtoE->DeductPedestal[det-1] > 0) // pedestal cut { if(RMS<=0) return kRms; @@ -755,16 +760,16 @@ Int_t StBemcRaw::makeHit(StEmcCollection* emc, Int_t det, Int_t id, Int_t ADC, I mTables->getGain(det,id,C); E*=C; - if(mControlADCtoE->CutOffType[det-1]==2 && !mSaveAllStEvent) // energy cut + if(mControlADCtoE->CutOffType[det-1]==2 && skipSave) // energy cut { if(ECutOff[det-1]) return kEn; } } - if(mControlADCtoE->OnlyCalibrated[det-1]>0 && E==0 && !mSaveAllStEvent) + if(mControlADCtoE->OnlyCalibrated[det-1]>0 && E==0 && skipSave) return kCalib; - + StDetectorId did = static_cast(det+kBarrelEmcTowerId-1); StEmcDetector* detector=emc->detector(did); StEmcGeom *geo = StEmcGeom::instance(det); diff --git a/StRoot/StEmcRawMaker/StBemcRaw.h b/StRoot/StEmcRawMaker/StBemcRaw.h index f4422fb101e..91acb6dcbe4 100644 --- a/StRoot/StEmcRawMaker/StBemcRaw.h +++ b/StRoot/StEmcRawMaker/StBemcRaw.h @@ -102,6 +102,7 @@ class StBemcRaw : public TObject controlADCtoE_st* mControlADCtoE; Bool_t mSaveAllStEvent; + Bool_t mSaveAllBTOW; //! switch for saving all BTOW hits (used in daq->picoDst production) Bool_t mPsdMapBug; Bool_t mPsdMapBug2; Bool_t mTowerMapBug; @@ -178,6 +179,10 @@ class StBemcRaw : public TObject { mSaveAllStEvent = a; } ///< Set to kTRUE if all hits are to be saved on StEvent + void saveAllBTOW(Bool_t a) + { + mSaveAllBTOW = a; + } ///< Set to kTRUE if all BTOW hits are to be saved on StEvent (for picoDst/triggerSimu) void psdMapBug(Bool_t a) { mPsdMapBug = a; diff --git a/StRoot/StEmcRawMaker/StEmcRawMaker.cxx b/StRoot/StEmcRawMaker/StEmcRawMaker.cxx index 992c1fdc9cf..8c29f9a7650 100644 --- a/StRoot/StEmcRawMaker/StEmcRawMaker.cxx +++ b/StRoot/StEmcRawMaker/StEmcRawMaker.cxx @@ -87,6 +87,11 @@ Int_t StEmcRawMaker::Init() mBemcRaw->saveAllStEvent(kTRUE); mBemcRaw->initQAHisto(); } + if(m_Mode==10) + { + LOG_INFO << "Saveing all BTOW hits for bfc->picoDst production" << endm; + mBemcRaw->saveAllBTOW(kTRUE); + } //................EEMC stuff .............. eeStDb = (StEEmcDb*)this->GetDataSet("StEEmcDb"); if(eeStDb==0)