KaliVeda  1.13/01
Heavy-Ion Analysis Toolkit
KVExpSetUp.h
Go to the documentation of this file.
1 
4 #ifndef __KVEXPSETUP_H
5 #define __KVEXPSETUP_H
6 
7 #include "KVMultiDetArray.h"
8 #include <KVExpDB.h>
9 class KVDBRun;
10 
24 class KVExpSetUp : public KVMultiDetArray {
25 
26  void for_each_array(const std::function<void(KVMultiDetArray*)>& f,
27  const std::function<bool(KVMultiDetArray*)>& break_cond = [](KVMultiDetArray*)
28  {
29  return false;
30  })
31  const
32  {
37  TIter next_array(&fMDAList);
38  KVMultiDetArray* mda;
39  while ((mda = (KVMultiDetArray*)next_array())) {
40  f(mda);
41  if (break_cond(mda)) break;
42  }
43  }
44 
45 protected:
48 
49  void init();
50 
51 #ifdef WITH_MFM
52  Bool_t handle_raw_data_event_mfmframe(const MFMCommonFrame& mfmframe)
53  {
58 
59  Bool_t return_value = kFALSE;
61  [](KVMultiDetArray*) {},
62  [&](KVMultiDetArray * mda) {
63  if (mda->handle_raw_data_event_mfmframe(mfmframe)) {
64  mda->fHandledRawData = true;
65  return_value = kTRUE;
66  }
67  return return_value;
68  }
69  );
70  return return_value;
71  }
72 #endif
74  {
77  }
78  );
79  }
80 
82  {
85  }
86  );
87  }
88 
89 public:
90 
91  KVExpSetUp();
92  virtual ~KVExpSetUp();
93  virtual void Build(Int_t run = -1);
94  void Clear(Option_t* opt = "")
95  {
97 
98  for_each_array([ = ](KVMultiDetArray * mda) {
99  mda->Clear(opt);
100  });
101  }
102 
103  void FillDetectorList(KVReconstructedNucleus* rnuc, KVHashList* DetList, const KVString& DetNames)
104  {
107 
109  [ = ](KVMultiDetArray * mda) {
110  mda->FillDetectorList(rnuc, DetList, DetNames);
111  },
112  [ = ](KVMultiDetArray*) {
113  return !DetList->IsEmpty();
114  }
115  );
116  }
117  virtual KVMultiDetArray* GetArray(const Char_t* name) const
118  {
120  return (KVMultiDetArray*)fMDAList.FindObject(name);
121  }
123 
124  void GetDetectorEvent(KVDetectorEvent* detev, const TSeqCollection* fired_params = nullptr)
125  {
128 
130  [ = ](KVMultiDetArray * mda) {
131  mda->GetDetectorEvent(detev, fired_params);
132  }
133  );
134  }
136  {
139 
140  KVGroupReconstructor* gr(nullptr);
142  [ =, &gr](KVMultiDetArray * mda) {
143  gr = mda->GetReconstructorForGroup(g);
144  },
145  [ = ](KVMultiDetArray*) {
146  return gr != nullptr;
147  }
148  );
149  return gr;
150  }
152  {
154  for_each_array([&](KVMultiDetArray * mda) {
156  });
157  }
158 
160 
162  {
163  TString orig_dbtype = db->GetDBType();
164  for_each_array([ = ](KVMultiDetArray * mda) {
165  db->SetDBType(Form("%sDB", mda->GetName()));
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  }
179  void CheckStatusOfDetectors(KVDBRun* r, const TString& = "")
180  {
182  for_each_array([ = ](KVMultiDetArray * mda) {
183  mda->SetCurrentRunNumber(r->GetNumber());
184  mda->CheckStatusOfDetectors(r, mda->GetName());
185  }
186  );
187  }
188 
189  virtual void AcceptAllIDCodes()
190  {
193 
194  for_each_array([](KVMultiDetArray * mda) {
195  mda->AcceptAllIDCodes();
196  }
197  );
198  }
199  virtual void AcceptAllECodes()
200  {
203 
204  for_each_array([](KVMultiDetArray * mda) {
205  mda->AcceptAllECodes();
206  }
207  );
208  }
209 
210  virtual void InitializeIDTelescopes()
211  {
213 
214  for_each_array([](KVMultiDetArray * mda) {
215  mda->InitializeIDTelescopes();
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)
char Char_t
const Bool_t kFALSE
bool Bool_t
const Bool_t kTRUE
const char Option_t
#define ClassDef(name, id)
char * Form(const char *fmt,...)
Description of an experimental run in database ,.
Definition: KVDBRun.h:35
Base class to describe database of an experiment ,.
Definition: KVExpDB.h:19
void SetDBType(const TString &s)
Definition: KVExpDB.h:49
TString GetDBType() const
Definition: KVExpDB.h:45
Describe an experimental set-up coupling two or more different detector arrays.
Definition: KVExpSetUp.h:24
virtual void SetSimMode(Bool_t on=kTRUE)
Definition: KVExpSetUp.h:230
virtual void SetExpectedDetectorSignalNames()
Definition: KVExpSetUp.h:81
KVExpSetUp()
Default constructor.
Definition: KVExpSetUp.cpp:37
void SetRawDataFromReconEvent(KVNameValueList &l)
Definition: KVExpSetUp.h:151
Bool_t handle_raw_data_event_mfmframe(const MFMCommonFrame &mfmframe)
Definition: KVExpSetUp.h:52
void GetArrayMultiplicities(KVReconstructedEvent *, KVNameValueList &, Option_t *="")
Definition: KVExpSetUp.cpp:181
KVList fMDAList
list of multidetarrays
Definition: KVExpSetUp.h:46
virtual void AcceptParticleForAnalysis(KVReconstructedNucleus *) const
Definition: KVExpSetUp.cpp:148
virtual void AcceptAllIDCodes()
Definition: KVExpSetUp.h:189
void Clear(Option_t *opt="")
Definition: KVExpSetUp.h:94
void FillDetectorList(KVReconstructedNucleus *rnuc, KVHashList *DetList, const KVString &DetNames)
Definition: KVExpSetUp.h:103
virtual ~KVExpSetUp()
Destructor.
Definition: KVExpSetUp.cpp:48
void GetDetectorEvent(KVDetectorEvent *detev, const TSeqCollection *fired_params=nullptr)
Definition: KVExpSetUp.h:124
void SetCalibratorParameters(KVDBRun *r, const TString &="")
Definition: KVExpSetUp.h:171
virtual void Build(Int_t run=-1)
Definition: KVExpSetUp.cpp:63
virtual void InitializeIDTelescopes()
Definition: KVExpSetUp.h:210
KVGroupReconstructor * GetReconstructorForGroup(const KVGroup *g) const
Definition: KVExpSetUp.h:135
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:26
Bool_t HandleRawDataEvent(KVRawDataReader *)
Definition: KVExpSetUp.cpp:209
void copy_fired_parameters_to_recon_param_list()
Definition: KVExpSetUp.h:73
virtual void SetTarget(KVTarget *target)
Definition: KVExpSetUp.h:239
void init()
Definition: KVExpSetUp.cpp:21
void CheckStatusOfDetectors(KVDBRun *r, const TString &="")
Definition: KVExpSetUp.h:179
KVString lmultidetarrayclasses
Definition: KVExpSetUp.h:47
virtual KVMultiDetArray * GetArray(const Char_t *name) const
Definition: KVExpSetUp.h:117
void MakeCalibrationTables(KVExpDB *db)
Definition: KVExpSetUp.h:161
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:19
Extended version of ROOT THashList.
Definition: KVHashList.h:28
Extended TList class which owns its objects by default.
Definition: KVList.h:27
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 copy_fired_parameters_to_recon_param_list()
virtual void MakeCalibrationTables(KVExpDB *)
virtual void Clear(Option_t *opt="")
virtual void CheckStatusOfDetectors(KVDBRun *, const TString &="")
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:72
Calculation/correction of energy losses of particles through an experimental target.
Definition: KVTarget.h:126
virtual Bool_t IsEmpty() const
virtual const char * GetName() const
TGraphErrors * gr
const long double g
masses
Definition: KVUnits.h:72
constexpr Double_t R()
auto * l