5 #include <calobase/RawTowerContainer.h>
6 #include <pdbcalbase/PdbParameterMap.h>
7 #include <phparameter/PHParameters.h>
33 #include <TLorentzVector.h>
50 calenergy =
new TNtuple(
"calenergy",
"calenergy",
"e_hcin:e_hcout:e_cemc:ea_hcin:ea_hcout:ea_cemc:ev_hcin:ev_hcout:ev_cemc:e_magnet:e_bh:e_emcelect:e_hcalin_spt:sfemc:sfihcal:sfohcal:sfvemc:sfvihcal:sfvohcal:LCG:emc_LCG:hcalin_LCG:hcalout_LCG:e_svtx:e_svtx_support:e_bh_plus:e_bh_minus");
72 float e_hcin = 0.0, e_hcout = 0.0, e_cemc = 0.0;
73 float ea_hcin = 0.0, ea_hcout = 0.0, ea_cemc = 0.0;
74 float ev_hcin = 0.0, ev_hcout = 0.0, ev_cemc = 0.0;
75 float e_magnet = 0.0, e_bh = 0.0;
76 float e_emcelect = 0.0, e_hcalin_spt = 0.0;
77 float e_svtx = 0.0, e_svtx_support = 0.0;
78 float e_bh_plus = 0.0, e_bh_minus = 0.0;
82 float hcalin_lcg = 0.0;
83 float hcalout_lcg = 0.0;
87 hit_iter != hcalout_hit_range.second; hit_iter++){
89 PHG4Hit *this_hit = hit_iter->second;
95 float rin = sqrt(pow(this_hit->
get_x(0),2)+pow(this_hit->
get_y(0),2));
96 float rout = sqrt(pow(this_hit->
get_x(1),2)+pow(this_hit->
get_y(1),2));
98 lcg += this_hit->
get_edep()*(rin + ((rout-rin)/2.0));
99 hcalout_lcg += this_hit->
get_edep()*(rin + ((rout-rin)/2.0));
106 hit_iter != hcalin_hit_range.second; hit_iter++){
108 PHG4Hit *this_hit = hit_iter->second;
114 float rin = sqrt(pow(this_hit->
get_x(0),2)+pow(this_hit->
get_y(0),2));
115 float rout = sqrt(pow(this_hit->
get_x(1),2)+pow(this_hit->
get_y(1),2));
117 lcg += this_hit->
get_edep()*(rin + ((rout-rin)/2.0));
118 hcalin_lcg += this_hit->
get_edep()*(rin + ((rout-rin)/2.0));
124 hit_iter != cemc_hit_range.second; hit_iter++){
126 PHG4Hit *this_hit = hit_iter->second;
132 float rin = sqrt(pow(this_hit->
get_x(0),2)+pow(this_hit->
get_y(0),2));
133 float rout = sqrt(pow(this_hit->
get_x(1),2)+pow(this_hit->
get_y(1),2));
135 lcg += this_hit->
get_edep()*(rin + ((rout-rin)/2.0));
136 emc_lcg += this_hit->
get_edep()*(rin + ((rout-rin)/2.0));
142 hit_iter != hcalout_abs_hit_range.second; hit_iter++){
144 PHG4Hit *this_hit = hit_iter->second;
149 float rin = sqrt(pow(this_hit->
get_x(0),2)+pow(this_hit->
get_y(0),2));
150 float rout = sqrt(pow(this_hit->
get_x(1),2)+pow(this_hit->
get_y(1),2));
152 lcg += this_hit->
get_edep()*(rin + ((rout-rin)/2.0));
153 hcalout_lcg += this_hit->
get_edep()*(rin + ((rout-rin)/2.0));
159 hit_iter != hcalin_abs_hit_range.second; hit_iter++){
161 PHG4Hit *this_hit = hit_iter->second;
166 float rin = sqrt(pow(this_hit->
get_x(0),2)+pow(this_hit->
get_y(0),2));
167 float rout = sqrt(pow(this_hit->
get_x(1),2)+pow(this_hit->
get_y(1),2));
169 lcg += this_hit->
get_edep()*(rin + ((rout-rin)/2.0));
170 hcalin_lcg += this_hit->
get_edep()*(rin + ((rout-rin)/2.0));
176 hit_iter != cemc_abs_hit_range.second; hit_iter++){
178 PHG4Hit *this_hit = hit_iter->second;
183 float rin = sqrt(pow(this_hit->
get_x(0),2)+pow(this_hit->
get_y(0),2));
184 float rout = sqrt(pow(this_hit->
get_x(1),2)+pow(this_hit->
get_y(1),2));
186 lcg += this_hit->
get_edep()*(rin + ((rout-rin)/2.0));
187 emc_lcg += this_hit->
get_edep()*(rin + ((rout-rin)/2.0));
193 hit_iter != magnet_hit_range.second; hit_iter++){
195 PHG4Hit *this_hit = hit_iter->second;
200 float rin = sqrt(pow(this_hit->
get_x(0),2)+pow(this_hit->
get_y(0),2));
201 float rout = sqrt(pow(this_hit->
get_x(1),2)+pow(this_hit->
get_y(1),2));
203 lcg += this_hit->
get_edep()*(rin + ((rout-rin)/2.0));
209 hit_iter != bh_hit_range.second; hit_iter++){
211 PHG4Hit *this_hit = hit_iter->second;
220 hit_iter != bh_plus_hit_range.second; hit_iter++){
222 PHG4Hit *this_hit = hit_iter->second;
231 hit_iter != bh_minus_hit_range.second; hit_iter++){
233 PHG4Hit *this_hit = hit_iter->second;
242 hit_iter != cemc_electronics_hit_range.second; hit_iter++){
244 PHG4Hit *this_hit = hit_iter->second;
249 float rin = sqrt(pow(this_hit->
get_x(0),2)+pow(this_hit->
get_y(0),2));
250 float rout = sqrt(pow(this_hit->
get_x(1),2)+pow(this_hit->
get_y(1),2));
252 lcg += this_hit->
get_edep()*(rin + ((rout-rin)/2.0));
258 hit_iter != hcalin_spt_hit_range.second; hit_iter++){
260 PHG4Hit *this_hit = hit_iter->second;
263 e_hcalin_spt += this_hit->
get_edep();
265 float rin = sqrt(pow(this_hit->
get_x(0),2)+pow(this_hit->
get_y(0),2));
266 float rout = sqrt(pow(this_hit->
get_x(1),2)+pow(this_hit->
get_y(1),2));
268 lcg += this_hit->
get_edep()*(rin + ((rout-rin)/2.0));
276 hit_iter != svtx_hit_range.second; hit_iter++){
278 PHG4Hit *this_hit = hit_iter->second;
287 hit_iter != svtx_support_hit_range.second; hit_iter++){
289 PHG4Hit *this_hit = hit_iter->second;
292 e_svtx_support += this_hit->
get_edep();
298 lcg = lcg/(e_cemc+ea_cemc+e_emcelect+e_hcin+ea_hcin+e_hcalin_spt+e_hcout+ea_hcout+e_magnet);
299 hcalin_lcg = hcalin_lcg/(e_hcin+ea_hcin);
300 hcalout_lcg = hcalout_lcg/(e_hcout+ea_hcout);
301 emc_lcg = emc_lcg/(e_cemc+ea_cemc);
311 ntdata[4] = ea_hcout;
314 ntdata[7] = ev_hcout;
316 ntdata[9] = e_magnet;
318 ntdata[11] = e_emcelect;
319 ntdata[12] = e_hcalin_spt;
321 ntdata[13] = e_cemc/(e_cemc + ea_cemc + e_emcelect);
322 ntdata[14] = e_hcin/(e_hcin + ea_hcin + e_hcalin_spt);
323 ntdata[15] = e_hcout/(e_hcout + ea_hcout);
325 ntdata[16] = ev_cemc/(e_cemc + ea_cemc + e_emcelect);
326 ntdata[17] = ev_hcin/(e_hcin + ea_hcin + e_hcalin_spt);
327 ntdata[18] = ev_hcout/(e_hcout + ea_hcout);
331 ntdata[20] = emc_lcg;
332 ntdata[21] = hcalin_lcg;
333 ntdata[22] = hcalout_lcg;
336 ntdata[24] = e_svtx_support;
338 ntdata[25] = e_bh_plus;
339 ntdata[26] = e_bh_minus;
393 _bh_hit_container = findNode::getClass<PHG4HitContainer> (topNode,
"G4HIT_BH_1");