diff --git a/core/detectors/sts/CbmMcbm2018StsPar.cxx b/core/detectors/sts/CbmMcbm2018StsPar.cxx index 52715e5b430dfaaf07c1ed6403712211a4069914..9bd94c1efcdbf8c41bc4b50d4a890495b8c5d76d 100644 --- a/core/detectors/sts/CbmMcbm2018StsPar.cxx +++ b/core/detectors/sts/CbmMcbm2018StsPar.cxx @@ -33,6 +33,7 @@ CbmMcbm2018StsPar::CbmMcbm2018StsPar(const char* name, const char* title, const , fuNrOfDpbs(0) , fiDbpIdArray() , fiCrobActiveFlag() + , fiFebPulserFlag() , fiFebModuleIdx() , fiFebModuleSide() , fdFebAdcGain() @@ -73,6 +74,7 @@ void CbmMcbm2018StsPar::putParams(FairParamList* l) l->add("DbpIdArray", fiDbpIdArray); l->add("CrobActiveFlag", fiCrobActiveFlag); + l->add("FebPulserFlag", fiFebPulserFlag); l->add("FebModuleIdx", fiFebModuleIdx); l->add("FebModuleSide", fiFebModuleSide); l->add("FebAdcGain", fdFebAdcGain); @@ -107,12 +109,14 @@ Bool_t CbmMcbm2018StsPar::getParams(FairParamList* l) fiCrobActiveFlag.Set(fuNrOfDpbs * kuNbCrobsPerDpb); if (!l->fill("CrobActiveFlag", &fiCrobActiveFlag)) return kFALSE; + fiFebPulserFlag.Set(fuNrOfDpbs * kuNbCrobsPerDpb * kuNbFebsPerCrob); fiFebModuleIdx.Set(fuNrOfDpbs * kuNbCrobsPerDpb * kuNbFebsPerCrob); fiFebModuleSide.Set(fuNrOfDpbs * kuNbCrobsPerDpb * kuNbFebsPerCrob); fdFebAdcGain.Set(fuNrOfDpbs * kuNbCrobsPerDpb * kuNbFebsPerCrob); fdFebAdcBase.Set(fuNrOfDpbs * kuNbCrobsPerDpb * kuNbFebsPerCrob); fdFebAdcThrGain.Set(fuNrOfDpbs * kuNbCrobsPerDpb * kuNbFebsPerCrob); fiFebAdcThrOffs.Set(fuNrOfDpbs * kuNbCrobsPerDpb * kuNbFebsPerCrob); + if (!l->fill("FebPulserFlag", &fiFebPulserFlag)) return kFALSE; if (!l->fill("FebModuleIdx", &fiFebModuleIdx)) return kFALSE; if (!l->fill("FebModuleSide", &fiFebModuleSide)) return kFALSE; if (!l->fill("FebAdcGain", &fdFebAdcGain)) return kFALSE; @@ -228,7 +232,6 @@ Bool_t CbmMcbm2018StsPar::IsCrobActive(UInt_t uDpbIdx, UInt_t uCrobIdx) } Bool_t CbmMcbm2018StsPar::IsFebActive(UInt_t uFebInSystIdx) { - if (uFebInSystIdx < GetNrOfFebs()) { return (-1 == fiFebModuleIdx[uFebInSystIdx] ? kFALSE : kTRUE); } // if( uFebInSystIdx < GetNrOfFebs() ) @@ -264,6 +267,43 @@ Bool_t CbmMcbm2018StsPar::IsFebActive(UInt_t uDpbIdx, UInt_t uCrobIdx, UInt_t uF return kFALSE; } // else of if( uDpbIdx < fuNrOfDpbs ) } +Bool_t CbmMcbm2018StsPar::IsFebPulser(UInt_t uFebInSystIdx) +{ + if (uFebInSystIdx < GetNrOfFebs()) { + return (fiFebPulserFlag[uFebInSystIdx] ? kTRUE : kFALSE); + } // if( uFebInSystIdx < GetNrOfFebs() ) + else { + LOG(warning) << "CbmMcbm2018StsPar::IsFebPulser => Feb Index out of bound, " + << "returning default standard FEB!"; + return kFALSE; + } // else of if( uFebInSystIdx < GetNrOfFebs() ) +} +Bool_t CbmMcbm2018StsPar::IsFebPulser(UInt_t uDpbIdx, UInt_t uCrobIdx, UInt_t uFebIdx) +{ + if (uDpbIdx < fuNrOfDpbs) { + if (uCrobIdx < kuNbCrobsPerDpb) { + if (uFebIdx < kuNbFebsPerCrob) { + UInt_t uIdx = (uDpbIdx * kuNbCrobsPerDpb + uCrobIdx) * kuNbFebsPerCrob + uFebIdx; + return IsFebPulser(uIdx); + } // if( uFebIdx < kuNbFebsPerCrob ) + else { + LOG(warning) << "CbmMcbm2018StsPar::IsFebPulser => Feb Index out of bound, " + << "returning default standard FEB!"; + return kFALSE; + } // else of if( uFebIdx < kuNbCrobsPerDpb ) + } // if( uCrobIdx < kuNbCrobsPerDpb ) + else { + LOG(warning) << "CbmMcbm2018StsPar::IsFebPulser => Crob Index out of bound, " + << "returning default standard FEB!"; + return kFALSE; + } // else of if( uCrobIdx < kuNbCrobsPerDpb ) + } // if( uDpbIdx < fuNrOfDpbs ) + else { + LOG(warning) << "CbmMcbm2018StsPar::IsFebPulser => Dpb Index out of bound, " + << "returning default standard FEB!"; + return kFALSE; + } // else of if( uDpbIdx < fuNrOfDpbs ) +} Int_t CbmMcbm2018StsPar::GetFebModuleIdx(UInt_t uDpbIdx, UInt_t uCrobIdx, UInt_t uFebIdx) { if (uDpbIdx < fuNrOfDpbs) { diff --git a/core/detectors/sts/CbmMcbm2018StsPar.h b/core/detectors/sts/CbmMcbm2018StsPar.h index 3431e8f107aaf55a20c1edb0a7170ccd214f9550..95f1d80f7756525bf1e012ae4c0779dc25032426 100644 --- a/core/detectors/sts/CbmMcbm2018StsPar.h +++ b/core/detectors/sts/CbmMcbm2018StsPar.h @@ -82,6 +82,8 @@ public: Bool_t IsCrobActive(UInt_t uDpbIdx, UInt_t uCrobIdx); Bool_t IsFebActive(UInt_t uFebInSystIdx); Bool_t IsFebActive(UInt_t uDpbIdx, UInt_t uCrobIdx, UInt_t uFebIdx); + Bool_t IsFebPulser(UInt_t uFebInSystIdx); + Bool_t IsFebPulser(UInt_t uDpbIdx, UInt_t uCrobIdx, UInt_t uFebIdx); Int_t GetFebModuleIdx(UInt_t uDpbIdx, UInt_t uCrobIdx, UInt_t uFebIdx); Int_t GetFebModuleSide(UInt_t uDpbIdx, UInt_t uCrobIdx, UInt_t uFebIdx); Double_t GetFebAdcGain(UInt_t uDpbIdx, UInt_t uCrobIdx, UInt_t uFebIdx); @@ -138,6 +140,8 @@ private: UInt_t fuNrOfDpbs; // Total number of STS DPBs in system TArrayI fiDbpIdArray; // Array to hold the unique IDs (equipment ID) for all STS DPBs TArrayI fiCrobActiveFlag; // Array to hold the active flag for all CROBs, [ NbDpb * kuNbCrobPerDpb ] + TArrayI + fiFebPulserFlag; // Array to hold the pulser flag for all FEBs, [ NbDpb * kuNbCrobPerDpb * kuNbFebsPerCrob ], 1 if pulser, 0 if standard TArrayI fiFebModuleIdx; // Index of the STS module for each FEB, [ NbDpb * kuNbCrobPerDpb * kuNbFebsPerCrob ], -1 if inactive TArrayI @@ -148,6 +152,6 @@ private: TArrayI fiFebAdcThrOffs; // Thr. offset in Units vs Cal. Thr. for each FEB, [ NbDpb * kuNbCrobPerDpb * kuNbFebsPerCrob ] - ClassDef(CbmMcbm2018StsPar, 1); + ClassDef(CbmMcbm2018StsPar, 2); }; #endif // CBMMCBM2018STSPAR_H diff --git a/fles/mcbm2018/unpacker/CbmMcbm2018UnpackerAlgoSts.cxx b/fles/mcbm2018/unpacker/CbmMcbm2018UnpackerAlgoSts.cxx index 25337de2f164a4d819baf5691778e2675d6548ac..9f243a7873aa14db9c665942289b95e61d793d37 100644 --- a/fles/mcbm2018/unpacker/CbmMcbm2018UnpackerAlgoSts.cxx +++ b/fles/mcbm2018/unpacker/CbmMcbm2018UnpackerAlgoSts.cxx @@ -198,6 +198,8 @@ Bool_t CbmMcbm2018UnpackerAlgoSts::InitParameters() for (UInt_t uFebIdx = 0; uFebIdx < fUnpackPar->GetNbFebsPerCrob(); ++uFebIdx) { fviFebModuleIdx[uDpb][uCrobIdx][uFebIdx] = fUnpackPar->GetFebModuleIdx(uDpb, uCrobIdx, uFebIdx); fviFebModuleSide[uDpb][uCrobIdx][uFebIdx] = fUnpackPar->GetFebModuleSide(uDpb, uCrobIdx, uFebIdx); + + fvbFebPulser.push_back(fUnpackPar->IsFebPulser(uDpb, uCrobIdx, uFebIdx)); fvdFebAdcGain.push_back(fUnpackPar->GetFebAdcGain(uDpb, uCrobIdx, uFebIdx)); fvdFebAdcOffs.push_back(fUnpackPar->GetFebAdcOffset(uDpb, uCrobIdx, uFebIdx)); @@ -407,7 +409,14 @@ Bool_t CbmMcbm2018UnpackerAlgoSts::ProcessTs(const fles::Timeslice& ts) fviFebSide[uFebIdx]); } // if( 0 == fviFebAddress[ uFebIdx ] || -1 == fviFebSide[ uFebIdx ] ) - fDigiVect.emplace_back(fviFebAddress[uFebIdx], uChanInMod, ulTimeInNs, dCalAdc); + + /// Catch the pulser digis and either save them to their own output or drop them + if (fbPulserOutput && fvbFebPulser[uFebIdx]) { + fPulserDigiVect.emplace_back(CbmStsDigi(fviFebAddress[uFebIdx], uChanInMod, ulTimeInNs, dCalAdc)); + } // if (fvbFebPulser[uFebIdx]) + else { + fDigiVect.emplace_back(fviFebAddress[uFebIdx], uChanInMod, ulTimeInNs, dCalAdc); + } // else of if (fvbFebPulser[uFebIdx]) } // for( auto itHitIn = fvmHitsInMs.begin(); itHitIn < fvmHitsInMs.end(); ++itHitIn ) /// Clear the buffer of hits @@ -427,6 +436,12 @@ Bool_t CbmMcbm2018UnpackerAlgoSts::ProcessTs(const fles::Timeslice& ts) std::sort(fDigiVect.begin(), fDigiVect.end(), [](const CbmStsDigi& a, const CbmStsDigi& b) -> bool { return a.GetTime() < b.GetTime(); }); + /// Sort the buffers of pulser hits due to the time offsets applied + if (fbPulserOutput) { + std::sort(fPulserDigiVect.begin(), fPulserDigiVect.end(), + [](const CbmStsDigi& a, const CbmStsDigi& b) -> bool { return a.GetTime() < b.GetTime(); }); + } + /// Fill plots if in monitor mode if (fbMonitorMode) { if (kFALSE == FillHistograms()) { @@ -1216,6 +1231,11 @@ Bool_t CbmMcbm2018UnpackerAlgoSts::FillHistograms() for (auto itHit = fDigiVect.begin(); itHit != fDigiVect.end(); ++itHit) { fhDigisTimeInRun->Fill(itHit->GetTime() * 1e-9); } // for( auto itHit = fDigiVect.begin(); itHit != fDigiVect.end(); ++itHit) + if (fbPulserOutput) { + for (auto itHit = fPulserDigiVect.begin(); itHit != fPulserDigiVect.end(); ++itHit) { + fhDigisTimeInRun->Fill(itHit->GetTime() * 1e-9); + } // for( auto itHit = fPulserDigiVect.begin(); itHit != fPulserDigiVect.end(); ++itHit) + } return kTRUE; } Bool_t CbmMcbm2018UnpackerAlgoSts::ResetHistograms() diff --git a/fles/mcbm2018/unpacker/CbmMcbm2018UnpackerAlgoSts.h b/fles/mcbm2018/unpacker/CbmMcbm2018UnpackerAlgoSts.h index 4ec67a4c3775db201dfaefad525b30cb94e85d91..6c18a704b8e0b492fb4bc67963186f107de93836 100644 --- a/fles/mcbm2018/unpacker/CbmMcbm2018UnpackerAlgoSts.h +++ b/fles/mcbm2018/unpacker/CbmMcbm2018UnpackerAlgoSts.h @@ -54,6 +54,9 @@ public: Bool_t InitParameters(); + std::vector<CbmStsDigi>& GetPulserVector() { return fPulserDigiVect; } + void ClearPulserVector() { fPulserDigiVect.clear(); } + Bool_t ProcessTs(const fles::Timeslice& ts); Bool_t ProcessTs(const fles::Timeslice& ts, size_t /*component*/) { return ProcessTs(ts); } Bool_t ProcessMs(const fles::Timeslice& ts, size_t uMsCompIdx, size_t uMsIdx); @@ -75,6 +78,8 @@ public: inline void SetVectCapInc(Double_t dIncFact) { fdCapacityIncFactor = dIncFact; } + void SeparatePulserOutput(Bool_t bFlagIn) { fbPulserOutput = bFlagIn; } + private: /// Control flags Bool_t fbMonitorMode; //! Switch ON the filling of a minimal set of histograms @@ -82,6 +87,7 @@ private: std::vector<Bool_t> fvbMaskedComponents; /// => Quick and dirty hack for binning FW!!! Bool_t fbBinningFw = kFALSE; + Bool_t fbPulserOutput = kTRUE; //! If ON a separate output vector of digi is used for the pulser /// Settings from parameter file CbmMcbm2018StsPar* fUnpackPar; //! @@ -102,6 +108,7 @@ private: fviFebModuleSide; //! STS module side for each FEB, [ NbDpb ][ NbCrobPerDpb ][ NbFebsPerCrob ], 0 = P, 1 = N, -1 if inactive std::vector<std::vector<std::vector<Int_t>>> fviFebType; //! FEB type, [ NbDpb ][ NbCrobPerDpb ][ NbFebsPerCrob ], 0 = A, 1 = B, -1 if inactive + std::vector<bool> fvbFebPulser = {}; //! Pulser flag for each FEB, [ NbDpb * NbCrobPerDpb * NbFebsPerCrob ] std::vector<Int_t> fviFebAddress; //! STS address for each FEB, [ NbDpb * NbCrobPerDpb * NbFebsPerCrob ] std::vector<Int_t> fviFebSide; //! Module side for each FEB, [ NbDpb * NbCrobPerDpb * NbFebsPerCrob ] std::vector<Double_t> fvdFebAdcGain; //! ADC gain in e-/b, [ NbDpb * NbCrobPerDpb * NbFebsPerCrob ] @@ -146,6 +153,9 @@ private: std::vector<stsxyter::FinalHit> fvmHitsInMs; //! All hits (time in bins, ADC in bins, asic, channel) in last MS, sorted with "<" operator + /// Pulser Digis output, needed as STS reco does not accept Digis without a valid STS address + std::vector<CbmStsDigi> fPulserDigiVect = {}; + /// Duplicate hits suppression static const UInt_t kuMaxTsMsbDiffDuplicates = 8; std::vector<std::vector<UShort_t>> fvvusLastTsChan; //! TS of last hit message for each channel, [ AsicIdx ][ Chan ] diff --git a/fles/mcbm2018/unpacker/CbmMcbm2018UnpackerTaskSts.cxx b/fles/mcbm2018/unpacker/CbmMcbm2018UnpackerTaskSts.cxx index 72efd6eb9db73b2a4b9ba6743af3d2c85ec81920..bcb7e7ea9bbdc4fe279e0a08d5b5be631de5189a 100644 --- a/fles/mcbm2018/unpacker/CbmMcbm2018UnpackerTaskSts.cxx +++ b/fles/mcbm2018/unpacker/CbmMcbm2018UnpackerTaskSts.cxx @@ -67,6 +67,12 @@ Bool_t CbmMcbm2018UnpackerTaskSts::Init() fpvDigiSts = &(fUnpackerAlgo->GetVector()); ioman->RegisterAny("StsDigi", fpvDigiSts, fbWriteOutput); + if (fbPulserOutput) { + /// Get address of pulser vector from algo + fpvPulserDigiSts = &(fUnpackerAlgo->GetPulserVector()); + ioman->RegisterAny("StsDigiPulser", fpvPulserDigiSts, fbWriteOutput); + } + /// Get address of error vector from algo fpvErrorSts = &(fUnpackerAlgo->GetErrorVector()); ioman->RegisterAny("CbmStsError", fpvErrorSts, fbWriteOutput); @@ -194,6 +200,7 @@ void CbmMcbm2018UnpackerTaskSts::Reset() { fUnpackerAlgo->ClearVector(); fUnpackerAlgo->ClearErrorVector(); + if (fbPulserOutput) { fUnpackerAlgo->ClearPulserVector(); } } void CbmMcbm2018UnpackerTaskSts::Finish() @@ -252,5 +259,10 @@ void CbmMcbm2018UnpackerTaskSts::SetAdcCut(UInt_t uAdc) { fUnpackerAlgo->SetAdcC void CbmMcbm2018UnpackerTaskSts::SetBinningFwFlag(Bool_t bEnable) { fUnpackerAlgo->SetBinningFwFlag(bEnable); } +void CbmMcbm2018UnpackerTaskSts::SeparatePulserOutput(Bool_t bFlagIn) +{ + fbPulserOutput = bFlagIn; + fUnpackerAlgo->SeparatePulserOutput(fbPulserOutput); +} ClassImp(CbmMcbm2018UnpackerTaskSts) diff --git a/fles/mcbm2018/unpacker/CbmMcbm2018UnpackerTaskSts.h b/fles/mcbm2018/unpacker/CbmMcbm2018UnpackerTaskSts.h index c30216d95f0dcd65c674806b0bd68481646c281b..175f68f9edaf6e504af617fc79bcdd2990fb557d 100644 --- a/fles/mcbm2018/unpacker/CbmMcbm2018UnpackerTaskSts.h +++ b/fles/mcbm2018/unpacker/CbmMcbm2018UnpackerTaskSts.h @@ -65,12 +65,14 @@ public: /// Task settings void SetWriteOutputFlag(Bool_t bFlagIn) { fbWriteOutput = bFlagIn; } + void SeparatePulserOutput(Bool_t bFlagIn); private: /// Control flags - Bool_t fbMonitorMode; //! Switch ON the filling of a minimal set of histograms - Bool_t fbDebugMonitorMode; //! Switch ON the filling of a additional set of histograms - Bool_t fbWriteOutput; //! If ON the output TClonesArray of digi is written to disk + Bool_t fbMonitorMode; //! Switch ON the filling of a minimal set of histograms + Bool_t fbDebugMonitorMode; //! Switch ON the filling of a additional set of histograms + Bool_t fbWriteOutput; //! If ON the output TClonesArray of digi is written to disk + Bool_t fbPulserOutput = kTRUE; //! If ON a separate output vector of digi is used for the pulser /// Temporary storage of user parameters std::vector<FebChanMask> fvChanMasks; @@ -80,6 +82,7 @@ private: /// Output vectors std::vector<CbmStsDigi>* fpvDigiSts = nullptr; + std::vector<CbmStsDigi>* fpvPulserDigiSts = nullptr; std::vector<CbmErrorMessage>* fpvErrorSts = nullptr; /// Processing algo diff --git a/macro/beamtime/mcbm2019/CMakeLists.txt b/macro/beamtime/mcbm2019/CMakeLists.txt index 493b893f29a76ecb25d780ae6f07a231f04b2b94..9f389a2b2f523948aca65642811f322159c94aa8 100644 --- a/macro/beamtime/mcbm2019/CMakeLists.txt +++ b/macro/beamtime/mcbm2019/CMakeLists.txt @@ -26,6 +26,7 @@ GENERATE_ROOT_TEST_SCRIPT(${CBMROOT_SOURCE_DIR}/macro/beamtime/mcbm2019/MonitorM GENERATE_ROOT_TEST_SCRIPT(${CBMROOT_SOURCE_DIR}/macro/beamtime/mcbm2019/MonitorTof.C ) # CbmMcbm2018MonitorTaskTof + CbmMcbm2018MonitorAlgoTof GENERATE_ROOT_TEST_SCRIPT(${CBMROOT_SOURCE_DIR}/macro/beamtime/mcbm2019/MonitorRich.C ) # CbmMcbm2018UnpackerTaskRich.h in monitor mode GENERATE_ROOT_TEST_SCRIPT(${CBMROOT_SOURCE_DIR}/macro/beamtime/mcbm2019/MonitorPsd.C ) # CbmMcbm2018MonitorTaskPsd + CbmMcbm2018MonitorAlgoPsd +GENERATE_ROOT_TEST_SCRIPT(${CBMROOT_SOURCE_DIR}/macro/beamtime/mcbm2019/unpack_pulser_mcbm.C ) # Unpackers + Pulser check ## Define tests + dependencies Set(testname mcbm_convert_2019) @@ -69,19 +70,19 @@ Set_Tests_Properties(${testname} PROPERTIES PASS_REGULAR_EXPRESSION "Test Passed set_tests_properties(${testname} PROPERTIES FIXTURES_REQUIRED ${fixture_unpacked}) set_tests_properties(${testname} PROPERTIES DEPENDS mcbm_check_stsdigis_2019) -Set(testname mcbm_check_pulser_2019) -Add_Test(${testname} ${CBMROOT_BINARY_DIR}/macro/beamtime/mcbm2019/check_pulser.sh 399 ) -Set_Tests_Properties(${testname} PROPERTIES TIMEOUT "600") -Set_Tests_Properties(${testname} PROPERTIES PASS_REGULAR_EXPRESSION "Test Passed;All ok") -set_tests_properties(${testname} PROPERTIES FIXTURES_REQUIRED ${fixture_unpacked}) -set_tests_properties(${testname} PROPERTIES DEPENDS mcbm_check_muchdigis_2019) +#Set(testname mcbm_check_pulser_2019) +#Add_Test(${testname} ${CBMROOT_BINARY_DIR}/macro/beamtime/mcbm2019/check_pulser.sh 399 ) +#Set_Tests_Properties(${testname} PROPERTIES TIMEOUT "600") +#Set_Tests_Properties(${testname} PROPERTIES PASS_REGULAR_EXPRESSION "Test Passed;All ok") +#set_tests_properties(${testname} PROPERTIES FIXTURES_REQUIRED ${fixture_unpacked}) +#set_tests_properties(${testname} PROPERTIES DEPENDS mcbm_check_muchdigis_2019) Set(testname mcbm_build_event_2019) Add_Test(${testname} ${CBMROOT_BINARY_DIR}/macro/beamtime/mcbm2019/build_events.sh \"data/unp_mcbm_399.root\" 399 ) Set_Tests_Properties(${testname} PROPERTIES TIMEOUT "600") Set_Tests_Properties(${testname} PROPERTIES PASS_REGULAR_EXPRESSION "Test Passed;All ok") set_tests_properties(${testname} PROPERTIES FIXTURES_REQUIRED ${fixture_unpacked}) -set_tests_properties(${testname} PROPERTIES DEPENDS mcbm_check_pulser_2019) +set_tests_properties(${testname} PROPERTIES DEPENDS mcbm_check_muchdigis_2019) Set(fixture_built_evt fixture_done_${testname}) set_tests_properties(${testname} PROPERTIES FIXTURES_SETUP ${fixture_built_evt}) @@ -128,4 +129,10 @@ Set_Tests_Properties(${testname} PROPERTIES TIMEOUT "600") Set_Tests_Properties(${testname} PROPERTIES PASS_REGULAR_EXPRESSION "Test Passed;All ok") set_tests_properties(${testname} PROPERTIES DEPENDS mcbm_monirich_2019) +### Unpack + pulser check, needed as STS unpacker now needs a special flag to store the pulser digis in the standard out +Set(testname mcbm_unpack_pulser_2019) +Add_Test(${testname} ${CBMROOT_BINARY_DIR}/macro/beamtime/mcbm2019/unpack_pulser_mcbm.sh \"${CBMROOT_SOURCE_DIR}/input/mcbm_run399_first20Ts.tsa\" 399 ) +Set_Tests_Properties(${testname} PROPERTIES TIMEOUT "600") +Set_Tests_Properties(${testname} PROPERTIES PASS_REGULAR_EXPRESSION "Test Passed;All ok") +set_tests_properties(${testname} PROPERTIES DEPENDS mcbm_monipsd_2019) ##################### diff --git a/macro/beamtime/mcbm2019/check_pulser.C b/macro/beamtime/mcbm2019/check_pulser.C index 283f69b85c8750e947036bb14d18d41382c920fd..62edc36e45db249fba2327527d42b2a42454f232 100644 --- a/macro/beamtime/mcbm2019/check_pulser.C +++ b/macro/beamtime/mcbm2019/check_pulser.C @@ -59,6 +59,7 @@ void check_pulser(UInt_t uRunId = 0, Int_t nrEvents = 0, TString sDir = "data") pulserChecker->SetRichOffsetSearchRange(1000); pulserChecker->SetPsdOffsetSearchRange(5000); if (0 < uRunId) pulserChecker->SetOutFilename(Form("data/HistosPulserCheck_%03u.root", uRunId)); + pulserChecker->SetStsAddress(0x11E004E2); fRun->AddTask(pulserChecker); // ----- Parameter database -------------------------------------------- diff --git a/macro/beamtime/mcbm2019/unpack_pulser_mcbm.C b/macro/beamtime/mcbm2019/unpack_pulser_mcbm.C index 038db825ed6eb0d138e0db304a0c18be5bf878c7..03d26fa0dbdc3a935dc3a5d2a564c27fc894d8e3 100644 --- a/macro/beamtime/mcbm2019/unpack_pulser_mcbm.C +++ b/macro/beamtime/mcbm2019/unpack_pulser_mcbm.C @@ -14,11 +14,9 @@ // In order to call later Finish, we make this global FairRunOnline* run = NULL; -void unpack_pulser_mcbm(UInt_t uRunId = 0, TString sHostname = "localhost", UInt_t nrEvents = 0, - TString outDir = "data", Int_t iServerRefreshRate = 100, Int_t iServerHttpPort = 8080) +void unpack_pulser_mcbm(TString inFile = "", UInt_t uRunId = 0, UInt_t nrEvents = 0, TString outDir = "data", + TString inDir = "") { - if (uRunId < 353 && 0 != uRunId) return kFALSE; - TString srcDir = gSystem->Getenv("VMCWORKDIR"); // --- Specify number of events to be produced. @@ -26,8 +24,8 @@ void unpack_pulser_mcbm(UInt_t uRunId = 0, TString sHostname = "localhost", UInt Int_t nEvents = -1; // --- Specify output file name (this is just an example) TString runId = TString::Format("%03u", uRunId); - TString outFile = outDir + "/unp_mcbm_" + runId + ".root"; - TString parFile = outDir + "/unp_mcbm_params_" + runId + ".root"; + TString outFile = outDir + "/unp_pulser_" + runId + ".root"; + TString parFile = outDir + "/unp_pulser_params_" + runId + ".root"; // --- Set log output levels FairLogger::GetLogger(); @@ -44,7 +42,11 @@ void unpack_pulser_mcbm(UInt_t uRunId = 0, TString sHostname = "localhost", UInt TObjString* parStsFileName = new TObjString(paramFileSts); parFileList->Add(parStsFileName); - TString paramFileMuch = paramDir + "mMuchPar.par"; + TString paramFileMuch = paramDir + "mMuchPar.par"; + /// Special parameter files for runs 353-374 (November19) and 380-408 (December19) + if (uRunId >= 353 && uRunId <= 374) paramFileMuch = paramDir + "mMuchPar_Nov19.par"; + else if (374 < uRunId) + paramFileMuch = paramDir + "mMuchPar_Dec19.par"; TObjString* parMuchFileName = new TObjString(paramFileMuch); parFileList->Add(parMuchFileName); @@ -75,11 +77,11 @@ void unpack_pulser_mcbm(UInt_t uRunId = 0, TString sHostname = "localhost", UInt std::cout << std::endl; std::cout << ">>> unpack_tsa: Initialising..." << std::endl; - CbmMcbm2018UnpackerTaskSts* unpacker_sts = new CbmMcbm2018UnpackerTaskSts(); - CbmMcbm2018UnpackerTaskMuch* unpacker_much = new CbmMcbm2018UnpackerTaskMuch(); - CbmMcbm2018UnpackerTaskTof* unpacker_tof = new CbmMcbm2018UnpackerTaskTof(); - CbmMcbm2018UnpackerTaskRich* unpacker_rich = new CbmMcbm2018UnpackerTaskRich(); - CbmMcbm2018UnpackerTaskPsd* unpacker_psd = new CbmMcbm2018UnpackerTaskPsd(); + CbmMcbm2018UnpackerTaskSts* unpacker_sts = new CbmMcbm2018UnpackerTaskSts(); + CbmMcbm2018UnpackerTaskMuch* unpacker_much = new CbmMcbm2018UnpackerTaskMuch(); + CbmMcbm2018UnpackerTaskTof* unpacker_tof = new CbmMcbm2018UnpackerTaskTof(); + CbmMcbm2018UnpackerTaskRich2020* unpacker_rich = new CbmMcbm2018UnpackerTaskRich2020(); + CbmMcbm2018UnpackerTaskPsd* unpacker_psd = new CbmMcbm2018UnpackerTaskPsd(); unpacker_sts->SetMonitorMode(); unpacker_much->SetMonitorMode(); @@ -100,8 +102,18 @@ void unpack_pulser_mcbm(UInt_t uRunId = 0, TString sHostname = "localhost", UInt unpacker_psd->SetWriteOutputFlag(kFALSE); unpacker_sts->SetAdcCut(3); + unpacker_sts->SeparatePulserOutput(kFALSE); unpacker_tof->SetSeparateArrayT0(); + // ------------------------------ // + // Enable Asic type for MUCH data. + // fFlag = 0 ==> Asic type 2.0 (20) ---> December 2018 and March 2019 Data + // fFlag = 1 ==> Asic type 2.1 (21) ---> December 2019 Data + // This is to correct the channel fliping problem in smx 2.1 chip + Int_t fFlag = 1; + unpacker_much->EnableAsicType(fFlag); + // ------------------------------ // + switch (uRunId) { /* case 159: @@ -182,75 +194,89 @@ void unpack_pulser_mcbm(UInt_t uRunId = 0, TString sHostname = "localhost", UInt break; } // 159 */ + case 384: { + /// General System offsets (= offsets between sub-systems) + //unpacker_sts ->SetTimeOffsetNs( -1750 ); // Run 384 + //unpacker_much->SetTimeOffsetNs( -1750 ); // Run 384 + //unpacker_tof ->SetTimeOffsetNs( 40 ); // Run 384 + //unpacker_rich->SetTimeOffsetNs( -273 ); // Run 384 + + /// ASIC specific offsets (= offsets inside sub-system) + unpacker_much->SetTimeOffsetNsAsic(0, 2429.0); // Run 384, DPB 0 ASIC 0 + unpacker_much->SetTimeOffsetNsAsic(1, 2417.0); // Run 384, DPB 0 ASIC 1 + unpacker_much->SetTimeOffsetNsAsic(2, 2418.0); // Run 384, DPB 0 ASIC 2 + unpacker_much->SetTimeOffsetNsAsic(3, 0.0); // Run 384, DPB 0 ASIC 3 + unpacker_much->SetTimeOffsetNsAsic(4, 2404.0); // Run 384, DPB 0 ASIC 4 + unpacker_much->SetTimeOffsetNsAsic(5, 2415.0); // Run 384, DPB 0 ASIC 5 + unpacker_much->SetTimeOffsetNsAsic(6, -772.7); // Run 384, DPB 1 ASIC 0 + unpacker_much->SetTimeOffsetNsAsic(7, -779.3); // Run 384, DPB 1 ASIC 1 + unpacker_much->SetTimeOffsetNsAsic(8, 0.0); // Run 384, DPB 1 ASIC 2 + unpacker_much->SetTimeOffsetNsAsic(9, -806.6); // Run 384, DPB 1 ASIC 3 + unpacker_much->SetTimeOffsetNsAsic(10, -784.2); // Run 384, DPB 1 ASIC 4 + unpacker_much->SetTimeOffsetNsAsic(11, -786.4); // Run 384, DPB 1 ASIC 5 + unpacker_much->SetTimeOffsetNsAsic(12, -788.9); // Run 384, DPB 2 ASIC 0 + unpacker_much->SetTimeOffsetNsAsic(13, 0.0); // Run 384, DPB 2 ASIC 1 + unpacker_much->SetTimeOffsetNsAsic(14, 0.0); // Run 384, DPB 2 ASIC 2 + unpacker_much->SetTimeOffsetNsAsic(15, -785.9); // Run 384, DPB 2 ASIC 3 + unpacker_much->SetTimeOffsetNsAsic(16, -784.5); // Run 384, DPB 2 ASIC 4 + unpacker_much->SetTimeOffsetNsAsic(17, -775.6); // Run 384, DPB 2 ASIC 5 + unpacker_much->SetTimeOffsetNsAsic(18, 2404.0); // Run 384, DPB 3 ASIC 0 + unpacker_much->SetTimeOffsetNsAsic(19, 2400.0); // Run 384, DPB 3 ASIC 1 + unpacker_much->SetTimeOffsetNsAsic(20, 2413.0); // Run 384, DPB 3 ASIC 2 + unpacker_much->SetTimeOffsetNsAsic(21, 2407.0); // Run 384, DPB 3 ASIC 3 + unpacker_much->SetTimeOffsetNsAsic(22, 0.0); // Run 384, DPB 3 ASIC 4 + unpacker_much->SetTimeOffsetNsAsic(23, 0.0); // Run 384, DPB 3 ASIC 5 + unpacker_much->SetTimeOffsetNsAsic(24, 2377.0); // Run 384, DPB 4 ASIC 0 + unpacker_much->SetTimeOffsetNsAsic(25, 2375.0); // Run 384, DPB 4 ASIC 1 + unpacker_much->SetTimeOffsetNsAsic(26, 2378.0); // Run 384, DPB 4 ASIC 2 + unpacker_much->SetTimeOffsetNsAsic(27, 2394.0); // Run 384, DPB 4 ASIC 3 + unpacker_much->SetTimeOffsetNsAsic(28, 2401.0); // Run 384, DPB 4 ASIC 4 + unpacker_much->SetTimeOffsetNsAsic(29, 2405.0); // Run 384, DPB 4 ASIC 5 + unpacker_much->SetTimeOffsetNsAsic(30, 5575.0); // Run 384, DPB 5 ASIC 0 + unpacker_much->SetTimeOffsetNsAsic(31, 5599.0); // Run 384, DPB 5 ASIC 1 + unpacker_much->SetTimeOffsetNsAsic(32, 5597.0); // Run 384, DPB 5 ASIC 2 + unpacker_much->SetTimeOffsetNsAsic(33, 5583.0); // Run 384, DPB 5 ASIC 3 + unpacker_much->SetTimeOffsetNsAsic(34, 0.0); // Run 384, DPB 5 ASIC 4 + unpacker_much->SetTimeOffsetNsAsic(35, 0.0); // Run 384, DPB 5 ASIC 5 + + unpacker_psd->SetTimeOffsetNs(-180.0); + + break; + } // 384 + + case 365: { + unpacker_psd->SetTimeOffsetNs(-1007.0); + break; + } + default: break; } // switch( uRunId ) // --- Source task CbmMcbm2018Source* source = new CbmMcbm2018Source(); - /* - TString inFile = Form( "/scratch/mcbm_data/mcbm_all/data/%3u_pn02_0000.tsa;", uRunId ); - inFile += Form( "/scratch/mcbm_data/mcbm_all/data/%3u_pn04_0000.tsa;", uRunId ); - inFile += Form( "/scratch/mcbm_data/mcbm_all/data/%3u_pn05_0000.tsa;", uRunId ); - inFile += Form( "/scratch/mcbm_data/mcbm_all/data/%3u_pn06_0000.tsa;", uRunId ); - inFile += Form( "/scratch/mcbm_data/mcbm_all/data/%3u_pn08_0000.tsa;", uRunId ); - inFile += Form( "/scratch/mcbm_data/mcbm_all/data/%3u_pn10_0000.tsa;", uRunId ); - inFile += Form( "/scratch/mcbm_data/mcbm_all/data/%3u_pn11_0000.tsa;", uRunId ); - inFile += Form( "/scratch/mcbm_data/mcbm_all/data/%3u_pn12_0000.tsa;", uRunId ); - inFile += Form( "/scratch/mcbm_data/mcbm_all/data/%3u_pn13_0000.tsa;", uRunId ); - inFile += Form( "/scratch/mcbm_data/mcbm_all/data/%3u_pn15_0000.tsa", uRunId ); -*/ - /* - TString inFile = Form( "/scratch/mcbm_data/mcbm_all/data/%3u_pn02_0003.tsa;", uRunId ); - inFile += Form( "/scratch/mcbm_data/mcbm_all/data/%3u_pn04_0003.tsa;", uRunId ); - inFile += Form( "/scratch/mcbm_data/mcbm_all/data/%3u_pn05_0003.tsa;", uRunId ); - inFile += Form( "/scratch/mcbm_data/mcbm_all/data/%3u_pn06_0003.tsa;", uRunId ); - inFile += Form( "/scratch/mcbm_data/mcbm_all/data/%3u_pn08_0003.tsa;", uRunId ); - inFile += Form( "/scratch/mcbm_data/mcbm_all/data/%3u_pn10_0003.tsa;", uRunId ); - inFile += Form( "/scratch/mcbm_data/mcbm_all/data/%3u_pn11_0003.tsa;", uRunId ); - inFile += Form( "/scratch/mcbm_data/mcbm_all/data/%3u_pn12_0003.tsa;", uRunId ); - inFile += Form( "/scratch/mcbm_data/mcbm_all/data/%3u_pn13_0003.tsa;", uRunId ); - inFile += Form( "/scratch/mcbm_data/mcbm_all/data/%3u_pn15_0003.tsa", uRunId ); -*/ - - TString inFile = Form("/scratch/mcbm_data/mcbm_all/data/%3u_pn02_*.tsa;", uRunId); - inFile += Form("/scratch/mcbm_data/mcbm_all/data/%3u_pn04_*.tsa;", uRunId); - inFile += Form("/scratch/mcbm_data/mcbm_all/data/%3u_pn05_*.tsa;", uRunId); - inFile += Form("/scratch/mcbm_data/mcbm_all/data/%3u_pn06_*.tsa;", uRunId); - inFile += Form("/scratch/mcbm_data/mcbm_all/data/%3u_pn08_*.tsa;", uRunId); - inFile += Form("/scratch/mcbm_data/mcbm_all/data/%3u_pn10_*.tsa;", uRunId); - inFile += Form("/scratch/mcbm_data/mcbm_all/data/%3u_pn11_*.tsa;", uRunId); - inFile += Form("/scratch/mcbm_data/mcbm_all/data/%3u_pn12_*.tsa;", uRunId); - inFile += Form("/scratch/mcbm_data/mcbm_all/data/%3u_pn13_*.tsa;", uRunId); - inFile += Form("/scratch/mcbm_data/mcbm_all/data/%3u_pn15_*.tsa", uRunId); - - if (0 < uRunId) { source->SetFileName(inFile); } // if( "" != inFile ) - else { - source->SetHostName(sHostname); - source->SetSubscriberHwm(10); - } // else of if( "" != inFile ) + source->SetWriteOutputFlag(kFALSE); // For writing TS metadata + source->SetFileName(inFile); // source->SetInputDir(inDir); - // source->AddUnpacker(unpacker_sts, 0x10, ECbmModuleId::kSts );//STS xyter + source->AddUnpacker(unpacker_sts, 0x10, ECbmModuleId::kSts); //STS xyter source->AddUnpacker(unpacker_much, 0x40, ECbmModuleId::kMuch); //MUCH xyter source->AddUnpacker(unpacker_tof, 0x60, ECbmModuleId::kTof); //gDPB A & B & C source->AddUnpacker(unpacker_tof, 0x90, ECbmModuleId::kTof); //gDPB T0 A & B - // source->AddUnpacker(unpacker_rich, 0x30, ECbmModuleId::kRich );//RICH trb - source->AddUnpacker(unpacker_psd, 0x80, ECbmModuleId::kPsd); //PSD + source->AddUnpacker(unpacker_rich, 0x30, ECbmModuleId::kRich); //RICH trb + source->AddUnpacker(unpacker_psd, 0x80, ECbmModuleId::kPsd); //PSD + // --- RootFileSink to avoid crash with old versions of FairRoot (< 18.4.6) + FairRootFileSink* sink = new FairRootFileSink(outFile); // --- Run run = new FairRunOnline(source); - run->ActivateHttpServer(iServerRefreshRate, - iServerHttpPort); // refresh each 100 events - /// To avoid the server sucking all Histos from gROOT when no output file is used - /// ===> Need to explicitely add the canvases to the server in the task! - run->GetHttpServer()->GetSniffer()->SetScanGlobalDir(kFALSE); + run->SetSink(sink); /// Needed for FairRoot < 18.4.6 run->SetAutoFinish(kFALSE); CbmMcbm2019CheckPulser* pulserChecker = new CbmMcbm2019CheckPulser(); pulserChecker->SetT0PulserTotLimits(184, 191); pulserChecker->SetStsPulserAdcLimits(31, 0); - pulserChecker->SetMuchPulseradcLimits(5, 25); /// mCBM 2019 + pulserChecker->SetMuchPulserAdcLimits(5, 25); /// mCBM 2019 pulserChecker->SetTofPulserTotLimits(184, 191); pulserChecker->SetRichPulserTotLimits(1, 0); pulserChecker->SetPsdPulserAdcLimits(0, 70000); @@ -258,11 +284,11 @@ void unpack_pulser_mcbm(UInt_t uRunId = 0, TString sHostname = "localhost", UInt pulserChecker->SetMuchOffsetSearchRange(5000); pulserChecker->SetTofOffsetSearchRange(500); pulserChecker->SetRichOffsetSearchRange(1000); - // pulserChecker->SetPsdOffsetSearchRange( 500 ); - pulserChecker->SetPsdOffsetSearchRange(250); + pulserChecker->SetPsdOffsetSearchRange(5000); if (0 < uRunId) pulserChecker->SetOutFilename(Form("data/HistosPulserCheck_%03u.root", uRunId)); /// mCBM 2019 + pulserChecker->SetStsAddress(0x11E004E2); pulserChecker->SetMuchAsic(9); pulserChecker->SetMuchChanRange(63); @@ -283,7 +309,7 @@ void unpack_pulser_mcbm(UInt_t uRunId = 0, TString sHostname = "localhost", UInt timer.Start(); std::cout << ">>> unpack_tsa_mcbm: Starting run..." << std::endl; if (0 == nrEvents) { - run->Run(nEvents, 0); // run until end of input file + run->Run(-1, 0); // run until end of input file } else { run->Run(0, nrEvents); // process N Events diff --git a/macro/beamtime/mcbm2020/CMakeLists.txt b/macro/beamtime/mcbm2020/CMakeLists.txt index 79b3b909bb58bbe73b42a051774220e1504d2748..bc297189e424bbf5bc1f641df2be52137e7423e9 100644 --- a/macro/beamtime/mcbm2020/CMakeLists.txt +++ b/macro/beamtime/mcbm2020/CMakeLists.txt @@ -33,6 +33,7 @@ If(DEFINED ENV{RAW_DATA_PATH} ) GENERATE_ROOT_TEST_SCRIPT(${CBMROOT_SOURCE_DIR}/macro/beamtime/mcbm2020/MonitorTof.C ) # CbmMcbm2018MonitorTaskTof + CbmMcbm2018MonitorAlgoTof GENERATE_ROOT_TEST_SCRIPT(${CBMROOT_SOURCE_DIR}/macro/beamtime/mcbm2020/MonitorRich.C ) # CbmMcbm2018UnpackerTaskRich.h in monitor mode GENERATE_ROOT_TEST_SCRIPT(${CBMROOT_SOURCE_DIR}/macro/beamtime/mcbm2020/MonitorPsd.C ) # CbmMcbm2018MonitorTaskPsd + CbmMcbm2018MonitorAlgoPsd + GENERATE_ROOT_TEST_SCRIPT(${CBMROOT_SOURCE_DIR}/macro/beamtime/mcbm2020/unpack_pulser_mcbm.C ) # Unpackers + Pulser check ## Run only if raw data files present ForEach(RUN 759 760 761 762 811 812 819 824 831 856 ) @@ -65,19 +66,19 @@ If(DEFINED ENV{RAW_DATA_PATH} ) #### Make this test run alone to try to avoid memory errors on test machines set_tests_properties(${testname} PROPERTIES RUN_SERIAL true ) - Set(testname mcbm_check_pulser_2020_${RUN}) - Add_Test(${testname} ${CBMROOT_BINARY_DIR}/macro/beamtime/mcbm2020/check_pulser.sh ${RUN} ) - Set_Tests_Properties(${testname} PROPERTIES TIMEOUT "300") - Set_Tests_Properties(${testname} PROPERTIES PASS_REGULAR_EXPRESSION "Test Passed;All ok") - set_tests_properties(${testname} PROPERTIES FIXTURES_REQUIRED ${fixture_unpacked_${RUN}}) - set_tests_properties(${testname} PROPERTIES DEPENDS mcbm_check_timing_2020_${RUN}) +# Set(testname mcbm_check_pulser_2020_${RUN}) +# Add_Test(${testname} ${CBMROOT_BINARY_DIR}/macro/beamtime/mcbm2020/check_pulser.sh ${RUN} ) +# Set_Tests_Properties(${testname} PROPERTIES TIMEOUT "300") +# Set_Tests_Properties(${testname} PROPERTIES PASS_REGULAR_EXPRESSION "Test Passed;All ok") +# set_tests_properties(${testname} PROPERTIES FIXTURES_REQUIRED ${fixture_unpacked_${RUN}}) +# set_tests_properties(${testname} PROPERTIES DEPENDS mcbm_check_timing_2020_${RUN}) Set(testname mcbm_build_event_2020_${RUN}) Add_Test(${testname} ${CBMROOT_BINARY_DIR}/macro/beamtime/mcbm2020/build_events.sh \"data/unp_mcbm_${RUN}.root\" ${RUN} ) Set_Tests_Properties(${testname} PROPERTIES TIMEOUT "600") Set_Tests_Properties(${testname} PROPERTIES PASS_REGULAR_EXPRESSION "Test Passed;All ok") set_tests_properties(${testname} PROPERTIES FIXTURES_REQUIRED ${fixture_unpacked_${RUN}}) - set_tests_properties(${testname} PROPERTIES DEPENDS mcbm_check_pulser_2020_${RUN}) + set_tests_properties(${testname} PROPERTIES DEPENDS mcbm_check_timing_2020_${RUN}) Set(fixture_built_evt_${RUN} fixture_done_${testname}) set_tests_properties(${testname} PROPERTIES FIXTURES_SETUP ${fixture_built_evt_${RUN}}) @@ -202,6 +203,13 @@ If(DEFINED ENV{RAW_DATA_PATH} ) Set_Tests_Properties(${testname} PROPERTIES TIMEOUT "300") Set_Tests_Properties(${testname} PROPERTIES PASS_REGULAR_EXPRESSION "Test Passed;All ok") set_tests_properties(${testname} PROPERTIES DEPENDS mcbm_monirich_2020_${RUN}) + + ### Unpack + pulser check, needed as STS unpacker now needs a special flag to store the pulser digis in the standard out + Set(testname mcbm_unpack_pulser_2020_${RUN}) + Add_Test(${testname} ${CBMROOT_BINARY_DIR}/macro/beamtime/mcbm2020/unpack_pulser_mcbm.sh \"${RAW_DATA_PATH}/${RUN}_first20Ts.tsa\" ${RUN} ) + Set_Tests_Properties(${testname} PROPERTIES TIMEOUT "600") + Set_Tests_Properties(${testname} PROPERTIES PASS_REGULAR_EXPRESSION "Test Passed;All ok") + set_tests_properties(${testname} PROPERTIES DEPENDS mcbm_monirich_2020_) EndIf() # If(EXISTS ${RAW_DATA_PATH}/${RUN}_first20Ts.tsa)) EndForEach() # ForEach(RUN 759 760 761 762 811 812 819 824 856 ) EndIf() # If(DEFINED ENV{RAW_DATA_PATH} ) diff --git a/macro/beamtime/mcbm2020/mStsPar.par b/macro/beamtime/mcbm2020/mStsPar.par index 4e9941a75f5b32b31e74fe93fb259cb52f1bb83e..4c1d9b65fa3f261407eca9c88f7276fc4d72489c 100644 --- a/macro/beamtime/mcbm2020/mStsPar.par +++ b/macro/beamtime/mcbm2020/mStsPar.par @@ -12,7 +12,7 @@ ModuleType: Int_t \ // STS address for the first strip of each module // 1 Line per ladder, from above beam to under beam ModAddress: Int_t \ - 0x10018002 0x10008002 0x99999999 // addresse matching the current mSTS geometry (PAL, 15/05/2020) + 0x10018002 0x10008002 0x11E004E2 // addresse matching the current mSTS geometry (PAL, 15/05/2020) // Offset of module center in X, in mm (Should be done by geometry for the unpacker!) ModCenterPosX: Double_t \ 0.0 0.0 0.0 @@ -27,12 +27,15 @@ DbpIdArray: Int_t \ // Array to hold the active flag for all CROBs, [ NbDpb * kuNbCrobPerDpb ] = [ NbDpb * 1 ] CrobActiveFlag: Int_t \ 1 +// Pulser flag for each FEB, [ NbDpb * kuNbCrobPerDpb * kuNbFebsPerCrob ] = = [ NbDpb * 1 * 5 ], 1 if pulser, 0 otherwise +FebPulserFlag: Int_t \ + 1 0 0 0 0 // Index of the STS module for each FEB, [ NbDpb * kuNbCrobPerDpb * kuNbFebsPerCrob ] = = [ NbDpb * 1 * 5 ], -1 if inactive FebModuleIdx: Int_t \ - 2 0 0 1 1 + 2 0 0 1 1 // STS module side for each FEB, [ NbDpb * kuNbCrobPerDpb * kuNbFebsPerCrob ], 0 = P, 1 = N, -1 if inactive FebModuleSide: Int_t \ - 0 1 0 1 0 + 0 1 0 1 0 // ADC Gain in e-/ADC bin for each FEB, [ NbDpb * kuNbCrobPerDpb * kuNbFebsPerCrob ] FebAdcGain: Double_t \ 1.0 1.0 1.0 1.0 1.0 diff --git a/macro/beamtime/mcbm2020/mStsPar_pulser.par b/macro/beamtime/mcbm2020/mStsPar_pulser.par index d7fcd66b42b07d8e50291192e387411699a99566..84aa1713d9115634baf817bf63c30a480155f8e2 100644 --- a/macro/beamtime/mcbm2020/mStsPar_pulser.par +++ b/macro/beamtime/mcbm2020/mStsPar_pulser.par @@ -12,9 +12,9 @@ ModuleType: Int_t \ // STS address for the first strip of each module // 1 Line per ladder, from above beam to under beam ModAddress: Int_t \ - 0x10010002 0x10000002 0x99999999 -// 0x10010402 0x10000402 0x99999999 // alternative to try -// 0x10008002 0x10008002 0x99999999 // original + 0x10010002 0x10000002 0x11E004E2 +// 0x10010402 0x10000402 0x11E004E2 // alternative to try +// 0x10008002 0x10008002 0x11E004E2 // original // Offset of module center in X, in mm (Should be done by geometry for the unpacker!) ModCenterPosX: Double_t \ 0.0 0.0 0.0 @@ -29,12 +29,15 @@ DbpIdArray: Int_t \ // Array to hold the active flag for all CROBs, [ NbDpb * kuNbCrobPerDpb ] = [ NbDpb * 1 ] CrobActiveFlag: Int_t \ 1 +// Pulser flag for each FEB, [ NbDpb * kuNbCrobPerDpb * kuNbFebsPerCrob ] = = [ NbDpb * 1 * 5 ], 1 if pulser, 0 otherwise +FebPulserFlag: Int_t \ + 1 0 0 0 0 // Index of the STS module for each FEB, [ NbDpb * kuNbCrobPerDpb * kuNbFebsPerCrob ] = = [ NbDpb * 1 * 5 ], -1 if inactive FebModuleIdx: Int_t \ - 2 -1 -1 -1 -1 + 2 -1 -1 -1 -1 // STS module side for each FEB, [ NbDpb * kuNbCrobPerDpb * kuNbFebsPerCrob ], 0 = P, 1 = N, -1 if inactive FebModuleSide: Int_t \ - 1 1 0 1 0 + 1 1 0 1 0 // ADC Gain in e-/ADC bin for each FEB, [ NbDpb * kuNbCrobPerDpb * kuNbFebsPerCrob ] FebAdcGain: Double_t \ 1.0 1.0 1.0 1.0 1.0 diff --git a/macro/beamtime/mcbm2020/unpack_pulser_mcbm.C b/macro/beamtime/mcbm2020/unpack_pulser_mcbm.C index e94c4b4c30bc61f7b65558e1823ecf278bc47ba1..3034561ab9d412924498fb18e6e53970f12d9faa 100644 --- a/macro/beamtime/mcbm2020/unpack_pulser_mcbm.C +++ b/macro/beamtime/mcbm2020/unpack_pulser_mcbm.C @@ -14,20 +14,40 @@ // In order to call later Finish, we make this global FairRunOnline* run = NULL; -void unpack_pulser_mcbm(UInt_t uRunId = 0, TString sHostname = "localhost", UInt_t nrEvents = 0, - TString outDir = "data", Int_t iServerRefreshRate = 100, Int_t iServerHttpPort = 8080) +/// FIXME: Disable clang formatting to keep easy parameters overview +/* clang-format off */ +Bool_t unpack_pulser_mcbm(TString inFile = "", + UInt_t uRunId = 0, + UInt_t uNbTimeslices = 0, + TString sOutDir = "data", + Int_t iSpillIndex = -1, + Int_t iSpillnumber = 3, + UInt_t uSpillLimType = 1) { - if (uRunId < 353 && 0 != uRunId) return kFALSE; + /// FIXME: Re-enable clang formatting after parameters initial values setting + /* clang-format on */ TString srcDir = gSystem->Getenv("VMCWORKDIR"); - // --- Specify number of events to be produced. - // --- -1 means run until the end of the input file. - Int_t nEvents = -1; // --- Specify output file name (this is just an example) TString runId = TString::Format("%03u", uRunId); - TString outFile = outDir + "/unp_mcbm_" + runId + ".root"; - TString parFile = outDir + "/unp_mcbm_params_" + runId + ".root"; + TString outFile = sOutDir + "/unp_mcbm_" + runId; + TString parFile = sOutDir + "/unp_mcbm_params_" + runId; + if (0 <= iSpillIndex) { + outFile += TString::Format("_%02i", iSpillIndex); + parFile += TString::Format("_%02i", iSpillIndex); + } // if( 0 <= iSpillIndex ) + outFile += ".root"; + parFile += ".root"; + + /* + std::cout << inFile << std::endl << sOutDir << std::endl; + std::cout << parFile << std::endl + << outFile << std::endl; + std::cout << uRunId << " " << uNbTimeslices << std::endl; + + return kTRUE; + */ // --- Set log output levels FairLogger::GetLogger(); @@ -38,9 +58,9 @@ void unpack_pulser_mcbm(UInt_t uRunId = 0, TString sHostname = "localhost", UInt // --- Define parameter files TList* parFileList = new TList(); - TString paramDir = "./"; + TString paramDir = srcDir + "/macro/beamtime/mcbm2020/"; - // ---- Load the geometry setup ---- + // --- Load the geometry setup ---- // This is currently only required by the TRD std::string geoSetupTag = "mcbm_beam_2020_03"; CbmSetup* geoSetup = CbmSetup::Instance(); @@ -69,13 +89,22 @@ void unpack_pulser_mcbm(UInt_t uRunId = 0, TString sHostname = "localhost", UInt for (auto parIt : paramFilesVecTrd) { parFileList->Add(new TObjString(Form("%s.%s.par", paramFilesTrd.Data(), parIt.data()))); } + // Add timeshift calibration, currently only available for run 831 others to come + if (uRunId == 831) + parFileList->Add(new TObjString( + Form("%s/parameters/trd/mcbm2020_special/CbmMcbm2020TrdTshiftPar_run%d.par", srcDir.Data(), uRunId))); } - TString paramFileTof = paramDir + "mTofPar.par"; + TString paramFileTof = paramDir + "mTofPar.par"; + if (uRunId >= 708 && uRunId < 754) paramFileTof = paramDir + "mTofPar_2Stack.par"; + else if (uRunId >= 754) + paramFileTof = paramDir + "mTofPar_3Stack.par"; + TObjString* parTofFileName = new TObjString(paramFileTof); parFileList->Add(parTofFileName); - TString paramFileRich = paramDir + "mRichPar.par"; + TString paramFileRich = paramDir + "mRichPar.par"; + if (uRunId > 698) paramFileRich = paramDir + "mRichPar_70.par"; TObjString* parRichFileName = new TObjString(paramFileRich); parFileList->Add(parRichFileName); @@ -94,19 +123,22 @@ void unpack_pulser_mcbm(UInt_t uRunId = 0, TString sHostname = "localhost", UInt std::cout << std::endl; std::cout << ">>> unpack_tsa: Initialising..." << std::endl; - CbmMcbm2018UnpackerTaskSts* unpacker_sts = new CbmMcbm2018UnpackerTaskSts(); - CbmMcbm2018UnpackerTaskMuch* unpacker_much = new CbmMcbm2018UnpackerTaskMuch(); - CbmMcbm2018UnpackerTaskTrdR* unpacker_trdR = new CbmMcbm2018UnpackerTaskTrdR(); - CbmMcbm2018UnpackerTaskTof* unpacker_tof = new CbmMcbm2018UnpackerTaskTof(); - CbmMcbm2018UnpackerTaskRich* unpacker_rich = new CbmMcbm2018UnpackerTaskRich(); - CbmMcbm2018UnpackerTaskPsd* unpacker_psd = new CbmMcbm2018UnpackerTaskPsd(); + CbmMcbm2018UnpackerTaskSts* unpacker_sts = new CbmMcbm2018UnpackerTaskSts(); + CbmMcbm2018UnpackerTaskMuch* unpacker_much = new CbmMcbm2018UnpackerTaskMuch(); + CbmMcbm2018UnpackerTaskTrdR* unpacker_trdR = new CbmMcbm2018UnpackerTaskTrdR(); + CbmMcbm2018UnpackerTaskTof* unpacker_tof = new CbmMcbm2018UnpackerTaskTof(); + CbmMcbm2018UnpackerTaskRich2020* unpacker_rich = new CbmMcbm2018UnpackerTaskRich2020(); + CbmMcbm2018UnpackerTaskPsd* unpacker_psd = new CbmMcbm2018UnpackerTaskPsd(); - unpacker_sts->SetMonitorMode(); + /* + * Do not generate plots by default + unpacker_sts ->SetMonitorMode(); unpacker_much->SetMonitorMode(); - unpacker_trdR->SetMonitorMode(); - unpacker_tof->SetMonitorMode(); + unpacker_trdR->SetMonitorMode(); // Assume histo server present, not like other unpackers + unpacker_tof ->SetMonitorMode(); unpacker_rich->SetMonitorMode(); unpacker_psd->SetMonitorMode(); +*/ unpacker_sts->SetIgnoreOverlapMs(); unpacker_much->SetIgnoreOverlapMs(); @@ -115,6 +147,11 @@ void unpack_pulser_mcbm(UInt_t uRunId = 0, TString sHostname = "localhost", UInt unpacker_rich->SetIgnoreOverlapMs(); unpacker_psd->SetIgnoreOverlapMs(); + /// Starting from first run on Tuesday 28/04/2020, STS uses bin sorter FW + if (692 <= uRunId) unpacker_sts->SetBinningFwFlag(kTRUE); + /// Starting from first run on Monday 04/05/2020, MUCH uses bin sorter FW + if (811 <= uRunId) unpacker_much->SetBinningFwFlag(kTRUE); + unpacker_sts->SetWriteOutputFlag(kFALSE); unpacker_much->SetWriteOutputFlag(kFALSE); unpacker_trdR->SetWriteOutput(kFALSE); @@ -122,177 +159,491 @@ void unpack_pulser_mcbm(UInt_t uRunId = 0, TString sHostname = "localhost", UInt unpacker_rich->SetWriteOutputFlag(kFALSE); unpacker_psd->SetWriteOutputFlag(kFALSE); + /// FIXME: Disable clang formatting for parameters tuning for now + /* clang-format off */ + unpacker_sts ->MaskNoisyChannel(1,768 , true ); + unpacker_sts ->MaskNoisyChannel(1,894 , true ); + unpacker_sts ->MaskNoisyChannel(1,896 , true ); + + unpacker_sts ->MaskNoisyChannel(2,930 , true ); + unpacker_sts ->MaskNoisyChannel(2,926 , true ); + unpacker_sts ->MaskNoisyChannel(2,892 , true ); + + unpacker_sts ->MaskNoisyChannel(3,770 , true ); + unpacker_sts->SetAdcCut(3); + unpacker_sts->SeparatePulserOutput(kFALSE); + unpacker_tof->SetSeparateArrayT0(); + // ------------------------------ // + // Enable Asic type for MUCH data. + // fFlag = 0 ==> Asic type 2.0 (20) ---> December 2018 and March 2019 Data + // fFlag = 1 ==> Asic type 2.1 (21) ---> December 2019 Data + // This is to correct the channel fliping problem in smx 2.1 chip + Int_t fFlag = 1; + unpacker_much->EnableAsicType(fFlag); + // ------------------------------ // + /// General System offsets (= offsets between sub-systems) + unpacker_sts->SetTimeOffsetNs(-936); // Run 811-866 + unpacker_much->SetTimeOffsetNs(-885); // Run 811-866 + unpacker_trdR->SetTimeOffsetNs(0); // Run 811-866 + unpacker_tof->SetTimeOffsetNs(30); // Run 811-866 + unpacker_rich->SetTimeOffsetNs(-310); // Run 811-866 + unpacker_psd->SetTimeOffsetNs(-225); // Run 811-866 + + // ----------- ASIC by ASIC STS ---------------- + // the first 8 Unused + unpacker_sts ->SetTimeOffsetNsAsic( 0, 0.0 ); // Unused + unpacker_sts ->SetTimeOffsetNsAsic( 1, 0.0 ); // Unused + unpacker_sts ->SetTimeOffsetNsAsic( 2, 0.0 ); // Unused + unpacker_sts ->SetTimeOffsetNsAsic( 3, 0.0 ); // Unused + unpacker_sts ->SetTimeOffsetNsAsic( 4, 0.0 ); // Unused + unpacker_sts ->SetTimeOffsetNsAsic( 5, 0.0 ); // Unused + unpacker_sts ->SetTimeOffsetNsAsic( 6, 0.0 ); // Unused + unpacker_sts ->SetTimeOffsetNsAsic( 7, 0.0 ); // Unused + // + unpacker_sts ->SetTimeOffsetNsAsic(8, -0.360078 ); + unpacker_sts ->SetTimeOffsetNsAsic(9, 2.73976 ); + unpacker_sts ->SetTimeOffsetNsAsic(10, -0.507079 ); + unpacker_sts ->SetTimeOffsetNsAsic(11, 1.74695 ); + unpacker_sts ->SetTimeOffsetNsAsic(12, -0.909864 ); + unpacker_sts ->SetTimeOffsetNsAsic(13, -0.255514 ); + unpacker_sts ->SetTimeOffsetNsAsic(14, 1.44034 ); + unpacker_sts ->SetTimeOffsetNsAsic(15, 2.64009 ); + // this side: revert order 23->16 + unpacker_sts ->SetTimeOffsetNsAsic(23, -0.442762 ); + unpacker_sts ->SetTimeOffsetNsAsic(22, 1.76543 ); + unpacker_sts ->SetTimeOffsetNsAsic(21, -0.94728 ); + unpacker_sts ->SetTimeOffsetNsAsic(20, -2.18516 ); + unpacker_sts ->SetTimeOffsetNsAsic(19, -0.68254 ); + unpacker_sts ->SetTimeOffsetNsAsic(18, -2.32241 ); + unpacker_sts ->SetTimeOffsetNsAsic(17, -1.53483 ); + unpacker_sts ->SetTimeOffsetNsAsic(16, -2.12455 ); + // + unpacker_sts ->SetTimeOffsetNsAsic(24, -0.41084 ); + unpacker_sts ->SetTimeOffsetNsAsic(25, 0.230455 ); + unpacker_sts ->SetTimeOffsetNsAsic(26, -0.206921 ); + unpacker_sts ->SetTimeOffsetNsAsic(27, 0.0913657 ); + unpacker_sts ->SetTimeOffsetNsAsic(28, -0.17252 ); + unpacker_sts ->SetTimeOffsetNsAsic(29, -0.32990 ); + unpacker_sts ->SetTimeOffsetNsAsic(30, 1.43535 ); + unpacker_sts ->SetTimeOffsetNsAsic(31, -0.155741 ); + // this side: revert order 39->32 + unpacker_sts ->SetTimeOffsetNsAsic(39, 1.53865 ); + unpacker_sts ->SetTimeOffsetNsAsic(38, 3.6318 ); + unpacker_sts ->SetTimeOffsetNsAsic(37, 1.3153 ); + unpacker_sts ->SetTimeOffsetNsAsic(36, -1.90278 ); + unpacker_sts ->SetTimeOffsetNsAsic(35, 2.00051 ); + unpacker_sts ->SetTimeOffsetNsAsic(34, -2.85656 ); + unpacker_sts ->SetTimeOffsetNsAsic(33, 1.28834 ); + unpacker_sts ->SetTimeOffsetNsAsic(32, 0.657113 ); + switch (uRunId) { - /* - case 159: - { - /// General System offsets (= offsets between sub-systems) - unpacker_sts ->SetTimeOffsetNs( -1750 ); // Run 159 - unpacker_much->SetTimeOffsetNs( -1750 ); // Run 159 - unpacker_tof ->SetTimeOffsetNs( -50 ); // Run 159 - unpacker_rich->SetTimeOffsetNs( -1090 ); // Run 159 - - /// ASIC specific offsets (= offsets inside sub-system) - unpacker_sts ->SetTimeOffsetNsAsic( 0, 0.0 ); // Unused - unpacker_sts ->SetTimeOffsetNsAsic( 1, 0.0 ); // Unused - unpacker_sts ->SetTimeOffsetNsAsic( 2, 0.0 ); // Unused - unpacker_sts ->SetTimeOffsetNsAsic( 3, 0.0 ); // Unused - unpacker_sts ->SetTimeOffsetNsAsic( 4, 0.0 ); // Unused - unpacker_sts ->SetTimeOffsetNsAsic( 5, 0.0 ); // Unused - unpacker_sts ->SetTimeOffsetNsAsic( 6, 0.0 ); // Unused - unpacker_sts ->SetTimeOffsetNsAsic( 7, 0.0 ); // Unused - unpacker_sts ->SetTimeOffsetNsAsic( 8, 0.0 ); // Run 160, Ladder 0, Module 1, N, Asic 0 - unpacker_sts ->SetTimeOffsetNsAsic( 9, 18.75 ); // Run 160, Ladder 0, Module 1, N, Asic 1 - unpacker_sts ->SetTimeOffsetNsAsic( 10, 0.0 ); // Run 160, Ladder 0, Module 1, N, Asic 2 - unpacker_sts ->SetTimeOffsetNsAsic( 11, 25.0 ); // Run 160, Ladder 0, Module 1, N, Asic 3 - unpacker_sts ->SetTimeOffsetNsAsic( 12, 0.0 ); // Run 160, Ladder 0, Module 1, N, Asic 4 - unpacker_sts ->SetTimeOffsetNsAsic( 13, 56.25 ); // Run 160, Ladder 0, Module 1, N, Asic 5 - unpacker_sts ->SetTimeOffsetNsAsic( 14, 0.0 ); // Run 160, Ladder 0, Module 1, N, Asic 6 - unpacker_sts ->SetTimeOffsetNsAsic( 15, 37.5 ); // Run 160, Ladder 0, Module 1, N, Asic 7 - unpacker_sts ->SetTimeOffsetNsAsic( 16, 0.0 ); // Run 160, Ladder 0, Module 1, P, Asic 0 - unpacker_sts ->SetTimeOffsetNsAsic( 17, 0.0 ); // Run 160, Ladder 0, Module 1, P, Asic 1 - unpacker_sts ->SetTimeOffsetNsAsic( 18, 0.0 ); // Run 160, Ladder 0, Module 1, P, Asic 2 - unpacker_sts ->SetTimeOffsetNsAsic( 19, 50.0 ); // Run 160, Ladder 0, Module 1, P, Asic 3 - unpacker_sts ->SetTimeOffsetNsAsic( 20, 0.0 ); // Run 160, Ladder 0, Module 1, P, Asic 4 - unpacker_sts ->SetTimeOffsetNsAsic( 21, 0.0 ); // Run 160, Ladder 0, Module 1, P, Asic 5 - unpacker_sts ->SetTimeOffsetNsAsic( 22, 0.0 ); // Run 160, Ladder 0, Module 1, P, Asic 6 - unpacker_sts ->SetTimeOffsetNsAsic( 23, 25.0 ); // Run 160, Ladder 0, Module 1, P, Asic 7 - unpacker_sts ->SetTimeOffsetNsAsic( 24, 50.0 ); // Run 160, Ladder 0, Module 0, N, Asic 0 - unpacker_sts ->SetTimeOffsetNsAsic( 25, 25.0 ); // Run 160, Ladder 0, Module 0, N, Asic 1 - unpacker_sts ->SetTimeOffsetNsAsic( 26, 50.0 ); // Run 160, Ladder 0, Module 0, N, Asic 2 - unpacker_sts ->SetTimeOffsetNsAsic( 27, 31.25 ); // Run 160, Ladder 0, Module 0, N, Asic 3 - unpacker_sts ->SetTimeOffsetNsAsic( 28, 0.0 ); // Run 160, Ladder 0, Module 0, N, Asic 4 - unpacker_sts ->SetTimeOffsetNsAsic( 29, 6.25 ); // Run 160, Ladder 0, Module 0, N, Asic 5 - unpacker_sts ->SetTimeOffsetNsAsic( 30, 50.0 ); // Run 160, Ladder 0, Module 0, N, Asic 6 - unpacker_sts ->SetTimeOffsetNsAsic( 31, 31.25 ); // Run 160, Ladder 0, Module 0, N, Asic 7 - unpacker_sts ->SetTimeOffsetNsAsic( 32, 0.0 ); // Run 160, Ladder 0, Module 0, P, Asic 0 - unpacker_sts ->SetTimeOffsetNsAsic( 33, 31.25 ); // Run 160, Ladder 0, Module 0, P, Asic 1 - unpacker_sts ->SetTimeOffsetNsAsic( 34, 0.0 ); // Run 160, Ladder 0, Module 0, P, Asic 2 - unpacker_sts ->SetTimeOffsetNsAsic( 35, 25.0 ); // Run 160, Ladder 0, Module 0, P, Asic 3 - unpacker_sts ->SetTimeOffsetNsAsic( 36, 25.0 ); // Run 160, Ladder 0, Module 0, P, Asic 4 - unpacker_sts ->SetTimeOffsetNsAsic( 37, 25.0 ); // Run 160, Ladder 0, Module 0, P, Asic 5 - unpacker_sts ->SetTimeOffsetNsAsic( 38, 0.0 ); // Run 160, Ladder 0, Module 0, P, Asic 6 - unpacker_sts ->SetTimeOffsetNsAsic( 39, 0.0 ); // Run 160, Ladder 0, Module 0, P, Asic 7 - - unpacker_much->SetTimeOffsetNsAsic( 0, 0.0 ); // Run 159, DPB 0 ASIC 0 - unpacker_much->SetTimeOffsetNsAsic( 1, 109.0 ); // Run 159, DPB 0 ASIC 1 - unpacker_much->SetTimeOffsetNsAsic( 2, 142.0 ); // Run 159, DPB 0 ASIC 2 - unpacker_much->SetTimeOffsetNsAsic( 3, 84.0 ); // Run 159, DPB 0 ASIC 3 - unpacker_much->SetTimeOffsetNsAsic( 4, 109.0 ); // Run 159, DPB 0 ASIC 4 - unpacker_much->SetTimeOffsetNsAsic( 5, 0.0 ); // Run 159, DPB 0 ASIC 5 - unpacker_much->SetTimeOffsetNsAsic( 6, 2820915.0 ); // Run 159, DPB 1 ASIC 0 - unpacker_much->SetTimeOffsetNsAsic( 7, 2820905.0 ); // Run 159, DPB 1 ASIC 1 - unpacker_much->SetTimeOffsetNsAsic( 8, 2820785.0 ); // Run 159, DPB 1 ASIC 2 - unpacker_much->SetTimeOffsetNsAsic( 9, 2820915.0 ); // Run 159, DPB 1 ASIC 3 - unpacker_much->SetTimeOffsetNsAsic( 10, 0.0 ); // Run 159, DPB 1 ASIC 4 - unpacker_much->SetTimeOffsetNsAsic( 11, 2820805.0 ); // Run 159, DPB 1 ASIC 5 - unpacker_much->SetTimeOffsetNsAsic( 12, 8144.0 ); // Run 159, DPB 2 ASIC 0 - unpacker_much->SetTimeOffsetNsAsic( 13, 8133.0 ); // Run 159, DPB 2 ASIC 1 - unpacker_much->SetTimeOffsetNsAsic( 14, 0.0 ); // Run 159, DPB 2 ASIC 2 - unpacker_much->SetTimeOffsetNsAsic( 15, 0.0 ); // Run 159, DPB 2 ASIC 3 - unpacker_much->SetTimeOffsetNsAsic( 16, 0.0 ); // Run 159, DPB 2 ASIC 4 - unpacker_much->SetTimeOffsetNsAsic( 17, 0.0 ); // Run 159, DPB 2 ASIC 5 - unpacker_much->SetTimeOffsetNsAsic( 18, 136.0 ); // Run 159, DPB 3 ASIC 0 - unpacker_much->SetTimeOffsetNsAsic( 19, 119.0 ); // Run 159, DPB 3 ASIC 1 - unpacker_much->SetTimeOffsetNsAsic( 20, 141.0 ); // Run 159, DPB 3 ASIC 2 - unpacker_much->SetTimeOffsetNsAsic( 21, 0.0 ); // Run 159, DPB 3 ASIC 3 - unpacker_much->SetTimeOffsetNsAsic( 22, 0.0 ); // Run 159, DPB 3 ASIC 4 - unpacker_much->SetTimeOffsetNsAsic( 23, 0.0 ); // Run 159, DPB 3 ASIC 5 - - break; - } // 159 -*/ + case 707: { + /// General System offsets (= offsets between sub-systems) + //unpacker_sts ->SetTimeOffsetNs( -1750 ); // Run 707 + //unpacker_much->SetTimeOffsetNs( -1750 ); // Run 707 + + /// ASIC specific offsets (= offsets inside sub-system) + unpacker_much->SetTimeOffsetNsAsic(0, 0.0); // Run 707, DPB 0 ASIC 0 + unpacker_much->SetTimeOffsetNsAsic(1, 0.0); // Run 707, DPB 0 ASIC 1 + unpacker_much->SetTimeOffsetNsAsic(2, 0.0); // Run 707, DPB 0 ASIC 2 + unpacker_much->SetTimeOffsetNsAsic(3, 0.0); // Run 707, DPB 0 ASIC 3 + unpacker_much->SetTimeOffsetNsAsic(4, 0.0); // Run 707, DPB 0 ASIC 4 + unpacker_much->SetTimeOffsetNsAsic(5, 0.0); // Run 707, DPB 0 ASIC 5 + unpacker_much->SetTimeOffsetNsAsic(6, 0.0); // Run 707, DPB 1 ASIC 0 + unpacker_much->SetTimeOffsetNsAsic(7, 0.0); // Run 707, DPB 1 ASIC 1 + unpacker_much->SetTimeOffsetNsAsic(8, 0.0); // Run 707, DPB 1 ASIC 2 + unpacker_much->SetTimeOffsetNsAsic(9, 0.0); // Run 707, DPB 1 ASIC 3 + unpacker_much->SetTimeOffsetNsAsic(10, 0.0); // Run 707, DPB 1 ASIC 4 + unpacker_much->SetTimeOffsetNsAsic(11, 0.0); // Run 707, DPB 1 ASIC 5 + unpacker_much->SetTimeOffsetNsAsic(12, 0.0); // Run 707, DPB 2 ASIC 0 + unpacker_much->SetTimeOffsetNsAsic(13, 0.0); // Run 707, DPB 2 ASIC 1 + unpacker_much->SetTimeOffsetNsAsic(14, 0.0); // Run 707, DPB 2 ASIC 2 + unpacker_much->SetTimeOffsetNsAsic(15, 0.0); // Run 707, DPB 2 ASIC 3 + unpacker_much->SetTimeOffsetNsAsic(16, 0.0); // Run 707, DPB 2 ASIC 4 + unpacker_much->SetTimeOffsetNsAsic(17, 0.0); // Run 707, DPB 2 ASIC 5 + unpacker_much->SetTimeOffsetNsAsic(18, 9590.0); // Run 707, DPB 3 ASIC 0 + unpacker_much->SetTimeOffsetNsAsic(19, 9590.0); // Run 707, DPB 3 ASIC 1 + unpacker_much->SetTimeOffsetNsAsic(20, 9630.0); // Run 707, DPB 3 ASIC 2 + unpacker_much->SetTimeOffsetNsAsic(21, 9590.0); // Run 707, DPB 3 ASIC 3 + unpacker_much->SetTimeOffsetNsAsic(22, 0.0); // Run 707, DPB 3 ASIC 4 + unpacker_much->SetTimeOffsetNsAsic(23, 0.0); // Run 707, DPB 3 ASIC 5 + unpacker_much->SetTimeOffsetNsAsic(24, 0.0); // Run 707, DPB 4 ASIC 0 + unpacker_much->SetTimeOffsetNsAsic(25, 0.0); // Run 707, DPB 4 ASIC 1 + unpacker_much->SetTimeOffsetNsAsic(26, 0.0); // Run 707, DPB 4 ASIC 2 + unpacker_much->SetTimeOffsetNsAsic(27, 0.0); // Run 707, DPB 4 ASIC 3 + unpacker_much->SetTimeOffsetNsAsic(28, 0.0); // Run 707, DPB 4 ASIC 4 + unpacker_much->SetTimeOffsetNsAsic(29, 0.0); // Run 707, DPB 4 ASIC 5 + unpacker_much->SetTimeOffsetNsAsic(30, 0.0); // Run 707, DPB 5 ASIC 0 + unpacker_much->SetTimeOffsetNsAsic(31, 0.0); // Run 707, DPB 5 ASIC 1 + unpacker_much->SetTimeOffsetNsAsic(32, 7170.0); // Run 707, DPB 5 ASIC 2 + unpacker_much->SetTimeOffsetNsAsic(33, 7170.0); // Run 707, DPB 5 ASIC 3 + unpacker_much->SetTimeOffsetNsAsic(34, 0.0); // Run 707, DPB 5 ASIC 4 + unpacker_much->SetTimeOffsetNsAsic(35, 0.0); // Run 707, DPB 5 ASIC 5 + break; + } // 707 + case 750: { + /// General System offsets (= offsets between sub-systems) + //unpacker_sts ->SetTimeOffsetNs( -1750 ); // Run 750 + //unpacker_much->SetTimeOffsetNs( -1750 ); // Run 750 + + /// ASIC specific offsets (= offsets inside sub-system) + unpacker_much->SetTimeOffsetNsAsic(0, 0.0); // Run 750, DPB 0 ASIC 0 + unpacker_much->SetTimeOffsetNsAsic(1, 0.0); // Run 750, DPB 0 ASIC 1 + unpacker_much->SetTimeOffsetNsAsic(2, 0.0); // Run 750, DPB 0 ASIC 2 + unpacker_much->SetTimeOffsetNsAsic(3, 0.0); // Run 750, DPB 0 ASIC 3 + unpacker_much->SetTimeOffsetNsAsic(4, 0.0); // Run 750, DPB 0 ASIC 4 + unpacker_much->SetTimeOffsetNsAsic(5, 0.0); // Run 750, DPB 0 ASIC 5 + unpacker_much->SetTimeOffsetNsAsic(6, 0.0); // Run 750, DPB 1 ASIC 0 + unpacker_much->SetTimeOffsetNsAsic(7, 0.0); // Run 750, DPB 1 ASIC 1 + unpacker_much->SetTimeOffsetNsAsic(8, 0.0); // Run 750, DPB 1 ASIC 2 + unpacker_much->SetTimeOffsetNsAsic(9, 0.0); // Run 750, DPB 1 ASIC 3 + unpacker_much->SetTimeOffsetNsAsic(10, 0.0); // Run 750, DPB 1 ASIC 4 + unpacker_much->SetTimeOffsetNsAsic(11, 0.0); // Run 750, DPB 1 ASIC 5 + unpacker_much->SetTimeOffsetNsAsic(12, 0.0); // Run 750, DPB 2 ASIC 0 + unpacker_much->SetTimeOffsetNsAsic(13, 0.0); // Run 750, DPB 2 ASIC 1 + unpacker_much->SetTimeOffsetNsAsic(14, 0.0); // Run 750, DPB 2 ASIC 2 + unpacker_much->SetTimeOffsetNsAsic(15, 0.0); // Run 750, DPB 2 ASIC 3 + unpacker_much->SetTimeOffsetNsAsic(16, 0.0); // Run 750, DPB 2 ASIC 4 + unpacker_much->SetTimeOffsetNsAsic(17, 0.0); // Run 750, DPB 2 ASIC 5 + unpacker_much->SetTimeOffsetNsAsic(18, 6400.0); // Run 750, DPB 3 ASIC 0 + unpacker_much->SetTimeOffsetNsAsic(19, 6400.0); // Run 750, DPB 3 ASIC 1 + unpacker_much->SetTimeOffsetNsAsic(20, 6400.0); // Run 750, DPB 3 ASIC 2 + unpacker_much->SetTimeOffsetNsAsic(21, 6400.0); // Run 750, DPB 3 ASIC 3 + unpacker_much->SetTimeOffsetNsAsic(22, 0.0); // Run 750, DPB 3 ASIC 4 + unpacker_much->SetTimeOffsetNsAsic(23, 0.0); // Run 750, DPB 3 ASIC 5 + unpacker_much->SetTimeOffsetNsAsic(24, 0.0); // Run 750, DPB 4 ASIC 0 + unpacker_much->SetTimeOffsetNsAsic(25, 0.0); // Run 750, DPB 4 ASIC 1 + unpacker_much->SetTimeOffsetNsAsic(26, 0.0); // Run 750, DPB 4 ASIC 2 + unpacker_much->SetTimeOffsetNsAsic(27, 0.0); // Run 750, DPB 4 ASIC 3 + unpacker_much->SetTimeOffsetNsAsic(28, 0.0); // Run 750, DPB 4 ASIC 4 + unpacker_much->SetTimeOffsetNsAsic(29, 0.0); // Run 750, DPB 4 ASIC 5 + unpacker_much->SetTimeOffsetNsAsic(30, 0.0); // Run 750, DPB 5 ASIC 0 + unpacker_much->SetTimeOffsetNsAsic(31, 0.0); // Run 750, DPB 5 ASIC 1 + unpacker_much->SetTimeOffsetNsAsic(32, 3170.0); // Run 750, DPB 5 ASIC 2 + unpacker_much->SetTimeOffsetNsAsic(33, 3170.0); // Run 750, DPB 5 ASIC 3 + unpacker_much->SetTimeOffsetNsAsic(34, 0.0); // Run 750, DPB 5 ASIC 4 + unpacker_much->SetTimeOffsetNsAsic(35, 0.0); // Run 750, DPB 5 ASIC 5 + break; + } // 750 + case 759: { + /// General System offsets (= offsets between sub-systems) + //unpacker_sts ->SetTimeOffsetNs( -1759 ); // Run 759 + //unpacker_much->SetTimeOffsetNs( -1759 ); // Run 759 + unpacker_trdR->SetTimeOffsetNs(190); // Run 759 + + /// ASIC specific offsets (= offsets inside sub-system) + unpacker_much->SetTimeOffsetNsAsic(0, 0.0); // Run 759, DPB 0 ASIC 0 + unpacker_much->SetTimeOffsetNsAsic(1, 0.0); // Run 759, DPB 0 ASIC 1 + unpacker_much->SetTimeOffsetNsAsic(2, 0.0); // Run 759, DPB 0 ASIC 2 + unpacker_much->SetTimeOffsetNsAsic(3, 0.0); // Run 759, DPB 0 ASIC 3 + unpacker_much->SetTimeOffsetNsAsic(4, 0.0); // Run 759, DPB 0 ASIC 4 + unpacker_much->SetTimeOffsetNsAsic(5, 0.0); // Run 759, DPB 0 ASIC 5 + unpacker_much->SetTimeOffsetNsAsic(6, 0.0); // Run 759, DPB 1 ASIC 0 + unpacker_much->SetTimeOffsetNsAsic(7, 0.0); // Run 759, DPB 1 ASIC 1 + unpacker_much->SetTimeOffsetNsAsic(8, 0.0); // Run 759, DPB 1 ASIC 2 + unpacker_much->SetTimeOffsetNsAsic(9, 0.0); // Run 759, DPB 1 ASIC 3 + unpacker_much->SetTimeOffsetNsAsic(10, 0.0); // Run 759, DPB 1 ASIC 4 + unpacker_much->SetTimeOffsetNsAsic(11, 0.0); // Run 759, DPB 1 ASIC 5 + unpacker_much->SetTimeOffsetNsAsic(12, 0.0); // Run 759, DPB 2 ASIC 0 + unpacker_much->SetTimeOffsetNsAsic(13, 0.0); // Run 759, DPB 2 ASIC 1 + unpacker_much->SetTimeOffsetNsAsic(14, 0.0); // Run 759, DPB 2 ASIC 2 + unpacker_much->SetTimeOffsetNsAsic(15, 0.0); // Run 759, DPB 2 ASIC 3 + unpacker_much->SetTimeOffsetNsAsic(16, 0.0); // Run 759, DPB 2 ASIC 4 + unpacker_much->SetTimeOffsetNsAsic(17, 0.0); // Run 759, DPB 2 ASIC 5 + unpacker_much->SetTimeOffsetNsAsic(18, 3200.0); // Run 759, DPB 3 ASIC 0 + unpacker_much->SetTimeOffsetNsAsic(19, 3200.0); // Run 759, DPB 3 ASIC 1 + unpacker_much->SetTimeOffsetNsAsic(20, 3200.0); // Run 759, DPB 3 ASIC 2 + unpacker_much->SetTimeOffsetNsAsic(21, 3200.0); // Run 759, DPB 3 ASIC 3 + unpacker_much->SetTimeOffsetNsAsic(22, 0.0); // Run 759, DPB 3 ASIC 4 + unpacker_much->SetTimeOffsetNsAsic(23, 0.0); // Run 759, DPB 3 ASIC 5 + unpacker_much->SetTimeOffsetNsAsic(24, 3200.0); // Run 759, DPB 4 ASIC 0 + unpacker_much->SetTimeOffsetNsAsic(25, 3200.0); // Run 759, DPB 4 ASIC 1 + unpacker_much->SetTimeOffsetNsAsic(26, 3200.0); // Run 759, DPB 4 ASIC 2 + unpacker_much->SetTimeOffsetNsAsic(27, 0.0); // Run 759, DPB 4 ASIC 3 + unpacker_much->SetTimeOffsetNsAsic(28, 0.0); // Run 759, DPB 4 ASIC 4 + unpacker_much->SetTimeOffsetNsAsic(29, 0.0); // Run 759, DPB 4 ASIC 5 + unpacker_much->SetTimeOffsetNsAsic(30, 0.0); // Run 759, DPB 5 ASIC 0 + unpacker_much->SetTimeOffsetNsAsic(31, 0.0); // Run 759, DPB 5 ASIC 1 + unpacker_much->SetTimeOffsetNsAsic(32, -30.0); // Run 759, DPB 5 ASIC 2 + unpacker_much->SetTimeOffsetNsAsic(33, -30.0); // Run 759, DPB 5 ASIC 3 + unpacker_much->SetTimeOffsetNsAsic(34, 0.0); // Run 759, DPB 5 ASIC 4 + unpacker_much->SetTimeOffsetNsAsic(35, 0.0); // Run 759, DPB 5 ASIC 5 + break; + } // 759 + case 760: { + /// General System offsets (= offsets between sub-systems) + //unpacker_sts ->SetTimeOffsetNs( -1760 ); // Run 760 + //unpacker_much->SetTimeOffsetNs( -1760 ); // Run 760 + unpacker_trdR->SetTimeOffsetNs(-75); // Run 760 + + /// ASIC specific offsets (= offsets inside sub-system) + unpacker_much->SetTimeOffsetNsAsic(0, 0.0); // Run 760, DPB 0 ASIC 0 + unpacker_much->SetTimeOffsetNsAsic(1, 0.0); // Run 760, DPB 0 ASIC 1 + unpacker_much->SetTimeOffsetNsAsic(2, 0.0); // Run 760, DPB 0 ASIC 2 + unpacker_much->SetTimeOffsetNsAsic(3, 0.0); // Run 760, DPB 0 ASIC 3 + unpacker_much->SetTimeOffsetNsAsic(4, 0.0); // Run 760, DPB 0 ASIC 4 + unpacker_much->SetTimeOffsetNsAsic(5, 0.0); // Run 760, DPB 0 ASIC 5 + unpacker_much->SetTimeOffsetNsAsic(6, 0.0); // Run 760, DPB 1 ASIC 0 + unpacker_much->SetTimeOffsetNsAsic(7, 0.0); // Run 760, DPB 1 ASIC 1 + unpacker_much->SetTimeOffsetNsAsic(8, 0.0); // Run 760, DPB 1 ASIC 2 + unpacker_much->SetTimeOffsetNsAsic(9, 0.0); // Run 760, DPB 1 ASIC 3 + unpacker_much->SetTimeOffsetNsAsic(10, 0.0); // Run 760, DPB 1 ASIC 4 + unpacker_much->SetTimeOffsetNsAsic(11, 0.0); // Run 760, DPB 1 ASIC 5 + unpacker_much->SetTimeOffsetNsAsic(12, 0.0); // Run 760, DPB 2 ASIC 0 + unpacker_much->SetTimeOffsetNsAsic(13, 0.0); // Run 760, DPB 2 ASIC 1 + unpacker_much->SetTimeOffsetNsAsic(14, 0.0); // Run 760, DPB 2 ASIC 2 + unpacker_much->SetTimeOffsetNsAsic(15, 0.0); // Run 760, DPB 2 ASIC 3 + unpacker_much->SetTimeOffsetNsAsic(16, 0.0); // Run 760, DPB 2 ASIC 4 + unpacker_much->SetTimeOffsetNsAsic(17, 0.0); // Run 760, DPB 2 ASIC 5 + unpacker_much->SetTimeOffsetNsAsic(18, 0.0); // Run 760, DPB 3 ASIC 0 + unpacker_much->SetTimeOffsetNsAsic(19, 0.0); // Run 760, DPB 3 ASIC 1 + unpacker_much->SetTimeOffsetNsAsic(20, 0.0); // Run 760, DPB 3 ASIC 2 + unpacker_much->SetTimeOffsetNsAsic(21, 0.0); // Run 760, DPB 3 ASIC 3 + unpacker_much->SetTimeOffsetNsAsic(22, 0.0); // Run 760, DPB 3 ASIC 4 + unpacker_much->SetTimeOffsetNsAsic(23, 0.0); // Run 760, DPB 3 ASIC 5 + unpacker_much->SetTimeOffsetNsAsic(24, 3160.0); // Run 760, DPB 4 ASIC 0 + unpacker_much->SetTimeOffsetNsAsic(25, 3160.0); // Run 760, DPB 4 ASIC 1 + unpacker_much->SetTimeOffsetNsAsic(26, 3160.0); // Run 760, DPB 4 ASIC 2 + unpacker_much->SetTimeOffsetNsAsic(27, 0.0); // Run 760, DPB 4 ASIC 3 + unpacker_much->SetTimeOffsetNsAsic(28, 0.0); // Run 760, DPB 4 ASIC 4 + unpacker_much->SetTimeOffsetNsAsic(29, 0.0); // Run 760, DPB 4 ASIC 5 + unpacker_much->SetTimeOffsetNsAsic(30, 0.0); // Run 760, DPB 5 ASIC 0 + unpacker_much->SetTimeOffsetNsAsic(31, 0.0); // Run 760, DPB 5 ASIC 1 + unpacker_much->SetTimeOffsetNsAsic(32, -30.0); // Run 760, DPB 5 ASIC 2 + unpacker_much->SetTimeOffsetNsAsic(33, -30.0); // Run 760, DPB 5 ASIC 3 + unpacker_much->SetTimeOffsetNsAsic(34, 0.0); // Run 760, DPB 5 ASIC 4 + unpacker_much->SetTimeOffsetNsAsic(35, 0.0); // Run 760, DPB 5 ASIC 5 + break; + } // 760 + case 761: { + /// General System offsets (= offsets between sub-systems) + //unpacker_sts ->SetTimeOffsetNs( -1761 ); // Run 761 + //unpacker_much->SetTimeOffsetNs( -1761 ); // Run 761 + unpacker_trdR->SetTimeOffsetNs(90); // Run 761 + + /// ASIC specific offsets (= offsets inside sub-system) + unpacker_much->SetTimeOffsetNsAsic(0, 0.0); // Run 761, DPB 0 ASIC 0 + unpacker_much->SetTimeOffsetNsAsic(1, 0.0); // Run 761, DPB 0 ASIC 1 + unpacker_much->SetTimeOffsetNsAsic(2, 0.0); // Run 761, DPB 0 ASIC 2 + unpacker_much->SetTimeOffsetNsAsic(3, 0.0); // Run 761, DPB 0 ASIC 3 + unpacker_much->SetTimeOffsetNsAsic(4, 0.0); // Run 761, DPB 0 ASIC 4 + unpacker_much->SetTimeOffsetNsAsic(5, 0.0); // Run 761, DPB 0 ASIC 5 + unpacker_much->SetTimeOffsetNsAsic(6, 0.0); // Run 761, DPB 1 ASIC 0 + unpacker_much->SetTimeOffsetNsAsic(7, 0.0); // Run 761, DPB 1 ASIC 1 + unpacker_much->SetTimeOffsetNsAsic(8, 0.0); // Run 761, DPB 1 ASIC 2 + unpacker_much->SetTimeOffsetNsAsic(9, 0.0); // Run 761, DPB 1 ASIC 3 + unpacker_much->SetTimeOffsetNsAsic(10, 0.0); // Run 761, DPB 1 ASIC 4 + unpacker_much->SetTimeOffsetNsAsic(11, 0.0); // Run 761, DPB 1 ASIC 5 + unpacker_much->SetTimeOffsetNsAsic(12, 0.0); // Run 761, DPB 2 ASIC 0 + unpacker_much->SetTimeOffsetNsAsic(13, 0.0); // Run 761, DPB 2 ASIC 1 + unpacker_much->SetTimeOffsetNsAsic(14, 0.0); // Run 761, DPB 2 ASIC 2 + unpacker_much->SetTimeOffsetNsAsic(15, 0.0); // Run 761, DPB 2 ASIC 3 + unpacker_much->SetTimeOffsetNsAsic(16, 0.0); // Run 761, DPB 2 ASIC 4 + unpacker_much->SetTimeOffsetNsAsic(17, 0.0); // Run 761, DPB 2 ASIC 5 + unpacker_much->SetTimeOffsetNsAsic(18, 3200.0); // Run 761, DPB 3 ASIC 0 + unpacker_much->SetTimeOffsetNsAsic(19, 3200.0); // Run 761, DPB 3 ASIC 1 + unpacker_much->SetTimeOffsetNsAsic(20, 3200.0); // Run 761, DPB 3 ASIC 2 + unpacker_much->SetTimeOffsetNsAsic(21, 3200.0); // Run 761, DPB 3 ASIC 3 + unpacker_much->SetTimeOffsetNsAsic(22, 0.0); // Run 761, DPB 3 ASIC 4 + unpacker_much->SetTimeOffsetNsAsic(23, 0.0); // Run 761, DPB 3 ASIC 5 + unpacker_much->SetTimeOffsetNsAsic(24, 6360.0); // Run 761, DPB 4 ASIC 0 + unpacker_much->SetTimeOffsetNsAsic(25, 6360.0); // Run 761, DPB 4 ASIC 1 + unpacker_much->SetTimeOffsetNsAsic(26, 6360.0); // Run 761, DPB 4 ASIC 2 + unpacker_much->SetTimeOffsetNsAsic(27, 0.0); // Run 761, DPB 4 ASIC 3 + unpacker_much->SetTimeOffsetNsAsic(28, 0.0); // Run 761, DPB 4 ASIC 4 + unpacker_much->SetTimeOffsetNsAsic(29, 0.0); // Run 761, DPB 4 ASIC 5 + unpacker_much->SetTimeOffsetNsAsic(30, 0.0); // Run 761, DPB 5 ASIC 0 + unpacker_much->SetTimeOffsetNsAsic(31, 0.0); // Run 761, DPB 5 ASIC 1 + unpacker_much->SetTimeOffsetNsAsic(32, 6360.0); // Run 761, DPB 5 ASIC 2 + unpacker_much->SetTimeOffsetNsAsic(33, 6360.0); // Run 761, DPB 5 ASIC 3 + unpacker_much->SetTimeOffsetNsAsic(34, 0.0); // Run 761, DPB 5 ASIC 4 + unpacker_much->SetTimeOffsetNsAsic(35, 0.0); // Run 761, DPB 5 ASIC 5 + break; + } // 761 + case 762: { + /// General System offsets (= offsets between sub-systems) + //unpacker_sts ->SetTimeOffsetNs( -1762 ); // Run 762 + //unpacker_much->SetTimeOffsetNs( -1762 ); // Run 762 + unpacker_trdR->SetTimeOffsetNs(60); // Run 762 + + /// ASIC specific offsets (= offsets inside sub-system) + unpacker_much->SetTimeOffsetNsAsic(0, 0.0); // Run 762, DPB 0 ASIC 0 + unpacker_much->SetTimeOffsetNsAsic(1, 0.0); // Run 762, DPB 0 ASIC 1 + unpacker_much->SetTimeOffsetNsAsic(2, 0.0); // Run 762, DPB 0 ASIC 2 + unpacker_much->SetTimeOffsetNsAsic(3, 0.0); // Run 762, DPB 0 ASIC 3 + unpacker_much->SetTimeOffsetNsAsic(4, 0.0); // Run 762, DPB 0 ASIC 4 + unpacker_much->SetTimeOffsetNsAsic(5, 0.0); // Run 762, DPB 0 ASIC 5 + unpacker_much->SetTimeOffsetNsAsic(6, 0.0); // Run 762, DPB 1 ASIC 0 + unpacker_much->SetTimeOffsetNsAsic(7, 0.0); // Run 762, DPB 1 ASIC 1 + unpacker_much->SetTimeOffsetNsAsic(8, 0.0); // Run 762, DPB 1 ASIC 2 + unpacker_much->SetTimeOffsetNsAsic(9, 0.0); // Run 762, DPB 1 ASIC 3 + unpacker_much->SetTimeOffsetNsAsic(10, 0.0); // Run 762, DPB 1 ASIC 4 + unpacker_much->SetTimeOffsetNsAsic(11, 0.0); // Run 762, DPB 1 ASIC 5 + unpacker_much->SetTimeOffsetNsAsic(12, 0.0); // Run 762, DPB 2 ASIC 0 + unpacker_much->SetTimeOffsetNsAsic(13, 0.0); // Run 762, DPB 2 ASIC 1 + unpacker_much->SetTimeOffsetNsAsic(14, 0.0); // Run 762, DPB 2 ASIC 2 + unpacker_much->SetTimeOffsetNsAsic(15, 0.0); // Run 762, DPB 2 ASIC 3 + unpacker_much->SetTimeOffsetNsAsic(16, 0.0); // Run 762, DPB 2 ASIC 4 + unpacker_much->SetTimeOffsetNsAsic(17, 0.0); // Run 762, DPB 2 ASIC 5 + unpacker_much->SetTimeOffsetNsAsic(18, 4800.0); // Run 762, DPB 3 ASIC 0 + unpacker_much->SetTimeOffsetNsAsic(19, 4800.0); // Run 762, DPB 3 ASIC 1 + unpacker_much->SetTimeOffsetNsAsic(20, 4800.0); // Run 762, DPB 3 ASIC 2 + unpacker_much->SetTimeOffsetNsAsic(21, 4800.0); // Run 762, DPB 3 ASIC 3 + unpacker_much->SetTimeOffsetNsAsic(22, 0.0); // Run 762, DPB 3 ASIC 4 + unpacker_much->SetTimeOffsetNsAsic(23, 0.0); // Run 762, DPB 3 ASIC 5 + unpacker_much->SetTimeOffsetNsAsic(24, 9550.0); // Run 762, DPB 4 ASIC 0 + unpacker_much->SetTimeOffsetNsAsic(25, 9550.0); // Run 762, DPB 4 ASIC 1 + unpacker_much->SetTimeOffsetNsAsic(26, 9550.0); // Run 762, DPB 4 ASIC 2 + unpacker_much->SetTimeOffsetNsAsic(27, 0.0); // Run 762, DPB 4 ASIC 3 + unpacker_much->SetTimeOffsetNsAsic(28, 0.0); // Run 762, DPB 4 ASIC 4 + unpacker_much->SetTimeOffsetNsAsic(29, 0.0); // Run 762, DPB 4 ASIC 5 + unpacker_much->SetTimeOffsetNsAsic(30, 0.0); // Run 762, DPB 5 ASIC 0 + unpacker_much->SetTimeOffsetNsAsic(31, 0.0); // Run 762, DPB 5 ASIC 1 + unpacker_much->SetTimeOffsetNsAsic(32, -30.0); // Run 762, DPB 5 ASIC 2 + unpacker_much->SetTimeOffsetNsAsic(33, -30.0); // Run 762, DPB 5 ASIC 3 + unpacker_much->SetTimeOffsetNsAsic(34, 0.0); // Run 762, DPB 5 ASIC 4 + unpacker_much->SetTimeOffsetNsAsic(35, 0.0); // Run 762, DPB 5 ASIC 5 + break; + } // 762 + case 811: { + unpacker_trdR->SetTimeOffsetNs(84.38); + break; + } // 811 + case 812: { + unpacker_trdR->SetTimeOffsetNs(165.62); + break; + } // 812 + case 816: { + unpacker_trdR->SetTimeOffsetNs(-9.38); + break; + } // 816 + case 819: { + unpacker_trdR->SetTimeOffsetNs(-140.62); + break; + } // 819 + case 820: { + unpacker_trdR->SetTimeOffsetNs(109.38); + break; + } // 820 + case 821: { + unpacker_trdR->SetTimeOffsetNs(-65.62); + break; + } // 821 + case 822: { + unpacker_trdR->SetTimeOffsetNs(59.38); + break; + } // 822 + case 824: { + unpacker_trdR->SetTimeOffsetNs(-165.62); + break; + } // 824 + case 826: { + unpacker_trdR->SetTimeOffsetNs(59.38); + break; + } // 826 + case 827: { + unpacker_trdR->SetTimeOffsetNs(-15.62); + break; + } // 827 + case 828: { + unpacker_trdR->SetTimeOffsetNs(-109.38); + break; + } // 828 + case 830: { + unpacker_trdR->SetTimeOffsetNs(15.62); + break; + } // 830 + case 831: { + // unpacker_trdR->SetTimeOffsetNs( 70.00 ); + unpacker_trdR->SetTimeOffsetNs(-25.00); + + std::cout << "MUCH: Feb by feb time offset correction......" << std::endl; + UInt_t uRun, uNx; + Double_t offset; + ifstream infile_off(paramDir + "/parameters/time_offset_much.txt"); + if (!infile_off) { + std::cout << "can not open time offset MUCH parameter List" << std::endl; + return kFALSE; + } // if (!infile_off) + while (!infile_off.eof()) { + infile_off >> uRun >> uNx >> offset; + if(uRun != 831) continue; + unpacker_much->SetTimeOffsetNsAsic(uNx, offset); + } // while (!infile_off.eof()) + infile_off.close(); + std::cout << "masking noisy channels......" << std::endl; + UInt_t uChan = 0; + ifstream infile_noise(paramDir + "parameters/much_noisy_channel_list.txt"); + if (!infile_noise) { + std::cout << "can not open MUCH noisy channel List" << std::endl; + return kFALSE; + } // if (!infile_noise) + while (!infile_noise.eof()) { + infile_noise >> uRun >> uNx >> uChan; + if(uRun != 831) continue; + unpacker_much->MaskNoisyChannel(uNx, uChan, kTRUE ); + } // while (!infile_noise.eof()) + infile_noise.close(); + break; + } // 831 + case 836: { + unpacker_trdR->SetTimeOffsetNs(-40.62); + break; + } // 836 default: break; } // switch( uRunId ) + /// FIXME: Re-enable clang formatting after parameters tuning + /* clang-format on */ // --- Source task CbmMcbm2018Source* source = new CbmMcbm2018Source(); - /* - TString inFile = Form( "/scratch/mcbm_data/mcbm_all/data/%3u_pn02_0000.tsa;", uRunId ); - inFile += Form( "/scratch/mcbm_data/mcbm_all/data/%3u_pn04_0000.tsa;", uRunId ); - inFile += Form( "/scratch/mcbm_data/mcbm_all/data/%3u_pn05_0000.tsa;", uRunId ); - inFile += Form( "/scratch/mcbm_data/mcbm_all/data/%3u_pn06_0000.tsa;", uRunId ); - inFile += Form( "/scratch/mcbm_data/mcbm_all/data/%3u_pn08_0000.tsa;", uRunId ); - inFile += Form( "/scratch/mcbm_data/mcbm_all/data/%3u_pn10_0000.tsa;", uRunId ); - inFile += Form( "/scratch/mcbm_data/mcbm_all/data/%3u_pn11_0000.tsa;", uRunId ); - inFile += Form( "/scratch/mcbm_data/mcbm_all/data/%3u_pn12_0000.tsa;", uRunId ); - inFile += Form( "/scratch/mcbm_data/mcbm_all/data/%3u_pn13_0000.tsa;", uRunId ); - inFile += Form( "/scratch/mcbm_data/mcbm_all/data/%3u_pn15_0000.tsa", uRunId ); -*/ - /* - TString inFile = Form( "/scratch/mcbm_data/mcbm_all/data/%3u_pn02_0003.tsa;", uRunId ); - inFile += Form( "/scratch/mcbm_data/mcbm_all/data/%3u_pn04_0003.tsa;", uRunId ); - inFile += Form( "/scratch/mcbm_data/mcbm_all/data/%3u_pn05_0003.tsa;", uRunId ); - inFile += Form( "/scratch/mcbm_data/mcbm_all/data/%3u_pn06_0003.tsa;", uRunId ); - inFile += Form( "/scratch/mcbm_data/mcbm_all/data/%3u_pn08_0003.tsa;", uRunId ); - inFile += Form( "/scratch/mcbm_data/mcbm_all/data/%3u_pn10_0003.tsa;", uRunId ); - inFile += Form( "/scratch/mcbm_data/mcbm_all/data/%3u_pn11_0003.tsa;", uRunId ); - inFile += Form( "/scratch/mcbm_data/mcbm_all/data/%3u_pn12_0003.tsa;", uRunId ); - inFile += Form( "/scratch/mcbm_data/mcbm_all/data/%3u_pn13_0003.tsa;", uRunId ); - inFile += Form( "/scratch/mcbm_data/mcbm_all/data/%3u_pn15_0003.tsa", uRunId ); -*/ - TString inFile = Form("/scratch/mcbm_data/mcbm_all/data/%3u_pn02_*.tsa;", uRunId); - inFile += Form("/scratch/mcbm_data/mcbm_all/data/%3u_pn04_*.tsa;", uRunId); - inFile += Form("/scratch/mcbm_data/mcbm_all/data/%3u_pn05_*.tsa;", uRunId); - inFile += Form("/scratch/mcbm_data/mcbm_all/data/%3u_pn06_*.tsa;", uRunId); - inFile += Form("/scratch/mcbm_data/mcbm_all/data/%3u_pn08_*.tsa;", uRunId); - inFile += Form("/scratch/mcbm_data/mcbm_all/data/%3u_pn10_*.tsa;", uRunId); - inFile += Form("/scratch/mcbm_data/mcbm_all/data/%3u_pn11_*.tsa;", uRunId); - inFile += Form("/scratch/mcbm_data/mcbm_all/data/%3u_pn12_*.tsa;", uRunId); - inFile += Form("/scratch/mcbm_data/mcbm_all/data/%3u_pn13_*.tsa;", uRunId); - inFile += Form("/scratch/mcbm_data/mcbm_all/data/%3u_pn15_*.tsa", uRunId); - - if (415 < uRunId) { - inFile = Form("/scratch/mcbm_data/mcbm_all/pulser/%3u_pn02_*.tsa;", uRunId); - inFile += Form("/scratch/mcbm_data/mcbm_all/pulser/%3u_pn04_*.tsa;", uRunId); - inFile += Form("/scratch/mcbm_data/mcbm_all/pulser/%3u_pn05_*.tsa;", uRunId); - inFile += Form("/scratch/mcbm_data/mcbm_all/pulser/%3u_pn06_*.tsa;", uRunId); - inFile += Form("/scratch/mcbm_data/mcbm_all/pulser/%3u_pn08_*.tsa;", uRunId); - inFile += Form("/scratch/mcbm_data/mcbm_all/pulser/%3u_pn10_*.tsa;", uRunId); - inFile += Form("/scratch/mcbm_data/mcbm_all/pulser/%3u_pn11_*.tsa;", uRunId); - inFile += Form("/scratch/mcbm_data/mcbm_all/pulser/%3u_pn12_*.tsa;", uRunId); - inFile += Form("/scratch/mcbm_data/mcbm_all/pulser/%3u_pn13_*.tsa;", uRunId); - inFile += Form("/scratch/mcbm_data/mcbm_all/pulser/%3u_pn15_*.tsa", uRunId); - } // if( 415 < uRunId ) - if (430 < uRunId) { - inFile = Form("/scratch/mcbm_data/mcbm_all/data/%3u_pn02_*.tsa;", uRunId); - inFile += Form("/scratch/mcbm_data/mcbm_all/data/%3u_pn04_*.tsa;", uRunId); - inFile += Form("/scratch/mcbm_data/mcbm_all/data/%3u_pn06_*.tsa;", uRunId); - inFile += Form("/scratch/mcbm_data/mcbm_all/data/%3u_pn08_*.tsa;", uRunId); - inFile += Form("/scratch/mcbm_data/mcbm_all/data/%3u_pn10_*.tsa;", uRunId); - inFile += Form("/scratch/mcbm_data/mcbm_all/data/%3u_pn11_*.tsa;", uRunId); - inFile += Form("/scratch/mcbm_data/mcbm_all/data/%3u_pn12_*.tsa;", uRunId); - inFile += Form("/scratch/mcbm_data/mcbm_all/data/%3u_pn13_*.tsa;", uRunId); - inFile += Form("/scratch/mcbm_data/mcbm_all/data/%3u_pn15_*.tsa", uRunId); - } // if( 430 < uRunId ) - - if (0 < uRunId) { source->SetFileName(inFile); } // if( "" != inFile ) - else { - source->SetHostName(sHostname); - source->SetSubscriberHwm(10); - } // else of if( "" != inFile ) + source->SetFileName(inFile); - // source->SetInputDir(inDir); - source->AddUnpacker(unpacker_sts, 0x10, ECbmModuleId::kSts); //STS xyter - source->AddUnpacker(unpacker_much, 0x50, ECbmModuleId::kMuch); //MUCH xyter + source->AddUnpacker(unpacker_sts, 0x10, ECbmModuleId::kSts); // STS xyter + source->AddUnpacker(unpacker_much, 0x50, ECbmModuleId::kMuch); // MUCH xyter if (isActiveTrd) source->AddUnpacker(unpacker_trdR, 0x40, ECbmModuleId::kTrd); // Trd - source->AddUnpacker(unpacker_tof, 0x60, ECbmModuleId::kTof); //gDPB A & B & C - source->AddUnpacker(unpacker_tof, 0x90, ECbmModuleId::kTof); //gDPB T0 A & B - source->AddUnpacker(unpacker_rich, 0x30, ECbmModuleId::kRich); //RICH trb - source->AddUnpacker(unpacker_psd, 0x80, ECbmModuleId::kPsd); //PSD - + source->AddUnpacker(unpacker_tof, 0x60, ECbmModuleId::kTof); // gDPB TOF + source->AddUnpacker(unpacker_tof, 0x90, ECbmModuleId::kTof); // gDPB T0 + source->AddUnpacker(unpacker_rich, 0x30, ECbmModuleId::kRich); // RICH trb + source->AddUnpacker(unpacker_psd, 0x80, ECbmModuleId::kPsd); // PSD + + /// Select a pre-identified spills block through block index + block length (in spills) + /// Also select where we split the spills: beginning, middle or end of the spill break + source->UnpackSelectSpills(iSpillIndex * iSpillnumber, iSpillIndex * iSpillnumber + iSpillnumber - 1, uSpillLimType); + /// Disable clang formatting around vectors initialization by lists + /* clang-format off */ + switch (uRunId) { + case 831: { + source->LoadTsListSpillBreakBegin(std::vector<ULong64_t>( + { 1, 933, 1941, 2949, 4349, 5357, 6365, 7373, 8773, 9781, + 10789, 11801, 13197, 14209, 15217, 16225, 17625, 18633, 19645, 20653, + 22053, 23061, 24069, 25077, 26473, 27481, 28493, 29501, 30897, 31905, + 32913, 33921, 35321, 36329, 37337, 38345, 39745, 40753, 41761, 42769, + 44169, 45177, 46185, 47193, 48593})); + source->LoadTsListSpillBreakMiddle(std::vector<ULong64_t>( + { 111, 1081, 2087, 3299, 4495, 5503, 6513, 7721, 8921, 9927, + 10935, 12149, 13347, 14355, 15363, 16573, 17773, 18781, 19791, 21001, + 22199, 23209, 24215, 25423, 26619, 27629, 28637, 29847, 31045, 32051, + 33059, 34275, 35469, 36475, 37483, 38693, 39889, 40899, 41907, 43117, + 44315, 45323, 46333, 47543, 48689})); + source->LoadTsListSpillBreakEnd(std::vector<ULong64_t>( + { 221, 1229, 2233, 3649, 4641, 5649, 6661, 8069, 9069, 10073, + 11081, 12497, 13497, 14501, 15509, 16921, 17921, 18929, 19937, 21349, + 22345, 23357, 24361, 25769, 26765, 27777, 28781, 30193, 31193, 32197, + 33205, 34629, 35617, 36621, 37629, 39041, 40033, 41045, 42053, 43465, + 44461, 45469, 46481, 47893, 48786})); + break; + } // case 831 + } // switch (uRunId) + /// Re-enable clang formatting after vectors initialization by lists + /* clang-format on */ // --- Run run = new FairRunOnline(source); - run->ActivateHttpServer(iServerRefreshRate, - iServerHttpPort); // refresh each 100 events - /// To avoid the server sucking all Histos from gROOT when no output file is used - /// ===> Need to explicitely add the canvases to the server in the task! - run->GetHttpServer()->GetSniffer()->SetScanGlobalDir(kFALSE); run->SetAutoFinish(kFALSE); CbmMcbm2019CheckPulser* pulserChecker = new CbmMcbm2019CheckPulser(); @@ -321,7 +672,7 @@ void unpack_pulser_mcbm(UInt_t uRunId = 0, TString sHostname = "localhost", UInt if (0 < uRunId) pulserChecker->SetOutFilename(Form("data/HistosPulserCheck_%03u.root", uRunId)); /// mCBM 2019-2020 - // pulserChecker->SetStsAddress( 0x99999999 ); + pulserChecker->SetStsAddress(0x11E004E2); pulserChecker->SetMuchAsic(9); pulserChecker->SetMuchChanRange(63); /// For PSD pick channel 0 @@ -342,11 +693,11 @@ void unpack_pulser_mcbm(UInt_t uRunId = 0, TString sHostname = "localhost", UInt TStopwatch timer; timer.Start(); std::cout << ">>> unpack_tsa_mcbm: Starting run..." << std::endl; - if (0 == nrEvents) { - run->Run(nEvents, 0); // run until end of input file + if (0 == uNbTimeslices) { + run->Run(-1, 0); // run until end of input file } else { - run->Run(0, nrEvents); // process N Events + run->Run(0, uNbTimeslices); // process N Timeslices } run->Finish(); @@ -366,4 +717,6 @@ void unpack_pulser_mcbm(UInt_t uRunId = 0, TString sHostname = "localhost", UInt /// --- Screen output for automatic tests std::cout << " Test passed" << std::endl; std::cout << " All ok " << std::endl; + + return kTRUE; } diff --git a/macro/beamtime/mcbm2020/unpack_pulser_mcbm_stsbinning.C b/macro/beamtime/mcbm2020/unpack_pulser_mcbm_stsbinning.C index a609776eb6ce7faa985b208e6322b26d1a34d047..983b0d9ee864185558b530546e6ed674cd08f6bd 100644 --- a/macro/beamtime/mcbm2020/unpack_pulser_mcbm_stsbinning.C +++ b/macro/beamtime/mcbm2020/unpack_pulser_mcbm_stsbinning.C @@ -124,6 +124,7 @@ void unpack_pulser_mcbm_stsbinning(UInt_t uRunId = 0, TString sHostname = "local unpacker_psd->SetWriteOutputFlag(kFALSE); unpacker_sts->SetAdcCut(3); + unpacker_sts->SeparatePulserOutput(kFALSE); unpacker_tof->SetSeparateArrayT0(); unpacker_sts->SetBinningFwFlag(kTRUE); diff --git a/macro/beamtime/mcbm2021/mStsPar.par b/macro/beamtime/mcbm2021/mStsPar.par index db18fc93d8159449da8586f957ddee3d6214ced0..4bdac409cbe731118a0acf423713d5ffb1faa905 100644 --- a/macro/beamtime/mcbm2021/mStsPar.par +++ b/macro/beamtime/mcbm2021/mStsPar.par @@ -8,51 +8,58 @@ NbModules: Int_t 13 // Type of each module: 0 for connectors on the right, 1 for connectors on the left ModuleType: Int_t \ - 0 0 \ - 1 1 1 \ - 0 0 0 \ - 1 1 1 1 1 + 0 0 \ + 1 1 1 \ + 0 0 0 \ + 1 1 1 1 1 // STS address for the first strip of each module // 1 Line per ladder, from above beam to under beam FIXME ModAddress: Int_t \ - 0x10000002 0x10010002 \ - 0x10000012 0x10010012 0x99999999 \ - 0x10000022 0x10010022 0x99999998 \ - 0x10000032 0x10010032 0x10020032 0x10000432 0x10010432 + 0x10000002 0x10010002 \ + 0x10000012 0x10010012 0x11E004E2 \ + 0x10000022 0x10010022 0x11E104E2 \ + 0x10000032 0x10010032 0x10020032 0x10000432 0x10010432 // Offset of module center in X, in mm (Should be done by geometry for the unpacker!) ModCenterPosX: Double_t \ - 0.0 0.0 \ + 0.0 0.0 \ 0.0 0.0 0.0 \ 0.0 0.0 0.0 \ 0.0 0.0 0.0 0.0 0.0 // Offset of module center in Y, in mm (Should be done by geometry for the unpacker!) ModCenterPosY: Double_t \ - 0.0 0.0 \ + 0.0 0.0 \ + 0.0 0.0 0.0 \ 0.0 0.0 0.0 \ - 0.0 0.0 0.0 \ 0.0 0.0 0.0 0.0 0.0 // Total number of STS DPBs in system FIXME NrOfDpbs: Int_t 5 // Array to hold the unique IDs (equipment ID) for all STS DPBs, Array size has to match NrOfDpbs FIXME DbpIdArray: Int_t \ - 0x1003 0x1002 0x1006 0x1005 0x1004 + 0x1003 0x1002 0x1006 0x1005 0x1004 // Array to hold the active flag for all CROBs, [ NbDpb * kuNbCrobPerDpb ] = [ NbDpb * 1 ] CrobActiveFlag: Int_t \ - 1 1 1 1 1 + 1 1 1 1 1 +// Pulser flag for each FEB, [ NbDpb * kuNbCrobPerDpb * kuNbFebsPerCrob ] = = [ NbDpb * 1 * 5 ], 1 if pulser, 0 otherwise +FebPulserFlag: Int_t \ + 0 0 0 0 0 \ + 1 0 0 0 0 \ + 1 0 0 0 0 \ + 0 0 0 0 0 \ + 0 0 0 0 0 // Index of the STS module for each FEB, [ NbDpb * kuNbCrobPerDpb * kuNbFebsPerCrob ] = = [ NbDpb * 1 * 5 ], -1 if inactive FebModuleIdx: Int_t \ - -1 0 0 1 1 \ - 4 2 2 3 3 \ - 7 5 5 6 6 \ - 10 9 9 8 8 \ - 12 12 11 11 10 + -1 0 0 1 1 \ + 4 2 2 3 3 \ + 7 5 5 6 6 \ + 10 9 9 8 8 \ + 12 12 11 11 10 // STS module side for each FEB, [ NbDpb * kuNbCrobPerDpb * kuNbFebsPerCrob ], 0 = P, 1 = N, -1 if inactive FebModuleSide: Int_t \ - -1 1 0 1 0 \ - 1 1 0 1 0 \ - 1 1 0 1 0 \ - 0 1 0 1 0 \ - 1 0 1 0 1 + -1 1 0 1 0 \ + 1 1 0 1 0 \ + 1 1 0 1 0 \ + 0 1 0 1 0 \ + 1 0 1 0 1 // ADC Gain in e-/ADC bin for each FEB, [ NbDpb * kuNbCrobPerDpb * kuNbFebsPerCrob ] FebAdcGain: Double_t \ 1.0 1.0 1.0 1.0 1.0 \ diff --git a/macro/beamtime/pulser2020/unpack_pulser_mcbm.C b/macro/beamtime/pulser2020/unpack_pulser_mcbm.C index 68416f4784e27710e26c2fab9342fae18fded579..40cd97979758b43eade0550416fd50a85bba892c 100644 --- a/macro/beamtime/pulser2020/unpack_pulser_mcbm.C +++ b/macro/beamtime/pulser2020/unpack_pulser_mcbm.C @@ -97,6 +97,7 @@ void unpack_pulser_mcbm(UInt_t uRunId = 0, TString sHostname = "localhost", UInt unpacker_psd->SetWriteOutputFlag(kFALSE); // unpacker_sts ->SetAdcCut( 3 ); + unpacker_sts->SeparatePulserOutput(kFALSE); unpacker_tof->SetSeparateArrayT0(); switch (uRunId) { diff --git a/macro/run/run_unpack_tsa.C b/macro/run/run_unpack_tsa.C index 55f3bbf029c031b378a7637c9727dfab9fb9cda0..8629aff0f4854c792c2f8e820646ea8df469b26a 100644 --- a/macro/run/run_unpack_tsa.C +++ b/macro/run/run_unpack_tsa.C @@ -122,6 +122,7 @@ void run_unpack_tsa(std::vector<std::string> infile = {"test.tsa"}, UInt_t runid if (stsconfig) { // stsconfig->SetDebugState(); stsconfig->SetDoWriteOutput(); + stsconfig->SetDoWriteOptOutA("StsDigiPulser"); std::string parfilesbasepathSts = Form("%s/macro/beamtime/mcbm2021/", srcDir.Data()); stsconfig->SetParFilesBasePath(parfilesbasepathSts); /// Enable duplicates rejection, Ignores the ADC for duplicates check diff --git a/reco/detectors/sts/unpack/CbmStsUnpackAlgo.cxx b/reco/detectors/sts/unpack/CbmStsUnpackAlgo.cxx index e3362c73dd419c83e1e12198a2b627fb9b14ce7b..8429661f37904bef050573fbfca046c86760d416 100644 --- a/reco/detectors/sts/unpack/CbmStsUnpackAlgo.cxx +++ b/reco/detectors/sts/unpack/CbmStsUnpackAlgo.cxx @@ -157,6 +157,7 @@ Bool_t CbmStsUnpackAlgo::initParSet(CbmMcbm2018StsPar* parset) for (uint32_t uCrobIdx = 0; uCrobIdx < fNrCrobPerDpb; ++uCrobIdx) { fviFebType[uDpb][uCrobIdx].resize(parset->GetNbFebsPerCrob(), -1); for (uint32_t uFebIdx = 0; uFebIdx < parset->GetNbFebsPerCrob(); ++uFebIdx) { + fvbFebPulser.push_back(parset->IsFebPulser(uDpb, uCrobIdx, uFebIdx)); fvdFebAdcGain.push_back(parset->GetFebAdcGain(uDpb, uCrobIdx, uFebIdx)); fvdFebAdcOffs.push_back(parset->GetFebAdcOffset(uDpb, uCrobIdx, uFebIdx)); @@ -176,8 +177,8 @@ Bool_t CbmStsUnpackAlgo::initParSet(CbmMcbm2018StsPar* parset) ///! 2) No accessor/setter to change only the side field of an STS address ///! => hardcode the shift ///! +> The bit is unused in the current scheme: the side is encoded in the Digi channel - fviFebAddress.push_back(viModAddress[viFebModuleIdx[uDpb][uCrobIdx][uFebIdx]] - + (viFebModuleSide[uDpb][uCrobIdx][uFebIdx] << 25)); + fviFebAddress.push_back(viModAddress[viFebModuleIdx[uDpb][uCrobIdx][uFebIdx]]); + // + (viFebModuleSide[uDpb][uCrobIdx][uFebIdx] << 25)); fviFebSide.push_back(viFebModuleSide[uDpb][uCrobIdx][uFebIdx]); break; } // case 0: // FEB-8-1 with ZIF connector on the right @@ -193,8 +194,8 @@ Bool_t CbmStsUnpackAlgo::initParSet(CbmMcbm2018StsPar* parset) ///! 2) No accessor/setter to change only the side field of an STS address ///! => hardcode the shift ///! +> The bit is unused in the current scheme: the side is encoded in the Digi channel - fviFebAddress.push_back(viModAddress[viFebModuleIdx[uDpb][uCrobIdx][uFebIdx]] - + ((!viFebModuleSide[uDpb][uCrobIdx][uFebIdx]) << 25)); + fviFebAddress.push_back(viModAddress[viFebModuleIdx[uDpb][uCrobIdx][uFebIdx]]); + // + ((!viFebModuleSide[uDpb][uCrobIdx][uFebIdx]) << 25)); fviFebSide.push_back(viFebModuleSide[uDpb][uCrobIdx][uFebIdx]); break; } // case 1: // FEB-8-1 with ZIF connector on the left @@ -421,8 +422,8 @@ void CbmStsUnpackAlgo::processErrorInfo(const stsxyter::Message& mess) if (mess.IsMsErrorFlagOn()) { // I do pass here the Ts start time instead of the ms time, since, we removed the ms time as member for the time being if (fMonitor) { fMonitor->FillMsErrorsEvo(fMsStartTime, mess.GetMsErrorType()); } - if (fOptOutAVec) - fOptOutAVec->emplace_back( + if (fOptOutBVec) + fOptOutBVec->emplace_back( CbmErrorMessage(ECbmModuleId::kSts, fMsStartTime, fuCurrDpbIdx, 0x20, mess.GetMsErrorType())); } } @@ -503,12 +504,21 @@ void CbmStsUnpackAlgo::processHitInfo(const stsxyter::Message& mess) LOG(error) << Form("Digi on disabled FEB %02u has address 0x%08x and side %d", uFebIdx, fviFebAddress[uFebIdx], fviFebSide[uFebIdx]); } - fOutputVec.emplace_back(CbmStsDigi(fviFebAddress[uFebIdx], uChanInMod, ulTimeInNs, dCalAdc)); + + /// Catch the pulser digis and either save them to their own output or drop them + if (fvbFebPulser[uFebIdx]) { + if (fOptOutAVec) { + fOptOutAVec->emplace_back(CbmStsDigi(fviFebAddress[uFebIdx], uChanInMod, ulTimeInNs, dCalAdc)); + } // if (fOptOutAVec) + } // if (fvbFebPulser[uFebIdx]) + else { + fOutputVec.emplace_back(CbmStsDigi(fviFebAddress[uFebIdx], uChanInMod, ulTimeInNs, dCalAdc)); + } // else of if (fvbFebPulser[uFebIdx]) /// If EM flag ON, store a corresponding error message with the next flag after all other possible status flags set if (mess.IsHitMissedEvts()) - if (fOptOutAVec) - fOptOutAVec->emplace_back( + if (fOptOutBVec) + fOptOutBVec->emplace_back( CbmErrorMessage(ECbmModuleId::kSts, dTimeInNs, uAsicIdx, 1 << stsxyter::kusLenStatStatus, usChan)); } } @@ -559,8 +569,8 @@ void CbmStsUnpackAlgo::processStatusInfo(const stsxyter::Message& mess, uint32_t /// Convert the time in bins to Hit time in ns const double dTimeNs = ulTime * stsxyter::kdClockCycleNs; - if (fOptOutAVec) - fOptOutAVec->emplace_back( + if (fOptOutBVec) + fOptOutBVec->emplace_back( CbmErrorMessage(ECbmModuleId::kSts, dTimeNs, uAsicIdx, mess.GetStatusStatus(), mess.GetData())); } diff --git a/reco/detectors/sts/unpack/CbmStsUnpackAlgo.h b/reco/detectors/sts/unpack/CbmStsUnpackAlgo.h index 517932d27716508485d6f1153e40ea46babfbafb..132c1081489b32d6da208af6b1faf218cceb9d87 100644 --- a/reco/detectors/sts/unpack/CbmStsUnpackAlgo.h +++ b/reco/detectors/sts/unpack/CbmStsUnpackAlgo.h @@ -221,6 +221,8 @@ protected: /** @brief FEB type, [ NbDpb ][ NbCrobPerDpb ][ NbFebsPerCrob ], 0 = A, 1 = B, -1 if inactive */ std::vector<std::vector<std::vector<int32_t>>> fviFebType = {}; //! + /** @brief Pulser flag for each FEB, [ NbDpb * NbCrobPerDpb * NbFebsPerCrob ] */ + std::vector<bool> fvbFebPulser; //! /** @brief STS address for each FEB, [ NbDpb * NbCrobPerDpb * NbFebsPerCrob ] */ std::vector<int32_t> fviFebAddress; //! /** @brief Module side for each FEB, [ NbDpb * NbCrobPerDpb * NbFebsPerCrob ] */ diff --git a/reco/detectors/sts/unpack/CbmStsUnpackAlgoBase.h b/reco/detectors/sts/unpack/CbmStsUnpackAlgoBase.h index 285b65395b8f80d45093db57a76e94f47d54758d..65ca023c6ef43d77d44a9687f7c5675f2f6ae4aa 100644 --- a/reco/detectors/sts/unpack/CbmStsUnpackAlgoBase.h +++ b/reco/detectors/sts/unpack/CbmStsUnpackAlgoBase.h @@ -38,7 +38,7 @@ #include <memory> #include <utility> -class CbmStsUnpackAlgoBase : public CbmRecoUnpackAlgo<CbmStsDigi, CbmErrorMessage> { +class CbmStsUnpackAlgoBase : public CbmRecoUnpackAlgo<CbmStsDigi, CbmStsDigi, CbmErrorMessage> { public: /** @brief Create the Cbm Sts Unpack AlgoBase object */ CbmStsUnpackAlgoBase(std::string name); diff --git a/reco/detectors/sts/unpack/CbmStsUnpackAlgoLegacy.cxx b/reco/detectors/sts/unpack/CbmStsUnpackAlgoLegacy.cxx index 1b67fb04a862715ed3469275c21948aec4d14d55..1b0b195b11390c97397bd9c73731a7a4a30fa082 100644 --- a/reco/detectors/sts/unpack/CbmStsUnpackAlgoLegacy.cxx +++ b/reco/detectors/sts/unpack/CbmStsUnpackAlgoLegacy.cxx @@ -146,6 +146,7 @@ bool CbmStsUnpackAlgoLegacy::InitParameters() for (uint32_t uCrobIdx = 0; uCrobIdx < fUnpackPar->GetNbCrobsPerDpb(); ++uCrobIdx) { fviFebType[uDpb][uCrobIdx].resize(fUnpackPar->GetNbFebsPerCrob(), -1); for (uint32_t uFebIdx = 0; uFebIdx < fUnpackPar->GetNbFebsPerCrob(); ++uFebIdx) { + fvbFebPulser.push_back(fUnpackPar->IsFebPulser(uDpb, uCrobIdx, uFebIdx)); fvdFebAdcGain.push_back(fUnpackPar->GetFebAdcGain(uDpb, uCrobIdx, uFebIdx)); fvdFebAdcOffs.push_back(fUnpackPar->GetFebAdcOffset(uDpb, uCrobIdx, uFebIdx)); @@ -165,8 +166,8 @@ bool CbmStsUnpackAlgoLegacy::InitParameters() ///! 2) No accessor/setter to change only the side field of an STS address ///! => hardcode the shift ///! +> The bit is unused in the current scheme: the side is encoded in the Digi channel - fviFebAddress.push_back(viModAddress[viFebModuleIdx[uDpb][uCrobIdx][uFebIdx]] - + (viFebModuleSide[uDpb][uCrobIdx][uFebIdx] << 25)); + fviFebAddress.push_back(viModAddress[viFebModuleIdx[uDpb][uCrobIdx][uFebIdx]]); + // + (viFebModuleSide[uDpb][uCrobIdx][uFebIdx] << 25)); fviFebSide.push_back(viFebModuleSide[uDpb][uCrobIdx][uFebIdx]); break; } // case 0: // FEB-8-1 with ZIF connector on the right @@ -182,8 +183,8 @@ bool CbmStsUnpackAlgoLegacy::InitParameters() ///! 2) No accessor/setter to change only the side field of an STS address ///! => hardcode the shift ///! +> The bit is unused in the current scheme: the side is encoded in the Digi channel - fviFebAddress.push_back(viModAddress[viFebModuleIdx[uDpb][uCrobIdx][uFebIdx]] - + ((!viFebModuleSide[uDpb][uCrobIdx][uFebIdx]) << 25)); + fviFebAddress.push_back(viModAddress[viFebModuleIdx[uDpb][uCrobIdx][uFebIdx]]); + // + ((!viFebModuleSide[uDpb][uCrobIdx][uFebIdx]) << 25)); fviFebSide.push_back(viFebModuleSide[uDpb][uCrobIdx][uFebIdx]); break; } // case 1: // FEB-8-1 with ZIF connector on the left @@ -357,7 +358,16 @@ void CbmStsUnpackAlgoLegacy::AddHitsToDigiVect(std::vector<stsxyter::FinalHit>* LOG(error) << Form("Digi on disabled FEB %02u has address 0x%08x and side %d", uFebIdx, fviFebAddress[uFebIdx], fviFebSide[uFebIdx]); } - vDigiVectOut->emplace_back(fviFebAddress[uFebIdx], uChanInMod, ulTimeInNs, dCalAdc); + + /// Catch the pulser digis and either save them to their own output or drop them + if (fvbFebPulser[uFebIdx]) { + if (fOptOutAVec) { + fOptOutAVec->emplace_back(fviFebAddress[uFebIdx], uChanInMod, ulTimeInNs, dCalAdc); + } // if (fOptOutAVec) + } // if (fvbFebPulser[uFebIdx]) + else { + vDigiVectOut->emplace_back(fviFebAddress[uFebIdx], uChanInMod, ulTimeInNs, dCalAdc); + } // else of if (fvbFebPulser[uFebIdx]) } } @@ -591,8 +601,8 @@ void CbmStsUnpackAlgoLegacy::ProcessHitInfo(const stsxyter::Message& mess) const double dHitTimeNs = ulHitTime * stsxyter::kdClockCycleNs; /// If EM flag ON, store a corresponding error message with the next flag after all other possible status flags set - if (mess.IsHitMissedEvts() && fOptOutAVec != nullptr) - fOptOutAVec->push_back( + if (mess.IsHitMissedEvts() && fOptOutBVec != nullptr) + fOptOutBVec->push_back( CbmErrorMessage(ECbmModuleId::kSts, dHitTimeNs, uAsicIdx, 1 << stsxyter::kusLenStatStatus, usChan)); if (fMonitor) { @@ -691,8 +701,10 @@ void CbmStsUnpackAlgoLegacy::ProcessStatusInfo(const stsxyter::Message& mess, ui /// Convert the time in bins to Hit time in ns const double dTimeNs = ulTime * stsxyter::kdClockCycleNs; - fOptOutAVec->push_back( - CbmErrorMessage(ECbmModuleId::kSts, dTimeNs, uAsicIdx, mess.GetStatusStatus(), mess.GetData())); + if (fOptOutBVec) { + fOptOutBVec->push_back( + CbmErrorMessage(ECbmModuleId::kSts, dTimeNs, uAsicIdx, mess.GetStatusStatus(), mess.GetData())); + } } // ------------------------------------------------------------------------- @@ -713,8 +725,8 @@ void CbmStsUnpackAlgoLegacy::ProcessErrorInfo(const stsxyter::Message& mess) { if (mess.IsMsErrorFlagOn()) { if (fMonitor) { fMonitor->FillMsErrorsEvo(fulCurrentMsIdx, mess.GetMsErrorType()); } - if (fOptOutAVec) { - fOptOutAVec->push_back( + if (fOptOutBVec) { + fOptOutBVec->push_back( CbmErrorMessage(ECbmModuleId::kSts, fulCurrentMsIdx, fuCurrDpbIdx, 0x20, mess.GetMsErrorType())); } } diff --git a/reco/detectors/sts/unpack/CbmStsUnpackAlgoLegacy.h b/reco/detectors/sts/unpack/CbmStsUnpackAlgoLegacy.h index 39a404b53c5c86a65d8d6e0802632e632e606b4c..09cf50f56a3761c5817c0fc78688ffa12bc3c504 100644 --- a/reco/detectors/sts/unpack/CbmStsUnpackAlgoLegacy.h +++ b/reco/detectors/sts/unpack/CbmStsUnpackAlgoLegacy.h @@ -71,6 +71,7 @@ private: std::vector<std::vector<std::vector<int32_t>>> fviFebType; //! FEB type, [ NbDpb ][ NbCrobPerDpb ][ NbFebsPerCrob ], 0 = A, 1 = B, -1 if inactive + std::vector<bool> fvbFebPulser; //! Pulser flag for each FEB, [ NbDpb * NbCrobPerDpb * NbFebsPerCrob ] std::vector<int32_t> fviFebAddress; //! STS address for each FEB, [ NbDpb * NbCrobPerDpb * NbFebsPerCrob ] std::vector<int32_t> fviFebSide; //! Module side for each FEB, [ NbDpb * NbCrobPerDpb * NbFebsPerCrob ] std::vector<double> fvdFebAdcGain; //! ADC gain in e-/b, [ NbDpb * NbCrobPerDpb * NbFebsPerCrob ] diff --git a/reco/detectors/sts/unpack/CbmStsUnpackConfig.h b/reco/detectors/sts/unpack/CbmStsUnpackConfig.h index 94a55ea104b2c7c9ac755d72aa32b57c122160f7..83522fc08d3514501dbf64e582b666c6808edee2 100644 --- a/reco/detectors/sts/unpack/CbmStsUnpackConfig.h +++ b/reco/detectors/sts/unpack/CbmStsUnpackConfig.h @@ -35,7 +35,7 @@ #include <memory> #include <vector> -class CbmStsUnpackConfig : public CbmRecoUnpackConfig<CbmStsUnpackAlgoBase, CbmStsDigi, CbmErrorMessage> { +class CbmStsUnpackConfig : public CbmRecoUnpackConfig<CbmStsUnpackAlgoBase, CbmStsDigi, CbmStsDigi, CbmErrorMessage> { public: /**