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

Contents of /calo/flight/CaloEnergy/inc/CaloEnergy.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Fri Jul 10 09:54:32 2009 UTC (15 years, 6 months ago) by mocchiut
Branch: MAIN
Changes since 1.1: +25 -5 lines
File MIME type: text/plain
Bugs fixed and new methods implemented

1 /**
2 * \file CaloEnergy.h
3 * \authors Emiliano Mocchiutti & Giovanna Jerse
4 */
5 #ifndef caloenergy_h
6 #define caloenergy_h
7
8 #include <PamLevel2.h>
9
10 #include <TTree.h>
11 #include <TFriendElement.h>
12 #include <TChain.h>
13 #include <TFile.h>
14 #include <TList.h>
15 #include <TKey.h>
16 #include <TSystemFile.h>
17 #include <TSystemDirectory.h>
18 #include <TSQLServer.h>
19
20 #include <iostream>
21
22 using namespace std;
23
24 /**
25 *
26 */
27 class CaloEnergy : public TObject {
28
29 private:
30 //
31 PamLevel2 *L2;
32 Bool_t debug;
33 //
34 // needed to avoid reprocessing the same event over and over to obtain the variables
35 //
36 UInt_t OBT;
37 UInt_t PKT;
38 UInt_t atime;
39 TString sntr;
40 UInt_t AOBT;
41 UInt_t APKT;
42 UInt_t aatime;
43 TString asntr;
44 //
45 Float_t fM;
46 Float_t fM1;
47 Int_t fPl;
48 Float_t fConv_rxe;
49 Float_t fConv_rxo;
50 Float_t fConv_rye;
51 Float_t fConv_ryo;
52 Bool_t fLong;
53 //
54 Float_t fEnergyxe;
55 Float_t fEnergyxo;
56 Float_t fEnergyye;
57 Float_t fEnergyyo;
58 Float_t fEnergy;
59 Float_t fCount;
60 Int_t fMax_planexe;
61 Int_t fMax_planexo;
62 Int_t fMax_planeyo;
63 Int_t fMax_planeye;
64 Float_t fMax_plane;
65 //
66 Float_t xe1;
67 Float_t xe2;
68 Float_t xe3;
69 Float_t xe4;
70 Float_t xe5;
71 Float_t xe6;
72 Float_t z1;
73 Float_t yo1;
74 Float_t yo2;
75 Float_t yo3;
76 Float_t yo4;
77 Float_t yo5;
78 Float_t yo6;
79 Float_t z2;
80 Float_t xo1;
81 Float_t xo2;
82 Float_t xo3;
83 Float_t xo4;
84 Float_t xo5;
85 Float_t xo6;
86 Float_t z3;
87 Float_t ye1;
88 Float_t ye2;
89 Float_t ye3;
90 Float_t ye4;
91 Float_t ye5;
92 Float_t ye6;
93 Float_t z4;
94 Float_t trk_z[22][2];
95 Float_t en;
96 Int_t view;
97 Int_t plane;
98 Int_t strip;
99 Int_t fRad;
100 Float_t energyxe;
101 Float_t energyyo;
102 Float_t energyxo;
103 Float_t energyye;
104 Float_t en_xep[11];
105 Float_t en_yop[11];
106 Float_t en_xop[11];
107 Float_t en_yep[11];
108 Float_t enstrip[2][22][96];
109 //
110 Bool_t fXosel;
111 Bool_t fXesel;
112 Bool_t fYosel;
113 Bool_t fYesel;
114 Bool_t fSel;
115 //
116 Bool_t fSimu;
117 void DefineGeometry();
118
119 public:
120 //
121 CaloEnergy();
122 CaloEnergy(PamLevel2 *L2);
123 CaloEnergy(PamLevel2 *L2, Bool_t simulation);
124 ~CaloEnergy(){ Delete(); };
125 //
126 void SetDebug(Bool_t d){ debug=d; };
127 //
128 void Clear();
129 void Clear(Option_t *option){Clear();};
130 void Delete();
131 void Delete(Option_t *option){Delete();};
132 //
133 void Process();
134 void Process(TString section);
135 void Print();
136 void Print(Option_t *option){Print();};
137 //
138 Bool_t IsInsideAcceptance(TString section);
139 Bool_t IsInsideAcceptance(TString section, Bool_t fast);
140 //
141 Bool_t IsInsideXE(){return(IsInsideAcceptance("XE"));};
142 Bool_t InsideXEcheck(){return fXesel;};
143 Bool_t IsInsideXO(){return(IsInsideAcceptance("XO"));};
144 Bool_t InsideXOcheck(){return fXosel;};
145 Bool_t IsInsideYE(){return(IsInsideAcceptance("YE"));};
146 Bool_t InsideYEcheck(){return fYesel;};
147 Bool_t IsInsideYO(){return(IsInsideAcceptance("YO"));};
148 Bool_t InsideYOcheck(){return fYosel;};
149 //
150 Float_t GetEnergy(){ Process(); return fEnergy;};
151 Float_t GetEnergy(TString section){ Process(section); return fEnergy;};
152 Float_t GetCount(){ return fCount;};
153 //
154 Float_t GetMaxplane(){ return fMax_plane;};
155 Float_t GetMaxEnergy(TString section){ return(this->GetEnergy(section)*this->GetConversionFactor(section));};
156 Int_t GetMaxplane(TString section);
157 //
158 void UseLongitudinalFitEnergy(){ fPl = 0; fLong = true;};
159 void UseMeasuredEnergyUpToMax(){ fLong = false;};
160 void SetMargin(Float_t margin){fM = margin + 0.096; fM1 = margin - 0.122 - 0.096; if ( fM1 < 0. ) fM1 = 0.;};
161 void SetMarginStripDirection(Float_t margin){fM = margin + 0.096;};
162 void SetMarginStripReading(Float_t margin){fM1 = margin -0.122 - 0.096;};
163 void SetRadius(Int_t strip){fRad = strip;};
164 void SetMaxPlaneOffset(Int_t noplanes){fPl = noplanes;};
165 //
166 void SetConversionFactor(TString section, Float_t conv_r);
167 Float_t GetConversionFactor(TString section);
168 //
169 ClassDef(CaloEnergy,1);
170 };
171
172 #endif
173

  ViewVC Help
Powered by ViewVC 1.1.23