/[PAMELA software]/calo/flight/CaloProfile/inc/CaloProfile.h
ViewVC logotype

Contents of /calo/flight/CaloProfile/inc/CaloProfile.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.10 - (show annotations) (download)
Mon Aug 17 15:00:35 2009 UTC (15 years, 5 months ago) by mocchiut
Branch: MAIN
Changes since 1.9: +1 -1 lines
File MIME type: text/plain
New features added

1 /**
2 * \file CaloProfile.h
3 * \author Emiliano Mocchiutti
4 */
5 #ifndef caloprofile_h
6 #define caloprofile_h
7
8 #define EMPTY -1
9 #define MAX 50
10
11 #include <iostream>
12 #include <stdio.h>
13 #include <string.h>
14 #include <ctype.h>
15 #include <TTree.h>
16 #include <TFriendElement.h>
17 #include <TChain.h>
18 #include <TCanvas.h>
19 #include <TGraph.h>
20 #include <TH1F.h>
21 #include <TH2F.h>
22 #include <TFile.h>
23 #include <TPolyLine.h>
24 #include <TMath.h>
25 #include <TStyle.h>
26 #include <TList.h>
27 #include <TKey.h>
28 #include <TSystemFile.h>
29 #include <TSystemDirectory.h>
30 #include <TSQLServer.h>
31 #include <TF1.h>
32 #include <TGraphErrors.h>
33
34 #include <PamLevel2.h>
35
36 using namespace std;
37
38 struct stack{
39 char data[MAX];
40 int top;
41 };
42
43 /**
44 *
45 */
46 class CaloLat : public TObject {
47
48 private:
49 //
50 PamLevel2 *L2;
51 Bool_t debug;
52 //
53 // needed to avoid reprocessing the same event over and over to obtain the variables
54 //
55 UInt_t OBT;
56 UInt_t PKT;
57 UInt_t atime;
58 //
59 Float_t estrip[2][22][96];
60 //
61
62 public:
63 //
64 //
65 void Draw();
66 void Draw(Int_t,Int_t);
67 //
68 CaloLat();
69 CaloLat(PamLevel2 *L2);
70 ~CaloLat(){ Delete(); };
71 //
72 void SetDebug(Bool_t d){ debug=d; };
73 //
74 void Clear();
75 void Clear(Option_t *option){Clear();};
76 void Delete();
77 void Delete(Option_t *option){Delete();};
78 //
79 void Process(); ///< Process data
80 void Print();
81 void Print(Option_t *option){Print();};
82 //
83 ClassDef(CaloLat,1);
84 };
85
86 /**
87 *
88 */
89 class CaloLong : public TObject {
90
91 private:
92 //
93 PamLevel2 *L2;
94 Bool_t debug;
95 //
96 // needed to avoid reprocessing the same event over and over to obtain the variables
97 //
98 UInt_t OBT;
99 UInt_t PKT;
100 UInt_t atime;
101 UInt_t fOBT;
102 UInt_t fPKT;
103 UInt_t fatime;
104 //
105 Int_t N;
106 Int_t NC;
107 Bool_t sel;
108 Bool_t cont;
109 Int_t mask18b;
110 //
111 Float_t chi2;
112 Float_t ndf;
113 Float_t E0;
114 Float_t a;
115 Float_t b;
116 Float_t errE0;
117 Float_t erra;
118 Float_t errb;
119 Float_t etmax;
120 Float_t asymm;
121 Float_t X0pl;
122 Float_t defE0;
123 Float_t umax;
124 Float_t lmax;
125 TString sumax;
126 TString slmax;
127 Int_t fitresult;
128 //
129 Bool_t no18x;
130 Bool_t maskXE;
131 Bool_t maskYE;
132 Bool_t maskXO;
133 Bool_t maskYO;
134 //
135 Bool_t xyaverage;
136 //
137 Float_t eplane[2][22];
138 //
139 CaloLevel2 *clp;
140 //
141 Float_t Evaluate(TString s, Float_t tmax, Float_t X0pl ); // expression must be of the form "tmax+2.*X0pl", "5*tmax"."tmax+10","tmax-(4*tmax)+3.*X0pl"...
142 //
143
144 public:
145 //
146 //
147 void Fit();
148 void Fit(Bool_t draw);
149 //
150 // Double_t ccurve(Double_t *t, Double_t *par);
151 //
152 void SetCaloLevel2Pointer(CaloLevel2 *cp){ clp = cp;};
153 //
154 Float_t Get_E0(){this->Fit(); return E0;};
155 Float_t Get_defE0(){this->Fit(); return defE0;};
156 Float_t Get_a(){this->Fit(); return a;};
157 Float_t Get_b(){this->Fit(); return b;};
158 Float_t Get_errE0(){this->Fit(); return errE0;};
159 Float_t Get_erra(){this->Fit(); return erra;};
160 Float_t Get_errb(){this->Fit(); return errb;};
161 Float_t Get_chi2(){this->Fit(); return chi2;};
162 Float_t Get_ndf(){this->Fit(); return ndf;};
163 Float_t Get_nchi2(){this->Fit(); if ( ndf > 0 ) return (chi2/ndf); return 0;};
164 Float_t Get_tmax(){this->Fit(); if ( b != 0 ) return ((a-1.)/b); return 0;};
165 Float_t Get_asymm(){this->Fit(); return asymm;};
166 Float_t Get_exptmax(){this->Process(); return etmax;};
167 Float_t Get_X0pl(){this->Process(); return X0pl;};
168 Int_t Get_fitresult(){this->Fit(); return fitresult;};
169 //
170 void ForceNextFit(){atime=0;fatime=0;};
171 void Draw();
172 void Draw(Int_t);
173 //
174 CaloLong();
175 CaloLong(PamLevel2 *L2);
176 ~CaloLong(){ Delete(); };
177 //
178 void SetDebug(Bool_t d){ debug=d; };
179 void UsePlane18X(){ no18x=false; };
180 //
181 void UseAverage(){ xyaverage = true;};
182 void UseAllMeas(){ xyaverage = false;};
183 //
184 void MaskSection(TString);
185 void UnMaskSection(TString);
186 void UnMaskSections();
187 void Selection(){sel = true; cont = false;}; ///< Set selection mode: planes from 1 to 22-N are used, plane 18 - N is masked if "emulate18" variable is true (DEFAULT);
188 void Contamination(){sel = false; cont = true;}; ///< Set contamination mode: planes from N to 22 are used.
189 void SetNoWpreSampler(Int_t n);
190 void SetNoWcalo(Int_t n);
191 void SplitInto(Int_t NoWpreSampler, Int_t NoWcalo);
192 Int_t GetNoWpreSampler(){return N;}; ///< Get the number of W planes used as presampler.
193 Int_t GetNoWcalo(){return NC;}; ///< Get the number of W planes used as calorimeter.
194 void SetEnergies(Float_t myene[][22]);
195 //
196 void SetLowerLimit(Float_t l){ lmax = l; };
197 void SetUpperLimit(Float_t u){ umax = u; };
198 void SetLowerLimit(TString sl){ slmax = sl; };// expression must be of the form "5*t"."t+10","t-(4*t)"... where t will be replaced by the fitted maximum (X0)
199 void SetUpperLimit(TString su){ sumax = su; };// expression must be of the form "5*t"."t+10","t-(4*t)"... where t will be replaced by the fitted maximum (X0)
200 //
201 Float_t GetLowerLimit(){ return lmax;};
202 Float_t GetUpperLimit(){ return umax;};
203 //
204 void Clear();
205 void Clear(Option_t *option){Clear();};
206 void Delete();
207 void Delete(Option_t *option){Delete();};
208 //
209 void Process(); ///< Process data
210 void Print();
211 void Print(Option_t *option){Print();};
212 //
213 ClassDef(CaloLong,2);
214 };
215
216 /**
217 *
218 */
219 class Calo2D : public TObject {
220
221 private:
222 //
223 PamLevel2 *L2;
224 Bool_t debug;
225 //
226 // needed to avoid reprocessing the same event over and over to obtain the variables
227 //
228 UInt_t OBT;
229 UInt_t PKT;
230 UInt_t atime;
231 //
232 Float_t estrip[23][96][96];
233 Int_t smax[23];
234 Int_t smay[23];
235 //
236
237 public:
238 //
239 //
240 void Draw();
241 void Draw(Int_t);
242 //
243 Calo2D();
244 Calo2D(PamLevel2 *L2);
245 ~Calo2D(){ Delete(); };
246 //
247 void SetDebug(Bool_t d){ debug=d; };
248 //
249 void Clear();
250 void Clear(Option_t *option){Clear();};
251 void Delete();
252 void Delete(Option_t *option){Delete();};
253 //
254 void Process(); ///< Process data
255 void Print();
256 void Print(Option_t *option){Print();};
257 //
258 ClassDef(Calo2D,1);
259 };
260
261 #endif
262

  ViewVC Help
Powered by ViewVC 1.1.23