6 #include <calobase/RawTower.h>
7 #include <calobase/RawTowerContainer.h>
8 #include <calobase/TowerInfo.h>
9 #include <calobase/TowerInfoContainer.h>
10 #include <calobase/RawTowerDefs.h>
11 #include <calobase/RawTowerGeom.h>
12 #include <calobase/RawTowerGeomContainer.h>
32 os <<
" TowerJetInput: ";
35 os <<
"TOWER_CEMC to Jet::CEMC_TOWER";
39 os <<
"TOWER_EEMC to Jet::EEMC_TOWER";
43 os <<
"TOWER_HCALIN to Jet::HCALIN_TOWER";
47 os <<
"TOWER_HCALOUT to Jet::HCALOUT_TOWER";
51 os <<
"TOWER_FEMC to Jet::FEMC_TOWER";
55 os <<
"TOWER_FHCAL to Jet::FHCAL_TOWER";
62 if (
Verbosity() > 0) std::cout <<
"TowerJetInput::process_event -- entered" << std::endl;
64 GlobalVertexMap *vertexmap = findNode::getClass<GlobalVertexMap>(topNode,
"GlobalVertexMap");
67 std::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." << std::endl;
70 return std::vector<Jet *>();
73 if (vertexmap->
empty())
75 std::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." << std::endl;
76 return std::vector<Jet *>();
108 towers = findNode::getClass<RawTowerContainer>(topNode,
"TOWER_CALIB_CEMC");
109 geom = findNode::getClass<RawTowerGeomContainer>(topNode,
"TOWERGEOM_CEMC");
110 if ((!towers) || !geom)
112 return std::vector<Jet *>();
118 towerinfos = findNode::getClass<TowerInfoContainer>(topNode,
"TOWERINFO_CALIB_CEMC");
119 geom = findNode::getClass<RawTowerGeomContainer>(topNode,
"TOWERGEOM_CEMC");
121 if ((!towerinfos) || !geom)
123 return std::vector<Jet *>();
129 towerinfos = findNode::getClass<TowerInfoContainer>(topNode,
"TOWERINFO_CALIB_EMBED_CEMC");
130 geom = findNode::getClass<RawTowerGeomContainer>(topNode,
"TOWERGEOM_CEMC");
132 if ((!towerinfos) || !geom)
134 return std::vector<Jet *>();
140 towerinfos = findNode::getClass<TowerInfoContainer>(topNode,
"TOWERINFO_CALIB_SIM_CEMC");
141 geom = findNode::getClass<RawTowerGeomContainer>(topNode,
"TOWERGEOM_CEMC");
143 if ((!towerinfos) || !geom)
145 return std::vector<Jet *>();
150 towers = findNode::getClass<RawTowerContainer>(topNode,
"TOWER_CALIB_EEMC");
151 geom = findNode::getClass<RawTowerGeomContainer>(topNode,
"TOWERGEOM_EEMC");
152 if ((!towers && !towerinfos) || !geom)
154 return std::vector<Jet *>();
159 towers = findNode::getClass<RawTowerContainer>(topNode,
"TOWER_CALIB_HCALIN");
160 geom = findNode::getClass<RawTowerGeomContainer>(topNode,
"TOWERGEOM_HCALIN");
161 if ((!towers) || !geom)
163 return std::vector<Jet *>();
169 towerinfos = findNode::getClass<TowerInfoContainer>(topNode,
"TOWERINFO_CALIB_HCALIN");
171 geom = findNode::getClass<RawTowerGeomContainer>(topNode,
"TOWERGEOM_HCALIN");
172 if ((!towerinfos) || !geom)
174 return std::vector<Jet *>();
180 towerinfos = findNode::getClass<TowerInfoContainer>(topNode,
"TOWERINFO_CALIB_EMBED_HCALIN");
181 geom = findNode::getClass<RawTowerGeomContainer>(topNode,
"TOWERGEOM_HCALIN");
183 if ((!towerinfos) || !geom)
185 return std::vector<Jet *>();
191 towerinfos = findNode::getClass<TowerInfoContainer>(topNode,
"TOWERINFO_CALIB_SIM_HCALIN");
192 geom = findNode::getClass<RawTowerGeomContainer>(topNode,
"TOWERGEOM_HCALIN");
194 if ((!towerinfos) || !geom)
196 return std::vector<Jet *>();
201 towers = findNode::getClass<RawTowerContainer>(topNode,
"TOWER_CALIB_HCALOUT");
202 geom = findNode::getClass<RawTowerGeomContainer>(topNode,
"TOWERGEOM_HCALOUT");
203 if ((!towers) || !geom)
205 return std::vector<Jet *>();
211 towerinfos = findNode::getClass<TowerInfoContainer>(topNode,
"TOWERINFO_CALIB_HCALOUT");
213 geom = findNode::getClass<RawTowerGeomContainer>(topNode,
"TOWERGEOM_HCALOUT");
214 if ((!towerinfos) || !geom)
216 return std::vector<Jet *>();
222 towerinfos = findNode::getClass<TowerInfoContainer>(topNode,
"TOWERINFO_CALIB_EMBED_HCALOUT");
223 geom = findNode::getClass<RawTowerGeomContainer>(topNode,
"TOWERGEOM_HCALOUT");
225 if ((!towerinfos) || !geom)
227 return std::vector<Jet *>();
233 towerinfos = findNode::getClass<TowerInfoContainer>(topNode,
"TOWERINFO_CALIB_SIM_HCALOUT");
234 geom = findNode::getClass<RawTowerGeomContainer>(topNode,
"TOWERGEOM_HCALOUT");
236 if ((!towerinfos) || !geom)
238 return std::vector<Jet *>();
245 towers = findNode::getClass<RawTowerContainer>(topNode,
"TOWER_CALIB_FEMC");
246 geom = findNode::getClass<RawTowerGeomContainer>(topNode,
"TOWERGEOM_FEMC");
247 if ((!towers) || !geom)
249 return std::vector<Jet *>();
254 towers = findNode::getClass<RawTowerContainer>(topNode,
"TOWER_CALIB_FHCAL");
255 geom = findNode::getClass<RawTowerGeomContainer>(topNode,
"TOWERGEOM_FHCAL");
256 if ((!towers) || !geom)
258 return std::vector<Jet *>();
263 towers = findNode::getClass<RawTowerContainer>(topNode,
"TOWER_CALIB_CEMC_RETOWER");
264 geom = findNode::getClass<RawTowerGeomContainer>(topNode,
"TOWERGEOM_HCALIN");
265 if ((!towers) || !geom)
267 return std::vector<Jet *>();
273 towerinfos = findNode::getClass<TowerInfoContainer>(topNode,
"TOWERINFO_CALIB_CEMC_RETOWER");
275 geom = findNode::getClass<RawTowerGeomContainer>(topNode,
"TOWERGEOM_HCALIN");
276 if ((!towerinfos) || !geom)
278 return std::vector<Jet *>();
283 towers = findNode::getClass<RawTowerContainer>(topNode,
"TOWER_CALIB_CEMC_RETOWER_SUB1");
284 geom = findNode::getClass<RawTowerGeomContainer>(topNode,
"TOWERGEOM_HCALIN");
285 if ((!towers) || !geom)
287 return std::vector<Jet *>();
293 towerinfos = findNode::getClass<TowerInfoContainer>(topNode,
"TOWERINFO_CALIB_CEMC_RETOWER_SUB1");
295 geom = findNode::getClass<RawTowerGeomContainer>(topNode,
"TOWERGEOM_HCALIN");
296 if ((!towerinfos) || !geom)
298 return std::vector<Jet *>();
303 towers = findNode::getClass<RawTowerContainer>(topNode,
"TOWER_CALIB_HCALIN_SUB1");
304 geom = findNode::getClass<RawTowerGeomContainer>(topNode,
"TOWERGEOM_HCALIN");
305 if ((!towers) || !geom)
307 return std::vector<Jet *>();
313 towerinfos = findNode::getClass<TowerInfoContainer>(topNode,
"TOWERINFO_CALIB_HCALIN_SUB1");
315 geom = findNode::getClass<RawTowerGeomContainer>(topNode,
"TOWERGEOM_HCALIN");
316 if ((!towerinfos) || !geom)
318 return std::vector<Jet *>();
323 towers = findNode::getClass<RawTowerContainer>(topNode,
"TOWER_CALIB_HCALOUT_SUB1");
324 geom = findNode::getClass<RawTowerGeomContainer>(topNode,
"TOWERGEOM_HCALOUT");
325 if ((!towers) || !geom)
327 return std::vector<Jet *>();
333 towerinfos = findNode::getClass<TowerInfoContainer>(topNode,
"TOWERINFO_CALIB_HCALOUT_SUB1");
335 geom = findNode::getClass<RawTowerGeomContainer>(topNode,
"TOWERGEOM_HCALOUT");
336 if ((!towerinfos) || !geom)
338 return std::vector<Jet *>();
343 towers = findNode::getClass<RawTowerContainer>(topNode,
"TOWER_CALIB_CEMC_RETOWER_SUB1CS");
344 geom = findNode::getClass<RawTowerGeomContainer>(topNode,
"TOWERGEOM_HCALIN");
345 if ((!towers) || !geom)
347 return std::vector<Jet *>();
352 towers = findNode::getClass<RawTowerContainer>(topNode,
"TOWER_CALIB_HCALIN_SUB1CS");
353 geom = findNode::getClass<RawTowerGeomContainer>(topNode,
"TOWERGEOM_HCALIN");
354 if ((!towers) || !geom)
356 return std::vector<Jet *>();
361 towers = findNode::getClass<RawTowerContainer>(topNode,
"TOWER_CALIB_HCALOUT_SUB1CS");
362 geom = findNode::getClass<RawTowerGeomContainer>(topNode,
"TOWERGEOM_HCALOUT");
363 if ((!towers) || !geom)
365 return std::vector<Jet *>();
370 return std::vector<Jet *>();
382 return std::vector<Jet *>();
385 if (std::isnan(vtxz))
387 static bool once =
true;
392 std::cout <<
"TowerJetInput::get_input - WARNING - vertex is NAN. Drop all tower inputs (further NAN-vertex warning will be suppressed)." << std::endl;
395 return std::vector<Jet *>();
398 std::vector<Jet *> pseudojets;
403 return std::vector<Jet *>();
406 unsigned int nchannels = towerinfos->
size();
424 double z = z0 - vtxz;
425 double eta = asinh(z / r);
427 if (tower->
get_energy() == NAN) {pt = 0/cosh(eta);}
428 double px = pt * cos(phi);
429 double py = pt * sin(phi);
430 double pz = pt * sinh(eta);
438 pseudojets.push_back(jet);
445 for (rtiter = begin_end.first; rtiter != begin_end.second; ++rtiter)
455 double z = z0 - vtxz;
456 double eta = asinh(z / r);
458 double px = pt * cos(phi);
459 double py = pt * sin(phi);
460 double pz = pt * sinh(eta);
468 pseudojets.push_back(jet);
471 if (
Verbosity() > 0) std::cout <<
"TowerJetInput::process_event -- exited" << std::endl;