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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.15 - (hide annotations) (download)
Mon Dec 14 14:52:13 2009 UTC (15 years, 1 month ago) by mocchiut
Branch: MAIN
Changes since 1.14: +3 -3 lines
File MIME type: text/plain
Do not use plane 18x by default

1 mocchiut 1.1 /**
2     * \file CaloProfile.h
3     * \author Emiliano Mocchiutti
4     */
5     #ifndef caloprofile_h
6     #define caloprofile_h
7    
8 mocchiut 1.7 #define EMPTY -1
9     #define MAX 50
10    
11 mocchiut 1.3 #include <iostream>
12 mocchiut 1.7 #include <stdio.h>
13     #include <string.h>
14     #include <ctype.h>
15 mocchiut 1.1 #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 mocchiut 1.9 #include <TGraphErrors.h>
33 mocchiut 1.13 #include <TMinuit.h>
34 mocchiut 1.3
35     #include <PamLevel2.h>
36 mocchiut 1.1
37     using namespace std;
38    
39 mocchiut 1.7 struct stack{
40     char data[MAX];
41     int top;
42     };
43    
44 mocchiut 1.1 /**
45     *
46     */
47     class CaloLat : public TObject {
48    
49     private:
50     //
51     PamLevel2 *L2;
52     Bool_t debug;
53     //
54     // needed to avoid reprocessing the same event over and over to obtain the variables
55     //
56     UInt_t OBT;
57     UInt_t PKT;
58     UInt_t atime;
59     //
60     Float_t estrip[2][22][96];
61 mocchiut 1.11 TString suf;
62 mocchiut 1.14 Bool_t usepl18x;
63 mocchiut 1.1 //
64    
65     public:
66     //
67     //
68     void Draw();
69     void Draw(Int_t,Int_t);
70     //
71     CaloLat();
72     CaloLat(PamLevel2 *L2);
73     ~CaloLat(){ Delete(); };
74     //
75     void SetDebug(Bool_t d){ debug=d; };
76     //
77     void Clear();
78     void Clear(Option_t *option){Clear();};
79     void Delete();
80 mocchiut 1.2 void Delete(Option_t *option){Delete();};
81 mocchiut 1.1 //
82     void Process(); ///< Process data
83     void Print();
84 mocchiut 1.2 void Print(Option_t *option){Print();};
85 mocchiut 1.1 //
86 mocchiut 1.14
87     void UsePlane18X(Bool_t use){usepl18x = use;};
88     //
89     //
90 mocchiut 1.11 void SetSuffix(TString suffix){ suf = suffix;};
91     //
92 mocchiut 1.15 ClassDef(CaloLat,3);
93 mocchiut 1.1 };
94    
95     /**
96     *
97     */
98     class CaloLong : public TObject {
99    
100     private:
101     //
102     PamLevel2 *L2;
103     Bool_t debug;
104     //
105     // needed to avoid reprocessing the same event over and over to obtain the variables
106     //
107     UInt_t OBT;
108     UInt_t PKT;
109     UInt_t atime;
110 mocchiut 1.3 UInt_t fOBT;
111     UInt_t fPKT;
112     UInt_t fatime;
113     //
114     Int_t N;
115     Int_t NC;
116     Bool_t sel;
117     Bool_t cont;
118     Int_t mask18b;
119 mocchiut 1.14 Bool_t usepl18x;
120 mocchiut 1.3 //
121     Float_t chi2;
122     Float_t ndf;
123     Float_t E0;
124     Float_t a;
125     Float_t b;
126     Float_t errE0;
127     Float_t erra;
128     Float_t errb;
129     Float_t etmax;
130     Float_t asymm;
131     Float_t X0pl;
132 mocchiut 1.7 Float_t defE0;
133     Float_t umax;
134     Float_t lmax;
135     TString sumax;
136     TString slmax;
137 mocchiut 1.3 Int_t fitresult;
138     //
139     Bool_t no18x;
140 mocchiut 1.5 Bool_t maskXE;
141     Bool_t maskYE;
142     Bool_t maskXO;
143     Bool_t maskYO;
144 mocchiut 1.1 //
145 mocchiut 1.9 Bool_t xyaverage;
146     //
147 mocchiut 1.12 Bool_t heavytail;
148     Float_t letmax;
149     Float_t lmipth;
150     //
151 mocchiut 1.1 Float_t eplane[2][22];
152     //
153 mocchiut 1.6 CaloLevel2 *clp;
154     //
155 mocchiut 1.10 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"...
156 mocchiut 1.7 //
157 mocchiut 1.11 TString suf;
158 mocchiut 1.1
159     public:
160     //
161     //
162 mocchiut 1.3 void Fit();
163     void Fit(Bool_t draw);
164     //
165     // Double_t ccurve(Double_t *t, Double_t *par);
166     //
167 mocchiut 1.6 void SetCaloLevel2Pointer(CaloLevel2 *cp){ clp = cp;};
168     //
169 mocchiut 1.3 Float_t Get_E0(){this->Fit(); return E0;};
170 mocchiut 1.7 Float_t Get_defE0(){this->Fit(); return defE0;};
171 mocchiut 1.3 Float_t Get_a(){this->Fit(); return a;};
172     Float_t Get_b(){this->Fit(); return b;};
173     Float_t Get_errE0(){this->Fit(); return errE0;};
174     Float_t Get_erra(){this->Fit(); return erra;};
175     Float_t Get_errb(){this->Fit(); return errb;};
176     Float_t Get_chi2(){this->Fit(); return chi2;};
177     Float_t Get_ndf(){this->Fit(); return ndf;};
178     Float_t Get_nchi2(){this->Fit(); if ( ndf > 0 ) return (chi2/ndf); return 0;};
179     Float_t Get_tmax(){this->Fit(); if ( b != 0 ) return ((a-1.)/b); return 0;};
180     Float_t Get_asymm(){this->Fit(); return asymm;};
181     Float_t Get_exptmax(){this->Process(); return etmax;};
182     Float_t Get_X0pl(){this->Process(); return X0pl;};
183 mocchiut 1.12 //
184     Float_t Get_letmax(){ return letmax;};
185     Float_t Get_lmipth(){ return lmipth;};
186     Int_t Get_fitresult(){this->Fit(); return fitresult;};
187 mocchiut 1.3 //
188 mocchiut 1.6 void ForceNextFit(){atime=0;fatime=0;};
189 mocchiut 1.1 void Draw();
190     void Draw(Int_t);
191     //
192     CaloLong();
193     CaloLong(PamLevel2 *L2);
194     ~CaloLong(){ Delete(); };
195     //
196     void SetDebug(Bool_t d){ debug=d; };
197 mocchiut 1.14 // void UsePlane18X(){ no18x=false; };
198    
199     void UsePlane18X(Bool_t use="false"){usepl18x = use; no18x=!use;};
200     //
201 mocchiut 1.3 //
202 mocchiut 1.9 void UseAverage(){ xyaverage = true;};
203     void UseAllMeas(){ xyaverage = false;};
204     //
205 mocchiut 1.5 void MaskSection(TString);
206 mocchiut 1.6 void UnMaskSection(TString);
207     void UnMaskSections();
208 mocchiut 1.3 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);
209     void Contamination(){sel = false; cont = true;}; ///< Set contamination mode: planes from N to 22 are used.
210     void SetNoWpreSampler(Int_t n);
211     void SetNoWcalo(Int_t n);
212 mocchiut 1.4 void SplitInto(Int_t NoWpreSampler, Int_t NoWcalo);
213 mocchiut 1.3 Int_t GetNoWpreSampler(){return N;}; ///< Get the number of W planes used as presampler.
214     Int_t GetNoWcalo(){return NC;}; ///< Get the number of W planes used as calorimeter.
215 mocchiut 1.6 void SetEnergies(Float_t myene[][22]);
216 mocchiut 1.3 //
217 mocchiut 1.7 void SetLowerLimit(Float_t l){ lmax = l; };
218     void SetUpperLimit(Float_t u){ umax = u; };
219     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)
220     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)
221     //
222 mocchiut 1.12 void Setletmax(Float_t l){ letmax = l;};
223     void Setlmipth(Float_t l){ lmipth = l;};
224     void HeavyTail(Bool_t b){ heavytail=b;};
225     //
226 mocchiut 1.8 Float_t GetLowerLimit(){ return lmax;};
227     Float_t GetUpperLimit(){ return umax;};
228     //
229 mocchiut 1.11 void SetSuffix(TString suffix){ suf = suffix;};
230     //
231 mocchiut 1.3 void Clear();
232     void Clear(Option_t *option){Clear();};
233     void Delete();
234     void Delete(Option_t *option){Delete();};
235     //
236     void Process(); ///< Process data
237     void Print();
238     void Print(Option_t *option){Print();};
239     //
240 mocchiut 1.15 ClassDef(CaloLong,4);
241 mocchiut 1.3 };
242    
243     /**
244     *
245     */
246     class Calo2D : public TObject {
247    
248     private:
249     //
250     PamLevel2 *L2;
251     Bool_t debug;
252     //
253     // needed to avoid reprocessing the same event over and over to obtain the variables
254     //
255     UInt_t OBT;
256     UInt_t PKT;
257     UInt_t atime;
258     //
259     Float_t estrip[23][96][96];
260     Int_t smax[23];
261     Int_t smay[23];
262 mocchiut 1.14 Bool_t usepl18x;
263 mocchiut 1.3 //
264 mocchiut 1.11 TString suf;
265 mocchiut 1.3
266     public:
267     //
268     //
269     void Draw();
270     void Draw(Int_t);
271     //
272     Calo2D();
273     Calo2D(PamLevel2 *L2);
274     ~Calo2D(){ Delete(); };
275     //
276     void SetDebug(Bool_t d){ debug=d; };
277 mocchiut 1.1 //
278     void Clear();
279     void Clear(Option_t *option){Clear();};
280     void Delete();
281 mocchiut 1.2 void Delete(Option_t *option){Delete();};
282 mocchiut 1.1 //
283 mocchiut 1.11 void SetSuffix(TString suffix){ suf = suffix;};
284 mocchiut 1.14
285     void UsePlane18X(Bool_t use){usepl18x = use;};
286     //
287 mocchiut 1.11 //
288 mocchiut 1.1 void Process(); ///< Process data
289     void Print();
290 mocchiut 1.2 void Print(Option_t *option){Print();};
291 mocchiut 1.1 //
292 mocchiut 1.15 ClassDef(Calo2D,3);
293 mocchiut 1.1 };
294    
295     #endif
296    

  ViewVC Help
Powered by ViewVC 1.1.23