CbmRoot
Loading...
Searching...
No Matches
CbmMcbmCheckTimingAlgo.h
Go to the documentation of this file.
1/* Copyright (C) 2020-2024 Facility for Antiproton and Ion Research in Europe, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Pierre-Alain Loizeau [committer], Andreas Redelbach, Alexandru Bercuci */
4
5#ifndef CBMMCBMCHECKTIMINGALGO_H
6#define CBMMCBMCHECKTIMINGALGO_H
7
8#include "CbmModuleList.h"
9#include "CbmTofDigi.h"
10#include "CbmTrdDigi.h"
11#include "CbmTsEventHeader.h"
12
13#include "TString.h"
14
15#include <unordered_set>
16#include <vector>
17
18class TH1;
19class TH2;
20class CbmDigiManager;
21class CbmStsDigi;
22class CbmMuchDigi;
23class CbmTrdDigi;
24class CbmTofDigi;
25class CbmRichDigi;
26class CbmPsdDigi;
27class CbmBmonDigi;
29public:
31 CheckTimingDetector(ECbmModuleId detIdIn, std::string sNameIn)
32 {
33 detId = detIdIn;
34 sName = sNameIn;
35 }
36
39 std::string sName = "Invalid";
40 Double_t dTimeRangeBeg = -1000.0;
41 Double_t dTimeRangeEnd = 1000.0;
42 UInt_t uRangeNbBins = 320;
44 0;
46 0;
47 UInt_t uNviews = 1;
48 std::vector<std::string> vName = {""};
50 Double_t dPrevTime = 0.;
52};
53
55public:
57
60
62 // CbmMcbmCheckTimingAlgo(Int_t verbose);
63
64
67
68
70 Bool_t Init();
71
73 Bool_t ReInit();
74
75
77 void ProcessTs();
78
80 void SetParContainers();
81
83 void Finish();
84
85 inline void SetOutFilename(TString sNameIn) { fOutFileName = sNameIn; }
86 void WriteHistos();
87
88 void SetReferenceDetector(ECbmModuleId refDetIn, std::string sNameIn, Double_t dTimeRangeBegIn = -1000.0,
89 Double_t dTimeRangeEndIn = 1000.0, UInt_t uRangeNbBinsIn = 320, UInt_t uChargeCutMinIn = 0,
90 UInt_t uChargeCutMaxIn = 0);
91 void AddCheckDetector(ECbmModuleId detIn, std::string sNameIn, Double_t dTimeRangeBegIn = -1000.0,
92 Double_t dTimeRangeEndIn = 1000.0, UInt_t uRangeNbBinsIn = 320, UInt_t uChargeCutMinIn = 0,
93 UInt_t uChargeCutMaxIn = 0);
95 void SetDetectorDifferential(ECbmModuleId detIn, std::vector<std::string> vName);
96
97 void SetTrdPeakWidthNs(Double_t val = 120.) { fTrdPeakWidthNs = val; }
98 void SetStsPeakWidthNs(Double_t val = 30.) { fStsPeakWidthNs = val; }
99 void SetMuchPeakWidthNs(Double_t val = 100.) { fMuchPeakWidthNs = val; }
100 void SetTofPeakWidthNs(Double_t val = 20.) { fTofPeakWidthNs = val; }
101 void SetRichPeakWidthNs(Double_t val = 40.) { fRichPeakWidthNs = val; }
102 void SetPsdPeakWidthNs(Double_t val = 20.) { fPsdPeakWidthNs = val; }
103
104private:
105 void CheckDataPresence(CheckTimingDetector detToCheck);
106 void CreateHistos();
107
108 template<class DigiRef>
110 template<class Digi>
111 void FillTimeOffsetHistos(const Double_t dRefTime, const Double_t dRefCharge, UInt_t uDetIdx);
119 template<class Digi>
120 UInt_t GetDigiInfo(UInt_t iDigi, std::vector<std::tuple<double, double, UInt_t>>* vec,
127 template<class Digi>
128 int GetViewId(CheckTimingDetector det, std::tuple<double, double, UInt_t> info);
129
132
134 const std::vector<CbmBmonDigi>* fpBmonDigiVec = nullptr;
135
140
141 //
142 UInt_t fuNbTs = 0;
143
149
151 std::map<ECbmModuleId, std::vector<TH1*>> fvhDetSelfDiff = {};
152 std::map<ECbmModuleId, std::vector<TH1*>> fvhDetToRefDiff = {};
153 std::map<ECbmModuleId, std::vector<TH2*>> fvhDetToRefDiffRefCharge = {};
154 std::map<ECbmModuleId, std::vector<TH2*>> fvhDetToRefDiffDetCharge = {};
155 std::map<ECbmModuleId, std::vector<TH2*>> fvhDetToRefDiffEvo = {};
156 std::map<ECbmModuleId, std::vector<TH2*>> fvhDetToRefDiffEvoLong = {};
157
159 TString fOutFileName = "data/HistosCheckTiming.root";
162 Double_t fTrdPeakWidthNs = 120.;
163 Double_t fStsPeakWidthNs = 30.;
164 Double_t fMuchPeakWidthNs = 100.;
165 Double_t fTofPeakWidthNs = 20.;
166 Double_t fRichPeakWidthNs = 40.;
167 Double_t fPsdPeakWidthNs = 20.;
168
169 std::map<ECbmModuleId, std::unordered_set<std::string>> fUnimplementedView = {};
170
172};
173
174#endif
ECbmModuleId
Definition CbmDefs.h:39
@ kTrd
Transition Radiation Detector.
@ kTof
Time-of-flight Detector.
@ kNotExist
If not found.
@ kPsd
Projectile spectator detector.
@ kSts
Silicon Tracking System.
@ kMuch
Muon detection system.
@ kRich
Ring-Imaging Cherenkov Detector.
Data class for a signal in the t-zero detector.
Definition CbmBmonDigi.h:30
CbmDigiManager.
std::map< ECbmModuleId, std::vector< TH2 * > > fvhDetToRefDiffEvo
void AddCheckDetector(ECbmModuleId detIn, std::string sNameIn, Double_t dTimeRangeBegIn=-1000.0, Double_t dTimeRangeEndIn=1000.0, UInt_t uRangeNbBinsIn=320, UInt_t uChargeCutMinIn=0, UInt_t uChargeCutMaxIn=0)
void SetDetectorDifferential(ECbmModuleId detIn, std::vector< std::string > vName)
std::map< ECbmModuleId, std::vector< TH2 * > > fvhDetToRefDiffDetCharge
void SetTrdPeakWidthNs(Double_t val=120.)
void SetTofPeakWidthNs(Double_t val=20.)
CbmMcbmCheckTimingAlgo operator=(const CbmMcbmCheckTimingAlgo &)=delete
void SetOutFilename(TString sNameIn)
void SetRichPeakWidthNs(Double_t val=40.)
UInt_t GetDigiInfo(UInt_t iDigi, std::vector< std::tuple< double, double, UInt_t > > *vec, ECbmModuleId detId=ECbmModuleId::kNotExist)
Retrieve digi (time,charge,addres) info. SHOULD BE IMPLEMENTED BY DETECTORS IF MORE DIFFERENTIAL STUD...
std::map< ECbmModuleId, std::unordered_set< std::string > > fUnimplementedView
const CbmTsEventHeader * fCbmTsEventHeader
Pointer to the Timeslice start time used to write it to the output tree.
const std::vector< CbmBmonDigi > * fpBmonDigiVec
std::map< ECbmModuleId, std::vector< TH1 * > > fvhDetSelfDiff
vectors storing histograms for each detector under investigation
void SetStsPeakWidthNs(Double_t val=30.)
ClassDefNV(CbmMcbmCheckTimingAlgo, 1)
std::map< ECbmModuleId, std::vector< TH1 * > > fvhDetToRefDiff
void SetReferenceDetector(ECbmModuleId refDetIn, std::string sNameIn, Double_t dTimeRangeBegIn=-1000.0, Double_t dTimeRangeEndIn=1000.0, UInt_t uRangeNbBinsIn=320, UInt_t uChargeCutMinIn=0, UInt_t uChargeCutMaxIn=0)
void CheckDataPresence(CheckTimingDetector detToCheck)
void SetPsdPeakWidthNs(Double_t val=20.)
std::map< ECbmModuleId, std::vector< TH2 * > > fvhDetToRefDiffRefCharge
void SetMuchPeakWidthNs(Double_t val=100.)
void FillTimeOffsetHistos(const Double_t dRefTime, const Double_t dRefCharge, UInt_t uDetIdx)
int GetViewId(CheckTimingDetector det, std::tuple< double, double, UInt_t > info)
Retrieve the detector view corresponding to the digi data (.
void RemoveCheckDetector(ECbmModuleId detIn)
CbmMcbmCheckTimingAlgo(const CbmMcbmCheckTimingAlgo &)=delete
std::map< ECbmModuleId, std::vector< TH2 * > > fvhDetToRefDiffEvoLong
std::vector< CheckTimingDetector > fvDets
Data class for PSD digital information.
Definition CbmPsdDigi.h:36
Data class for a single-channel message in the STS.
Definition CbmStsDigi.h:40
Data class for expanded digital TOF information.
Definition CbmTofDigi.h:47
CheckTimingDetector(ECbmModuleId detIdIn, std::string sNameIn)
std::vector< std::string > vName
No of views for each detector.
UInt_t uChargeCutMax
Charge cut used for example to reject/select pulser, no effect if equal, select if min < max,...
Double_t dPrevTime
Book-keeping variables.
UInt_t uNviews
Charge cut used for example to reject/select pulser, no effect if equal, select if min < max,...
ECbmModuleId detId
Settings.