/[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.13 - (hide annotations) (download)
Mon Sep 14 13:56:48 2009 UTC (15 years, 4 months ago) by mocchiut
Branch: MAIN
Changes since 1.12: +1 -0 lines
File MIME type: text/plain
Bug in Longitudinal fit fixed

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

  ViewVC Help
Powered by ViewVC 1.1.23