Skip to content

Commit

Permalink
Fix in EmcRawMaker for BEMC data size in StEvent/MuDst (star-bnl#329)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
Co-authored-by: Xin Dong <[email protected]>
  • Loading branch information
3 people authored Mar 17, 2022
1 parent 2cb20da commit 7e08c32
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 20 deletions.
8 changes: 4 additions & 4 deletions StRoot/StBFChain/StBFChain.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
37 changes: 21 additions & 16 deletions StRoot/StEmcRawMaker/StBemcRaw.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ ClassImp(StBemcRaw)
StBemcRaw::StBemcRaw()
{
mSaveAllStEvent = kFALSE;
mSaveAllBTOW = kFALSE;
mPsdMapBug = kFALSE;
mPsdMapBug2 = kFALSE;
mTowerMapBug = kFALSE;
Expand Down Expand Up @@ -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;
}

}
Expand All @@ -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;
Expand All @@ -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(E<mControlADCtoE->CutOff[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<StDetectorId>(det+kBarrelEmcTowerId-1);
StEmcDetector* detector=emc->detector(did);
StEmcGeom *geo = StEmcGeom::instance(det);
Expand Down
5 changes: 5 additions & 0 deletions StRoot/StEmcRawMaker/StBemcRaw.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
5 changes: 5 additions & 0 deletions StRoot/StEmcRawMaker/StEmcRawMaker.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 7e08c32

Please sign in to comment.