KaliVeda
Toolkit for HIC analysis
Loading...
Searching...
No Matches
KVExpSetUp.h
1
3
4#ifndef __KVEXPSETUP_H
5#define __KVEXPSETUP_H
6
7#include "KVMultiDetArray.h"
8#include <KVExpDB.h>
9class KVDBRun;
10
26
27 void for_each_array(const std::function<void(KVMultiDetArray*)>& f,
28 const std::function<bool(KVMultiDetArray*)>& break_cond = [](KVMultiDetArray*)
29 {
30 return false;
31 })
32 const
33 {
38 TIter next_array(&fMDAList);
39 KVMultiDetArray* mda;
40 while ((mda = (KVMultiDetArray*)next_array())) {
41 f(mda);
42 if (break_cond(mda)) break;
43 }
44 }
45
46protected:
49
50 void init();
51
52#ifdef WITH_MFM
53 Bool_t handle_raw_data_event_mfmframe(const MFMCommonFrame& mfmframe)
54 {
59
60 Bool_t return_value = kFALSE;
62 [](KVMultiDetArray*) {},
63 [&](KVMultiDetArray * mda) {
64 if (mda->handle_raw_data_event_mfmframe(mfmframe)) {
65 mda->fHandledRawData = true;
66 return_value = kTRUE;
67 }
68 return return_value;
69 }
70 );
71 return return_value;
72 }
73#endif
81
83 {
86 }
87 );
88 }
89
90public:
91
92 KVExpSetUp();
93 virtual ~KVExpSetUp();
94 virtual void Build(Int_t run = -1);
95 void Clear(Option_t* opt = "")
96 {
98
99 for_each_array([ = ](KVMultiDetArray * mda) {
100 mda->Clear(opt);
101 });
102 }
103
104 void FillDetectorList(KVReconstructedNucleus* rnuc, KVHashList* DetList, const KVString& DetNames)
105 {
108
110 [ = ](KVMultiDetArray * mda) {
111 mda->FillDetectorList(rnuc, DetList, DetNames);
112 },
113 [ = ](KVMultiDetArray*) {
114 return !DetList->IsEmpty();
115 }
116 );
117 }
118 virtual KVMultiDetArray* GetArray(const Char_t* name) const
119 {
122 }
124
125 void GetDetectorEvent(KVDetectorEvent* detev, const TSeqCollection* fired_params = nullptr)
126 {
129
131 [ = ](KVMultiDetArray * mda) {
132 mda->GetDetectorEvent(detev, fired_params);
133 }
134 );
135 }
137 {
140
141 KVGroupReconstructor* gr(nullptr);
143 [ =, &gr](KVMultiDetArray * mda) {
145 },
146 [ =, &gr ](KVMultiDetArray * mda) {
147 return gr != nullptr;
148 }
149 );
150 return gr;
151 }
159
161
163 {
164 TString orig_dbtype = db->GetDBType();
165 for_each_array([ = ](KVMultiDetArray * mda) {
166 mda->MakeCalibrationTables(db);
167 }
168 );
169 db->SetDBType(orig_dbtype);
170 }
172 {
174 for_each_array([ = ](KVMultiDetArray * mda) {
175 mda->SetCalibratorParameters(r, mda->GetName());
176 }
177 );
178 }
180 {
182 for_each_array([ = ](KVMultiDetArray * mda) {
183 mda->SetCurrentRunNumber(r->GetNumber());
185 }
186 );
187 }
188
189 virtual void AcceptAllIDCodes()
190 {
193
195 mda->AcceptAllIDCodes();
196 }
197 );
198 }
199 virtual void AcceptAllECodes()
200 {
203
205 mda->AcceptAllECodes();
206 }
207 );
208 }
209
211 {
213
216 }
217 );
218 }
219
221 {
223 for_each_array([ = ](KVMultiDetArray * mda) {
225 }
226 );
227 }
229
230 virtual void SetSimMode(Bool_t on = kTRUE)
231 {
233
234 for_each_array([ = ](KVMultiDetArray * mda) {
235 mda->SetSimMode(on);
236 }
237 );
238 }
239 virtual void SetTarget(KVTarget* target)
240 {
242
244 for_each_array([ = ](KVMultiDetArray * mda) {
245 mda->SetTarget(target);
246 }
247 );
248 }
249
250 ClassDef(KVExpSetUp, 1) //Describe an experimental set-up made of several KVMultiDetArray objects
251};
252
253#endif
int Int_t
ROOT::R::TRInterface & r
#define f(i)
bool Bool_t
char Char_t
constexpr Bool_t kFALSE
constexpr Bool_t kTRUE
const char Option_t
#define ClassDef(name, id)
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t target
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void on
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t g
char name[80]
Description of an experimental run in database ,,.
Definition KVDBRun.h:36
List of hit groups in a multidetector array.
Base class to describe database of an experiment ,,.
Definition KVExpDB.h:20
void SetDBType(const TString &s)
Definition KVExpDB.h:50
TString GetDBType() const
Definition KVExpDB.h:46
Describe an experimental set-up coupling two or more different detector arrays.
Definition KVExpSetUp.h:25
virtual void SetSimMode(Bool_t on=kTRUE)
Definition KVExpSetUp.h:230
virtual void SetExpectedDetectorSignalNames()
Definition KVExpSetUp.h:82
KVExpSetUp()
Default constructor.
void SetRawDataFromReconEvent(KVNameValueList &l)
Definition KVExpSetUp.h:152
void SetDetectorParametersForRun(KVDBRun *r, const TString &="")
Definition KVExpSetUp.h:179
Bool_t handle_raw_data_event_mfmframe(const MFMCommonFrame &mfmframe)
Definition KVExpSetUp.h:53
void GetArrayMultiplicities(KVReconstructedEvent *, KVNameValueList &, Option_t *="")
KVList fMDAList
list of multidetarrays
Definition KVExpSetUp.h:47
virtual void AcceptParticleForAnalysis(KVReconstructedNucleus *) const
virtual void AcceptAllIDCodes()
Definition KVExpSetUp.h:189
virtual KVMultiDetArray * GetArray(const Char_t *name) const
Definition KVExpSetUp.h:118
void Clear(Option_t *opt="")
Definition KVExpSetUp.h:95
void FillDetectorList(KVReconstructedNucleus *rnuc, KVHashList *DetList, const KVString &DetNames)
Definition KVExpSetUp.h:104
virtual ~KVExpSetUp()
Destructor.
void GetDetectorEvent(KVDetectorEvent *detev, const TSeqCollection *fired_params=nullptr)
Definition KVExpSetUp.h:125
KVGroupReconstructor * GetReconstructorForGroup(const KVGroup *g) const
Definition KVExpSetUp.h:136
void SetCalibratorParameters(KVDBRun *r, const TString &="")
Definition KVExpSetUp.h:171
virtual void Build(Int_t run=-1)
virtual void InitializeIDTelescopes()
Definition KVExpSetUp.h:210
void InitialiseRawDataReading(KVRawDataReader *R)
Definition KVExpSetUp.h:220
virtual void AcceptAllECodes()
Definition KVExpSetUp.h:199
void for_each_array(const std::function< void(KVMultiDetArray *)> &f, const std::function< bool(KVMultiDetArray *)> &break_cond=[](KVMultiDetArray *) { return false;}) const
Definition KVExpSetUp.h:27
Bool_t HandleRawDataEvent(KVRawDataReader *)
void copy_fired_parameters_to_recon_param_list()
Definition KVExpSetUp.h:74
virtual void SetTarget(KVTarget *target)
Definition KVExpSetUp.h:239
void init()
KVString lmultidetarrayclasses
Definition KVExpSetUp.h:48
void MakeCalibrationTables(KVExpDB *db)
Definition KVExpSetUp.h:162
Base class for particle reconstruction in one group of a detector array.
Group of detectors which can be treated independently of all others in array.
Definition KVGroup.h:20
Extended version of ROOT THashList.
Definition KVHashList.h:29
Extended TList class which owns its objects by default.
Definition KVList.h:28
Base class for describing the geometry of a detector array.
virtual void GetDetectorEvent(KVDetectorEvent *detev, const TSeqCollection *fired_params=0)
virtual void AcceptAllECodes()
Bool_t HandledRawData() const
Bool_t fHandledRawData
set to true if multidetector handles data in last call to HandleRawData
void prepare_to_handle_new_raw_data()
reset acquisition parameters etc. before reading new raw data event
virtual void InitialiseRawDataReading(KVRawDataReader *)
virtual void SetExpectedDetectorSignalNames()
void SetCurrentRunNumber(UInt_t r)
virtual void SetDetectorParametersForRun(KVDBRun *, const TString &="")
virtual void copy_fired_parameters_to_recon_param_list()
virtual void MakeCalibrationTables(KVExpDB *)
virtual void Clear(Option_t *opt="")
virtual KVGroupReconstructor * GetReconstructorForGroup(const KVGroup *) const
virtual void FillDetectorList(KVReconstructedNucleus *rnuc, KVHashList *DetList, const KVString &DetNames)
virtual Bool_t handle_raw_data_event_mfmframe(const MFMCommonFrame &)
virtual void SetRawDataFromReconEvent(KVNameValueList &)
virtual void InitializeIDTelescopes()
virtual void SetSimMode(Bool_t on=kTRUE)
virtual void SetTarget(KVTarget *target)
virtual void AcceptAllIDCodes()
virtual void SetCalibratorParameters(KVDBRun *, const TString &="")
Handles lists of named parameters with different types, a list of KVNamedParameter objects.
Abstract base class for reading raw (DAQ) data.
Event containing KVReconstructedNucleus nuclei reconstructed from hits in detectors.
Nuclei reconstructed from data measured by a detector array .
virtual TObject * FindObject(const char *name) const
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
Definition KVString.h:73
Calculation/correction of energy losses of particles through an experimental target.
Definition KVTarget.h:127
virtual Bool_t IsEmpty() const
const char * GetName() const override
TGraphErrors * gr
constexpr Double_t R()
TLine l