3 #include <calobase/RawTowerContainer.h>
4 #include <calobase/RawTowerv2.h>
6 #include <calobase/RawTower.h>
7 #include <calobase/RawTowerDefs.h>
8 #include <calobase/RawTowerGeom.h>
9 #include <calobase/RawTowerGeomContainer.h>
10 #include <calobase/RawTowerGeomContainerv1.h>
11 #include <calobase/RawTowerGeomv3.h>
27 #include <TRotation.h>
47 , m_MappingTowerFile(
"default.txt")
48 , m_CaloId(RawTowerDefs::
NONE)
57 , m_ThicknessAbsorber(0)
58 , m_ThicknessScintilator(0)
60 , m_NLayersPerTowerSeg(0)
74 std::cout <<
PHWHERE <<
"DST Node missing, doing nothing." << std::endl;
82 catch (std::exception &
e)
84 std::cout << e.what() << std::endl;
92 catch (std::exception &e)
94 std::cout << e.what() << std::endl;
105 PHG4HitContainer *g4hit = findNode::getClass<PHG4HitContainer>(topNode, NodeNameHits);
108 cout <<
"Could not locate g4 hit node " << NodeNameHits << endl;
116 for (hiter = hit_begin_end.first; hiter != hit_begin_end.second; hiter++)
118 PHG4Hit *g4hit_i = hiter->second;
133 tower->set_energy(0);
138 std::cout <<
"decoded: " << tower->get_bineta() <<
"\t" << tower->get_binphi() <<
"\t" << tower->get_binl() << std::endl;
156 std::cout <<
"storing towers: " <<
m_Towers->
size() << std::endl;
157 cout <<
"Energy lost by dropping towers with less than " <<
m_Emin
162 for (iter = begin_end.first; iter != begin_end.second; ++iter)
164 iter->second->identify();
188 std::cerr <<
PHWHERE <<
"Run Node missing, doing nothing." << std::endl;
189 throw std::runtime_error(
"Failed to find Run node in RawTowerBuilderByHitIndexLHCal::CreateNodes");
195 std::cerr <<
PHWHERE <<
"DST Node missing, doing nothing." << std::endl;
196 throw std::runtime_error(
"Failed to find DST node in RawTowerBuilderByHitIndexLHCal::CreateNodes");
201 string NodeNameTowerGeometries =
"TOWERGEOM_" +
m_Detector;
218 string NodeNameTowers;
238 ifstream istream_mapping;
241 if (!istream_mapping.is_open())
244 if (!istream_mapping)
246 cerr <<
"CaloTowerGeomManager::ReadGeometryFromTable - ERROR Failed to open mapping file " <<
m_MappingTowerFile << endl;
253 while (getline(istream_mapping, line_mapping))
256 if (line_mapping.find(
"#") != string::npos)
260 cout <<
"RawTowerBuilderByHitIndexLHCal: SKIPPING line in mapping file: " << line_mapping << endl;
264 istringstream iss(line_mapping);
267 if (line_mapping.find(
"Tower ") != string::npos)
269 unsigned idx_j, idx_k, idx_l;
270 double pos_x, pos_y, pos_z;
271 double size_x, size_y,
size_z;
272 double rot_x, rot_y, rot_z;
277 if (!(iss >> dummys >> type >> idx_j >> idx_k >> idx_l >> pos_x >> pos_y >> pos_z >> size_x >> size_y >> size_z >> rot_x >> rot_y >> rot_z))
279 cerr <<
"ERROR in RawTowerBuilderByHitIndexLHCal: Failed to read line in mapping file " <<
m_MappingTowerFile << endl;
294 temp_geo->
set_center_z(pos_z - 0.5 * size_z + (il + 0.5) * blocklength);
313 if (!(iss >> parname >> parval))
315 cerr <<
"ERROR in RawTowerBuilderByHitIndexLHCal: Failed to read line in mapping file " <<
m_MappingTowerFile << endl;
322 std::map<string, double>::iterator parit;
382 it != all_towers.second; ++
it)
384 double x_temp =
it->second->get_center_x();
385 double y_temp =
it->second->get_center_y();
386 double z_temp =
it->second->get_center_z();
394 TVector3 v_temp_r(x_temp, y_temp, z_temp);
395 v_temp_r.Transform(rot);
403 it->second->set_center_x(x_temp_rt);
404 it->second->set_center_y(y_temp_rt);
405 it->second->set_center_z(z_temp_rt);
409 cout <<
"* Local tower x y z : " << x_temp <<
" " << y_temp <<
" " << z_temp << endl;
410 cout <<
"* Globl tower x y z : " << x_temp_rt <<
" " << y_temp_rt <<
" " << z_temp_rt << endl;