3 #include <calobase/RawTowerContainer.h>
4 #include <calobase/RawTowerv1.h>
6 #include <calobase/RawTower.h>
7 #include <calobase/RawTowerDefs.h>
8 #include <calobase/RawTowerGeom.h>
9 #include <calobase/RawTowerGeomContainer.h>
10 #include <calobase/RawTowerGeomContainer_Cylinderv1.h>
11 #include <calobase/RawTowerGeomv4.h>
27 #include <TRotation.h>
46 , m_MappingTowerFile(
"default.txt")
47 , m_CaloId(RawTowerDefs::
NONE)
61 std::cout <<
PHWHERE <<
"DST Node missing, doing nothing." << std::endl;
69 catch (std::exception &
e)
71 std::cout << e.what() << std::endl;
79 catch (std::exception &e)
81 std::cout << e.what() << std::endl;
92 PHG4HitContainer *g4hit = findNode::getClass<PHG4HitContainer>(topNode, NodeNameHits);
95 cout <<
"Could not locate g4 hit node " << NodeNameHits << endl;
103 for (hiter = hit_begin_end.first; hiter != hit_begin_end.second; hiter++)
105 PHG4Hit *g4hit_i = hiter->second;
120 tower->set_energy(0);
139 std::cout <<
"storing towers: " <<
m_Towers->
size() << std::endl;
140 cout <<
"Energy lost by dropping towers with less than " <<
m_Emin
145 for (iter = begin_end.first; iter != begin_end.second; ++iter)
147 iter->second->identify();
171 std::cerr <<
PHWHERE <<
"Run Node missing, doing nothing." << std::endl;
172 throw std::runtime_error(
"Failed to find Run node in RawTowerBuilderByHitIndexBECAL::CreateNodes");
178 std::cerr <<
PHWHERE <<
"DST Node missing, doing nothing." << std::endl;
179 throw std::runtime_error(
"Failed to find DST node in RawTowerBuilderByHitIndexBECAL::CreateNodes");
185 string NodeNameTowerGeometries =
"TOWERGEOM_" +
m_Detector;
202 string NodeNameTowers;
222 ifstream istream_mapping;
225 if (!istream_mapping.is_open())
228 if (!istream_mapping)
230 cerr <<
"CaloTowerGeomManager::ReadGeometryFromTable - ERROR Failed to open mapping file " <<
m_MappingTowerFile << endl;
237 while (
getline(istream_mapping, line_mapping))
240 if (line_mapping.find(
"#") != string::npos)
244 cout <<
"RawTowerBuilderByHitIndexBECAL: SKIPPING line in mapping file: " << line_mapping << endl;
249 std::istringstream iss(line_mapping);
251 if (line_mapping.find(
"BECALtower ") != string::npos)
253 unsigned idphi_j, ideta_k;
255 double rot_z, rot_y, rot_x;
256 double size_z, size_y1, size_x1, size_y2, size_x2, p_Theta;
259 if (!(iss >> dummys >> ideta_k >> idphi_j >> size_x1 >> size_x2 >> size_y1 >> size_y2 >> size_z >> p_Theta >> cx >> cy >> cz >> rot_x >> rot_y >> rot_z))
261 std::cout <<
"ERROR in PHG4ForwardHcalDetector: Failed to read line in mapping file " <<
m_MappingTowerFile << std::endl;
282 if (!(iss >> parname >> parval))
284 cout <<
"ERROR in PHG4BarrelCalorimeterDetector: Failed to read line in mapping file " << endl;
289 std::map<string, double>::iterator parit;
317 it != all_towers.second; ++
it)
319 double x_temp =
it->second->get_center_x();
320 double y_temp =
it->second->get_center_y();
321 double z_temp =
it->second->get_center_z();
322 double roty =
it->second->get_roty();
323 double rotz =
it->second->get_rotz();
327 double z_tempfinal = z_temp +
thickness_wall * sin(roty - M_PI_2);
329 it->second->set_center_x(x_tempfinal);
330 it->second->set_center_y(y_tempfinal);
331 it->second->set_center_z(z_tempfinal);
335 cout <<
"*** Tower x y z : " << x_temp <<
" " << y_temp <<
" " << z_temp << endl;