9 |
#include <TString.h> |
#include <TString.h> |
10 |
#include <TSQLServer.h> |
#include <TSQLServer.h> |
11 |
#include <TSystem.h> |
#include <TSystem.h> |
12 |
|
#include <TROOT.h> // EMILIANO: needed to compile with ROOT > 5.16/x |
13 |
|
|
14 |
#include <GLTables.h> |
#include <GLTables.h> |
15 |
#include <TrkStruct.h> |
#include <TrkStruct.h> |
16 |
#include <TrkCalib.h> |
#include <TrkCalib.h> |
17 |
|
|
18 |
#define NTYPES 10 |
#define NTYPES 10 |
19 |
|
#define NGF 14 |
20 |
|
|
21 |
/** |
/** |
22 |
* \brief Class to store tracker parameter information |
* \brief Class to store tracker parameter information |
39 |
* 7 default calibration |
* 7 default calibration |
40 |
* |
* |
41 |
* Internal parameters are initialized to default values |
* Internal parameters are initialized to default values |
42 |
* (NB!! the same values set in analisysflight.f). |
* |
|
* |
|
43 |
* TrkParams::SetCalib(...) and TrkParams::Set(...) methods allow to set |
* TrkParams::SetCalib(...) and TrkParams::Set(...) methods allow to set |
44 |
* required parameters, from an input path, from the DB (for a given input |
* required parameters, from an input path, from the DB (for a given input |
45 |
* run id) and from environment variable PAM_CALIB. |
* run id) and from environment variable PAM_CALIB. |
62 |
|
|
63 |
private: |
private: |
64 |
|
|
65 |
|
static Bool_t simuflag; |
66 |
static Int_t GetIndex( UInt_t type ); |
static Int_t GetIndex( UInt_t type ); |
67 |
|
|
68 |
public: |
public: |
69 |
|
|
70 |
|
static void SetSimuFlag(Bool_t); |
71 |
|
static Bool_t GetSimuFlag(); |
72 |
// --------------------------------------------- |
// --------------------------------------------- |
73 |
// variables to store loaded-calibration info |
// variables to store loaded-calibration info |
74 |
// --------------------------------------------- |
// --------------------------------------------- |
77 |
static TString calibpathf; //full |
static TString calibpathf; //full |
78 |
static Bool_t calib104; |
static Bool_t calib104; |
79 |
static Bool_t calibload; |
static Bool_t calibload; |
80 |
|
static TrkCalib* calib1; |
81 |
|
static TrkCalib* calib2; |
82 |
// --------------------------------------------- |
// --------------------------------------------- |
83 |
// variables to store loaded-parameters info |
// variables to store loaded-parameters info |
84 |
// --------------------------------------------- |
// --------------------------------------------- |
93 |
static int init__mini_trackmode; |
static int init__mini_trackmode; |
94 |
static int init__mini_istepmin; |
static int init__mini_istepmin; |
95 |
static double init__mini_fact; |
static double init__mini_fact; |
96 |
|
static cDbg init__dbg_mode; //debug mode (for both c++ and F77 roiutines) |
97 |
|
static float init__pfa_e234ax[6]; // angle intervals for eta2-3-4 |
98 |
|
static float init__pfa_e234ay[6]; // angle intervals for eta2-3-4 |
99 |
|
static double init__deltab_0; |
100 |
|
static double init__deltab_1; |
101 |
|
static double init__dlt; |
102 |
|
|
103 |
|
// ------------------------------------------ |
104 |
|
// nominal z-coordinates to define acceptance |
105 |
|
// ------------------------------------------ |
106 |
|
static int nGF; |
107 |
|
static float zGF[NGF]; |
108 |
|
static float xGF_min[NGF]; |
109 |
|
static float xGF_max[NGF]; |
110 |
|
static float yGF_min[NGF]; |
111 |
|
static float yGF_max[NGF]; |
112 |
|
static TString GF_element[NGF]; |
113 |
|
|
114 |
TrkParams(); |
TrkParams(); |
115 |
|
|
116 |
// --------------------------------------------- |
// --------------------------------------------- |
117 |
// calibration (PED-SIG-BAD) |
// calibration (PED-SIG-BAD) |
118 |
// --------------------------------------------- |
// --------------------------------------------- |
120 |
static Bool_t LoadCalib( ); |
static Bool_t LoadCalib( ); |
121 |
static Bool_t CalibIsLoaded(){ return calibload; }; |
static Bool_t CalibIsLoaded(){ return calibload; }; |
122 |
static UInt_t ValidateTrkCalib( CalibTrk1Event* ); |
static UInt_t ValidateTrkCalib( CalibTrk1Event* ); |
123 |
static void FillFCalibFrom(TFile* , Int_t , Int_t );//full |
// static void FillFCalibFrom(TFile* , Int_t , Int_t );//full |
124 |
static void FillTCalibFrom(TFile* , Int_t , Int_t );//truncated |
// static void FillTCalibFrom(TFile* , Int_t , Int_t );//truncated |
125 |
static void FillTCalibFrom(TString path); |
static void FillTCalibFrom(TString path); |
126 |
static void FillACalibFrom(TFile* , Int_t , Int_t );//all |
static void FillACalibFrom(TFile* , Int_t , Int_t );//all |
127 |
static void FillMask(TFile* , Int_t , Int_t ); |
static void FillMask(TFile* , Int_t , Int_t ); |
129 |
// --------------------------------------------- |
// --------------------------------------------- |
130 |
// parameters |
// parameters |
131 |
// --------------------------------------------- |
// --------------------------------------------- |
132 |
static Bool_t Set( GL_RUN* glrun, TSQLServer* dbc, UInt_t type); |
static Bool_t Set( GL_RUN* glrun, TSQLServer* dbc, UInt_t type, UInt_t abstime=0); |
133 |
static Bool_t Set( GL_RUN* glrun, TSQLServer* dbc){ |
static Bool_t Set( GL_RUN* glrun, TSQLServer* dbc){ |
134 |
for(Int_t i=0; i<NTYPES; i++) |
Bool_t result = true; |
135 |
if( !TrkParams::Set(glrun,dbc,trkparamtype[i]) )return false; |
for(Int_t i=0; i<NTYPES; i++) |
136 |
return true; |
if( !TrkParams::Set(glrun,dbc,trkparamtype[i]) ) |
137 |
|
result = false; |
138 |
|
return result; |
139 |
}; |
}; |
140 |
static Bool_t Set( TString, UInt_t ); |
static Bool_t Set( TString, UInt_t ); |
141 |
static Bool_t Set( UInt_t ); |
static Bool_t Set( UInt_t ); |
145 |
static Bool_t IsLoaded( UInt_t type ){return glload[TrkParams::GetIndex(type)];}; |
static Bool_t IsLoaded( UInt_t type ){return glload[TrkParams::GetIndex(type)];}; |
146 |
static Bool_t IsLoaded( ); |
static Bool_t IsLoaded( ); |
147 |
|
|
148 |
|
static GL_PARAM GetParams( UInt_t type ){ return gl[TrkParams::GetIndex(type)]; }; |
149 |
|
|
150 |
// --------------------------------------------- |
// --------------------------------------------- |
151 |
// retrieve parameters |
// retrieve parameters |
152 |
// --------------------------------------------- |
// --------------------------------------------- |
153 |
static float GetBX(float*); |
static float GetBX(float*); |
154 |
static float GetBY(float*); |
static float GetBY(float*); |
155 |
static float GetBZ(float*); |
static float GetBZ(float*); |
156 |
|
static float GetResolution(int,float); |
157 |
|
static int GetPFA(){return sw_.pfaid;}; |
158 |
|
static int GetPFA_NbinsAngle(); |
159 |
|
static int GetPFA_NbinsETA(); |
160 |
|
static int GetPFA_NbinsCharge(){return 0;}; |
161 |
|
static int GetPFA_AngleBin(float); |
162 |
|
static float* GetPFA_ETAcorr(TString,int,int,int); |
163 |
|
static float* GetPFA_ETAabs(TString,int); |
164 |
|
static float GetPFA_ETAlandi(int,int,int); |
165 |
|
static float GetPFA_ETAlandi(int nv,int nl,float ang) |
166 |
|
{ return TrkParams::GetPFA_ETAlandi(nv,nl,TrkParams::GetPFA_AngleBin(ang)); }; |
167 |
|
|
168 |
|
|
169 |
|
|
170 |
// --------------------------------------------- |
// --------------------------------------------- |
171 |
// debug mode |
// debug mode |
172 |
// --------------------------------------------- |
// --------------------------------------------- |
|
static cDbg dbg_mode; //debug mode (for both c++ and F77 roiutines) |
|
173 |
|
|
174 |
static void SetDebugMode() {dbg_mode.SetDebug(); dbg_=dbg_mode;}; |
static void SetDebugMode() {init__dbg_mode.SetDebug(); dbg_=init__dbg_mode;}; |
175 |
static void SetVerboseMode(){dbg_mode.SetVerbose(); dbg_=dbg_mode;}; |
static void SetVerboseMode(){init__dbg_mode.SetVerbose(); dbg_=init__dbg_mode;}; |
176 |
static void SetWarningMode(){dbg_mode.SetWarning(); dbg_=dbg_mode;}; |
static void SetWarningMode(){init__dbg_mode.SetWarning(); dbg_=init__dbg_mode;}; |
177 |
static Bool_t DebugMode(){return dbg_mode.debug;}; |
static void SetQuietMode() {init__dbg_mode.SetNone(); dbg_=init__dbg_mode;}; |
178 |
static Bool_t WarningMode(){return dbg_mode.warning;}; |
static Bool_t DebugMode(){return init__dbg_mode.debug;}; |
179 |
static Bool_t VerboseMode(){return dbg_mode.verbose;}; |
static Bool_t WarningMode(){return init__dbg_mode.warning;}; |
180 |
|
static Bool_t VerboseMode(){return init__dbg_mode.verbose;}; |
181 |
|
|
182 |
// ------------------------------------------------ |
// ------------------------------------------------ |
183 |
// alcuni metodi che non sapevo dove mettere |
// alcuni metodi che non sapevo dove mettere |
187 |
static void SetTrackingMode() {track_.trackmode = init__mini_trackmode;}; |
static void SetTrackingMode() {track_.trackmode = init__mini_trackmode;}; |
188 |
static void SetPrecisionFactor(){track_.fact = init__mini_fact; }; |
static void SetPrecisionFactor(){track_.fact = init__mini_fact; }; |
189 |
static void SetStepMin() {track_.istepmin = init__mini_istepmin; }; |
static void SetStepMin() {track_.istepmin = init__mini_istepmin; }; |
190 |
static void SetPFA() {sw_.pfaid = init__pfa; }; |
static void SetDeltaB() {deltab_.delta0 = init__deltab_0; |
191 |
|
deltab_.delta1 = init__deltab_1;}; |
192 |
|
static void SetDLT() {deltab_.dlt = init__dlt;}; |
193 |
|
static void SetMiniDefault() { |
194 |
|
SetTrackingMode(); |
195 |
|
SetPrecisionFactor(); |
196 |
|
SetStepMin(); |
197 |
|
SetDeltaB(); |
198 |
|
SetDLT(); |
199 |
|
}; // |
200 |
|
static void SetPFA(); |
201 |
|
|
202 |
// set to custom values |
// set to custom values |
203 |
static void SetTrackingMode(int); |
static void SetTrackingMode(int); |
204 |
static void SetPrecisionFactor(double); |
static void SetPrecisionFactor(double); |
205 |
static void SetStepMin(int); |
static void SetStepMin(int); |
206 |
|
static void SetDeltaB(int,double); |
207 |
|
static void SetDLT(double); |
208 |
static void SetPFA(int); |
static void SetPFA(int); |
209 |
|
static void SetPFA(float *); |
210 |
|
|
211 |
|
// --------------------------------------------- |
212 |
|
// varie ed eventuali... |
213 |
|
// --------------------------------------------- |
214 |
|
static TSQLServer* SetDBConnection(); |
215 |
|
|
216 |
|
|
217 |
ClassDef(TrkParams,2); |
ClassDef(TrkParams,2); |
218 |
|
|
219 |
}; |
}; |