12 #include <calobase/RawCluster.h>
13 #include <calobase/RawClusterContainer.h>
14 #include <calobase/RawClusterUtility.h>
15 #include <calobase/RawTower.h>
16 #include <calobase/RawTowerContainer.h>
17 #include <calobase/RawTowerGeom.h>
18 #include <calobase/RawTowerGeomContainer.h>
43 if (vx == 0 && vy == 0 && vz == 0)
51 r = -log(tan(theta / 2.));
60 ClusterIso::ClusterIso(
const std::string &kname,
float eTCut = 0.0,
int coneSize = 3,
bool do_subtracted = 1,
bool do_unsubtracted = 1)
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 RawTowerContainer *towersEM3old = findNode::getClass<RawTowerContainer>(topNode,
"TOWER_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() <<
" TOWER_CALIB_CEMC_RETOWER_SUB1 towers" <<
'\n';
153 RawTowerContainer *towersIH3 = findNode::getClass<RawTowerContainer>(topNode,
"TOWER_CALIB_HCALIN_SUB1");
154 if (
Verbosity() >=
VERBOSITY_MORE) std::cout <<
Name() <<
"::ClusterIso::process_event: " << towersIH3->
size() <<
" TOWER_CALIB_HCALIN_SUB1 towers" <<
'\n';
157 RawTowerContainer *towersOH3 = findNode::getClass<RawTowerContainer>(topNode,
"TOWER_CALIB_HCALOUT_SUB1");
158 if (
Verbosity() >=
VERBOSITY_MORE) std::cout <<
Name() <<
"::ClusterIso::process_event: " << towersOH3->
size() <<
" TOWER_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");
166 RawClusterContainer *clusters = findNode::getClass<RawClusterContainer>(topNode,
"CLUSTER_CEMC");
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();
194 double cluster_phi = E_vec_cluster.
phi();
195 double et = cluster_energy / cosh(cluster_eta);
210 double this_phi = tower_geom->
get_phi();
211 double this_eta = tower_geom->
get_eta();
214 isoEt += tower->
get_energy() / cosh(this_eta);
226 double this_phi = tower_geom->
get_phi();
230 isoEt += tower->
get_energy() / cosh(this_eta);
242 double this_phi = tower_geom->
get_phi();
246 isoEt += tower->
get_energy() / cosh(this_eta);
254 std::cout <<
Name() <<
"::ClusterIso iso_et for ";
256 std::cout <<
"=" << isoEt <<
'\n';
271 RawTowerContainer *towersEM3old = findNode::getClass<RawTowerContainer>(topNode,
"TOWER_CALIB_CEMC");
272 if (
Verbosity() >=
VERBOSITY_MORE) std::cout <<
"ClusterIso::process_event: " << towersEM3old->
size() <<
" TOWER_CALIB_CEMC towers" <<
'\n';
275 RawTowerContainer *towersIH3 = findNode::getClass<RawTowerContainer>(topNode,
"TOWER_CALIB_HCALIN");
276 if (
Verbosity() >=
VERBOSITY_MORE) std::cout <<
"ClusterIso::process_event: " << towersIH3->
size() <<
" TOWER_CALIB_HCALIN towers" <<
'\n';
279 RawTowerContainer *towersOH3 = findNode::getClass<RawTowerContainer>(topNode,
"TOWER_CALIB_HCALOUT");
280 if (
Verbosity() >=
VERBOSITY_MORE) std::cout <<
"ClusterIso::process_event: " << towersOH3->
size() <<
" TOWER_CALIB_HCALOUT towers" << std::endl;
283 RawTowerGeomContainer *geomEM = findNode::getClass<RawTowerGeomContainer>(topNode,
"TOWERGEOM_CEMC");
284 RawTowerGeomContainer *geomIH = findNode::getClass<RawTowerGeomContainer>(topNode,
"TOWERGEOM_HCALIN");
285 RawTowerGeomContainer *geomOH = findNode::getClass<RawTowerGeomContainer>(topNode,
"TOWERGEOM_HCALOUT");
288 RawClusterContainer *clusters = findNode::getClass<RawClusterContainer>(topNode,
"CLUSTER_CEMC");
294 GlobalVertexMap *vertexmap = findNode::getClass<GlobalVertexMap>(topNode,
"GlobalVertexMap");
296 if (vertexmap && !vertexmap->
empty())
299 m_vx = vertex->
get_x();
305 for (rtiter = begin_end.first; rtiter != begin_end.second; ++rtiter)
311 double cluster_energy = E_vec_cluster.
mag();
313 double cluster_phi = E_vec_cluster.
phi();
314 double et = cluster_energy / cosh(cluster_eta);
318 std::cout <<
Name() <<
"::ClusterIso processing";
335 double this_phi = tower_geom->
get_phi();
339 isoEt += tower->
get_energy() / cosh(this_eta);
351 double this_phi = tower_geom->
get_phi();
355 isoEt += tower->
get_energy() / cosh(this_eta);
367 double this_phi = tower_geom->
get_phi();
371 isoEt += tower->
get_energy() / cosh(this_eta);
379 std::cout <<
Name() <<
"::ClusterIso iso_et for ";
381 std::cout <<
"=" << isoEt <<
'\n';