6 #include <calobase/RawTower.h>
7 #include <calobase/RawTowerContainer.h>
8 #include <calobase/RawTowerGeom.h>
9 #include <calobase/RawTowerGeomContainer.h>
32 os <<
" TowerJetInput: ";
34 os <<
"TOWER_CEMC to Jet::CEMC_TOWER";
36 os <<
"TOWER_EEMC to Jet::EEMC_TOWER";
38 os <<
"TOWER_HCALIN to Jet::HCALIN_TOWER";
40 os <<
"TOWER_HCALOUT to Jet::HCALOUT_TOWER";
42 os <<
"TOWER_FEMC to Jet::FEMC_TOWER";
44 os <<
"TOWER_FHCAL to Jet::FHCAL_TOWER";
50 if (
Verbosity() > 0) cout <<
"TowerJetInput::process_event -- entered" << endl;
52 GlobalVertexMap *vertexmap = findNode::getClass<GlobalVertexMap>(topNode,
"GlobalVertexMap");
55 cout <<
"TowerJetInput::get_input - Fatal Error - GlobalVertexMap node is missing. Please turn on the do_global flag in the main macro in order to reconstruct the global vertex." << endl;
58 return std::vector<Jet *>();
61 if (vertexmap->
empty())
63 cout <<
"TowerJetInput::get_input - Fatal Error - GlobalVertexMap node is empty. Please turn on the do_bbc or tracking reco flags in the main macro in order to reconstruct the global vertex." << endl;
64 return std::vector<Jet *>();
71 towers = findNode::getClass<RawTowerContainer>(topNode,
"TOWER_CALIB_CEMC");
72 geom = findNode::getClass<RawTowerGeomContainer>(topNode,
"TOWERGEOM_CEMC");
75 return std::vector<Jet *>();
80 towers = findNode::getClass<RawTowerContainer>(topNode,
"TOWER_CALIB_EEMC");
81 geom = findNode::getClass<RawTowerGeomContainer>(topNode,
"TOWERGEOM_EEMC");
84 return std::vector<Jet *>();
89 towers = findNode::getClass<RawTowerContainer>(topNode,
"TOWER_CALIB_HCALIN");
90 geom = findNode::getClass<RawTowerGeomContainer>(topNode,
"TOWERGEOM_HCALIN");
93 return std::vector<Jet *>();
98 towers = findNode::getClass<RawTowerContainer>(topNode,
"TOWER_CALIB_HCALOUT");
99 geom = findNode::getClass<RawTowerGeomContainer>(topNode,
"TOWERGEOM_HCALOUT");
100 if (!towers || !geom)
102 return std::vector<Jet *>();
107 towers = findNode::getClass<RawTowerContainer>(topNode,
"TOWER_CALIB_FEMC");
108 geom = findNode::getClass<RawTowerGeomContainer>(topNode,
"TOWERGEOM_FEMC");
109 if (!towers || !geom)
111 return std::vector<Jet *>();
116 towers = findNode::getClass<RawTowerContainer>(topNode,
"TOWER_CALIB_FHCAL");
117 geom = findNode::getClass<RawTowerGeomContainer>(topNode,
"TOWERGEOM_FHCAL");
118 if (!towers || !geom)
120 return std::vector<Jet *>();
125 towers = findNode::getClass<RawTowerContainer>(topNode,
"TOWER_CALIB_CEMC_RETOWER");
126 geom = findNode::getClass<RawTowerGeomContainer>(topNode,
"TOWERGEOM_HCALIN");
127 if (!towers || !geom)
129 return std::vector<Jet *>();
134 towers = findNode::getClass<RawTowerContainer>(topNode,
"TOWER_CALIB_CEMC_RETOWER_SUB1");
135 geom = findNode::getClass<RawTowerGeomContainer>(topNode,
"TOWERGEOM_HCALIN");
136 if (!towers || !geom)
138 return std::vector<Jet *>();
143 towers = findNode::getClass<RawTowerContainer>(topNode,
"TOWER_CALIB_HCALIN_SUB1");
144 geom = findNode::getClass<RawTowerGeomContainer>(topNode,
"TOWERGEOM_HCALIN");
145 if (!towers || !geom)
147 return std::vector<Jet *>();
152 towers = findNode::getClass<RawTowerContainer>(topNode,
"TOWER_CALIB_HCALOUT_SUB1");
153 geom = findNode::getClass<RawTowerGeomContainer>(topNode,
"TOWERGEOM_HCALOUT");
154 if (!towers || !geom)
156 return std::vector<Jet *>();
161 towers = findNode::getClass<RawTowerContainer>(topNode,
"TOWER_CALIB_CEMC_RETOWER_SUB1CS");
162 geom = findNode::getClass<RawTowerGeomContainer>(topNode,
"TOWERGEOM_HCALIN");
163 if (!towers || !geom)
165 return std::vector<Jet *>();
170 towers = findNode::getClass<RawTowerContainer>(topNode,
"TOWER_CALIB_HCALIN_SUB1CS");
171 geom = findNode::getClass<RawTowerGeomContainer>(topNode,
"TOWERGEOM_HCALIN");
172 if (!towers || !geom)
174 return std::vector<Jet *>();
179 towers = findNode::getClass<RawTowerContainer>(topNode,
"TOWER_CALIB_HCALOUT_SUB1CS");
180 geom = findNode::getClass<RawTowerGeomContainer>(topNode,
"TOWERGEOM_HCALOUT");
181 if (!towers || !geom)
183 return std::vector<Jet *>();
188 return std::vector<Jet *>();
197 return std::vector<Jet *>();
201 static bool once =
true;
206 cout <<
"TowerJetInput::get_input - WARNING - vertex is NAN. Drop all tower inputs (further NAN-vertex warning will be suppressed)." << endl;
209 return std::vector<Jet *>();
212 std::vector<Jet *> pseudojets;
215 for (rtiter = begin_end.first; rtiter != begin_end.second; ++rtiter)
227 double z = z0 - vtxz;
229 double eta = asinh(z / r);
232 double px = pt * cos(phi);
233 double py = pt * sin(phi);
234 double pz = pt * sinh(eta);
243 pseudojets.push_back(jet);
246 if (
Verbosity() > 0) cout <<
"TowerJetInput::process_event -- exited" << endl;