16 #include <calobase/RawTower.h>
17 #include <calobase/RawTowerContainer.h>
18 #include <calobase/RawTowerGeom.h>
19 #include <calobase/RawTowerGeomContainer.h>
20 #include <calobase/TowerInfoContainer.h>
21 #include <calobase/TowerInfo.h>
36 , m_recoJetName(recojetname)
37 , m_outputFileName(outputfilename)
38 , m_etaRange(-1.1, 1.1)
41 std::cout <<
"JetNconstituents::JetNconstituents(const std::string& recojetname, const std::string& outputfilename) Calling ctor" << std::endl;
47 std::cout <<
"JetNconstituents::~JetNconstituents() Calling dtor" << std::endl;
54 std::cout <<
"JetNconstituents::Init(PHCompositeNode *topNode) Initializing" << std::endl;
56 std::cout <<
"JetValidation::Init - Output to " <<
m_outputFileName << std::endl;
59 h1d_nConsituents =
new TH1D(
"h1d_nConsituents",
"h1d_nConsituents", 300, 0, 300);
107 std::cout <<
"JetNconstituents::InitRun(PHCompositeNode *topNode) Initializing for Run XXX" << std::endl;
119 std::cout <<
"JetNconstituents::process_event - Error can not find DST Reco JetMap node " <<
m_recoJetName << std::endl;
123 TowerInfoContainer *towersEM3 = findNode::getClass<TowerInfoContainer>(topNode,
"TOWERINFO_CALIB_CEMC_RETOWER");
124 TowerInfoContainer *towersIH3 = findNode::getClass<TowerInfoContainer>(topNode,
"TOWERINFO_CALIB_HCALIN");
125 TowerInfoContainer *towersOH3 = findNode::getClass<TowerInfoContainer>(topNode,
"TOWERINFO_CALIB_HCALOUT");
126 RawTowerGeomContainer *tower_geom = findNode::getClass<RawTowerGeomContainer>(topNode,
"TOWERGEOM_HCALIN");
127 RawTowerGeomContainer *tower_geomOH = findNode::getClass<RawTowerGeomContainer>(topNode,
"TOWERGEOM_HCALOUT");
128 if(!towersEM3 || !towersIH3 || !towersOH3){
130 <<
"MyJetAnalysis::process_event - Error can not find raw tower node "
135 if(!tower_geom || !tower_geomOH){
137 <<
"MyJetAnalysis::process_event - Error can not find raw tower geometry "
145 Jet* jet = iter->second;
150 if ((not eta_cut) or (not pt_cut))
continue;
152 if(jet->
get_pt() < 1)
continue;
157 float ohcal_energy_sum = 0;
158 float ihcal_energy_sum = 0;
159 float emcal_energy_sum = 0;
163 float jet_energy_sum = 0;
164 int n_constituents_emcal = 0;
165 int n_constituents_ihcal = 0;
166 int n_constituents_ohcal = 0;
173 unsigned int channel = (*comp).second;
175 if ((*comp).first == 15 || (*comp).first == 30)
177 tower = towersIH3->get_tower_at_channel(channel);
178 if(!tower || !tower_geom){
continue; }
180 n_constituents_ihcal++;
183 else if ((*comp).first == 16 || (*comp).first == 31)
185 tower = towersOH3->get_tower_at_channel(channel);
186 if(!tower || !tower_geomOH){
continue; }
188 n_constituents_ohcal++;
191 else if ((*comp).first == 14 || (*comp).first == 29){
193 if(!tower || !tower_geom){
continue; }
195 n_constituents_emcal++;
200 float eFrac_emcal = emcal_energy_sum/jet_energy_sum;
201 float eFrac_ihcal = ihcal_energy_sum/jet_energy_sum;
202 float eFrac_ohcal = ohcal_energy_sum/jet_energy_sum;
247 std::cout <<
"JetNconstituents::EndRun(const int runnumber) Ending Run for Run " << runnumber << std::endl;
248 std::cout <<
"JetValidation::End - Output to " <<
m_outputFileName << std::endl;
267 std::cout <<
"JetValidation::End(PHCompositeNode *topNode) This is the End..." << std::endl;
275 std::cout <<
"JetNconstituents::End(PHCompositeNode *topNode) This is the End..." << std::endl;
289 std::cout <<
"JetNconstituents::Print(const std::string &what) const Printing info for " << what << std::endl;