diff --git a/core/data/CbmTsEventHeader.cxx b/core/data/CbmTsEventHeader.cxx index 6c9724edf65e77fb5692ce1eb8b9bd46c7c0dffa..360500d8e550d3fdf9fccb95d357bfaca11c8775 100644 --- a/core/data/CbmTsEventHeader.cxx +++ b/core/data/CbmTsEventHeader.cxx @@ -7,3 +7,18 @@ // ----- Constructor ------------------------------------------------------ CbmTsEventHeader::CbmTsEventHeader() {} // ---------------------------------------------------------------------------- + + +// ---- Reset ---- +void CbmTsEventHeader::Reset() +{ + // Reset the digi counters + fNDigisPsd = 0; + fNDigisRich = 0; + fNDigisSts = 0; + fNDigisTof = 0; + fNDigisTrd1D = 0; + fNDigisTrd2D = 0; +} + +ClassImp(CbmTsEventHeader) diff --git a/core/data/CbmTsEventHeader.h b/core/data/CbmTsEventHeader.h index 71f43e1a6677e361df1aa2e809d439a33ea3ccb5..422096e804f04f276919a2922bdbd06e9137c2f9 100644 --- a/core/data/CbmTsEventHeader.h +++ b/core/data/CbmTsEventHeader.h @@ -21,39 +21,55 @@ public: /** Default destructor */ virtual ~CbmTsEventHeader() {}; - /** Get the Start time of the this Timeslice linked to this event header*/ - uint64_t GetTsIndex() { return fTsIndex; } - /** Get the Start time of the this Timeslice linked to this event header*/ - uint64_t GetTsStartTime() { return fTsStartTime; } + /** @brief Add a number of digis from this Ts */ + void AddNDigisPsd(uint64_t value) { fNDigisPsd += value; } + /** @brief Add a number of digis from this Ts */ + void AddNDigisRich(uint64_t value) { fNDigisRich += value; } + /** @brief Add a number of digis from this Ts */ + void AddNDigisSts(uint64_t value) { fNDigisSts += value; } + /** @brief Add a number of digis from this Ts */ + void AddNDigisTof(uint64_t value) { fNDigisTof += value; } + /** @brief Add a number of digis from this Ts */ + void AddNDigisTrd1D(uint64_t value) { fNDigisTrd1D += value; } + /** @brief Add a number of digis from this Ts */ + void AddNDigisTrd2D(uint64_t value) { fNDigisTrd2D += value; } /** @brief Get the number of digis in this Ts */ - ULong64_t GetNDigisPsd(ULong64_t) { return fNDigisPsd; } + uint64_t GetNDigisPsd() { return fNDigisPsd; } /** @brief Get the number of digis in this Ts */ - ULong64_t GetNDigisRich(ULong64_t) { return fNDigisRich; } + uint64_t GetNDigisRich() { return fNDigisRich; } /** @brief Get the number of digis in this Ts */ - ULong64_t GetNDigisSts(ULong64_t) { return fNDigisSts; } + uint64_t GetNDigisSts() { return fNDigisSts; } /** @brief Get the number of digis in this Ts */ - ULong64_t GetNDigisTof(ULong64_t) { return fNDigisTof; } + uint64_t GetNDigisTof() { return fNDigisTof; } /** @brief Get the number of digis in this Ts */ - ULong64_t GetNDigisTrd1D(ULong64_t) { return fNDigisTrd; } + uint64_t GetNDigisTrd1D() { return fNDigisTrd1D; } /** @brief Get the number of digis in this Ts */ - ULong64_t GetNDigisTrd2D(ULong64_t) { return fNDigisTrd2D; } + uint64_t GetNDigisTrd2D() { return fNDigisTrd2D; } + + /** Get the Start time of the this Timeslice linked to this event header*/ + uint64_t GetTsIndex() { return fTsIndex; } + /** Get the Start time of the this Timeslice linked to this event header*/ + uint64_t GetTsStartTime() { return fTsStartTime; } + + /** @brief Resets counters and variables for a new Timeslice, e.g. the NDigis counter are set back to 0*/ + void Reset(); /** @brief Set the number of digis in this Ts */ - void SetNDigisPsd(ULong64_t value) { fNDigisPsd = value; } + void SetNDigisPsd(uint64_t value) { fNDigisPsd = value; } /** @brief Set the number of digis in this Ts */ - void SetNDigisRich(ULong64_t value) { fNDigisRich = value; } + void SetNDigisRich(uint64_t value) { fNDigisRich = value; } /** @brief Set the number of digis in this Ts */ - void SetNDigisSts(ULong64_t value) { fNDigisSts = value; } + void SetNDigisSts(uint64_t value) { fNDigisSts = value; } /** @brief Set the number of digis in this Ts */ - void SetNDigisTof(ULong64_t value) { fNDigisTof = value; } + void SetNDigisTof(uint64_t value) { fNDigisTof = value; } /** @brief Set the number of digis in this Ts */ - void SetNDigisTrd1D(ULong64_t value) { fNDigisTrd = value; } + void SetNDigisTrd1D(uint64_t value) { fNDigisTrd1D = value; } /** @brief Set the number of digis in this Ts */ - void SetNDigisTrd2D(ULong64_t value) { fNDigisTrd2D = value; } + void SetNDigisTrd2D(uint64_t value) { fNDigisTrd2D = value; } /** @brief Set the Ts Start Time @param value Start time of the TS */ - void SetTsIndex(uint32_t value) { fTsIndex = value; } + void SetTsIndex(uint64_t value) { fTsIndex = value; } /** @brief Set the Ts Start Time @param value Start time of the TS */ void SetTsStartTime(uint64_t value) { fTsStartTime = value; } @@ -64,18 +80,18 @@ protected: uint64_t fTsStartTime = 0; /** @brief nDigis in "this" timeslice measured by the PSD */ - ULong64_t fNDigisPsd = 0; + uint64_t fNDigisPsd = 0; /** @brief nDigis in "this" timeslice measured by the RICH */ - ULong64_t fNDigisRich = 0; + uint64_t fNDigisRich = 0; /** @brief nDigis in "this" timeslice measured by the STS */ - ULong64_t fNDigisSts = 0; - /** @brief nDigis in "this" timeslice measured by the TRD1D @remark the member is not renamed to fNDigisTrd1D for easier backwards compatibility */ - ULong64_t fNDigisTrd = 0; - /** @brief nDigis in "this" timeslice measured by the TRD2D */ - ULong64_t fNDigisTrd2D = 0; + uint64_t fNDigisSts = 0; /** @brief nDigis in "this" timeslice measured by the TOF */ - ULong64_t fNDigisTof = 0; + uint64_t fNDigisTof = 0; + /** @brief nDigis in "this" timeslice measured by the TRD1D */ + uint64_t fNDigisTrd1D = 0; + /** @brief nDigis in "this" timeslice measured by the TRD2D */ + uint64_t fNDigisTrd2D = 0; - ClassDef(CbmTsEventHeader, 4) + ClassDef(CbmTsEventHeader, 5) }; #endif diff --git a/reco/steer/CbmRecoUnpack.cxx b/reco/steer/CbmRecoUnpack.cxx index 15eb072e9abb32f9e12f1b9e526b1ab67d9f8b89..2e38369d414b427efbb73d0f53d1dbee61b0f4f4 100644 --- a/reco/steer/CbmRecoUnpack.cxx +++ b/reco/steer/CbmRecoUnpack.cxx @@ -11,8 +11,6 @@ #include "CbmTrdDigi.h" #include "CbmTsEventHeader.h" -#include "MicrosliceDescriptor.hpp" - #include <FairRootManager.h> #include <Logger.h> @@ -214,6 +212,9 @@ void CbmRecoUnpack::performanceProfiling() // ----- Reset ------------------------------------------------------------ void CbmRecoUnpack::Reset() { + // Reset the event header for a new timeslice + fCbmTsEventHeader->Reset(); + // Reset the unpackers for a new timeslice, e.g. clear the output vectors // ---- Psd ---- @@ -252,7 +253,7 @@ void CbmRecoUnpack::Unpack(unique_ptr<Timeslice> ts) switch (systemId) { case fkFlesPsd: { if (fPsdConfig) { - fCbmTsEventHeader->SetNDigisPsd(unpack(systemId, ×lice, component, fPsdConfig, + fCbmTsEventHeader->AddNDigisPsd(unpack(systemId, ×lice, component, fPsdConfig, fPsdConfig->GetOptOutAVec(), fPsdConfig->GetOptOutBVec())); } @@ -260,28 +261,28 @@ void CbmRecoUnpack::Unpack(unique_ptr<Timeslice> ts) } case fkFlesRich: { if (fRichConfig) { - fCbmTsEventHeader->SetNDigisRich(unpack(systemId, ×lice, component, fRichConfig, + fCbmTsEventHeader->AddNDigisRich(unpack(systemId, ×lice, component, fRichConfig, fRichConfig->GetOptOutAVec(), fRichConfig->GetOptOutBVec())); } break; } case fkFlesSts: { if (fStsConfig) { - fCbmTsEventHeader->SetNDigisSts(unpack(systemId, ×lice, component, fStsConfig, + fCbmTsEventHeader->AddNDigisSts(unpack(systemId, ×lice, component, fStsConfig, fStsConfig->GetOptOutAVec(), fStsConfig->GetOptOutBVec())); } break; } case fkFlesTof: { if (fTofConfig) { - fCbmTsEventHeader->SetNDigisTof(unpack(systemId, ×lice, component, fTofConfig, + fCbmTsEventHeader->AddNDigisTof(unpack(systemId, ×lice, component, fTofConfig, fTofConfig->GetOptOutAVec(), fTofConfig->GetOptOutBVec())); } break; } case fkFlesTrd: { if (fTrd1DConfig) { - fCbmTsEventHeader->SetNDigisTrd1D(unpack(systemId, ×lice, component, fTrd1DConfig, + fCbmTsEventHeader->AddNDigisTrd1D(unpack(systemId, ×lice, component, fTrd1DConfig, fTrd1DConfig->GetOptOutAVec(), fTrd1DConfig->GetOptOutBVec())); } break; @@ -289,7 +290,7 @@ void CbmRecoUnpack::Unpack(unique_ptr<Timeslice> ts) case fkFlesTrd2D: { if (fTrd2DConfig) if (fTrd2DConfig) { - fCbmTsEventHeader->SetNDigisTrd2D(unpack(systemId, ×lice, component, fTrd2DConfig, + fCbmTsEventHeader->AddNDigisTrd2D(unpack(systemId, ×lice, component, fTrd2DConfig, fTrd2DConfig->GetOptOutAVec(), fTrd2DConfig->GetOptOutBVec())); } break;