1 |
/** |
2 |
* \file CaloBragg.h |
3 |
* \author Emiliano Mocchiutti & Valeria Malvezzi & Daniele Tavagnacco |
4 |
*/ |
5 |
#ifndef calobragg_h |
6 |
#define calobragg_h |
7 |
#define SQ(a) ( a * a ) |
8 |
#include <PamLevel2.h> |
9 |
|
10 |
#include <TTree.h> |
11 |
#include <TFriendElement.h> |
12 |
#include <TChain.h> |
13 |
#include <TFile.h> |
14 |
#include <TList.h> |
15 |
#include <TKey.h> |
16 |
#include <TSystemFile.h> |
17 |
#include <TStyle.h> |
18 |
#include <TSystemDirectory.h> |
19 |
#include <TSQLServer.h> |
20 |
#include <TCanvas.h> |
21 |
#include <TH2F.h> |
22 |
#include <iostream> |
23 |
|
24 |
using namespace std; |
25 |
|
26 |
|
27 |
/** |
28 |
* |
29 |
* Class to store and calculate variables useful for nuclei analysis |
30 |
*/ |
31 |
class CaloBragg : public TObject { |
32 |
|
33 |
private: |
34 |
// |
35 |
PamLevel2 *L2; |
36 |
Bool_t debug; |
37 |
Bool_t usetrack; |
38 |
Bool_t startZero; |
39 |
|
40 |
// |
41 |
// needed to avoid reprocessing the same event over and over to obtain the variables |
42 |
// |
43 |
UInt_t OBT; |
44 |
UInt_t PKT; |
45 |
UInt_t atime; |
46 |
Int_t tr; |
47 |
Int_t sntr; |
48 |
//parametri calorimetro |
49 |
Int_t NPLA; |
50 |
Int_t NCHA; |
51 |
Int_t nView; |
52 |
|
53 |
Float_t AA;//mm larghezza strip |
54 |
Float_t ADIST;//mm distanza tra pad |
55 |
Float_t PIANO;//mm distanza |
56 |
|
57 |
Float_t ySi;//mm spessore silicio |
58 |
Float_t yW;//mm spessore tungsteno |
59 |
Float_t rhoSi;//g/cm3 densita' silicio |
60 |
Float_t rhoW;//g/cm3 densita' tugsteno |
61 |
Float_t MIP;//Mev g/cm2 energia al minimo nel silicio per 0.38 mm |
62 |
|
63 |
Float_t emin; |
64 |
Float_t fzeta; |
65 |
Float_t fene; |
66 |
Int_t fiso; |
67 |
// |
68 |
Bool_t usepl18x; |
69 |
Bool_t newchi2; |
70 |
Bool_t usenewBB; |
71 |
Int_t ndf; |
72 |
|
73 |
|
74 |
//parametri bethe-bloch |
75 |
Float_t pigr; |
76 |
Float_t Na; |
77 |
Float_t ZA; /*Z/A per Si*/ |
78 |
Float_t ISi; /*MeV*/ |
79 |
Float_t IW; /*MeV*/ |
80 |
Float_t Me; /* MeV*/ |
81 |
Float_t MassP;/*MeV*/ |
82 |
Float_t r2; /*ro*ro in cm */ |
83 |
|
84 |
//variabili globali caricabili |
85 |
Float_t Integrale; |
86 |
Float_t bestchi2[5]; |
87 |
/* Float_t qtchi2; */ |
88 |
/* Float_t qtz; */ |
89 |
/* Float_t qtetot; */ |
90 |
/* Float_t qtpskip; */ |
91 |
Float_t lpchi2; |
92 |
Float_t lpz; |
93 |
Float_t lpisotope; |
94 |
Float_t lpetot; |
95 |
Float_t lppskip; |
96 |
Float_t calorimetro[44][2]; |
97 |
Float_t spessore[4]; |
98 |
Float_t estremi[2][2];//[0][0]primo piano [0][1]energia primo |
99 |
//[1][0]ultim piano [1][1]energia ultim |
100 |
//Float_t shift[2][22];//shift dei piani |
101 |
//Float_t piano[22]; //posizione z dei piani |
102 |
Float_t elem[32][7];//A degli elementi compresi isotopi |
103 |
// |
104 |
|
105 |
Float_t dEplan[2*22];//energia rilasciata calcolata |
106 |
|
107 |
/* void SWAP(Float_t*,Float_t*); */ |
108 |
void LoadParam(); |
109 |
void conversione(); |
110 |
void BetheBloch(Float_t *,Float_t *,Float_t *,Float_t *,Float_t *,Float_t *, Float_t); |
111 |
void ELOSS(Float_t *,Int_t *,Int_t *, Float_t *, Float_t *, Float_t); |
112 |
void Enetrack(Int_t *,Int_t *, Float_t *, Float_t *,Float_t *,Float_t * ); |
113 |
void chiquadro(Float_t *, Float_t *); |
114 |
void loopze(Float_t ,Float_t ,Float_t ,Float_t, Int_t ); |
115 |
void mediatroncata(); |
116 |
void Zdaloop(); |
117 |
void CleanPlanes(Float_t epiano[22][2], Bool_t zpiano[22][2]); |
118 |
|
119 |
public: |
120 |
// |
121 |
void SetStartZero(Bool_t yes=false){ startZero = yes;}; |
122 |
// |
123 |
Float_t Get_firstplane(){ Process(); return estremi[0][0];}; ///< Number of available dE/dx measurements before interaction or exit from the calo (interaction plane) |
124 |
Float_t Get_lastplane(){ Process(); return estremi[1][0];}; ///< Number of available dE/dx measurements before interaction or exit from the calo (interaction plane) |
125 |
/* Float_t Get_qtchi2(){ Process(); return qtchi2;}; ///< Number of available dE/dx measurements before interaction or exit from the calo (interaction plane) */ |
126 |
/* Float_t Get_qtz(){ Process(); return qtz;}; ///< Number of available dE/dx measurements before interaction or exit from the calo (interaction plane) */ |
127 |
/* Float_t Get_qtetot(){ Process(); return qtetot;}; ///< Number of available dE/dx measurements before interaction or exit from the calo (interaction plane) */ |
128 |
/* Float_t Get_qtpskip(){ Process(); return qtpskip;}; ///< Number of available dE/dx measurements before interaction or exit from the calo (interaction plane) */ |
129 |
Float_t Get_lpchi2(){ Process(); return lpchi2;}; ///< Number of available dE/dx measurements before interaction or exit from the calo (interaction plane) |
130 |
Float_t Get_lpz(){ Process(); return lpz;}; ///< Number of available dE/dx measurements before interaction or exit from the calo (interaction plane) |
131 |
Float_t Get_mass(){ Process(); return elem[(Int_t)lpz - 1][(Int_t)lpisotope];}; ///< Number of available dE/dx measurements before interaction or exit from the calo (interaction plane) |
132 |
Float_t Get_lpetot(){ Process(); return lpetot;}; ///< Number of available dE/dx measurements before interaction or exit from the calo (interaction plane) |
133 |
Float_t Get_lppskip(){ Process(); return lppskip;}; ///< Number of available dE/dx measurements before interaction or exit from the calo (interaction plane) |
134 |
|
135 |
Float_t Integral(); |
136 |
Float_t LastIntegral(); |
137 |
|
138 |
void ForceZeta(Float_t zeta){ fzeta = zeta;}; |
139 |
void ForceEne(Float_t ener ){ fene = ener;}; |
140 |
void ForceIso(Int_t isor ){ fiso = isor;}; |
141 |
void ForceProcessing(){ sntr = -1000.;}; |
142 |
|
143 |
void UsePlane18X(Bool_t use){usepl18x = use;}; |
144 |
|
145 |
void UseNewChi2(Bool_t use){newchi2 = use;}; |
146 |
void UseNewBB(Bool_t use){usenewBB = use;}; |
147 |
// |
148 |
|
149 |
// |
150 |
CaloBragg(); |
151 |
CaloBragg(PamLevel2 *L2); |
152 |
~CaloBragg(){ Delete(); }; |
153 |
// |
154 |
void Draw(); |
155 |
void Draw(Int_t,Int_t, Float_t); |
156 |
void SetDebug(Bool_t d){ debug=d; }; |
157 |
void UseTrack(Bool_t d){ usetrack=d; }; |
158 |
// |
159 |
void Clear(); |
160 |
void Clear(Option_t *option){Clear();}; |
161 |
void Delete(); |
162 |
void Delete(Option_t *option){Delete();}; |
163 |
// |
164 |
void Process(); ///< Process data for track number 0 |
165 |
void Process(Int_t ntr); ///< Process data for track number ntr |
166 |
void Print(); |
167 |
void Print(Option_t *option){Print();}; |
168 |
// |
169 |
ClassDef(CaloBragg,6); |
170 |
}; |
171 |
|
172 |
#endif |
173 |
|