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/RawTowerGeomv3.h>
10 #include <calobase/RawTowerGeomContainer.h>
11 #include <calobase/RawTowerGeomContainerv1.h>
27 #include <TRotation.h>
46 , m_MappingTowerFile(
"default.txt")
47 , m_CaloId(RawTowerDefs::
NONE)
67 std::cout <<
PHWHERE <<
"DST Node missing, doing nothing." << std::endl;
75 catch (std::exception &
e)
77 std::cout << e.what() << std::endl;
85 catch (std::exception &e)
87 std::cout << e.what() << std::endl;
98 PHG4HitContainer *g4hit = findNode::getClass<PHG4HitContainer>(topNode, NodeNameHits);
101 cout <<
"Could not locate g4 hit node " << NodeNameHits << endl;
109 for (hiter = hit_begin_end.first; hiter != hit_begin_end.second; hiter++)
111 PHG4Hit *g4hit_i = hiter->second;
126 tower->set_energy(0);
145 std::cout <<
"storing towers: "<<
m_Towers->
size() << std::endl;
146 cout <<
"Energy lost by dropping towers with less than " <<
m_Emin
151 for (iter = begin_end.first; iter != begin_end.second; ++iter)
153 iter->second->identify();
177 std::cerr <<
PHWHERE <<
"Run Node missing, doing nothing." << std::endl;
178 throw std::runtime_error(
"Failed to find Run node in RawTowerBuilderByHitIndex::CreateNodes");
184 std::cerr <<
PHWHERE <<
"DST Node missing, doing nothing." << std::endl;
185 throw std::runtime_error(
"Failed to find DST node in RawTowerBuilderByHitIndex::CreateNodes");
190 string NodeNameTowerGeometries =
"TOWERGEOM_" +
m_Detector;
207 string NodeNameTowers;
227 ifstream istream_mapping;
230 if (!istream_mapping.is_open())
233 if (!istream_mapping)
235 cerr <<
"CaloTowerGeomManager::ReadGeometryFromTable - ERROR Failed to open mapping file " <<
m_MappingTowerFile << endl;
242 while (getline(istream_mapping, line_mapping))
245 if (line_mapping.find(
"#") != string::npos)
249 cout <<
"RawTowerBuilderByHitIndex: SKIPPING line in mapping file: " << line_mapping << endl;
254 istringstream iss(line_mapping);
257 if (line_mapping.find(
"Tower ") != string::npos)
259 unsigned idx_j, idx_k, idx_l;
260 double pos_x, pos_y, pos_z;
261 double size_x, size_y,
size_z;
262 double rot_x, rot_y, rot_z;
267 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))
269 cerr <<
"ERROR in RawTowerBuilderByHitIndex: Failed to read line in mapping file " <<
m_MappingTowerFile << endl;
297 if (!(iss >> parname >> parval))
299 cerr <<
"ERROR in RawTowerBuilderByHitIndex: Failed to read line in mapping file " <<
m_MappingTowerFile << endl;
308 std::map<string, double>::iterator parit;
339 it != all_towers.second; ++
it)
341 double x_temp =
it->second->get_center_x();
342 double y_temp =
it->second->get_center_y();
343 double z_temp =
it->second->get_center_z();
351 TVector3 v_temp_r(x_temp, y_temp, z_temp);
352 v_temp_r.Transform(rot);
360 it->second->set_center_x(x_temp_rt);
361 it->second->set_center_y(y_temp_rt);
362 it->second->set_center_z(z_temp_rt);
366 cout <<
"* Local tower x y z : " << x_temp <<
" " << y_temp <<
" " << z_temp << endl;
367 cout <<
"* Globl tower x y z : " << x_temp_rt <<
" " << y_temp_rt <<
" " << z_temp_rt << endl;