5#ifndef CBMALGOBUILDRAWEVENTS_H
6#define CBMALGOBUILDRAWEVENTS_H
17#include <boost/any.hpp>
65 Int_t iTriggerMaxDigisIn, Double_t fdTimeWinBegIn, Double_t fdTimeWinEndIn,
66 UInt_t uTriggerMinLayersIn = 0, Double_t fdHistMaxDigiNbIn = 1000)
151 UInt_t uTriggerMinDigisIn = 0, Int_t iTriggerMaxDigisIn = -1,
152 Double_t fdTimeWinBegIn = -100, Double_t fdTimeWinEndIn = 100);
154 Int_t iTriggerMaxDigisIn = -1, Double_t fdTimeWinBegIn = -100, Double_t fdTimeWinEndIn = 100);
212 void SetDigis(std::vector<CbmMuchBeamTimeDigi>* MuchBeamTimeDigis)
243 template<
class DigiSeed>
246 void CheckSeed(Double_t dSeedTime, UInt_t uSeedDigiIdx);
249 template<
class DigiCheck>
292 std::vector<RawEventBuilderDetector>
fvDets = {
349 std::vector<std::pair<TNamed*, std::string>>
351 std::vector<std::pair<TCanvas*, std::string>>
static const RawEventBuilderDetector kRawEventBuilderDetSts
Pre-defined detector types.
static const RawEventBuilderDetector kRawEventBuilderDetTrd2D
static const RawEventBuilderDetector kRawEventBuilderDetBmon
static const RawEventBuilderDetector kRawEventBuilderDetFsd
static const RawEventBuilderDetector kRawEventBuilderDetTrd
static const RawEventBuilderDetector kRawEventBuilderDetPsd
static const RawEventBuilderDetector kRawEventBuilderDetRich
static const RawEventBuilderDetector kRawEventBuilderDetTof
static const RawEventBuilderDetector kRawEventBuilderDetMuch
static const RawEventBuilderDetector kRawEventBuilderDetUndef
@ kTrd
Transition Radiation Detector.
@ kTof
Time-of-flight Detector.
@ kPsd
Projectile spectator detector.
@ kSts
Silicon Tracking System.
@ kTrd2d
TRD-FASP Detector (FIXME)
@ kMuch
Muon detection system.
@ kFsd
Forward spectator detector.
@ kRich
Ring-Imaging Cherenkov Detector.
static double dTsStartTime
void UpdateWidestTimeWinRange()
void SetFillHistos(Bool_t var)
CbmAlgoBuildRawEvents()=default
Bool_t CheckTriggerConditions(CbmEvent *event, const RawEventBuilderDetector &det)
void SetEventOverlapMode(EOverlapModeRaw mode)
Control flags.
static constexpr Double_t kdDefaultTimeWinBeg
Constants.
void SetTimeSliceMetaDataArray(TClonesArray *TimeSliceMetaDataArray)
void SetDigis(std::vector< CbmStsDigi > *StsDigis)
TDirectoryFile * outFolder
UInt_t fuCurEv
histogram with size of overlap between evt vs TS index, AllowOverlap only
const std::vector< CbmTrdDigi > * fTrdDigis
Double_t GetSeedTimeWinRange()
const std::vector< CbmBmonDigi > * fBmonDigis
std::vector< std::pair< TNamed *, std::string > > GetHistoVector()
void AddDigiToEvent(const RawEventBuilderDetector &det, Int_t uIdx)
TH1 * fhCpuTimePerTsHist
Processing time per TS.
void SetDigis(std::vector< CbmRichDigi > *RichDigis)
std::vector< TH1 * > fvhOutRatioPerTsSz
ratio of input digi size in total input size vs TS in run
void SetHistogramMaxDigiNb(ECbmModuleId selDet, Double_t dDigiNbMax)
int32_t getNofFilteredBmonDigis(CbmEvent *ev)
TH2 * fhOverEventSizeTs
histogram with proportion of overlap evt vs TS index, AllowOverlap only
void SetIgnoreTsOverlap(Bool_t bFlagIn=kTRUE)
uint64_t GetSizeFromDigisNb(ECbmModuleId detId, uint64_t ulNbDigis)
const std::vector< Double_t > * fSeedTimes
EOverlapModeRaw fOverMode
bit map for Bmon trigger. Defined by user
TH2 * fhNbDigiPerEvtTime
histogram with the nb of all digis in the event
std::vector< std::pair< TNamed *, std::string > > fvpAllHistoPointers
vector with all created events
void SetDigis(std::vector< CbmTofDigi > *TofDigis)
std::vector< TH2 * > fvhNbDigiPerEvtTimeDet
Plotting time per TS.
static constexpr Double_t kdDefaultTimeWinEnd
TH1 * fhEventSize
histogram with the interval in seed time of consecutive events
void CheckTriggerCondition(Double_t dSeedTime)
Double_t fdPrevEvtEndTime
Save previous time information.
std::vector< TH1 * > fvhSelRatioPerTsNb
void SetDigis(std::vector< CbmTrdDigi > *TrdDigis)
std::vector< std::pair< TCanvas *, std::string > > GetCanvasVector()
void SwitchBmonStation(int id, bool on=true)
void UpdateTimeWinBoundariesExtrema()
void ChangeMuchBeamtimeDigiFlag(Bool_t bFlagIn=kFALSE)
Bool_t fbUseMuchBeamtimeDigi
Switch ON/OFF filling of histograms.
const std::vector< CbmTofDigi > * fTofDigis
CbmEvent * fCurrentEvent
Data ouptut.
void SetTsParameters(Double_t dTsStartTime, Double_t dTsLength, Double_t dTsOverLength)
void SetDigis(std::vector< CbmMuchBeamTimeDigi > *MuchBeamTimeDigis)
ClassDefNV(CbmAlgoBuildRawEvents, 2)
Save previous event last digi time information.
void SetSeedTimeWindow(Double_t timeWinBeg, Double_t timeWinEnd)
CbmAlgoBuildRawEvents operator=(const CbmAlgoBuildRawEvents &)=delete
std::vector< RawEventBuilderDetector > fvDets
TH1 * fhCpuTimePerTs
histogram with the nb of all digis per event vs seed time of the events
UInt_t GetNofDigis(ECbmModuleId detId)
void SetDigis(std::vector< CbmFsdDigi > *FsdDigis)
void SetSeedTimes(std::vector< Double_t > *SeedTimes)
UInt_t fuNrTs
Event Counter.
std::vector< std::pair< TCanvas *, std::string > > fvpAllCanvasPointers
Vector of pointers to histograms + optional folder name.
Double_t fdSeedWindowBeg
Seed window.
void RemoveDetector(RawEventBuilderDetector selDet)
void AddDetector(ECbmModuleId selDet, ECbmDataType dataTypeIn, std::string sNameIn, UInt_t uTriggerMinDigisIn=0, Int_t iTriggerMaxDigisIn=-1, Double_t fdTimeWinBegIn=-100, Double_t fdTimeWinEndIn=100)
std::vector< CbmEvent * > fEventVector
pointer to the event which is currently build
TDirectoryFile * GetOutFolder()
Bool_t fbFillHistos
Ignore data in Overlap part of the TS.
void SetTimings(Bool_t var)
std::vector< CbmEvent * > & GetEventVector()
Data output access.
void AddHistoToVector(TNamed *pointer, std::string sFolder="")
For monitor algos.
void SearchMatches(Double_t dSeedTime, RawEventBuilderDetector &detMatch)
Double_t fdWidestTimeWinRange
TH1 * fhSizeReductionPerTs
ratio of selected digi size in total event size vs TS in run
void SetTriggerMaxNumber(ECbmModuleId selDet, Int_t iVal)
Bool_t HasTrigger(CbmEvent *)
const std::vector< CbmRichDigi > * fRichDigis
TH1 * fhRealTimePerTsHist
Plotting time per TS.
const std::vector< CbmStsDigi > * fStsDigis
TH1 * fhEventTime
Vector of pointers to canvases + optional folder name.
Double_t fdSeedTimeWinEnd
Bool_t fbGetTimings
Switch between MUCH digi classes.
const std::vector< CbmMuchBeamTimeDigi > * fMuchBeamTimeDigis
std::vector< TH1 * > fvhTDiff
histograms with the nb of digis in each detector per event
const std::vector< CbmMuchDigi > * fMuchDigis
void SetDigis(std::vector< CbmPsdDigi > *PsdDigis)
void ResetHistograms(Bool_t bResetTime=kTRUE)
TH1 * fhRealTimePerTs
Processing time per TS.
TProfile * fhOverEventShareTs
histogram with proportion of overlap evt, AllowOverlap only
bool filterBmon(int32_t add)
Filter Bmon stations. Hack added for the mCBM2024 data (AB)
void AddCanvasToVector(TCanvas *pointer, std::string sFolder="")
Bool_t fbUseTsMetaData
Measure CPU time using stopwatch.
std::vector< TH1 * > fvhNbDigiPerEvtDet
histograms with the nb of digis in each detector per event vs seed time of the events
void CheckSeed(Double_t dSeedTime, UInt_t uSeedDigiIdx)
void SetTriggerMinLayersNumber(ECbmModuleId selDet, UInt_t uVal)
Double_t fdSeedTimeWinBeg
Double_t fdPrevEvtTime
Timeslice Counter.
void SetTriggerMinNumber(ECbmModuleId selDet, UInt_t uVal)
TH1 * fhOverEventShare
ratio of total selected size to input size selected vs TS in run
TClonesArray * fTimeSliceMetaDataArray
Data input.
Bool_t CheckDataAvailable(const RawEventBuilderDetector &det)
Internal methods.
void SetDigis(std::vector< CbmBmonDigi > *BmonDigis)
Set digi containers.
void SetReferenceDetector(ECbmModuleId refDet, ECbmDataType dataTypeIn, std::string sNameIn, UInt_t uTriggerMinDigisIn=0, Int_t iTriggerMaxDigisIn=-1, Double_t fdTimeWinBegIn=-100, Double_t fdTimeWinEndIn=100)
bool SetBmonEventTime(CbmEvent *event)
CbmAlgoBuildRawEvents(const CbmAlgoBuildRawEvents &)=delete
Double_t fdEarliestTimeWinBeg
const std::vector< CbmPsdDigi > * fPsdDigis
RawEventBuilderDetector fRefDet
is create when fbGetTimings is set before init
void SetTriggerWindow(ECbmModuleId selDet, Double_t dWinBeg, Double_t dWinEnd)
void SetDigis(std::vector< CbmMuchDigi > *MuchDigis)
const Digi * GetDigi(UInt_t uDigi)
const std::vector< CbmFsdDigi > * fFsdDigis
Double_t fdLatestTimeWinEnd
TH1 * fhEventDt
histogram with the seed time of the events
std::vector< bool > fUseBmonMap
Read Ts Parameters from input tree.
std::vector< TH1 * > fvhInpRatioPerTsSz
ratio of selected/input digi vs TS in run
Data class for a signal in the t-zero detector.
Class characterising one event by a collection of links (indices) to data objects,...
Data class for FSD digital information.
Data class for PSD digital information.
Data class for a single-channel message in the STS.
Data class for expanded digital TOF information.
RawEventBuilderDetector(ECbmModuleId detIdIn, ECbmDataType dataTypeIn, std::string sNameIn, UInt_t uTriggerMinDigisIn, Int_t iTriggerMaxDigisIn, Double_t fdTimeWinBegIn, Double_t fdTimeWinEndIn, UInt_t uTriggerMinLayersIn=0, Double_t fdHistMaxDigiNbIn=1000)
Int_t fiTriggerMaxDigis
Maximum number of digis per detector needed to generate an event, -1 means no cut,...
UInt_t fuTriggerMinLayers
Minimum number of fired layers needed to generate an event, 0 means do not require for event selectio...
RawEventBuilderDetector()=default
RawEventBuilderDetector(ECbmModuleId detIdIn, ECbmDataType dataTypeIn, std::string sNameIn)
ECbmModuleId detId
Settings.
Double_t fdTimeWinBeg
Selection Window.
bool operator!=(const RawEventBuilderDetector &other) const
UInt_t fuTriggerMinDigis
Minimum number of digis per detector needed to generate an event, 0 means do not use for event select...
Double_t GetTimeWinRange()
bool operator==(const RawEventBuilderDetector &other) const
Double_t fdHistMaxDigiNb
Histo configuration.
UInt_t fuStartIndex
Book-keeping variables.