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/TowerInfoContainer.h>
12 #include <calobase/TowerInfoContainerv1.h>
13 #include <calobase/TowerInfo.h>
34 #include <boost/io/ios_state.hpp>
55 std::cout <<
PHWHERE <<
" " << geonodename
56 <<
" Node missing, doing nothing." << std::endl;
57 throw std::runtime_error(
58 "Failed to find " + geonodename +
" node in RawTowerBuilder::CreateNodes");
70 std::cout <<
PHWHERE <<
"DST Node missing, doing nothing." << std::endl;
78 catch (std::exception &
e)
80 std::cout << e.what() << std::endl;
86 std::cout <<
"RawTowerBuilder::InitRun :";
89 std::cout <<
"save Geant4 energy deposition as the weight of the cells"
94 std::cout <<
"save light yield as the weight of the cells" << std::endl;
104 std::cout <<
PHWHERE <<
"Process event entered" << std::endl;
111 std::cout <<
PHWHERE <<
"TowerInfoContainer Node missing, doing nothing." << std::endl;
117 PHG4CellContainer *cells = findNode::getClass<PHG4CellContainer>(topNode, cellnodename);
120 std::cout <<
PHWHERE <<
" " << cellnodename
121 <<
" Node missing, doing nothing." << std::endl;
128 for (cell_iter = cell_range.first; cell_iter != cell_range.second; ++cell_iter)
134 std::cout <<
PHWHERE <<
" print out the cell:" << std::endl;
140 float cell_weight = 0;
169 boost::io::ios_flags_saver ifs(std::cout);
185 shower_iter != range.second;
188 tower->
add_eshower(shower_iter->first, shower_iter->second);
211 boost::io::ios_flags_saver ifs(std::cout);
215 unsigned int towerkey = (etabin << 16U) + phibin;
220 std::cout << __PRETTY_FUNCTION__ <<
": missing towerkey = " << towerkey <<
" in m_TowerInfoContainer!";
237 if (fabs(cellE - towerE) / cellE > 1
e-5)
239 std::cout <<
"towerE: " << towerE <<
", cellE: " << cellE <<
", delta: "
240 << cellE - towerE << std::endl;
251 std::cout <<
"Energy lost by dropping towers with less than " <<
m_Emin
257 for (iter = begin_end.first; iter != begin_end.second; ++iter)
259 iter->second->identify();
272 std::cout <<
PHWHERE <<
"Run Node missing, doing nothing." << std::endl;
273 throw std::runtime_error(
"Failed to find Run node in RawTowerBuilder::CreateNodes");
291 std::cout <<
PHWHERE <<
" " << geonodename
292 <<
" Node missing, doing nothing." << std::endl;
293 throw std::runtime_error(
294 "Failed to find " + geonodename +
" node in RawTowerBuilder::CreateNodes");
312 int first_layer = -1;
316 for (miter = begin_end.first; miter != begin_end.second; ++miter)
327 first_cellgeo = miter->second;
349 std::cout <<
"RawTowerBuilder::CreateNodes::" <<
Name()
350 <<
" - Fatal Error - unsupported cell binning method "
361 std::cout <<
"inconsistent binning method from " <<
m_CellBinning
362 <<
" layer " << cellgeo->
get_layer() <<
": "
368 std::cout <<
"radius of layer " << cellgeo->
get_layer() <<
" is "
369 << cellgeo->
get_radius() <<
" which smaller than radius "
370 << inner_radius <<
" of first layer in list " << first_layer
375 std::cout <<
"mixing number of phibins, fisrt layer: " <<
m_NumPhiBins
376 <<
" layer " << cellgeo->
get_layer() <<
": "
382 std::cout <<
"mixing number of phimin, fisrt layer: " <<
m_PhiMin
383 <<
" layer " << cellgeo->
get_layer() <<
": "
389 std::cout <<
"mixing phisteps first layer: " <<
m_PhiStep <<
" layer "
398 std::cout <<
"mixing number of EtaBins , first layer: "
405 std::cout <<
"mixing etamin, fisrt layer: " <<
m_EtaMin <<
" layer "
412 std::cout <<
"mixing eta steps first layer: " <<
m_EtaStep
413 <<
" layer " << cellgeo->
get_layer() <<
": "
424 std::cout <<
"mixing number of z bins , first layer: " <<
m_NumEtaBins
425 <<
" layer " << cellgeo->
get_layer() <<
": "
441 std::cout <<
"RawTowerBuilder::CreateNodes - ERROR - can not find first layer of cells "
482 std::cout <<
"RawTowerBuilder::CreateNodes - Tower geometry " << key <<
" already exists" << std::endl;
485 if (fabs(tg->get_center_x() -
x) > 1
e-4)
487 std::cout <<
"RawTowerBuilder::CreateNodes - Fatal Error - duplicated Tower geometry " << key <<
" with existing x = " << tg->
get_center_x() <<
" and expected x = " << x
492 if (fabs(tg->get_center_y() -
y) > 1
e-4)
494 std::cout <<
"RawTowerBuilder::CreateNodes - Fatal Error - duplicated Tower geometry " << key <<
" with existing y = " << tg->get_center_y() <<
" and expected y = " << y
498 if (fabs(tg->get_center_z() -
z) > 1
e-4)
500 std::cout <<
"RawTowerBuilder::CreateNodes - Fatal Error - duplicated Tower geometry " << key <<
" with existing z= " << tg->get_center_z() <<
" and expected z = " <<
z
509 std::cout <<
"RawTowerBuilder::CreateNodes - building tower geometry " << key <<
"" << std::endl;
528 const std::pair<double, double> z_range = first_cellgeo->
get_zbounds(
ibin);
530 const double eta1 = -log(tan(atan2(r, z_range.first) / 2.));
531 const double eta2 = -log(tan(atan2(r, z_range.second) / 2.));
551 std::cout <<
"RawTowerBuilder::CreateNodes - Tower geometry " << key <<
" already exists" << std::endl;
554 if (fabs(tg->get_center_x() -
x) > 1
e-4)
556 std::cout <<
"RawTowerBuilder::CreateNodes - Fatal Error - duplicated Tower geometry " << key <<
" with existing x = " << tg->
get_center_x() <<
" and expected x = " << x
561 if (fabs(tg->get_center_y() -
y) > 1
e-4)
563 std::cout <<
"RawTowerBuilder::CreateNodes - Fatal Error - duplicated Tower geometry " << key <<
" with existing y = " << tg->get_center_y() <<
" and expected y = " << y
567 if (fabs(tg->get_center_z() -
z) > 1
e-4)
569 std::cout <<
"RawTowerBuilder::CreateNodes - Fatal Error - duplicated Tower geometry " << key <<
" with existing z= " << tg->get_center_z() <<
" and expected z = " <<
z
578 std::cout <<
"RawTowerBuilder::CreateNodes - building tower geometry " << key <<
"" << std::endl;
593 std::cout <<
"RawTowerBuilder::CreateNodes - ERROR - unsupported cell geometry "
606 std::cout <<
PHWHERE <<
"DST Node missing, doing nothing." << std::endl;
607 throw std::runtime_error(
608 "Failed to find DST node in RawTowerBuilder::CreateNodes");
638 DetNode->addNode(towerNode);
655 if (m_TowerInfoContainer ==
nullptr)
660 detec = TowerInfoContainer::DETECTOR::EMCAL;
664 detec = TowerInfoContainer::DETECTOR::HCAL;
668 std::cout <<
PHWHERE <<
"Detector not implemented into the TowerInfoContainer object, defaulting to HCal implementation." << std::endl;
669 detec = TowerInfoContainer::DETECTOR::HCAL;
673 DetNode->addNode(TowerInfoNode);