diff --git a/core/detectors/much/CbmMcbm2018MuchPar.cxx b/core/detectors/much/CbmMcbm2018MuchPar.cxx index 3cdf393fa8f9777b038134895c63a899d7a33229..ffbab96cca0c8b515ce5371c98fc199a5a235809 100644 --- a/core/detectors/much/CbmMcbm2018MuchPar.cxx +++ b/core/detectors/much/CbmMcbm2018MuchPar.cxx @@ -17,9 +17,7 @@ using namespace std; // ----- Standard constructor ------------------------------------------ -CbmMcbm2018MuchPar::CbmMcbm2018MuchPar(const char* name, - const char* title, - const char* context) +CbmMcbm2018MuchPar::CbmMcbm2018MuchPar(const char* name, const char* title, const char* context) : FairParGenericSet(name, title, context) , fuNrOfDpbs(0) , fiDbpIdArray() @@ -33,7 +31,8 @@ CbmMcbm2018MuchPar::CbmMcbm2018MuchPar(const char* name, , fChannelsToPadXB() , fChannelsToPadYB() , fRealX() - , fRealPadSize() { + , fRealPadSize() +{ detName = "Much"; } // ------------------------------------------------------------------------- @@ -45,7 +44,8 @@ CbmMcbm2018MuchPar::~CbmMcbm2018MuchPar() {} // ----- Public method clear ------------------------------------------- -void CbmMcbm2018MuchPar::clear() { +void CbmMcbm2018MuchPar::clear() +{ status = kFALSE; resetInputVersions(); } @@ -53,7 +53,8 @@ void CbmMcbm2018MuchPar::clear() { // ------------------------------------------------------------------------- -void CbmMcbm2018MuchPar::putParams(FairParamList* l) { +void CbmMcbm2018MuchPar::putParams(FairParamList* l) +{ if (!l) return; l->add("NrOfDpbs", fuNrOfDpbs); @@ -73,7 +74,8 @@ void CbmMcbm2018MuchPar::putParams(FairParamList* l) { // ------------------------------------------------------------------------- -Bool_t CbmMcbm2018MuchPar::getParams(FairParamList* l) { +Bool_t CbmMcbm2018MuchPar::getParams(FairParamList* l) +{ if (!l) return kFALSE; @@ -116,163 +118,144 @@ Bool_t CbmMcbm2018MuchPar::getParams(FairParamList* l) { return kTRUE; } // ------------------------------------------------------------------------- -Int_t CbmMcbm2018MuchPar::ElinkIdxToFebIdx(UInt_t uElink) { +Int_t CbmMcbm2018MuchPar::ElinkIdxToFebIdx(UInt_t uElink) +{ //LOG(info) <<" uElink "<<uElink<<" kuNbElinksPerCrob "<<kuNbElinksPerCrob; - if (uElink < kuNbElinksPerCrob) - return kiCrobMapElinkFebIdx[uElink]; + if (uElink < kuNbElinksPerCrob) return kiCrobMapElinkFebIdx[uElink]; else { - LOG(warning) - << "CbmMcbm2018MuchPar::ElinkIdxToFebIdx => Index out of bound, " - << "returning crazy value!"; + LOG(warning) << "CbmMcbm2018MuchPar::ElinkIdxToFebIdx => Index out of bound, " + << "returning crazy value!"; return -1; } // else of if( uElink < kuNbElinksPerCrob ) } // ------------------------------------------------------------------------- -UInt_t CbmMcbm2018MuchPar::ElinkIdxToAsicIdxFebMuch(UInt_t uElink) { - if (uElink < kuNbElinksPerCrob) - return kuCrobMapElinkFebMuch[uElink]; +UInt_t CbmMcbm2018MuchPar::ElinkIdxToAsicIdxFebMuch(UInt_t uElink) +{ + if (uElink < kuNbElinksPerCrob) return kuCrobMapElinkFebMuch[uElink]; else { - LOG(warning) - << "CbmMcbm2018MuchPar::ElinkIdxToAsicIdxFebMuch => Index out of bound, " - << "returning crazy value!"; + LOG(warning) << "CbmMcbm2018MuchPar::ElinkIdxToAsicIdxFebMuch => Index out of bound, " + << "returning crazy value!"; return 0xFFFF; } // else of if( uElink < kuNbElinksPerCrob ) } // ------------------------------------------------------------------------- -UInt_t CbmMcbm2018MuchPar::GetDpbId(UInt_t uDpbIdx) { - if (uDpbIdx < fuNrOfDpbs) - return fiDbpIdArray[uDpbIdx]; +UInt_t CbmMcbm2018MuchPar::GetDpbId(UInt_t uDpbIdx) +{ + if (uDpbIdx < fuNrOfDpbs) return fiDbpIdArray[uDpbIdx]; else { LOG(warning) << "CbmMcbm2018MuchPar::GetDpbId => Index out of bound, " << "returning crazy value!"; return 0xFFFFFFFF; } // else of if( uDpbIdx < fuNrOfDpbs ) } -Bool_t CbmMcbm2018MuchPar::IsCrobActive(UInt_t uDpbIdx, UInt_t uCrobIdx) { +Bool_t CbmMcbm2018MuchPar::IsCrobActive(UInt_t uDpbIdx, UInt_t uCrobIdx) +{ if (uDpbIdx < fuNrOfDpbs) { - if (uCrobIdx < kuNbCrobsPerDpb) - return 0 < fiCrobActiveFlag[uDpbIdx * kuNbCrobsPerDpb + uCrobIdx] - ? kTRUE - : kFALSE; + if (uCrobIdx < kuNbCrobsPerDpb) return 0 < fiCrobActiveFlag[uDpbIdx * kuNbCrobsPerDpb + uCrobIdx] ? kTRUE : kFALSE; else { - LOG(warning) - << "CbmMcbm2018MuchPar::IsCrobActive => Crob Index out of bound, " - << "returning default inactive!"; + LOG(warning) << "CbmMcbm2018MuchPar::IsCrobActive => Crob Index out of bound, " + << "returning default inactive!"; return kFALSE; } // else of if( uCrobIdx < kuNbCrobsPerDpb ) } // if( uDpbIdx < fuNrOfDpbs ) else { - LOG(warning) - << "CbmMcbm2018MuchPar::IsCrobActive => Dpb Index out of bound, " - << "returning default inactive!"; + LOG(warning) << "CbmMcbm2018MuchPar::IsCrobActive => Dpb Index out of bound, " + << "returning default inactive!"; return kFALSE; } // else of if( uDpbIdx < fuNrOfDpbs ) } -Bool_t CbmMcbm2018MuchPar::IsFebActive(UInt_t uFebInSystIdx) { +Bool_t CbmMcbm2018MuchPar::IsFebActive(UInt_t uFebInSystIdx) +{ if (uFebInSystIdx < GetNrOfFebs()) { /// Always return true for now return kTRUE; } // if( uFebInSystIdx < GetNrOfFebs() ) else { - LOG(warning) - << "CbmMcbm2018MuchPar::IsFebActive => Feb Index out of bound, " - << "returning default inactive!"; + LOG(warning) << "CbmMcbm2018MuchPar::IsFebActive => Feb Index out of bound, " + << "returning default inactive!"; return kFALSE; } // else of if( uFebInSystIdx < GetNrOfFebs() ) } -Bool_t CbmMcbm2018MuchPar::IsFebActive(UInt_t uDpbIdx, - UInt_t uCrobIdx, - UInt_t uFebIdx) { +Bool_t CbmMcbm2018MuchPar::IsFebActive(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; + UInt_t uIdx = (uDpbIdx * kuNbCrobsPerDpb + uCrobIdx) * kuNbFebsPerCrob + uFebIdx; return IsFebActive(uIdx); } // if( uFebIdx < kuNbFebsPerCrob ) else { - LOG(warning) - << "CbmMcbm2018MuchPar::IsFebActive => Feb Index out of bound, " - << "returning default inactive!"; + LOG(warning) << "CbmMcbm2018MuchPar::IsFebActive => Feb Index out of bound, " + << "returning default inactive!"; return kFALSE; } // else of if( uFebIdx < kuNbCrobsPerDpb ) } // if( uCrobIdx < kuNbCrobsPerDpb ) else { - LOG(warning) - << "CbmMcbm2018MuchPar::IsFebActive => Crob Index out of bound, " - << "returning default inactive!"; + LOG(warning) << "CbmMcbm2018MuchPar::IsFebActive => Crob Index out of bound, " + << "returning default inactive!"; return kFALSE; } // else of if( uCrobIdx < kuNbCrobsPerDpb ) } // if( uDpbIdx < fuNrOfDpbs ) else { - LOG(warning) - << "CbmMcbm2018MuchPar::IsFebActive => Dpb Index out of bound, " - << "returning default inactive!"; + LOG(warning) << "CbmMcbm2018MuchPar::IsFebActive => Dpb Index out of bound, " + << "returning default inactive!"; return kFALSE; } // else of if( uDpbIdx < fuNrOfDpbs ) } -Short_t CbmMcbm2018MuchPar::GetPadXA(UShort_t febid, UShort_t channelid) { - if (fChannelsToPadXA.GetSize() - <= static_cast<Int_t>((febid * kuNbChanPerAsic) + channelid)) { - LOG(debug) << "CbmMcbm2018MuchPar::GetPadXA => Index out of bounds: " - << ((febid * kuNbChanPerAsic) + channelid) << " VS " - << fChannelsToPadXA.GetSize() << " (" << febid << " and " - << channelid << ")"; +Short_t CbmMcbm2018MuchPar::GetPadXA(UShort_t febid, UShort_t channelid) +{ + if (fChannelsToPadXA.GetSize() <= static_cast<Int_t>((febid * kuNbChanPerAsic) + channelid)) { + LOG(debug) << "CbmMcbm2018MuchPar::GetPadXA => Index out of bounds: " << ((febid * kuNbChanPerAsic) + channelid) + << " VS " << fChannelsToPadXA.GetSize() << " (" << febid << " and " << channelid << ")"; return -2; } // if( fChannelsToPadXA.GetSize () <= static_cast< Int_t >( (febid*kuNbChanPerAsic)+channelid ) ) return fChannelsToPadXA[(febid * kuNbChanPerAsic) + channelid]; } -Short_t CbmMcbm2018MuchPar::GetPadYA(UShort_t febid, UShort_t channelid) { - if (fChannelsToPadXA.GetSize() - <= static_cast<Int_t>((febid * kuNbChanPerAsic) + channelid)) { - LOG(debug) << "CbmMcbm2018MuchPar::GetPadYA => Index out of bounds: " - << ((febid * kuNbChanPerAsic) + channelid) << " VS " - << fChannelsToPadYA.GetSize() << " (" << febid << " and " - << channelid << ")"; +Short_t CbmMcbm2018MuchPar::GetPadYA(UShort_t febid, UShort_t channelid) +{ + if (fChannelsToPadXA.GetSize() <= static_cast<Int_t>((febid * kuNbChanPerAsic) + channelid)) { + LOG(debug) << "CbmMcbm2018MuchPar::GetPadYA => Index out of bounds: " << ((febid * kuNbChanPerAsic) + channelid) + << " VS " << fChannelsToPadYA.GetSize() << " (" << febid << " and " << channelid << ")"; return -2; } // if( fChannelsToPadXA.GetSize () <= static_cast< Int_t >( (febid*kuNbChanPerAsic)+channelid ) ) return fChannelsToPadYA[(febid * kuNbChanPerAsic) + channelid]; } -Short_t CbmMcbm2018MuchPar::GetPadXB(UShort_t febid, UShort_t channelid) { - if (fChannelsToPadXB.GetSize() - <= static_cast<Int_t>((febid * kuNbChanPerAsic) + channelid)) { - LOG(debug) << "CbmMcbm2018MuchPar::GetPadXB => Index out of bounds: " - << ((febid * kuNbChanPerAsic) + channelid) << " VS " - << fChannelsToPadXB.GetSize() << " (" << febid << " and " - << channelid << ")"; +Short_t CbmMcbm2018MuchPar::GetPadXB(UShort_t febid, UShort_t channelid) +{ + if (fChannelsToPadXB.GetSize() <= static_cast<Int_t>((febid * kuNbChanPerAsic) + channelid)) { + LOG(debug) << "CbmMcbm2018MuchPar::GetPadXB => Index out of bounds: " << ((febid * kuNbChanPerAsic) + channelid) + << " VS " << fChannelsToPadXB.GetSize() << " (" << febid << " and " << channelid << ")"; return -2; } // if( fChannelsToPadXB.GetSize () <= static_cast< Int_t >( (febid*kuNbChanPerAsic)+channelid ) ) return fChannelsToPadXB[(febid * kuNbChanPerAsic) + channelid]; } -Short_t CbmMcbm2018MuchPar::GetPadYB(UShort_t febid, UShort_t channelid) { - if (fChannelsToPadXB.GetSize() - <= static_cast<Int_t>((febid * kuNbChanPerAsic) + channelid)) { - LOG(debug) << "CbmMcbm2018MuchPar::GetPadYB => Index out of bounds: " - << ((febid * kuNbChanPerAsic) + channelid) << " VS " - << fChannelsToPadYB.GetSize() << " (" << febid << " and " - << channelid << ")"; +Short_t CbmMcbm2018MuchPar::GetPadYB(UShort_t febid, UShort_t channelid) +{ + if (fChannelsToPadXB.GetSize() <= static_cast<Int_t>((febid * kuNbChanPerAsic) + channelid)) { + LOG(debug) << "CbmMcbm2018MuchPar::GetPadYB => Index out of bounds: " << ((febid * kuNbChanPerAsic) + channelid) + << " VS " << fChannelsToPadYB.GetSize() << " (" << febid << " and " << channelid << ")"; return -2; } // if( fChannelsToPadXB.GetSize () <= static_cast< Int_t >( (febid*kuNbChanPerAsic)+channelid ) ) return fChannelsToPadYB[(febid * kuNbChanPerAsic) + channelid]; } -UInt_t CbmMcbm2018MuchPar::GetFebId(UInt_t uAsicIdx) { +UInt_t CbmMcbm2018MuchPar::GetFebId(UInt_t uAsicIdx) +{ //LOG(info)<<" fnFebsIdsArrayGemA.GetSize() "<<fnFebsIdsArrayGemA.GetSize()<<" fnFebsIdsArrayGemB.GetSize()"<<fnFebsIdsArrayGemB.GetSize(); if (uAsicIdx >= GetNrOfFebsInGemA()) { if ((uAsicIdx % GetNrOfFebsInGemA()) < GetNrOfFebsInGemB()) return fnFebsIdsArrayGemB[uAsicIdx % GetNrOfFebsInGemA()]; else { - LOG(error) << "CbmMcbm2018MuchPar::GetFebId => Index out of bounds: " - << uAsicIdx << " VS " << GetNrOfFebsInGemA() << " and " - << GetNrOfFebsInGemB() << " => Returning crazy value!!!"; + LOG(error) << "CbmMcbm2018MuchPar::GetFebId => Index out of bounds: " << uAsicIdx << " VS " << GetNrOfFebsInGemA() + << " and " << GetNrOfFebsInGemB() << " => Returning crazy value!!!"; return 10000 * (GetNrOfFebsInGemA() + GetNrOfFebsInGemB()); } // else of if( ( uAsicIdx % GetNrOfFebsInGemA() ) < GetNrOfFebsInGemB() ) } // if(uAsicIdx >= GetNrOfFebsInGemA()) @@ -280,10 +263,10 @@ UInt_t CbmMcbm2018MuchPar::GetFebId(UInt_t uAsicIdx) { return fnFebsIdsArrayGemA[uAsicIdx]; } -UInt_t CbmMcbm2018MuchPar::GetModule(UInt_t uAsicIdx) { +UInt_t CbmMcbm2018MuchPar::GetModule(UInt_t uAsicIdx) +{ if (uAsicIdx >= GetNrOfFebsInGemA()) { - if ((uAsicIdx % GetNrOfFebsInGemA()) < GetNrOfFebsInGemB()) - return 1; + if ((uAsicIdx % GetNrOfFebsInGemA()) < GetNrOfFebsInGemB()) return 1; else return 2; } // if(uAsicIdx >= GetNrOfFebsInGemA()) @@ -291,7 +274,8 @@ UInt_t CbmMcbm2018MuchPar::GetModule(UInt_t uAsicIdx) { return 0; } -Double_t CbmMcbm2018MuchPar::GetRealX(Int_t SectorIndex) { +Double_t CbmMcbm2018MuchPar::GetRealX(Int_t SectorIndex) +{ //LOG(info)<<" fChannelsToPadX.GetSize() "<<fChannelsToPadX.GetSize(); if (SectorIndex < 0 || SectorIndex <= 97) { @@ -302,7 +286,8 @@ Double_t CbmMcbm2018MuchPar::GetRealX(Int_t SectorIndex) { return fRealX[SectorIndex]; } -Double_t CbmMcbm2018MuchPar::GetRealPadSize(Int_t SectorIndex) { +Double_t CbmMcbm2018MuchPar::GetRealPadSize(Int_t SectorIndex) +{ //LOG(info)<<" fChannelsToPadX.GetSize() "<<fChannelsToPadX.GetSize(); if (SectorIndex < 0 || SectorIndex <= 97) { @@ -313,23 +298,24 @@ Double_t CbmMcbm2018MuchPar::GetRealPadSize(Int_t SectorIndex) { return fRealPadSize[SectorIndex]; } -Double_t CbmMcbm2018MuchPar::GetRealX(Int_t Channel, Int_t Sector) { +Double_t CbmMcbm2018MuchPar::GetRealX(Int_t Channel, Int_t Sector) +{ Int_t PadIndex = Channel + 97 * Sector; if (Channel < 0 || Sector < 0) return -2; if (fRealX.GetSize() <= PadIndex) { - LOG(info) << "CbmMcbm2018MuchPar::GetRealX => Index out of bounds: " - << Channel << " " << Sector << " " << PadIndex; + LOG(info) << "CbmMcbm2018MuchPar::GetRealX => Index out of bounds: " << Channel << " " << Sector << " " << PadIndex; return -1; } // if( fRealX.Size() <= PadIndex ) return fRealX[PadIndex]; } -Double_t CbmMcbm2018MuchPar::GetRealPadSize(Int_t Channel, Int_t Sector) { +Double_t CbmMcbm2018MuchPar::GetRealPadSize(Int_t Channel, Int_t Sector) +{ Int_t PadIndex = Channel + 97 * Sector; if (Channel < 0 || Sector < 0) return -2; if (fRealPadSize.GetSize() <= PadIndex) { - LOG(info) << "CbmMcbm2018MuchPar::GetRealPadSize => Index out of bounds: " - << Channel << " " << Sector << " " << PadIndex; + LOG(info) << "CbmMcbm2018MuchPar::GetRealPadSize => Index out of bounds: " << Channel << " " << Sector << " " + << PadIndex; return -1; } // if( fRealPadSize.Size() <= PadIndex ) diff --git a/core/detectors/much/CbmMcbm2018MuchPar.h b/core/detectors/much/CbmMcbm2018MuchPar.h index 976122fd2ffd922d424d763f569a1273f0ae8675..cea63b0406f288ccaff1b732c4bb9354dd0ab6a7 100644 --- a/core/detectors/much/CbmMcbm2018MuchPar.h +++ b/core/detectors/much/CbmMcbm2018MuchPar.h @@ -20,8 +20,7 @@ class CbmMcbm2018MuchPar : public FairParGenericSet { public: /** Standard constructor **/ - CbmMcbm2018MuchPar(const char* name = "CbmMcbm2018MuchPar", - const char* title = "Much parameters", + CbmMcbm2018MuchPar(const char* name = "CbmMcbm2018MuchPar", const char* title = "Much parameters", const char* context = "Default"); @@ -37,29 +36,19 @@ public: static constexpr UInt_t GetNbCrobsPerDpb() { return kuNbCrobsPerDpb; } static constexpr UInt_t GetNbElinkPerCrob() { return kuNbElinksPerCrob; } static constexpr UInt_t GetNbFebsPerCrob() { return kuNbFebsPerCrob; } - static constexpr UInt_t GetNbFebsPerDpb() { - return kuNbCrobsPerDpb * kuNbFebsPerCrob; - } + static constexpr UInt_t GetNbFebsPerDpb() { return kuNbCrobsPerDpb * kuNbFebsPerCrob; } static constexpr UInt_t GetNbAsicsPerFeb() { return kuNbAsicsPerFeb; } - static constexpr UInt_t GetNbAsicsPerCrob() { - return kuNbFebsPerCrob * kuNbAsicsPerFeb; - } - static constexpr UInt_t GetNbAsicsPerDpb() { - return kuNbCrobsPerDpb * GetNbAsicsPerCrob(); - } + static constexpr UInt_t GetNbAsicsPerCrob() { return kuNbFebsPerCrob * kuNbAsicsPerFeb; } + static constexpr UInt_t GetNbAsicsPerDpb() { return kuNbCrobsPerDpb * GetNbAsicsPerCrob(); } static constexpr UInt_t GetNbChanPerAsic() { return kuNbChanPerAsic; } - static constexpr UInt_t GetNbChanPerFeb() { - return kuNbAsicsPerFeb * kuNbChanPerAsic; - } + static constexpr UInt_t GetNbChanPerFeb() { return kuNbAsicsPerFeb * kuNbChanPerAsic; } Int_t ElinkIdxToFebIdx(UInt_t uElink); /*UInt_t ElinkIdxToAsicIdx( Bool_t bFebType, UInt_t uElink ) { return kTRUE == bFebType ? ElinkIdxToAsicIdxFebB( uElink ) : ElinkIdxToAsicIdxFebA( uElink ); }*/ - UInt_t ElinkIdxToAsicIdx(UInt_t uElink) { - return ElinkIdxToAsicIdxFebMuch(uElink); - } + UInt_t ElinkIdxToAsicIdx(UInt_t uElink) { return ElinkIdxToAsicIdxFebMuch(uElink); } UInt_t ElinkIdxToAsicIdxFebMuch(UInt_t uElink); /*UInt_t ElinkIdxToAsicIdxFebA( UInt_t uElink ); @@ -95,14 +84,11 @@ public: private: /// Constants - static const UInt_t kuNbCrobsPerDpb = 1; // Number of CROBs possible per DPB - static const UInt_t kuNbElinksPerCrob = - 42; // Number of elinks in each CROB ? - static const UInt_t kuNbFebsPerCrob = - 6; // Number of FEBs connected to each CROB for mMuch 2019 - static const UInt_t kuNbAsicsPerFeb = - 1; // Number of ASICs connected in each FEB for MUCH - static const UInt_t kuNbChanPerAsic = 128; // Number of channels in each ASIC + static const UInt_t kuNbCrobsPerDpb = 1; // Number of CROBs possible per DPB + static const UInt_t kuNbElinksPerCrob = 42; // Number of elinks in each CROB ? + static const UInt_t kuNbFebsPerCrob = 6; // Number of FEBs connected to each CROB for mMuch 2019 + static const UInt_t kuNbAsicsPerFeb = 1; // Number of ASICs connected in each FEB for MUCH + static const UInt_t kuNbChanPerAsic = 128; // Number of channels in each ASIC // static constexpr UInt_t kuCrobMapElinkFebA[ kuNbElinksPerCrob ] = { /* *** Inverted ?!? const UInt_t kuCrobMapElinkFebA[ kuNbElinksPerCrob ] = { @@ -115,17 +101,16 @@ private: 0x000C, 0x0002, 0x0007, 0x0004, 0x0000, 0x0006 }; //! Map from eLink index to ASIC index within CROB ( 0 to kuNbFebsPerCrob * kuNbAsicPerFeb ) */ - const UInt_t - kuCrobMapElinkFebMuch - [kuNbElinksPerCrob] = - { - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0001, 0x0001, - 0x0001, 0x0001, 0x0002, 0x0002, 0x0002, 0x0002, 0x0003, 0x0003, - 0x0003, 0x0003, 0x0003, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, - 0x0005, 0x0005, 0x0005, 0x0005, 0x0003, 0x0003, 0x0003, 0x0003, - 0x0003, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0005, 0x0005, - 0x0005, 0x0005}; //! Map from eLink index to ASIC index within CROB ( 0 to kuNbFebsPerCrob * kuNbAsicPerFeb ) - /* + const UInt_t kuCrobMapElinkFebMuch[kuNbElinksPerCrob] = {0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0002, 0x0002, 0x0002, 0x0002, 0x0003, + 0x0003, 0x0003, 0x0003, 0x0003, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0005, + 0x0005, 0x0005, 0x0005, 0x0003, 0x0003, + 0x0003, 0x0003, 0x0003, 0x0004, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0005, 0x0005, + 0x0005, 0x0005}; //! Map from eLink index to ASIC index within CROB ( 0 to kuNbFebsPerCrob * kuNbAsicPerFeb ) + /* const UInt_t kuCrobMapElinkFebMuch[ kuNbElinksPerCrob ] = { 0x001C, 0x001D, 0x001E, 0x001F, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, @@ -137,39 +122,26 @@ private: }; //! Map from eLink index to ASIC index within CROB ( 0 to kuNbFebsPerCrob * kuNbAsicPerFeb ) */ // static constexpr UInt_t kuCrobMapElinkFebIdx[ kuNbElinksPerCrob ] = { - const Int_t kiCrobMapElinkFebIdx[kuNbElinksPerCrob] = {0, 0, 0, 0, 0, 1, 1, 1, - 1, 1, 2, 2, 2, 2, 3, 3, - 3, 3, 3, 4, 4, 4, 4, 4, - 5, 5, 5, 5, 6, 6, 6, 6, - 6, 7, 7, 7, 7, 7, 8, 8, - 8, 8}; //! Map from eLink index to ASIC index within CROB ( 0 to kuNbFebsPerCrob * kuNbAsicPerFeb ) + const Int_t kiCrobMapElinkFebIdx[kuNbElinksPerCrob] = { + 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, + 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 8, 8, 8, 8}; //! Map from eLink index to ASIC index within CROB ( 0 to kuNbFebsPerCrob * kuNbAsicPerFeb ) /// Variables - UInt_t fuNrOfDpbs; // Total number of MUCH DPBs in system - TArrayI - fiDbpIdArray; // Array to hold the unique IDs (equipment ID) for all MUCH DPBs - TArrayI - fiCrobActiveFlag; // Array to hold the active flag for all CROBs, [ NbDpb * kuNbCrobPerDpb ] - UInt_t fuFebsInGemA; // Number of FEBs connected in GEM Module A - UInt_t fuFebsInGemB; // Number of FEBs connected in GEM Module B - TArrayI - fnFebsIdsArrayGemA; // Array to hold FEB IDs connected to GEM Module A - TArrayI - fnFebsIdsArrayGemB; // Array to hold FEB IDs connected to GEM Module B - TArrayI - fChannelsToPadXA; // Array which stores the corresponding x position of PAD of entire module A - TArrayI - fChannelsToPadYA; // Array which stores the corresponding y position of PAD of entire module A - TArrayI - fChannelsToPadXB; // Array which stores the corresponding x position of PAD of entire module B - TArrayI - fChannelsToPadYB; // Array which stores the corresponding y position of PAD of entire module B - TArrayD - fRealX; // Array which stores the Real X (starting 18.733 cm) position of PAD - TArrayD - fRealPadSize; // Array which stores the Real Progressive size of each padX (starting .327 cm ) + UInt_t fuNrOfDpbs; // Total number of MUCH DPBs in system + TArrayI fiDbpIdArray; // Array to hold the unique IDs (equipment ID) for all MUCH DPBs + TArrayI fiCrobActiveFlag; // Array to hold the active flag for all CROBs, [ NbDpb * kuNbCrobPerDpb ] + UInt_t fuFebsInGemA; // Number of FEBs connected in GEM Module A + UInt_t fuFebsInGemB; // Number of FEBs connected in GEM Module B + TArrayI fnFebsIdsArrayGemA; // Array to hold FEB IDs connected to GEM Module A + TArrayI fnFebsIdsArrayGemB; // Array to hold FEB IDs connected to GEM Module B + TArrayI fChannelsToPadXA; // Array which stores the corresponding x position of PAD of entire module A + TArrayI fChannelsToPadYA; // Array which stores the corresponding y position of PAD of entire module A + TArrayI fChannelsToPadXB; // Array which stores the corresponding x position of PAD of entire module B + TArrayI fChannelsToPadYB; // Array which stores the corresponding y position of PAD of entire module B + TArrayD fRealX; // Array which stores the Real X (starting 18.733 cm) position of PAD + TArrayD fRealPadSize; // Array which stores the Real Progressive size of each padX (starting .327 cm ) ClassDef(CbmMcbm2018MuchPar, 1); }; diff --git a/core/detectors/much/CbmMuchContFact.cxx b/core/detectors/much/CbmMuchContFact.cxx index 22c2c2e072ff3314acc2033456b285491047a8f0..9b5283cd45a249b2440d29beeadb869871e98dc2 100644 --- a/core/detectors/much/CbmMuchContFact.cxx +++ b/core/detectors/much/CbmMuchContFact.cxx @@ -47,8 +47,7 @@ void CbmMuchContFact::setAllContainers() { p2->addContext("TestNonDefaultContext"); containers->Add(p2); - FairContainer* beamPars = new FairContainer( - "CbmMcbm2018MuchPar", "Much at MCBM 2018 Unpack Parameters", "Default"); + FairContainer* beamPars = new FairContainer("CbmMcbm2018MuchPar", "Much at MCBM 2018 Unpack Parameters", "Default"); beamPars->addContext("Default"); containers->Add(beamPars); } @@ -63,9 +62,9 @@ FairParSet* CbmMuchContFact::createContainer(FairContainer* c) { if (strcmp(name, "CbmGeoMuchPar") == 0) { p = new CbmGeoMuchPar( c->getConcatName().Data(), c->GetTitle(), c->getContext()); - } else if (strcmp(name, "CbmMcbm2018MuchPar") == 0) { - p = new CbmMcbm2018MuchPar( - c->getConcatName().Data(), c->GetTitle(), c->getContext()); + } + else if (strcmp(name, "CbmMcbm2018MuchPar") == 0) { + p = new CbmMcbm2018MuchPar(c->getConcatName().Data(), c->GetTitle(), c->getContext()); } return p; diff --git a/core/detectors/psd/CbmMcbm2018PsdPar.cxx b/core/detectors/psd/CbmMcbm2018PsdPar.cxx index f629d23aad466f11cc88156bfa6cba49a8ec8479..a80d869f153fd4d6fa4da8c0cf5c53ea054378cc 100644 --- a/core/detectors/psd/CbmMcbm2018PsdPar.cxx +++ b/core/detectors/psd/CbmMcbm2018PsdPar.cxx @@ -14,9 +14,7 @@ #include "TString.h" // ----- Standard constructor ------------------------------------------ -CbmMcbm2018PsdPar::CbmMcbm2018PsdPar(const char* name, - const char* title, - const char* context) +CbmMcbm2018PsdPar::CbmMcbm2018PsdPar(const char* name, const char* title, const char* context) : FairParGenericSet(name, title, context) , fiMonitorMode(-1) , fiDebugMonitorMode(-1) @@ -30,7 +28,8 @@ CbmMcbm2018PsdPar::CbmMcbm2018PsdPar(const char* name, , fiNbMsTot(0) , fiNbMsOverlap(0) , fdSizeMsInNs(0.0) - , fdTsDeadtimePeriod(0.0) { + , fdTsDeadtimePeriod(0.0) +{ detName = "Psd"; } // ------------------------------------------------------------------------- @@ -42,7 +41,8 @@ CbmMcbm2018PsdPar::~CbmMcbm2018PsdPar() {} // ----- Public method clear ------------------------------------------- -void CbmMcbm2018PsdPar::clear() { +void CbmMcbm2018PsdPar::clear() +{ status = kFALSE; resetInputVersions(); } @@ -50,7 +50,8 @@ void CbmMcbm2018PsdPar::clear() { // ------------------------------------------------------------------------- -void CbmMcbm2018PsdPar::putParams(FairParamList* l) { +void CbmMcbm2018PsdPar::putParams(FairParamList* l) +{ if (!l) return; l->add("NrOfGdpbs", fiNrOfGdpb); l->add("GdpbIdArray", fiGdpbIdArray); @@ -67,7 +68,8 @@ void CbmMcbm2018PsdPar::putParams(FairParamList* l) { //------------------------------------------------------ -Bool_t CbmMcbm2018PsdPar::getParams(FairParamList* l) { +Bool_t CbmMcbm2018PsdPar::getParams(FairParamList* l) +{ if (!l) return kFALSE; @@ -96,14 +98,12 @@ Bool_t CbmMcbm2018PsdPar::getParams(FairParamList* l) { return kTRUE; } // ------------------------------------------------------------------------- -Int_t CbmMcbm2018PsdPar::FeeChanToGbtChan(UInt_t uChannelInFee) { - if (uChannelInFee < kuNbChannelsPerFee) - return kuFeeToGbt[uChannelInFee]; +Int_t CbmMcbm2018PsdPar::FeeChanToGbtChan(UInt_t uChannelInFee) +{ + if (uChannelInFee < kuNbChannelsPerFee) return kuFeeToGbt[uChannelInFee]; else { - LOG(fatal) << "CbmMcbm2018PsdPar::FeeChanToGbtChan => Index out of bound, " - << uChannelInFee << " vs " - << static_cast<uint32_t>(kuNbChannelsPerFee) - << ", returning crazy value!"; + LOG(fatal) << "CbmMcbm2018PsdPar::FeeChanToGbtChan => Index out of bound, " << uChannelInFee << " vs " + << static_cast<uint32_t>(kuNbChannelsPerFee) << ", returning crazy value!"; return -1; } // else of if( uChannelInFee < kuNbChannelsPerFee ) } diff --git a/core/detectors/psd/CbmMcbm2018PsdPar.h b/core/detectors/psd/CbmMcbm2018PsdPar.h index 7bbc21bfc01bfd8b00f5ab45b8f596c966d457ac..8b6f5c096e4e12d46019d1be8c2a8b1be18d317f 100644 --- a/core/detectors/psd/CbmMcbm2018PsdPar.h +++ b/core/detectors/psd/CbmMcbm2018PsdPar.h @@ -20,8 +20,7 @@ class CbmMcbm2018PsdPar : public FairParGenericSet { public: /** Standard constructor **/ - CbmMcbm2018PsdPar(const char* name = "CbmMcbm2018PsdPar", - const char* title = "Psd unpacker parameters", + CbmMcbm2018PsdPar(const char* name = "CbmMcbm2018PsdPar", const char* title = "Psd unpacker parameters", const char* context = "Default"); /** Destructor **/ @@ -38,25 +37,15 @@ public: //static constexpr UInt_t GetNrOfChannelsPerFee() { return kuNbChannelsPerFee; } static constexpr UInt_t GetNrOfFeePerGbtx() { return kuNbFeePerGbtx; } static constexpr UInt_t GetNrOfGbtxPerGdpb() { return kuNbGbtxPerGdpb; } - static constexpr UInt_t GetNrOfChannelsPerGbtx() { - return kuNbChannelsPerGbtx; - } - static constexpr UInt_t GetNrOfChannelsPerGdpb() { - return kuNbChannelsPerGdpb; - } + static constexpr UInt_t GetNrOfChannelsPerGbtx() { return kuNbChannelsPerGbtx; } + static constexpr UInt_t GetNrOfChannelsPerGdpb() { return kuNbChannelsPerGdpb; } static constexpr UInt_t GetNrOfFeePerGdpb() { return kuNbFeePerGdpb; } - inline UInt_t GetNumberOfChannels() { - return kuNbChannelsPerGdpb * fiNrOfGdpb; - } + inline UInt_t GetNumberOfChannels() { return kuNbChannelsPerGdpb * fiNrOfGdpb; } Int_t FeeChanToGbtChan(UInt_t uChannelInFee); - inline Bool_t GetMonitorMode() { - return (1 == fiMonitorMode ? kTRUE : kFALSE); - } - inline Bool_t GetDebugMonitorMode() { - return (1 == fiDebugMonitorMode ? kTRUE : kFALSE); - } + inline Bool_t GetMonitorMode() { return (1 == fiMonitorMode ? kTRUE : kFALSE); } + inline Bool_t GetDebugMonitorMode() { return (1 == fiDebugMonitorMode ? kTRUE : kFALSE); } inline Int_t GetNrOfGdpbs() { return fiNrOfGdpb; } inline Int_t GetGdpbId(Int_t i) { return fiGdpbIdArray[i]; } @@ -79,23 +68,19 @@ private: /// Data format static const uint32_t kuBytesPerMessage = 8; /// Readout chain - static const uint32_t kuNbChannelsPerFee = 10; - static const uint32_t kuNbFeePerGbtx = 1; - static const uint32_t kuNbGbtxPerGdpb = 1; - static const uint32_t kuNbChannelsPerGbtx = - kuNbChannelsPerFee * kuNbFeePerGbtx; - static const uint32_t kuNbChannelsPerGdpb = - kuNbChannelsPerGbtx * kuNbGbtxPerGdpb; - static const uint32_t kuNbFeePerGdpb = kuNbFeePerGbtx * kuNbGbtxPerGdpb; + static const uint32_t kuNbChannelsPerFee = 10; + static const uint32_t kuNbFeePerGbtx = 1; + static const uint32_t kuNbGbtxPerGdpb = 1; + static const uint32_t kuNbChannelsPerGbtx = kuNbChannelsPerFee * kuNbFeePerGbtx; + static const uint32_t kuNbChannelsPerGdpb = kuNbChannelsPerGbtx * kuNbGbtxPerGdpb; + static const uint32_t kuNbFeePerGdpb = kuNbFeePerGbtx * kuNbGbtxPerGdpb; /// Mapping - const UInt_t kuFeeToGbt[kuNbChannelsPerFee] = - {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; //! Map from Psd channel to Gbt channel + const UInt_t kuFeeToGbt[kuNbChannelsPerFee] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; //! Map from Psd channel to Gbt channel - Int_t - fiMonitorMode; // Enable histograms in event builder processes and algo, 0 = OFF / 1 = ON + Int_t fiMonitorMode; // Enable histograms in event builder processes and algo, 0 = OFF / 1 = ON Int_t fiDebugMonitorMode; // Enable extra debuging histos in bth event builder and monitor processes and algo, 0 = OFF / 1 = ON - Int_t fiNrOfGdpb; // Total number of GDPBs + Int_t fiNrOfGdpb; // Total number of GDPBs TArrayI fiGdpbIdArray; // Array to hold the unique IDs for all Psd GDPBs Int_t fiNrOfFeesPerGdpb; // Number of FEEs which are connected to one GDPB @@ -103,13 +88,11 @@ private: Int_t fiNrOfGbtx; // Total number of Gbtx links Int_t fiNrOfModules; // Total number of Modules - TArrayI - fiModuleId; // Module Identifier connected to Gbtx link, has to match geometry + TArrayI fiModuleId; // Module Identifier connected to Gbtx link, has to match geometry - Int_t fiNbMsTot; // Total number of MS per link in TS - Int_t fiNbMsOverlap; // Number of overlap MS per TS - Double_t - fdSizeMsInNs; // Size of the MS in ns, needed for MS border detection + Int_t fiNbMsTot; // Total number of MS per link in TS + Int_t fiNbMsOverlap; // Number of overlap MS per TS + Double_t fdSizeMsInNs; // Size of the MS in ns, needed for MS border detection Double_t fdTsDeadtimePeriod; // Period (ns) in the first MS of each TS where events with missing triggers should be built using the overlap MS of previous TS (overlap events) diff --git a/core/detectors/psd/CbmPsdContFact.cxx b/core/detectors/psd/CbmPsdContFact.cxx index aba06d4e90693aee670fab0983bd6a45f919e1eb..388cc83820ae25380dda04a9e5106a09eb522f62 100644 --- a/core/detectors/psd/CbmPsdContFact.cxx +++ b/core/detectors/psd/CbmPsdContFact.cxx @@ -24,7 +24,8 @@ ClassImp(CbmPsdContFact) static CbmPsdContFact gCbmPsdContFact; -CbmPsdContFact::CbmPsdContFact() { +CbmPsdContFact::CbmPsdContFact() +{ // Constructor (called when the library is loaded) fName = "CbmPsdContFact"; fTitle = "Factory for parameter containers in libPsdBase"; @@ -32,17 +33,18 @@ CbmPsdContFact::CbmPsdContFact() { FairRuntimeDb::instance()->addContFactory(this); } -void CbmPsdContFact::setAllContainers() { +void CbmPsdContFact::setAllContainers() +{ /** Creates the Container objects with all accepted contexts and adds them to * the list of containers for the PsdBase library.*/ - FairContainer* beamPars = new FairContainer( - "CbmMcbm2018PsdPar", "Psd at MCBM 2018 Unpack Parameters", "Default"); + FairContainer* beamPars = new FairContainer("CbmMcbm2018PsdPar", "Psd at MCBM 2018 Unpack Parameters", "Default"); beamPars->addContext("Default"); containers->Add(beamPars); } -FairParSet* CbmPsdContFact::createContainer(FairContainer* c) { +FairParSet* CbmPsdContFact::createContainer(FairContainer* c) +{ /** Calls the constructor of the corresponding parameter container. * For an actual context, which is not an empty string and not the default context * of this container, the name is concatinated with the context. */ @@ -50,8 +52,7 @@ FairParSet* CbmPsdContFact::createContainer(FairContainer* c) { LOG(info) << " -I container name " << name; FairParSet* p = 0; if (strcmp(name, "CbmMcbm2018PsdPar") == 0) { - p = new CbmMcbm2018PsdPar( - c->getConcatName().Data(), c->GetTitle(), c->getContext()); + p = new CbmMcbm2018PsdPar(c->getConcatName().Data(), c->GetTitle(), c->getContext()); } return p; diff --git a/core/detectors/psd/CbmPsdContFact.h b/core/detectors/psd/CbmPsdContFact.h index b37622e0f0ab3102b3d942468f57d685fdd3ff50..b3f445502348ba57c4243adda737df6be92eeedd 100644 --- a/core/detectors/psd/CbmPsdContFact.h +++ b/core/detectors/psd/CbmPsdContFact.h @@ -11,10 +11,10 @@ #ifndef CBMPSDCONTFACT_H #define CBMPSDCONTFACT_H -#include <Rtypes.h> // for THashConsistencyHolder, ClassDef - #include <FairContFact.h> // for FairContFact +#include <Rtypes.h> // for THashConsistencyHolder, ClassDef + class FairParIo; class FairParSet; class FairContainer; diff --git a/core/detectors/rich/CbmMcbm2018RichPar.cxx b/core/detectors/rich/CbmMcbm2018RichPar.cxx index 0d39d00435d70f8de48e05ecb55f202cd37d8b0d..420ce2a8ac3aebab0f0817437df8bb6577bb96ad 100644 --- a/core/detectors/rich/CbmMcbm2018RichPar.cxx +++ b/core/detectors/rich/CbmMcbm2018RichPar.cxx @@ -16,23 +16,24 @@ //#include "FairLogger.h" //TODO delete -CbmMcbm2018RichPar::CbmMcbm2018RichPar(const char* name, - const char* title, - const char* context) - : FairParGenericSet(name, title, context) { +CbmMcbm2018RichPar::CbmMcbm2018RichPar(const char* name, const char* title, const char* context) + : FairParGenericSet(name, title, context) +{ detName = "RICH"; } CbmMcbm2018RichPar::~CbmMcbm2018RichPar() {} -void CbmMcbm2018RichPar::putParams(FairParamList* l) { +void CbmMcbm2018RichPar::putParams(FairParamList* l) +{ if (!l) return; l->add("TRBaddresses", fTRBaddresses); l->add("ToTshifts", fToTshifts); } -Bool_t CbmMcbm2018RichPar::getParams(FairParamList* l) { +Bool_t CbmMcbm2018RichPar::getParams(FairParamList* l) +{ if (!l) return kFALSE; if (!l->fill("TRBaddresses", &fTRBaddresses)) return kFALSE; @@ -47,28 +48,29 @@ Bool_t CbmMcbm2018RichPar::getParams(FairParamList* l) { // Create a map from the lists imported from the par file for (Int_t i = 0; i < siz; i++) { for (Int_t ch = 0; ch <= 32; ch++) { - fToTshiftMap.insert( - std::pair<Int_t, Double_t>(i * 33 + ch, fToTshifts[i * 33 + ch])); + fToTshiftMap.insert(std::pair<Int_t, Double_t>(i * 33 + ch, fToTshifts[i * 33 + ch])); } } return kTRUE; } -Int_t CbmMcbm2018RichPar::GetAddressIdx(Int_t addr) const { +Int_t CbmMcbm2018RichPar::GetAddressIdx(Int_t addr) const +{ //TODO catch exception only for map try { Int_t idx = fTRBaddrMap.at(addr); return idx; - } catch (...) { - LOG(warning) - << "CbmMcbm2018RichPar::GetAddressIdx => Unknown TRB address 0x" - << std::hex << std::setw(4) << addr << ", probably corrupted data!"; + } + catch (...) { + LOG(warning) << "CbmMcbm2018RichPar::GetAddressIdx => Unknown TRB address 0x" << std::hex << std::setw(4) << addr + << ", probably corrupted data!"; return -1; } } -Int_t CbmMcbm2018RichPar::GetAddress(Int_t ind) const { +Int_t CbmMcbm2018RichPar::GetAddress(Int_t ind) const +{ if (ind < 0 || ind >= fTRBaddresses.GetSize()) return -1; return fTRBaddresses[ind]; } diff --git a/core/detectors/rich/CbmMcbm2018RichPar.h b/core/detectors/rich/CbmMcbm2018RichPar.h index 2bbf9f3b09b8ebe7dce682408efff40268105875..21aca2691a8bab8b0847e2a3fa2c64a180e5cc09 100644 --- a/core/detectors/rich/CbmMcbm2018RichPar.h +++ b/core/detectors/rich/CbmMcbm2018RichPar.h @@ -12,8 +12,7 @@ class CbmMcbm2018RichPar : public FairParGenericSet { public: - CbmMcbm2018RichPar(const char* name = "CbmMcbm2018RichPar", - const char* title = "RICH unpacker parameters", + CbmMcbm2018RichPar(const char* name = "CbmMcbm2018RichPar", const char* title = "RICH unpacker parameters", const char* context = "Default"); virtual ~CbmMcbm2018RichPar(); @@ -33,7 +32,8 @@ public: * First argument is TDC ID (i.e. 0x7210) * TODO: test! */ - Double_t GetToTshift(Int_t tdc, Int_t ch) const { + Double_t GetToTshift(Int_t tdc, Int_t ch) const + { Int_t tdcIdx = this->GetAddressIdx(tdc); return this->GetToTshift2(tdcIdx, ch); } @@ -42,9 +42,7 @@ public: * First argument is TDC index (i.e. 0,1,2,...) * TODO: test! */ - Double_t GetToTshift2(Int_t tdcIdx, Int_t ch) const { - return fToTshiftMap.at(tdcIdx * 33 + ch); - } + Double_t GetToTshift2(Int_t tdcIdx, Int_t ch) const { return fToTshiftMap.at(tdcIdx * 33 + ch); } private: // Stored in the par file /** diff --git a/core/detectors/rich/CbmRichContFact.cxx b/core/detectors/rich/CbmRichContFact.cxx index 6c48c0291da4e5c2da7eb53601f4ef32d7f746e1..b9a53f0160584434f05f3d9b85d78e99250526e7 100644 --- a/core/detectors/rich/CbmRichContFact.cxx +++ b/core/detectors/rich/CbmRichContFact.cxx @@ -24,7 +24,8 @@ ClassImp(CbmRichContFact) static CbmRichContFact gCbmRichContFact; -CbmRichContFact::CbmRichContFact() { +CbmRichContFact::CbmRichContFact() +{ // Constructor (called when the library is loaded) fName = "CbmRichContFact"; fTitle = "Factory for parameter containers in libRichBase"; @@ -32,17 +33,18 @@ CbmRichContFact::CbmRichContFact() { FairRuntimeDb::instance()->addContFactory(this); } -void CbmRichContFact::setAllContainers() { +void CbmRichContFact::setAllContainers() +{ /** Creates the Container objects with all accepted contexts and adds them to * the list of containers for the RichBase library.*/ - FairContainer* beamPars = new FairContainer( - "CbmMcbm2018RichPar", "Rich at MCBM 2018 Unpack Parameters", "Default"); + FairContainer* beamPars = new FairContainer("CbmMcbm2018RichPar", "Rich at MCBM 2018 Unpack Parameters", "Default"); beamPars->addContext("Default"); containers->Add(beamPars); } -FairParSet* CbmRichContFact::createContainer(FairContainer* c) { +FairParSet* CbmRichContFact::createContainer(FairContainer* c) +{ /** Calls the constructor of the corresponding parameter container. * For an actual context, which is not an empty string and not the default context * of this container, the name is concatinated with the context. */ @@ -50,8 +52,7 @@ FairParSet* CbmRichContFact::createContainer(FairContainer* c) { LOG(info) << " -I container name " << name; FairParSet* p = 0; if (strcmp(name, "CbmMcbm2018RichPar") == 0) { - p = new CbmMcbm2018RichPar( - c->getConcatName().Data(), c->GetTitle(), c->getContext()); + p = new CbmMcbm2018RichPar(c->getConcatName().Data(), c->GetTitle(), c->getContext()); } return p; diff --git a/core/detectors/rich/CbmRichContFact.h b/core/detectors/rich/CbmRichContFact.h index bdcdc2d32a8db13e8c21ab9c165c916645ac58a6..4c0afcecc1f5abee226ac9e0989b8251a2c81789 100644 --- a/core/detectors/rich/CbmRichContFact.h +++ b/core/detectors/rich/CbmRichContFact.h @@ -11,10 +11,10 @@ #ifndef CBMRICHCONTFACT_H #define CBMRICHCONTFACT_H -#include <Rtypes.h> // for THashConsistencyHolder, ClassDef - #include <FairContFact.h> // for FairContFact +#include <Rtypes.h> // for THashConsistencyHolder, ClassDef + class FairParIo; class FairParSet; class FairContainer; diff --git a/core/detectors/sts/CbmMcbm2018StsPar.cxx b/core/detectors/sts/CbmMcbm2018StsPar.cxx index 3542941d1fccee54fc300191729e252bb9fc7ae3..adaf6e44996f2cf2c4cad7fee1133ca4f006e650 100644 --- a/core/detectors/sts/CbmMcbm2018StsPar.cxx +++ b/core/detectors/sts/CbmMcbm2018StsPar.cxx @@ -16,13 +16,10 @@ using namespace std; /// Constants assignation -const Double_t CbmMcbm2018StsPar::kdStereoAngleTan = - TMath::Tan(kdStereoAngle * TMath::DegToRad()); +const Double_t CbmMcbm2018StsPar::kdStereoAngleTan = TMath::Tan(kdStereoAngle * TMath::DegToRad()); // ----- Standard constructor ------------------------------------------ -CbmMcbm2018StsPar::CbmMcbm2018StsPar(const char* name, - const char* title, - const char* context) +CbmMcbm2018StsPar::CbmMcbm2018StsPar(const char* name, const char* title, const char* context) : FairParGenericSet(name, title, context) , fuNbModules(0) , fiModuleType() @@ -37,7 +34,8 @@ CbmMcbm2018StsPar::CbmMcbm2018StsPar(const char* name, , fdFebAdcGain() , fdFebAdcBase() , fdFebAdcThrGain() - , fiFebAdcThrOffs() { + , fiFebAdcThrOffs() +{ detName = "Sts"; } // ------------------------------------------------------------------------- @@ -49,7 +47,8 @@ CbmMcbm2018StsPar::~CbmMcbm2018StsPar() {} // ----- Public method clear ------------------------------------------- -void CbmMcbm2018StsPar::clear() { +void CbmMcbm2018StsPar::clear() +{ status = kFALSE; resetInputVersions(); } @@ -57,7 +56,8 @@ void CbmMcbm2018StsPar::clear() { // ------------------------------------------------------------------------- -void CbmMcbm2018StsPar::putParams(FairParamList* l) { +void CbmMcbm2018StsPar::putParams(FairParamList* l) +{ if (!l) return; l->add("NbModules", fuNbModules); @@ -79,7 +79,8 @@ void CbmMcbm2018StsPar::putParams(FairParamList* l) { // ------------------------------------------------------------------------- -Bool_t CbmMcbm2018StsPar::getParams(FairParamList* l) { +Bool_t CbmMcbm2018StsPar::getParams(FairParamList* l) +{ if (!l) return kFALSE; @@ -122,117 +123,107 @@ Bool_t CbmMcbm2018StsPar::getParams(FairParamList* l) { return kTRUE; } // ------------------------------------------------------------------------- -Int_t CbmMcbm2018StsPar::ElinkIdxToFebIdx(UInt_t uElink) { - if (uElink < kuNbElinksPerCrob) - return kiCrobMapElinkFebIdx[uElink]; +Int_t CbmMcbm2018StsPar::ElinkIdxToFebIdx(UInt_t uElink) +{ + if (uElink < kuNbElinksPerCrob) return kiCrobMapElinkFebIdx[uElink]; else { - LOG(warning) - << "CbmMcbm2018StsPar::ElinkIdxToFebIdx => Index out of bound, " - << "returning crazy value!"; + LOG(warning) << "CbmMcbm2018StsPar::ElinkIdxToFebIdx => Index out of bound, " + << "returning crazy value!"; return -1; } // else of if( uElink < kuNbElinksPerCrob ) } // ------------------------------------------------------------------------- -UInt_t CbmMcbm2018StsPar::ElinkIdxToAsicIdxFebA(UInt_t uElink) { - if (uElink < kuNbElinksPerCrob) - return kuCrobMapElinkFebA[uElink]; +UInt_t CbmMcbm2018StsPar::ElinkIdxToAsicIdxFebA(UInt_t uElink) +{ + if (uElink < kuNbElinksPerCrob) return kuCrobMapElinkFebA[uElink]; else { - LOG(warning) - << "CbmMcbm2018StsPar::ElinkIdxToAsicIdxFebA => Index out of bound, " - << "returning crazy value!"; + LOG(warning) << "CbmMcbm2018StsPar::ElinkIdxToAsicIdxFebA => Index out of bound, " + << "returning crazy value!"; return 0xFFFF; } // else of if( uElink < kuNbElinksPerCrob ) } -UInt_t CbmMcbm2018StsPar::ElinkIdxToAsicIdxFebB(UInt_t uElink) { - if (uElink < kuNbElinksPerCrob) - return kuCrobMapElinkFebB[uElink]; +UInt_t CbmMcbm2018StsPar::ElinkIdxToAsicIdxFebB(UInt_t uElink) +{ + if (uElink < kuNbElinksPerCrob) return kuCrobMapElinkFebB[uElink]; else { - LOG(warning) - << "CbmMcbm2018StsPar::ElinkIdxToAsicIdxFebB => Index out of bound, " - << "returning crazy value!"; + LOG(warning) << "CbmMcbm2018StsPar::ElinkIdxToAsicIdxFebB => Index out of bound, " + << "returning crazy value!"; return 0xFFFF; } // else of if( uElink < kuNbElinksPerCrob ) } // ------------------------------------------------------------------------- -Bool_t CbmMcbm2018StsPar::CheckModuleIndex(UInt_t uModuleIdx) { - if (uModuleIdx < fuNbModules) - return kTRUE; +Bool_t CbmMcbm2018StsPar::CheckModuleIndex(UInt_t uModuleIdx) +{ + if (uModuleIdx < fuNbModules) return kTRUE; else { - LOG(warning) - << "CbmMcbm2018StsPar::CheckModuleIndex => Index out of bound!"; + LOG(warning) << "CbmMcbm2018StsPar::CheckModuleIndex => Index out of bound!"; return kFALSE; } // else of if( uModuleIdx < fuNbModules ) } -UInt_t CbmMcbm2018StsPar::GetModuleType(UInt_t uModuleIdx) { - if (uModuleIdx < fuNbModules) - return fiModuleType[uModuleIdx]; +UInt_t CbmMcbm2018StsPar::GetModuleType(UInt_t uModuleIdx) +{ + if (uModuleIdx < fuNbModules) return fiModuleType[uModuleIdx]; else { LOG(warning) << "CbmMcbm2018StsPar::GetModuleType => Index out of bound, " << "returning crazy value!"; return 0xFFFFFFFF; } // else of if( uModuleIdx < fuNbModules ) } -UInt_t CbmMcbm2018StsPar::GetModuleAddress(UInt_t uModuleIdx) { - if (uModuleIdx < fuNbModules) - return fiModAddress[uModuleIdx]; +UInt_t CbmMcbm2018StsPar::GetModuleAddress(UInt_t uModuleIdx) +{ + if (uModuleIdx < fuNbModules) return fiModAddress[uModuleIdx]; else { - LOG(warning) - << "CbmMcbm2018StsPar::GetModuleAddress => Index out of bound, " - << "returning crazy value!"; + LOG(warning) << "CbmMcbm2018StsPar::GetModuleAddress => Index out of bound, " + << "returning crazy value!"; return 0xFFFFFFFF; } // else of if( uModuleIdx < fuNbModules ) } -Double_t CbmMcbm2018StsPar::GetModuleCenterPosX(UInt_t uModuleIdx) { - if (uModuleIdx < fuNbModules) - return fdModCenterPosX[uModuleIdx]; +Double_t CbmMcbm2018StsPar::GetModuleCenterPosX(UInt_t uModuleIdx) +{ + if (uModuleIdx < fuNbModules) return fdModCenterPosX[uModuleIdx]; else { - LOG(warning) - << "CbmMcbm2018StsPar::GetModuleCenterPosX => Index out of bound, " - << "returning crazy value!"; + LOG(warning) << "CbmMcbm2018StsPar::GetModuleCenterPosX => Index out of bound, " + << "returning crazy value!"; return 3.844e11; // Fly to the Moon! } // else of if( uModuleIdx < fuNbModules ) } -Double_t CbmMcbm2018StsPar::GetModuleCenterPosY(UInt_t uModuleIdx) { - if (uModuleIdx < fuNbModules) - return fdModCenterPosY[uModuleIdx]; +Double_t CbmMcbm2018StsPar::GetModuleCenterPosY(UInt_t uModuleIdx) +{ + if (uModuleIdx < fuNbModules) return fdModCenterPosY[uModuleIdx]; else { - LOG(warning) - << "CbmMcbm2018StsPar::GetModuleCenterPosY => Index out of bound, " - << "returning crazy value!"; + LOG(warning) << "CbmMcbm2018StsPar::GetModuleCenterPosY => Index out of bound, " + << "returning crazy value!"; return 3.844e11; // Fly to the Moon! } // else of if( uModuleIdx < fuNbModules ) } // ------------------------------------------------------------------------- -UInt_t CbmMcbm2018StsPar::GetDpbId(UInt_t uDpbIdx) { - if (uDpbIdx < fuNrOfDpbs) - return fiDbpIdArray[uDpbIdx]; +UInt_t CbmMcbm2018StsPar::GetDpbId(UInt_t uDpbIdx) +{ + if (uDpbIdx < fuNrOfDpbs) return fiDbpIdArray[uDpbIdx]; else { LOG(warning) << "CbmMcbm2018StsPar::GetDpbId => Index out of bound, " << "returning crazy value!"; return 0xFFFFFFFF; } // else of if( uDpbIdx < fuNrOfDpbs ) } -Bool_t CbmMcbm2018StsPar::IsCrobActive(UInt_t uDpbIdx, UInt_t uCrobIdx) { +Bool_t CbmMcbm2018StsPar::IsCrobActive(UInt_t uDpbIdx, UInt_t uCrobIdx) +{ if (uDpbIdx < fuNrOfDpbs) { - if (uCrobIdx < kuNbCrobsPerDpb) - return 0 < fiCrobActiveFlag[uDpbIdx * kuNbCrobsPerDpb + uCrobIdx] - ? kTRUE - : kFALSE; + if (uCrobIdx < kuNbCrobsPerDpb) return 0 < fiCrobActiveFlag[uDpbIdx * kuNbCrobsPerDpb + uCrobIdx] ? kTRUE : kFALSE; else { - LOG(warning) - << "CbmMcbm2018StsPar::IsCrobActive => Crob Index out of bound, " - << "returning default inactive!"; + LOG(warning) << "CbmMcbm2018StsPar::IsCrobActive => Crob Index out of bound, " + << "returning default inactive!"; return kFALSE; } // else of if( uCrobIdx < kuNbCrobsPerDpb ) } // if( uDpbIdx < fuNrOfDpbs ) else { - LOG(warning) - << "CbmMcbm2018StsPar::IsCrobActive => Dpb Index out of bound, " - << "returning default inactive!"; + LOG(warning) << "CbmMcbm2018StsPar::IsCrobActive => Dpb Index out of bound, " + << "returning default inactive!"; return kFALSE; } // else of if( uDpbIdx < fuNrOfDpbs ) } -Bool_t CbmMcbm2018StsPar::IsFebActive(UInt_t uFebInSystIdx) { +Bool_t CbmMcbm2018StsPar::IsFebActive(UInt_t uFebInSystIdx) +{ if (uFebInSystIdx < GetNrOfFebs()) { return (-1 == fiFebModuleIdx[uFebInSystIdx] ? kFALSE : kTRUE); @@ -243,27 +234,23 @@ Bool_t CbmMcbm2018StsPar::IsFebActive(UInt_t uFebInSystIdx) { return kFALSE; } // else of if( uFebInSystIdx < GetNrOfFebs() ) } -Bool_t CbmMcbm2018StsPar::IsFebActive(UInt_t uDpbIdx, - UInt_t uCrobIdx, - UInt_t uFebIdx) { +Bool_t CbmMcbm2018StsPar::IsFebActive(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; + UInt_t uIdx = (uDpbIdx * kuNbCrobsPerDpb + uCrobIdx) * kuNbFebsPerCrob + uFebIdx; return IsFebActive(uIdx); } // if( uFebIdx < kuNbFebsPerCrob ) else { - LOG(warning) - << "CbmMcbm2018StsPar::IsFebActive => Feb Index out of bound, " - << "returning default inactive!"; + LOG(warning) << "CbmMcbm2018StsPar::IsFebActive => Feb Index out of bound, " + << "returning default inactive!"; return kFALSE; } // else of if( uFebIdx < kuNbCrobsPerDpb ) } // if( uCrobIdx < kuNbCrobsPerDpb ) else { - LOG(warning) - << "CbmMcbm2018StsPar::IsFebActive => Crob Index out of bound, " - << "returning default inactive!"; + LOG(warning) << "CbmMcbm2018StsPar::IsFebActive => Crob Index out of bound, " + << "returning default inactive!"; return kFALSE; } // else of if( uCrobIdx < kuNbCrobsPerDpb ) } // if( uDpbIdx < fuNrOfDpbs ) @@ -273,221 +260,185 @@ Bool_t CbmMcbm2018StsPar::IsFebActive(UInt_t uDpbIdx, return kFALSE; } // else of if( uDpbIdx < fuNrOfDpbs ) } -Int_t CbmMcbm2018StsPar::GetFebModuleIdx(UInt_t uDpbIdx, - UInt_t uCrobIdx, - UInt_t uFebIdx) { +Int_t CbmMcbm2018StsPar::GetFebModuleIdx(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; + UInt_t uIdx = (uDpbIdx * kuNbCrobsPerDpb + uCrobIdx) * kuNbFebsPerCrob + uFebIdx; return fiFebModuleIdx[uIdx]; } // if( uFebIdx < kuNbFebsPerCrob ) else { - LOG(warning) - << "CbmMcbm2018StsPar::GetFebModuleIdx => Feb Index out of bound, " - << "returning default inactive!"; + LOG(warning) << "CbmMcbm2018StsPar::GetFebModuleIdx => Feb Index out of bound, " + << "returning default inactive!"; return -1; } // else of if( uCrobIdx < kuNbCrobsPerDpb ) } // if( uCrobIdx < kuNbCrobsPerDpb ) else { - LOG(warning) - << "CbmMcbm2018StsPar::GetFebModuleIdx => Crob Index out of bound, " - << "returning default inactive!"; + LOG(warning) << "CbmMcbm2018StsPar::GetFebModuleIdx => Crob Index out of bound, " + << "returning default inactive!"; return -1; } // else of if( uCrobIdx < kuNbCrobsPerDpb ) } // if( uDpbIdx < fuNrOfDpbs ) else { - LOG(warning) - << "CbmMcbm2018StsPar::GetFebModuleIdx => Dpb Index out of bound, " - << "returning default inactive!"; + LOG(warning) << "CbmMcbm2018StsPar::GetFebModuleIdx => Dpb Index out of bound, " + << "returning default inactive!"; return -1; } // else of if( uDpbIdx < fuNrOfDpbs ) } -Int_t CbmMcbm2018StsPar::GetFebModuleSide(UInt_t uDpbIdx, - UInt_t uCrobIdx, - UInt_t uFebIdx) { +Int_t CbmMcbm2018StsPar::GetFebModuleSide(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; + UInt_t uIdx = (uDpbIdx * kuNbCrobsPerDpb + uCrobIdx) * kuNbFebsPerCrob + uFebIdx; return fiFebModuleSide[uIdx]; } // if( uFebIdx < kuNbFebsPerCrob ) else { - LOG(warning) - << "CbmMcbm2018StsPar::GetFebModuleSide => Feb Index out of bound, " - << "returning default inactive!"; + LOG(warning) << "CbmMcbm2018StsPar::GetFebModuleSide => Feb Index out of bound, " + << "returning default inactive!"; return -1; } // else of if( uCrobIdx < kuNbCrobsPerDpb ) } // if( uCrobIdx < kuNbCrobsPerDpb ) else { - LOG(warning) - << "CbmMcbm2018StsPar::GetFebModuleSide => Crob Index out of bound, " - << "returning default inactive!"; + LOG(warning) << "CbmMcbm2018StsPar::GetFebModuleSide => Crob Index out of bound, " + << "returning default inactive!"; return -1; } // else of if( uCrobIdx < kuNbCrobsPerDpb ) } // if( uDpbIdx < fuNrOfDpbs ) else { - LOG(warning) - << "CbmMcbm2018StsPar::GetFebModuleSide => Dpb Index out of bound, " - << "returning default inactive!"; + LOG(warning) << "CbmMcbm2018StsPar::GetFebModuleSide => Dpb Index out of bound, " + << "returning default inactive!"; return -1; } // else of if( uDpbIdx < fuNrOfDpbs ) } -Double_t CbmMcbm2018StsPar::GetFebAdcGain(UInt_t uDpbIdx, - UInt_t uCrobIdx, - UInt_t uFebIdx) { +Double_t CbmMcbm2018StsPar::GetFebAdcGain(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; + UInt_t uIdx = (uDpbIdx * kuNbCrobsPerDpb + uCrobIdx) * kuNbFebsPerCrob + uFebIdx; return fdFebAdcGain[uIdx]; } // if( uFebIdx < kuNbFebsPerCrob ) else { - LOG(warning) - << "CbmMcbm2018StsPar::GetFebAdcGain => Feb Index out of bound, " - << "returning default value!"; + LOG(warning) << "CbmMcbm2018StsPar::GetFebAdcGain => Feb Index out of bound, " + << "returning default value!"; return 0.0; } // else of if( uCrobIdx < kuNbCrobsPerDpb ) } // if( uCrobIdx < kuNbCrobsPerDpb ) else { - LOG(warning) - << "CbmMcbm2018StsPar::GetFebAdcGain => Crob Index out of bound, " - << "returning default value!"; + LOG(warning) << "CbmMcbm2018StsPar::GetFebAdcGain => Crob Index out of bound, " + << "returning default value!"; return 0.0; } // else of if( uCrobIdx < kuNbCrobsPerDpb ) } // if( uDpbIdx < fuNrOfDpbs ) else { - LOG(warning) - << "CbmMcbm2018StsPar::GetFebAdcGain => Dpb Index out of bound, " - << "returning default value!"; + LOG(warning) << "CbmMcbm2018StsPar::GetFebAdcGain => Dpb Index out of bound, " + << "returning default value!"; return 0.0; } // else of if( uDpbIdx < fuNrOfDpbs ) } -Double_t CbmMcbm2018StsPar::GetFebAdcOffset(UInt_t uDpbIdx, - UInt_t uCrobIdx, - UInt_t uFebIdx) { +Double_t CbmMcbm2018StsPar::GetFebAdcOffset(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 (fdFebAdcBase[uIdx] - + fdFebAdcThrGain[uIdx] * fiFebAdcThrOffs[uIdx]); + UInt_t uIdx = (uDpbIdx * kuNbCrobsPerDpb + uCrobIdx) * kuNbFebsPerCrob + uFebIdx; + return (fdFebAdcBase[uIdx] + fdFebAdcThrGain[uIdx] * fiFebAdcThrOffs[uIdx]); } // if( uFebIdx < kuNbFebsPerCrob ) else { - LOG(warning) - << "CbmMcbm2018StsPar::GetFebAdcOffset => Feb Index out of bound, " - << "returning default value!"; + LOG(warning) << "CbmMcbm2018StsPar::GetFebAdcOffset => Feb Index out of bound, " + << "returning default value!"; return 0.0; } // else of if( uCrobIdx < kuNbCrobsPerDpb ) } // if( uCrobIdx < kuNbCrobsPerDpb ) else { - LOG(warning) - << "CbmMcbm2018StsPar::GetFebAdcOffset => Crob Index out of bound, " - << "returning default value!"; + LOG(warning) << "CbmMcbm2018StsPar::GetFebAdcOffset => Crob Index out of bound, " + << "returning default value!"; return 0.0; } // else of if( uCrobIdx < kuNbCrobsPerDpb ) } // if( uDpbIdx < fuNrOfDpbs ) else { - LOG(warning) - << "CbmMcbm2018StsPar::GetFebAdcOffset => Dpb Index out of bound, " - << "returning default value!"; + LOG(warning) << "CbmMcbm2018StsPar::GetFebAdcOffset => Dpb Index out of bound, " + << "returning default value!"; return 0.0; } // else of if( uDpbIdx < fuNrOfDpbs ) } -Double_t CbmMcbm2018StsPar::GetFebAdcBase(UInt_t uDpbIdx, - UInt_t uCrobIdx, - UInt_t uFebIdx) { +Double_t CbmMcbm2018StsPar::GetFebAdcBase(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; + UInt_t uIdx = (uDpbIdx * kuNbCrobsPerDpb + uCrobIdx) * kuNbFebsPerCrob + uFebIdx; return fdFebAdcBase[uIdx]; } // if( uFebIdx < kuNbFebsPerCrob ) else { - LOG(warning) - << "CbmMcbm2018StsPar::GetFebAdcBase => Feb Index out of bound, " - << "returning default value!"; + LOG(warning) << "CbmMcbm2018StsPar::GetFebAdcBase => Feb Index out of bound, " + << "returning default value!"; return 0.0; } // else of if( uCrobIdx < kuNbCrobsPerDpb ) } // if( uCrobIdx < kuNbCrobsPerDpb ) else { - LOG(warning) - << "CbmMcbm2018StsPar::GetFebAdcBase => Crob Index out of bound, " - << "returning default value!"; + LOG(warning) << "CbmMcbm2018StsPar::GetFebAdcBase => Crob Index out of bound, " + << "returning default value!"; return 0.0; } // else of if( uCrobIdx < kuNbCrobsPerDpb ) } // if( uDpbIdx < fuNrOfDpbs ) else { - LOG(warning) - << "CbmMcbm2018StsPar::GetFebAdcBase => Dpb Index out of bound, " - << "returning default value!"; + LOG(warning) << "CbmMcbm2018StsPar::GetFebAdcBase => Dpb Index out of bound, " + << "returning default value!"; return 0.0; } // else of if( uDpbIdx < fuNrOfDpbs ) } -Double_t CbmMcbm2018StsPar::GetFebAdcThrGain(UInt_t uDpbIdx, - UInt_t uCrobIdx, - UInt_t uFebIdx) { +Double_t CbmMcbm2018StsPar::GetFebAdcThrGain(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; + UInt_t uIdx = (uDpbIdx * kuNbCrobsPerDpb + uCrobIdx) * kuNbFebsPerCrob + uFebIdx; return fdFebAdcThrGain[uIdx]; } // if( uFebIdx < kuNbFebsPerCrob ) else { - LOG(warning) - << "CbmMcbm2018StsPar::GetFebAdcThrGain => Feb Index out of bound, " - << "returning default value!"; + LOG(warning) << "CbmMcbm2018StsPar::GetFebAdcThrGain => Feb Index out of bound, " + << "returning default value!"; return 0.0; } // else of if( uCrobIdx < kuNbCrobsPerDpb ) } // if( uCrobIdx < kuNbCrobsPerDpb ) else { - LOG(warning) - << "CbmMcbm2018StsPar::GetFebAdcThrGain => Crob Index out of bound, " - << "returning default value!"; + LOG(warning) << "CbmMcbm2018StsPar::GetFebAdcThrGain => Crob Index out of bound, " + << "returning default value!"; return 0.0; } // else of if( uCrobIdx < kuNbCrobsPerDpb ) } // if( uDpbIdx < fuNrOfDpbs ) else { - LOG(warning) - << "CbmMcbm2018StsPar::GetFebAdcThrGain => Dpb Index out of bound, " - << "returning default value!"; + LOG(warning) << "CbmMcbm2018StsPar::GetFebAdcThrGain => Dpb Index out of bound, " + << "returning default value!"; return 0.0; } // else of if( uDpbIdx < fuNrOfDpbs ) } -Int_t CbmMcbm2018StsPar::GetFebAdcThrOffs(UInt_t uDpbIdx, - UInt_t uCrobIdx, - UInt_t uFebIdx) { +Int_t CbmMcbm2018StsPar::GetFebAdcThrOffs(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; + UInt_t uIdx = (uDpbIdx * kuNbCrobsPerDpb + uCrobIdx) * kuNbFebsPerCrob + uFebIdx; return fiFebAdcThrOffs[uIdx]; } // if( uFebIdx < kuNbFebsPerCrob ) else { - LOG(warning) - << "CbmMcbm2018StsPar::GetFebAdcThrOffs => Feb Index out of bound, " - << "returning default value!"; + LOG(warning) << "CbmMcbm2018StsPar::GetFebAdcThrOffs => Feb Index out of bound, " + << "returning default value!"; return 0; } // else of if( uCrobIdx < kuNbCrobsPerDpb ) } // if( uCrobIdx < kuNbCrobsPerDpb ) else { - LOG(warning) - << "CbmMcbm2018StsPar::GetFebAdcThrOffs => Crob Index out of bound, " - << "returning default value!"; + LOG(warning) << "CbmMcbm2018StsPar::GetFebAdcThrOffs => Crob Index out of bound, " + << "returning default value!"; return 0; } // else of if( uCrobIdx < kuNbCrobsPerDpb ) } // if( uDpbIdx < fuNrOfDpbs ) else { - LOG(warning) - << "CbmMcbm2018StsPar::GetFebAdcThrOffs => Dpb Index out of bound, " - << "returning default value!"; + LOG(warning) << "CbmMcbm2018StsPar::GetFebAdcThrOffs => Dpb Index out of bound, " + << "returning default value!"; return 0; } // else of if( uDpbIdx < fuNrOfDpbs ) } diff --git a/core/detectors/sts/CbmMcbm2018StsPar.h b/core/detectors/sts/CbmMcbm2018StsPar.h index e60cb7f78387aba4a8ceebf1884dc0273aa822be..a1f9cd6c37489d8d6aff72d88e2608e692609a5a 100644 --- a/core/detectors/sts/CbmMcbm2018StsPar.h +++ b/core/detectors/sts/CbmMcbm2018StsPar.h @@ -19,8 +19,7 @@ class CbmMcbm2018StsPar : public FairParGenericSet { public: /** Standard constructor **/ - CbmMcbm2018StsPar(const char* name = "CbmMcbm2018StsPar", - const char* title = "Sts parameters", + CbmMcbm2018StsPar(const char* name = "CbmMcbm2018StsPar", const char* title = "Sts parameters", const char* context = "Default"); @@ -35,24 +34,14 @@ public: static constexpr UInt_t GetNbCrobsPerDpb() { return kuNbCrobsPerDpb; } static constexpr UInt_t GetNbElinkPerCrob() { return kuNbElinksPerCrob; } - static constexpr UInt_t GetNbElinkPerDpb() { - return kuNbCrobsPerDpb * kuNbElinksPerCrob; - } + static constexpr UInt_t GetNbElinkPerDpb() { return kuNbCrobsPerDpb * kuNbElinksPerCrob; } static constexpr UInt_t GetNbFebsPerCrob() { return kuNbFebsPerCrob; } - static constexpr UInt_t GetNbFebsPerDpb() { - return kuNbCrobsPerDpb * kuNbFebsPerCrob; - } + static constexpr UInt_t GetNbFebsPerDpb() { return kuNbCrobsPerDpb * kuNbFebsPerCrob; } static constexpr UInt_t GetNbAsicsPerFeb() { return kuNbAsicsPerFeb; } - static constexpr UInt_t GetNbAsicsPerCrob() { - return kuNbFebsPerCrob * kuNbAsicsPerFeb; - } - static constexpr UInt_t GetNbAsicsPerDpb() { - return kuNbCrobsPerDpb * GetNbAsicsPerCrob(); - } + static constexpr UInt_t GetNbAsicsPerCrob() { return kuNbFebsPerCrob * kuNbAsicsPerFeb; } + static constexpr UInt_t GetNbAsicsPerDpb() { return kuNbCrobsPerDpb * GetNbAsicsPerCrob(); } static constexpr UInt_t GetNbChanPerAsic() { return kuNbChanPerAsic; } - static constexpr UInt_t GetNbChanPerFeb() { - return kuNbAsicsPerFeb * kuNbChanPerAsic; - } + static constexpr UInt_t GetNbChanPerFeb() { return kuNbAsicsPerFeb * kuNbChanPerAsic; } static constexpr Double_t GetStereoAngle() { return kdStereoAngle; } static constexpr Double_t GetPitchMm() { return kdPitchMm; } @@ -66,9 +55,9 @@ public: Double_t GetStereoAngleTan() const { return kdStereoAngleTan; } Int_t ElinkIdxToFebIdx(UInt_t uElink); - UInt_t ElinkIdxToAsicIdx(Bool_t bFebType, UInt_t uElink) { - return kTRUE == bFebType ? ElinkIdxToAsicIdxFebB(uElink) - : ElinkIdxToAsicIdxFebA(uElink); + UInt_t ElinkIdxToAsicIdx(Bool_t bFebType, UInt_t uElink) + { + return kTRUE == bFebType ? ElinkIdxToAsicIdxFebB(uElink) : ElinkIdxToAsicIdxFebA(uElink); } UInt_t ElinkIdxToAsicIdxFebA(UInt_t uElink); UInt_t ElinkIdxToAsicIdxFebB(UInt_t uElink); @@ -101,80 +90,57 @@ public: private: /// Constants - static const UInt_t kuNbCrobsPerDpb = 1; // Number of CROBs possible per DPB - static const UInt_t kuNbElinksPerCrob = 42; // Number of elinks in each CROB - static const UInt_t kuNbFebsPerCrob = - 5; // Number of FEBs connected to each DPB - static const UInt_t kuNbAsicsPerFeb = - 8; // Number of ASICs connected in each FEB - static const UInt_t kuNbChanPerAsic = 128; // Number of channels in each ASIC + static const UInt_t kuNbCrobsPerDpb = 1; // Number of CROBs possible per DPB + static const UInt_t kuNbElinksPerCrob = 42; // Number of elinks in each CROB + static const UInt_t kuNbFebsPerCrob = 5; // Number of FEBs connected to each DPB + static const UInt_t kuNbAsicsPerFeb = 8; // Number of ASICs connected in each FEB + static const UInt_t kuNbChanPerAsic = 128; // Number of channels in each ASIC // static constexpr UInt_t kuCrobMapElinkFebA[ kuNbElinksPerCrob ] = { const UInt_t kuCrobMapElinkFebA[kuNbElinksPerCrob] = { - 0x0021, 0x0023, 0x0025, 0x0020, 0x0022, 0x0018, 0x001A, 0x001C, 0x0024, - 0x0027, 0xFFFF, 0xFFFF, 0x0026, 0x001E, 0x0010, 0x0012, 0x0019, 0x001B, - 0x001F, 0x000E, 0x0011, 0x0013, 0x000C, 0x0015, 0x0017, 0x0016, 0x001D, - 0x0014, 0x0009, 0x000D, 0x000F, 0x0008, 0x000A, 0x0002, 0x0004, 0x0006, - 0x000B, 0x0005, 0x0000, 0x0003, 0x0007, 0x0001, + 0x0021, 0x0023, 0x0025, 0x0020, 0x0022, 0x0018, 0x001A, 0x001C, 0x0024, 0x0027, 0xFFFF, 0xFFFF, 0x0026, 0x001E, + 0x0010, 0x0012, 0x0019, 0x001B, 0x001F, 0x000E, 0x0011, 0x0013, 0x000C, 0x0015, 0x0017, 0x0016, 0x001D, 0x0014, + 0x0009, 0x000D, 0x000F, 0x0008, 0x000A, 0x0002, 0x0004, 0x0006, 0x000B, 0x0005, 0x0000, 0x0003, 0x0007, 0x0001, }; //! Map from eLink index to ASIC index within CROB ( 0 to kuNbFebsPerCrob * kuNbAsicPerFeb ) // static constexpr UInt_t kuCrobMapElinkFebB[ kuNbElinksPerCrob ] = { - const UInt_t - kuCrobMapElinkFebB - [kuNbElinksPerCrob] = - { - 0x0027, 0x0025, 0x0023, 0x0026, 0x0024, 0x001E, 0x001C, 0x001A, - 0x0022, 0x0021, 0xFFFF, 0xFFFF, 0x0020, 0x0018, 0x0016, 0x0014, - 0x001F, 0x001D, 0x0019, 0x0008, 0x0017, 0x0015, 0x000A, 0x0013, - 0x0011, 0x0010, 0x001B, 0x0012, 0x000F, 0x000B, 0x0009, 0x000E, - 0x000C, 0x0004, 0x0002, 0x0000, 0x000D, 0x0003, 0x0006, 0x0005, - 0x0001, 0x0007}; //! Map from eLink index to ASIC index within CROB ( 0 to kuNbFebsPerCrob * kuNbAsicPerFeb ) + const UInt_t kuCrobMapElinkFebB[kuNbElinksPerCrob] = {0x0027, 0x0025, 0x0023, 0x0026, 0x0024, 0x001E, 0x001C, 0x001A, + 0x0022, 0x0021, 0xFFFF, 0xFFFF, 0x0020, 0x0018, 0x0016, 0x0014, + 0x001F, 0x001D, 0x0019, 0x0008, 0x0017, 0x0015, 0x000A, 0x0013, + 0x0011, 0x0010, 0x001B, 0x0012, 0x000F, 0x000B, 0x0009, 0x000E, + 0x000C, 0x0004, 0x0002, 0x0000, 0x000D, 0x0003, 0x0006, 0x0005, + 0x0001, 0x0007}; //! Map from eLink index to ASIC index within CROB ( 0 to kuNbFebsPerCrob * kuNbAsicPerFeb ) // static constexpr UInt_t kuCrobMapElinkFebIdx[ kuNbElinksPerCrob ] = { - const Int_t kiCrobMapElinkFebIdx[kuNbElinksPerCrob] = {4, 4, 4, 4, 4, - 3, 3, 3, 4, 4, - -1, -1, 4, 3, 2, - 2, 3, 3, 3, 1, - 2, 2, 1, 2, 2, - 2, 3, 2, 1, 1, - 1, 1, 1, 0, 0, - 0, 1, 0, 0, 0, - 0, 0}; //! Map from eLink index to ASIC index within CROB ( 0 to kuNbFebsPerCrob * kuNbAsicPerFeb ) + const Int_t kiCrobMapElinkFebIdx[kuNbElinksPerCrob] = { + 4, 4, 4, 4, 4, 3, 3, 3, 4, 4, -1, -1, 4, 3, 2, 2, 3, 3, 3, 1, 2, 2, + 1, 2, 2, 2, 3, 2, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0}; //! Map from eLink index to ASIC index within CROB ( 0 to kuNbFebsPerCrob * kuNbAsicPerFeb ) /// Modules properties (assumes 1 FEB per side!) - static constexpr Double_t kdStereoAngle = 7.5; // [Deg] - static const Double_t kdStereoAngleTan; // [] See cxx file for assignation - static constexpr Double_t kdPitchMm = 0.058; // [mm] - static constexpr Double_t kdSensorsSzX = - 60; // [mm], active is 59.570 mm (kiNbStrips*kdPitchMm) - static constexpr Double_t kdSensorsSzY = 60; // [mm], active is 59.570 mm - static constexpr Int_t kiCenterStripP = 512; // [] - static constexpr Int_t kiCenterStripN = 512; // [] - static constexpr Double_t kdCenterPosX = 0.0; // [mm] Top Center + static constexpr Double_t kdStereoAngle = 7.5; // [Deg] + static const Double_t kdStereoAngleTan; // [] See cxx file for assignation + static constexpr Double_t kdPitchMm = 0.058; // [mm] + static constexpr Double_t kdSensorsSzX = 60; // [mm], active is 59.570 mm (kiNbStrips*kdPitchMm) + static constexpr Double_t kdSensorsSzY = 60; // [mm], active is 59.570 mm + static constexpr Int_t kiCenterStripP = 512; // [] + static constexpr Int_t kiCenterStripN = 512; // [] + static constexpr Double_t kdCenterPosX = 0.0; // [mm] Top Center static constexpr Double_t kdCenterPosY = 59.570 / 2.0; // [mm] Top Center /// Variables - UInt_t fuNbModules; // Total number of STS modules in the setup - TArrayI - fiModuleType; // Type of each module: 0 for connectors on the right, 1 for connectors on the left - TArrayI fiModAddress; // STS address for the first strip of each module - TArrayD - fdModCenterPosX; // Offset of module center in X, in mm (Should be done by geometry for the unpacker!) - TArrayD - fdModCenterPosY; // Offset of module center in Y, in mm (Should be done by geometry for the unpacker!) - - 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 ] + UInt_t fuNbModules; // Total number of STS modules in the setup + TArrayI fiModuleType; // Type of each module: 0 for connectors on the right, 1 for connectors on the left + TArrayI fiModAddress; // STS address for the first strip of each module + TArrayD fdModCenterPosX; // Offset of module center in X, in mm (Should be done by geometry for the unpacker!) + TArrayD fdModCenterPosY; // Offset of module center in Y, in mm (Should be done by geometry for the unpacker!) + + 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 fiFebModuleIdx; // Index of the STS module for each FEB, [ NbDpb * kuNbCrobPerDpb * kuNbFebsPerCrob ], -1 if inactive TArrayI fiFebModuleSide; // STS module side for each FEB, [ NbDpb * kuNbCrobPerDpb * kuNbFebsPerCrob ], 0 = P, 1 = N, -1 if inactive - TArrayD - fdFebAdcGain; // ADC Gain in e-/ADC bin for each FEB, [ NbDpb * kuNbCrobPerDpb * kuNbFebsPerCrob ] - TArrayD - fdFebAdcBase; // Base at Cal. Thr. in e- for each FEB, [ NbDpb * kuNbCrobPerDpb * kuNbFebsPerCrob ] - TArrayD - fdFebAdcThrGain; // Thr. step in e-/Thr. Unit for each FEB, [ NbDpb * kuNbCrobPerDpb * kuNbFebsPerCrob ] + TArrayD fdFebAdcGain; // ADC Gain in e-/ADC bin for each FEB, [ NbDpb * kuNbCrobPerDpb * kuNbFebsPerCrob ] + TArrayD fdFebAdcBase; // Base at Cal. Thr. in e- for each FEB, [ NbDpb * kuNbCrobPerDpb * kuNbFebsPerCrob ] + TArrayD fdFebAdcThrGain; // Thr. step in e-/Thr. Unit for each FEB, [ NbDpb * kuNbCrobPerDpb * kuNbFebsPerCrob ] TArrayI fiFebAdcThrOffs; // Thr. offset in Units vs Cal. Thr. for each FEB, [ NbDpb * kuNbCrobPerDpb * kuNbFebsPerCrob ] diff --git a/core/detectors/sts/CbmStsContFact.cxx b/core/detectors/sts/CbmStsContFact.cxx index 2ebd5688e2da5c7d23a47addc8092dddf4f533b9..5d8256ff43f35ea9ce45dbae3175008120459ba4 100644 --- a/core/detectors/sts/CbmStsContFact.cxx +++ b/core/detectors/sts/CbmStsContFact.cxx @@ -10,12 +10,12 @@ #include "CbmStsParSetSensorCond.h" // for CbmStsParSetSensorCond #include "CbmStsParSim.h" // for CbmStsParSim -#include <FairLogger.h> // for Logger, LOG - +#include <FairLogger.h> // for Logger, LOG #include <FairParSet.h> // for FairParSet #include <FairRuntimeDb.h> // for FairRuntimeDb -#include <TList.h> // for TList -#include <TString.h> // for TString + +#include <TList.h> // for TList +#include <TString.h> // for TString #include <string.h> // for strcmp @@ -73,9 +73,7 @@ FairParSet* CbmStsContFact::createContainer(FairContainer* container) { // --- Beamtime parameters else if (strcmp(contName, "CbmMcbm2018StsPar") == 0) { - parSet = new CbmMcbm2018StsPar(container->getConcatName().Data(), - container->GetTitle(), - container->getContext()); + parSet = new CbmMcbm2018StsPar(container->getConcatName().Data(), container->GetTitle(), container->getContext()); } LOG(info) << GetName() << ": Create container " << contName @@ -113,8 +111,7 @@ void CbmStsContFact::setAllContainers() { containers->Add(sensorCond); // Beamtime parameters - FairContainer* beamPars = new FairContainer( - "CbmMcbm2018StsPar", "STS at MCBM 2018 Unpack Parameters", "Default"); + FairContainer* beamPars = new FairContainer("CbmMcbm2018StsPar", "STS at MCBM 2018 Unpack Parameters", "Default"); beamPars->addContext("Default"); containers->Add(beamPars); } diff --git a/core/detectors/tof/CbmMcbm2018TofPar.cxx b/core/detectors/tof/CbmMcbm2018TofPar.cxx index e93e7e13c8697743c6873a0d7f91d297ad067819..c3c98d6877b91e792388fd459f11eaf94b6f38a8 100644 --- a/core/detectors/tof/CbmMcbm2018TofPar.cxx +++ b/core/detectors/tof/CbmMcbm2018TofPar.cxx @@ -5,8 +5,6 @@ #include "CbmMcbm2018TofPar.h" -#include "gDpbMessv100.h" - #include "FairDetParIo.h" #include "FairLogger.h" #include "FairParIo.h" @@ -14,10 +12,10 @@ #include "TString.h" +#include "gDpbMessv100.h" + // ----- Standard constructor ------------------------------------------ -CbmMcbm2018TofPar::CbmMcbm2018TofPar(const char* name, - const char* title, - const char* context) +CbmMcbm2018TofPar::CbmMcbm2018TofPar(const char* name, const char* title, const char* context) : FairParGenericSet(name, title, context) , fvdPadiThrCodeToValue(GetNrOfPadiThrCodes(), 0.0) , fiNrOfGdpb(-1) @@ -37,7 +35,8 @@ CbmMcbm2018TofPar::CbmMcbm2018TofPar(const char* name, , fdStarTriggerDeadtime() , fdStarTriggerDelay() , fdStarTriggerWinSize() - , fdTsDeadtimePeriod(0.0) { + , fdTsDeadtimePeriod(0.0) +{ detName = "Tof"; /// PADI threshold measures and extrapolated code to value map @@ -46,18 +45,15 @@ CbmMcbm2018TofPar::CbmMcbm2018TofPar(const char* name, /// Linear extrapolation between measured points if (uPadiPoint + 1 < kuNbThrMeasPoints) { - UInt_t uNbSteps = - kuThrMeasCode[uPadiPoint + 1] - kuThrMeasCode[uPadiPoint]; - Double_t dValStep = - (kdThrMeasVal[uPadiPoint + 1] - kdThrMeasVal[uPadiPoint]) / uNbSteps; - UInt_t uCode = kuThrMeasCode[uPadiPoint]; + UInt_t uNbSteps = kuThrMeasCode[uPadiPoint + 1] - kuThrMeasCode[uPadiPoint]; + Double_t dValStep = (kdThrMeasVal[uPadiPoint + 1] - kdThrMeasVal[uPadiPoint]) / uNbSteps; + UInt_t uCode = kuThrMeasCode[uPadiPoint]; for (UInt_t uStep = 1; uStep < uNbSteps; ++uStep) { uCode++; - fvdPadiThrCodeToValue[uCode] = - kdThrMeasVal[uPadiPoint] + dValStep * uStep; + fvdPadiThrCodeToValue[uCode] = kdThrMeasVal[uPadiPoint] + dValStep * uStep; } // for( UInt_t uStep = 1; uStep < uNbSteps; ++uStep) } // if( uPadiPoint + 1 < kuNbThrMeasPoints ) - } // for( UInt_t uPadiPoint = 0; uPadiPoint < kuNbThrMeasPoints; ++uPadiPoint ) + } // for( UInt_t uPadiPoint = 0; uPadiPoint < kuNbThrMeasPoints; ++uPadiPoint ) } // ------------------------------------------------------------------------- @@ -68,7 +64,8 @@ CbmMcbm2018TofPar::~CbmMcbm2018TofPar() {} // ----- Public method clear ------------------------------------------- -void CbmMcbm2018TofPar::clear() { +void CbmMcbm2018TofPar::clear() +{ status = kFALSE; resetInputVersions(); } @@ -76,7 +73,8 @@ void CbmMcbm2018TofPar::clear() { // ------------------------------------------------------------------------- -void CbmMcbm2018TofPar::putParams(FairParamList* l) { +void CbmMcbm2018TofPar::putParams(FairParamList* l) +{ if (!l) return; l->add("NrOfGdpbs", fiNrOfGdpb); l->add("GdpbIdArray", fiGdpbIdArray); @@ -100,7 +98,8 @@ void CbmMcbm2018TofPar::putParams(FairParamList* l) { //------------------------------------------------------ -Bool_t CbmMcbm2018TofPar::getParams(FairParamList* l) { +Bool_t CbmMcbm2018TofPar::getParams(FairParamList* l) +{ if (!l) return kFALSE; @@ -144,63 +143,54 @@ Bool_t CbmMcbm2018TofPar::getParams(FairParamList* l) { return kTRUE; } // ------------------------------------------------------------------------- -Int_t CbmMcbm2018TofPar::Get4ChanToPadiChan(UInt_t uChannelInFee) { - if (uChannelInFee < kuNbChannelsPerFee) - return kuGet4topadi[uChannelInFee]; +Int_t CbmMcbm2018TofPar::Get4ChanToPadiChan(UInt_t uChannelInFee) +{ + if (uChannelInFee < kuNbChannelsPerFee) return kuGet4topadi[uChannelInFee]; else { - LOG(fatal) - << "CbmMcbm2018TofPar::Get4ChanToPadiChan => Index out of bound, " - << uChannelInFee << " vs " << static_cast<uint32_t>(kuNbChannelsPerFee) - << ", returning crazy value!"; + LOG(fatal) << "CbmMcbm2018TofPar::Get4ChanToPadiChan => Index out of bound, " << uChannelInFee << " vs " + << static_cast<uint32_t>(kuNbChannelsPerFee) << ", returning crazy value!"; return -1; } // else of if( uChannelInFee < kuNbChannelsPerFee ) } -Int_t CbmMcbm2018TofPar::PadiChanToGet4Chan(UInt_t uChannelInFee) { - if (uChannelInFee < kuNbChannelsPerFee) - return kuPaditoget4[uChannelInFee]; +Int_t CbmMcbm2018TofPar::PadiChanToGet4Chan(UInt_t uChannelInFee) +{ + if (uChannelInFee < kuNbChannelsPerFee) return kuPaditoget4[uChannelInFee]; else { - LOG(fatal) - << "CbmMcbm2018TofPar::PadiChanToGet4Chan => Index out of bound, " - << uChannelInFee << " vs " << static_cast<uint32_t>(kuNbChannelsPerFee) - << ", returning crazy value!"; + LOG(fatal) << "CbmMcbm2018TofPar::PadiChanToGet4Chan => Index out of bound, " << uChannelInFee << " vs " + << static_cast<uint32_t>(kuNbChannelsPerFee) << ", returning crazy value!"; return -1; } // else of if( uChannelInFee < kuNbChannelsPerFee ) } // ------------------------------------------------------------------------- -Int_t CbmMcbm2018TofPar::ElinkIdxToGet4Idx(UInt_t uElink) { - if (gdpbv100::kuChipIdMergedEpoch == uElink) - return uElink; +Int_t CbmMcbm2018TofPar::ElinkIdxToGet4Idx(UInt_t uElink) +{ + if (gdpbv100::kuChipIdMergedEpoch == uElink) return uElink; else if (uElink < kuNbGet4PerGdpb) - return kuElinkToGet4[uElink % kuNbGet4PerGbtx] - + kuNbGet4PerGbtx * (uElink / kuNbGet4PerGbtx); + return kuElinkToGet4[uElink % kuNbGet4PerGbtx] + kuNbGet4PerGbtx * (uElink / kuNbGet4PerGbtx); else { - LOG(fatal) << "CbmMcbm2018TofPar::ElinkIdxToGet4Idx => Index out of bound, " - << uElink << " vs " << static_cast<uint32_t>(kuNbGet4PerGdpb) - << ", returning crazy value!"; + LOG(fatal) << "CbmMcbm2018TofPar::ElinkIdxToGet4Idx => Index out of bound, " << uElink << " vs " + << static_cast<uint32_t>(kuNbGet4PerGdpb) << ", returning crazy value!"; return -1; } // else of if( uElink < kuNbGet4PerGbtx ) } -Int_t CbmMcbm2018TofPar::Get4IdxToElinkIdx(UInt_t uGet4) { - if (gdpbv100::kuChipIdMergedEpoch == uGet4) - return uGet4; +Int_t CbmMcbm2018TofPar::Get4IdxToElinkIdx(UInt_t uGet4) +{ + if (gdpbv100::kuChipIdMergedEpoch == uGet4) return uGet4; else if (uGet4 < kuNbGet4PerGdpb) - return kuGet4ToElink[uGet4 % kuNbGet4PerGbtx] - + kuNbGet4PerGbtx * (uGet4 / kuNbGet4PerGbtx); + return kuGet4ToElink[uGet4 % kuNbGet4PerGbtx] + kuNbGet4PerGbtx * (uGet4 / kuNbGet4PerGbtx); else { - LOG(fatal) << "CbmMcbm2018TofPar::Get4IdxToElinkIdx => Index out of bound, " - << uGet4 << " vs " << static_cast<uint32_t>(kuNbGet4PerGdpb) - << ", returning crazy value!"; + LOG(fatal) << "CbmMcbm2018TofPar::Get4IdxToElinkIdx => Index out of bound, " << uGet4 << " vs " + << static_cast<uint32_t>(kuNbGet4PerGdpb) << ", returning crazy value!"; return -1; } // else of if( uElink < kuNbGet4PerGbtx ) } // ------------------------------------------------------------------------- -Double_t CbmMcbm2018TofPar::GetPadiThresholdVal(UInt_t uCode) { - if (uCode < GetNrOfPadiThrCodes()) - return fvdPadiThrCodeToValue[uCode]; +Double_t CbmMcbm2018TofPar::GetPadiThresholdVal(UInt_t uCode) +{ + if (uCode < GetNrOfPadiThrCodes()) return fvdPadiThrCodeToValue[uCode]; else { - LOG(error) - << "CbmStar2019TofPar::GetPadiThresholdVal => Code out of bound, " - << uCode << " vs " << GetNrOfPadiThrCodes() << ", returning crazy value!"; + LOG(error) << "CbmStar2019TofPar::GetPadiThresholdVal => Code out of bound, " << uCode << " vs " + << GetNrOfPadiThrCodes() << ", returning crazy value!"; return 1e9; } // else of if( uCode < GetNrOfPadiThrCodes() ) } diff --git a/core/detectors/tof/CbmMcbm2018TofPar.h b/core/detectors/tof/CbmMcbm2018TofPar.h index 5c5165d6683a60ebd704d0f6536eeb5e99f827c8..7605447f478150136249641a127b2ebc956e66a3 100644 --- a/core/detectors/tof/CbmMcbm2018TofPar.h +++ b/core/detectors/tof/CbmMcbm2018TofPar.h @@ -19,8 +19,7 @@ class CbmMcbm2018TofPar : public FairParGenericSet { public: /** Standard constructor **/ - CbmMcbm2018TofPar(const char* name = "CbmMcbm2018TofPar", - const char* title = "Tof unpacker parameters", + CbmMcbm2018TofPar(const char* name = "CbmMcbm2018TofPar", const char* title = "Tof unpacker parameters", const char* context = "Default"); @@ -49,18 +48,12 @@ public: static constexpr UInt_t GetNrOfFeePerGbtx() { return kuNbFeePerGbtx; } static constexpr UInt_t GetNrOfGbtxPerGdpb() { return kuNbGbtxPerGdpb; } static constexpr UInt_t GetNrOfChannelsPerFee() { return kuNbChannelsPerFee; } - static constexpr UInt_t GetNrOfChannelsPerGbtx() { - return kuNbChannelsPerGbtx; - } - static constexpr UInt_t GetNrOfChannelsPerGdpb() { - return kuNbChannelsPerGdpb; - } + static constexpr UInt_t GetNrOfChannelsPerGbtx() { return kuNbChannelsPerGbtx; } + static constexpr UInt_t GetNrOfChannelsPerGdpb() { return kuNbChannelsPerGdpb; } static constexpr UInt_t GetNrOfGet4PerGbtx() { return kuNbGet4PerGbtx; } static constexpr UInt_t GetNrOfGet4PerGdpb() { return kuNbGet4PerGdpb; } static constexpr UInt_t GetNrOfFeePerGdpb() { return kuNbFeePerGdpb; } - inline UInt_t GetNumberOfChannels() { - return kuNbChannelsPerGdpb * fiNrOfGdpb; - } + inline UInt_t GetNumberOfChannels() { return kuNbChannelsPerGdpb * fiNrOfGdpb; } /// FIXME: replace with method returning the correspondign constants! see Star2019 parameter inline Int_t GetNrOfGdpbs() { return fiNrOfGdpb; } @@ -80,15 +73,9 @@ public: inline Int_t GetNbMsOverlap() { return fiNbMsOverlap; } inline Double_t GetSizeMsInNs() { return fdSizeMsInNs; } - inline Double_t GetStarTriggDeadtime(Int_t gdpb) { - return fdStarTriggerDeadtime[gdpb]; - } - inline Double_t GetStarTriggDelay(Int_t gdpb) { - return fdStarTriggerDelay[gdpb]; - } - inline Double_t GetStarTriggWinSize(Int_t gdpb) { - return fdStarTriggerWinSize[gdpb]; - } + inline Double_t GetStarTriggDeadtime(Int_t gdpb) { return fdStarTriggerDeadtime[gdpb]; } + inline Double_t GetStarTriggDelay(Int_t gdpb) { return fdStarTriggerDelay[gdpb]; } + inline Double_t GetStarTriggWinSize(Int_t gdpb) { return fdStarTriggerWinSize[gdpb]; } inline Double_t GetTsDeadtimePeriod() { return fdTsDeadtimePeriod; } private: @@ -100,63 +87,49 @@ private: static const uint32_t kuNbGet4PerFee = 8; static const uint32_t kuNbFeePerGbtx = 5; static const uint32_t kuNbGbtxPerGdpb = 6; - static const uint32_t kuNbChannelsPerFee = - kuNbChannelsPerGet4 * kuNbGet4PerFee; - static const uint32_t kuNbChannelsPerGbtx = - kuNbChannelsPerFee * kuNbFeePerGbtx; - static const uint32_t kuNbChannelsPerGdpb = - kuNbChannelsPerGbtx * kuNbGbtxPerGdpb; - static const uint32_t kuNbGet4PerGbtx = kuNbGet4PerFee * kuNbFeePerGbtx; - static const uint32_t kuNbGet4PerGdpb = kuNbGet4PerGbtx * kuNbGbtxPerGdpb; - static const uint32_t kuNbFeePerGdpb = kuNbFeePerGbtx * kuNbGbtxPerGdpb; + static const uint32_t kuNbChannelsPerFee = kuNbChannelsPerGet4 * kuNbGet4PerFee; + static const uint32_t kuNbChannelsPerGbtx = kuNbChannelsPerFee * kuNbFeePerGbtx; + static const uint32_t kuNbChannelsPerGdpb = kuNbChannelsPerGbtx * kuNbGbtxPerGdpb; + static const uint32_t kuNbGet4PerGbtx = kuNbGet4PerFee * kuNbFeePerGbtx; + static const uint32_t kuNbGet4PerGdpb = kuNbGet4PerGbtx * kuNbGbtxPerGdpb; + static const uint32_t kuNbFeePerGdpb = kuNbFeePerGbtx * kuNbGbtxPerGdpb; /// Mapping in Readout chain PCBs - const UInt_t - kuGet4topadi[kuNbChannelsPerFee] = {3, 2, 1, 0, 7, 6, 5, 4, 11, - 10, 9, 8, 15, 14, 13, 12, 19, 18, - 17, 16, 23, 22, 21, 20, 27, 26, 25, - 24, 31, 30, 29, 28}; //! Map from GET4 channel to PADI channel - - const UInt_t - kuPaditoget4[kuNbChannelsPerFee] = {3, 2, 1, 0, 7, 6, 5, 4, 11, - 10, 9, 8, 15, 14, 13, 12, 19, 18, - 17, 16, 23, 22, 21, 20, 27, 26, 25, - 24, 31, 30, 29, 28}; //! Map from PADI channel to GET4 channel - const UInt_t kuElinkToGet4[kuNbGet4PerGbtx] = { - 27, 2, 7, 3, 31, 26, 30, 1, 33, 37, 32, 13, 9, 14, - 10, 15, 17, 21, 16, 35, 34, 38, 25, 24, 0, 6, 20, 23, - 18, 22, 28, 4, 29, 5, 19, 36, 39, 8, 12, 11}; - const UInt_t kuGet4ToElink[kuNbGet4PerGbtx] = { - 24, 7, 1, 3, 31, 33, 25, 2, 37, 12, 14, 39, 38, 11, - 13, 15, 18, 16, 28, 34, 26, 17, 29, 27, 23, 22, 5, 0, - 30, 32, 6, 4, 10, 8, 20, 19, 35, 9, 21, 36}; + const UInt_t kuGet4topadi[kuNbChannelsPerFee] = { + 3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12, + 19, 18, 17, 16, 23, 22, 21, 20, 27, 26, 25, 24, 31, 30, 29, 28}; //! Map from GET4 channel to PADI channel + + const UInt_t kuPaditoget4[kuNbChannelsPerFee] = { + 3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12, + 19, 18, 17, 16, 23, 22, 21, 20, 27, 26, 25, 24, 31, 30, 29, 28}; //! Map from PADI channel to GET4 channel + const UInt_t kuElinkToGet4[kuNbGet4PerGbtx] = {27, 2, 7, 3, 31, 26, 30, 1, 33, 37, 32, 13, 9, 14, + 10, 15, 17, 21, 16, 35, 34, 38, 25, 24, 0, 6, 20, 23, + 18, 22, 28, 4, 29, 5, 19, 36, 39, 8, 12, 11}; + const UInt_t kuGet4ToElink[kuNbGet4PerGbtx] = {24, 7, 1, 3, 31, 33, 25, 2, 37, 12, 14, 39, 38, 11, + 13, 15, 18, 16, 28, 34, 26, 17, 29, 27, 23, 22, 5, 0, + 30, 32, 6, 4, 10, 8, 20, 19, 35, 9, 21, 36}; /// PADI threshold measures and extrapolated code to value map static const uint32_t kuNbPadiThrCodes = 1024; // 0x3FF + 1 static const uint32_t kuNbThrMeasPoints = 65; const UInt_t kuThrMeasCode[kuNbThrMeasPoints] = { - 0x000, 0x010, 0x020, 0x030, 0x040, 0x050, 0x060, 0x070, 0x080, 0x090, 0x0A0, - 0x0B0, 0x0C0, 0x0D0, 0x0E0, 0x0F0, 0x100, 0x110, 0x120, 0x130, 0x140, 0x150, - 0x160, 0x170, 0x180, 0x190, 0x1A0, 0x1B0, 0x1C0, 0x1D0, 0x1E0, 0x1F0, 0x200, - 0x210, 0x220, 0x230, 0x240, 0x250, 0x260, 0x270, 0x280, 0x290, 0x2A0, 0x2B0, - 0x2C0, 0x2D0, 0x2E0, 0x2F0, 0x300, 0x310, 0x320, 0x330, 0x340, 0x350, 0x360, - 0x370, 0x380, 0x390, 0x3A0, 0x3B0, 0x3C0, 0x3D0, 0x3E0, 0x3F0, 0x3FF}; + 0x000, 0x010, 0x020, 0x030, 0x040, 0x050, 0x060, 0x070, 0x080, 0x090, 0x0A0, 0x0B0, 0x0C0, + 0x0D0, 0x0E0, 0x0F0, 0x100, 0x110, 0x120, 0x130, 0x140, 0x150, 0x160, 0x170, 0x180, 0x190, + 0x1A0, 0x1B0, 0x1C0, 0x1D0, 0x1E0, 0x1F0, 0x200, 0x210, 0x220, 0x230, 0x240, 0x250, 0x260, + 0x270, 0x280, 0x290, 0x2A0, 0x2B0, 0x2C0, 0x2D0, 0x2E0, 0x2F0, 0x300, 0x310, 0x320, 0x330, + 0x340, 0x350, 0x360, 0x370, 0x380, 0x390, 0x3A0, 0x3B0, 0x3C0, 0x3D0, 0x3E0, 0x3F0, 0x3FF}; const Double_t kdThrMeasVal[kuNbThrMeasPoints] = { - -652.6, -631.2, -611.4, -590.6, -570.9, -550.0, -529.9, -509.4, -490.6, - -469.5, -449.3, -428.5, -408.5, -388.2, -367.8, -347.2, -329.2, -308.2, - -287.5, -266.8, -246.9, -226.0, -205.6, -185.0, -165.7, -144.9, -124.4, - -103.8, -83.4, -62.9, -42.4, -21.2, -5.3, 15.5, 36.2, 56.8, - 77.3, 97.8, 118.4, 139.1, 158.7, 179.2, 199.7, 220.2, 240.8, - 261.1, 281.7, 302.2, 321.3, 341.4, 362.0, 382.2, 402.9, 422.8, - 443.4, 463.7, 483.7, 503.7, 524.1, 544.3, 565.0, 585.0, 605.5, - 626.0, 646.1}; + -652.6, -631.2, -611.4, -590.6, -570.9, -550.0, -529.9, -509.4, -490.6, -469.5, -449.3, -428.5, -408.5, + -388.2, -367.8, -347.2, -329.2, -308.2, -287.5, -266.8, -246.9, -226.0, -205.6, -185.0, -165.7, -144.9, + -124.4, -103.8, -83.4, -62.9, -42.4, -21.2, -5.3, 15.5, 36.2, 56.8, 77.3, 97.8, 118.4, + 139.1, 158.7, 179.2, 199.7, 220.2, 240.8, 261.1, 281.7, 302.2, 321.3, 341.4, 362.0, 382.2, + 402.9, 422.8, 443.4, 463.7, 483.7, 503.7, 524.1, 544.3, 565.0, 585.0, 605.5, 626.0, 646.1}; std::vector<Double_t> fvdPadiThrCodeToValue; Int_t fiNrOfGdpb; // Total number of GDPBs TArrayI fiGdpbIdArray; // Array to hold the unique IDs for all Tof GDPBs - Int_t fiNrOfFeesPerGdpb; // Number of FEEs which are connected to one GDPB - Int_t - fiNrOfGet4PerFee; // Number of GET4 chips which are connected to one FEB + Int_t fiNrOfFeesPerGdpb; // Number of FEEs which are connected to one GDPB + Int_t fiNrOfGet4PerFee; // Number of GET4 chips which are connected to one FEB Int_t fiNrOfChannelsPerGet4; // Number of channels per GET4 Int_t fiNrOfGbtx; // Total number of Gbtx links @@ -164,20 +137,16 @@ private: TArrayI fiNrOfRpc; // number of Rpcs connected to Gbtx link, i.e. 3 or 5 TArrayI fiRpcType; // type of Rpcs connected to Gbtx link TArrayI fiRpcSide; // side of Rpcs connected to Gbtx link, i.e. 0 or 1 - TArrayI - fiModuleId; // Module Identifier connected to Gbtx link, has to match geometry + TArrayI fiModuleId; // Module Identifier connected to Gbtx link, has to match geometry - Int_t fiNbMsTot; // Total number of MS per link in TS - Int_t fiNbMsOverlap; // Number of overlap MS per TS - Double_t - fdSizeMsInNs; // Size of the MS in ns, needed for MS border detection + Int_t fiNbMsTot; // Total number of MS per link in TS + Int_t fiNbMsOverlap; // Number of overlap MS per TS + Double_t fdSizeMsInNs; // Size of the MS in ns, needed for MS border detection - TArrayD - fdStarTriggerDeadtime; // STAR: Array to hold for each gDPB the deadtime between triggers in ns + TArrayD fdStarTriggerDeadtime; // STAR: Array to hold for each gDPB the deadtime between triggers in ns TArrayD fdStarTriggerDelay; // STAR: Array to hold for each gDPB the Delay in ns to subtract when looking for beginning of coincidence of data with trigger window - TArrayD - fdStarTriggerWinSize; // STAR: Array to hold for each gDPB the Size of the trigger window in ns + TArrayD fdStarTriggerWinSize; // STAR: Array to hold for each gDPB the Size of the trigger window in ns Double_t fdTsDeadtimePeriod; // Period (ns) in the first MS of each TS where events with missing triggers should be built using the overlap MS of previous TS (overlap events) diff --git a/core/detectors/tof/CbmTofContFact.cxx b/core/detectors/tof/CbmTofContFact.cxx index 2dd7b1a1af0841296b47c8715166cd152511cf09..8f7c20063aac055c48cdf76b7ddfa1ef9f4a0964 100644 --- a/core/detectors/tof/CbmTofContFact.cxx +++ b/core/detectors/tof/CbmTofContFact.cxx @@ -52,8 +52,7 @@ void CbmTofContFact::setAllContainers() { containers->Add(p2); - FairContainer* beamPars = new FairContainer( - "CbmMcbm2018TofPar", "TOF at MCBM 2018 Unpack Parameters", "Default"); + FairContainer* beamPars = new FairContainer("CbmMcbm2018TofPar", "TOF at MCBM 2018 Unpack Parameters", "Default"); beamPars->addContext("Default"); containers->Add(beamPars); } @@ -68,12 +67,13 @@ FairParSet* CbmTofContFact::createContainer(FairContainer* c) { if (strcmp(name, "CbmTofDigiPar") == 0) { p = new CbmTofDigiPar( c->getConcatName().Data(), c->GetTitle(), c->getContext()); - } else if (strcmp(name, "CbmTofDigiBdfPar") == 0) { + } + else if (strcmp(name, "CbmTofDigiBdfPar") == 0) { p = new CbmTofDigiBdfPar( c->getConcatName().Data(), c->GetTitle(), c->getContext()); - } else if (strcmp(name, "CbmMcbm2018TofPar") == 0) { - p = new CbmMcbm2018TofPar( - c->getConcatName().Data(), c->GetTitle(), c->getContext()); + } + else if (strcmp(name, "CbmMcbm2018TofPar") == 0) { + p = new CbmMcbm2018TofPar(c->getConcatName().Data(), c->GetTitle(), c->getContext()); } return p; diff --git a/core/detectors/trd/CbmMcbm2020TrdTshiftPar.cxx b/core/detectors/trd/CbmMcbm2020TrdTshiftPar.cxx index a21212e173ca25f1864c59bc1be002e97beef55e..c75d9cba45e260f6f24c4d6ec1dff669cfd144c7 100644 --- a/core/detectors/trd/CbmMcbm2020TrdTshiftPar.cxx +++ b/core/detectors/trd/CbmMcbm2020TrdTshiftPar.cxx @@ -28,10 +28,10 @@ // #define CTAVM CbmTrdAnalysisVarManager // See comments in GetNevents() et al. // #define CTAH CbmTrdAnalysisHisto // See comments in GetNevents() et al. -CbmMcbm2020TrdTshiftPar::CbmMcbm2020TrdTshiftPar(const char* name, - const char* title, - const char* context) - : FairParGenericSet(name, title, context), fNtimeslices(1) { +CbmMcbm2020TrdTshiftPar::CbmMcbm2020TrdTshiftPar(const char* name, const char* title, const char* context) + : FairParGenericSet(name, title, context) + , fNtimeslices(1) +{ detName = "TRD"; } @@ -49,32 +49,30 @@ void CbmMcbm2020TrdTshiftPar::clear() void CbmMcbm2020TrdTshiftPar::printparams() { - std::cout << "CbmMcbm2020TrdTshiftPar::printparams() " << &fTimeshifts - << std::endl; + std::cout << "CbmMcbm2020TrdTshiftPar::printparams() " << &fTimeshifts << std::endl; size_t ntimeshifts = (fTimeshifts.GetSize() / (fgNchannels + 1)); - std::cout << "ParSet has " << ntimeshifts << " timeshift changes stored" - << std::endl; + std::cout << "ParSet has " << ntimeshifts << " timeshift changes stored" << std::endl; for (size_t ishiftblock = 0; ishiftblock < ntimeshifts; ishiftblock++) { - std::cout << "Shiftblock of event " - << fTimeshifts[ishiftblock * (fgNchannels + 1)] << std::endl; + std::cout << "Shiftblock of event " << fTimeshifts[ishiftblock * (fgNchannels + 1)] << std::endl; for (size_t ichannel = 0; ichannel < fgNchannels; ichannel++) { if (ichannel % 6 == 0) std::cout << std::endl; - std::cout << " Ch " << ichannel << " shift " - << fTimeshifts[(ishiftblock * (fgNchannels + 1)) + ichannel]; + std::cout << " Ch " << ichannel << " shift " << fTimeshifts[(ishiftblock * (fgNchannels + 1)) + ichannel]; } } } // ---- putParams ---- -void CbmMcbm2020TrdTshiftPar::putParams(FairParamList* l) { +void CbmMcbm2020TrdTshiftPar::putParams(FairParamList* l) +{ if (!l) return; l->add(pararraynames[0].data(), fNtimeslices); l->add(pararraynames[1].data(), fTimeshifts); } // ---- getParams ---- -Bool_t CbmMcbm2020TrdTshiftPar::getParams(FairParamList* l) { +Bool_t CbmMcbm2020TrdTshiftPar::getParams(FairParamList* l) +{ if (!l) return kFALSE; if (!l->fill(pararraynames[0].data(), &fNtimeslices)) return kFALSE; @@ -94,33 +92,28 @@ Bool_t CbmMcbm2020TrdTshiftPar::getParams(FairParamList* l) { if ((ientry - nthShift * (fgNchannels + 1)) == 0) { // Before starting the extraction of the next chain, emplace the previous chain to the map if (ientry != 0) { - auto tspair = std::pair<size_t, std::vector<Int_t>>( - itimeslice, fvecCurrentTimeshifts); + auto tspair = std::pair<size_t, std::vector<Int_t>>(itimeslice, fvecCurrentTimeshifts); fmapTimeshifts.emplace(tspair); } itimeslice = fTimeshifts[ientry]; fvecCurrentTimeshifts.clear(); fvecCurrentTimeshifts.resize(fgNchannels); - - } else { - ichannel = ientry - 1 - nthShift * (fgNchannels + 1); + } + else { + ichannel = ientry - 1 - nthShift * (fgNchannels + 1); fvecCurrentTimeshifts[ichannel] = fTimeshifts[ientry]; } } // Now we have to fill the blank spots in the map, since, we do not now if the timeslices are accessed in a completely ordered manor - for (itimeslice = 0; - itimeslice < static_cast<size_t>(std::abs(fNtimeslices[0])); - itimeslice++) { + for (itimeslice = 0; itimeslice < static_cast<size_t>(std::abs(fNtimeslices[0])); itimeslice++) { auto itspair = fmapTimeshifts.find(itimeslice); - if (itspair != fmapTimeshifts.end()) { - continue; - } else { + if (itspair != fmapTimeshifts.end()) { continue; } + else { // Get previous timeshift vector to add it also to the current pair itspair--; - auto newtspair = - std::pair<size_t, std::vector<Int_t>>(itimeslice, itspair->second); + auto newtspair = std::pair<size_t, std::vector<Int_t>>(itimeslice, itspair->second); fmapTimeshifts.emplace(newtspair); } } @@ -128,8 +121,8 @@ Bool_t CbmMcbm2020TrdTshiftPar::getParams(FairParamList* l) { } // ---- GetTimeshifts ---- -bool CbmMcbm2020TrdTshiftPar::GetTimeshifts( - std::shared_ptr<TH2> timeshiftHisto) { +bool CbmMcbm2020TrdTshiftPar::GetTimeshifts(std::shared_ptr<TH2> timeshiftHisto) +{ ///< Extract the timeshift values from a histo containing the information and write them to fTimeshifts. @@ -148,9 +141,7 @@ bool CbmMcbm2020TrdTshiftPar::GetTimeshifts( fTimeshifts.Set(nentries); bool didChange = true; - for (size_t ievent = 1; - ievent < static_cast<size_t>(std::abs(fNtimeslices[0])); - ievent++) { + for (size_t ievent = 1; ievent < static_cast<size_t>(std::abs(fNtimeslices[0])); ievent++) { tsidx = timeshiftHisto->GetXaxis()->GetBinLowEdge(ievent); for (size_t ichannel = 0; ichannel < fgNchannels; ichannel++) { tshift = (Int_t) timeshiftHisto->GetBinContent(ievent, ichannel); @@ -186,13 +177,15 @@ bool CbmMcbm2020TrdTshiftPar::GetTimeshifts( } // ---- GetTimeshiftsVec ---- -std::vector<Int_t> CbmMcbm2020TrdTshiftPar::GetTimeshiftsVec(size_t tsidx) { +std::vector<Int_t> CbmMcbm2020TrdTshiftPar::GetTimeshiftsVec(size_t tsidx) +{ auto pair = fmapTimeshifts.find(tsidx); return pair->second; } // ---- GetNEvents ---- -double CbmMcbm2020TrdTshiftPar::GetNEvents(std::shared_ptr<TFile> mcbmanafile) { +double CbmMcbm2020TrdTshiftPar::GetNEvents(std::shared_ptr<TFile> mcbmanafile) +{ ///< Extract the number of events from a mcbmana task output file, which has to contain the required histogram. TH1* histo = nullptr; @@ -209,16 +202,15 @@ double CbmMcbm2020TrdTshiftPar::GetNEvents(std::shared_ptr<TFile> mcbmanafile) { std::string hpath = "FillStation-RunInfo/FullTrd/RunId_wNEvents-RunInfo"; histo = (TH1*) mcbmanafile->Get(hpath.data()); if (!histo) { - LOG(fatal) << " CbmMcbm2020TrdTshiftPar::GetNEvents " << hpath.data() - << " not found in the file" << std::endl; + LOG(fatal) << " CbmMcbm2020TrdTshiftPar::GetNEvents " << hpath.data() << " not found in the file" << std::endl; } double nevents = histo->GetBinContent(histo->GetMaximumBin()); return nevents; } // ---- GetCalibHisto ---- -std::shared_ptr<TH3> -CbmMcbm2020TrdTshiftPar::GetCalibHisto(std::shared_ptr<TFile> mcbmanafile) { +std::shared_ptr<TH3> CbmMcbm2020TrdTshiftPar::GetCalibHisto(std::shared_ptr<TFile> mcbmanafile) +{ ///< Extract the required base histogram from a mcbmana task output file. THnSparse* hsparse = nullptr; @@ -228,21 +220,18 @@ CbmMcbm2020TrdTshiftPar::GetCalibHisto(std::shared_ptr<TFile> mcbmanafile) { // histo = // (THnSparseD*) CTAH::GetHistoFromFile(varvec, fillstation, htype, mcbmanafile); - std::string hpath = - "FillStation-TrdT0Digi/FullTrd/" - "TsSourceTsIndex_DigiTrdChannel_DigiDtCorrSlice-TrdT0Digi"; + std::string hpath = "FillStation-TrdT0Digi/FullTrd/" + "TsSourceTsIndex_DigiTrdChannel_DigiDtCorrSlice-TrdT0Digi"; hsparse = (THnSparse*) mcbmanafile->Get(hpath.data()); if (!hsparse) { - LOG(fatal) << " CbmMcbm2020TrdTshiftPar::GetCalibHisto " << hpath.data() - << " not found in the file" << std::endl; + LOG(fatal) << " CbmMcbm2020TrdTshiftPar::GetCalibHisto " << hpath.data() << " not found in the file" << std::endl; } auto nevents = GetNEvents(mcbmanafile); // auto tsaxis = CTAH::GetVarAxis(hsparse, CTAVM::eVars::kTsSourceTsIndex); - auto tsaxis = - hsparse->GetAxis(0); // For now we know that the TsIndex is on the X-Axis + auto tsaxis = hsparse->GetAxis(0); // For now we know that the TsIndex is on the X-Axis tsaxis->SetRangeUser(0.0, (double) nevents); auto temphisto = hsparse->Projection(0, 1, 2); auto histo = std::make_shared<TH3D>(*temphisto); @@ -258,40 +247,29 @@ CbmMcbm2020TrdTshiftPar::GetCalibHisto(std::shared_ptr<TFile> mcbmanafile) { } // ---- GetCalibHisto ---- -std::shared_ptr<TH2> -CbmMcbm2020TrdTshiftPar::GetCalibHisto(std::shared_ptr<TH3> calibbasehisto) { +std::shared_ptr<TH2> CbmMcbm2020TrdTshiftPar::GetCalibHisto(std::shared_ptr<TH3> calibbasehisto) +{ ///< Extract the timeshiftHisto from the calibbase histogram. The calibbase histogram is a TH3* with the tsIdx, the module channels and the timeshifts on the axes. // Get the x-axis definitions size_t nevents = calibbasehisto->GetNbinsX(); - size_t firstTsIdx = calibbasehisto->GetXaxis()->GetBinLowEdge( - calibbasehisto->GetXaxis()->GetFirst()); - size_t lastTsIdx = calibbasehisto->GetXaxis()->GetBinUpEdge( - calibbasehisto->GetXaxis()->GetLast()); + size_t firstTsIdx = calibbasehisto->GetXaxis()->GetBinLowEdge(calibbasehisto->GetXaxis()->GetFirst()); + size_t lastTsIdx = calibbasehisto->GetXaxis()->GetBinUpEdge(calibbasehisto->GetXaxis()->GetLast()); // Get the y-axis definitions size_t nchannels = calibbasehisto->GetNbinsY(); - size_t firstChannel = calibbasehisto->GetYaxis()->GetBinLowEdge( - calibbasehisto->GetYaxis()->GetFirst()); - size_t lastChannel = calibbasehisto->GetYaxis()->GetBinUpEdge( - calibbasehisto->GetYaxis()->GetLast()); + size_t firstChannel = calibbasehisto->GetYaxis()->GetBinLowEdge(calibbasehisto->GetYaxis()->GetFirst()); + size_t lastChannel = calibbasehisto->GetYaxis()->GetBinUpEdge(calibbasehisto->GetYaxis()->GetLast()); - std::shared_ptr<TH2I> calibhisto = std::make_shared<TH2I>("calibhisto", - "calibhisto", - nevents, - firstTsIdx, - lastTsIdx, - nchannels, - firstChannel, - lastChannel); + std::shared_ptr<TH2I> calibhisto = std::make_shared<TH2I>("calibhisto", "calibhisto", nevents, firstTsIdx, lastTsIdx, + nchannels, firstChannel, lastChannel); for (size_t itsidx = 1; itsidx < nevents; itsidx++) { for (size_t ichannel = 1; ichannel < nchannels; ichannel++) { - auto dominantshift = - GetDominantShift(calibbasehisto, itsidx, ichannel) < 255 - ? GetDominantShift(calibbasehisto, itsidx, ichannel) - : calibhisto->GetBinContent(itsidx - 1, ichannel); + auto dominantshift = GetDominantShift(calibbasehisto, itsidx, ichannel) < 255 + ? GetDominantShift(calibbasehisto, itsidx, ichannel) + : calibhisto->GetBinContent(itsidx - 1, ichannel); if (itsidx - 1 == 0) dominantshift = 0; calibhisto->SetBinContent(itsidx, ichannel, dominantshift); } @@ -300,12 +278,9 @@ CbmMcbm2020TrdTshiftPar::GetCalibHisto(std::shared_ptr<TH3> calibbasehisto) { } // ---- GetDominantShift ---- -Int_t CbmMcbm2020TrdTshiftPar::GetDominantShift( - std::shared_ptr<TH3> calibbasehisto, - size_t itsidx, - size_t ichannel) { - auto hdomshift = - calibbasehisto->ProjectionZ("domshift", itsidx, itsidx, ichannel, ichannel); +Int_t CbmMcbm2020TrdTshiftPar::GetDominantShift(std::shared_ptr<TH3> calibbasehisto, size_t itsidx, size_t ichannel) +{ + auto hdomshift = calibbasehisto->ProjectionZ("domshift", itsidx, itsidx, ichannel, ichannel); // Scale histo to one hdomshift->Scale(1. / hdomshift->Integral()); @@ -325,8 +300,8 @@ Int_t CbmMcbm2020TrdTshiftPar::GetDominantShift( } // ---- FillTimeshiftArray ---- -bool CbmMcbm2020TrdTshiftPar::FillTimeshiftArray( - std::shared_ptr<TFile> mcbmanafile) { +bool CbmMcbm2020TrdTshiftPar::FillTimeshiftArray(std::shared_ptr<TFile> mcbmanafile) +{ ///< Extract the timeshift values from a TAF output file that contains the required histograms and write them to fTimeshifts. auto calibbasehisto = GetCalibHisto(mcbmanafile); diff --git a/core/detectors/trd/CbmMcbm2020TrdTshiftPar.h b/core/detectors/trd/CbmMcbm2020TrdTshiftPar.h index b950797f8b8bf5b71190378812971d7c21a0bcbc..36c2ef246519e578145c381d1919a78c160de0ff 100644 --- a/core/detectors/trd/CbmMcbm2020TrdTshiftPar.h +++ b/core/detectors/trd/CbmMcbm2020TrdTshiftPar.h @@ -15,10 +15,9 @@ class CbmMcbm2020TrdTshiftPar : public FairParGenericSet { public: - CbmMcbm2020TrdTshiftPar( - const char* name = "CbmMcbm2020TrdTshiftPar", - const char* title = "TRD timeshift unpacker parameters mCbm 2020", - const char* context = "Default"); + CbmMcbm2020TrdTshiftPar(const char* name = "CbmMcbm2020TrdTshiftPar", + const char* title = "TRD timeshift unpacker parameters mCbm 2020", + const char* context = "Default"); virtual ~CbmMcbm2020TrdTshiftPar(); @@ -40,9 +39,7 @@ public: std::vector<Int_t> GetTimeshiftsVec(size_t tsidx); ///< Return the timeshift vector for a given Timeslice Index. Works only if getParams() was run before - std::map<size_t, std::vector<Int_t>>* GetTimeshiftsMap() { - return &fmapTimeshifts; - } + std::map<size_t, std::vector<Int_t>>* GetTimeshiftsMap() { return &fmapTimeshifts; } ///< Return the timeshift map. @@ -52,17 +49,14 @@ public: std::shared_ptr<TH2> GetCalibHisto(std::shared_ptr<TH3> calibbasehisto); ///< Extract the timeshiftHisto from the calibbase histogram. The calibbase histogram is a TH3* with the tsIdx, the module channels and the timeshifts on the axes. - Int_t GetDominantShift(std::shared_ptr<TH3> calibbasehisto, - size_t itsidx, - size_t ichannel); + Int_t GetDominantShift(std::shared_ptr<TH3> calibbasehisto, size_t itsidx, size_t ichannel); ///< Extract the dominant shift value from the calibbase histogram. For a give tsIdx and channel. bool FillTimeshiftArray(std::shared_ptr<TFile> mcbmanafile); ///< Extract the timeshift values from a TAF output file that contains the required histograms and write them to fTimeshifts. private: - const std::vector<std::string> pararraynames = {"nTimeslices", - "TrdTimeshifts"}; + const std::vector<std::string> pararraynames = {"nTimeslices", "TrdTimeshifts"}; ///< Names of the parameter arrays const size_t fgNchannels = 768; diff --git a/core/detectors/trd/CbmTrdContFact.cxx b/core/detectors/trd/CbmTrdContFact.cxx index cd381d269b4a05b99f74f2a0c18869b7c3d7a311..56a4f34c5c98c52a9e5a05f9af4b6d7ac0048287 100644 --- a/core/detectors/trd/CbmTrdContFact.cxx +++ b/core/detectors/trd/CbmTrdContFact.cxx @@ -71,9 +71,7 @@ void CbmTrdContFact::setAllContainers() { containers->Add(par); FairContainer* pTrd = - new FairContainer("CbmMcbm2020TrdTshiftPar", - "TRD timeshift unpacker parameters mCbm 2020", - "Default"); + new FairContainer("CbmMcbm2020TrdTshiftPar", "TRD timeshift unpacker parameters mCbm 2020", "Default"); pTrd->addContext("Default"); containers->Add(pTrd); } @@ -102,8 +100,7 @@ FairParSet* CbmTrdContFact::createContainer(FairContainer* c) { p = new CbmTrdParSetGeo( c->getConcatName().Data(), c->GetTitle(), c->getContext()); else if (strcmp(name, "CbmMcbm2020TrdTshiftPar") == 0) { - p = new CbmMcbm2020TrdTshiftPar( - c->getConcatName().Data(), c->GetTitle(), c->getContext()); + p = new CbmMcbm2020TrdTshiftPar(c->getConcatName().Data(), c->GetTitle(), c->getContext()); } return p; diff --git a/fles/cosy2019/monitor/CbmCosy2019MonitorAlgoHodo.cxx b/fles/cosy2019/monitor/CbmCosy2019MonitorAlgoHodo.cxx index c43e1bc57d5df1feb00ce1dd0eaff833bb2b1611..c67eae149f5025167105773bc1af58d78b1a6bd9 100644 --- a/fles/cosy2019/monitor/CbmCosy2019MonitorAlgoHodo.cxx +++ b/fles/cosy2019/monitor/CbmCosy2019MonitorAlgoHodo.cxx @@ -28,6 +28,7 @@ #include <fstream> #include <iomanip> #include <iostream> + #include <stdint.h> // ------------------------------------------------------------------------- @@ -123,11 +124,8 @@ CbmCosy2019MonitorAlgoHodo::CbmCosy2019MonitorAlgoHodo() , fhPrevHitDtAsicsAB(nullptr) , fiTimeIntervalRateUpdate(-1) , fviTimeSecLastRateUpdate(kuNbHodos, 0) - , fvdChanCountsSinceLastRateUpdate( - kuNbHodos, - std::vector<Double_t>(kuNbChanPerAsic, 0.0)) - , fdHodoChanLastTimeForDist(kuNbHodos, - std::vector<Double_t>(kuNbChanPerAsic, 0.0)) + , fvdChanCountsSinceLastRateUpdate(kuNbHodos, std::vector<Double_t>(kuNbChanPerAsic, 0.0)) + , fdHodoChanLastTimeForDist(kuNbHodos, std::vector<Double_t>(kuNbChanPerAsic, 0.0)) , fuPreviousHitAsic(0) , fvdPreviousHitTimePerAsic(2, 0.0) , fcSummary(nullptr) @@ -137,33 +135,40 @@ CbmCosy2019MonitorAlgoHodo::CbmCosy2019MonitorAlgoHodo() , fcHodoFiberCoincAB(nullptr) , fcHodoFullCoinc(nullptr) , fcHodoFullCoincPos(nullptr) - , fcHodoPrevHitDt(nullptr) {} -CbmCosy2019MonitorAlgoHodo::~CbmCosy2019MonitorAlgoHodo() { + , fcHodoPrevHitDt(nullptr) +{ +} +CbmCosy2019MonitorAlgoHodo::~CbmCosy2019MonitorAlgoHodo() +{ /// Clear buffers fvmHitsInMs.clear(); } // ------------------------------------------------------------------------- -Bool_t CbmCosy2019MonitorAlgoHodo::Init() { +Bool_t CbmCosy2019MonitorAlgoHodo::Init() +{ LOG(info) << "Initializing mCBM HODO 2019 monitor algo"; return kTRUE; } void CbmCosy2019MonitorAlgoHodo::Reset() {} -void CbmCosy2019MonitorAlgoHodo::Finish() { +void CbmCosy2019MonitorAlgoHodo::Finish() +{ /// Printout Goodbye message and stats /// Write Output histos } // ------------------------------------------------------------------------- -Bool_t CbmCosy2019MonitorAlgoHodo::InitContainers() { +Bool_t CbmCosy2019MonitorAlgoHodo::InitContainers() +{ LOG(info) << "Init parameter containers for CbmCosy2019MonitorAlgoHodo"; Bool_t initOK = ReInitContainers(); return initOK; } -Bool_t CbmCosy2019MonitorAlgoHodo::ReInitContainers() { +Bool_t CbmCosy2019MonitorAlgoHodo::ReInitContainers() +{ LOG(info) << "**********************************************"; LOG(info) << "ReInit parameter containers for CbmCosy2019MonitorAlgoHodo"; /* @@ -175,7 +180,8 @@ Bool_t CbmCosy2019MonitorAlgoHodo::ReInitContainers() { return initOK; } -TList* CbmCosy2019MonitorAlgoHodo::GetParList() { +TList* CbmCosy2019MonitorAlgoHodo::GetParList() +{ if (nullptr == fParCList) fParCList = new TList(); /* fUnpackPar = new CbmCosy2019HodoPar("CbmCosy2019HodoPar"); @@ -183,7 +189,8 @@ TList* CbmCosy2019MonitorAlgoHodo::GetParList() { */ return fParCList; } -Bool_t CbmCosy2019MonitorAlgoHodo::InitParameters() { +Bool_t CbmCosy2019MonitorAlgoHodo::InitParameters() +{ /* fuNbModules = fUnpackPar->GetNbOfModules(); LOG(info) << "Nr. of STS Modules: " << fuNbModules; @@ -369,8 +376,8 @@ Bool_t CbmCosy2019MonitorAlgoHodo::InitParameters() { } // ------------------------------------------------------------------------- -void CbmCosy2019MonitorAlgoHodo::AddMsComponentToList(size_t component, - UShort_t usDetectorId) { +void CbmCosy2019MonitorAlgoHodo::AddMsComponentToList(size_t component, UShort_t usDetectorId) +{ /// Check for duplicates and ignore if it is the case for (UInt_t uCompIdx = 0; uCompIdx < fvMsComponentsList.size(); ++uCompIdx) if (component == fvMsComponentsList[uCompIdx]) return; @@ -378,13 +385,13 @@ void CbmCosy2019MonitorAlgoHodo::AddMsComponentToList(size_t component, /// Add to list fvMsComponentsList.push_back(component); - LOG(info) << "CbmCosy2019MonitorAlgoHodo::AddMsComponentToList => Component " - << component << " with detector ID 0x" << std::hex << usDetectorId - << std::dec << " added to list"; + LOG(info) << "CbmCosy2019MonitorAlgoHodo::AddMsComponentToList => Component " << component << " with detector ID 0x" + << std::hex << usDetectorId << std::dec << " added to list"; } // ------------------------------------------------------------------------- -Bool_t CbmCosy2019MonitorAlgoHodo::ProcessTs(const fles::Timeslice& ts) { +Bool_t CbmCosy2019MonitorAlgoHodo::ProcessTs(const fles::Timeslice& ts) +{ fulCurrentTsIdx = ts.index(); fdTsStartTime = static_cast<Double_t>(ts.descriptor(0, 0).idx); @@ -397,10 +404,9 @@ Bool_t CbmCosy2019MonitorAlgoHodo::ProcessTs(const fles::Timeslice& ts) { fuNbOverMsPerTs = ts.num_microslices(0) - ts.num_core_microslices(); fdTsCoreSizeInNs = fdMsSizeInNs * (fuNbCoreMsPerTs); fdTsFullSizeInNs = fdMsSizeInNs * (fuNbCoreMsPerTs + fuNbOverMsPerTs); - LOG(info) << "Timeslice parameters: each TS has " << fuNbCoreMsPerTs - << " Core MS and " << fuNbOverMsPerTs - << " Overlap MS, for a core duration of " << fdTsCoreSizeInNs - << " ns and a full duration of " << fdTsFullSizeInNs << " ns"; + LOG(info) << "Timeslice parameters: each TS has " << fuNbCoreMsPerTs << " Core MS and " << fuNbOverMsPerTs + << " Overlap MS, for a core duration of " << fdTsCoreSizeInNs << " ns and a full duration of " + << fdTsFullSizeInNs << " ns"; /// Ignore overlap ms if flag set by user fuNbMsLoop = fuNbCoreMsPerTs; @@ -415,16 +421,14 @@ Bool_t CbmCosy2019MonitorAlgoHodo::ProcessTs(const fles::Timeslice& ts) { /// Loop over core microslices (and overlap ones if chosen) for (fuMsIndex = 0; fuMsIndex < fuNbMsLoop; fuMsIndex++) { /// Loop over registered components - for (UInt_t uMsCompIdx = 0; uMsCompIdx < fvMsComponentsList.size(); - ++uMsCompIdx) { + for (UInt_t uMsCompIdx = 0; uMsCompIdx < fvMsComponentsList.size(); ++uMsCompIdx) { UInt_t uMsComp = fvMsComponentsList[uMsCompIdx]; if (kFALSE == ProcessMs(ts, uMsComp, fuMsIndex)) { - LOG(error) << "Failed to process ts " << fulCurrentTsIdx << " MS " - << fuMsIndex << " for component " << uMsComp; + LOG(error) << "Failed to process ts " << fulCurrentTsIdx << " MS " << fuMsIndex << " for component " << uMsComp; return kFALSE; } // if( kFALSE == ProcessMs( ts, uMsCompIdx, fuMsIndex ) ) - } // for( UInt_t uMsCompIdx = 0; uMsCompIdx < fvMsComponentsList.size(); ++uMsCompIdx ) + } // for( UInt_t uMsCompIdx = 0; uMsCompIdx < fvMsComponentsList.size(); ++uMsCompIdx ) /// Sort the buffers of hits std::sort(fvmHitsInMs.begin(), fvmHitsInMs.end()); @@ -443,8 +447,7 @@ Bool_t CbmCosy2019MonitorAlgoHodo::ProcessTs(const fles::Timeslice& ts) { */ if (kFALSE == FillHistograms()) { - LOG(error) << "Failed to fill histos in ts " << fulCurrentTsIdx << " MS " - << fuMsIndex; + LOG(error) << "Failed to fill histos in ts " << fulCurrentTsIdx << " MS " << fuMsIndex; return kFALSE; } // if( kFALSE == FillHistograms() ) @@ -459,31 +462,27 @@ Bool_t CbmCosy2019MonitorAlgoHodo::ProcessTs(const fles::Timeslice& ts) { return kTRUE; } -Bool_t CbmCosy2019MonitorAlgoHodo::ProcessMs(const fles::Timeslice& ts, - size_t uMsCompIdx, - size_t uMsIdx) { - auto msDescriptor = ts.descriptor(uMsCompIdx, uMsIdx); - fuCurrentEquipmentId = msDescriptor.eq_id; - const uint8_t* msContent = - reinterpret_cast<const uint8_t*>(ts.content(uMsCompIdx, uMsIdx)); +Bool_t CbmCosy2019MonitorAlgoHodo::ProcessMs(const fles::Timeslice& ts, size_t uMsCompIdx, size_t uMsIdx) +{ + auto msDescriptor = ts.descriptor(uMsCompIdx, uMsIdx); + fuCurrentEquipmentId = msDescriptor.eq_id; + const uint8_t* msContent = reinterpret_cast<const uint8_t*>(ts.content(uMsCompIdx, uMsIdx)); uint32_t uSize = msDescriptor.size; fulCurrentMsIdx = msDescriptor.idx; Double_t dMsTime = (1e-9) * static_cast<double>(fulCurrentMsIdx); - LOG(debug) << "Microslice: " << fulCurrentMsIdx << " from EqId " << std::hex - << fuCurrentEquipmentId << std::dec << " has size: " << uSize; + LOG(debug) << "Microslice: " << fulCurrentMsIdx << " from EqId " << std::hex << fuCurrentEquipmentId << std::dec + << " has size: " << uSize; - if (0 == fvbMaskedComponents.size()) - fvbMaskedComponents.resize(ts.num_components(), kFALSE); + if (0 == fvbMaskedComponents.size()) fvbMaskedComponents.resize(ts.num_components(), kFALSE); fuCurrDpbId = static_cast<uint32_t>(fuCurrentEquipmentId & 0xFFFF); /// Check if this sDPB ID matches the one declared by the user if (fuDpbId != fuCurrDpbId) { if (kFALSE == fvbMaskedComponents[uMsCompIdx]) { - LOG(info) - << "---------------------------------------------------------------"; + LOG(info) << "---------------------------------------------------------------"; /* LOG(info) << "hi hv eqid flag si sv idx/start crc size offset"; LOG(info) << Form( "%02x %02x %04x %04x %02x %02x %016llx %08x %08x %016llx", @@ -494,10 +493,9 @@ Bool_t CbmCosy2019MonitorAlgoHodo::ProcessMs(const fles::Timeslice& ts, msDescriptor.size, msDescriptor.offset ); */ LOG(info) << FormatMsHeaderPrintout(msDescriptor); - LOG(warning) << "Could not find the sDPB index for AFCK id 0x" << std::hex - << fuCurrDpbId << std::dec << " in timeslice " - << fulCurrentTsIdx << " in microslice " << uMsIdx - << " component " << uMsCompIdx << "\n" + LOG(warning) << "Could not find the sDPB index for AFCK id 0x" << std::hex << fuCurrDpbId << std::dec + << " in timeslice " << fulCurrentTsIdx << " in microslice " << uMsIdx << " component " << uMsCompIdx + << "\n" << "If valid this index has to be added in the STS " "parameter file in the DbpIdArray field"; fvbMaskedComponents[uMsCompIdx] = kTRUE; @@ -513,8 +511,7 @@ Bool_t CbmCosy2019MonitorAlgoHodo::ProcessMs(const fles::Timeslice& ts, } // if( fuDpbId != fuCurrDpbId ) /// Plots in [X/s] update - if (static_cast<Int_t>(fvdPrevMsTime[uMsCompIdx]) - < static_cast<Int_t>(dMsTime)) { + if (static_cast<Int_t>(fvdPrevMsTime[uMsCompIdx]) < static_cast<Int_t>(dMsTime)) { /// "new second" for (UInt_t uHodoIdx = 0; uHodoIdx < kuNbHodos; ++uHodoIdx) { /// Ignore first interval is not clue how late the data taking was started @@ -526,20 +523,17 @@ Bool_t CbmCosy2019MonitorAlgoHodo::ProcessMs(const fles::Timeslice& ts, continue; } // if( 0 == fviTimeSecLastRateUpdate[ uHodoIdx ] ) - Int_t iTimeInt = - static_cast<Int_t>(dMsTime) - fviTimeSecLastRateUpdate[uHodoIdx]; + Int_t iTimeInt = static_cast<Int_t>(dMsTime) - fviTimeSecLastRateUpdate[uHodoIdx]; if (fiTimeIntervalRateUpdate <= iTimeInt) { for (UInt_t uChan = 0; uChan < kuNbChanPerAsic; ++uChan) { - fhHodoChanHitRateProf[uHodoIdx]->Fill( - uChan, - fvdChanCountsSinceLastRateUpdate[uHodoIdx][uChan] / iTimeInt); + fhHodoChanHitRateProf[uHodoIdx]->Fill(uChan, fvdChanCountsSinceLastRateUpdate[uHodoIdx][uChan] / iTimeInt); fvdChanCountsSinceLastRateUpdate[uHodoIdx][uChan] = 0.0; } // for( UInt_t uChan = 0; uChan < kuNbChanPerAsic; ++uChan ) fviTimeSecLastRateUpdate[uHodoIdx] = static_cast<Int_t>(dMsTime); } // if( fiTimeIntervalRateUpdate <= iTimeInt ) } // for( UInt_t uHodoIdx = 0; uHodoIdx < kuNbHodos; ++uHodoIdx ) - } // if( static_cast<Int_t>( fvdPrevMsTime[ uMsCompIdx ] ) < static_cast<Int_t>( dMsTime ) ) + } // if( static_cast<Int_t>( fvdPrevMsTime[ uMsCompIdx ] ) < static_cast<Int_t>( dMsTime ) ) fvdPrevMsTime[uMsCompIdx] = dMsTime; /// Check Flags field of MS header @@ -548,21 +542,17 @@ Bool_t CbmCosy2019MonitorAlgoHodo::ProcessMs(const fles::Timeslice& ts, fhHodoMsStatusFieldType->Fill(uBit, (uMsHeaderFlags >> uBit) & 0x1); /** Check the current TS_MSb cycle and correct it if wrong **/ - UInt_t uTsMsbCycleHeader = std::floor( - fulCurrentMsIdx / (stsxyter::kulTsCycleNbBins * stsxyter::kdClockCycleNs)); + UInt_t uTsMsbCycleHeader = std::floor(fulCurrentMsIdx / (stsxyter::kulTsCycleNbBins * stsxyter::kdClockCycleNs)); if (0 == uMsIdx) { fvuCurrentTsMsbCycle = uTsMsbCycleHeader; fvulCurrentTsMsb = 0; } // if( 0 == uMsIdx ) - else if (uTsMsbCycleHeader != fvuCurrentTsMsbCycle - && 4194303 != fvulCurrentTsMsb) { - LOG(warning) - << "TS MSB cycle from MS header does not match current cycle from data " - << "for TS " << std::setw(12) << fulCurrentTsIdx << " MS " - << std::setw(12) << fulCurrentMsIdx << " MsInTs " << std::setw(3) - << uMsIdx << " ====> " << fvuCurrentTsMsbCycle << " VS " - << uTsMsbCycleHeader; + else if (uTsMsbCycleHeader != fvuCurrentTsMsbCycle && 4194303 != fvulCurrentTsMsb) { + LOG(warning) << "TS MSB cycle from MS header does not match current cycle from data " + << "for TS " << std::setw(12) << fulCurrentTsIdx << " MS " << std::setw(12) << fulCurrentMsIdx + << " MsInTs " << std::setw(3) << uMsIdx << " ====> " << fvuCurrentTsMsbCycle << " VS " + << uTsMsbCycleHeader; fvuCurrentTsMsbCycle = uTsMsbCycleHeader; } @@ -572,8 +562,7 @@ Bool_t CbmCosy2019MonitorAlgoHodo::ProcessMs(const fles::Timeslice& ts, << "contain only complete nDPB messages!"; // Compute the number of complete messages in the input microslice buffer - uint32_t uNbMessages = - (uSize - (uSize % kuBytesPerMessage)) / kuBytesPerMessage; + uint32_t uNbMessages = (uSize - (uSize % kuBytesPerMessage)) / kuBytesPerMessage; // Prepare variables for the loop on contents const uint32_t* pInBuff = reinterpret_cast<const uint32_t*>(msContent); @@ -592,8 +581,7 @@ Bool_t CbmCosy2019MonitorAlgoHodo::ProcessMs(const fles::Timeslice& ts, case stsxyter::MessType::Hit: { // Extract the eLink and Asic indices => Should GO IN the fill method now that obly hits are link/asic specific! UShort_t usElinkIdx = mess.GetLinkIndex(); - fhHodoMessTypePerElink->Fill(usElinkIdx, - static_cast<uint16_t>(typeMess)); + fhHodoMessTypePerElink->Fill(usElinkIdx, static_cast<uint16_t>(typeMess)); /// Remap from eLink index to Hodoscope index UInt_t uHodoIdx = 0; @@ -606,8 +594,7 @@ Bool_t CbmCosy2019MonitorAlgoHodo::ProcessMs(const fles::Timeslice& ts, if (bBadElink) { LOG(warning) << "CbmCosy2019MonitorAlgoHodo::DoUnpack => " - << "Wrong elink Idx! Elink raw " - << Form("%2d", usElinkIdx); + << "Wrong elink Idx! Elink raw " << Form("%2d", usElinkIdx); continue; } // if( bBadElink ) @@ -628,14 +615,12 @@ Bool_t CbmCosy2019MonitorAlgoHodo::ProcessMs(const fles::Timeslice& ts, if (0 < uIdx) LOG(info) << "CbmCosy2019MonitorAlgoHodo::DoUnpack => " - << "EPOCH message at unexpected position in MS: message " - << uIdx << " VS message 0 expected!"; + << "EPOCH message at unexpected position in MS: message " << uIdx << " VS message 0 expected!"; break; } // case stsxyter::MessType::TsMsb : case stsxyter::MessType::Status: { UShort_t usElinkIdx = mess.GetStatusLink(); - fhHodoMessTypePerElink->Fill(usElinkIdx, - static_cast<uint16_t>(typeMess)); + fhHodoMessTypePerElink->Fill(usElinkIdx, static_cast<uint16_t>(typeMess)); ProcessStatusInfo(mess); break; } // case stsxyter::MessType::Status @@ -661,9 +646,9 @@ Bool_t CbmCosy2019MonitorAlgoHodo::ProcessMs(const fles::Timeslice& ts, } // ------------------------------------------------------------------------- -void CbmCosy2019MonitorAlgoHodo::ProcessHitInfo(stsxyter::Message mess, - const UInt_t& uHodoIdx, - const UInt_t& /*uMsIdx*/) { +void CbmCosy2019MonitorAlgoHodo::ProcessHitInfo(stsxyter::Message mess, const UInt_t& uHodoIdx, + const UInt_t& /*uMsIdx*/) +{ UShort_t usChan = mess.GetHitChannel(); UShort_t usRawAdc = mess.GetHitAdc(); // UShort_t usTsOver = mess.GetHitTimeOver(); @@ -694,21 +679,17 @@ void CbmCosy2019MonitorAlgoHodo::ProcessHitInfo(stsxyter::Message mess, /// Compute the Full time stamp /// Use TS w/o overlap bits as they will anyway come from the TS_MSB Long64_t ulHitTime = usRawTs; - ulHitTime += static_cast<ULong64_t>(stsxyter::kuHitNbTsBins) - * static_cast<ULong64_t>(fvulCurrentTsMsb) - + static_cast<ULong64_t>(stsxyter::kulTsCycleNbBins) - * static_cast<ULong64_t>(fvuCurrentTsMsbCycle); + ulHitTime += static_cast<ULong64_t>(stsxyter::kuHitNbTsBins) * static_cast<ULong64_t>(fvulCurrentTsMsb) + + static_cast<ULong64_t>(stsxyter::kulTsCycleNbBins) * static_cast<ULong64_t>(fvuCurrentTsMsbCycle); /// Convert the Hit time in bins to Hit time in ns Double_t dHitTimeNs = ulHitTime * stsxyter::kdClockCycleNs; /// Data should already be time sorted in FW - fhHodoChanDistT[uHodoIdx]->Fill( - dHitTimeNs - fdHodoChanLastTimeForDist[uHodoIdx][usChan], usChan); + fhHodoChanDistT[uHodoIdx]->Fill(dHitTimeNs - fdHodoChanLastTimeForDist[uHodoIdx][usChan], usChan); fdHodoChanLastTimeForDist[uHodoIdx][usChan] = dHitTimeNs; - fvmHitsInMs.push_back( - stsxyter::FinalHit(ulHitTime, usRawAdc, uHodoIdx, uFiber, uAxis, 0)); + fvmHitsInMs.push_back(stsxyter::FinalHit(ulHitTime, usRawAdc, uHodoIdx, uFiber, uAxis, 0)); /// Check Starting point of histos with time as X axis if (-1 == fdStartTime) fdStartTime = dHitTimeNs; @@ -726,20 +707,17 @@ void CbmCosy2019MonitorAlgoHodo::ProcessHitInfo(stsxyter::Message mess, } // if( mess.IsHitMissedEvts() ) } -void CbmCosy2019MonitorAlgoHodo::ProcessTsMsbInfo(stsxyter::Message mess, - UInt_t uMessIdx, - UInt_t uMsIdx) { +void CbmCosy2019MonitorAlgoHodo::ProcessTsMsbInfo(stsxyter::Message mess, UInt_t uMessIdx, UInt_t uMsIdx) +{ UInt_t uVal = mess.GetTsMsbVal(); // Update Status counters if (uVal < fvulCurrentTsMsb) { - LOG(info) << " TS " << std::setw(12) << fulCurrentTsIdx << " MS " - << std::setw(12) << fulCurrentMsIdx << " MS Idx " << std::setw(4) - << uMsIdx << " Msg Idx " << std::setw(5) << uMessIdx - << " Old TsMsb " << std::setw(5) << fvulCurrentTsMsb - << " Old MsbCy " << std::setw(5) << fvuCurrentTsMsbCycle - << " new TsMsb " << std::setw(5) << uVal; + LOG(info) << " TS " << std::setw(12) << fulCurrentTsIdx << " MS " << std::setw(12) << fulCurrentMsIdx << " MS Idx " + << std::setw(4) << uMsIdx << " Msg Idx " << std::setw(5) << uMessIdx << " Old TsMsb " << std::setw(5) + << fvulCurrentTsMsb << " Old MsbCy " << std::setw(5) << fvuCurrentTsMsbCycle << " new TsMsb " + << std::setw(5) << uVal; fvuCurrentTsMsbCycle++; } // if( uVal < fvulCurrentTsMsb ) @@ -747,11 +725,9 @@ void CbmCosy2019MonitorAlgoHodo::ProcessTsMsbInfo(stsxyter::Message mess, && 1 != uMessIdx) // 1st TS MSB in MS always repat of last in prev MS { LOG(info) << "TS MSb Jump in " - << " TS " << std::setw(12) << fulCurrentTsIdx << " MS " - << std::setw(12) << fulCurrentMsIdx << " MS Idx " << std::setw(4) - << uMsIdx << " Msg Idx " << std::setw(5) << uMessIdx - << " => Old TsMsb " << std::setw(5) << fvulCurrentTsMsb - << " new TsMsb " << std::setw(5) << uVal; + << " TS " << std::setw(12) << fulCurrentTsIdx << " MS " << std::setw(12) << fulCurrentMsIdx << " MS Idx " + << std::setw(4) << uMsIdx << " Msg Idx " << std::setw(5) << uMessIdx << " => Old TsMsb " << std::setw(5) + << fvulCurrentTsMsb << " new TsMsb " << std::setw(5) << uVal; } // if( uVal + 1 != fvulCurrentTsMsb && 4194303 != uVal && 0 != fvulCurrentTsMsb && 1 != uMessIdx ) fvulCurrentTsMsb = uVal; /* @@ -762,7 +738,8 @@ void CbmCosy2019MonitorAlgoHodo::ProcessTsMsbInfo(stsxyter::Message mess, */ } -void CbmCosy2019MonitorAlgoHodo::ProcessEpochInfo(stsxyter::Message /*mess*/) { +void CbmCosy2019MonitorAlgoHodo::ProcessEpochInfo(stsxyter::Message /*mess*/) +{ // UInt_t uVal = mess.GetEpochVal(); // UInt_t uCurrentCycle = uVal % stsxyter::kulTsCycleNbBins; @@ -774,7 +751,8 @@ void CbmCosy2019MonitorAlgoHodo::ProcessEpochInfo(stsxyter::Message /*mess*/) { */ } -void CbmCosy2019MonitorAlgoHodo::ProcessStatusInfo(stsxyter::Message /*mess*/) { +void CbmCosy2019MonitorAlgoHodo::ProcessStatusInfo(stsxyter::Message /*mess*/) +{ /* UInt_t uCrobIdx = usElinkIdx / XXXX Int_t uFebIdx = XXXX @@ -796,9 +774,9 @@ void CbmCosy2019MonitorAlgoHodo::ProcessStatusInfo(stsxyter::Message /*mess*/) { // ------------------------------------------------------------------------- -Bool_t CbmCosy2019MonitorAlgoHodo::CreateHistograms() { - fhHodoMessType = - new TH1I("hHodoMessType", "Nb of message for each type; Type", 6, 0., 6.); +Bool_t CbmCosy2019MonitorAlgoHodo::CreateHistograms() +{ + fhHodoMessType = new TH1I("hHodoMessType", "Nb of message for each type; Type", 6, 0., 6.); fhHodoMessType->GetXaxis()->SetBinLabel(1, "Dummy"); fhHodoMessType->GetXaxis()->SetBinLabel(2, "Hit"); fhHodoMessType->GetXaxis()->SetBinLabel(3, "TsMsb"); @@ -806,15 +784,9 @@ Bool_t CbmCosy2019MonitorAlgoHodo::CreateHistograms() { fhHodoMessType->GetXaxis()->SetBinLabel(5, "Status"); fhHodoMessType->GetXaxis()->SetBinLabel(6, "Empty"); - fhHodoStatusMessType = new TH2I( - "hHodoStatusMessType", - "Nb of status message of each type for each DPB; ASIC; Status Type", - kuNbHodos, - 0, - kuNbHodos, - 16, - 0., - 16.); + fhHodoStatusMessType = + new TH2I("hHodoStatusMessType", "Nb of status message of each type for each DPB; ASIC; Status Type", kuNbHodos, 0, + kuNbHodos, 16, 0., 16.); /* fhHodoStatusMessType->GetYaxis()->SetBinLabel( 1, "Dummy"); fhHodoStatusMessType->GetYaxis()->SetBinLabel( 2, "Hit"); @@ -822,15 +794,9 @@ Bool_t CbmCosy2019MonitorAlgoHodo::CreateHistograms() { fhHodoStatusMessType->GetYaxis()->SetBinLabel( 4, "Epoch"); */ - fhHodoMsStatusFieldType = new TH2I( - "hHodoMsStatusFieldType", - "For each flag in the MS header, ON/OFF counts; Flag bit []; ON/OFF; MS []", - 16, - -0.5, - 15.5, - 2, - -0.5, - 1.5); + fhHodoMsStatusFieldType = + new TH2I("hHodoMsStatusFieldType", "For each flag in the MS header, ON/OFF counts; Flag bit []; ON/OFF; MS []", 16, + -0.5, 15.5, 2, -0.5, 1.5); /* fhHodoStatusMessType->GetYaxis()->SetBinLabel( 1, "Dummy"); fhHodoStatusMessType->GetYaxis()->SetBinLabel( 2, "Hit"); @@ -838,15 +804,8 @@ Bool_t CbmCosy2019MonitorAlgoHodo::CreateHistograms() { fhHodoStatusMessType->GetYaxis()->SetBinLabel( 4, "Epoch"); */ - fhHodoMessTypePerElink = - new TH2I("hHodoMessTypePerElink", - "Nb of message of each type for each eLink; eLink; Type", - kuNbElinksDpb, - 0, - kuNbElinksDpb, - 6, - 0., - 6.); + fhHodoMessTypePerElink = new TH2I("hHodoMessTypePerElink", "Nb of message of each type for each eLink; eLink; Type", + kuNbElinksDpb, 0, kuNbElinksDpb, 6, 0., 6.); fhHodoMessTypePerElink->GetYaxis()->SetBinLabel(1, "Dummy"); fhHodoMessTypePerElink->GetYaxis()->SetBinLabel(2, "Hit"); fhHodoMessTypePerElink->GetYaxis()->SetBinLabel(3, "TsMsb"); @@ -862,34 +821,23 @@ Bool_t CbmCosy2019MonitorAlgoHodo::CreateHistograms() { for (UInt_t uHodoIdx = 0; uHodoIdx < kuNbHodos; ++uHodoIdx) { /// Raw = ASIC channels /// Channel counts - fhHodoChanCntRaw[uHodoIdx] = new TH1I( - Form("hHodoChanCntRaw_%u", uHodoIdx), - Form("Hits Count per channel, Hodo #%u; Channel; Hits []", uHodoIdx), - kuNbChanPerAsic, - -0.5, - kuNbChanPerAsic - 0.5); + fhHodoChanCntRaw[uHodoIdx] = new TH1I(Form("hHodoChanCntRaw_%u", uHodoIdx), + Form("Hits Count per channel, Hodo #%u; Channel; Hits []", uHodoIdx), + kuNbChanPerAsic, -0.5, kuNbChanPerAsic - 0.5); /// Raw Adc Distribution - fhHodoChanAdcRaw[uHodoIdx] = - new TH2I(Form("hHodoChanAdcRaw_%u", uHodoIdx), - Form("Raw Adc distribution per channel, Hodo #%u; Channel []; " - "Adc []; Hits []", - uHodoIdx), - kuNbChanPerAsic, - -0.5, - kuNbChanPerAsic - 0.5, - stsxyter::kuHitNbAdcBins, - -0.5, - stsxyter::kuHitNbAdcBins - 0.5); + fhHodoChanAdcRaw[uHodoIdx] = new TH2I(Form("hHodoChanAdcRaw_%u", uHodoIdx), + Form("Raw Adc distribution per channel, Hodo #%u; Channel []; " + "Adc []; Hits []", + uHodoIdx), + kuNbChanPerAsic, -0.5, kuNbChanPerAsic - 0.5, stsxyter::kuHitNbAdcBins, -0.5, + stsxyter::kuHitNbAdcBins - 0.5); /// Raw Adc Distribution profile - fhHodoChanAdcRawProf[uHodoIdx] = new TProfile( - Form("hHodoChanAdcRawProf_%u", uHodoIdx), - Form("Raw Adc prodile per channel, Hodo #%u; Channel []; Adc []", - uHodoIdx), - kuNbChanPerAsic, - -0.5, - kuNbChanPerAsic - 0.5); + fhHodoChanAdcRawProf[uHodoIdx] = + new TProfile(Form("hHodoChanAdcRawProf_%u", uHodoIdx), + Form("Raw Adc prodile per channel, Hodo #%u; Channel []; Adc []", uHodoIdx), kuNbChanPerAsic, -0.5, + kuNbChanPerAsic - 0.5); /* /// Cal Adc Distribution fhHodoChanAdcCal[ uHodoIdx ] = new TH2I( Form( "hHodoChanAdcCal_%u", uHodoIdx ), @@ -903,79 +851,45 @@ Bool_t CbmCosy2019MonitorAlgoHodo::CreateHistograms() { kuNbChanPerAsic, -0.5, kuNbChanPerAsic - 0.5 ); */ /// Raw Ts Distribution - fhHodoChanRawTs[uHodoIdx] = - new TH2I(Form("hHodoChanRawTs_%u", uHodoIdx), - Form("Raw Timestamp distribution per channel, FEB #%03u; " - "Channel []; Ts []; Hits []", - uHodoIdx), - kuNbChanPerAsic, - -0.5, - kuNbChanPerAsic - 0.5, - stsxyter::kuHitNbTsBins, - -0.5, - stsxyter::kuHitNbTsBins - 0.5); + fhHodoChanRawTs[uHodoIdx] = new TH2I(Form("hHodoChanRawTs_%u", uHodoIdx), + Form("Raw Timestamp distribution per channel, FEB #%03u; " + "Channel []; Ts []; Hits []", + uHodoIdx), + kuNbChanPerAsic, -0.5, kuNbChanPerAsic - 0.5, stsxyter::kuHitNbTsBins, -0.5, + stsxyter::kuHitNbTsBins - 0.5); /// Missed event flag - fhHodoChanMissEvt[uHodoIdx] = - new TH2I(Form("hHodoChanMissEvt_%u", uHodoIdx), - Form("Missed Event flags per channel, Hodo #%u; Channel []; " - "Miss Evt []; Hits []", - uHodoIdx), - kuNbChanPerAsic, - -0.5, - kuNbChanPerAsic - 0.5, - 2, - -0.5, - 1.5); + fhHodoChanMissEvt[uHodoIdx] = new TH2I(Form("hHodoChanMissEvt_%u", uHodoIdx), + Form("Missed Event flags per channel, Hodo #%u; Channel []; " + "Miss Evt []; Hits []", + uHodoIdx), + kuNbChanPerAsic, -0.5, kuNbChanPerAsic - 0.5, 2, -0.5, 1.5); /// Missed event flag counts evolution - fhHodoChanMissEvtEvo[uHodoIdx] = - new TH2I(Form("hHodoChanMissEvtEvo_%u", uHodoIdx), - Form("Missed Evt flags per second & channel in Hodo #%u; Time " - "[s]; Channel []; Missed Evt flags []", - uHodoIdx), - 1800, - 0, - 1800, - kuNbChanPerAsic, - -0.5, - kuNbChanPerAsic - 0.5); + fhHodoChanMissEvtEvo[uHodoIdx] = new TH2I(Form("hHodoChanMissEvtEvo_%u", uHodoIdx), + Form("Missed Evt flags per second & channel in Hodo #%u; Time " + "[s]; Channel []; Missed Evt flags []", + uHodoIdx), + 1800, 0, 1800, kuNbChanPerAsic, -0.5, kuNbChanPerAsic - 0.5); /// Hit rates evo per channel - fhHodoChanHitRateEvo[uHodoIdx] = new TH2I( - Form("hHodoChanHitRateEvo_%u", uHodoIdx), - Form( - "Hits per second & channel in Hodo #%u; Time [s]; Channel []; Hits []", - uHodoIdx), - 1800, - 0, - 1800, - kuNbChanPerAsic, - -0.5, - kuNbChanPerAsic - 0.5); + fhHodoChanHitRateEvo[uHodoIdx] = + new TH2I(Form("hHodoChanHitRateEvo_%u", uHodoIdx), + Form("Hits per second & channel in Hodo #%u; Time [s]; Channel []; Hits []", uHodoIdx), 1800, 0, 1800, + kuNbChanPerAsic, -0.5, kuNbChanPerAsic - 0.5); /// Hit rates profile per channel - fhHodoChanHitRateProf[uHodoIdx] = new TProfile( - Form("hHodoChanHitRateProf_%u", uHodoIdx), - Form( - "Hits per second for each channel in Hodo #%u; Channel []; Hits/s []", - uHodoIdx), - kuNbChanPerAsic, - -0.5, - kuNbChanPerAsic - 0.5); + fhHodoChanHitRateProf[uHodoIdx] = + new TProfile(Form("hHodoChanHitRateProf_%u", uHodoIdx), + Form("Hits per second for each channel in Hodo #%u; Channel []; Hits/s []", uHodoIdx), + kuNbChanPerAsic, -0.5, kuNbChanPerAsic - 0.5); /// Distance between hits on same channel - fhHodoChanDistT[uHodoIdx] = - new TH2I(Form("hHodoChanDistT_%u", uHodoIdx), - Form("Time distance between hits on same channel in Hodo #%u; " - "Time difference [ns]; Channel []; ", - uHodoIdx), - 1000, - -0.5, - 6250.0 - 0.5, - kuNbChanPerAsic, - -0.5, - kuNbChanPerAsic - 0.5); + fhHodoChanDistT[uHodoIdx] = new TH2I(Form("hHodoChanDistT_%u", uHodoIdx), + Form("Time distance between hits on same channel in Hodo #%u; " + "Time difference [ns]; Channel []; ", + uHodoIdx), + 1000, -0.5, 6250.0 - 0.5, kuNbChanPerAsic, -0.5, kuNbChanPerAsic - 0.5); /// Remapped = Hodos fibers for (UInt_t uAxis = 0; uAxis < kuNbAxis; ++uAxis) { @@ -983,50 +897,30 @@ Bool_t CbmCosy2019MonitorAlgoHodo::CreateHistograms() { /// Fibers counts fhHodoFiberCnt[uHodoIdx][uAxis] = new TH1I(Form("hHodoFiberCnt%c_%u", cAxisName, uHodoIdx), - Form("Hits Count per Fiber, Hodo #%u Axis %c; Fiber; Hits []", - uHodoIdx, - cAxisName), - kuNbChanPerAsic / 2, - -0.5, - kuNbChanPerAsic / 2 - 0.5); + Form("Hits Count per Fiber, Hodo #%u Axis %c; Fiber; Hits []", uHodoIdx, cAxisName), + kuNbChanPerAsic / 2, -0.5, kuNbChanPerAsic / 2 - 0.5); /// Fibers Adc Distribution - fhHodoFiberAdc[uHodoIdx][uAxis] = - new TH2I(Form("fhHodoFiberAdc%c_%u", cAxisName, uHodoIdx), - Form("Raw Adc distribution per Fiber, Hodo #%u Axis %c; " - "Channel []; Adc []; Hits []", - uHodoIdx, - cAxisName), - kuNbChanPerAsic / 2, - -0.5, - kuNbChanPerAsic / 2 - 0.5, - stsxyter::kuHitNbAdcBins, - -0.5, - stsxyter::kuHitNbAdcBins - 0.5); + fhHodoFiberAdc[uHodoIdx][uAxis] = new TH2I(Form("fhHodoFiberAdc%c_%u", cAxisName, uHodoIdx), + Form("Raw Adc distribution per Fiber, Hodo #%u Axis %c; " + "Channel []; Adc []; Hits []", + uHodoIdx, cAxisName), + kuNbChanPerAsic / 2, -0.5, kuNbChanPerAsic / 2 - 0.5, + stsxyter::kuHitNbAdcBins, -0.5, stsxyter::kuHitNbAdcBins - 0.5); /// Fibers Adc Distribution profile - fhHodoFiberAdcProf[uHodoIdx][uAxis] = new TProfile( - Form("hHodoFiberAdcProf%c_%u", cAxisName, uHodoIdx), - Form("Raw Adc prodile per Fiber, Hodo #%u Axis %c; Channel []; Adc []", - uHodoIdx, - cAxisName), - kuNbChanPerAsic / 2, - -0.5, - kuNbChanPerAsic / 2 - 0.5); + fhHodoFiberAdcProf[uHodoIdx][uAxis] = + new TProfile(Form("hHodoFiberAdcProf%c_%u", cAxisName, uHodoIdx), + Form("Raw Adc prodile per Fiber, Hodo #%u Axis %c; Channel []; Adc []", uHodoIdx, cAxisName), + kuNbChanPerAsic / 2, -0.5, kuNbChanPerAsic / 2 - 0.5); /// Hit rates evo per fiber fhHodoFiberHitRateEvo[uHodoIdx][uAxis] = new TH2I(Form("hHodoFiberHitRateEvo%c_%u", cAxisName, uHodoIdx), Form("Hits per second & Fiber in Hodo #%u Axis %c; Time [s]; " "Channel []; Hits []", - uHodoIdx, - cAxisName), - 1800, - 0, - 1800, - kuNbChanPerAsic / 2, - -0.5, - kuNbChanPerAsic / 2 - 0.5); + uHodoIdx, cAxisName), + 1800, 0, 1800, kuNbChanPerAsic / 2, -0.5, kuNbChanPerAsic / 2 - 0.5); AddHistoToVector(fhHodoFiberCnt[uHodoIdx][uAxis], "Fibers"); AddHistoToVector(fhHodoFiberAdc[uHodoIdx][uAxis], "Fibers"); @@ -1039,49 +933,31 @@ Bool_t CbmCosy2019MonitorAlgoHodo::CreateHistograms() { /// Coincidences in same Hodo between axis /// Map - fhHodoFiberCoincMapXY[uHodoIdx] = - new TH2I(Form("hHodoFiberCoincMapXY_%u", uHodoIdx), - Form("Map of coincident (X, Y) pairs in Hodo #%u; X [Fiber]; Y " - "[Fiber]; Hits []", - uHodoIdx), - kuNbChanPerAsic / 2, - -0.5, - kuNbChanPerAsic / 2 - 0.5, - kuNbChanPerAsic / 2, - -0.5, - kuNbChanPerAsic / 2 - 0.5); + fhHodoFiberCoincMapXY[uHodoIdx] = new TH2I(Form("hHodoFiberCoincMapXY_%u", uHodoIdx), + Form("Map of coincident (X, Y) pairs in Hodo #%u; X [Fiber]; Y " + "[Fiber]; Hits []", + uHodoIdx), + kuNbChanPerAsic / 2, -0.5, kuNbChanPerAsic / 2 - 0.5, + kuNbChanPerAsic / 2, -0.5, kuNbChanPerAsic / 2 - 0.5); /// Time diff - fhHodoFiberCoincTimeXY[uHodoIdx] = - new TH1I(Form("hHodoFiberCoincTimeXY_%u", uHodoIdx), - Form("Time difference of coincident (X, Y) pairs in Hodo #%u; " - "t_Y - t_X [ns]; Hits []", - uHodoIdx), - 2 * fdTimeCoincLimit + 1, - -fdTimeCoincLimitNs, - fdTimeCoincLimitNs); + fhHodoFiberCoincTimeXY[uHodoIdx] = new TH1I(Form("hHodoFiberCoincTimeXY_%u", uHodoIdx), + Form("Time difference of coincident (X, Y) pairs in Hodo #%u; " + "t_Y - t_X [ns]; Hits []", + uHodoIdx), + 2 * fdTimeCoincLimit + 1, -fdTimeCoincLimitNs, fdTimeCoincLimitNs); /// Walk - fhHodoFiberCoincWalkXY_X[uHodoIdx] = - new TH2I(Form("hHodoFiberCoincWalkXY_X_%u", uHodoIdx), - Form("Walk X of coincident (X, Y) pairs in Hodo #%u; ADC X " - "[bin]; t_Y - t_X [ns]; Hits []", - uHodoIdx), - stsxyter::kuHitNbAdcBins, - -0.5, - stsxyter::kuHitNbAdcBins - 0.5, - 2 * fdTimeCoincLimit + 1, - -fdTimeCoincLimitNs, - fdTimeCoincLimitNs); - fhHodoFiberCoincWalkXY_Y[uHodoIdx] = - new TH2I(Form("hHodoFiberCoincWalkXY_Y_%u", uHodoIdx), - Form("Walk X of coincident (X, Y) pairs in Hodo #%u; ADC X " - "[bin]; t_Y - t_X [ns]; Hits []", - uHodoIdx), - stsxyter::kuHitNbAdcBins, - -0.5, - stsxyter::kuHitNbAdcBins - 0.5, - 2 * fdTimeCoincLimit + 1, - -fdTimeCoincLimitNs, - fdTimeCoincLimitNs); + fhHodoFiberCoincWalkXY_X[uHodoIdx] = new TH2I(Form("hHodoFiberCoincWalkXY_X_%u", uHodoIdx), + Form("Walk X of coincident (X, Y) pairs in Hodo #%u; ADC X " + "[bin]; t_Y - t_X [ns]; Hits []", + uHodoIdx), + stsxyter::kuHitNbAdcBins, -0.5, stsxyter::kuHitNbAdcBins - 0.5, + 2 * fdTimeCoincLimit + 1, -fdTimeCoincLimitNs, fdTimeCoincLimitNs); + fhHodoFiberCoincWalkXY_Y[uHodoIdx] = new TH2I(Form("hHodoFiberCoincWalkXY_Y_%u", uHodoIdx), + Form("Walk X of coincident (X, Y) pairs in Hodo #%u; ADC X " + "[bin]; t_Y - t_X [ns]; Hits []", + uHodoIdx), + stsxyter::kuHitNbAdcBins, -0.5, stsxyter::kuHitNbAdcBins - 0.5, + 2 * fdTimeCoincLimit + 1, -fdTimeCoincLimitNs, fdTimeCoincLimitNs); AddHistoToVector(fhHodoChanCntRaw[uHodoIdx], "Raw"); AddHistoToVector(fhHodoChanAdcRaw[uHodoIdx], "Raw"); @@ -1105,60 +981,32 @@ Bool_t CbmCosy2019MonitorAlgoHodo::CreateHistograms() { Char_t cOtherAxisName = (uAxis ? 'X' : 'Y'); /// Coincidences in different Hodos between axis <= Valid only for kuNbHodos = 2 !!! /// Map Same axis - fhHodoFiberCoincMapSameAB[uAxis] = - new TH2I(Form("hHodoFiberCoincMapSameAB_%c%c", cAxisName, cAxisName), - Form("Map of coincident (%c, %c) pairs in Hodo A and B; %c_A " - "[Fiber]; %c_B [Fiber]; Hits []", - cAxisName, - cAxisName, - cAxisName, - cAxisName), - kuNbChanPerAsic / 2, - -0.5, - kuNbChanPerAsic / 2 - 0.5, - kuNbChanPerAsic / 2, - -0.5, - kuNbChanPerAsic / 2 - 0.5); + fhHodoFiberCoincMapSameAB[uAxis] = new TH2I(Form("hHodoFiberCoincMapSameAB_%c%c", cAxisName, cAxisName), + Form("Map of coincident (%c, %c) pairs in Hodo A and B; %c_A " + "[Fiber]; %c_B [Fiber]; Hits []", + cAxisName, cAxisName, cAxisName, cAxisName), + kuNbChanPerAsic / 2, -0.5, kuNbChanPerAsic / 2 - 0.5, + kuNbChanPerAsic / 2, -0.5, kuNbChanPerAsic / 2 - 0.5); /// Time diff Same axis - fhHodoFiberCoincTimeSameAB[uAxis] = - new TH1I(Form("hHodoFiberCoincTimeSameAB_%c%c", cAxisName, cAxisName), - Form("Time difference of coincident (%c, %c) pairs in Hodo A " - "and B; t_%c_B - t_%c_A [ns]; Hits []", - cAxisName, - cAxisName, - cAxisName, - cAxisName), - 2 * fdTimeCoincLimit + 1, - -fdTimeCoincLimitNs, - fdTimeCoincLimitNs); + fhHodoFiberCoincTimeSameAB[uAxis] = new TH1I(Form("hHodoFiberCoincTimeSameAB_%c%c", cAxisName, cAxisName), + Form("Time difference of coincident (%c, %c) pairs in Hodo A " + "and B; t_%c_B - t_%c_A [ns]; Hits []", + cAxisName, cAxisName, cAxisName, cAxisName), + 2 * fdTimeCoincLimit + 1, -fdTimeCoincLimitNs, fdTimeCoincLimitNs); /// Map different axis - fhHodoFiberCoincMapDiffAB[uAxis] = - new TH2I(Form("hHodoFiberCoincMapDiffAB_%c%c", cAxisName, cOtherAxisName), - Form("Map of coincident (%c, %c) pairs in Hodo A and B; %c_A " - "[Fiber]; %c_B [Fiber]; Hits []", - cAxisName, - cOtherAxisName, - cOtherAxisName, - cAxisName), - kuNbChanPerAsic / 2, - -0.5, - kuNbChanPerAsic / 2 - 0.5, - kuNbChanPerAsic / 2, - -0.5, - kuNbChanPerAsic / 2 - 0.5); + fhHodoFiberCoincMapDiffAB[uAxis] = new TH2I(Form("hHodoFiberCoincMapDiffAB_%c%c", cAxisName, cOtherAxisName), + Form("Map of coincident (%c, %c) pairs in Hodo A and B; %c_A " + "[Fiber]; %c_B [Fiber]; Hits []", + cAxisName, cOtherAxisName, cOtherAxisName, cAxisName), + kuNbChanPerAsic / 2, -0.5, kuNbChanPerAsic / 2 - 0.5, + kuNbChanPerAsic / 2, -0.5, kuNbChanPerAsic / 2 - 0.5); /// Time diff different axis - fhHodoFiberCoincTimeDiffAB[uAxis] = new TH1I( - Form("hHodoFiberCoincTimeDiffAB_%c%c", cAxisName, cOtherAxisName), - Form("Time difference of coincident (%c, %c) pairs in Hodo A and B; " - "t_%c_B - t_%c_A [ns]; Hits []", - cAxisName, - cOtherAxisName, - cOtherAxisName, - cAxisName), - 2 * fdTimeCoincLimit + 1, - -fdTimeCoincLimitNs, - fdTimeCoincLimitNs); + fhHodoFiberCoincTimeDiffAB[uAxis] = new TH1I(Form("hHodoFiberCoincTimeDiffAB_%c%c", cAxisName, cOtherAxisName), + Form("Time difference of coincident (%c, %c) pairs in Hodo A and B; " + "t_%c_B - t_%c_A [ns]; Hits []", + cAxisName, cOtherAxisName, cOtherAxisName, cAxisName), + 2 * fdTimeCoincLimit + 1, -fdTimeCoincLimitNs, fdTimeCoincLimitNs); AddHistoToVector(fhHodoFiberCoincMapSameAB[uAxis], "Coinc"); AddHistoToVector(fhHodoFiberCoincTimeSameAB[uAxis], "Coinc"); @@ -1168,76 +1016,47 @@ Bool_t CbmCosy2019MonitorAlgoHodo::CreateHistograms() { /// Full Coincidences between Hodos<= Valid only for kuNbHodos = 2 && kuNbAxis = 2 /// Position on hodo A - fhHodoFullCoincPosA = - new TH2I("fhHodoFullCoincPosA", - "Position on Hodo A for coincident pairs in Hodo A and B; X_A " - "[Fiber]; Y_A [Fiber]; Hits []", - kuNbChanPerAsic / 2, - -0.5, - kuNbChanPerAsic / 2 - 0.5, - kuNbChanPerAsic / 2, - -0.5, - kuNbChanPerAsic / 2 - 0.5); + fhHodoFullCoincPosA = new TH2I("fhHodoFullCoincPosA", + "Position on Hodo A for coincident pairs in Hodo A and B; X_A " + "[Fiber]; Y_A [Fiber]; Hits []", + kuNbChanPerAsic / 2, -0.5, kuNbChanPerAsic / 2 - 0.5, kuNbChanPerAsic / 2, -0.5, + kuNbChanPerAsic / 2 - 0.5); /// Position on hodo B - fhHodoFullCoincPosB = - new TH2I("fhHodoFullCoincPosB", - "Position on Hodo B for coincident pairs in Hodo A and B; X_B " - "[Fiber]; Y_B [Fiber]; Hits []", - kuNbChanPerAsic / 2, - -0.5, - kuNbChanPerAsic / 2 - 0.5, - kuNbChanPerAsic / 2, - -0.5, - kuNbChanPerAsic / 2 - 0.5); + fhHodoFullCoincPosB = new TH2I("fhHodoFullCoincPosB", + "Position on Hodo B for coincident pairs in Hodo A and B; X_B " + "[Fiber]; Y_B [Fiber]; Hits []", + kuNbChanPerAsic / 2, -0.5, kuNbChanPerAsic / 2 - 0.5, kuNbChanPerAsic / 2, -0.5, + kuNbChanPerAsic / 2 - 0.5); /// Comp X axis - fhHodoFullCoincCompX = - new TH2I("hHodoFullCoincCompX", - "Comparison of X pos for coincident pairs in Hodo A and B; X_A " - "[Fiber]; X_B [Fiber]; Hits []", - kuNbChanPerAsic / 2, - -0.5, - kuNbChanPerAsic / 2 - 0.5, - kuNbChanPerAsic / 2, - -0.5, - kuNbChanPerAsic / 2 - 0.5); + fhHodoFullCoincCompX = new TH2I("hHodoFullCoincCompX", + "Comparison of X pos for coincident pairs in Hodo A and B; X_A " + "[Fiber]; X_B [Fiber]; Hits []", + kuNbChanPerAsic / 2, -0.5, kuNbChanPerAsic / 2 - 0.5, kuNbChanPerAsic / 2, -0.5, + kuNbChanPerAsic / 2 - 0.5); /// Comp Y axis - fhHodoFullCoincCompY = - new TH2I("hHodoFullCoincCompY", - "Comparison of Y pos for coincident pairs in Hodo A and B; Y_A " - "[Fiber]; Y_B [Fiber]; Hits []", - kuNbChanPerAsic / 2, - -0.5, - kuNbChanPerAsic / 2 - 0.5, - kuNbChanPerAsic / 2, - -0.5, - kuNbChanPerAsic / 2 - 0.5); + fhHodoFullCoincCompY = new TH2I("hHodoFullCoincCompY", + "Comparison of Y pos for coincident pairs in Hodo A and B; Y_A " + "[Fiber]; Y_B [Fiber]; Hits []", + kuNbChanPerAsic / 2, -0.5, kuNbChanPerAsic / 2 - 0.5, kuNbChanPerAsic / 2, -0.5, + kuNbChanPerAsic / 2 - 0.5); /// Residuals X vs Y ("alignment") fhHodoFullCoincResidualXY = new TH2I("hHodoFullCoincResidualXY", "X and Y residuals for coincident pairs in Hodo A and B; X_B - " "X_A [Fiber]; Y_B - Y_A [Fiber]; Hits []", - kuNbChanPerAsic + 1, - -1.0 * kuNbChanPerAsic / 2 - 0.5, - kuNbChanPerAsic / 2 + 0.5, - kuNbChanPerAsic + 1, - -1.0 * kuNbChanPerAsic / 2 - 0.5, - kuNbChanPerAsic / 2 + 0.5); + kuNbChanPerAsic + 1, -1.0 * kuNbChanPerAsic / 2 - 0.5, kuNbChanPerAsic / 2 + 0.5, kuNbChanPerAsic + 1, + -1.0 * kuNbChanPerAsic / 2 - 0.5, kuNbChanPerAsic / 2 + 0.5); /// Time diff different axis - fhHodoFullCoincTimeDiff = - new TH1I("hHodoFullCoincTimeDiff", - "Time difference of coincident pairs in Hodo A and B; (t_X_B + " - "t_Y_B)/2 - (t_X_A + t_Y_A)/2 [ns]; Hits []", - 2 * fdTimeCoincLimit + 1, - -fdTimeCoincLimitNs, - fdTimeCoincLimitNs); + fhHodoFullCoincTimeDiff = new TH1I("hHodoFullCoincTimeDiff", + "Time difference of coincident pairs in Hodo A and B; (t_X_B + " + "t_Y_B)/2 - (t_X_A + t_Y_A)/2 [ns]; Hits []", + 2 * fdTimeCoincLimit + 1, -fdTimeCoincLimitNs, fdTimeCoincLimitNs); fhHodoFullCoincRateEvo = new TH1I("fhHodoFullCoincRateEvo", "Evolution of the full coincidence rate; " "Time in run [s]; Full coincidences;", - 1800, - -0.5, - 1800 - 0.5); + 1800, -0.5, 1800 - 0.5); AddHistoToVector(fhHodoFullCoincPosA, "FullCoinc"); AddHistoToVector(fhHodoFullCoincPosB, "FullCoinc"); @@ -1254,63 +1073,38 @@ Bool_t CbmCosy2019MonitorAlgoHodo::CreateHistograms() { new TH2I(Form("hHodoFullCoincTimeWalk_%u%c", uHodoIdx, cAxisName), Form("Time walk of coincident (A, B) pairs in Hodo #%u Axis " "%c; ADC %u_%c [bin]; Time Diff <B> - <A> [ns]; Hits []", - uHodoIdx, - cAxisName, - uHodoIdx, - cAxisName), - stsxyter::kuHitNbAdcBins, - -0.5, - stsxyter::kuHitNbAdcBins - 0.5, - 2 * fdTimeCoincLimit + 1, - -fdTimeCoincLimitNs, - fdTimeCoincLimitNs); + uHodoIdx, cAxisName, uHodoIdx, cAxisName), + stsxyter::kuHitNbAdcBins, -0.5, stsxyter::kuHitNbAdcBins - 0.5, 2 * fdTimeCoincLimit + 1, + -fdTimeCoincLimitNs, fdTimeCoincLimitNs); AddHistoToVector(fhHodoFullCoincTimeWalk[uHodoIdx][uAxis], "Walk"); - fhHodoFullCoincPosEvo[uHodoIdx][uAxis] = new TH2I( - Form("hHodoFullCoincPosEvo_%u%c", uHodoIdx, cAxisName), - Form("Time evolution of coincident (A, B) pairs position in Hodo #%u " - "Axis %c; Time in run [s]; Position %u_%c [Fiber]; Hits []", - uHodoIdx, - cAxisName, - uHodoIdx, - cAxisName), - 2000, - -0.5, - 1000 - 0.5, - kuNbChanPerAsic / 2, - -0.5, - kuNbChanPerAsic / 2 - 0.5); + fhHodoFullCoincPosEvo[uHodoIdx][uAxis] = + new TH2I(Form("hHodoFullCoincPosEvo_%u%c", uHodoIdx, cAxisName), + Form("Time evolution of coincident (A, B) pairs position in Hodo #%u " + "Axis %c; Time in run [s]; Position %u_%c [Fiber]; Hits []", + uHodoIdx, cAxisName, uHodoIdx, cAxisName), + 2000, -0.5, 1000 - 0.5, kuNbChanPerAsic / 2, -0.5, kuNbChanPerAsic / 2 - 0.5); AddHistoToVector(fhHodoFullCoincPosEvo[uHodoIdx][uAxis], "FullCoinc"); } // for( UInt_t uAxis = 0; uAxis < kuNbAxis; ++uAxis ) } // for( UInt_t uHodoIdx = 0; uHodoIdx < kuNbHodos; ++uHodoIdx ) /// Setup debugging - fhPrevHitDtAllAsics = - new TH1I("hPrevHitDtAllAsics", - "Time difference between current and previous hits in any ASIC; t " - "- t_prev [ns]; Hit pairs []", - 10000, - 0.0, - 10000 * stsxyter::kdClockCycleNs); - fhPrevHitDtAsicA = new TH1I("hPrevHitDtAsicA", + fhPrevHitDtAllAsics = new TH1I("hPrevHitDtAllAsics", + "Time difference between current and previous hits in any ASIC; t " + "- t_prev [ns]; Hit pairs []", + 10000, 0.0, 10000 * stsxyter::kdClockCycleNs); + fhPrevHitDtAsicA = new TH1I("hPrevHitDtAsicA", "Time difference between current and previous " "hits in ASIC A; t - t_prev [ns]; Hit pairs []", - 10000, - 0.0, - 10000 * stsxyter::kdClockCycleNs); - fhPrevHitDtAsicB = new TH1I("hPrevHitDtAsicB", + 10000, 0.0, 10000 * stsxyter::kdClockCycleNs); + fhPrevHitDtAsicB = new TH1I("hPrevHitDtAsicB", "Time difference between current and previous " "hits in ASIC B; t - t_prev [ns]; Hit pairs []", - 10000, - 0.0, - 10000 * stsxyter::kdClockCycleNs); - fhPrevHitDtAsicsAB = - new TH1I("hPrevHitDtAsicsAB", - "Time difference between current in ASIC A and previous hit in " - "ASIC B; t - t_prev [ns]; Hit pairs []", - 10000, - 0.0, - 10000 * stsxyter::kdClockCycleNs); + 10000, 0.0, 10000 * stsxyter::kdClockCycleNs); + fhPrevHitDtAsicsAB = new TH1I("hPrevHitDtAsicsAB", + "Time difference between current in ASIC A and previous hit in " + "ASIC B; t - t_prev [ns]; Hit pairs []", + 10000, 0.0, 10000 * stsxyter::kdClockCycleNs); AddHistoToVector(fhPrevHitDtAllAsics, "SetupDebugging"); AddHistoToVector(fhPrevHitDtAsicA, "SetupDebugging"); @@ -1354,10 +1148,7 @@ Bool_t CbmCosy2019MonitorAlgoHodo::CreateHistograms() { for (UInt_t uHodoIdx = 0; uHodoIdx < kuNbHodos; ++uHodoIdx) { /// Distributions before fiber mapping per Hodo fcHodoSummaryRaw[uHodoIdx] = - new TCanvas(Form("cHodoSummaryRaw%u", uHodoIdx), - Form("Raw Summary for Hodo %u", uHodoIdx), - w, - h); + new TCanvas(Form("cHodoSummaryRaw%u", uHodoIdx), Form("Raw Summary for Hodo %u", uHodoIdx), w, h); fcHodoSummaryRaw[uHodoIdx]->Divide(4, 2); fcHodoSummaryRaw[uHodoIdx]->cd(1); @@ -1409,10 +1200,7 @@ Bool_t CbmCosy2019MonitorAlgoHodo::CreateHistograms() { /// Distributions after fiber mapping per Hodo and axis fcHodoSummaryFiber[uHodoIdx] = - new TCanvas(Form("cHodoSummaryFiber%u", uHodoIdx), - Form("Fiber Summary for Hodo %u", uHodoIdx), - w, - h); + new TCanvas(Form("cHodoSummaryFiber%u", uHodoIdx), Form("Fiber Summary for Hodo %u", uHodoIdx), w, h); fcHodoSummaryFiber[uHodoIdx]->Divide(4, 2); for (UInt_t uAxis = 0; uAxis < kuNbAxis; ++uAxis) { @@ -1444,8 +1232,7 @@ Bool_t CbmCosy2019MonitorAlgoHodo::CreateHistograms() { AddCanvasToVector(fcHodoSummaryFiber[uHodoIdx], "canvases"); } // for( UInt_t uHodoIdx = 0; uHodoIdx < kuNbHodos; ++uHodoIdx ) - fcHodoFiberCoinc = - new TCanvas("fcHodoFiberCoinc", "X/Y coincidences in same hodoscope", w, h); + fcHodoFiberCoinc = new TCanvas("fcHodoFiberCoinc", "X/Y coincidences in same hodoscope", w, h); fcHodoFiberCoinc->Divide(4, 2); fcHodoFiberCoinc->cd(1); @@ -1496,8 +1283,7 @@ Bool_t CbmCosy2019MonitorAlgoHodo::CreateHistograms() { gPad->SetLogz(); fhHodoFiberCoincWalkXY_Y[1]->Draw("colz"); - fcHodoFiberCoincAB = new TCanvas( - "fcHodoFiberCoincAB", "X/Y coincidences between hodoscopes", w, h); + fcHodoFiberCoincAB = new TCanvas("fcHodoFiberCoincAB", "X/Y coincidences between hodoscopes", w, h); fcHodoFiberCoincAB->Divide(4, 2); for (UInt_t uAxis = 0; uAxis < kuNbAxis; ++uAxis) { @@ -1526,8 +1312,7 @@ Bool_t CbmCosy2019MonitorAlgoHodo::CreateHistograms() { fhHodoFiberCoincTimeDiffAB[uAxis]->Draw("hist"); } // for( UInt_t uAxis = 0; uAxis < kuNbAxis; ++uAxis ) - fcHodoFullCoinc = new TCanvas( - "fcHodoFullCoinc", "Full coincidences between hodoscopes", w, h); + fcHodoFullCoinc = new TCanvas("fcHodoFullCoinc", "Full coincidences between hodoscopes", w, h); fcHodoFullCoinc->Divide(4, 2); fcHodoFullCoinc->cd(1); @@ -1580,10 +1365,7 @@ Bool_t CbmCosy2019MonitorAlgoHodo::CreateHistograms() { fhHodoFullCoincTimeWalk[1][1]->Draw("colz"); fcHodoFullCoincPos = - new TCanvas("fcHodoFullCoincPos", - "Hit Positions for Full coincidences between hodoscopes", - w, - h); + new TCanvas("fcHodoFullCoincPos", "Hit Positions for Full coincidences between hodoscopes", w, h); fcHodoFullCoincPos->Divide(2); fcHodoFullCoincPos->cd(1); @@ -1599,10 +1381,7 @@ Bool_t CbmCosy2019MonitorAlgoHodo::CreateHistograms() { fhHodoFullCoincPosB->Draw("colz"); fcHodoFullCoincPosEvo = - new TCanvas("fcHodoFullCoincPosEvo", - "Hit Positions Evo for Full coincidences between hodoscopes", - w, - h); + new TCanvas("fcHodoFullCoincPosEvo", "Hit Positions Evo for Full coincidences between hodoscopes", w, h); fcHodoFullCoincPosEvo->Divide(4); fcHodoFullCoincPosEvo->cd(1); @@ -1629,11 +1408,7 @@ Bool_t CbmCosy2019MonitorAlgoHodo::CreateHistograms() { gPad->SetLogz(); fhHodoFullCoincPosEvo[1][1]->Draw("colz"); - fcHodoPrevHitDt = - new TCanvas("fcHodoPrevHitDt", - "Time difference between current and previous hits", - w, - h); + fcHodoPrevHitDt = new TCanvas("fcHodoPrevHitDt", "Time difference between current and previous hits", w, h); fcHodoPrevHitDt->Divide(2, 2); fcHodoPrevHitDt->cd(1); @@ -1668,7 +1443,8 @@ Bool_t CbmCosy2019MonitorAlgoHodo::CreateHistograms() { return kTRUE; } -Bool_t CbmCosy2019MonitorAlgoHodo::FillHistograms() { +Bool_t CbmCosy2019MonitorAlgoHodo::FillHistograms() +{ /// Prepare storage variables std::vector<std::vector<stsxyter::FinalHit>> lastHitHodoAxis; std::vector<std::vector<Bool_t>> bHitFoundHodoAxis; @@ -1687,10 +1463,8 @@ Bool_t CbmCosy2019MonitorAlgoHodo::FillHistograms() { // UInt_t uFiber = fvmHitsInMs[ uHit ].GetChan(); /// Setup debugging - Double_t dCurrentHitTime = - fvmHitsInMs[uHit].GetTs() * stsxyter::kdClockCycleNs; - fhPrevHitDtAllAsics->Fill(dCurrentHitTime - - fvdPreviousHitTimePerAsic[fuPreviousHitAsic]); + Double_t dCurrentHitTime = fvmHitsInMs[uHit].GetTs() * stsxyter::kdClockCycleNs; + fhPrevHitDtAllAsics->Fill(dCurrentHitTime - fvdPreviousHitTimePerAsic[fuPreviousHitAsic]); if (0 == uHodo) { fhPrevHitDtAsicA->Fill(dCurrentHitTime - fvdPreviousHitTimePerAsic[0]); fhPrevHitDtAsicsAB->Fill(dCurrentHitTime - fvdPreviousHitTimePerAsic[1]); @@ -1706,90 +1480,67 @@ Bool_t CbmCosy2019MonitorAlgoHodo::FillHistograms() { /// Coincidences in same Hodo <= !!!! WORKS ONLY FOR kuNbAxis = 2 !!! if (bHitFoundHodoAxis[uHodo][0] && bHitFoundHodoAxis[uHodo][1]) { - Double_t dTimeDiffAxis = - lastHitHodoAxis[uHodo][1].GetTs() * stsxyter::kdClockCycleNs - - lastHitHodoAxis[uHodo][0].GetTs() * stsxyter::kdClockCycleNs; - - if (-fdTimeCoincLimitNs < dTimeDiffAxis - && dTimeDiffAxis < fdTimeCoincLimitNs) { - fhHodoFiberCoincMapXY[uHodo]->Fill(lastHitHodoAxis[uHodo][0].GetChan(), - lastHitHodoAxis[uHodo][1].GetChan()); + Double_t dTimeDiffAxis = lastHitHodoAxis[uHodo][1].GetTs() * stsxyter::kdClockCycleNs + - lastHitHodoAxis[uHodo][0].GetTs() * stsxyter::kdClockCycleNs; + + if (-fdTimeCoincLimitNs < dTimeDiffAxis && dTimeDiffAxis < fdTimeCoincLimitNs) { + fhHodoFiberCoincMapXY[uHodo]->Fill(lastHitHodoAxis[uHodo][0].GetChan(), lastHitHodoAxis[uHodo][1].GetChan()); fhHodoFiberCoincTimeXY[uHodo]->Fill(dTimeDiffAxis); - fhHodoFiberCoincWalkXY_X[uHodo]->Fill( - lastHitHodoAxis[uHodo][0].GetAdc(), dTimeDiffAxis); - fhHodoFiberCoincWalkXY_Y[uHodo]->Fill( - lastHitHodoAxis[uHodo][1].GetAdc(), dTimeDiffAxis); + fhHodoFiberCoincWalkXY_X[uHodo]->Fill(lastHitHodoAxis[uHodo][0].GetAdc(), dTimeDiffAxis); + fhHodoFiberCoincWalkXY_Y[uHodo]->Fill(lastHitHodoAxis[uHodo][1].GetAdc(), dTimeDiffAxis); } // if( -fdTimeCoincLimitNs < dTimeDiffAxis && dTimeDiffAxis < fdTimeCoincLimitNs ) - } // if( bHitFoundHodoAxis[ uHodo ][ 0 ] && bHitFoundHodoAxis[ uHodo ][ 1 ] ) + } // if( bHitFoundHodoAxis[ uHodo ][ 0 ] && bHitFoundHodoAxis[ uHodo ][ 1 ] ) /// Concidences between Hodos <= !!!! WORKS ONLY FOR kuNbHodos = 2 && kuNbAxis = 2 !!! if (bHitFoundHodoAxis[0][uAxis] && bHitFoundHodoAxis[1][uAxis]) { - Double_t dTimeDiffHodoSame = - lastHitHodoAxis[1][uAxis].GetTs() * stsxyter::kdClockCycleNs - - lastHitHodoAxis[0][uAxis].GetTs() * stsxyter::kdClockCycleNs; - - if (-fdTimeCoincLimitNs < dTimeDiffHodoSame - && dTimeDiffHodoSame < fdTimeCoincLimitNs) { - fhHodoFiberCoincMapSameAB[uAxis]->Fill( - lastHitHodoAxis[0][uAxis].GetChan(), - lastHitHodoAxis[1][uAxis].GetChan()); + Double_t dTimeDiffHodoSame = lastHitHodoAxis[1][uAxis].GetTs() * stsxyter::kdClockCycleNs + - lastHitHodoAxis[0][uAxis].GetTs() * stsxyter::kdClockCycleNs; + + if (-fdTimeCoincLimitNs < dTimeDiffHodoSame && dTimeDiffHodoSame < fdTimeCoincLimitNs) { + fhHodoFiberCoincMapSameAB[uAxis]->Fill(lastHitHodoAxis[0][uAxis].GetChan(), + lastHitHodoAxis[1][uAxis].GetChan()); fhHodoFiberCoincTimeSameAB[uAxis]->Fill(dTimeDiffHodoSame); } // if( -fdTimeCoincLimitNs < dTimeDiffAxis && dTimeDiffAxis < fdTimeCoincLimitNs ) - } // if( bHitFoundHodoAxis[ 0 ][ uAxis ] && bHitFoundHodoAxis[ 1 ][ uAxis ] ) + } // if( bHitFoundHodoAxis[ 0 ][ uAxis ] && bHitFoundHodoAxis[ 1 ][ uAxis ] ) UInt_t uAxisA = (uHodo ? !uAxis : uAxis); UInt_t uAxisB = (uHodo ? uAxis : !uAxis); if (bHitFoundHodoAxis[0][uAxisA] && bHitFoundHodoAxis[1][uAxisB]) { - Double_t dTimeDiffHodoDiff = - lastHitHodoAxis[1][uAxisB].GetTs() * stsxyter::kdClockCycleNs - - lastHitHodoAxis[0][uAxisA].GetTs() * stsxyter::kdClockCycleNs; - - if (-fdTimeCoincLimitNs < dTimeDiffHodoDiff - && dTimeDiffHodoDiff < fdTimeCoincLimitNs) { - fhHodoFiberCoincMapDiffAB[uAxisA]->Fill( - lastHitHodoAxis[0][uAxisA].GetChan(), - lastHitHodoAxis[1][uAxisB].GetChan()); + Double_t dTimeDiffHodoDiff = lastHitHodoAxis[1][uAxisB].GetTs() * stsxyter::kdClockCycleNs + - lastHitHodoAxis[0][uAxisA].GetTs() * stsxyter::kdClockCycleNs; + + if (-fdTimeCoincLimitNs < dTimeDiffHodoDiff && dTimeDiffHodoDiff < fdTimeCoincLimitNs) { + fhHodoFiberCoincMapDiffAB[uAxisA]->Fill(lastHitHodoAxis[0][uAxisA].GetChan(), + lastHitHodoAxis[1][uAxisB].GetChan()); fhHodoFiberCoincTimeDiffAB[uAxisA]->Fill(dTimeDiffHodoDiff); } // if( -fdTimeCoincLimitNs < dTimeDiffAxis && dTimeDiffAxis < fdTimeCoincLimitNs ) } /// Full Concidences between Hodos <= !!!! WORKS ONLY FOR kuNbHodos = 2 && kuNbAxis = 2 !!! - if (bHitFoundHodoAxis[0][0] && bHitFoundHodoAxis[0][1] - && bHitFoundHodoAxis[1][0] && bHitFoundHodoAxis[1][1]) { - Double_t dTimeDiffHodoA = - lastHitHodoAxis[0][1].GetTs() * stsxyter::kdClockCycleNs - - lastHitHodoAxis[0][0].GetTs() * stsxyter::kdClockCycleNs; - Double_t dTimeDiffHodoB = - lastHitHodoAxis[1][1].GetTs() * stsxyter::kdClockCycleNs - - lastHitHodoAxis[1][0].GetTs() * stsxyter::kdClockCycleNs; - Double_t dTimeDiffHodoAB = - (lastHitHodoAxis[1][1].GetTs() * stsxyter::kdClockCycleNs - + lastHitHodoAxis[1][0].GetTs() * stsxyter::kdClockCycleNs) - / 2.0 - - (lastHitHodoAxis[0][1].GetTs() * stsxyter::kdClockCycleNs - + lastHitHodoAxis[0][0].GetTs() * stsxyter::kdClockCycleNs) - / 2.0; - Double_t dTimeHitHodoAB = - (lastHitHodoAxis[1][1].GetTs() * stsxyter::kdClockCycleNs - + lastHitHodoAxis[1][0].GetTs() * stsxyter::kdClockCycleNs - + lastHitHodoAxis[0][1].GetTs() * stsxyter::kdClockCycleNs - + lastHitHodoAxis[0][0].GetTs() * stsxyter::kdClockCycleNs) - / 4.0; - - if (-fdTimeCoincLimitNs < dTimeDiffHodoA - && dTimeDiffHodoA < fdTimeCoincLimitNs - && -fdTimeCoincLimitNs < dTimeDiffHodoB - && dTimeDiffHodoB < fdTimeCoincLimitNs - && -fdTimeCoincLimitNs < dTimeDiffHodoAB - && dTimeDiffHodoAB < fdTimeCoincLimitNs) { - UInt_t uPosXA = fvbHodoSwapXY[0] ? lastHitHodoAxis[0][1].GetChan() - : lastHitHodoAxis[0][0].GetChan(); - UInt_t uPosYA = fvbHodoSwapXY[0] ? lastHitHodoAxis[0][0].GetChan() - : lastHitHodoAxis[0][1].GetChan(); - UInt_t uPosXB = fvbHodoSwapXY[1] ? lastHitHodoAxis[1][1].GetChan() - : lastHitHodoAxis[1][0].GetChan(); - UInt_t uPosYB = fvbHodoSwapXY[1] ? lastHitHodoAxis[1][0].GetChan() - : lastHitHodoAxis[1][1].GetChan(); + if (bHitFoundHodoAxis[0][0] && bHitFoundHodoAxis[0][1] && bHitFoundHodoAxis[1][0] && bHitFoundHodoAxis[1][1]) { + Double_t dTimeDiffHodoA = lastHitHodoAxis[0][1].GetTs() * stsxyter::kdClockCycleNs + - lastHitHodoAxis[0][0].GetTs() * stsxyter::kdClockCycleNs; + Double_t dTimeDiffHodoB = lastHitHodoAxis[1][1].GetTs() * stsxyter::kdClockCycleNs + - lastHitHodoAxis[1][0].GetTs() * stsxyter::kdClockCycleNs; + Double_t dTimeDiffHodoAB = (lastHitHodoAxis[1][1].GetTs() * stsxyter::kdClockCycleNs + + lastHitHodoAxis[1][0].GetTs() * stsxyter::kdClockCycleNs) + / 2.0 + - (lastHitHodoAxis[0][1].GetTs() * stsxyter::kdClockCycleNs + + lastHitHodoAxis[0][0].GetTs() * stsxyter::kdClockCycleNs) + / 2.0; + Double_t dTimeHitHodoAB = (lastHitHodoAxis[1][1].GetTs() * stsxyter::kdClockCycleNs + + lastHitHodoAxis[1][0].GetTs() * stsxyter::kdClockCycleNs + + lastHitHodoAxis[0][1].GetTs() * stsxyter::kdClockCycleNs + + lastHitHodoAxis[0][0].GetTs() * stsxyter::kdClockCycleNs) + / 4.0; + + if (-fdTimeCoincLimitNs < dTimeDiffHodoA && dTimeDiffHodoA < fdTimeCoincLimitNs + && -fdTimeCoincLimitNs < dTimeDiffHodoB && dTimeDiffHodoB < fdTimeCoincLimitNs + && -fdTimeCoincLimitNs < dTimeDiffHodoAB && dTimeDiffHodoAB < fdTimeCoincLimitNs) { + UInt_t uPosXA = fvbHodoSwapXY[0] ? lastHitHodoAxis[0][1].GetChan() : lastHitHodoAxis[0][0].GetChan(); + UInt_t uPosYA = fvbHodoSwapXY[0] ? lastHitHodoAxis[0][0].GetChan() : lastHitHodoAxis[0][1].GetChan(); + UInt_t uPosXB = fvbHodoSwapXY[1] ? lastHitHodoAxis[1][1].GetChan() : lastHitHodoAxis[1][0].GetChan(); + UInt_t uPosYB = fvbHodoSwapXY[1] ? lastHitHodoAxis[1][0].GetChan() : lastHitHodoAxis[1][1].GetChan(); if (fvbHodoInvertX[0]) uPosXA = kuNbChanPerAsic / 2 - 1 - uPosXA; if (fvbHodoInvertY[0]) uPosYA = kuNbChanPerAsic / 2 - 1 - uPosYA; @@ -1810,14 +1561,10 @@ Bool_t CbmCosy2019MonitorAlgoHodo::FillHistograms() { fhHodoFullCoincResidualXY->Fill(dResX, dResY); fhHodoFullCoincTimeDiff->Fill(dTimeDiffHodoAB); - fhHodoFullCoincTimeWalk[0][0]->Fill(lastHitHodoAxis[0][0].GetAdc(), - dTimeDiffHodoAB); - fhHodoFullCoincTimeWalk[0][1]->Fill(lastHitHodoAxis[0][1].GetAdc(), - dTimeDiffHodoAB); - fhHodoFullCoincTimeWalk[1][0]->Fill(lastHitHodoAxis[1][0].GetAdc(), - dTimeDiffHodoAB); - fhHodoFullCoincTimeWalk[1][1]->Fill(lastHitHodoAxis[1][1].GetAdc(), - dTimeDiffHodoAB); + fhHodoFullCoincTimeWalk[0][0]->Fill(lastHitHodoAxis[0][0].GetAdc(), dTimeDiffHodoAB); + fhHodoFullCoincTimeWalk[0][1]->Fill(lastHitHodoAxis[0][1].GetAdc(), dTimeDiffHodoAB); + fhHodoFullCoincTimeWalk[1][0]->Fill(lastHitHodoAxis[1][0].GetAdc(), dTimeDiffHodoAB); + fhHodoFullCoincTimeWalk[1][1]->Fill(lastHitHodoAxis[1][1].GetAdc(), dTimeDiffHodoAB); Double_t dTimeSinceStart = (dTimeHitHodoAB - fdStartTime) * 1e-9; fhHodoFullCoincRateEvo->Fill(dTimeSinceStart); @@ -1853,7 +1600,8 @@ Bool_t CbmCosy2019MonitorAlgoHodo::FillHistograms() { return kTRUE; } -Bool_t CbmCosy2019MonitorAlgoHodo::ResetHistograms() { +Bool_t CbmCosy2019MonitorAlgoHodo::ResetHistograms() +{ fhHodoMessType->Reset(); fhHodoStatusMessType->Reset(); fhHodoMsStatusFieldType->Reset(); diff --git a/fles/cosy2019/monitor/CbmCosy2019MonitorAlgoHodo.h b/fles/cosy2019/monitor/CbmCosy2019MonitorAlgoHodo.h index 26d10fde24a812dad39001183b862d746e71d67a..81886715b34251b98b04c14145902342d141d460 100644 --- a/fles/cosy2019/monitor/CbmCosy2019MonitorAlgoHodo.h +++ b/fles/cosy2019/monitor/CbmCosy2019MonitorAlgoHodo.h @@ -12,6 +12,7 @@ // Data #include "CbmStsDigi.h" + #include "StsXyterFinalHit.h" #include "StsXyterMessage.h" @@ -47,9 +48,7 @@ public: Bool_t InitParameters(); Bool_t ProcessTs(const fles::Timeslice& ts); - Bool_t ProcessTs(const fles::Timeslice& ts, size_t /*component*/) { - return ProcessTs(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); void AddMsComponentToList(size_t component, UShort_t usDetectorId); @@ -58,40 +57,35 @@ public: Bool_t FillHistograms(); Bool_t ResetHistograms(); - inline void SetMonitorMode(Bool_t bFlagIn = kTRUE) { - fbMonitorMode = bFlagIn; - } - inline void SetTimeOffsetNs(Double_t dOffsetIn = 0.0) { - fdTimeOffsetNs = dOffsetIn; - } + inline void SetMonitorMode(Bool_t bFlagIn = kTRUE) { fbMonitorMode = bFlagIn; } + inline void SetTimeOffsetNs(Double_t dOffsetIn = 0.0) { fdTimeOffsetNs = dOffsetIn; } inline void SetDpbId(UInt_t uDpbId = 0x5b75) { fuDpbId = uDpbId; } - inline void SetHodoElinkIdx(UInt_t uElinkHodoA = 5, UInt_t uElinkHodoB = 10) { + inline void SetHodoElinkIdx(UInt_t uElinkHodoA = 5, UInt_t uElinkHodoB = 10) + { fvuElinkIdxHodo[0] = uElinkHodoA; fvuElinkIdxHodo[1] = uElinkHodoB; } /// Default set for mMUCH FMC slots 8 and 9 - inline void SetHodoSwapXY(Bool_t bSwapHodoA = kFALSE, - Bool_t bSwapHodoB = kTRUE) { + inline void SetHodoSwapXY(Bool_t bSwapHodoA = kFALSE, Bool_t bSwapHodoB = kTRUE) + { fvbHodoSwapXY[0] = bSwapHodoA; fvbHodoSwapXY[1] = bSwapHodoB; } /// Default set closest cosmic setup stack - inline void SetHodoInvertX(Bool_t bInvHodoA = kFALSE, - Bool_t bInvHodoB = kTRUE) { + inline void SetHodoInvertX(Bool_t bInvHodoA = kFALSE, Bool_t bInvHodoB = kTRUE) + { fvbHodoInvertX[0] = bInvHodoA; fvbHodoInvertX[1] = bInvHodoB; } /// Default set closest cosmic setup stack - inline void SetHodoInvertY(Bool_t bInvHodoA = kFALSE, - Bool_t bInvHodoB = kTRUE) { + inline void SetHodoInvertY(Bool_t bInvHodoA = kFALSE, Bool_t bInvHodoB = kTRUE) + { fvbHodoInvertY[0] = bInvHodoA; fvbHodoInvertY[1] = bInvHodoB; } /// Default set closest cosmic setup stack 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 fbMonitorMode; //! Switch ON the filling of a minimal set of histograms + Bool_t fbDebugMonitorMode; //! Switch ON the filling of a additional set of histograms std::vector<Bool_t> fvbMaskedComponents; /// Settings from parameter file => For now use only accessors! @@ -127,11 +121,10 @@ private: /// Constants static const Int_t kiMaxNbFlibLinks = 32; static const UInt_t kuBytesPerMessage = 4; - static const UInt_t kuNbElinksDpb = - 2 * 42; //! Max Nb of eLinks for this sDPB: 2 GBTx with 42 eLinks each - static const UInt_t kuNbHodos = 2; //! Nb of hodoscopes = Nb FEBs = Nb ASICs - static const UInt_t kuNbAxis = 2; //! Per hodoscope = X and Y - static const UInt_t kuNbChanPerAsic = 128; + static const UInt_t kuNbElinksDpb = 2 * 42; //! Max Nb of eLinks for this sDPB: 2 GBTx with 42 eLinks each + static const UInt_t kuNbHodos = 2; //! Nb of hodoscopes = Nb FEBs = Nb ASICs + static const UInt_t kuNbAxis = 2; //! Per hodoscope = X and Y + static const UInt_t kuNbChanPerAsic = 128; /* const UInt_t kuChannelToFiberMap[ kuNbChanPerAsic ] = { 0, 32, 16, 48, 15, 47, 31, 63, 1, 33, 17, 49, 14, 46, 30, 62, @@ -144,65 +137,51 @@ private: 6, 38, 22, 54, 9, 41, 25, 57, 7, 39, 23, 55, 8, 40, 24, 56 }; //! Map from channel index to Hodoscope Fiber */ - const UInt_t kuChannelToFiberMap[kuNbChanPerAsic] = - { - 32, 0, 48, 16, 47, 15, 63, 31, 33, 1, 49, 17, 46, 14, 62, 30, 34, - 2, 50, 18, 45, 13, 61, 29, 35, 3, 51, 19, 44, 12, 60, 28, 36, 4, - 52, 20, 43, 11, 59, 27, 37, 5, 53, 21, 42, 10, 58, 26, 38, 6, 54, - 22, 41, 9, 57, 25, 39, 7, 55, 23, 40, 8, 56, 24, 32, 0, 48, 16, - 47, 15, 63, 31, 33, 1, 49, 17, 46, 14, 62, 30, 34, 2, 50, 18, 45, - 13, 61, 29, 35, 3, 51, 19, 44, 12, 60, 28, 36, 4, 52, 20, 43, 11, - 59, 27, 37, 5, 53, 21, 42, 10, 58, 26, 38, 6, 54, 22, 41, 9, 57, - 25, 39, 7, 55, 23, 40, 8, 56, 24}; //! Map from channel index to Hodoscope Fiber - const UInt_t kuChannelToPixelMap[kuNbChanPerAsic] = - { - 1, 5, 3, 7, 2, 6, 4, 8, 9, 13, 11, 15, 10, 14, 12, 16, 17, - 21, 19, 23, 18, 22, 20, 24, 25, 29, 27, 31, 26, 30, 28, 32, 33, 37, - 35, 39, 34, 38, 36, 40, 41, 45, 43, 47, 42, 46, 44, 48, 49, 53, 51, - 55, 50, 54, 52, 56, 57, 61, 59, 63, 58, 62, 60, 64, 1, 5, 3, 7, - 2, 6, 4, 8, 9, 13, 11, 15, 10, 14, 12, 16, 17, 21, 19, 23, 18, - 22, 20, 24, 25, 29, 27, 31, 26, 30, 28, 32, 33, 37, 35, 39, 34, 38, - 36, 40, 41, 45, 43, 47, 42, 46, 44, 48, 49, 53, 51, 55, 50, 54, 52, - 56, 57, 61, 59, 63, 58, 62, 60, 64}; //! Map from channel index to PMT pixel - const UInt_t kuChannelToPlaneMap - [kuNbChanPerAsic] = {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, 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, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1}; //! Map from channel index to Hodoscope Axis (X or Y) + const UInt_t kuChannelToFiberMap[kuNbChanPerAsic] = {32, 0, 48, 16, 47, 15, 63, 31, 33, 1, 49, 17, 46, 14, 62, + 30, 34, 2, 50, 18, 45, 13, 61, 29, 35, 3, 51, 19, 44, 12, + 60, 28, 36, 4, 52, 20, 43, 11, 59, 27, 37, 5, 53, 21, 42, + 10, 58, 26, 38, 6, 54, 22, 41, 9, 57, 25, 39, 7, 55, 23, + 40, 8, 56, 24, 32, 0, 48, 16, 47, 15, 63, 31, 33, 1, 49, + 17, 46, 14, 62, 30, 34, 2, 50, 18, 45, 13, 61, 29, 35, 3, + 51, 19, 44, 12, 60, 28, 36, 4, 52, 20, 43, 11, 59, 27, 37, + 5, 53, 21, 42, 10, 58, 26, 38, 6, 54, 22, 41, 9, 57, 25, + 39, 7, 55, 23, 40, 8, 56, 24}; //! Map from channel index to Hodoscope Fiber + const UInt_t kuChannelToPixelMap[kuNbChanPerAsic] = {1, 5, 3, 7, 2, 6, 4, 8, 9, 13, 11, 15, 10, 14, 12, + 16, 17, 21, 19, 23, 18, 22, 20, 24, 25, 29, 27, 31, 26, 30, + 28, 32, 33, 37, 35, 39, 34, 38, 36, 40, 41, 45, 43, 47, 42, + 46, 44, 48, 49, 53, 51, 55, 50, 54, 52, 56, 57, 61, 59, 63, + 58, 62, 60, 64, 1, 5, 3, 7, 2, 6, 4, 8, 9, 13, 11, + 15, 10, 14, 12, 16, 17, 21, 19, 23, 18, 22, 20, 24, 25, 29, + 27, 31, 26, 30, 28, 32, 33, 37, 35, 39, 34, 38, 36, 40, 41, + 45, 43, 47, 42, 46, 44, 48, 49, 53, 51, 55, 50, 54, 52, 56, + 57, 61, 59, 63, 58, 62, 60, 64}; //! Map from channel index to PMT pixel + const UInt_t kuChannelToPlaneMap[kuNbChanPerAsic] = { + 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, 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, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; //! Map from channel index to Hodoscope Axis (X or Y) /// Running indices /// TS/MS info ULong64_t fulCurrentTsIdx; ULong64_t fulCurrentMsIdx; - Double_t - fdTsStartTime; //! Time in ns of current TS from the index of the first MS first component - Double_t - fdTsStopTimeCore; //! End Time in ns of current TS Core from the index of the first MS first component + Double_t fdTsStartTime; //! Time in ns of current TS from the index of the first MS first component + Double_t fdTsStopTimeCore; //! End Time in ns of current TS Core from the index of the first MS first component std::vector<Double_t> fvdPrevMsTime; //! Header time of previous MS per link - Double_t - fdMsTime; //! Start Time in ns of current MS from its index field in header - UInt_t fuMsIndex; //! Index of current MS within the TS - /// Current data properties + Double_t fdMsTime; //! Start Time in ns of current MS from its index field in header + UInt_t fuMsIndex; //! Index of current MS within the TS + /// Current data properties std::map<stsxyter::MessType, UInt_t> fmMsgCounter; - UInt_t - fuCurrentEquipmentId; //! Current equipment ID, tells from which DPB the current MS is originating - UInt_t - fuCurrDpbId; //! Temp holder until Current equipment ID is properly filled in MS - Int_t - fiRunStartDateTimeSec; //! Start of run time since "epoch" in s, for the plots with date as X axis - Int_t fiBinSizeDatePlots; //! Bin size in s for the plots with date as X axis - /// Data format control + UInt_t fuCurrentEquipmentId; //! Current equipment ID, tells from which DPB the current MS is originating + UInt_t fuCurrDpbId; //! Temp holder until Current equipment ID is properly filled in MS + Int_t fiRunStartDateTimeSec; //! Start of run time since "epoch" in s, for the plots with date as X axis + Int_t fiBinSizeDatePlots; //! Bin size in s for the plots with date as X axis + /// Data format control ULong64_t fvulCurrentTsMsb; //! Current TS MSB for each DPB UInt_t fvuCurrentTsMsbCycle; //! Current TS MSB cycle for DPB /// Starting state book-keeping - Double_t - fdStartTime; /** Time of first valid hit (TS_MSB available), used as reference for evolution plots**/ - Double_t - fdStartTimeMsSz; /** Time of first microslice, used as reference for evolution plots**/ + Double_t fdStartTime; /** Time of first valid hit (TS_MSB available), used as reference for evolution plots**/ + Double_t fdStartTimeMsSz; /** Time of first microslice, used as reference for evolution plots**/ std::chrono::steady_clock::time_point ftStartTimeUnix; /** Time of run Start from UNIX system, used as reference for long evolution plots against reception time **/ @@ -217,46 +196,44 @@ private: TH2* fhHodoMsStatusFieldType; TH2* fhHodoMessTypePerElink; /// Raw = ASIC channels - std::vector<TH1*> fhHodoChanCntRaw; //! [ Hodo ] - std::vector<TH2*> fhHodoChanAdcRaw; //! [ Hodo ] - std::vector<TProfile*> fhHodoChanAdcRawProf; //! [ Hodo ] - std::vector<TH2*> fhHodoChanAdcCal; //! [ Hodo ] - std::vector<TProfile*> fhHodoChanAdcCalProf; //! [ Hodo ] - std::vector<TH2*> fhHodoChanRawTs; //! [ Hodo ] - std::vector<TH2*> fhHodoChanMissEvt; //! [ Hodo ] - std::vector<TH2*> fhHodoChanMissEvtEvo; //! [ Hodo ] - std::vector<TH2*> fhHodoChanHitRateEvo; //! [ Hodo ] - std::vector<TProfile*> fhHodoChanHitRateProf; //! [ Hodo ] - std::vector<TH2*> fhHodoChanDistT; //! [ Hodo ] - /// Remapped = Hodos fibers - std::vector<std::vector<TH1*>> fhHodoFiberCnt; //! [ Hodo ][ Axis ] - std::vector<std::vector<TH2*>> fhHodoFiberAdc; //! [ Hodo ][ Axis ] + std::vector<TH1*> fhHodoChanCntRaw; //! [ Hodo ] + std::vector<TH2*> fhHodoChanAdcRaw; //! [ Hodo ] + std::vector<TProfile*> fhHodoChanAdcRawProf; //! [ Hodo ] + std::vector<TH2*> fhHodoChanAdcCal; //! [ Hodo ] + std::vector<TProfile*> fhHodoChanAdcCalProf; //! [ Hodo ] + std::vector<TH2*> fhHodoChanRawTs; //! [ Hodo ] + std::vector<TH2*> fhHodoChanMissEvt; //! [ Hodo ] + std::vector<TH2*> fhHodoChanMissEvtEvo; //! [ Hodo ] + std::vector<TH2*> fhHodoChanHitRateEvo; //! [ Hodo ] + std::vector<TProfile*> fhHodoChanHitRateProf; //! [ Hodo ] + std::vector<TH2*> fhHodoChanDistT; //! [ Hodo ] + /// Remapped = Hodos fibers + std::vector<std::vector<TH1*>> fhHodoFiberCnt; //! [ Hodo ][ Axis ] + std::vector<std::vector<TH2*>> fhHodoFiberAdc; //! [ Hodo ][ Axis ] std::vector<std::vector<TProfile*>> fhHodoFiberAdcProf; //! [ Hodo ][ Axis ] std::vector<std::vector<TH2*>> fhHodoFiberHitRateEvo; //! [ Hodo ][ Axis ] /// Clusters /// =====> Limits for clustering to be defined, maybe use instead STS SsdOrtho reconstruction class /// Coincidences - Double_t fdTimeCoincLimit = 100.0; /// +/- in clock cycles - Double_t fdTimeCoincLimitNs = - stsxyter::kdClockCycleNs - * (fdTimeCoincLimit + 0.5); /// +/- in clock cycles - std::vector<TH2*> fhHodoFiberCoincMapXY; //! [ Hodo ] - std::vector<TH1*> fhHodoFiberCoincTimeXY; //! [ Hodo ] - std::vector<TH2*> fhHodoFiberCoincWalkXY_X; //! [ Hodo ] - std::vector<TH2*> fhHodoFiberCoincWalkXY_Y; //! [ Hodo ] - std::vector<TH2*> fhHodoFiberCoincMapSameAB; //! [ Axis ] - std::vector<TH1*> fhHodoFiberCoincTimeSameAB; //! [ Axis ] - std::vector<TH2*> fhHodoFiberCoincMapDiffAB; //! [ Axis ] - std::vector<TH1*> fhHodoFiberCoincTimeDiffAB; //! [ Axis ] - TH2* fhHodoFullCoincPosA; //! - TH2* fhHodoFullCoincPosB; //! - TH2* fhHodoFullCoincCompX; //! - TH2* fhHodoFullCoincCompY; //! - TH2* fhHodoFullCoincResidualXY; //! - TH1* fhHodoFullCoincTimeDiff; //! - std::vector<std::vector<TH2*>> fhHodoFullCoincTimeWalk; //! [ Hodo ][ Axis ] - TH1* fhHodoFullCoincRateEvo; //! - std::vector<std::vector<TH2*>> fhHodoFullCoincPosEvo; //! [ Hodo ][ Axis ] + Double_t fdTimeCoincLimit = 100.0; /// +/- in clock cycles + Double_t fdTimeCoincLimitNs = stsxyter::kdClockCycleNs * (fdTimeCoincLimit + 0.5); /// +/- in clock cycles + std::vector<TH2*> fhHodoFiberCoincMapXY; //! [ Hodo ] + std::vector<TH1*> fhHodoFiberCoincTimeXY; //! [ Hodo ] + std::vector<TH2*> fhHodoFiberCoincWalkXY_X; //! [ Hodo ] + std::vector<TH2*> fhHodoFiberCoincWalkXY_Y; //! [ Hodo ] + std::vector<TH2*> fhHodoFiberCoincMapSameAB; //! [ Axis ] + std::vector<TH1*> fhHodoFiberCoincTimeSameAB; //! [ Axis ] + std::vector<TH2*> fhHodoFiberCoincMapDiffAB; //! [ Axis ] + std::vector<TH1*> fhHodoFiberCoincTimeDiffAB; //! [ Axis ] + TH2* fhHodoFullCoincPosA; //! + TH2* fhHodoFullCoincPosB; //! + TH2* fhHodoFullCoincCompX; //! + TH2* fhHodoFullCoincCompY; //! + TH2* fhHodoFullCoincResidualXY; //! + TH1* fhHodoFullCoincTimeDiff; //! + std::vector<std::vector<TH2*>> fhHodoFullCoincTimeWalk; //! [ Hodo ][ Axis ] + TH1* fhHodoFullCoincRateEvo; //! + std::vector<std::vector<TH2*>> fhHodoFullCoincPosEvo; //! [ Hodo ][ Axis ] /// Setup debugging TH1* fhPrevHitDtAllAsics; TH1* fhPrevHitDtAsicA; @@ -266,11 +243,9 @@ private: /// Histogramming variables /// Mean Rate per channel plots Int_t fiTimeIntervalRateUpdate; - std::vector<Int_t> fviTimeSecLastRateUpdate; //! [ Hodo ] - std::vector<std::vector<Double_t>> - fvdChanCountsSinceLastRateUpdate; //! [ Hodo ][ Chan ] - std::vector<std::vector<Double_t>> - fdHodoChanLastTimeForDist; //! [ Hodo ][ Chan ] + std::vector<Int_t> fviTimeSecLastRateUpdate; //! [ Hodo ] + std::vector<std::vector<Double_t>> fvdChanCountsSinceLastRateUpdate; //! [ Hodo ][ Chan ] + std::vector<std::vector<Double_t>> fdHodoChanLastTimeForDist; //! [ Hodo ][ Chan ] UInt_t fuPreviousHitAsic; std::vector<Double_t> fvdPreviousHitTimePerAsic; //! [ Asic ] @@ -285,12 +260,8 @@ private: TCanvas* fcHodoFullCoincPosEvo; TCanvas* fcHodoPrevHitDt; - void ProcessHitInfo(stsxyter::Message mess, - const UInt_t& uHodoIdx, - const UInt_t& uMsIdx); - void ProcessTsMsbInfo(stsxyter::Message mess, - UInt_t uMessIdx = 0, - UInt_t uMsIdx = 0); + void ProcessHitInfo(stsxyter::Message mess, const UInt_t& uHodoIdx, const UInt_t& uMsIdx); + void ProcessTsMsbInfo(stsxyter::Message mess, UInt_t uMessIdx = 0, UInt_t uMsIdx = 0); void ProcessEpochInfo(stsxyter::Message mess); void ProcessStatusInfo(stsxyter::Message mess); diff --git a/fles/cosy2019/monitor/CbmCosy2019MonitorTaskHodo.cxx b/fles/cosy2019/monitor/CbmCosy2019MonitorTaskHodo.cxx index df855220d4044f188a548ffe93379863ea2d5d35..d2cb0f0c2d65ecedfebcec5fa49ef0bfb11b777b 100644 --- a/fles/cosy2019/monitor/CbmCosy2019MonitorTaskHodo.cxx +++ b/fles/cosy2019/monitor/CbmCosy2019MonitorTaskHodo.cxx @@ -29,6 +29,7 @@ #include <fstream> #include <iomanip> #include <iostream> + #include <stdint.h> Bool_t bCosy2019MonitorTaskHodoResetHistos = kFALSE; @@ -40,15 +41,15 @@ CbmCosy2019MonitorTaskHodo::CbmCosy2019MonitorTaskHodo(UInt_t /*uNbGdpb*/) , fulTsCounter(0) , // fHodoDigiCloneArray(), - fMonitorAlgo(nullptr) { + fMonitorAlgo(nullptr) +{ fMonitorAlgo = new CbmCosy2019MonitorAlgoHodo(); } -CbmCosy2019MonitorTaskHodo::~CbmCosy2019MonitorTaskHodo() { - delete fMonitorAlgo; -} +CbmCosy2019MonitorTaskHodo::~CbmCosy2019MonitorTaskHodo() { delete fMonitorAlgo; } -Bool_t CbmCosy2019MonitorTaskHodo::Init() { +Bool_t CbmCosy2019MonitorTaskHodo::Init() +{ LOG(info) << "CbmCosy2019MonitorTaskHodo::Init"; LOG(info) << "Initializing mCBM Hodoscopes Monitor"; /* @@ -68,7 +69,8 @@ Bool_t CbmCosy2019MonitorTaskHodo::Init() { return kTRUE; } -void CbmCosy2019MonitorTaskHodo::SetParContainers() { +void CbmCosy2019MonitorTaskHodo::SetParContainers() +{ LOG(info) << "Setting parameter containers for " << GetName(); TList* parCList = fMonitorAlgo->GetParList(); @@ -78,12 +80,11 @@ void CbmCosy2019MonitorTaskHodo::SetParContainers() { parCList->Remove(tempObj); std::string sParamName {tempObj->GetName()}; - FairParGenericSet* newObj = dynamic_cast<FairParGenericSet*>( - FairRun::Instance()->GetRuntimeDb()->getContainer(sParamName.data())); + FairParGenericSet* newObj = + dynamic_cast<FairParGenericSet*>(FairRun::Instance()->GetRuntimeDb()->getContainer(sParamName.data())); if (nullptr == newObj) { - LOG(error) << "Failed to obtain parameter container " << sParamName - << ", for parameter index " << iparC; + LOG(error) << "Failed to obtain parameter container " << sParamName << ", for parameter index " << iparC; return; } // if( nullptr == newObj ) @@ -92,7 +93,8 @@ void CbmCosy2019MonitorTaskHodo::SetParContainers() { } // for( Int_t iparC = 0; iparC < parCList->GetEntries(); ++iparC ) } -Bool_t CbmCosy2019MonitorTaskHodo::InitContainers() { +Bool_t CbmCosy2019MonitorTaskHodo::InitContainers() +{ LOG(info) << "Init parameter containers for " << GetName(); /// Control flags @@ -120,28 +122,23 @@ Bool_t CbmCosy2019MonitorTaskHodo::InitContainers() { initOK &= fMonitorAlgo->CreateHistograms(); /// Obtain vector of pointers on each histo from the algo (+ optionally desired folder) - std::vector<std::pair<TNamed*, std::string>> vHistos = - fMonitorAlgo->GetHistoVector(); - std::vector<std::pair<TCanvas*, std::string>> vCanvas = - fMonitorAlgo->GetCanvasVector(); + std::vector<std::pair<TNamed*, std::string>> vHistos = fMonitorAlgo->GetHistoVector(); + std::vector<std::pair<TCanvas*, std::string>> vCanvas = fMonitorAlgo->GetCanvasVector(); /// Register the histos in the HTTP server THttpServer* server = FairRunOnline::Instance()->GetHttpServer(); if (nullptr != server) { for (UInt_t uHisto = 0; uHisto < vHistos.size(); ++uHisto) { if (nullptr != vHistos[uHisto].first) - server->Register(Form("/%s", vHistos[uHisto].second.data()), - vHistos[uHisto].first); + server->Register(Form("/%s", vHistos[uHisto].second.data()), vHistos[uHisto].first); } // for( UInt_t uHisto = 0; uHisto < vHistos.size(); ++uHisto ) for (UInt_t uCanvas = 0; uCanvas < vCanvas.size(); ++uCanvas) { if (nullptr != vCanvas[uCanvas].first) - server->Register(Form("/%s", vCanvas[uCanvas].second.data()), - vCanvas[uCanvas].first); + server->Register(Form("/%s", vCanvas[uCanvas].second.data()), vCanvas[uCanvas].first); } // for( UInt_t uHisto = 0; uHisto < vHistos.size(); ++uHisto ) - server->RegisterCommand("/Reset_MoniHodo_Hist", - "bCosy2019MonitorTaskHodoResetHistos=kTRUE"); + server->RegisterCommand("/Reset_MoniHodo_Hist", "bCosy2019MonitorTaskHodoResetHistos=kTRUE"); server->Restrict("/Reset_MoniHodo_Hist", "allow=admin"); } // if( nullptr != server ) @@ -150,20 +147,21 @@ Bool_t CbmCosy2019MonitorTaskHodo::InitContainers() { return initOK; } -Bool_t CbmCosy2019MonitorTaskHodo::ReInitContainers() { +Bool_t CbmCosy2019MonitorTaskHodo::ReInitContainers() +{ LOG(info) << "ReInit parameter containers for " << GetName(); Bool_t initOK = fMonitorAlgo->ReInitContainers(); return initOK; } -void CbmCosy2019MonitorTaskHodo::AddMsComponentToList(size_t component, - UShort_t usDetectorId) { +void CbmCosy2019MonitorTaskHodo::AddMsComponentToList(size_t component, UShort_t usDetectorId) +{ fMonitorAlgo->AddMsComponentToList(component, usDetectorId); } -Bool_t CbmCosy2019MonitorTaskHodo::DoUnpack(const fles::Timeslice& ts, - size_t /*component*/) { +Bool_t CbmCosy2019MonitorTaskHodo::DoUnpack(const fles::Timeslice& ts, size_t /*component*/) +{ if (fbMonitorMode && bCosy2019MonitorTaskHodoResetHistos) { LOG(info) << "Reset Hodoscopes monitor histos "; fMonitorAlgo->ResetHistograms(); @@ -171,8 +169,7 @@ Bool_t CbmCosy2019MonitorTaskHodo::DoUnpack(const fles::Timeslice& ts, } // if( fbMonitorMode && bCosy2019MonitorTaskHodoResetHistos ) if (kFALSE == fMonitorAlgo->ProcessTs(ts)) { - LOG(error) << "Failed processing TS " << ts.index() - << " in monitor algorithm class"; + LOG(error) << "Failed processing TS " << ts.index() << " in monitor algorithm class"; return kTRUE; } // if( kFALSE == fMonitorAlgo->ProcessTs( ts ) ) /* @@ -192,8 +189,7 @@ Bool_t CbmCosy2019MonitorTaskHodo::DoUnpack(const fles::Timeslice& ts, vDigi.clear(); fMonitorAlgo->ClearVector(); */ - if (0 == fulTsCounter % 10000) - LOG(info) << "Processed " << fulTsCounter << "TS"; + if (0 == fulTsCounter % 10000) LOG(info) << "Processed " << fulTsCounter << "TS"; fulTsCounter++; if (0 == fulTsCounter % 6000 && 0 < fulTsCounter) SaveHistograms(); @@ -201,23 +197,22 @@ Bool_t CbmCosy2019MonitorTaskHodo::DoUnpack(const fles::Timeslice& ts, return kTRUE; } -void CbmCosy2019MonitorTaskHodo::Reset() { +void CbmCosy2019MonitorTaskHodo::Reset() +{ // fHodoDigiCloneArray->Clear(); } -void CbmCosy2019MonitorTaskHodo::Finish() { +void CbmCosy2019MonitorTaskHodo::Finish() +{ /// If monitor mode enabled, trigger histos creation, obtain pointer on them and add them to the HTTP server - if (kTRUE == fbMonitorMode) { - SaveHistograms(); - } // if( kTRUE == fbMonitorMode ) + if (kTRUE == fbMonitorMode) { SaveHistograms(); } // if( kTRUE == fbMonitorMode ) } -Bool_t CbmCosy2019MonitorTaskHodo::SaveHistograms() { +Bool_t CbmCosy2019MonitorTaskHodo::SaveHistograms() +{ /// Obtain vector of pointers on each histo from the algo (+ optionally desired folder) - std::vector<std::pair<TNamed*, std::string>> vHistos = - fMonitorAlgo->GetHistoVector(); - std::vector<std::pair<TCanvas*, std::string>> vCanvas = - fMonitorAlgo->GetCanvasVector(); + std::vector<std::pair<TNamed*, std::string>> vHistos = fMonitorAlgo->GetHistoVector(); + std::vector<std::pair<TCanvas*, std::string>> vCanvas = fMonitorAlgo->GetCanvasVector(); /// Save old global file and folder pointer to avoid messing with FairRoot TFile* oldFile = gFile; @@ -266,30 +261,24 @@ Bool_t CbmCosy2019MonitorTaskHodo::SaveHistograms() { return kTRUE; } -void CbmCosy2019MonitorTaskHodo::SetIgnoreOverlapMs(Bool_t bFlagIn) { - fMonitorAlgo->SetIgnoreOverlapMs(bFlagIn); -} +void CbmCosy2019MonitorTaskHodo::SetIgnoreOverlapMs(Bool_t bFlagIn) { fMonitorAlgo->SetIgnoreOverlapMs(bFlagIn); } -void CbmCosy2019MonitorTaskHodo::SetTimeOffsetNs(Double_t dOffsetIn) { - fMonitorAlgo->SetTimeOffsetNs(dOffsetIn); -} -void CbmCosy2019MonitorTaskHodo::SetDpbId(UInt_t uDpbId) { - fMonitorAlgo->SetDpbId(uDpbId); -} -void CbmCosy2019MonitorTaskHodo::SetHodoElinkIdx(UInt_t uElinkHodoA, - UInt_t uElinkHodoB) { +void CbmCosy2019MonitorTaskHodo::SetTimeOffsetNs(Double_t dOffsetIn) { fMonitorAlgo->SetTimeOffsetNs(dOffsetIn); } +void CbmCosy2019MonitorTaskHodo::SetDpbId(UInt_t uDpbId) { fMonitorAlgo->SetDpbId(uDpbId); } +void CbmCosy2019MonitorTaskHodo::SetHodoElinkIdx(UInt_t uElinkHodoA, UInt_t uElinkHodoB) +{ fMonitorAlgo->SetHodoElinkIdx(uElinkHodoA, uElinkHodoB); } -void CbmCosy2019MonitorTaskHodo::SetHodoSwapXY(Bool_t bSwapHodoA, - Bool_t bSwapHodoB) { +void CbmCosy2019MonitorTaskHodo::SetHodoSwapXY(Bool_t bSwapHodoA, Bool_t bSwapHodoB) +{ fMonitorAlgo->SetHodoSwapXY(bSwapHodoA, bSwapHodoB); } -void CbmCosy2019MonitorTaskHodo::SetHodoInvertX(Bool_t bInvHodoA, - Bool_t bInvHodoB) { +void CbmCosy2019MonitorTaskHodo::SetHodoInvertX(Bool_t bInvHodoA, Bool_t bInvHodoB) +{ fMonitorAlgo->SetHodoInvertX(bInvHodoA, bInvHodoB); } -void CbmCosy2019MonitorTaskHodo::SetHodoInvertY(Bool_t bInvHodoA, - Bool_t bInvHodoB) { +void CbmCosy2019MonitorTaskHodo::SetHodoInvertY(Bool_t bInvHodoA, Bool_t bInvHodoB) +{ fMonitorAlgo->SetHodoInvertY(bInvHodoA, bInvHodoB); } diff --git a/fles/cosy2019/monitor/CbmCosy2019MonitorTaskHodo.h b/fles/cosy2019/monitor/CbmCosy2019MonitorTaskHodo.h index 02c4ca1e48840437fdcf94c83f3a4c045422dca8..cbc0695f31fb24eb73f7bde473823a003a68662b 100644 --- a/fles/cosy2019/monitor/CbmCosy2019MonitorTaskHodo.h +++ b/fles/cosy2019/monitor/CbmCosy2019MonitorTaskHodo.h @@ -8,10 +8,10 @@ #ifndef CbmCosy2019MonitorTaskHodo_H #define CbmCosy2019MonitorTaskHodo_H -#include "Timeslice.hpp" - #include "CbmMcbmUnpack.h" +#include "Timeslice.hpp" + class CbmCosy2019MonitorAlgoHodo; class CbmCosy2019MonitorTaskHodo : public CbmMcbmUnpack { @@ -19,8 +19,7 @@ public: CbmCosy2019MonitorTaskHodo(UInt_t uNbSdpb = 1); CbmCosy2019MonitorTaskHodo(const CbmCosy2019MonitorTaskHodo&) = delete; - CbmCosy2019MonitorTaskHodo - operator=(const CbmCosy2019MonitorTaskHodo&) = delete; + CbmCosy2019MonitorTaskHodo operator=(const CbmCosy2019MonitorTaskHodo&) = delete; virtual ~CbmCosy2019MonitorTaskHodo(); @@ -40,9 +39,7 @@ public: void AddMsComponentToList(size_t component, UShort_t usDetectorId); void SetNbMsInTs(size_t /*uCoreMsNb*/, size_t /*uOverlapMsNb*/) {}; - inline void SetMonitorMode(Bool_t bFlagIn = kTRUE) { - fbMonitorMode = bFlagIn; - } + inline void SetMonitorMode(Bool_t bFlagIn = kTRUE) { fbMonitorMode = bFlagIn; } void SetIgnoreOverlapMs(Bool_t bFlagIn = kTRUE); void SetDpbId(UInt_t uDpbId = 0x5b75); void SetHodoElinkIdx(UInt_t uElinkHodoA = 5, UInt_t uElinkHodoB = 10); @@ -57,12 +54,9 @@ public: 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 /// Statistics & first TS rejection uint64_t fulTsCounter; diff --git a/fles/cosy2019/parameter/CbmCosy2019ContFact.cxx b/fles/cosy2019/parameter/CbmCosy2019ContFact.cxx index 4c8376386655e19403f370f20cb6333c8de85857..01112696ee71e7a874ed42fc1925bcb84ebcaaff 100644 --- a/fles/cosy2019/parameter/CbmCosy2019ContFact.cxx +++ b/fles/cosy2019/parameter/CbmCosy2019ContFact.cxx @@ -16,7 +16,8 @@ ClassImp(CbmCosy2019ContFact) static CbmCosy2019ContFact gCbmCosy2019ContFact; -CbmCosy2019ContFact::CbmCosy2019ContFact() { +CbmCosy2019ContFact::CbmCosy2019ContFact() +{ // Constructor (called when the library is loaded) fName = "CbmCosy2019ContFact"; fTitle = "Factory for parameter containers for fles test library"; @@ -24,19 +25,19 @@ CbmCosy2019ContFact::CbmCosy2019ContFact() { FairRuntimeDb::instance()->addContFactory(this); } -void CbmCosy2019ContFact::setAllContainers() { +void CbmCosy2019ContFact::setAllContainers() +{ /** Creates the Container objects with all accepted contexts and adds them to * the list of containers for the fles test library.*/ FairContainer* pHodo = - new FairContainer("CbmCosy2019HodoPar", - "HODO at MCBM 2018 Unpack Parameters", - "TestDefaultContext"); + new FairContainer("CbmCosy2019HodoPar", "HODO at MCBM 2018 Unpack Parameters", "TestDefaultContext"); pHodo->addContext("TestNonDefaultContext"); containers->Add(pHodo); } -FairParSet* CbmCosy2019ContFact::createContainer(FairContainer* c) { +FairParSet* CbmCosy2019ContFact::createContainer(FairContainer* c) +{ /** Calls the constructor of the corresponding parameter container. * For an actual context, which is not an empty string and not the default context * of this container, the name is concatinated with the context. */ @@ -44,8 +45,7 @@ FairParSet* CbmCosy2019ContFact::createContainer(FairContainer* c) { FairParSet* p = 0; if (strcmp(name, "CbmCosy2019HodoPar") == 0) { - p = new CbmCosy2019HodoPar( - c->getConcatName().Data(), c->GetTitle(), c->getContext()); + p = new CbmCosy2019HodoPar(c->getConcatName().Data(), c->GetTitle(), c->getContext()); } return p; diff --git a/fles/cosy2019/parameter/CbmCosy2019HodoPar.cxx b/fles/cosy2019/parameter/CbmCosy2019HodoPar.cxx index 5e8ea922e5cf5f111227fcfbbc3960c60f049d22..542455249d480cf8addaf8f867bd8d19483fb7cc 100644 --- a/fles/cosy2019/parameter/CbmCosy2019HodoPar.cxx +++ b/fles/cosy2019/parameter/CbmCosy2019HodoPar.cxx @@ -16,9 +16,7 @@ using namespace std; // ----- Standard constructor ------------------------------------------ -CbmCosy2019HodoPar::CbmCosy2019HodoPar(const char* name, - const char* title, - const char* context) +CbmCosy2019HodoPar::CbmCosy2019HodoPar(const char* name, const char* title, const char* context) : FairParGenericSet(name, title, context) , fuNbModules(0) , fiModAddress() @@ -34,7 +32,8 @@ CbmCosy2019HodoPar::CbmCosy2019HodoPar(const char* name, , fdFebAdcGain() , fdFebAdcBase() , fdFebAdcThrGain() - , fiFebAdcThrOffs() { + , fiFebAdcThrOffs() +{ detName = "Hodo"; } // ------------------------------------------------------------------------- @@ -46,7 +45,8 @@ CbmCosy2019HodoPar::~CbmCosy2019HodoPar() {} // ----- Public method clear ------------------------------------------- -void CbmCosy2019HodoPar::clear() { +void CbmCosy2019HodoPar::clear() +{ status = kFALSE; resetInputVersions(); } @@ -54,7 +54,8 @@ void CbmCosy2019HodoPar::clear() { // ------------------------------------------------------------------------- -void CbmCosy2019HodoPar::putParams(FairParamList* l) { +void CbmCosy2019HodoPar::putParams(FairParamList* l) +{ if (!l) return; l->add("NbModules", fuNbModules); @@ -78,7 +79,8 @@ void CbmCosy2019HodoPar::putParams(FairParamList* l) { // ------------------------------------------------------------------------- -Bool_t CbmCosy2019HodoPar::getParams(FairParamList* l) { +Bool_t CbmCosy2019HodoPar::getParams(FairParamList* l) +{ if (!l) return kFALSE; @@ -119,50 +121,48 @@ Bool_t CbmCosy2019HodoPar::getParams(FairParamList* l) { return kTRUE; } // ------------------------------------------------------------------------- -Int_t CbmCosy2019HodoPar::ElinkIdxToFebIdx(UInt_t uElink) { +Int_t CbmCosy2019HodoPar::ElinkIdxToFebIdx(UInt_t uElink) +{ //LOG(info) <<" uElink "<<uElink<<" kuNbElinksPerCrob "<<kuNbElinksPerCrob; - if (uElink < kuNbElinksPerCrob) - return kiCrobMapElinkFebIdx[uElink]; + if (uElink < kuNbElinksPerCrob) return kiCrobMapElinkFebIdx[uElink]; else { - LOG(warning) - << "CbmCosy2019HodoPar::ElinkIdxToFebIdx => Index out of bound, " - << "returning crazy value!"; + LOG(warning) << "CbmCosy2019HodoPar::ElinkIdxToFebIdx => Index out of bound, " + << "returning crazy value!"; return -1; } // else of if( uElink < kuNbElinksPerCrob ) } // ------------------------------------------------------------------------- -UInt_t CbmCosy2019HodoPar::ElinkIdxToAsicIdxFebMuch(UInt_t uElink) { - if (uElink < kuNbElinksPerCrob) - return kuCrobMapElinkFebMuch[uElink]; +UInt_t CbmCosy2019HodoPar::ElinkIdxToAsicIdxFebMuch(UInt_t uElink) +{ + if (uElink < kuNbElinksPerCrob) return kuCrobMapElinkFebMuch[uElink]; else { - LOG(warning) - << "CbmCosy2019HodoPar::ElinkIdxToAsicIdxFebMuch => Index out of bound, " - << "returning crazy value!"; + LOG(warning) << "CbmCosy2019HodoPar::ElinkIdxToAsicIdxFebMuch => Index out of bound, " + << "returning crazy value!"; return 0xFFFF; } // else of if( uElink < kuNbElinksPerCrob ) } // ------------------------------------------------------------------------- -UInt_t CbmCosy2019HodoPar::ChannelToFiber(UInt_t uChan) { - if (uChan < kuNbChanPerAsic) - return kuChannelToFiberMap[uChan]; +UInt_t CbmCosy2019HodoPar::ChannelToFiber(UInt_t uChan) +{ + if (uChan < kuNbChanPerAsic) return kuChannelToFiberMap[uChan]; else { LOG(warning) << "CbmCosy2019HodoPar::ChannelToFiber => Index out of bound, " << "returning crazy value!"; return 0xFFFF; } // else of if( uChan < kuNbChanPerAsic ) } -UInt_t CbmCosy2019HodoPar::ChannelToPixel(UInt_t uChan) { - if (uChan < kuNbChanPerAsic) - return kuChannelToPixelMap[uChan]; +UInt_t CbmCosy2019HodoPar::ChannelToPixel(UInt_t uChan) +{ + if (uChan < kuNbChanPerAsic) return kuChannelToPixelMap[uChan]; else { LOG(warning) << "CbmCosy2019HodoPar::ChannelToPixel => Index out of bound, " << "returning crazy value!"; return 0xFFFF; } // else of if( uChan < kuNbChanPerAsic ) } -UInt_t CbmCosy2019HodoPar::ChannelToAxis(UInt_t uChan) { - if (uChan < kuNbChanPerAsic) - return kuChannelToPlaneMap[uChan]; +UInt_t CbmCosy2019HodoPar::ChannelToAxis(UInt_t uChan) +{ + if (uChan < kuNbChanPerAsic) return kuChannelToPlaneMap[uChan]; else { LOG(warning) << "CbmCosy2019HodoPar::ChannelToAxis => Index out of bound, " << "returning crazy value!"; @@ -170,337 +170,291 @@ UInt_t CbmCosy2019HodoPar::ChannelToAxis(UInt_t uChan) { } // else of if( uChan < kuNbChanPerAsic ) } // ------------------------------------------------------------------------- -Bool_t CbmCosy2019HodoPar::CheckModuleIndex(UInt_t uModuleIdx) { - if (uModuleIdx < fuNbModules) - return kTRUE; +Bool_t CbmCosy2019HodoPar::CheckModuleIndex(UInt_t uModuleIdx) +{ + if (uModuleIdx < fuNbModules) return kTRUE; else { - LOG(warning) - << "CbmCosy2019HodoPar::CheckModuleIndex => Index out of bound!"; + LOG(warning) << "CbmCosy2019HodoPar::CheckModuleIndex => Index out of bound!"; return kFALSE; } // else of if( uModuleIdx < fuNbModules ) } -UInt_t CbmCosy2019HodoPar::GetModuleAddress(UInt_t uModuleIdx) { - if (uModuleIdx < fuNbModules) - return fiModAddress[uModuleIdx]; +UInt_t CbmCosy2019HodoPar::GetModuleAddress(UInt_t uModuleIdx) +{ + if (uModuleIdx < fuNbModules) return fiModAddress[uModuleIdx]; else { - LOG(warning) - << "CbmCosy2019HodoPar::GetModuleAddress => Index out of bound, " - << "returning crazy value!"; + LOG(warning) << "CbmCosy2019HodoPar::GetModuleAddress => Index out of bound, " + << "returning crazy value!"; return 0xFFFFFFFF; } // else of if( uModuleIdx < fuNbModules ) } -Double_t CbmCosy2019HodoPar::GetModuleCenterPosX(UInt_t uModuleIdx) { - if (uModuleIdx < fuNbModules) - return fdModCenterPosX[uModuleIdx]; +Double_t CbmCosy2019HodoPar::GetModuleCenterPosX(UInt_t uModuleIdx) +{ + if (uModuleIdx < fuNbModules) return fdModCenterPosX[uModuleIdx]; else { - LOG(warning) - << "CbmCosy2019HodoPar::GetModuleCenterPosX => Index out of bound, " - << "returning crazy value!"; + LOG(warning) << "CbmCosy2019HodoPar::GetModuleCenterPosX => Index out of bound, " + << "returning crazy value!"; return 3.844e11; // Fly to the Moon! } // else of if( uModuleIdx < fuNbModules ) } -Double_t CbmCosy2019HodoPar::GetModuleCenterPosY(UInt_t uModuleIdx) { - if (uModuleIdx < fuNbModules) - return fdModCenterPosY[uModuleIdx]; +Double_t CbmCosy2019HodoPar::GetModuleCenterPosY(UInt_t uModuleIdx) +{ + if (uModuleIdx < fuNbModules) return fdModCenterPosY[uModuleIdx]; else { - LOG(warning) - << "CbmCosy2019HodoPar::GetModuleCenterPosY => Index out of bound, " - << "returning crazy value!"; + LOG(warning) << "CbmCosy2019HodoPar::GetModuleCenterPosY => Index out of bound, " + << "returning crazy value!"; return 3.844e11; // Fly to the Moon! } // else of if( uModuleIdx < fuNbModules ) } -Bool_t CbmCosy2019HodoPar::GetModuleSwapXY(UInt_t uModuleIdx) { - if (uModuleIdx < fuNbModules) - return fiModSwapXY[uModuleIdx]; +Bool_t CbmCosy2019HodoPar::GetModuleSwapXY(UInt_t uModuleIdx) +{ + if (uModuleIdx < fuNbModules) return fiModSwapXY[uModuleIdx]; else { - LOG(warning) - << "CbmCosy2019HodoPar::GetModuleSwapXY => Index out of bound, " - << "returning false!"; + LOG(warning) << "CbmCosy2019HodoPar::GetModuleSwapXY => Index out of bound, " + << "returning false!"; return kFALSE; // Fly to the Moon! } // else of if( uModuleIdx < fuNbModules ) } -Bool_t CbmCosy2019HodoPar::GetModuleInvertX(UInt_t uModuleIdx) { - if (uModuleIdx < fuNbModules) - return fiModInvertX[uModuleIdx]; +Bool_t CbmCosy2019HodoPar::GetModuleInvertX(UInt_t uModuleIdx) +{ + if (uModuleIdx < fuNbModules) return fiModInvertX[uModuleIdx]; else { - LOG(warning) - << "CbmCosy2019HodoPar::GetModuleInvertX => Index out of bound, " - << "returning false!"; + LOG(warning) << "CbmCosy2019HodoPar::GetModuleInvertX => Index out of bound, " + << "returning false!"; return kFALSE; // Fly to the Moon! } // else of if( uModuleIdx < fuNbModules ) } -Bool_t CbmCosy2019HodoPar::GetModuleInvertY(UInt_t uModuleIdx) { - if (uModuleIdx < fuNbModules) - return fiModInvertY[uModuleIdx]; +Bool_t CbmCosy2019HodoPar::GetModuleInvertY(UInt_t uModuleIdx) +{ + if (uModuleIdx < fuNbModules) return fiModInvertY[uModuleIdx]; else { - LOG(warning) - << "CbmCosy2019HodoPar::GetModuleInvertY => Index out of bound, " - << "returning false!"; + LOG(warning) << "CbmCosy2019HodoPar::GetModuleInvertY => Index out of bound, " + << "returning false!"; return kFALSE; // Fly to the Moon! } // else of if( uModuleIdx < fuNbModules ) } // ------------------------------------------------------------------------- -UInt_t CbmCosy2019HodoPar::GetDpbId(UInt_t uDpbIdx) { - if (uDpbIdx < fuNrOfDpbs) - return fiDbpIdArray[uDpbIdx]; +UInt_t CbmCosy2019HodoPar::GetDpbId(UInt_t uDpbIdx) +{ + if (uDpbIdx < fuNrOfDpbs) return fiDbpIdArray[uDpbIdx]; else { LOG(warning) << "CbmCosy2019HodoPar::GetDpbId => Index out of bound, " << "returning crazy value!"; return 0xFFFFFFFF; } // else of if( uDpbIdx < fuNrOfDpbs ) } -Bool_t CbmCosy2019HodoPar::IsCrobActive(UInt_t uDpbIdx, UInt_t uCrobIdx) { +Bool_t CbmCosy2019HodoPar::IsCrobActive(UInt_t uDpbIdx, UInt_t uCrobIdx) +{ if (uDpbIdx < fuNrOfDpbs) { - if (uCrobIdx < kuNbCrobsPerDpb) - return 0 < fiCrobActiveFlag[uDpbIdx * kuNbCrobsPerDpb + uCrobIdx] - ? kTRUE - : kFALSE; + if (uCrobIdx < kuNbCrobsPerDpb) return 0 < fiCrobActiveFlag[uDpbIdx * kuNbCrobsPerDpb + uCrobIdx] ? kTRUE : kFALSE; else { - LOG(warning) - << "CbmCosy2019HodoPar::IsCrobActive => Crob Index out of bound, " - << "returning default inactive!"; + LOG(warning) << "CbmCosy2019HodoPar::IsCrobActive => Crob Index out of bound, " + << "returning default inactive!"; return kFALSE; } // else of if( uCrobIdx < kuNbCrobsPerDpb ) } // if( uDpbIdx < fuNrOfDpbs ) else { - LOG(warning) - << "CbmCosy2019HodoPar::IsCrobActive => Dpb Index out of bound, " - << "returning default inactive!"; + LOG(warning) << "CbmCosy2019HodoPar::IsCrobActive => Dpb Index out of bound, " + << "returning default inactive!"; return kFALSE; } // else of if( uDpbIdx < fuNrOfDpbs ) } -Bool_t CbmCosy2019HodoPar::IsFebActive(UInt_t uFebInSystIdx) { +Bool_t CbmCosy2019HodoPar::IsFebActive(UInt_t uFebInSystIdx) +{ if (uFebInSystIdx < GetNrOfFebs()) { return (-1 == fiFebModuleIdx[uFebInSystIdx] ? kFALSE : kTRUE); } // if( uFebInSystIdx < GetNrOfFebs() ) else { - LOG(warning) - << "CbmCosy2019HodoPar::IsFebActive => Feb Index out of bound, " - << "returning default inactive!"; + LOG(warning) << "CbmCosy2019HodoPar::IsFebActive => Feb Index out of bound, " + << "returning default inactive!"; return kFALSE; } // else of if( uFebInSystIdx < GetNrOfFebs() ) } -Bool_t CbmCosy2019HodoPar::IsFebActive(UInt_t uDpbIdx, - UInt_t uCrobIdx, - UInt_t uFebIdx) { +Bool_t CbmCosy2019HodoPar::IsFebActive(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; + UInt_t uIdx = (uDpbIdx * kuNbCrobsPerDpb + uCrobIdx) * kuNbFebsPerCrob + uFebIdx; return IsFebActive(uIdx); } // if( uFebIdx < kuNbFebsPerCrob ) else { - LOG(warning) - << "CbmCosy2019HodoPar::IsFebActive => Feb Index out of bound, " - << "returning default inactive!"; + LOG(warning) << "CbmCosy2019HodoPar::IsFebActive => Feb Index out of bound, " + << "returning default inactive!"; return kFALSE; } // else of if( uFebIdx < kuNbCrobsPerDpb ) } // if( uCrobIdx < kuNbCrobsPerDpb ) else { - LOG(warning) - << "CbmCosy2019HodoPar::IsFebActive => Crob Index out of bound, " - << "returning default inactive!"; + LOG(warning) << "CbmCosy2019HodoPar::IsFebActive => Crob Index out of bound, " + << "returning default inactive!"; return kFALSE; } // else of if( uCrobIdx < kuNbCrobsPerDpb ) } // if( uDpbIdx < fuNrOfDpbs ) else { - LOG(warning) - << "CbmCosy2019HodoPar::IsFebActive => Dpb Index out of bound, " - << "returning default inactive!"; + LOG(warning) << "CbmCosy2019HodoPar::IsFebActive => Dpb Index out of bound, " + << "returning default inactive!"; return kFALSE; } // else of if( uDpbIdx < fuNrOfDpbs ) } -Int_t CbmCosy2019HodoPar::GetFebModuleIdx(UInt_t uDpbIdx, - UInt_t uCrobIdx, - UInt_t uFebIdx) { +Int_t CbmCosy2019HodoPar::GetFebModuleIdx(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; + UInt_t uIdx = (uDpbIdx * kuNbCrobsPerDpb + uCrobIdx) * kuNbFebsPerCrob + uFebIdx; return fiFebModuleIdx[uIdx]; } // if( uFebIdx < kuNbFebsPerCrob ) else { - LOG(warning) - << "CbmCosy2019HodoPar::GetFebModuleIdx => Feb Index out of bound, " - << "returning default inactive!"; + LOG(warning) << "CbmCosy2019HodoPar::GetFebModuleIdx => Feb Index out of bound, " + << "returning default inactive!"; return -1; } // else of if( uCrobIdx < kuNbCrobsPerDpb ) } // if( uCrobIdx < kuNbCrobsPerDpb ) else { - LOG(warning) - << "CbmCosy2019HodoPar::GetFebModuleIdx => Crob Index out of bound, " - << "returning default inactive!"; + LOG(warning) << "CbmCosy2019HodoPar::GetFebModuleIdx => Crob Index out of bound, " + << "returning default inactive!"; return -1; } // else of if( uCrobIdx < kuNbCrobsPerDpb ) } // if( uDpbIdx < fuNrOfDpbs ) else { - LOG(warning) - << "CbmCosy2019HodoPar::GetFebModuleIdx => Dpb Index out of bound, " - << "returning default inactive!"; + LOG(warning) << "CbmCosy2019HodoPar::GetFebModuleIdx => Dpb Index out of bound, " + << "returning default inactive!"; return -1; } // else of if( uDpbIdx < fuNrOfDpbs ) } -Double_t CbmCosy2019HodoPar::GetFebAdcGain(UInt_t uDpbIdx, - UInt_t uCrobIdx, - UInt_t uFebIdx) { +Double_t CbmCosy2019HodoPar::GetFebAdcGain(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; + UInt_t uIdx = (uDpbIdx * kuNbCrobsPerDpb + uCrobIdx) * kuNbFebsPerCrob + uFebIdx; return fdFebAdcGain[uIdx]; } // if( uFebIdx < kuNbFebsPerCrob ) else { - LOG(warning) - << "CbmCosy2019HodoPar::GetFebAdcGain => Feb Index out of bound, " - << "returning default value!"; + LOG(warning) << "CbmCosy2019HodoPar::GetFebAdcGain => Feb Index out of bound, " + << "returning default value!"; return 0.0; } // else of if( uCrobIdx < kuNbCrobsPerDpb ) } // if( uCrobIdx < kuNbCrobsPerDpb ) else { - LOG(warning) - << "CbmCosy2019HodoPar::GetFebAdcGain => Crob Index out of bound, " - << "returning default value!"; + LOG(warning) << "CbmCosy2019HodoPar::GetFebAdcGain => Crob Index out of bound, " + << "returning default value!"; return 0.0; } // else of if( uCrobIdx < kuNbCrobsPerDpb ) } // if( uDpbIdx < fuNrOfDpbs ) else { - LOG(warning) - << "CbmCosy2019HodoPar::GetFebAdcGain => Dpb Index out of bound, " - << "returning default value!"; + LOG(warning) << "CbmCosy2019HodoPar::GetFebAdcGain => Dpb Index out of bound, " + << "returning default value!"; return 0.0; } // else of if( uDpbIdx < fuNrOfDpbs ) } -Double_t CbmCosy2019HodoPar::GetFebAdcOffset(UInt_t uDpbIdx, - UInt_t uCrobIdx, - UInt_t uFebIdx) { +Double_t CbmCosy2019HodoPar::GetFebAdcOffset(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 (fdFebAdcBase[uIdx] - + fdFebAdcThrGain[uIdx] * fiFebAdcThrOffs[uIdx]); + UInt_t uIdx = (uDpbIdx * kuNbCrobsPerDpb + uCrobIdx) * kuNbFebsPerCrob + uFebIdx; + return (fdFebAdcBase[uIdx] + fdFebAdcThrGain[uIdx] * fiFebAdcThrOffs[uIdx]); } // if( uFebIdx < kuNbFebsPerCrob ) else { - LOG(warning) - << "CbmCosy2019HodoPar::GetFebAdcOffset => Feb Index out of bound, " - << "returning default value!"; + LOG(warning) << "CbmCosy2019HodoPar::GetFebAdcOffset => Feb Index out of bound, " + << "returning default value!"; return 0.0; } // else of if( uCrobIdx < kuNbCrobsPerDpb ) } // if( uCrobIdx < kuNbCrobsPerDpb ) else { - LOG(warning) - << "CbmCosy2019HodoPar::GetFebAdcOffset => Crob Index out of bound, " - << "returning default value!"; + LOG(warning) << "CbmCosy2019HodoPar::GetFebAdcOffset => Crob Index out of bound, " + << "returning default value!"; return 0.0; } // else of if( uCrobIdx < kuNbCrobsPerDpb ) } // if( uDpbIdx < fuNrOfDpbs ) else { - LOG(warning) - << "CbmCosy2019HodoPar::GetFebAdcOffset => Dpb Index out of bound, " - << "returning default value!"; + LOG(warning) << "CbmCosy2019HodoPar::GetFebAdcOffset => Dpb Index out of bound, " + << "returning default value!"; return 0.0; } // else of if( uDpbIdx < fuNrOfDpbs ) } -Double_t CbmCosy2019HodoPar::GetFebAdcBase(UInt_t uDpbIdx, - UInt_t uCrobIdx, - UInt_t uFebIdx) { +Double_t CbmCosy2019HodoPar::GetFebAdcBase(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; + UInt_t uIdx = (uDpbIdx * kuNbCrobsPerDpb + uCrobIdx) * kuNbFebsPerCrob + uFebIdx; return fdFebAdcBase[uIdx]; } // if( uFebIdx < kuNbFebsPerCrob ) else { - LOG(warning) - << "CbmCosy2019HodoPar::GetFebAdcBase => Feb Index out of bound, " - << "returning default value!"; + LOG(warning) << "CbmCosy2019HodoPar::GetFebAdcBase => Feb Index out of bound, " + << "returning default value!"; return 0.0; } // else of if( uCrobIdx < kuNbCrobsPerDpb ) } // if( uCrobIdx < kuNbCrobsPerDpb ) else { - LOG(warning) - << "CbmCosy2019HodoPar::GetFebAdcBase => Crob Index out of bound, " - << "returning default value!"; + LOG(warning) << "CbmCosy2019HodoPar::GetFebAdcBase => Crob Index out of bound, " + << "returning default value!"; return 0.0; } // else of if( uCrobIdx < kuNbCrobsPerDpb ) } // if( uDpbIdx < fuNrOfDpbs ) else { - LOG(warning) - << "CbmCosy2019HodoPar::GetFebAdcBase => Dpb Index out of bound, " - << "returning default value!"; + LOG(warning) << "CbmCosy2019HodoPar::GetFebAdcBase => Dpb Index out of bound, " + << "returning default value!"; return 0.0; } // else of if( uDpbIdx < fuNrOfDpbs ) } -Double_t CbmCosy2019HodoPar::GetFebAdcThrGain(UInt_t uDpbIdx, - UInt_t uCrobIdx, - UInt_t uFebIdx) { +Double_t CbmCosy2019HodoPar::GetFebAdcThrGain(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; + UInt_t uIdx = (uDpbIdx * kuNbCrobsPerDpb + uCrobIdx) * kuNbFebsPerCrob + uFebIdx; return fdFebAdcThrGain[uIdx]; } // if( uFebIdx < kuNbFebsPerCrob ) else { - LOG(warning) - << "CbmCosy2019HodoPar::GetFebAdcThrGain => Feb Index out of bound, " - << "returning default value!"; + LOG(warning) << "CbmCosy2019HodoPar::GetFebAdcThrGain => Feb Index out of bound, " + << "returning default value!"; return 0.0; } // else of if( uCrobIdx < kuNbCrobsPerDpb ) } // if( uCrobIdx < kuNbCrobsPerDpb ) else { - LOG(warning) - << "CbmCosy2019HodoPar::GetFebAdcThrGain => Crob Index out of bound, " - << "returning default value!"; + LOG(warning) << "CbmCosy2019HodoPar::GetFebAdcThrGain => Crob Index out of bound, " + << "returning default value!"; return 0.0; } // else of if( uCrobIdx < kuNbCrobsPerDpb ) } // if( uDpbIdx < fuNrOfDpbs ) else { - LOG(warning) - << "CbmCosy2019HodoPar::GetFebAdcThrGain => Dpb Index out of bound, " - << "returning default value!"; + LOG(warning) << "CbmCosy2019HodoPar::GetFebAdcThrGain => Dpb Index out of bound, " + << "returning default value!"; return 0.0; } // else of if( uDpbIdx < fuNrOfDpbs ) } -Int_t CbmCosy2019HodoPar::GetFebAdcThrOffs(UInt_t uDpbIdx, - UInt_t uCrobIdx, - UInt_t uFebIdx) { +Int_t CbmCosy2019HodoPar::GetFebAdcThrOffs(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; + UInt_t uIdx = (uDpbIdx * kuNbCrobsPerDpb + uCrobIdx) * kuNbFebsPerCrob + uFebIdx; return fiFebAdcThrOffs[uIdx]; } // if( uFebIdx < kuNbFebsPerCrob ) else { - LOG(warning) - << "CbmCosy2019HodoPar::GetFebAdcThrOffs => Feb Index out of bound, " - << "returning default value!"; + LOG(warning) << "CbmCosy2019HodoPar::GetFebAdcThrOffs => Feb Index out of bound, " + << "returning default value!"; return 0; } // else of if( uCrobIdx < kuNbCrobsPerDpb ) } // if( uCrobIdx < kuNbCrobsPerDpb ) else { - LOG(warning) - << "CbmCosy2019HodoPar::GetFebAdcThrOffs => Crob Index out of bound, " - << "returning default value!"; + LOG(warning) << "CbmCosy2019HodoPar::GetFebAdcThrOffs => Crob Index out of bound, " + << "returning default value!"; return 0; } // else of if( uCrobIdx < kuNbCrobsPerDpb ) } // if( uDpbIdx < fuNrOfDpbs ) else { - LOG(warning) - << "CbmCosy2019HodoPar::GetFebAdcThrOffs => Dpb Index out of bound, " - << "returning default value!"; + LOG(warning) << "CbmCosy2019HodoPar::GetFebAdcThrOffs => Dpb Index out of bound, " + << "returning default value!"; return 0; } // else of if( uDpbIdx < fuNrOfDpbs ) } // ------------------------------------------------------------------------- -UInt_t CbmCosy2019HodoPar::GetChannelInModule(UInt_t uModuleIdx, UInt_t uChan) { +UInt_t CbmCosy2019HodoPar::GetChannelInModule(UInt_t uModuleIdx, UInt_t uChan) +{ if (uModuleIdx < fuNbModules || uChan < kuNbChanPerAsic) { UInt_t uAxis = ChannelToAxis(uChan); UInt_t uChanInAxis = ChannelToFiber(uChan); @@ -511,16 +465,13 @@ UInt_t CbmCosy2019HodoPar::GetChannelInModule(UInt_t uModuleIdx, UInt_t uChan) { } // if( uAxis ? GetModuleInvertY( uModuleIdx ) : GetModuleInvertX( uModuleIdx ) ) /// Check for axis swap - if (GetModuleSwapXY(uModuleIdx)) { - uAxis = !uAxis; - } // if( GetModuleSwapXY( uModuleIdx ) ) + if (GetModuleSwapXY(uModuleIdx)) { uAxis = !uAxis; } // if( GetModuleSwapXY( uModuleIdx ) ) return uChanInAxis + uAxis * kuNbFiberPerAxis; } // if( uModuleIdx < fuNbModules || uChan < kuNbChanPerAsic ) else { - LOG(warning) - << "CbmCosy2019HodoPar::GetChannelInModule => Index out of bound, " - << "returning crazy value!"; + LOG(warning) << "CbmCosy2019HodoPar::GetChannelInModule => Index out of bound, " + << "returning crazy value!"; return 0xFFFF; } // else of if( uModuleIdx < fuNbModules || uChan < kuNbChanPerAsic ) } diff --git a/fles/cosy2019/parameter/CbmCosy2019HodoPar.h b/fles/cosy2019/parameter/CbmCosy2019HodoPar.h index 58e68ec14fcf54b1a5e93fd7581a70779923761f..6cf82f53d33f7826ee6c6593fe7773a697b1587c 100644 --- a/fles/cosy2019/parameter/CbmCosy2019HodoPar.h +++ b/fles/cosy2019/parameter/CbmCosy2019HodoPar.h @@ -19,8 +19,7 @@ class CbmCosy2019HodoPar : public FairParGenericSet { public: /** Standard constructor **/ - CbmCosy2019HodoPar(const char* name = "CbmCosy2019HodoPar", - const char* title = "Much parameters", + CbmCosy2019HodoPar(const char* name = "CbmCosy2019HodoPar", const char* title = "Much parameters", const char* context = "Default"); @@ -36,25 +35,15 @@ public: static constexpr UInt_t GetNbCrobsPerDpb() { return kuNbCrobsPerDpb; } static constexpr UInt_t GetNbElinkPerCrob() { return kuNbElinksPerCrob; } static constexpr UInt_t GetNbFebsPerCrob() { return kuNbFebsPerCrob; } - static constexpr UInt_t GetNbFebsPerDpb() { - return kuNbCrobsPerDpb * kuNbFebsPerCrob; - } + static constexpr UInt_t GetNbFebsPerDpb() { return kuNbCrobsPerDpb * kuNbFebsPerCrob; } static constexpr UInt_t GetNbAsicsPerFeb() { return kuNbAsicsPerFeb; } - static constexpr UInt_t GetNbAsicsPerCrob() { - return kuNbFebsPerCrob * kuNbAsicsPerFeb; - } - static constexpr UInt_t GetNbAsicsPerDpb() { - return kuNbCrobsPerDpb * GetNbAsicsPerCrob(); - } + static constexpr UInt_t GetNbAsicsPerCrob() { return kuNbFebsPerCrob * kuNbAsicsPerFeb; } + static constexpr UInt_t GetNbAsicsPerDpb() { return kuNbCrobsPerDpb * GetNbAsicsPerCrob(); } static constexpr UInt_t GetNbChanPerAsic() { return kuNbChanPerAsic; } - static constexpr UInt_t GetNbChanPerFeb() { - return kuNbAsicsPerFeb * kuNbChanPerAsic; - } + static constexpr UInt_t GetNbChanPerFeb() { return kuNbAsicsPerFeb * kuNbChanPerAsic; } Int_t ElinkIdxToFebIdx(UInt_t uElink); - UInt_t ElinkIdxToAsicIdx(UInt_t uElink) { - return ElinkIdxToAsicIdxFebMuch(uElink); - } + UInt_t ElinkIdxToAsicIdx(UInt_t uElink) { return ElinkIdxToAsicIdxFebMuch(uElink); } UInt_t ElinkIdxToAsicIdxFebMuch(UInt_t uElink); @@ -91,35 +80,26 @@ public: private: /// Constants - static const UInt_t kuNbCrobsPerDpb = 1; // Number of CROBs possible per DPB - static const UInt_t kuNbElinksPerCrob = - 42; // Number of elinks in each CROB ? - static const UInt_t kuNbFebsPerCrob = - 6; // Number of FEBs connected to each CROB for mMuch 2019 - static const UInt_t kuNbAsicsPerFeb = - 1; // Number of ASICs connected in each FEB for MUCH - static const UInt_t kuNbChanPerAsic = 128; // Number of channels in each ASIC - static const UInt_t kuNbFiberPerAxis = 64; // Number of Fibers per Hodo axis - const UInt_t - kuCrobMapElinkFebMuch - [kuNbElinksPerCrob] = - { - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0001, 0x0001, - 0x0001, 0x0001, 0x0002, 0x0002, 0x0002, 0x0002, 0x0003, 0x0003, - 0x0003, 0x0003, 0x0003, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, - 0x0005, 0x0005, 0x0005, 0x0005, 0x0003, 0x0003, 0x0003, 0x0003, - 0x0003, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0005, 0x0005, - 0x0005, 0x0005}; //! Map from eLink index to ASIC index within CROB ( 0 to kuNbFebsPerCrob * kuNbAsicPerFeb ) + static const UInt_t kuNbCrobsPerDpb = 1; // Number of CROBs possible per DPB + static const UInt_t kuNbElinksPerCrob = 42; // Number of elinks in each CROB ? + static const UInt_t kuNbFebsPerCrob = 6; // Number of FEBs connected to each CROB for mMuch 2019 + static const UInt_t kuNbAsicsPerFeb = 1; // Number of ASICs connected in each FEB for MUCH + static const UInt_t kuNbChanPerAsic = 128; // Number of channels in each ASIC + static const UInt_t kuNbFiberPerAxis = 64; // Number of Fibers per Hodo axis + const UInt_t kuCrobMapElinkFebMuch[kuNbElinksPerCrob] = {0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0002, 0x0002, 0x0002, 0x0002, 0x0003, + 0x0003, 0x0003, 0x0003, 0x0003, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0005, + 0x0005, 0x0005, 0x0005, 0x0003, 0x0003, + 0x0003, 0x0003, 0x0003, 0x0004, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0005, 0x0005, + 0x0005, 0x0005}; //! Map from eLink index to ASIC index within CROB ( 0 to kuNbFebsPerCrob * kuNbAsicPerFeb ) // static constexpr UInt_t kuCrobMapElinkFebIdx[ kuNbElinksPerCrob ] = { - const Int_t kiCrobMapElinkFebIdx[kuNbElinksPerCrob] = {0, 0, 0, 0, 0, 1, 1, 1, - 1, 1, 2, 2, 2, 2, 3, 3, - 3, 3, 3, 4, 4, 4, 4, 4, - 5, 5, 5, 5, 6, 6, 6, 6, - 6, 7, 7, 7, 7, 7, 8, 8, - 8, 8}; //! Map from eLink index to ASIC index within CROB ( 0 to kuNbFebsPerCrob * kuNbAsicPerFeb ) - const UInt_t kuChannelToFiberMap[kuNbChanPerAsic] = - { - /* + const Int_t kiCrobMapElinkFebIdx[kuNbElinksPerCrob] = { + 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, + 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 8, 8, 8, 8}; //! Map from eLink index to ASIC index within CROB ( 0 to kuNbFebsPerCrob * kuNbAsicPerFeb ) + const UInt_t kuChannelToFiberMap[kuNbChanPerAsic] = {/* 0, 32, 16, 48, 15, 47, 31, 63, 1, 33, 17, 49, 14, 46, 30, 62, 2, 34, 18, 50, 13, 45, 29, 61, 3, 35, 19, 51, 12, 44, 28, 60, 4, 36, 20, 52, 11, 43, 27, 59, 5, 37, 21, 53, 10, 42, 26, 58, @@ -129,61 +109,47 @@ private: 4, 36, 20, 52, 11, 43, 27, 59, 5, 37, 21, 53, 10, 42, 26, 58, 6, 38, 22, 54, 9, 41, 25, 57, 7, 39, 23, 55, 8, 40, 24, 56 */ - 32, 0, 48, 16, 47, 15, 63, 31, 33, 1, 49, 17, 46, 14, 62, 30, 34, - 2, 50, 18, 45, 13, 61, 29, 35, 3, 51, 19, 44, 12, 60, 28, 36, 4, - 52, 20, 43, 11, 59, 27, 37, 5, 53, 21, 42, 10, 58, 26, 38, 6, 54, - 22, 41, 9, 57, 25, 39, 7, 55, 23, 40, 8, 56, 24, 32, 0, 48, 16, - 47, 15, 63, 31, 33, 1, 49, 17, 46, 14, 62, 30, 34, 2, 50, 18, 45, - 13, 61, 29, 35, 3, 51, 19, 44, 12, 60, 28, 36, 4, 52, 20, 43, 11, - 59, 27, 37, 5, 53, 21, 42, 10, 58, 26, 38, 6, 54, 22, 41, 9, 57, - 25, 39, 7, 55, 23, 40, 8, 56, 24}; //! Map from channel index to Hodoscope Fiber - const UInt_t kuChannelToPixelMap[kuNbChanPerAsic] = - { - 1, 5, 3, 7, 2, 6, 4, 8, 9, 13, 11, 15, 10, 14, 12, 16, 17, - 21, 19, 23, 18, 22, 20, 24, 25, 29, 27, 31, 26, 30, 28, 32, 33, 37, - 35, 39, 34, 38, 36, 40, 41, 45, 43, 47, 42, 46, 44, 48, 49, 53, 51, - 55, 50, 54, 52, 56, 57, 61, 59, 63, 58, 62, 60, 64, 1, 5, 3, 7, - 2, 6, 4, 8, 9, 13, 11, 15, 10, 14, 12, 16, 17, 21, 19, 23, 18, - 22, 20, 24, 25, 29, 27, 31, 26, 30, 28, 32, 33, 37, 35, 39, 34, 38, - 36, 40, 41, 45, 43, 47, 42, 46, 44, 48, 49, 53, 51, 55, 50, 54, 52, - 56, 57, 61, 59, 63, 58, 62, 60, 64}; //! Map from channel index to PMT pixel - const UInt_t kuChannelToPlaneMap - [kuNbChanPerAsic] = {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, 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, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1}; //! Map from channel index to Hodoscope Axis (X or Y) + 32, 0, 48, 16, 47, 15, 63, 31, 33, 1, 49, 17, 46, 14, 62, + 30, 34, 2, 50, 18, 45, 13, 61, 29, 35, 3, 51, 19, 44, 12, + 60, 28, 36, 4, 52, 20, 43, 11, 59, 27, 37, 5, 53, 21, 42, + 10, 58, 26, 38, 6, 54, 22, 41, 9, 57, 25, 39, 7, 55, 23, + 40, 8, 56, 24, 32, 0, 48, 16, 47, 15, 63, 31, 33, 1, 49, + 17, 46, 14, 62, 30, 34, 2, 50, 18, 45, 13, 61, 29, 35, 3, + 51, 19, 44, 12, 60, 28, 36, 4, 52, 20, 43, 11, 59, 27, 37, + 5, 53, 21, 42, 10, 58, 26, 38, 6, 54, 22, 41, 9, 57, 25, + 39, 7, 55, 23, 40, 8, 56, 24}; //! Map from channel index to Hodoscope Fiber + const UInt_t kuChannelToPixelMap[kuNbChanPerAsic] = {1, 5, 3, 7, 2, 6, 4, 8, 9, 13, 11, 15, 10, 14, 12, + 16, 17, 21, 19, 23, 18, 22, 20, 24, 25, 29, 27, 31, 26, 30, + 28, 32, 33, 37, 35, 39, 34, 38, 36, 40, 41, 45, 43, 47, 42, + 46, 44, 48, 49, 53, 51, 55, 50, 54, 52, 56, 57, 61, 59, 63, + 58, 62, 60, 64, 1, 5, 3, 7, 2, 6, 4, 8, 9, 13, 11, + 15, 10, 14, 12, 16, 17, 21, 19, 23, 18, 22, 20, 24, 25, 29, + 27, 31, 26, 30, 28, 32, 33, 37, 35, 39, 34, 38, 36, 40, 41, + 45, 43, 47, 42, 46, 44, 48, 49, 53, 51, 55, 50, 54, 52, 56, + 57, 61, 59, 63, 58, 62, 60, 64}; //! Map from channel index to PMT pixel + const UInt_t kuChannelToPlaneMap[kuNbChanPerAsic] = { + 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, 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, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; //! Map from channel index to Hodoscope Axis (X or Y) /// Variables - UInt_t fuNbModules; // Total number of STS modules in the setup - TArrayI fiModAddress; // STS address for the first strip of each module - TArrayD - fdModCenterPosX; // Offset of module center in X, in mm (Should be done by geometry for the unpacker!) - TArrayD - fdModCenterPosY; // Offset of module center in Y, in mm (Should be done by geometry for the unpacker!) - TArrayI - fiModSwapXY; // Flag telling for each module if the X and Y axis should be swapped - TArrayI - fiModInvertX; // Flag telling for each module if the X axis should be inverted - TArrayI - fiModInvertY; // Flag telling for each module if the Y axis should be inverted - - 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 ] + UInt_t fuNbModules; // Total number of STS modules in the setup + TArrayI fiModAddress; // STS address for the first strip of each module + TArrayD fdModCenterPosX; // Offset of module center in X, in mm (Should be done by geometry for the unpacker!) + TArrayD fdModCenterPosY; // Offset of module center in Y, in mm (Should be done by geometry for the unpacker!) + TArrayI fiModSwapXY; // Flag telling for each module if the X and Y axis should be swapped + TArrayI fiModInvertX; // Flag telling for each module if the X axis should be inverted + TArrayI fiModInvertY; // Flag telling for each module if the Y axis should be inverted + + 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 fiFebModuleIdx; // Index of the STS module for each FEB, [ NbDpb * kuNbCrobPerDpb * kuNbFebsPerCrob ], -1 if inactive - TArrayD - fdFebAdcGain; // ADC Gain in e-/ADC bin for each FEB, [ NbDpb * kuNbCrobPerDpb * kuNbFebsPerCrob ] - TArrayD - fdFebAdcBase; // Base at Cal. Thr. in e- for each FEB, [ NbDpb * kuNbCrobPerDpb * kuNbFebsPerCrob ] - TArrayD - fdFebAdcThrGain; // Thr. step in e-/Thr. Unit for each FEB, [ NbDpb * kuNbCrobPerDpb * kuNbFebsPerCrob ] + TArrayD fdFebAdcGain; // ADC Gain in e-/ADC bin for each FEB, [ NbDpb * kuNbCrobPerDpb * kuNbFebsPerCrob ] + TArrayD fdFebAdcBase; // Base at Cal. Thr. in e- for each FEB, [ NbDpb * kuNbCrobPerDpb * kuNbFebsPerCrob ] + TArrayD fdFebAdcThrGain; // Thr. step in e-/Thr. Unit for each FEB, [ NbDpb * kuNbCrobPerDpb * kuNbFebsPerCrob ] TArrayI fiFebAdcThrOffs; // Thr. offset in Units vs Cal. Thr. for each FEB, [ NbDpb * kuNbCrobPerDpb * kuNbFebsPerCrob ] diff --git a/fles/cosy2019/unpacker/CbmCosy2019UnpackerAlgoHodo.cxx b/fles/cosy2019/unpacker/CbmCosy2019UnpackerAlgoHodo.cxx index 65a53cf711754588befbb9804d5fc26fb0eeb4cb..818888b0c447175ef313224d0b11fee7045c056c 100644 --- a/fles/cosy2019/unpacker/CbmCosy2019UnpackerAlgoHodo.cxx +++ b/fles/cosy2019/unpacker/CbmCosy2019UnpackerAlgoHodo.cxx @@ -23,6 +23,7 @@ #include <fstream> #include <iomanip> #include <iostream> + #include <stdint.h> // ------------------------------------------------------------------------- @@ -72,8 +73,10 @@ CbmCosy2019UnpackerAlgoHodo::CbmCosy2019UnpackerAlgoHodo() fhEventNbPerTs( nullptr ), fcTimeToTrigRaw( nullptr ) */ -{} -CbmCosy2019UnpackerAlgoHodo::~CbmCosy2019UnpackerAlgoHodo() { +{ +} +CbmCosy2019UnpackerAlgoHodo::~CbmCosy2019UnpackerAlgoHodo() +{ /// Clear buffers fvmHitsInMs.clear(); /* @@ -85,53 +88,58 @@ CbmCosy2019UnpackerAlgoHodo::~CbmCosy2019UnpackerAlgoHodo() { } // ------------------------------------------------------------------------- -Bool_t CbmCosy2019UnpackerAlgoHodo::Init() { +Bool_t CbmCosy2019UnpackerAlgoHodo::Init() +{ LOG(info) << "Initializing mCBM STS 2019 unpacker algo"; return kTRUE; } void CbmCosy2019UnpackerAlgoHodo::Reset() {} -void CbmCosy2019UnpackerAlgoHodo::Finish() { +void CbmCosy2019UnpackerAlgoHodo::Finish() +{ /// Printout Goodbye message and stats /// Write Output histos } // ------------------------------------------------------------------------- -Bool_t CbmCosy2019UnpackerAlgoHodo::InitContainers() { +Bool_t CbmCosy2019UnpackerAlgoHodo::InitContainers() +{ LOG(info) << "Init parameter containers for CbmCosy2019UnpackerAlgoHodo"; Bool_t initOK = ReInitContainers(); return initOK; } -Bool_t CbmCosy2019UnpackerAlgoHodo::ReInitContainers() { +Bool_t CbmCosy2019UnpackerAlgoHodo::ReInitContainers() +{ LOG(info) << "**********************************************"; LOG(info) << "ReInit parameter containers for CbmCosy2019UnpackerAlgoHodo"; - fUnpackPar = - (CbmCosy2019HodoPar*) fParCList->FindObject("CbmCosy2019HodoPar"); + fUnpackPar = (CbmCosy2019HodoPar*) fParCList->FindObject("CbmCosy2019HodoPar"); if (nullptr == fUnpackPar) return kFALSE; Bool_t initOK = InitParameters(); return initOK; } -TList* CbmCosy2019UnpackerAlgoHodo::GetParList() { +TList* CbmCosy2019UnpackerAlgoHodo::GetParList() +{ if (nullptr == fParCList) fParCList = new TList(); fUnpackPar = new CbmCosy2019HodoPar("CbmCosy2019HodoPar"); fParCList->Add(fUnpackPar); return fParCList; } -Bool_t CbmCosy2019UnpackerAlgoHodo::InitParameters() { +Bool_t CbmCosy2019UnpackerAlgoHodo::InitParameters() +{ fuNbModules = fUnpackPar->GetNbOfModules(); LOG(info) << "Nr. of STS Modules: " << fuNbModules; fviModAddress.resize(fuNbModules); for (UInt_t uModIdx = 0; uModIdx < fuNbModules; ++uModIdx) { fviModAddress[uModIdx] = fUnpackPar->GetModuleAddress(uModIdx); - LOG(info) << "Module #" << std::setw(2) << uModIdx << " Address 0x" - << std::setw(8) << std::hex << fviModAddress[uModIdx] << std::dec; + LOG(info) << "Module #" << std::setw(2) << uModIdx << " Address 0x" << std::setw(8) << std::hex + << fviModAddress[uModIdx] << std::dec; } // for( UInt_t uModIdx = 0; uModIdx < fuNbModules; ++uModIdx) fuNrOfDpbs = fUnpackPar->GetNrOfDpbs(); @@ -140,10 +148,8 @@ Bool_t CbmCosy2019UnpackerAlgoHodo::InitParameters() { fDpbIdIndexMap.clear(); for (UInt_t uDpb = 0; uDpb < fuNrOfDpbs; ++uDpb) { fDpbIdIndexMap[fUnpackPar->GetDpbId(uDpb)] = uDpb; - LOG(info) << "Eq. ID for DPB #" << std::setw(2) << uDpb << " = 0x" - << std::setw(4) << std::hex << fUnpackPar->GetDpbId(uDpb) - << std::dec << " => " - << fDpbIdIndexMap[fUnpackPar->GetDpbId(uDpb)]; + LOG(info) << "Eq. ID for DPB #" << std::setw(2) << uDpb << " = 0x" << std::setw(4) << std::hex + << fUnpackPar->GetDpbId(uDpb) << std::dec << " => " << fDpbIdIndexMap[fUnpackPar->GetDpbId(uDpb)]; } // for( UInt_t uDpb = 0; uDpb < fuNrOfDpbs; ++uDpb ) fuNbFebs = fUnpackPar->GetNrOfFebs(); @@ -165,26 +171,19 @@ Bool_t CbmCosy2019UnpackerAlgoHodo::InitParameters() { fviFebModuleIdx[uDpb].resize(fUnpackPar->GetNbCrobsPerDpb()); fvdFebAdcGain[uDpb].resize(fUnpackPar->GetNbCrobsPerDpb()); fvdFebAdcOffs[uDpb].resize(fUnpackPar->GetNbCrobsPerDpb()); - for (UInt_t uCrobIdx = 0; uCrobIdx < fUnpackPar->GetNbCrobsPerDpb(); - ++uCrobIdx) { - fvbCrobActiveFlag[uDpb][uCrobIdx] = - fUnpackPar->IsCrobActive(uDpb, uCrobIdx); + for (UInt_t uCrobIdx = 0; uCrobIdx < fUnpackPar->GetNbCrobsPerDpb(); ++uCrobIdx) { + fvbCrobActiveFlag[uDpb][uCrobIdx] = fUnpackPar->IsCrobActive(uDpb, uCrobIdx); fviFebModuleIdx[uDpb][uCrobIdx].resize(fUnpackPar->GetNbFebsPerCrob()); fvdFebAdcGain[uDpb][uCrobIdx].resize(fUnpackPar->GetNbFebsPerCrob(), 0.0); fvdFebAdcOffs[uDpb][uCrobIdx].resize(fUnpackPar->GetNbFebsPerCrob(), 0.0); - for (UInt_t uFebIdx = 0; uFebIdx < fUnpackPar->GetNbFebsPerCrob(); - ++uFebIdx) { - fviFebModuleIdx[uDpb][uCrobIdx][uFebIdx] = - fUnpackPar->GetFebModuleIdx(uDpb, uCrobIdx, uFebIdx); - fvdFebAdcGain[uDpb][uCrobIdx][uFebIdx] = - fUnpackPar->GetFebAdcGain(uDpb, uCrobIdx, uFebIdx); - fvdFebAdcOffs[uDpb][uCrobIdx][uFebIdx] = - fUnpackPar->GetFebAdcOffset(uDpb, uCrobIdx, uFebIdx); + for (UInt_t uFebIdx = 0; uFebIdx < fUnpackPar->GetNbFebsPerCrob(); ++uFebIdx) { + fviFebModuleIdx[uDpb][uCrobIdx][uFebIdx] = fUnpackPar->GetFebModuleIdx(uDpb, uCrobIdx, uFebIdx); + fvdFebAdcGain[uDpb][uCrobIdx][uFebIdx] = fUnpackPar->GetFebAdcGain(uDpb, uCrobIdx, uFebIdx); + fvdFebAdcOffs[uDpb][uCrobIdx][uFebIdx] = fUnpackPar->GetFebAdcOffset(uDpb, uCrobIdx, uFebIdx); if (0 <= fviFebModuleIdx[uDpb][uCrobIdx][uFebIdx] - && static_cast<UInt_t>(fviFebModuleIdx[uDpb][uCrobIdx][uFebIdx]) - < fuNbModules) { + && static_cast<UInt_t>(fviFebModuleIdx[uDpb][uCrobIdx][uFebIdx]) < fuNbModules) { ///! FIXME: 1) Geometry is using front/back while we are using P/N !!!! ///! => Assuming that front facing modules have connectors on right side @@ -192,8 +191,7 @@ Bool_t CbmCosy2019UnpackerAlgoHodo::InitParameters() { ///! 2) No accessor/setter to change only the side field of an STS address ///! => hardcode the shift ///! +> The big is unused in the current scheme: the side is encoded in the Digi channel - fviFebAddress.push_back( - fviModAddress[fviFebModuleIdx[uDpb][uCrobIdx][uFebIdx]]); + fviFebAddress.push_back(fviModAddress[fviFebModuleIdx[uDpb][uCrobIdx][uFebIdx]]); fviFebModule.push_back(fviFebModuleIdx[uDpb][uCrobIdx][uFebIdx]); } // FEB active and module index OK else if (-1 == fviFebModuleIdx[uDpb][uCrobIdx][uFebIdx]) { @@ -201,47 +199,36 @@ Bool_t CbmCosy2019UnpackerAlgoHodo::InitParameters() { fviFebModule.push_back(-1); } // Module index or type is set to inactive else { - LOG(fatal) << Form( - "Bad module Index for DPB #%02u CROB #%u FEB %02u: %d", - uDpb, - uCrobIdx, - uFebIdx, - fviFebModuleIdx[uDpb][uCrobIdx][uFebIdx]); + LOG(fatal) << Form("Bad module Index for DPB #%02u CROB #%u FEB %02u: %d", uDpb, uCrobIdx, uFebIdx, + fviFebModuleIdx[uDpb][uCrobIdx][uFebIdx]); } // Bad module index or type for this FEB - } // for( UInt_t uFebIdx = 0; uFebIdx < fUnpackPar->GetNbFebsPerCrob(); ++ uFebIdx ) - } // for( UInt_t uCrobIdx = 0; uCrobIdx < fUnpackPar->GetNbCrobsPerDpb(); ++uCrobIdx ) - } // for( UInt_t uDpb = 0; uDpb < fuNrOfDpbs; ++uDpb ) + } // for( UInt_t uFebIdx = 0; uFebIdx < fUnpackPar->GetNbFebsPerCrob(); ++ uFebIdx ) + } // for( UInt_t uCrobIdx = 0; uCrobIdx < fUnpackPar->GetNbCrobsPerDpb(); ++uCrobIdx ) + } // for( UInt_t uDpb = 0; uDpb < fuNrOfDpbs; ++uDpb ) for (UInt_t uDpb = 0; uDpb < fuNrOfDpbs; ++uDpb) { TString sPrintoutLine = Form("DPB #%02u CROB Active ?: ", uDpb); - for (UInt_t uCrobIdx = 0; uCrobIdx < fUnpackPar->GetNbCrobsPerDpb(); - ++uCrobIdx) { - sPrintoutLine += - Form("%1u", (fvbCrobActiveFlag[uDpb][uCrobIdx] == kTRUE)); + for (UInt_t uCrobIdx = 0; uCrobIdx < fUnpackPar->GetNbCrobsPerDpb(); ++uCrobIdx) { + sPrintoutLine += Form("%1u", (fvbCrobActiveFlag[uDpb][uCrobIdx] == kTRUE)); } // for( UInt_t uCrobIdx = 0; uCrobIdx < fUnpackPar->GetNbCrobsPerDpb(); ++uCrobIdx ) LOG(info) << sPrintoutLine; } // for( UInt_t uDpb = 0; uDpb < fuNrOfDpbs; ++uDpb ) UInt_t uGlobalFebIdx = 0; for (UInt_t uDpb = 0; uDpb < fuNrOfDpbs; ++uDpb) { - for (UInt_t uCrobIdx = 0; uCrobIdx < fUnpackPar->GetNbCrobsPerDpb(); - ++uCrobIdx) { + for (UInt_t uCrobIdx = 0; uCrobIdx < fUnpackPar->GetNbCrobsPerDpb(); ++uCrobIdx) { LOG(info) << Form("DPB #%02u CROB #%u: ", uDpb, uCrobIdx); - for (UInt_t uFebIdx = 0; uFebIdx < fUnpackPar->GetNbFebsPerCrob(); - ++uFebIdx) { + for (UInt_t uFebIdx = 0; uFebIdx < fUnpackPar->GetNbFebsPerCrob(); ++uFebIdx) { if (0 <= fviFebModuleIdx[uDpb][uCrobIdx][uFebIdx]) LOG(info) << Form(" FEB #%02u (%02u): Mod. Idx = %03d (Addr. " "0x%08x) ADC gain %4.0f e- ADC Offs %5.0f e-", - uFebIdx, - uGlobalFebIdx, - fviFebModuleIdx[uDpb][uCrobIdx][uFebIdx], - fviFebAddress[uGlobalFebIdx], - fvdFebAdcGain[uDpb][uCrobIdx][uFebIdx], + uFebIdx, uGlobalFebIdx, fviFebModuleIdx[uDpb][uCrobIdx][uFebIdx], + fviFebAddress[uGlobalFebIdx], fvdFebAdcGain[uDpb][uCrobIdx][uFebIdx], fvdFebAdcOffs[uDpb][uCrobIdx][uFebIdx]); uGlobalFebIdx++; } // for( UInt_t uFebIdx = 0; uFebIdx < fUnpackPar->GetNbFebsPerCrob(); ++ uFebIdx ) - } // for( UInt_t uCrobIdx = 0; uCrobIdx < fUnpackPar->GetNbCrobsPerDpb(); ++uCrobIdx ) - } // for( UInt_t uDpb = 0; uDpb < fuNrOfDpbs; ++uDpb ) + } // for( UInt_t uCrobIdx = 0; uCrobIdx < fUnpackPar->GetNbCrobsPerDpb(); ++uCrobIdx ) + } // for( UInt_t uDpb = 0; uDpb < fuNrOfDpbs; ++uDpb ) // Internal status initialization fvulCurrentTsMsb.resize(fuNrOfDpbs); @@ -255,8 +242,8 @@ Bool_t CbmCosy2019UnpackerAlgoHodo::InitParameters() { } // ------------------------------------------------------------------------- -void CbmCosy2019UnpackerAlgoHodo::AddMsComponentToList(size_t component, - UShort_t usDetectorId) { +void CbmCosy2019UnpackerAlgoHodo::AddMsComponentToList(size_t component, UShort_t usDetectorId) +{ /// Check for duplicates and ignore if it is the case for (UInt_t uCompIdx = 0; uCompIdx < fvMsComponentsList.size(); ++uCompIdx) if (component == fvMsComponentsList[uCompIdx]) return; @@ -264,13 +251,13 @@ void CbmCosy2019UnpackerAlgoHodo::AddMsComponentToList(size_t component, /// Add to list fvMsComponentsList.push_back(component); - LOG(info) << "CbmCosy2019UnpackerAlgoHodo::AddMsComponentToList => Component " - << component << " with detector ID 0x" << std::hex << usDetectorId - << std::dec << " added to list"; + LOG(info) << "CbmCosy2019UnpackerAlgoHodo::AddMsComponentToList => Component " << component << " with detector ID 0x" + << std::hex << usDetectorId << std::dec << " added to list"; } // ------------------------------------------------------------------------- -Bool_t CbmCosy2019UnpackerAlgoHodo::ProcessTs(const fles::Timeslice& ts) { +Bool_t CbmCosy2019UnpackerAlgoHodo::ProcessTs(const fles::Timeslice& ts) +{ fulCurrentTsIdx = ts.index(); fdTsStartTime = static_cast<Double_t>(ts.descriptor(0, 0).idx); @@ -283,10 +270,9 @@ Bool_t CbmCosy2019UnpackerAlgoHodo::ProcessTs(const fles::Timeslice& ts) { fuNbOverMsPerTs = ts.num_microslices(0) - ts.num_core_microslices(); fdTsCoreSizeInNs = fdMsSizeInNs * (fuNbCoreMsPerTs); fdTsFullSizeInNs = fdMsSizeInNs * (fuNbCoreMsPerTs + fuNbOverMsPerTs); - LOG(info) << "Timeslice parameters: each TS has " << fuNbCoreMsPerTs - << " Core MS and " << fuNbOverMsPerTs - << " Overlap MS, for a core duration of " << fdTsCoreSizeInNs - << " ns and a full duration of " << fdTsFullSizeInNs << " ns"; + LOG(info) << "Timeslice parameters: each TS has " << fuNbCoreMsPerTs << " Core MS and " << fuNbOverMsPerTs + << " Overlap MS, for a core duration of " << fdTsCoreSizeInNs << " ns and a full duration of " + << fdTsFullSizeInNs << " ns"; /// Ignore overlap ms if flag set by user fuNbMsLoop = fuNbCoreMsPerTs; @@ -301,43 +287,37 @@ Bool_t CbmCosy2019UnpackerAlgoHodo::ProcessTs(const fles::Timeslice& ts) { /// Loop over core microslices (and overlap ones if chosen) for (fuMsIndex = 0; fuMsIndex < fuNbMsLoop; fuMsIndex++) { /// Loop over registered components - for (UInt_t uMsCompIdx = 0; uMsCompIdx < fvMsComponentsList.size(); - ++uMsCompIdx) { + for (UInt_t uMsCompIdx = 0; uMsCompIdx < fvMsComponentsList.size(); ++uMsCompIdx) { UInt_t uMsComp = fvMsComponentsList[uMsCompIdx]; if (kFALSE == ProcessMs(ts, uMsComp, fuMsIndex)) { - LOG(error) << "Failed to process ts " << fulCurrentTsIdx << " MS " - << fuMsIndex << " for component " << uMsComp; + LOG(error) << "Failed to process ts " << fulCurrentTsIdx << " MS " << fuMsIndex << " for component " << uMsComp; return kFALSE; } // if( kFALSE == ProcessMs( ts, uMsCompIdx, fuMsIndex ) ) - } // for( UInt_t uMsCompIdx = 0; uMsCompIdx < fvMsComponentsList.size(); ++uMsCompIdx ) + } // for( UInt_t uMsCompIdx = 0; uMsCompIdx < fvMsComponentsList.size(); ++uMsCompIdx ) /// Sort the buffers of hits std::sort(fvmHitsInMs.begin(), fvmHitsInMs.end()); /// Add the hits to the output buffer as Digis - for (auto itHitIn = fvmHitsInMs.begin(); itHitIn < fvmHitsInMs.end(); - ++itHitIn) { + for (auto itHitIn = fvmHitsInMs.begin(); itHitIn < fvmHitsInMs.end(); ++itHitIn) { UInt_t uAsicIdx = itHitIn->GetAsic(); UInt_t uFebIdx = itHitIn->GetAsic() / fUnpackPar->GetNbAsicsPerFeb(); /// Ignore unmapped Hits if (-1 == fviFebModule[uFebIdx]) continue; - UInt_t uChanInMod = fUnpackPar->GetChannelInModule( - fviFebModule[uFebIdx], itHitIn->GetChan()); // 0-63 = X, 64-127 = Y + UInt_t uChanInMod = + fUnpackPar->GetChannelInModule(fviFebModule[uFebIdx], itHitIn->GetChan()); // 0-63 = X, 64-127 = Y - Double_t dTimeInNs = - itHitIn->GetTs() * stsxyter::kdClockCycleNs - fdTimeOffsetNs; - if (uAsicIdx < fvdTimeOffsetNsAsics.size()) - dTimeInNs -= fvdTimeOffsetNsAsics[uAsicIdx]; + Double_t dTimeInNs = itHitIn->GetTs() * stsxyter::kdClockCycleNs - fdTimeOffsetNs; + if (uAsicIdx < fvdTimeOffsetNsAsics.size()) dTimeInNs -= fvdTimeOffsetNsAsics[uAsicIdx]; ULong64_t ulTimeInNs = static_cast<ULong64_t>(dTimeInNs); /* LOG(info) << Form("Hit in ASIC %2u FEB %2u (Address %08x) Chan %3u Time %12u ", uAsicIdx, uFebIdx, fviFebAddress[ uFebIdx ], uChanInMod, ulTimeInNs ); */ - fDigiVect.emplace_back( - fviFebAddress[uFebIdx], uChanInMod, ulTimeInNs, itHitIn->GetAdc()); + fDigiVect.emplace_back(fviFebAddress[uFebIdx], uChanInMod, ulTimeInNs, itHitIn->GetAdc()); } // for( auto itHitIn = fvmHitsInMs.begin(); itHitIn < fvmHitsInMs.end(); ++itHitIn ) /// Clear the buffer of hits @@ -372,22 +352,19 @@ Bool_t CbmCosy2019UnpackerAlgoHodo::ProcessTs(const fles::Timeslice& ts) { return kTRUE; } -Bool_t CbmCosy2019UnpackerAlgoHodo::ProcessMs(const fles::Timeslice& ts, - size_t uMsCompIdx, - size_t uMsIdx) { - auto msDescriptor = ts.descriptor(uMsCompIdx, uMsIdx); - fuCurrentEquipmentId = msDescriptor.eq_id; - const uint8_t* msContent = - reinterpret_cast<const uint8_t*>(ts.content(uMsCompIdx, uMsIdx)); +Bool_t CbmCosy2019UnpackerAlgoHodo::ProcessMs(const fles::Timeslice& ts, size_t uMsCompIdx, size_t uMsIdx) +{ + auto msDescriptor = ts.descriptor(uMsCompIdx, uMsIdx); + fuCurrentEquipmentId = msDescriptor.eq_id; + const uint8_t* msContent = reinterpret_cast<const uint8_t*>(ts.content(uMsCompIdx, uMsIdx)); uint32_t uSize = msDescriptor.size; fulCurrentMsIdx = msDescriptor.idx; // Double_t dMsTime = (1e-9) * static_cast<double>(fulCurrentMsIdx); - LOG(debug) << "Microslice: " << fulCurrentMsIdx << " from EqId " << std::hex - << fuCurrentEquipmentId << std::dec << " has size: " << uSize; + LOG(debug) << "Microslice: " << fulCurrentMsIdx << " from EqId " << std::hex << fuCurrentEquipmentId << std::dec + << " has size: " << uSize; - if (0 == fvbMaskedComponents.size()) - fvbMaskedComponents.resize(ts.num_components(), kFALSE); + if (0 == fvbMaskedComponents.size()) fvbMaskedComponents.resize(ts.num_components(), kFALSE); fuCurrDpbId = static_cast<uint32_t>(fuCurrentEquipmentId & 0xFFFF); // fuCurrDpbIdx = fDpbIdIndexMap[ fuCurrDpbId ]; @@ -396,8 +373,7 @@ Bool_t CbmCosy2019UnpackerAlgoHodo::ProcessMs(const fles::Timeslice& ts, auto it = fDpbIdIndexMap.find(fuCurrDpbId); if (it == fDpbIdIndexMap.end()) { if (kFALSE == fvbMaskedComponents[uMsCompIdx]) { - LOG(info) - << "---------------------------------------------------------------"; + LOG(info) << "---------------------------------------------------------------"; /* LOG(info) << "hi hv eqid flag si sv idx/start crc size offset"; LOG(info) << Form( "%02x %02x %04x %04x %02x %02x %016llx %08x %08x %016llx", @@ -409,10 +385,9 @@ Bool_t CbmCosy2019UnpackerAlgoHodo::ProcessMs(const fles::Timeslice& ts, */ LOG(info) << FormatMsHeaderPrintout(msDescriptor); // LOG(info) << msDescriptor; - LOG(warning) << "Could not find the sDPB index for AFCK id 0x" << std::hex - << fuCurrDpbId << std::dec << " in timeslice " - << fulCurrentTsIdx << " in microslice " << uMsIdx - << " component " << uMsCompIdx << "\n" + LOG(warning) << "Could not find the sDPB index for AFCK id 0x" << std::hex << fuCurrDpbId << std::dec + << " in timeslice " << fulCurrentTsIdx << " in microslice " << uMsIdx << " component " << uMsCompIdx + << "\n" << "If valid this index has to be added in the HODO " "parameter file in the DbpIdArray field"; fvbMaskedComponents[uMsCompIdx] = kTRUE; @@ -430,21 +405,17 @@ Bool_t CbmCosy2019UnpackerAlgoHodo::ProcessMs(const fles::Timeslice& ts, fuCurrDpbIdx = fDpbIdIndexMap[fuCurrDpbId]; /** Check the current TS_MSb cycle and correct it if wrong **/ - UInt_t uTsMsbCycleHeader = std::floor( - fulCurrentMsIdx / (stsxyter::kulTsCycleNbBins * stsxyter::kdClockCycleNs)); + UInt_t uTsMsbCycleHeader = std::floor(fulCurrentMsIdx / (stsxyter::kulTsCycleNbBins * stsxyter::kdClockCycleNs)); if (0 == uMsIdx) { fvuCurrentTsMsbCycle[fuCurrDpbIdx] = uTsMsbCycleHeader; fvulCurrentTsMsb[fuCurrDpbIdx] = 0; } // if( 0 == uMsIdx ) - else if (uTsMsbCycleHeader != fvuCurrentTsMsbCycle[fuCurrDpbIdx] - && 4194303 != fvulCurrentTsMsb[fuCurrDpbIdx]) { - LOG(warning) - << "TS MSB cycle from MS header does not match current cycle from data " - << "for TS " << std::setw(12) << fulCurrentTsIdx << " MS " - << std::setw(12) << fulCurrentMsIdx << " MsInTs " << std::setw(3) - << uMsIdx << " ====> " << fvuCurrentTsMsbCycle[fuCurrDpbIdx] << " VS " - << uTsMsbCycleHeader; + else if (uTsMsbCycleHeader != fvuCurrentTsMsbCycle[fuCurrDpbIdx] && 4194303 != fvulCurrentTsMsb[fuCurrDpbIdx]) { + LOG(warning) << "TS MSB cycle from MS header does not match current cycle from data " + << "for TS " << std::setw(12) << fulCurrentTsIdx << " MS " << std::setw(12) << fulCurrentMsIdx + << " MsInTs " << std::setw(3) << uMsIdx << " ====> " << fvuCurrentTsMsbCycle[fuCurrDpbIdx] << " VS " + << uTsMsbCycleHeader; fvuCurrentTsMsbCycle[fuCurrDpbIdx] = uTsMsbCycleHeader; } @@ -454,12 +425,10 @@ Bool_t CbmCosy2019UnpackerAlgoHodo::ProcessMs(const fles::Timeslice& ts, << "contain only complete sDPB messages!"; // Compute the number of complete messages in the input microslice buffer - uint32_t uNbMessages = - (uSize - (uSize % sizeof(stsxyter::Message))) / sizeof(stsxyter::Message); + uint32_t uNbMessages = (uSize - (uSize % sizeof(stsxyter::Message))) / sizeof(stsxyter::Message); // Prepare variables for the loop on contents - const stsxyter::Message* pMess = - reinterpret_cast<const stsxyter::Message*>(msContent); + const stsxyter::Message* pMess = reinterpret_cast<const stsxyter::Message*>(msContent); for (uint32_t uIdx = 0; uIdx < uNbMessages; uIdx++) { /// Get message type @@ -480,15 +449,12 @@ Bool_t CbmCosy2019UnpackerAlgoHodo::ProcessMs(const fles::Timeslice& ts, if (-1 == uFebIdx) { LOG(warning) << "CbmCosy2019UnpackerAlgoHodo::DoUnpack => " - << "Wrong elink Idx! Elink raw " - << Form("%d remap %d", usElinkIdx, uFebIdx); + << "Wrong elink Idx! Elink raw " << Form("%d remap %d", usElinkIdx, uFebIdx); continue; } // if( -1 == uFebIdx ) - UInt_t uAsicIdx = - (fuCurrDpbIdx * fUnpackPar->GetNbCrobsPerDpb() + uCrobIdx) - * fUnpackPar->GetNbAsicsPerCrob() - + fUnpackPar->ElinkIdxToAsicIdx(usElinkIdx); + UInt_t uAsicIdx = (fuCurrDpbIdx * fUnpackPar->GetNbCrobsPerDpb() + uCrobIdx) * fUnpackPar->GetNbAsicsPerCrob() + + fUnpackPar->ElinkIdxToAsicIdx(usElinkIdx); ProcessHitInfo(pMess[uIdx], usElinkIdx, uAsicIdx, uMsIdx); break; @@ -507,8 +473,7 @@ Bool_t CbmCosy2019UnpackerAlgoHodo::ProcessMs(const fles::Timeslice& ts, if (0 < uIdx) LOG(info) << "CbmCosy2019UnpackerAlgoHodo::DoUnpack => " - << "EPOCH message at unexpected position in MS: message " - << uIdx << " VS message 0 expected!"; + << "EPOCH message at unexpected position in MS: message " << uIdx << " VS message 0 expected!"; break; } // case stsxyter::MessType::TsMsb : case stsxyter::MessType::Status: { @@ -539,10 +504,9 @@ Bool_t CbmCosy2019UnpackerAlgoHodo::ProcessMs(const fles::Timeslice& ts, } // ------------------------------------------------------------------------- -void CbmCosy2019UnpackerAlgoHodo::ProcessHitInfo(const stsxyter::Message& mess, - const UShort_t& usElinkIdx, - const UInt_t& uAsicIdx, - const UInt_t& /*uMsIdx*/) { +void CbmCosy2019UnpackerAlgoHodo::ProcessHitInfo(const stsxyter::Message& mess, const UShort_t& usElinkIdx, + const UInt_t& uAsicIdx, const UInt_t& /*uMsIdx*/) +{ UShort_t usChan = mess.GetHitChannel(); UShort_t usRawAdc = mess.GetHitAdc(); // UShort_t usFullTs = mess.GetHitTimeFull(); @@ -581,16 +545,14 @@ void CbmCosy2019UnpackerAlgoHodo::ProcessHitInfo(const stsxyter::Message& mess, // Compute the Full time stamp // Use TS w/o overlap bits as they will anyway come from the TS_MSB Long64_t ulHitTime = usRawTs; - ulHitTime += static_cast<ULong64_t>(stsxyter::kuHitNbTsBins) - * static_cast<ULong64_t>(fvulCurrentTsMsb[fuCurrDpbIdx]) - + static_cast<ULong64_t>(stsxyter::kulTsCycleNbBins) - * static_cast<ULong64_t>(fvuCurrentTsMsbCycle[fuCurrDpbIdx]); + ulHitTime += + static_cast<ULong64_t>(stsxyter::kuHitNbTsBins) * static_cast<ULong64_t>(fvulCurrentTsMsb[fuCurrDpbIdx]) + + static_cast<ULong64_t>(stsxyter::kulTsCycleNbBins) * static_cast<ULong64_t>(fvuCurrentTsMsbCycle[fuCurrDpbIdx]); // Convert the Hit time in bins to Hit time in ns Double_t dHitTimeNs = ulHitTime * stsxyter::kdClockCycleNs; - fvmHitsInMs.push_back(stsxyter::FinalHit( - ulHitTime, usRawAdc, uAsicIdx, usChan, fuCurrDpbIdx, uCrobIdx)); + fvmHitsInMs.push_back(stsxyter::FinalHit(ulHitTime, usRawAdc, uAsicIdx, usChan, fuCurrDpbIdx, uCrobIdx)); // Check Starting point of histos with time as X axis if (-1 == fdStartTime) fdStartTime = dHitTimeNs; @@ -626,10 +588,8 @@ void CbmCosy2019UnpackerAlgoHodo::ProcessHitInfo(const stsxyter::Message& mess, */ } -void CbmCosy2019UnpackerAlgoHodo::ProcessTsMsbInfo( - const stsxyter::Message& mess, - UInt_t uMessIdx, - UInt_t uMsIdx) { +void CbmCosy2019UnpackerAlgoHodo::ProcessTsMsbInfo(const stsxyter::Message& mess, UInt_t uMessIdx, UInt_t uMsIdx) +{ UInt_t uVal = mess.GetTsMsbVal(); /* @@ -651,24 +611,19 @@ void CbmCosy2019UnpackerAlgoHodo::ProcessTsMsbInfo( // Update Status counters if (uVal < fvulCurrentTsMsb[fuCurrDpbIdx]) { - LOG(info) << " TS " << std::setw(12) << fulCurrentTsIdx << " MS " - << std::setw(12) << fulCurrentMsIdx << " MS Idx " << std::setw(4) - << uMsIdx << " Msg Idx " << std::setw(5) << uMessIdx << " DPB " - << std::setw(2) << fuCurrDpbIdx << " Old TsMsb " << std::setw(5) - << fvulCurrentTsMsb[fuCurrDpbIdx] << " Old MsbCy " << std::setw(5) - << fvuCurrentTsMsbCycle[fuCurrDpbIdx] << " new TsMsb " - << std::setw(5) << uVal; + LOG(info) << " TS " << std::setw(12) << fulCurrentTsIdx << " MS " << std::setw(12) << fulCurrentMsIdx << " MS Idx " + << std::setw(4) << uMsIdx << " Msg Idx " << std::setw(5) << uMessIdx << " DPB " << std::setw(2) + << fuCurrDpbIdx << " Old TsMsb " << std::setw(5) << fvulCurrentTsMsb[fuCurrDpbIdx] << " Old MsbCy " + << std::setw(5) << fvuCurrentTsMsbCycle[fuCurrDpbIdx] << " new TsMsb " << std::setw(5) << uVal; fvuCurrentTsMsbCycle[fuCurrDpbIdx]++; } // if( uVal < fvulCurrentTsMsb[fuCurrDpbIdx] ) - if (uVal != fvulCurrentTsMsb[fuCurrDpbIdx] + 1 && 0 != uVal - && 4194303 != fvulCurrentTsMsb[fuCurrDpbIdx] && 1 != uMessIdx) { + if (uVal != fvulCurrentTsMsb[fuCurrDpbIdx] + 1 && 0 != uVal && 4194303 != fvulCurrentTsMsb[fuCurrDpbIdx] + && 1 != uMessIdx) { LOG(info) << "TS MSb Jump in " - << " TS " << std::setw(12) << fulCurrentTsIdx << " MS " - << std::setw(12) << fulCurrentMsIdx << " MS Idx " << std::setw(4) - << uMsIdx << " Msg Idx " << std::setw(5) << uMessIdx << " DPB " - << std::setw(2) << fuCurrDpbIdx << " => Old TsMsb " - << std::setw(5) << fvulCurrentTsMsb[fuCurrDpbIdx] << " new TsMsb " + << " TS " << std::setw(12) << fulCurrentTsIdx << " MS " << std::setw(12) << fulCurrentMsIdx << " MS Idx " + << std::setw(4) << uMsIdx << " Msg Idx " << std::setw(5) << uMessIdx << " DPB " << std::setw(2) + << fuCurrDpbIdx << " => Old TsMsb " << std::setw(5) << fvulCurrentTsMsb[fuCurrDpbIdx] << " new TsMsb " << std::setw(5) << uVal; } // if( uVal + 1 != fvulCurrentTsMsb[fuCurrDpbIdx] && 4194303 != uVal && 0 != fvulCurrentTsMsb[fuCurrDpbIdx] ) fvulCurrentTsMsb[fuCurrDpbIdx] = uVal; @@ -689,8 +644,8 @@ void CbmCosy2019UnpackerAlgoHodo::ProcessTsMsbInfo( */ } -void CbmCosy2019UnpackerAlgoHodo::ProcessEpochInfo( - const stsxyter::Message& /*mess*/) { +void CbmCosy2019UnpackerAlgoHodo::ProcessEpochInfo(const stsxyter::Message& /*mess*/) +{ // UInt_t uVal = mess.GetEpochVal(); // UInt_t uCurrentCycle = uVal % stsxyter::kulTsCycleNbBins; @@ -704,8 +659,8 @@ void CbmCosy2019UnpackerAlgoHodo::ProcessEpochInfo( */ } -void CbmCosy2019UnpackerAlgoHodo::ProcessStatusInfo( - const stsxyter::Message& /*mess*/) { +void CbmCosy2019UnpackerAlgoHodo::ProcessStatusInfo(const stsxyter::Message& /*mess*/) +{ /* UInt_t uCrobIdx = usElinkIdx / fUnpackPar->GetNbElinkPerCrob(); Int_t uFebIdx = fUnpackPar->ElinkIdxToFebIdx( usElinkIdx ); @@ -729,28 +684,16 @@ void CbmCosy2019UnpackerAlgoHodo::ProcessStatusInfo( // ------------------------------------------------------------------------- -Bool_t CbmCosy2019UnpackerAlgoHodo::CreateHistograms() { +Bool_t CbmCosy2019UnpackerAlgoHodo::CreateHistograms() +{ /// Create General unpacking histograms fhDigisTimeInRun = - new TH1I("hStsDigisTimeInRun", - "Digis Nb vs Time in Run; Time in run [s]; Digis Nb []", - 36000, - 0, - 3600); + new TH1I("hStsDigisTimeInRun", "Digis Nb vs Time in Run; Time in run [s]; Digis Nb []", 36000, 0, 3600); AddHistoToVector(fhDigisTimeInRun, ""); - fhVectorSize = - new TH1I("fhVectorSize", - "Size of the vector VS TS index; TS index; Size [bytes]", - 10000, - 0., - 10000.); + fhVectorSize = new TH1I("fhVectorSize", "Size of the vector VS TS index; TS index; Size [bytes]", 10000, 0., 10000.); fhVectorCapacity = - new TH1I("fhVectorCapacity", - "Size of the vector VS TS index; TS index; Size [bytes]", - 10000, - 0., - 10000.); + new TH1I("fhVectorCapacity", "Size of the vector VS TS index; TS index; Size [bytes]", 10000, 0., 10000.); AddHistoToVector(fhVectorSize, ""); AddHistoToVector(fhVectorCapacity, ""); /* @@ -990,13 +933,15 @@ Bool_t CbmCosy2019UnpackerAlgoHodo::CreateHistograms() { */ return kTRUE; } -Bool_t CbmCosy2019UnpackerAlgoHodo::FillHistograms() { +Bool_t CbmCosy2019UnpackerAlgoHodo::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) return kTRUE; } -Bool_t CbmCosy2019UnpackerAlgoHodo::ResetHistograms() { +Bool_t CbmCosy2019UnpackerAlgoHodo::ResetHistograms() +{ fhDigisTimeInRun->Reset(); /* for( UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb ) @@ -1033,8 +978,8 @@ Bool_t CbmCosy2019UnpackerAlgoHodo::ResetHistograms() { } // ------------------------------------------------------------------------- -void CbmCosy2019UnpackerAlgoHodo::SetTimeOffsetNsAsic(UInt_t uAsicIdx, - Double_t dOffsetIn) { +void CbmCosy2019UnpackerAlgoHodo::SetTimeOffsetNsAsic(UInt_t uAsicIdx, Double_t dOffsetIn) +{ if (uAsicIdx >= fvdTimeOffsetNsAsics.size()) { fvdTimeOffsetNsAsics.resize(uAsicIdx + 1, 0.0); } // if( uAsicIdx < fvdTimeOffsetNsAsics.size() ) diff --git a/fles/cosy2019/unpacker/CbmCosy2019UnpackerAlgoHodo.h b/fles/cosy2019/unpacker/CbmCosy2019UnpackerAlgoHodo.h index 31d4e372f732b72dcff1662f3d627b119f2d092d..9559b88cab6278f07094f6c27e5b7f9ce05146f1 100644 --- a/fles/cosy2019/unpacker/CbmCosy2019UnpackerAlgoHodo.h +++ b/fles/cosy2019/unpacker/CbmCosy2019UnpackerAlgoHodo.h @@ -12,6 +12,7 @@ // Data #include "CbmStsDigi.h" + #include "StsXyterFinalHit.h" #include "StsXyterMessage.h" @@ -48,9 +49,7 @@ public: Bool_t InitParameters(); Bool_t ProcessTs(const fles::Timeslice& ts); - Bool_t ProcessTs(const fles::Timeslice& ts, size_t /*component*/) { - return ProcessTs(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); void AddMsComponentToList(size_t component, UShort_t usDetectorId); @@ -59,37 +58,27 @@ public: Bool_t FillHistograms(); Bool_t ResetHistograms(); - inline void SetMonitorMode(Bool_t bFlagIn = kTRUE) { - fbMonitorMode = bFlagIn; - } - inline void SetTimeOffsetNs(Double_t dOffsetIn = 0.0) { - fdTimeOffsetNs = dOffsetIn; - } + inline void SetMonitorMode(Bool_t bFlagIn = kTRUE) { fbMonitorMode = bFlagIn; } + inline void SetTimeOffsetNs(Double_t dOffsetIn = 0.0) { fdTimeOffsetNs = dOffsetIn; } void SetTimeOffsetNsAsic(UInt_t uAsicIdx, Double_t dOffsetIn = 0.0); - inline void SetVectCapInc(Double_t dIncFact) { - fdCapacityIncFactor = dIncFact; - } + inline void SetVectCapInc(Double_t dIncFact) { fdCapacityIncFactor = dIncFact; } 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 fbMonitorMode; //! Switch ON the filling of a minimal set of histograms + Bool_t fbDebugMonitorMode; //! Switch ON the filling of a additional set of histograms std::vector<Bool_t> fvbMaskedComponents; /// Settings from parameter file - CbmCosy2019HodoPar* fUnpackPar; //! - /// Readout chain dimensions and mapping - UInt_t fuNbModules; //! Total number of STS modules in the setup - std::vector<Int_t> - fviModAddress; //! STS address for the first strip of each module - UInt_t fuNrOfDpbs; //! Total number of STS DPBs in system - std::map<UInt_t, UInt_t> - fDpbIdIndexMap; //! Map of DPB Identifier to DPB index + CbmCosy2019HodoPar* fUnpackPar; //! + /// Readout chain dimensions and mapping + UInt_t fuNbModules; //! Total number of STS modules in the setup + std::vector<Int_t> fviModAddress; //! STS address for the first strip of each module + UInt_t fuNrOfDpbs; //! Total number of STS DPBs in system + std::map<UInt_t, UInt_t> fDpbIdIndexMap; //! Map of DPB Identifier to DPB index std::vector<std::vector<Bool_t>> - fvbCrobActiveFlag; //! Array to hold the active flag for all CROBs, [ NbDpb ][ NbCrobPerDpb ] + fvbCrobActiveFlag; //! Array to hold the active flag for all CROBs, [ NbDpb ][ NbCrobPerDpb ] UInt_t fuNbFebs; //! Number of FEBs with StsXyter ASICs UInt_t fuNbStsXyters; //! Number of StsXyter ASICs std::vector<std::vector<std::vector<Int_t>>> @@ -97,11 +86,9 @@ private: std::vector<std::vector<std::vector<Double_t>>> fvdFebAdcGain; //! ADC gain in e-/b, [ NbDpb ][ NbCrobPerDpb ][ NbFebsPerCrob ] std::vector<std::vector<std::vector<Double_t>>> - fvdFebAdcOffs; //! ADC offset in e-, [ NbDpb ][ NbCrobPerDpb ][ NbFebsPerCrob ] - std::vector<Int_t> - fviFebAddress; //! STS address for each FEB, [ NbDpb * NbCrobPerDpb * NbFebsPerCrob ] - std::vector<Int_t> - fviFebModule; //! Module for each FEB, [ NbDpb * NbCrobPerDpb * NbFebsPerCrob ] + fvdFebAdcOffs; //! ADC offset in e-, [ NbDpb ][ NbCrobPerDpb ][ NbFebsPerCrob ] + std::vector<Int_t> fviFebAddress; //! STS address for each FEB, [ NbDpb * NbCrobPerDpb * NbFebsPerCrob ] + std::vector<Int_t> fviFebModule; //! Module for each FEB, [ NbDpb * NbCrobPerDpb * NbFebsPerCrob ] /// User settings: Data correction parameters Double_t fdTimeOffsetNs; @@ -114,32 +101,23 @@ private: /// TS/MS info ULong64_t fulCurrentTsIdx; ULong64_t fulCurrentMsIdx; - Double_t - fdTsStartTime; //! Time in ns of current TS from the index of the first MS first component - Double_t - fdTsStopTimeCore; //! End Time in ns of current TS Core from the index of the first MS first component - Double_t - fdMsTime; //! Start Time in ns of current MS from its index field in header - UInt_t fuMsIndex; //! Index of current MS within the TS - /// Current data properties + Double_t fdTsStartTime; //! Time in ns of current TS from the index of the first MS first component + Double_t fdTsStopTimeCore; //! End Time in ns of current TS Core from the index of the first MS first component + Double_t fdMsTime; //! Start Time in ns of current MS from its index field in header + UInt_t fuMsIndex; //! Index of current MS within the TS + /// Current data properties std::map<stsxyter::MessType, UInt_t> fmMsgCounter; - UInt_t - fuCurrentEquipmentId; //! Current equipment ID, tells from which DPB the current MS is originating - UInt_t - fuCurrDpbId; //! Temp holder until Current equipment ID is properly filled in MS - UInt_t - fuCurrDpbIdx; //! Index of the DPB from which the MS currently unpacked is coming - Int_t - fiRunStartDateTimeSec; //! Start of run time since "epoch" in s, for the plots with date as X axis - Int_t fiBinSizeDatePlots; //! Bin size in s for the plots with date as X axis - /// Data format control - std::vector<ULong64_t> fvulCurrentTsMsb; //! Current TS MSB for each DPB + UInt_t fuCurrentEquipmentId; //! Current equipment ID, tells from which DPB the current MS is originating + UInt_t fuCurrDpbId; //! Temp holder until Current equipment ID is properly filled in MS + UInt_t fuCurrDpbIdx; //! Index of the DPB from which the MS currently unpacked is coming + Int_t fiRunStartDateTimeSec; //! Start of run time since "epoch" in s, for the plots with date as X axis + Int_t fiBinSizeDatePlots; //! Bin size in s for the plots with date as X axis + /// Data format control + std::vector<ULong64_t> fvulCurrentTsMsb; //! Current TS MSB for each DPB std::vector<UInt_t> fvuCurrentTsMsbCycle; //! Current TS MSB cycle for DPB /// Starting state book-keeping - Double_t - fdStartTime; /** Time of first valid hit (TS_MSB available), used as reference for evolution plots**/ - Double_t - fdStartTimeMsSz; /** Time of first microslice, used as reference for evolution plots**/ + Double_t fdStartTime; /** Time of first valid hit (TS_MSB available), used as reference for evolution plots**/ + Double_t fdStartTimeMsSz; /** Time of first microslice, used as reference for evolution plots**/ std::chrono::steady_clock::time_point ftStartTimeUnix; /** Time of run Start from UNIX system, used as reference for long evolution plots against reception time **/ @@ -160,13 +138,9 @@ private: size_t fuTsMaxVectorSize = 0; Double_t fdCapacityIncFactor = 1.1; - void ProcessHitInfo(const stsxyter::Message& mess, - const UShort_t& usElinkIdx, - const UInt_t& uAsicIdx, + void ProcessHitInfo(const stsxyter::Message& mess, const UShort_t& usElinkIdx, const UInt_t& uAsicIdx, const UInt_t& uMsIdx); - void ProcessTsMsbInfo(const stsxyter::Message& mess, - UInt_t uMessIdx = 0, - UInt_t uMsIdx = 0); + void ProcessTsMsbInfo(const stsxyter::Message& mess, UInt_t uMessIdx = 0, UInt_t uMsIdx = 0); void ProcessEpochInfo(const stsxyter::Message& mess); void ProcessStatusInfo(const stsxyter::Message& mess); diff --git a/fles/cosy2019/unpacker/CbmCosy2019UnpackerTaskHodo.cxx b/fles/cosy2019/unpacker/CbmCosy2019UnpackerTaskHodo.cxx index bd153e0f6197f4f4c04df344232aef1ea10573b7..8d5059694c81ea2ec4ad16c01b7d2cc205aa5e4b 100644 --- a/fles/cosy2019/unpacker/CbmCosy2019UnpackerTaskHodo.cxx +++ b/fles/cosy2019/unpacker/CbmCosy2019UnpackerTaskHodo.cxx @@ -30,6 +30,7 @@ #include <fstream> #include <iomanip> #include <iostream> + #include <stdint.h> Bool_t bCosy2019UnpackerTaskHodoResetHistos = kFALSE; @@ -40,17 +41,20 @@ CbmCosy2019UnpackerTaskHodo::CbmCosy2019UnpackerTaskHodo(UInt_t /*uNbGdpb*/) , fbWriteOutput(kTRUE) , fvChanMasks() , fulTsCounter(0) - , fUnpackerAlgo(nullptr) { + , fUnpackerAlgo(nullptr) +{ fUnpackerAlgo = new CbmCosy2019UnpackerAlgoHodo(); fUnpackerAlgoSts = new CbmMcbm2018UnpackerAlgoSts(); } -CbmCosy2019UnpackerTaskHodo::~CbmCosy2019UnpackerTaskHodo() { +CbmCosy2019UnpackerTaskHodo::~CbmCosy2019UnpackerTaskHodo() +{ delete fUnpackerAlgo; delete fUnpackerAlgoSts; } -Bool_t CbmCosy2019UnpackerTaskHodo::Init() { +Bool_t CbmCosy2019UnpackerTaskHodo::Init() +{ LOG(info) << "CbmCosy2019UnpackerTaskHodo::Init"; LOG(info) << "Initializing mCBM STS 2018 Unpacker"; @@ -74,7 +78,8 @@ Bool_t CbmCosy2019UnpackerTaskHodo::Init() { return kTRUE; } -void CbmCosy2019UnpackerTaskHodo::SetParContainers() { +void CbmCosy2019UnpackerTaskHodo::SetParContainers() +{ LOG(info) << "Setting parameter containers for " << GetName(); TList* fParCList = fUnpackerAlgo->GetParList(); @@ -84,12 +89,11 @@ void CbmCosy2019UnpackerTaskHodo::SetParContainers() { fParCList->Remove(tempObj); std::string sParamName {tempObj->GetName()}; - FairParGenericSet* newObj = dynamic_cast<FairParGenericSet*>( - FairRun::Instance()->GetRuntimeDb()->getContainer(sParamName.data())); + FairParGenericSet* newObj = + dynamic_cast<FairParGenericSet*>(FairRun::Instance()->GetRuntimeDb()->getContainer(sParamName.data())); if (nullptr == newObj) { - LOG(error) << "Failed to obtain parameter container " << sParamName - << ", for parameter index " << iparC; + LOG(error) << "Failed to obtain parameter container " << sParamName << ", for parameter index " << iparC; return; } // if( nullptr == newObj ) @@ -104,12 +108,11 @@ void CbmCosy2019UnpackerTaskHodo::SetParContainers() { fParCList->Remove(tempObj); std::string sParamName {tempObj->GetName()}; - FairParGenericSet* newObj = dynamic_cast<FairParGenericSet*>( - FairRun::Instance()->GetRuntimeDb()->getContainer(sParamName.data())); + FairParGenericSet* newObj = + dynamic_cast<FairParGenericSet*>(FairRun::Instance()->GetRuntimeDb()->getContainer(sParamName.data())); if (nullptr == newObj) { - LOG(error) << "Failed to obtain parameter container " << sParamName - << ", for parameter index " << iparC; + LOG(error) << "Failed to obtain parameter container " << sParamName << ", for parameter index " << iparC; return; } // if( nullptr == newObj ) @@ -118,12 +121,13 @@ void CbmCosy2019UnpackerTaskHodo::SetParContainers() { } // for( Int_t iparC = 0; iparC < fParCList->GetEntries(); ++iparC ) } -Bool_t CbmCosy2019UnpackerTaskHodo::InitContainers() { +Bool_t CbmCosy2019UnpackerTaskHodo::InitContainers() +{ LOG(info) << "Init parameter containers for " << GetName(); /// Control flags - CbmCosy2019HodoPar* pUnpackPar = dynamic_cast<CbmCosy2019HodoPar*>( - FairRun::Instance()->GetRuntimeDb()->getContainer("CbmCosy2019HodoPar")); + CbmCosy2019HodoPar* pUnpackPar = + dynamic_cast<CbmCosy2019HodoPar*>(FairRun::Instance()->GetRuntimeDb()->getContainer("CbmCosy2019HodoPar")); if (nullptr == pUnpackPar) { LOG(error) << "Failed to obtain parameter container CbmCosy2019HodoPar"; return kFALSE; @@ -147,22 +151,18 @@ Bool_t CbmCosy2019UnpackerTaskHodo::InitContainers() { initOK &= fUnpackerAlgoSts->CreateHistograms(); /// Obtain vector of pointers on each histo from the algo (+ optionally desired folder) - std::vector<std::pair<TNamed*, std::string>> vHistos = - fUnpackerAlgo->GetHistoVector(); - std::vector<std::pair<TNamed*, std::string>> vHistosSts = - fUnpackerAlgoSts->GetHistoVector(); + std::vector<std::pair<TNamed*, std::string>> vHistos = fUnpackerAlgo->GetHistoVector(); + std::vector<std::pair<TNamed*, std::string>> vHistosSts = fUnpackerAlgoSts->GetHistoVector(); vHistos.insert(vHistos.end(), vHistosSts.begin(), vHistosSts.end()); /// Register the histos in the HTTP server THttpServer* server = FairRunOnline::Instance()->GetHttpServer(); if (nullptr != server) { for (UInt_t uHisto = 0; uHisto < vHistos.size(); ++uHisto) { - server->Register(Form("/%s", vHistos[uHisto].second.data()), - vHistos[uHisto].first); + server->Register(Form("/%s", vHistos[uHisto].second.data()), vHistos[uHisto].first); } // for( UInt_t uHisto = 0; uHisto < vHistos.size(); ++uHisto ) - server->RegisterCommand("/Reset_UnpHodo_Hist", - "bCosy2019UnpackerTaskHodoResetHistos=kTRUE"); + server->RegisterCommand("/Reset_UnpHodo_Hist", "bCosy2019UnpackerTaskHodoResetHistos=kTRUE"); server->Restrict("/Reset_UnpHodo_Hist", "allow=admin"); } // if( nullptr != server ) @@ -171,15 +171,14 @@ Bool_t CbmCosy2019UnpackerTaskHodo::InitContainers() { fUnpackerAlgo->SetMonitorMode(fbMonitorMode); fUnpackerAlgoSts->SetMonitorMode(fbMonitorMode); - for (std::vector<FebChanMaskSts>::iterator it = fvChanMasks.begin(); - it < fvChanMasks.end(); - ++it) + for (std::vector<FebChanMaskSts>::iterator it = fvChanMasks.begin(); it < fvChanMasks.end(); ++it) fUnpackerAlgoSts->MaskNoisyChannel((*it).uFeb, (*it).uChan, (*it).bMasked); return initOK; } -Bool_t CbmCosy2019UnpackerTaskHodo::ReInitContainers() { +Bool_t CbmCosy2019UnpackerTaskHodo::ReInitContainers() +{ LOG(info) << "ReInit parameter containers for " << GetName(); Bool_t initOK = fUnpackerAlgo->ReInitContainers(); initOK &= fUnpackerAlgoSts->ReInitContainers(); @@ -187,14 +186,14 @@ Bool_t CbmCosy2019UnpackerTaskHodo::ReInitContainers() { return initOK; } -void CbmCosy2019UnpackerTaskHodo::AddMsComponentToList(size_t component, - UShort_t usDetectorId) { +void CbmCosy2019UnpackerTaskHodo::AddMsComponentToList(size_t component, UShort_t usDetectorId) +{ fUnpackerAlgo->AddMsComponentToList(component, usDetectorId); fUnpackerAlgoSts->AddMsComponentToList(component, usDetectorId); } -Bool_t CbmCosy2019UnpackerTaskHodo::DoUnpack(const fles::Timeslice& ts, - size_t /*component*/) { +Bool_t CbmCosy2019UnpackerTaskHodo::DoUnpack(const fles::Timeslice& ts, size_t /*component*/) +{ if (fbMonitorMode && bCosy2019UnpackerTaskHodoResetHistos) { LOG(info) << "Reset Hodo + STS unpacker histos "; fUnpackerAlgo->ResetHistograms(); @@ -203,31 +202,22 @@ Bool_t CbmCosy2019UnpackerTaskHodo::DoUnpack(const fles::Timeslice& ts, } // if( fbMonitorMode && bCosy2019UnpackerTaskHodoResetHistos ) if (kFALSE == fUnpackerAlgo->ProcessTs(ts)) { - LOG(error) << "Failed processing TS " << ts.index() - << " in HODO unpacker algorithm class"; + LOG(error) << "Failed processing TS " << ts.index() << " in HODO unpacker algorithm class"; return kTRUE; } // if( kFALSE == fUnpackerAlgo->ProcessTs( ts ) ) if (kFALSE == fUnpackerAlgoSts->ProcessTs(ts)) { - LOG(error) << "Failed processing TS " << ts.index() - << " in STS unpacker algorithm class"; + LOG(error) << "Failed processing TS " << ts.index() << " in STS unpacker algorithm class"; return kTRUE; } // if( kFALSE == fUnpackerAlgoSts->ProcessTs( ts ) ) /// Copy the digis in the output Buffer - fpvDigiSts->insert(fpvDigiSts->end(), - fUnpackerAlgo->GetVector().begin(), - fUnpackerAlgo->GetVector().end()); - fpvDigiSts->insert(fpvDigiSts->end(), - fUnpackerAlgoSts->GetVector().begin(), - fUnpackerAlgoSts->GetVector().end()); + fpvDigiSts->insert(fpvDigiSts->end(), fUnpackerAlgo->GetVector().begin(), fUnpackerAlgo->GetVector().end()); + fpvDigiSts->insert(fpvDigiSts->end(), fUnpackerAlgoSts->GetVector().begin(), fUnpackerAlgoSts->GetVector().end()); /// Sort the buffers of hits due to the time offsets applied - sort(fpvDigiSts->begin(), - fpvDigiSts->end(), - [](const CbmStsDigi& a, const CbmStsDigi& b) -> bool { - return a.GetTime() < b.GetTime(); - }); + sort(fpvDigiSts->begin(), fpvDigiSts->end(), + [](const CbmStsDigi& a, const CbmStsDigi& b) -> bool { return a.GetTime() < b.GetTime(); }); fUnpackerAlgo->ClearVector(); fUnpackerAlgoSts->ClearVector(); @@ -235,36 +225,33 @@ Bool_t CbmCosy2019UnpackerTaskHodo::DoUnpack(const fles::Timeslice& ts, /// Copy the errors in the output Buffer /// Cannot be done in algo as merging outputs of 2 different ones! /// => Less efficient than STS only due to double sorting - fpvErrorSts->insert(fpvErrorSts->end(), - fUnpackerAlgo->GetErrorVector().begin(), + fpvErrorSts->insert(fpvErrorSts->end(), fUnpackerAlgo->GetErrorVector().begin(), fUnpackerAlgo->GetErrorVector().end()); - fpvErrorSts->insert(fpvErrorSts->end(), - fUnpackerAlgoSts->GetErrorVector().begin(), + fpvErrorSts->insert(fpvErrorSts->end(), fUnpackerAlgoSts->GetErrorVector().begin(), fUnpackerAlgoSts->GetErrorVector().end()); fUnpackerAlgo->ClearErrorVector(); fUnpackerAlgoSts->ClearErrorVector(); - if (0 == fulTsCounter % 10000) - LOG(info) << "Processed " << fulTsCounter << "TS"; + if (0 == fulTsCounter % 10000) LOG(info) << "Processed " << fulTsCounter << "TS"; fulTsCounter++; return kTRUE; } -void CbmCosy2019UnpackerTaskHodo::Reset() { +void CbmCosy2019UnpackerTaskHodo::Reset() +{ fpvDigiSts->clear(); fpvErrorSts->clear(); } -void CbmCosy2019UnpackerTaskHodo::Finish() { +void CbmCosy2019UnpackerTaskHodo::Finish() +{ /// If monitor mode enabled, trigger histos creation, obtain pointer on them and add them to the HTTP server if (kTRUE == fbMonitorMode) { /// Obtain vector of pointers on each histo from the algo (+ optionally desired folder) - std::vector<std::pair<TNamed*, std::string>> vHistos = - fUnpackerAlgo->GetHistoVector(); - std::vector<std::pair<TNamed*, std::string>> vHistosSts = - fUnpackerAlgoSts->GetHistoVector(); + std::vector<std::pair<TNamed*, std::string>> vHistos = fUnpackerAlgo->GetHistoVector(); + std::vector<std::pair<TNamed*, std::string>> vHistosSts = fUnpackerAlgoSts->GetHistoVector(); vHistos.insert(vHistos.end(), vHistosSts.begin(), vHistosSts.end()); /// Save old global file and folder pointer to avoid messing with FairRoot @@ -298,37 +285,34 @@ void CbmCosy2019UnpackerTaskHodo::Finish() { } // if( kTRUE == fbMonitorMode ) } -void CbmCosy2019UnpackerTaskHodo::SetIgnoreOverlapMs(Bool_t bFlagIn) { +void CbmCosy2019UnpackerTaskHodo::SetIgnoreOverlapMs(Bool_t bFlagIn) +{ fUnpackerAlgo->SetIgnoreOverlapMs(bFlagIn); fUnpackerAlgoSts->SetIgnoreOverlapMs(bFlagIn); } -void CbmCosy2019UnpackerTaskHodo::SetTimeOffsetNs(Double_t dOffsetIn) { - fUnpackerAlgo->SetTimeOffsetNs(dOffsetIn); -} +void CbmCosy2019UnpackerTaskHodo::SetTimeOffsetNs(Double_t dOffsetIn) { fUnpackerAlgo->SetTimeOffsetNs(dOffsetIn); } -void CbmCosy2019UnpackerTaskHodo::SetTimeOffsetNsSts(Double_t dOffsetIn) { +void CbmCosy2019UnpackerTaskHodo::SetTimeOffsetNsSts(Double_t dOffsetIn) +{ fUnpackerAlgoSts->SetTimeOffsetNs(dOffsetIn); } -void CbmCosy2019UnpackerTaskHodo::SetTimeOffsetNsAsic(UInt_t uAsicIdx, - Double_t dOffsetIn) { +void CbmCosy2019UnpackerTaskHodo::SetTimeOffsetNsAsic(UInt_t uAsicIdx, Double_t dOffsetIn) +{ fUnpackerAlgo->SetTimeOffsetNsAsic(uAsicIdx, dOffsetIn); } -void CbmCosy2019UnpackerTaskHodo::SetTimeOffsetNsAsicSts(UInt_t uAsicIdx, - Double_t dOffsetIn) { +void CbmCosy2019UnpackerTaskHodo::SetTimeOffsetNsAsicSts(UInt_t uAsicIdx, Double_t dOffsetIn) +{ fUnpackerAlgoSts->SetTimeOffsetNsAsic(uAsicIdx, dOffsetIn); } -void CbmCosy2019UnpackerTaskHodo::MaskNoisyChannelSts(UInt_t uFeb, - UInt_t uChan, - Bool_t bMasked) { +void CbmCosy2019UnpackerTaskHodo::MaskNoisyChannelSts(UInt_t uFeb, UInt_t uChan, Bool_t bMasked) +{ fvChanMasks.push_back(FebChanMaskSts {uFeb, uChan, bMasked}); } -void CbmCosy2019UnpackerTaskHodo::SetAdcCutSts(UInt_t uAdc) { - fUnpackerAlgoSts->SetAdcCut(uAdc); -} +void CbmCosy2019UnpackerTaskHodo::SetAdcCutSts(UInt_t uAdc) { fUnpackerAlgoSts->SetAdcCut(uAdc); } ClassImp(CbmCosy2019UnpackerTaskHodo) diff --git a/fles/cosy2019/unpacker/CbmCosy2019UnpackerTaskHodo.h b/fles/cosy2019/unpacker/CbmCosy2019UnpackerTaskHodo.h index 746b11853c3d51ce4bd8d119ae8394d946ef6986..c4fb92b13ea700a48b0079879699aeea4775d575 100644 --- a/fles/cosy2019/unpacker/CbmCosy2019UnpackerTaskHodo.h +++ b/fles/cosy2019/unpacker/CbmCosy2019UnpackerTaskHodo.h @@ -8,12 +8,12 @@ #ifndef CbmCosy2019UnpackerTaskHodo_H #define CbmCosy2019UnpackerTaskHodo_H -#include "Timeslice.hpp" - #include "CbmErrorMessage.h" #include "CbmMcbmUnpack.h" #include "CbmStsDigi.h" +#include "Timeslice.hpp" + class CbmCosy2019UnpackerAlgoHodo; class CbmMcbm2018UnpackerAlgoSts; @@ -28,8 +28,7 @@ public: CbmCosy2019UnpackerTaskHodo(UInt_t uNbSdpb = 1); CbmCosy2019UnpackerTaskHodo(const CbmCosy2019UnpackerTaskHodo&) = delete; - CbmCosy2019UnpackerTaskHodo - operator=(const CbmCosy2019UnpackerTaskHodo&) = delete; + CbmCosy2019UnpackerTaskHodo operator=(const CbmCosy2019UnpackerTaskHodo&) = delete; virtual ~CbmCosy2019UnpackerTaskHodo(); @@ -49,9 +48,7 @@ public: void AddMsComponentToList(size_t component, UShort_t usDetectorId); void SetNbMsInTs(size_t /*uCoreMsNb*/, size_t /*uOverlapMsNb*/) {}; - inline void SetMonitorMode(Bool_t bFlagIn = kTRUE) { - fbMonitorMode = bFlagIn; - } + inline void SetMonitorMode(Bool_t bFlagIn = kTRUE) { fbMonitorMode = bFlagIn; } void SetIgnoreOverlapMs(Bool_t bFlagIn = kTRUE); void SetTimeOffsetNs(Double_t dOffsetIn = 0.0); @@ -67,12 +64,9 @@ public: 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 /// Temporary storage of user parameters std::vector<FebChanMaskSts> fvChanMasks; diff --git a/macro/beamtime/cosy2019/unpack_tsa_cosy2019.C b/macro/beamtime/cosy2019/unpack_tsa_cosy2019.C index 39f7149d68d9399e39f40937d425197906d8ee3b..41c0890fca798000b635da7c6aa1dc472aaca588 100644 --- a/macro/beamtime/cosy2019/unpack_tsa_cosy2019.C +++ b/macro/beamtime/cosy2019/unpack_tsa_cosy2019.C @@ -60,8 +60,7 @@ void unpack_tsa_cosy2019(TString inFile = "", std::cout << ">>> unpack_tsa: Initialising..." << std::endl; CbmMcbm2018UnpackerTaskTof* unpacker_tof = new CbmMcbm2018UnpackerTaskTof(); - CbmCosy2019UnpackerTaskHodo* unpacker_hodo = - new CbmCosy2019UnpackerTaskHodo(); + CbmCosy2019UnpackerTaskHodo* unpacker_hodo = new CbmCosy2019UnpackerTaskHodo(); unpacker_tof->SetMonitorMode(); unpacker_hodo->SetMonitorMode();