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/RawTowerv2.h>
9 #include <calobase/TowerInfo.h>
10 #include <calobase/TowerInfoContainer.h>
11 #include <calobase/TowerInfoContainerv1.h>
12 #include <calobase/TowerInfov1.h>
14 #include <phparameter/PHParameters.h>
45 , _calib_algorithm(kNo_calibration)
47 , _calib_tower_node_prefix(
"CALIB")
48 , _raw_tower_node_prefix(
"RAW")
49 , _tower_calib_params(name)
69 std::cout <<
Name() <<
"::" <<
m_Detector <<
"::" << __PRETTY_FUNCTION__
70 <<
"DST Node missing, doing nothing." << std::endl;
78 catch (std::exception &
e)
80 std::cout << e.what() << std::endl;
86 std::cout <<
Name() <<
"::" <<
m_Detector <<
"::" << __PRETTY_FUNCTION__
87 <<
"kDbfile_tbt_gain_corr chosen but not implemented"
99 std::cout <<
Name() <<
"::" <<
m_Detector <<
"::" << __PRETTY_FUNCTION__
100 <<
"Process event entered" << std::endl;
108 for (rtiter = begin_end.first; rtiter != begin_end.second; ++rtiter)
112 const RawTower *raw_tower = rtiter->second;
134 const double raw_energy = raw_tower->
get_energy();
147 double tower_by_tower_calib = 1.;
150 const int l = raw_tower->
get_binl();
189 const double raw_energy = raw_tower->
get_energy();
204 std::cout <<
PHWHERE <<
" Could not get Hcal Calibration for domain HCALTBYTCORR" << std::endl;
216 std::cout <<
PHWHERE <<
" Could not get Cemc Calibration for domain CEMCTBYTCORR" << std::endl;
225 std::cout <<
Name() <<
"::" <<
m_Detector <<
"::" << __PRETTY_FUNCTION__
226 <<
"kDbfile_tbt_gain_corr chosen but no file loaded" << std::endl;
230 float gain_factor = -888;
235 unsigned int etaphikey =
phi;
236 etaphikey = (etaphikey << 16U) + eta;
240 const double raw_energy = raw_tower->
get_energy();
252 std::cout <<
Name() <<
"::" <<
m_Detector <<
"::" << __PRETTY_FUNCTION__
281 const double raw_energy = raw_tower->
get_energy();
289 double tower_by_tower_calib = 1.;
304 const double raw_energy = raw_tower->
get_energy();
312 std::cout <<
Name() <<
"::" <<
m_Detector <<
"::" << __PRETTY_FUNCTION__
313 <<
"kDbfile_tbt_gain_corr chosen but no file loaded" << std::endl;
317 float gain_factor = -888;
320 unsigned int etaphikey =
phi;
321 etaphikey = (etaphikey << 16U) + eta;
324 const double raw_energy = raw_tower->
get_energy();
330 std::cout <<
Name() <<
"::" <<
m_Detector <<
"::" << __PRETTY_FUNCTION__
370 std::cout <<
Name() <<
"::" <<
m_Detector <<
"::" << __PRETTY_FUNCTION__
372 <<
", output sum digitalized value = "
387 "PHCompositeNode",
"RUN"));
390 std::cout <<
Name() <<
"::" <<
m_Detector <<
"::" << __PRETTY_FUNCTION__
391 <<
"Run Node missing, doing nothing." << std::endl;
392 throw std::runtime_error(
393 "Failed to find Run node in RawTowerCalibration::CreateNodes");
397 rawtowergeom = findNode::getClass<RawTowerGeomContainer>(topNode,
401 std::cout <<
Name() <<
"::" <<
m_Detector <<
"::" << __PRETTY_FUNCTION__
404 throw std::runtime_error(
405 "Failed to find " +
TowerGeomNodeName +
" node in RawTowerCalibration::CreateNodes");
414 "PHCompositeNode",
"DST"));
417 std::cout <<
Name() <<
"::" <<
m_Detector <<
"::" << __PRETTY_FUNCTION__
418 <<
"DST Node missing, doing nothing." << std::endl;
419 throw std::runtime_error(
420 "Failed to find DST node in RawTowerCalibration::CreateNodes");
426 _raw_towers = findNode::getClass<RawTowerContainer>(dstNode,
430 std::cout <<
Name() <<
"::" << m_Detector <<
"::" << __PRETTY_FUNCTION__
433 throw std::runtime_error(
434 "Failed to find " +
RawTowerNodeName +
" node in RawTowerCalibration::CreateNodes");
443 std::cout <<
Name() <<
"::" << m_Detector <<
"::" << __PRETTY_FUNCTION__
446 throw std::runtime_error(
465 _calib_towers = findNode::getClass<RawTowerContainer>(DetNode,
471 DetNode->addNode(towerNode);
481 if (m_Detector ==
"CEMC")
483 detec = TowerInfoContainer::DETECTOR::EMCAL;
485 else if (m_Detector ==
"HCALIN" || m_Detector ==
"HCALOUT")
487 detec = TowerInfoContainer::DETECTOR::HCAL;
491 std::cout <<
PHWHERE <<
"Detector not implemented into the TowerInfoContainer object, defaulting to HCal implementation." << std::endl;
492 detec = TowerInfoContainer::DETECTOR::HCAL;
496 DetNode->addNode(towerinfoNode);