KaliVeda  1.12/06
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
84 
86 
87  void CreateCorrespondence();
88 #ifdef WITH_PROTOBUF
90 #ifndef __CINT__
91  Bool_t treat_event(const DAQ::FzEvent&);
92 #endif
93  Double_t TreatEnergy(Int_t sigid, Int_t eid, UInt_t val);
94 #endif
95  TString GetSignalName(Int_t bb, Int_t qq, Int_t tt, Int_t idsig);
96 
97  void ReadTriggerPatterns(KVExpDB* db);
98 
100  {
104  }
106 
110  {
112  return ECodes::NORMAL_CALIBRATION;
113  }
114 public:
115  enum IDCodes {
120  ID_GAMMA = 0,
121  ID_SI1_PSA = 11,
122  ID_SI1_SI2 = 12,
123  ID_SI2_CSI = 23,
124  ID_CSI_PSA = 33,
128  };
130  {
131  switch (idc) {
132  case NO_IDENTIFICATION:
133  return "NO_IDENTIFICATION";
134  case ID_GAMMA:
135  return "ID_GAMMA";
136  case ID_SI1_PSA:
137  return "ID_SI1_PSA";
138  case ID_SI1_SI2:
139  return "ID_SI1_SI2";
140  case ID_SI2_CSI:
141  return "ID_SI2_CSI";
142  case ID_CSI_PSA:
143  return "ID_CSI_PSA";
145  return "ID_STOPPED_IN_FIRST_STAGE";
147  return "ID_SI1_SI2_MAYBE_PUNCH_THROUGH";
149  return "ID_SI1_SI2_PUNCH_THROUGH";
150  default:
151  return Form("(unknown:%d)", idc);
152  }
153  }
154  enum ECodes {
162  };
164  {
165  switch (ec) {
167  return "NO_CALIBRATION_ATTEMPTED";
168  case NORMAL_CALIBRATION:
169  return "NORMAL_CALIBRATION";
171  return "SOME_ENERGY_LOSSES_CALCULATED";
173  return "WARNING_CSI_MAX_ENERGY";
174  default:
175  return Form("(unknown:%d)", ec);
176  }
177  }
179  {
180  return IDCodes::ID_STOPPED_IN_FIRST_STAGE;
181  }
182 
183  KVFAZIA(const Char_t* title = "");
184  virtual ~KVFAZIA();
185  void AddDetectorLabel(const Char_t* label);
186 
187  virtual void Build(Int_t = -1);
188 
189  void GetDetectorEvent(KVDetectorEvent* detev, const TSeqCollection* dets);
191  {
192  return fNblocks;
193  }
194  void IncludeTargetInGeometry(Bool_t include = kTRUE)
195  {
196  fBuildTarget = include;
197  }
198 
200  {
201  return fDetectorLabels;
202  }
203  const Char_t* GetSignalTypes() const
204  {
205  return fSignalTypes.Data();
206  }
207 
208  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.,
209  Double_t xorg = 0, Double_t yorg = 0, Double_t zorg = 0)
210  {
213  fImport_dPhi = dp;
214  fImport_dTheta = dt;
215  fImport_PhiMax = pmax;
216  fImport_PhiMin = pmin;
217  fImport_ThetaMax = tmax;
218  fImport_ThetaMin = tmin;
219  fImport_Xorg = xorg;
220  fImport_Yorg = yorg;
221  fImport_Zorg = zorg;
222  }
223  void FillDetectorList(KVReconstructedNucleus* rnuc, KVHashList* DetList, const KVString& DetNames);
224 
226  Double_t GetSetupParameter(const Char_t* parname);
227 
228  const KVFAZIATrigger& GetTrigger() const
229  {
230  return fTrigger;
231  }
233  virtual void MakeCalibrationTables(KVExpDB*);
234 
235  std::string GetTriggerForCurrentRun() const;
236 
237  ClassDef(KVFAZIA, 1) //Base class for description of the FAZIA set up
238 };
239 
242 
243 #endif
int Int_t
unsigned int UInt_t
#define R__EXTERN
R__EXTERN KVFAZIA * gFazia
................ global variable
Definition: KVFAZIA.h:241
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:18
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:513
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:569
Double_t fQ3slowrisetime
Definition: KVFAZIA.h:58
void SetTriggerPatternsForDataSet(const TString &dataset)
Definition: KVFAZIA.cpp:313
void FillDetectorList(KVReconstructedNucleus *rnuc, KVHashList *DetList, const KVString &DetNames)
Definition: KVFAZIA.cpp:465
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:208
int fQuartet[8][2]
quartet number from #FEE and #FPGA
Definition: KVFAZIA.h:52
Double_t GetSetupParameter(const Char_t *parname)
Definition: KVFAZIA.cpp:77
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:877
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:154
@ NO_CALIBRATION_ATTEMPTED
particle stopped in detectors with no available calibration
Definition: KVFAZIA.h:158
@ NORMAL_CALIBRATION
normal well-calibrated particle with no problems
Definition: KVFAZIA.h:159
@ WARNING_CSI_MAX_ENERGY
particle calibration OK, although apparent energy would mean punching through the CsI
Definition: KVFAZIA.h:161
@ SOME_ENERGY_LOSSES_CALCULATED
particle calibration OK, with some detector energies calculated
Definition: KVFAZIA.h:160
std::string GetTriggerForCurrentRun() const
Definition: KVFAZIA.cpp:128
void AddDetectorLabel(const Char_t *label)
Definition: KVFAZIA.cpp:173
Bool_t handle_raw_data_event_protobuf(KVProtobufDataReader &)
Definition: KVFAZIA.cpp:560
const KVFAZIATrigger & GetTrigger() const
Definition: KVFAZIA.h:228
virtual void BuildTarget()
Definition: KVFAZIA.cpp:361
virtual Int_t GetIDCodeForParticlesStoppingInFirstStageOfTelescopes() const
Definition: KVFAZIA.h:178
Int_t GetNumberOfBlocks() const
Definition: KVFAZIA.h:190
Int_t fStartingBlockNumber
Definition: KVFAZIA.h:38
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:223
Double_t fImport_Zorg
for geometry import
Definition: KVFAZIA.h:51
virtual void BuildFAZIA()
methods to be implemented in child classes
Definition: KVFAZIA.cpp:350
KVFAZIA(const Char_t *title="")
Default constructor.
Definition: KVFAZIA.cpp:53
virtual UChar_t GetNormalCalibrationCode()
Definition: KVFAZIA.h:109
void ReadTriggerPatterns(KVExpDB *db)
Definition: KVFAZIA.cpp:834
virtual void DefineStructureFormats(KVGeoImport &)
Definition: KVFAZIA.h:79
void GenerateCorrespondanceFile()
Definition: KVFAZIA.cpp:185
Double_t fQ3fastrisetime
Definition: KVFAZIA.h:59
KVString fSignalTypes
Definition: KVFAZIA.h:42
void PerformClosedROOTGeometryOperations()
Definition: KVFAZIA.cpp:254
Bool_t treat_event(const DAQ::FzEvent &)
Read raw data for an event.
Definition: KVFAZIA.cpp:600
virtual ~KVFAZIA()
Destructor.
Definition: KVFAZIA.cpp:162
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:104
Bool_t handle_raw_data_event_mfmframe(const MFMCommonFrame &)
Definition: KVFAZIA.cpp:752
virtual void GetGeometryParameters()
Called by the Build method.
Definition: KVFAZIA.cpp:285
void SetTriggerPattern(uint16_t fp)
Definition: KVFAZIA.h:65
TString GetIDCodeMeaning(Int_t idc) const
Definition: KVFAZIA.h:129
TString GetSignalName(Int_t bb, Int_t qq, Int_t tt, Int_t idsig)
Definition: KVFAZIA.cpp:528
Double_t fImport_PhiMin
for geometry import
Definition: KVFAZIA.h:47
IDCodes
Identification quality codes attributed to particles reconstructed from data.
Definition: KVFAZIA.h:115
@ ID_SI1_SI2_MAYBE_PUNCH_THROUGH
possible ambiguity of particle identification in SI1-SI2 due to unvetoed punch-through
Definition: KVFAZIA.h:126
@ ID_CSI_PSA
particle identified by pulse shape analysis in CSI
Definition: KVFAZIA.h:124
@ ID_STOPPED_IN_FIRST_STAGE
particle stopped in SI1, no identification possible better than estimation of minimum Z
Definition: KVFAZIA.h:125
@ ID_SI1_SI2_PUNCH_THROUGH
particle punching through SI2, identified Z is a minimum value
Definition: KVFAZIA.h:127
@ ID_SI1_PSA
particle identified by pulse shape analysis in SI1
Definition: KVFAZIA.h:121
@ NO_IDENTIFICATION
no identification possible for particle
Definition: KVFAZIA.h:119
@ ID_GAMMA
'gamma' particle identified by pulse shape analysis in CSI
Definition: KVFAZIA.h:120
@ ID_SI2_CSI
particle identified in SI2-CSI telescope
Definition: KVFAZIA.h:123
@ ID_SI1_SI2
particle identified in SI1-SI2 telescope
Definition: KVFAZIA.h:122
const Char_t * GetSignalTypes() const
Definition: KVFAZIA.h:203
void IncludeTargetInGeometry(Bool_t include=kTRUE)
Definition: KVFAZIA.h:194
Int_t fNblocks
number of blocks
Definition: KVFAZIA.h:37
void GetDetectorEvent(KVDetectorEvent *detev, const TSeqCollection *dets)
Definition: KVFAZIA.cpp:419
KVString GetDetectorLabels() const
Definition: KVFAZIA.h:199
void prepare_to_handle_new_raw_data()
reset acquisition parameters etc. before reading new raw data event
Definition: KVFAZIA.h:99
virtual void Build(Int_t=-1)
Build the FAZIA array.
Definition: KVFAZIA.cpp:384
Double_t fImport_Yorg
for geometry import
Definition: KVFAZIA.h:50
KVString fDetectorLabels
Definition: KVFAZIA.h:41
void CreateCorrespondence()
Definition: KVFAZIA.cpp:789
TString GetECodeMeaning(Int_t ec) const
Definition: KVFAZIA.h:163
virtual void SetRawDataFromReconEvent(KVNameValueList &)
Overrides base method in order to set the value of the trigger bit pattern for the event.
Definition: KVFAZIA.cpp:91
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:88
Base class for describing the geometry of a detector array.
virtual 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