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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1.1.1 by mocchiut, Fri Nov 9 09:11:24 2007 UTC revision 1.17 by mocchiut, Tue May 18 04:03:16 2010 UTC
# Line 5  Line 5 
5  #ifndef caloprofile_h  #ifndef caloprofile_h
6  #define caloprofile_h  #define caloprofile_h
7    
8  #include <PamLevel2.h>  #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>  #include <TTree.h>
16  #include <TFriendElement.h>  #include <TFriendElement.h>
17  #include <TChain.h>  #include <TChain.h>
# Line 24  Line 29 
29  #include <TSystemDirectory.h>  #include <TSystemDirectory.h>
30  #include <TSQLServer.h>  #include <TSQLServer.h>
31  #include <TF1.h>  #include <TF1.h>
32  #include <iostream>  #include <TGraphErrors.h>
33    #include <TMinuit.h>
34    
35    #include <PamLevel2.h>
36    
37  using namespace std;  using namespace std;
38    
39    struct stack{
40        char data[MAX];
41        int top;
42    };
43    
44  /**  /**
45   *   *
46   */   */
# Line 45  class CaloLat : public TObject { Line 58  class CaloLat : public TObject {
58      UInt_t atime;      UInt_t atime;
59      //      //
60      Float_t estrip[2][22][96];      Float_t estrip[2][22][96];
61        TString suf;
62        Bool_t usepl18x;
63      //      //
64    
65   public:   public:
# Line 62  class CaloLat : public TObject { Line 77  class CaloLat : public TObject {
77      void Clear();      void Clear();
78      void Clear(Option_t *option){Clear();};      void Clear(Option_t *option){Clear();};
79      void Delete();      void Delete();
80        void Delete(Option_t *option){Delete();};
81      //      //
82      void Process(); ///< Process data      void Process(); ///< Process data
83      void Print();      void Print();
84        void Print(Option_t *option){Print();};
85      //      //
86      ClassDef(CaloLat,1);      
87        void UsePlane18X(Bool_t use){usepl18x = use;};
88        //
89        //
90        void SetSuffix(TString suffix){ suf = suffix;};
91        //
92        ClassDef(CaloLat,3);
93  };  };
94    
95  /**  /**
# Line 84  class CaloLong : public TObject { Line 107  class CaloLong : public TObject {
107      UInt_t OBT;      UInt_t OBT;
108      UInt_t PKT;      UInt_t PKT;
109      UInt_t atime;      UInt_t atime;
110        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        Bool_t usepl18x;
120        //
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        Float_t defE0;
133        Float_t umax;
134        Float_t lmax;
135        TString sumax;
136        TString slmax;
137        Int_t fitresult;
138        //
139        Bool_t no18x;
140        Bool_t maskXE;
141        Bool_t maskYE;
142        Bool_t maskXO;
143        Bool_t maskYO;
144        //
145        Bool_t xyaverage;
146        //
147        Bool_t heavytail;
148        Float_t letmax;
149        Float_t lmipth;
150      //      //
151      Float_t eplane[2][22];      Float_t eplane[2][22];
152      //      //
153        CaloLevel2 *clp;
154        //
155        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        //
157        TString suf;
158        TF1 *lfit;
159    
160   public:   public:
161      //      //
162      //      //
163        void Fit();
164        void Fit(Bool_t draw);
165        TF1 *GetFit();
166        //
167        //    Double_t ccurve(Double_t *t, Double_t *par);
168        //
169        void SetCaloLevel2Pointer(CaloLevel2 *cp){ clp = cp;};
170        //
171        Float_t Get_E0(){this->Fit(); return E0;};
172        Float_t Get_defE0(){this->Fit(); return defE0;};
173        Float_t Get_a(){this->Fit(); return a;};
174        Float_t Get_b(){this->Fit(); return b;};
175        Float_t Get_errE0(){this->Fit(); return errE0;};
176        Float_t Get_erra(){this->Fit(); return erra;};
177        Float_t Get_errb(){this->Fit(); return errb;};
178        Float_t Get_chi2(){this->Fit(); return chi2;};
179        Float_t Get_ndf(){this->Fit(); return ndf;};
180        Float_t Get_nchi2(){this->Fit(); if ( ndf > 0 ) return (chi2/ndf); return 0;};
181        Float_t Get_tmax(){this->Fit(); if ( b != 0 ) return ((a-1.)/b); return 0;};
182        Float_t Get_asymm(){this->Fit(); return asymm;};
183        Float_t Get_exptmax(){this->Process(); return etmax;};
184        Float_t Get_X0pl(){this->Process(); return X0pl;};
185        //
186        Float_t Get_letmax(){ return letmax;};
187        Float_t Get_lmipth(){ return lmipth;};
188        Int_t Get_fitresult(){this->Fit(); return fitresult;};    
189        //
190        void ForceNextFit(){atime=0;fatime=0;};
191      void Draw();      void Draw();
192      void Draw(Int_t);      void Draw(Int_t);
193      //      //
# Line 99  class CaloLong : public TObject { Line 196  class CaloLong : public TObject {
196      ~CaloLong(){ Delete(); };      ~CaloLong(){ Delete(); };
197      //      //
198      void SetDebug(Bool_t d){ debug=d; };      void SetDebug(Bool_t d){ debug=d; };
199        //    void UsePlane18X(){ no18x=false; };
200        
201        void UsePlane18X(Bool_t use="false"){usepl18x = use; no18x=!use;};
202        //
203        //
204        void UseAverage(){ xyaverage = true;};
205        void UseAllMeas(){ xyaverage = false;};
206        //
207        void MaskSection(TString);
208        void UnMaskSection(TString);
209        void UnMaskSections();
210        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);
211        void Contamination(){sel = false; cont = true;}; ///< Set contamination mode: planes from N to 22 are used.
212        void SetNoWpreSampler(Int_t n);
213        void SetNoWcalo(Int_t n);
214        void SplitInto(Int_t NoWpreSampler, Int_t NoWcalo);
215        Int_t GetNoWpreSampler(){return N;}; ///< Get the number of W planes used as presampler.
216        Int_t GetNoWcalo(){return NC;}; ///< Get the number of W planes used as calorimeter.
217        void SetEnergies(Float_t myene[][22]);
218        //
219        void SetLowerLimit(Float_t l){ lmax = l; };
220        void SetUpperLimit(Float_t u){ umax = u; };
221        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)
222        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)
223        //
224        void Setletmax(Float_t l){ letmax = l;};
225        void Setlmipth(Float_t l){ lmipth = l;};
226        void HeavyTail(Bool_t b){ heavytail=b;};
227        //
228        Float_t GetLowerLimit(){ return lmax;};
229        Float_t GetUpperLimit(){ return umax;};
230        //
231        void SetSuffix(TString suffix){ suf = suffix;};
232        //
233        void Clear();
234        void Clear(Option_t *option){Clear();};
235        void Delete();
236        void Delete(Option_t *option){Delete();};
237        //
238        void Process(); ///< Process data
239        void Print();
240        void Print(Option_t *option){Print();};
241        //
242        ClassDef(CaloLong,4);
243    };
244    
245    /**
246     *
247     */
248    class Calo2D : public TObject {
249    
250     private:
251        //
252        PamLevel2 *L2;
253        Bool_t debug;
254        //
255        // needed to avoid reprocessing the same event over and over to obtain the variables
256        //
257        UInt_t OBT;
258        UInt_t PKT;
259        UInt_t atime;
260        //
261        Float_t estrip[23][96][96];
262        Int_t smax[23];
263        Int_t smay[23];
264        Bool_t usepl18x;
265        //
266        TString suf;
267    
268     public:
269        //
270        //
271        void Draw();
272        void Draw(Int_t);
273        //
274        Calo2D();
275        Calo2D(PamLevel2 *L2);
276        ~Calo2D(){ Delete(); };
277        //
278        void SetDebug(Bool_t d){ debug=d; };
279      //      //
280      void Clear();      void Clear();
281      void Clear(Option_t *option){Clear();};      void Clear(Option_t *option){Clear();};
282      void Delete();      void Delete();
283        void Delete(Option_t *option){Delete();};
284        //
285        void SetSuffix(TString suffix){ suf = suffix;};
286        
287        void UsePlane18X(Bool_t use){usepl18x = use;};
288        //
289      //      //
290      void Process(); ///< Process data      void Process(); ///< Process data
291      void Print();      void Print();
292        void Print(Option_t *option){Print();};
293      //      //
294      ClassDef(CaloLong,1);      ClassDef(Calo2D,3);
295  };  };
296    
297  #endif  #endif

Legend:
Removed from v.1.1.1.1  
changed lines
  Added in v.1.17

  ViewVC Help
Powered by ViewVC 1.1.23