12 #include <calobase/RawCluster.h>
13 #include <calobase/RawClusterContainer.h>
14 #include <calobase/RawClusterUtility.h>
15 #include <calobase/TowerInfo.h>
16 #include <calobase/TowerInfoContainerv1.h>
17 #include <calobase/RawTowerGeom.h>
18 #include <calobase/RawTowerGeomContainer.h>
28 #include <CLHEP/Vector/ThreeVector.h>
43 if (vx == 0 && vy == 0 && vz == 0)
51 r = -log(tan(theta / 2.));
62 , m_do_subtracted(do_subtracted)
63 , m_do_unsubtracted(do_unsubtracted)
72 std::cout <<
Name() <<
"::ClusterIso::m_coneSize is:" <<
m_coneSize <<
'\n';
73 std::cout <<
Name() <<
"::ClusterIso::m_eTCut is:" <<
m_eTCut <<
'\n';
75 if (!do_subtracted && !do_unsubtracted &&
Verbosity() >=
VERBOSITY_QUIET) std::cout <<
"WARNING in " <<
Name() <<
"ClusterIso:: all processes turned off doing nothing" <<
'\n';
144 TowerInfoContainer *towersEM3old = findNode::getClass<TowerInfoContainerv1>(topNode,
"TOWERINFO_CALIB_CEMC_RETOWER_SUB1");
145 if (towersEM3old ==
nullptr)
148 if (
Verbosity() >=
VERBOSITY_SOME) std::cout <<
"In " <<
Name() <<
"::ClusterIso WARNING substracted towers do not exist subtracted isolation cannot be preformed \n";
150 if (
Verbosity() >=
VERBOSITY_MORE) std::cout <<
Name() <<
"::ClusterIso::process_event: " << towersEM3old->
size() <<
" TOWERINFO_CALIB_CEMC_RETOWER_SUB1 towers" <<
'\n';
153 TowerInfoContainer *towersIH3 = findNode::getClass<TowerInfoContainerv1>(topNode,
"TOWERINFO_CALIB_HCALIN_SUB1");
154 if (
Verbosity() >=
VERBOSITY_MORE) std::cout <<
Name() <<
"::ClusterIso::process_event: " << towersIH3->
size() <<
" TOWERINFO_CALIB_HCALIN_SUB1 towers" <<
'\n';
157 TowerInfoContainer *towersOH3 = findNode::getClass<TowerInfoContainerv1>(topNode,
"TOWERINFO_CALIB_HCALOUT_SUB1");
158 if (
Verbosity() >=
VERBOSITY_MORE) std::cout <<
Name() <<
"::ClusterIso::process_event: " << towersOH3->
size() <<
" TOWERINFO_CALIB_HCALOUT_SUB1 towers" << std::endl;
161 RawTowerGeomContainer *geomEM = findNode::getClass<RawTowerGeomContainer>(topNode,
"TOWERGEOM_HCALIN");
162 RawTowerGeomContainer *geomIH = findNode::getClass<RawTowerGeomContainer>(topNode,
"TOWERGEOM_HCALIN");
163 RawTowerGeomContainer *geomOH = findNode::getClass<RawTowerGeomContainer>(topNode,
"TOWERGEOM_HCALOUT");
172 GlobalVertexMap *vertexmap = findNode::getClass<GlobalVertexMap>(topNode,
"GlobalVertexMap");
174 if (vertexmap && !vertexmap->
empty())
177 m_vx = vertex->
get_x();
182 std::cout <<
Name() <<
"::ClusterIso Event Vertex Calculated at x:" << m_vx <<
" y:" <<
m_vy <<
" z:" <<
m_vz <<
'\n';
186 for (rtiter = begin_end.first; rtiter != begin_end.second; ++rtiter)
192 double cluster_energy = E_vec_cluster.mag();
193 double cluster_eta = E_vec_cluster.pseudoRapidity();
194 double cluster_phi = E_vec_cluster.phi();
195 double et = cluster_energy / cosh(cluster_eta);
205 unsigned int ntowers = towersEM3old->
size();
216 double this_phi = tower_geom->
get_phi();
217 double this_eta = tower_geom->
get_eta();
220 isoEt += tower->
get_energy() / cosh(this_eta);
227 unsigned int ntowers = towersIH3->
size();
235 RawTowerGeom *tower_geom = geomIH->get_tower_geometry(key);
236 double this_phi = tower_geom->
get_phi();
240 isoEt += tower->
get_energy() / cosh(this_eta);
247 unsigned int ntowers = towersOH3->
size();
255 RawTowerGeom *tower_geom = geomOH->get_tower_geometry(key);
256 double this_phi = tower_geom->
get_phi();
260 isoEt += tower->
get_energy() / cosh(this_eta);
268 std::cout <<
Name() <<
"::ClusterIso iso_et for ";
270 std::cout <<
"=" << isoEt <<
'\n';
285 TowerInfoContainer *towersEM3old = findNode::getClass<TowerInfoContainerv1>(topNode,
"TOWERINFO_CALIB_CEMC");
286 if (
Verbosity() >=
VERBOSITY_MORE) std::cout <<
"ClusterIso::process_event: " << towersEM3old->
size() <<
" TOWERINFO_CALIB_CEMC towers" <<
'\n';
289 TowerInfoContainer *towersIH3 = findNode::getClass<TowerInfoContainerv1>(topNode,
"TOWERINFO_CALIB_HCALIN");
290 if (
Verbosity() >=
VERBOSITY_MORE) std::cout <<
"ClusterIso::process_event: " << towersIH3->
size() <<
" TOWERINFO_CALIB_HCALIN towers" <<
'\n';
293 TowerInfoContainer *towersOH3 = findNode::getClass<TowerInfoContainerv1>(topNode,
"TOWERINFO_CALIB_HCALOUT");
294 if (
Verbosity() >=
VERBOSITY_MORE) std::cout <<
"ClusterIso::process_event: " << towersOH3->
size() <<
" TOWERINFO_CALIB_HCALOUT towers" << std::endl;
297 RawTowerGeomContainer *geomEM = findNode::getClass<RawTowerGeomContainer>(topNode,
"TOWERGEOM_CEMC");
298 RawTowerGeomContainer *geomIH = findNode::getClass<RawTowerGeomContainer>(topNode,
"TOWERGEOM_HCALIN");
299 RawTowerGeomContainer *geomOH = findNode::getClass<RawTowerGeomContainer>(topNode,
"TOWERGEOM_HCALOUT");
308 GlobalVertexMap *vertexmap = findNode::getClass<GlobalVertexMap>(topNode,
"GlobalVertexMap");
310 if (vertexmap && !vertexmap->
empty())
313 m_vx = vertex->
get_x();
319 for (rtiter = begin_end.first; rtiter != begin_end.second; ++rtiter)
325 double cluster_energy = E_vec_cluster.mag();
326 double cluster_eta = E_vec_cluster.pseudoRapidity();
327 double cluster_phi = E_vec_cluster.phi();
328 double et = cluster_energy / cosh(cluster_eta);
332 std::cout <<
Name() <<
"::ClusterIso processing";
344 unsigned int ntowers = towersEM3old->
size();
353 double this_phi = tower_geom->
get_phi();
357 isoEt += tower->
get_energy() / cosh(this_eta);
364 unsigned int ntowers = towersIH3->
size();
372 RawTowerGeom *tower_geom = geomIH->get_tower_geometry(key);
373 double this_phi = tower_geom->
get_phi();
377 isoEt += tower->
get_energy() / cosh(this_eta);
384 unsigned int ntowers = towersOH3->
size();
392 RawTowerGeom *tower_geom = geomOH->get_tower_geometry(key);
393 double this_phi = tower_geom->
get_phi();
397 isoEt += tower->
get_energy() / cosh(this_eta);
405 std::cout <<
Name() <<
"::ClusterIso iso_et for ";
407 std::cout <<
"=" << isoEt <<
'\n';