KaliVeda  1.13/01
Heavy-Ion Analysis Toolkit
KVFAZIA.h
Go to the documentation of this file.
1 
4 #ifndef __KVFAZIA_H
5 #define __KVFAZIA_H
6 
7 #include "KVMultiDetArray.h"
8 
9 #include <KVGeoImport.h>
10 #include <KVEnv.h>
11 #include <KVSignal.h>
12 #include "KVFAZIATrigger.h"
13 
14 #if ROOT_VERSION_CODE <= ROOT_VERSION(5,32,0)
15 #include "TGeoMatrix.h"
16 #endif
17 
18 class KVDetectorEvent;
19 #ifdef WITH_PROTOBUF
20 #ifndef __CINT__
21 namespace DAQ {
22  class FzEvent;
23 }
24 #endif
25 #endif
26 
32 class KVFAZIA : public KVMultiDetArray {
33 protected:
52  int fQuartet[8][2];
53  int fTelescope[8][2];
54 
60 
63 
64  void SetTriggerPatternsForDataSet(const TString& dataset);
65  void SetTriggerPattern(uint16_t fp)
66  {
68  }
69 
71  virtual void BuildFAZIA();
72  virtual void GetGeometryParameters();
74 
75  virtual void BuildTarget();
77  virtual void SetNameOfDetectors(KVEnv& env);
78 
80 
81 #ifdef WITH_MFM
82  Bool_t handle_raw_data_event_mfmframe(const MFMCommonFrame&);
83 #endif
85  {
93  }
94 
96 
97  void CreateCorrespondence();
98 #ifdef WITH_PROTOBUF
100 #ifndef __CINT__
101  Bool_t treat_event(const DAQ::FzEvent&);
102 #endif
103  Double_t TreatEnergy(Int_t sigid, Int_t eid, UInt_t val);
104 #endif
105  TString GetSignalName(Int_t bb, Int_t qq, Int_t tt, Int_t idsig);
106 
107  void ReadTriggerPatterns(KVExpDB* db);
108 
110  {
114  }
116 
120  {
122  return ECodes::NORMAL_CALIBRATION;
123  }
124 public:
125  enum IDCodes {
130  ID_GAMMA = 0,
131  ID_SI1_PSA = 11,
132  ID_SI1_SI2 = 12,
133  ID_SI1_CSI = 13,
134  ID_SI2_PSA = 22,
135  ID_SI2_CSI = 23,
136  ID_SI12_CSI = 123,
137  ID_CSI_PSA = 33,
142  };
144  {
145  switch (idc) {
146  case NO_IDENTIFICATION:
147  return "NO_IDENTIFICATION";
148  case ID_GAMMA:
149  return "ID_GAMMA";
150  case ID_SI1_PSA:
151  return "ID_SI1_PSA";
152  case ID_SI2_PSA:
153  return "ID_SI2_PSA";
154  case ID_SI1_SI2:
155  return "ID_SI1_SI2";
156  case ID_SI2_CSI:
157  return "ID_SI2_CSI";
158  case ID_SI1_CSI:
159  return "ID_SI1_CSI";
160  case ID_SI12_CSI:
161  return "ID_SI12_CSI";
162  case ID_CSI_PSA:
163  return "ID_CSI_PSA";
165  return "ID_STOPPED_IN_FIRST_STAGE";
167  return "ID_SI1_SI2_MAYBE_PUNCH_THROUGH";
169  return "ID_SI1_SI2_PUNCH_THROUGH";
171  return "ID_SI1_PUNCH_THROUGH";
172  default:
173  return Form("(unknown:%d)", idc);
174  }
175  }
176  enum ECodes {
185  };
187  {
188  switch (ec) {
190  return "NO_CALIBRATION_ATTEMPTED";
191  case NORMAL_CALIBRATION:
192  return "NORMAL_CALIBRATION";
194  return "SOME_ENERGY_LOSSES_CALCULATED";
196  return "WARNING_CSI_MAX_ENERGY";
198  return "ENERGY_LOSSES_TENTATIVELY_CALCULATED (for Z=1,2 stopped in uncalibrated CsI)";
199  default:
200  return Form("(unknown:%d)", ec);
201  }
202  }
204  {
205  return IDCodes::ID_STOPPED_IN_FIRST_STAGE;
206  }
207 
208  KVFAZIA(const Char_t* title = "");
209  virtual ~KVFAZIA();
210  void AddDetectorLabel(const Char_t* label);
211 
212  virtual void Build(Int_t = -1);
213 
214  void GetDetectorEvent(KVDetectorEvent* detev, const TSeqCollection* dets);
216  {
217  return fNblocks;
218  }
219  void IncludeTargetInGeometry(Bool_t include = kTRUE)
220  {
221  fBuildTarget = include;
222  }
223 
225  {
226  return fDetectorLabels;
227  }
228  const Char_t* GetSignalTypes() const
229  {
230  return fSignalTypes.Data();
231  }
232 
233  void SetGeometryImportParameters(Double_t dt = 0.25, Double_t dp = 1.0, Double_t tmin = 2., Double_t pmin = 0, Double_t tmax = 20., Double_t pmax = 360.,
234  Double_t xorg = 0, Double_t yorg = 0, Double_t zorg = 0)
235  {
238  fImport_dPhi = dp;
239  fImport_dTheta = dt;
240  fImport_PhiMax = pmax;
241  fImport_PhiMin = pmin;
242  fImport_ThetaMax = tmax;
243  fImport_ThetaMin = tmin;
244  fImport_Xorg = xorg;
245  fImport_Yorg = yorg;
246  fImport_Zorg = zorg;
247  }
248  void FillDetectorList(KVReconstructedNucleus* rnuc, KVHashList* DetList, const KVString& DetNames);
249 
251  Double_t GetSetupParameter(const Char_t* parname);
252 
253  const KVFAZIATrigger& GetTrigger() const
254  {
255  return fTrigger;
256  }
258  virtual void MakeCalibrationTables(KVExpDB*);
259 
260  std::string GetTriggerForCurrentRun() const;
262 
263  ClassDef(KVFAZIA, 1) //Base class for description of the FAZIA set up
264 };
265 
268 
269 #endif
int Int_t
unsigned int UInt_t
#define R__EXTERN
R__EXTERN KVFAZIA * gFazia
................ global variable
Definition: KVFAZIA.h:267
unsigned char UChar_t
char Char_t
bool Bool_t
double Double_t
#define ClassDef(name, id)
char * Form(const char *fmt,...)
Extension of TEnv to allow the writing of comments in the file.
Definition: KVEnv.h:16
Base class to describe database of an experiment ,.
Definition: KVExpDB.h:19
The trigger pattern for each FAZIA event.
void SetTriggerPattern(uint16_t tp)
Description of a FAZIA detector geometry.
Definition: KVFAZIA.h:32
Double_t fImport_Xorg
for geometry import
Definition: KVFAZIA.h:49
Double_t fImport_ThetaMin
for geometry import
Definition: KVFAZIA.h:45
Double_t fFDist
distance of FAZIA detectors from target (in cm)
Definition: KVFAZIA.h:35
Double_t fQ2risetime
Definition: KVFAZIA.h:57
KVGroupReconstructor * GetReconstructorForGroup(const KVGroup *) const
Specialized group reconstructor for FAZIA.
Definition: KVFAZIA.cpp:594
Double_t fQH1risetime
values of trapezoidal filter rise time set in the fpgas defined in .kvrootrc
Definition: KVFAZIA.h:56
Double_t TreatEnergy(Int_t sigid, Int_t eid, UInt_t val)
Definition: KVFAZIA.cpp:650
Double_t fQ3slowrisetime
Definition: KVFAZIA.h:58
void SetTriggerPatternsForDataSet(const TString &dataset)
Definition: KVFAZIA.cpp:394
void FillDetectorList(KVReconstructedNucleus *rnuc, KVHashList *DetList, const KVString &DetNames)
Definition: KVFAZIA.cpp:546
TString fFGeoType
type of FAZIA geometry (="compact",...)
Definition: KVFAZIA.h:34
void SetGeometryImportParameters(Double_t dt=0.25, Double_t dp=1.0, Double_t tmin=2., Double_t pmin=0, Double_t tmax=20., Double_t pmax=360., Double_t xorg=0, Double_t yorg=0, Double_t zorg=0)
Definition: KVFAZIA.h:233
int fQuartet[8][2]
quartet number from #FEE and #FPGA
Definition: KVFAZIA.h:52
Double_t GetSetupParameter(const Char_t *parname)
Definition: KVFAZIA.cpp:78
Double_t fImport_dTheta
for geometry import
Definition: KVFAZIA.h:43
void SetIDCodeForIDTelescope(KVIDTelescope *) const
Set the FAZIA-specific general identification code for the given telescope.
Definition: KVFAZIA.cpp:958
Double_t fFThetaMin
minimum polar angle for compact geometry (in degrees)
Definition: KVFAZIA.h:36
ECodes
Calibration quality codes attributed to particles reconstructed from data.
Definition: KVFAZIA.h:176
@ NO_CALIBRATION_ATTEMPTED
particle stopped in detectors with no available calibration
Definition: KVFAZIA.h:180
@ NORMAL_CALIBRATION
normal well-calibrated particle with no problems
Definition: KVFAZIA.h:181
@ WARNING_CSI_MAX_ENERGY
particle calibration OK, although apparent energy would mean punching through the CsI
Definition: KVFAZIA.h:183
@ ENERGY_LOSSES_TENTATIVELY_CALCULATED
particle calibration OK, with some detector energies tentatively calculated (Z<2)
Definition: KVFAZIA.h:184
@ SOME_ENERGY_LOSSES_CALCULATED
particle calibration OK, with some detector energies calculated
Definition: KVFAZIA.h:182
std::string GetTriggerForCurrentRun() const
Definition: KVFAZIA.cpp:129
void AddDetectorLabel(const Char_t *label)
Definition: KVFAZIA.cpp:254
Bool_t handle_raw_data_event_protobuf(KVProtobufDataReader &)
Definition: KVFAZIA.cpp:641
const KVFAZIATrigger & GetTrigger() const
Definition: KVFAZIA.h:253
virtual void BuildTarget()
Definition: KVFAZIA.cpp:442
virtual Int_t GetIDCodeForParticlesStoppingInFirstStageOfTelescopes() const
Definition: KVFAZIA.h:203
Int_t GetNumberOfBlocks() const
Definition: KVFAZIA.h:215
Int_t fStartingBlockNumber
Definition: KVFAZIA.h:38
void copy_fired_parameters_to_recon_param_list()
Definition: KVFAZIA.h:84
void DeduceIdentificationTelescopesFromGeometry()
Definition: KVFAZIA.cpp:167
TString fCorrespondanceFile
Bool_t fBuildTarget; //kTRUE to include target frame in the geometry.
Definition: KVFAZIA.h:40
Double_t fImport_PhiMax
for geometry import
Definition: KVFAZIA.h:48
virtual void SetNameOfDetectors(KVEnv &env)
Definition: KVFAZIA.cpp:304
Double_t fImport_Zorg
for geometry import
Definition: KVFAZIA.h:51
virtual void BuildFAZIA()
methods to be implemented in child classes
Definition: KVFAZIA.cpp:431
KVFAZIA(const Char_t *title="")
Default constructor.
Definition: KVFAZIA.cpp:54
virtual UChar_t GetNormalCalibrationCode()
Definition: KVFAZIA.h:119
void ReadTriggerPatterns(KVExpDB *db)
Definition: KVFAZIA.cpp:915
virtual void DefineStructureFormats(KVGeoImport &)
Definition: KVFAZIA.h:79
void GenerateCorrespondanceFile()
Definition: KVFAZIA.cpp:266
Double_t fQ3fastrisetime
Definition: KVFAZIA.h:59
KVString fSignalTypes
Definition: KVFAZIA.h:42
void PerformClosedROOTGeometryOperations()
Definition: KVFAZIA.cpp:335
Bool_t treat_event(const DAQ::FzEvent &)
Read raw data for an event.
Definition: KVFAZIA.cpp:681
virtual ~KVFAZIA()
Destructor.
Definition: KVFAZIA.cpp:243
Double_t fImport_dPhi
for geometry import
Definition: KVFAZIA.h:44
Double_t fImport_ThetaMax
for geometry import
Definition: KVFAZIA.h:46
int fTelescope[8][2]
telescope number from #FEE and #FPGA
Definition: KVFAZIA.h:53
KVFAZIATrigger fTrigger
trigger pattern read from data for each event
Definition: KVFAZIA.h:62
virtual void MakeCalibrationTables(KVExpDB *)
Override base method in order to read FAZIA trigger for each run.
Definition: KVFAZIA.cpp:105
Bool_t handle_raw_data_event_mfmframe(const MFMCommonFrame &)
Definition: KVFAZIA.cpp:833
virtual void GetGeometryParameters()
Called by the Build method.
Definition: KVFAZIA.cpp:366
void SetTriggerPattern(uint16_t fp)
Definition: KVFAZIA.h:65
TString GetIDCodeMeaning(Int_t idc) const
Definition: KVFAZIA.h:143
TString GetSignalName(Int_t bb, Int_t qq, Int_t tt, Int_t idsig)
Definition: KVFAZIA.cpp:609
Double_t fImport_PhiMin
for geometry import
Definition: KVFAZIA.h:47
IDCodes
Identification quality codes attributed to particles reconstructed from data.
Definition: KVFAZIA.h:125
@ ID_SI12_CSI
particle identified in (SI1+SI2)-CSI telescope
Definition: KVFAZIA.h:136
@ ID_SI1_SI2_MAYBE_PUNCH_THROUGH
possible ambiguity of particle identification in SI1-SI2 due to unvetoed punch-through
Definition: KVFAZIA.h:139
@ ID_CSI_PSA
particle identified by pulse shape analysis in CSI
Definition: KVFAZIA.h:137
@ ID_STOPPED_IN_FIRST_STAGE
particle stopped in SI1, no identification possible better than estimation of minimum Z
Definition: KVFAZIA.h:138
@ ID_SI1_SI2_PUNCH_THROUGH
particle punching through SI2, identified Z is a minimum value
Definition: KVFAZIA.h:140
@ ID_SI1_CSI
particle identified in SI1-SI2 telescope
Definition: KVFAZIA.h:133
@ ID_SI1_PSA
particle identified by pulse shape analysis in SI1
Definition: KVFAZIA.h:131
@ ID_SI1_PUNCH_THROUGH
particle partially identified by pulse shape analysis in SI1, although it is punching through (no SI2...
Definition: KVFAZIA.h:141
@ ID_SI2_PSA
particle identified by pulse shape analysis in SI1
Definition: KVFAZIA.h:134
@ NO_IDENTIFICATION
no identification possible for particle
Definition: KVFAZIA.h:129
@ ID_GAMMA
'gamma' particle identified by pulse shape analysis in CSI
Definition: KVFAZIA.h:130
@ ID_SI2_CSI
particle identified in SI2-CSI telescope
Definition: KVFAZIA.h:135
@ ID_SI1_SI2
particle identified in SI1-SI2 telescope
Definition: KVFAZIA.h:132
const Char_t * GetSignalTypes() const
Definition: KVFAZIA.h:228
void IncludeTargetInGeometry(Bool_t include=kTRUE)
Definition: KVFAZIA.h:219
Int_t fNblocks
number of blocks
Definition: KVFAZIA.h:37
void GetDetectorEvent(KVDetectorEvent *detev, const TSeqCollection *dets)
Definition: KVFAZIA.cpp:500
KVString GetDetectorLabels() const
Definition: KVFAZIA.h:224
void prepare_to_handle_new_raw_data()
Definition: KVFAZIA.h:109
virtual void Build(Int_t=-1)
Build the FAZIA array.
Definition: KVFAZIA.cpp:465
Double_t fImport_Yorg
for geometry import
Definition: KVFAZIA.h:50
KVString fDetectorLabels
Definition: KVFAZIA.h:41
void CreateCorrespondence()
Definition: KVFAZIA.cpp:870
TString GetECodeMeaning(Int_t ec) const
Definition: KVFAZIA.h:186
virtual void SetRawDataFromReconEvent(KVNameValueList &)
Overrides base method in order to set the value of the trigger bit pattern for the event.
Definition: KVFAZIA.cpp:92
Import detector array described by ROOT geometry and set up corresponding KVMultiDetArray object.
Definition: KVGeoImport.h:67
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
Base class for all detectors or associations of detectors in array which can identify charged particl...
Definition: KVIDTelescope.h:83
Base class for describing the geometry of a detector array.
void prepare_to_handle_new_raw_data()
reset acquisition parameters etc. before reading new raw data event
static Bool_t fBuildTarget
Handles lists of named parameters with different types, a list of KVNamedParameter objects.
Read Google Protobuf DAQ files.
Nuclei reconstructed from data measured by a detector array .
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
Definition: KVString.h:72
const char * Data() const