/[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 by mocchiut, Fri Nov 9 09:11:24 2007 UTC revision 1.7 by mocchiut, Wed Aug 12 14:43:26 2009 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>  
33    #include <PamLevel2.h>
34    
35  using namespace std;  using namespace std;
36    
37    struct stack{
38        char data[MAX];
39        int top;
40    };
41    
42  /**  /**
43   *   *
44   */   */
# Line 62  class CaloLat : public TObject { Line 73  class CaloLat : public TObject {
73      void Clear();      void Clear();
74      void Clear(Option_t *option){Clear();};      void Clear(Option_t *option){Clear();};
75      void Delete();      void Delete();
76        void Delete(Option_t *option){Delete();};
77      //      //
78      void Process(); ///< Process data      void Process(); ///< Process data
79      void Print();      void Print();
80        void Print(Option_t *option){Print();};
81      //      //
82      ClassDef(CaloLat,1);      ClassDef(CaloLat,1);
83  };  };
# Line 84  class CaloLong : public TObject { Line 97  class CaloLong : public TObject {
97      UInt_t OBT;      UInt_t OBT;
98      UInt_t PKT;      UInt_t PKT;
99      UInt_t atime;      UInt_t atime;
100        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        Float_t defE0;
122        Float_t umax;
123        Float_t lmax;
124        TString sumax;
125        TString slmax;
126        Int_t fitresult;
127        //
128        Bool_t no18x;
129        Bool_t maskXE;
130        Bool_t maskYE;
131        Bool_t maskXO;
132        Bool_t maskYO;
133      //      //
134      Float_t eplane[2][22];      Float_t eplane[2][22];
135      //      //
136        CaloLevel2 *clp;
137        //
138        Float_t Evaluate(TString s, Float_t max); // expression must be of the form "5*t"."t+10","t-(4*t)"...
139        //
140    
141   public:   public:
142      //      //
143      //      //
144        void Fit();
145        void Fit(Bool_t draw);
146        //
147        //    Double_t ccurve(Double_t *t, Double_t *par);
148        //
149        void SetCaloLevel2Pointer(CaloLevel2 *cp){ clp = cp;};
150        //
151        Float_t Get_E0(){this->Fit(); return E0;};
152        Float_t Get_defE0(){this->Fit(); return defE0;};
153        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        void ForceNextFit(){atime=0;fatime=0;};
168      void Draw();      void Draw();
169      void Draw(Int_t);      void Draw(Int_t);
170      //      //
# Line 99  class CaloLong : public TObject { Line 173  class CaloLong : public TObject {
173      ~CaloLong(){ Delete(); };      ~CaloLong(){ Delete(); };
174      //      //
175      void SetDebug(Bool_t d){ debug=d; };      void SetDebug(Bool_t d){ debug=d; };
176        void UsePlane18X(){ no18x=false; };
177        //
178        void MaskSection(TString);
179        void UnMaskSection(TString);
180        void UnMaskSections();
181        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        void SplitInto(Int_t NoWpreSampler, Int_t NoWcalo);
186        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        void SetEnergies(Float_t myene[][22]);
189        //
190        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        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      //      //
240      void Clear();      void Clear();
241      void Clear(Option_t *option){Clear();};      void Clear(Option_t *option){Clear();};
242      void Delete();      void Delete();
243        void Delete(Option_t *option){Delete();};
244      //      //
245      void Process(); ///< Process data      void Process(); ///< Process data
246      void Print();      void Print();
247        void Print(Option_t *option){Print();};
248      //      //
249      ClassDef(CaloLong,1);      ClassDef(Calo2D,1);
250  };  };
251    
252  #endif  #endif

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.7

  ViewVC Help
Powered by ViewVC 1.1.23