8 #include <calobase/TowerInfo.h>
9 #include <calobase/TowerInfoContainer.h>
10 #include <calobase/TowerInfoDefs.h>
45 , OutFileName(
"eventplane_correction_histograms")
93 for (
unsigned int order = 1; order <
m_MaxOrder + 1; order++)
95 if(!(cdbhistosIn->
getHisto(Form(
"tprof_mean_cos_south_mbd_order_%d",order))))
112 for (
unsigned int order = 1; order < m_MaxOrder + 1; order++)
116 if(!(cdbhistosIn->
getHisto(Form(
"tprof_cos_north_mbd_shift_order_%d_%d",order,
p))))
133 cdbhistosIn->
Print();
140 for (
unsigned int order = 1; order < m_MaxOrder + 1; order++)
142 tprof_mean_cos_south_mbd[order - 1] =
new TProfile(Form(
"tprof_mean_cos_south_mbd_order_%d", order),
"", 125*4, 0, 2500, -1e10, 1e10);
143 tprof_mean_sin_south_mbd[order - 1] =
new TProfile(Form(
"tprof_mean_sin_south_mbd_order_%d", order),
"", 125*4, 0, 2500, -1e10, 1e10);
144 tprof_mean_cos_north_mbd[order - 1] =
new TProfile(Form(
"tprof_mean_cos_north_mbd_order_%d", order),
"", 125*4, 0, 2500, -1e10, 1e10);
145 tprof_mean_sin_north_mbd[order - 1] =
new TProfile(Form(
"tprof_mean_sin_north_mbd_order_%d", order),
"", 125*4, 0, 2500, -1e10, 1e10);
155 for (
unsigned int order = 1; order < m_MaxOrder + 1; order++)
158 if(cdbhistosIn->
getHisto(Form(
"tprof_mean_cos_south_mbd_order_%d",order)))
163 tprof_cos_north_mbd_shift[order - 1][
p] =
new TProfile(Form(
"tprof_cos_north_mbd_shift_order_%d_%d",order,
p),
"", 125*4, 0, 2500, -1e10, 1e10);
164 tprof_sin_north_mbd_shift[order - 1][
p] =
new TProfile(Form(
"tprof_sin_north_mbd_shift_order_%d_%d",order,
p),
"", 125*4, 0, 2500, -1e10, 1e10);
165 tprof_cos_south_mbd_shift[order - 1][
p] =
new TProfile(Form(
"tprof_cos_south_mbd_shift_order_%d_%d",order,
p),
"", 125*4, 0, 2500, -1e10, 1e10);
166 tprof_sin_south_mbd_shift[order - 1][
p] =
new TProfile(Form(
"tprof_sin_south_mbd_shift_order_%d_%d",order,
p),
"", 125*4, 0, 2500, -1e10, 1e10);
186 std::cout <<
"======================= EventPlaneReco::InitRun() =======================" << std::endl;
187 std::cout <<
"===========================================================================" << std::endl;
198 std::cout <<
"EventPlaneReco::process_event -- entered" << std::endl;
204 EventplaneinfoMap *epmap = findNode::getClass<EventplaneinfoMap>(topNode,
"EventplaneinfoMap");
207 std::cout <<
PHWHERE <<
"::ERROR - cannot find EventplaneinfoMap" << std::endl;
214 TowerInfoContainer *epd_towerinfo = findNode::getClass<TowerInfoContainer>(topNode,
"TOWERINFO_CALIB_EPD");
217 std::cout <<
PHWHERE <<
"::ERROR - cannot find TOWERINFO_CALIB_EPD" << std::endl;
220 EpdGeom *_epdgeom = findNode::getClass<EpdGeom>(topNode,
"TOWERGEOM_EPD");
223 std::cout <<
PHWHERE <<
"::ERROR - cannot find TOWERGEOM_EPD" << std::endl;
231 std::cout <<
"EventPlaneReco::process_event - epd_towerinfo" << std::endl;
234 unsigned int ntowers = epd_towerinfo->
size();
235 for (
unsigned int ch = 0; ch < ntowers; ch++)
244 float tile_phi = _epdgeom->
get_phi(key);
249 for (
unsigned int order = 1; order <
m_MaxOrder + 1; order++)
251 double Cosine = cos(tile_phi * (
double) order);
252 double Sine = sin(tile_phi * (
double) order);
253 south_q[order - 1][0] += truncated_e * Cosine;
254 south_q[order - 1][1] += truncated_e * Sine;
259 for (
unsigned int order = 1; order <
m_MaxOrder + 1; order++)
261 double Cosine = cos(tile_phi * (
double) order);
262 double Sine = sin(tile_phi * (
double) order);
263 north_q[order - 1][0] += truncated_e * Cosine;
264 north_q[order - 1][1] += truncated_e * Sine;
269 for (
unsigned int order = 1; order <
m_MaxOrder + 1; order++)
298 MbdPmtContainer *mbdpmts = findNode::getClass<MbdPmtContainer>(topNode,
"MbdPmtContainer");
301 std::cout <<
PHWHERE <<
"::ERROR - cannot find MbdPmtContainer" << std::endl;
305 MbdGeom *mbdgeom = findNode::getClass<MbdGeom>(topNode,
"MbdGeom");
308 std::cout <<
PHWHERE <<
"::ERROR - cannot find MbdGeom" << std::endl;
317 std::cout <<
"EventPlaneReco::process_event - mbdpmts" << std::endl;
324 for (
int ipmt = 0; ipmt < mbdpmts->
get_npmt(); ipmt++)
330 for (
int ipmt = 0; ipmt < mbdpmts->
get_npmt(); ipmt++)
334 int arm = mbdgeom->
get_arm(ipmt);
341 for (
unsigned int order = 1; order <
m_MaxOrder + 1; order++)
343 double Cosine = cos(phi * (
double) order);
344 double Sine = sin(phi * (
double) order);
345 south_q[order - 1][0] += mbd_q * Cosine;
346 south_q[order - 1][1] += mbd_q * Sine;
352 for (
unsigned int order = 1; order <
m_MaxOrder + 1; order++)
354 double Cosine = cos(phi * (
double) order);
355 double Sine = sin(phi * (
double) order);
356 north_q[order - 1][0] += mbd_q * Cosine;
357 north_q[order - 1][1] += mbd_q * Sine;
364 for (
unsigned int order = 1; order <
m_MaxOrder + 1; order++)
377 for (
unsigned int order = 1; order < m_MaxOrder + 1; order++)
406 for (
unsigned int order = 1; order < m_MaxOrder + 1; order++)
423 for (
unsigned int order = 1; order < m_MaxOrder + 1; order++)
430 double terms =
p+1.0;
445 for (
unsigned int order = 1; order < m_MaxOrder + 1; order++)
451 double terms =
p+1.0;
453 double prefactor = 2.0/terms;
474 for (
unsigned int order = 1; order < m_MaxOrder + 1; order++)
483 for (
unsigned int order = 1; order < m_MaxOrder + 1; order++)
495 for (
unsigned int order = 1; order < m_MaxOrder + 1; order++)
539 std::cout <<
PHWHERE <<
"DST Node missing, doing nothing." << std::endl;
555 globalNode->
addNode(EpMapNode);
564 std::fill(
vec.begin(),
vec.end(), 0.);
569 std::fill(
vec.begin(),
vec.end(), 0.);
574 std::fill(
vec.begin(),
vec.end(), 0.);
579 std::fill(
vec.begin(),
vec.end(), 0.);
597 std::cout <<
" EventPlaneReco::End() " << std::endl;