/[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.7 - (hide annotations) (download)
Wed Aug 12 14:43:26 2009 UTC (15 years, 5 months ago) by mocchiut
Branch: MAIN
Changes since 1.6: +24 -0 lines
File MIME type: text/plain
New small features added

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

  ViewVC Help
Powered by ViewVC 1.1.23