3 #include <calobase/TowerInfo.h>
4 #include <calobase/TowerInfoContainer.h>
5 #include <calobase/TowerInfoContainerv1.h>
6 #include <calobase/TowerInfoContainerv2.h>
7 #include <calobase/TowerInfov1.h>
8 #include <calobase/TowerInfoDefs.h>
9 #include <calobase/RawTowerGeom.h>
10 #include <calobase/RawTowerGeomContainer.h>
43 std::cout <<
"caloTowerEmbed::caloTowerEmbed(const std::string &name) Calling ctor" << std::endl;
49 std::cout <<
"caloTowerEmbed::~caloTowerEmbed() Calling dtor" << std::endl;
60 EventHeader *evtHeader = findNode::getClass<EventHeader>(topNode,
"EventHeader");
76 catch (std::exception &
e)
78 std::cout << e.what() << std::endl;
92 for(
int caloIndex=0; caloIndex<3; caloIndex++){
95 if(caloIndex == 0) std::cout <<
" CEMC" << std::endl;
96 else if(caloIndex == 1) std::cout <<
" HCALIN" << std::endl;
97 else if(caloIndex == 2) std::cout <<
" HCALOUT" << std::endl;
121 }
else if(caloIndex == 1){
124 }
else if(caloIndex == 2){
134 float embed_E = data_E + sim_E;
136 float data_phi = 0.0;
139 float data_eta = 0.0;
157 if(data_phi == sim_phi && data_eta == sim_eta){
160 if(
Verbosity()) std::cout <<
"eta and phi values in CEMC do not match between data and simulation, removing this event" << std::endl;
164 }
else if(caloIndex == 1){
171 if(data_phi == sim_phi && data_eta == sim_eta){
174 if(
Verbosity()) std::cout <<
"eta and phi values in HCALIN do not match between data and simulation, removing this event" << std::endl;
178 }
else if(caloIndex == 2){
185 if(data_phi == sim_phi && data_eta == sim_eta){
188 if(
Verbosity()) std::cout <<
"eta and phi values in HCALOUT do not match between data and simulation, removing this event" << std::endl;
208 std::cout <<
"creating node" << std::endl;
213 tower_geom = findNode::getClass<RawTowerGeomContainer>(topNode,
"TOWERGEOM_CEMC");
215 std::cerr <<
Name() <<
"::" << __PRETTY_FUNCTION__
216 <<
"tower geom CEMC missing, doing nothing." << std::endl;
217 throw std::runtime_error(
218 "Failed to find TOWERGEOM_CEMC node");
221 tower_geomIH = findNode::getClass<RawTowerGeomContainer>(topNode,
"TOWERGEOM_HCALIN");
223 std::cerr <<
Name() <<
"::" << __PRETTY_FUNCTION__
224 <<
"tower geom HCALIN missing, doing nothing." << std::endl;
225 throw std::runtime_error(
226 "Failed to find TOWERGEOM_HCALIN node");
230 tower_geomOH = findNode::getClass<RawTowerGeomContainer>(topNode,
"TOWERGEOM_HCALOUT");
232 std::cerr <<
Name() <<
"::" << __PRETTY_FUNCTION__
233 <<
"tower geom HCALOUT missing, doing nothing." << std::endl;
234 throw std::runtime_error(
235 "Failed to find TOWERGEOM_HCALOUT node");
244 "PHCompositeNode",
"DST"));
247 std::cerr <<
Name() <<
"::" << __PRETTY_FUNCTION__
248 <<
"DST Node missing, doing nothing." << std::endl;
249 throw std::runtime_error(
250 "Failed to find DST node in RawTowerCalibration::CreateNodes");
255 "PHCompositeNode",
"DST"));
258 std::cerr <<
Name() <<
"::" << __PRETTY_FUNCTION__
259 <<
"DSTsim Node missing, doing nothing." << std::endl;
260 throw std::runtime_error(
261 "Failed to find DSTsim node in RawTowerCalibration::CreateNodes");
264 for(
int i=0;
i<3;
i++){
268 if(
i==1) detector =
"HCALIN";
269 else if(
i==2) detector =
"HCALOUT";
274 _data_towers[
i] = findNode::getClass<TowerInfoContainer>(dstNode,
278 std::cerr <<
Name() <<
"::" << detector <<
"::" << __PRETTY_FUNCTION__
279 <<
"Tower Calib Node missing, doing nothing." << std::endl;
280 throw std::runtime_error(
281 "Failed to find Calib Tower node in caloTowerEmbed::CreateNodes");
287 _sim_towers[
i] = findNode::getClass<TowerInfoContainer>(dstNodeSim,
291 std::cerr <<
Name() <<
"::" << detector <<
"::" << __PRETTY_FUNCTION__
292 <<
"Tower Calib Sim Node missing, doing nothing." << std::endl;
293 throw std::runtime_error(
294 "Failed to find Calib Tower Sim node in caloTowerEmbed::CreateNodes");