3 #include <calobase/RawTower.h>
4 #include <calobase/RawTowerContainer.h>
5 #include <calobase/RawTowerDefs.h>
6 #include <calobase/RawTowerGeom.h>
7 #include <calobase/RawTowerGeomContainer.h>
8 #include <calobase/RawTowerGeomContainer_Cylinderv1.h>
9 #include <calobase/RawTowerGeomv1.h>
10 #include <calobase/RawTowerv1.h>
11 #include <calobase/TowerInfo.h>
12 #include <calobase/TowerInfoContainer.h>
13 #include <calobase/TowerInfoContainerv1.h>
20 #include <phparameter/PHParameterInterface.h>
21 #include <phparameter/PHParameters.h>
29 #include <pdbcalbase/PdbParameterMapContainer.h>
63 <<
" Detector name not set, use HcalRawTowerBuilder::Detector(string) to set, exiting"
74 std::cout <<
PHWHERE <<
"DST Node missing, exiting" << std::endl;
85 catch (std::exception &
e)
87 std::cout << e.what() << std::endl;
124 std::cout <<
"HcalRawTowerBuilder::InitRun :";
127 std::cout <<
"save Geant4 energy deposition in towers" << std::endl;
131 std::cout <<
"save light yield in towers" << std::endl;
135 std::cout <<
"save ionization energy in towers" << std::endl;
139 std::cout <<
"save raw (pre-Mephi map) light yield in towers" << std::endl;
143 std::cout <<
"unknown energy source" << std::endl;
160 double geom_ref_radius = innerrad + thickness / 2.;
162 if (!std::isfinite(phistart))
164 std::cout <<
PHWHERE <<
" phistart is not finite: " << phistart
165 <<
", exiting now (this will crash anyway)" << std::endl;
171 std::pair<double, double> range = std::make_pair(phiend, phistart);
182 double etahibound = etalowbound +
184 std::pair<double, double> range = std::make_pair(etalowbound, etahibound);
186 etalowbound = etahibound;
203 std::cout <<
"HcalRawTowerBuilder::InitRun - Tower geometry " << key <<
" already exists" << std::endl;
206 if (fabs(tg->get_center_x() -
x) > 1e-4)
208 std::cout <<
"HcalRawTowerBuilder::InitRun - Fatal Error - duplicated Tower geometry " << key <<
" with existing x = " << tg->
get_center_x() <<
" and expected x = " << x
213 if (fabs(tg->get_center_y() -
y) > 1e-4)
215 std::cout <<
"HcalRawTowerBuilder::InitRun - Fatal Error - duplicated Tower geometry " << key <<
" with existing y = " << tg->get_center_y() <<
" and expected y = " << y
219 if (fabs(tg->get_center_z() -
z) > 1e-4)
221 std::cout <<
"HcalRawTowerBuilder::InitRun - Fatal Error - duplicated Tower geometry " << key <<
" with existing z= " << tg->get_center_z() <<
" and expected z = " <<
z
230 std::cout <<
"HcalRawTowerBuilder::InitRun - building tower geometry " << key <<
"" << std::endl;
250 for (
int i = 0;
i <
n;
i++)
252 for (
int j = 0;
j <
m;
j++)
262 std::ifstream decalibrate_tower;
264 if (decalibrate_tower.is_open())
266 while (!decalibrate_tower.eof())
270 for (
int i = 0;
i <
n;
i++)
272 for (
int j = 0;
j <
m;
j++)
275 if (!std::isfinite(m_DecalArray[
i][
j]))
277 std::cout <<
"Calibration constant at etabin " << etabin
279 <<
" is not finite: " << m_DecalArray[
i][
j] << std::endl;
286 decalibrate_tower.close();
300 double cell_weight = 0.0;
303 std::cout <<
PHWHERE <<
"Process event entered" << std::endl;
310 std::cout <<
PHWHERE <<
"TowerInfoContainer Node missing, doing nothing." << std::endl;
316 PHG4CellContainer *slats = findNode::getClass<PHG4CellContainer>(topNode, cellnodename);
319 std::cout <<
PHWHERE <<
" Node " << cellnodename
320 <<
" missing, quitting" << std::endl;
328 for (cell_iter = cell_range.first; cell_iter != cell_range.second;
353 std::cout <<
Name() <<
": unknown tower energy source "
375 shower_iter != range.second;
378 tower->
add_eshower(shower_iter->first, shower_iter->second);
387 unsigned int phibin = twrrow;
389 unsigned int towerkey = (etabin << 16U) + phibin;
394 std::cout << __PRETTY_FUNCTION__ <<
": missing towerkey = " << towerkey <<
" in m_TowerInfoContainer!";
409 if (fabs(cellE - towerE) / cellE > 1
e-5)
411 std::cout <<
"towerE: " << towerE <<
", cellE: " << cellE <<
", delta: "
412 << cellE - towerE << std::endl;
424 std::cout <<
"Energy lost by dropping towers with less than " <<
m_Emin
430 for (iter = begin_end.first; iter != begin_end.second; ++iter)
432 iter->second->identify();
445 std::cout <<
PHWHERE <<
"Run Node missing, exiting." << std::endl;
452 std::cout <<
PHWHERE <<
"DST Node missing, exiting." << std::endl;
483 DetNode->addNode(towerNode);
502 if (m_TowerInfoContainer ==
nullptr)
507 detec = TowerInfoContainer::DETECTOR::EMCAL;
511 detec = TowerInfoContainer::DETECTOR::HCAL;
515 std::cout <<
PHWHERE <<
"Detector not implemented into the TowerInfoContainer object, defaulting to HCal implementation." << std::endl;
516 detec = TowerInfoContainer::DETECTOR::HCAL;
520 DetNode->addNode(TowerInfoNode);
557 std::cout <<
"could not find " << geonodename << std::endl;
559 se->
Print(
"NODETREE");
577 m_DecalArray.resize(nTiles, std::vector<double>(nPhislices));
600 std::pair<int, int> etaphi = std::make_pair(etabin, phibin);
608 int istart = phibin * m_NcellToTower +
i;
615 std::cout <<
Name() << std::endl;