AMSDST
myEcalShower.cxx
Go to the documentation of this file.
1 // Authors: M.Duranti - INFN di Perugia
2 #include "myEcalShower.h"
3 #include "debug.h"
4 #include "TClass.h"
5 
6 using namespace std;
7 
8 //--------------------------------------------------------------------
9 
11 #ifdef _WITHGBATCH_
12 ClassImp(myEcalShowerFiller);
13 #endif //#ifdef _WITHGBATCH_
14 
15 //--------------------------------------------------------------------
16 
18 #ifdef PDEBUG
19  printf("In myEcalShower::myEcalShower\n");
20 #endif
21  PRINTDEBUG;
22  init();
23  PRINTDEBUG;
24 }
25 
27 #ifdef PDEBUG
28  printf("In myEcalShower::~myEcalShower\n");
29 #endif
30  PRINTDEBUG;
31  Clear();
32 }
33 
34 void myEcalShower::Clear(Option_t* option){
35 #ifdef PDEBUG
36  printf("In myEcalShower::Clear\n");
37 #endif
38  PRINTDEBUG;
39  Status = -999999;
40  Nhits = -999999;
41  /*
42  memset(Dir, 0, 3*sizeof(Dir[0]));
43  memset(CofG, 0, 3*sizeof(CofG[0]));
44  memset(Entry, 0, 3*sizeof(Entry[0]));
45  memset(Exit, 0, 3*sizeof(Exit[0]));
46  */
47  fill_n(Dir, 3, 0.);
48  fill_n(CofG, 3, 0.);
49  fill_n(Exit, 3, 0.);
50  fill_n(Entry, 3, 0.);
51 
52  EnergyD = -0.0000001;
53  EnergyC = -0.0000001;
54  EnergyE = -0.0000001;
55  EnergyE2014 = -0.0000001;
56  EnergyA = -0.0000001;
57  EnergyF = -0.0000001;
58  DispLat = -999999;
59  DispLatX = -999999;
60  DispLatY = -999999;
61  S35RaX = -999999;
62  S35RaY = -999999;
63  MaxS = -9999999;
64  CorrectedEnergyElectrons = -9999999;
65  CorrectedEnergyPhotons = -9999999;
66  PRINTDEBUG;
67  return;
68 }
69 
71 #ifdef PDEBUG
72  printf("In myEcalShower::init\n");
73 #endif
74  PRINTDEBUG;
75  Clear();
76  PRINTDEBUG;
77  return;
78 }
79 
80 float myEcalShower::GetCorrectedEnergy(int partid, int method){
81 
82  if (method==2 && partid==2) return CorrectedEnergyElectrons;
83  else if (method==2 && partid==1) return CorrectedEnergyPhotons;
84  else {
85  printf("Only result of method 2 and for partid 1 and 2 has been saved, returning 0.0...\n");
86  }
87 
88  return 0.0;
89 }
90 
91 //----------------------------------------------------------------------------------------
92 
93 #ifdef _WITHGBATCH_
94 
95 myEcalShowerFiller::myEcalShowerFiller(){
96 #ifdef PDEBUG
97  printf("In myEcalShowerFiller::myEcalShowerFiller\n");
98 #endif
99  PRINTDEBUG;
100  init();
101  PRINTDEBUG;
102 }
103 
104 myEcalShowerFiller::~myEcalShowerFiller(){
105 #ifdef PDEBUG
106  printf("In myEcalShowerFiller::~myEcalShowerFiller\n");
107 #endif
108  PRINTDEBUG;
109  Clear();
110 }
111 
112 void myEcalShowerFiller::Clear(Option_t* option){
113 #ifdef PDEBUG
114  printf("In myEcalShowerFiller::Clear\n");
115 #endif
116  PRINTDEBUG;
117  shower=0;
118  PRINTDEBUG;
119  return;
120 }
121 
122 void myEcalShowerFiller::init(){
123 #ifdef PDEBUG
124  printf("In myEcalShowerFiller::init\n");
125 #endif
126  PRINTDEBUG;
127  Clear();
128  PRINTDEBUG;
129  return;
130 }
131 
132 void myEcalShowerFiller::Fill(EcalShowerR* _shower){
133 #ifdef PDEBUG
134  printf("In myEventFiller::Fill\n");
135 #endif
136  PRINTDEBUG;
137 
138  shower = _shower;
139 
140  if (shower) {
141  /*
142  memcpy(Dir, shower->Dir, 3*sizeof(Dir[0]));
143  memcpy(CofG, shower->CofG, 3*sizeof(CofG[0]));
144  memcpy(Entry, shower->Entry, 3*sizeof(Entry[0]));
145  memcpy(Exit, shower->Exit, 3*sizeof(Exit[0]));
146  */
147  copy_n(shower->Dir, 3, Dir);
148  copy_n(shower->CofG, 3, CofG);
149  copy_n(shower->DirCR, 3, DirCR);
150  copy_n(shower->CofGCR, 3, CofGCR);
151  copy_n(shower->Entry, 3, Entry);
152  copy_n(shower->Exit, 3, Exit);
153 
154  Status=shower->Status;
155  Nhits=shower->Nhits;
156 
157  EnergyD=shower->EnergyD;
158  EnergyC=shower->EnergyC;
159  EnergyE=shower->EnergyE;//Pisa merda, W Livorno!
160 #if !defined _B524_ && !defined _B530_ && !defined _B538_ && !defined _B550_ && !defined _B572_ && !defined _B580_ && !defined _B584_ && !defined _B594_ && !defined _B598_ && !defined _B610_ && !defined _B620_ && !defined _B630_
161  EnergyE2014=shower->EnergyE2014;//Pisa merda, W Livorno!
162 #endif //from B700
163  EnergyA=shower->EnergyA;
164  EnergyF=shower->EnergyF;
165 
166  DispLat = shower->ShowerLatDisp[0]/18;
167  DispLatX = shower->ShowerLatDisp[1]/8;
168  DispLatY = shower->ShowerLatDisp[2]/10;
169  // printf("DispLat: XY = %f, X = %f, Y = %f\n", DispLat, DispLatX, DispLatY);
170 
171  S35RaX=shower->S35Ra[0];
172  S35RaY=shower->S35Ra[1];
173 
174  MaxS=shower->ParProfile[1];
175 
176  CorrectedEnergyElectrons = shower->GetCorrectedEnergy(2,2);
177  CorrectedEnergyPhotons = shower->GetCorrectedEnergy(1,2);
178 
179  }
180 
181  PRINTDEBUG;
182 
183  return;
184 }
185 
186 #endif //#ifdef _WITHGBATCH_