77 #include <g4jets/JetMap.h>
78 #include <g4jets/Jetv1.h>
87 #include <calobase/RawTower.h>
88 #include <calobase/RawTowerContainer.h>
89 #include <calobase/RawTowerGeom.h>
90 #include <calobase/RawTowerGeomContainer.h>
100 , m_outputFileName(outputfilename)
102 std::cout <<
"JetUnderlyingEvent::JetUnderlyingEvent(const std::string &name) Calling ctor" << std::endl;
108 std::cout <<
"JetUnderlyingEvent::~JetUnderlyingEvent() Calling dtor" << std::endl;
114 std::cout <<
"JetUnderlyingEvent::Init(PHCompositeNode *topNode) Initializing" << std::endl;
116 std::cout <<
"JetUnderlyingEvent::Init - Output to " <<
m_outputFileName << std::endl;
120 hsubtractedE =
new TH3F(
"HsubtractedE",
"", 100, 0.0, 100, 100, 0, 100, 10, 0, 100);
122 hsubtractedE->GetYaxis()->SetTitle(
"Subtracted E_{T} [GeV]");
130 std::cout <<
"JetUnderlyingEvent::InitRun(PHCompositeNode *topNode) Initializing for Run XXX" << std::endl;
138 JetMap* jets = findNode::getClass<JetMap>(topNode,
"AntiKt_Tower_r04_Sub1");
141 <<
"MyJetAnalysis::process_event - Error can not find DST Reco JetMap node "
148 RawTowerContainer *towersEM3 = findNode::getClass<RawTowerContainer>(topNode,
"TOWER_CALIB_CEMC_RETOWER");
149 RawTowerContainer *towersIH3 = findNode::getClass<RawTowerContainer>(topNode,
"TOWER_CALIB_HCALIN");
150 RawTowerContainer *towersOH3 = findNode::getClass<RawTowerContainer>(topNode,
"TOWER_CALIB_HCALOUT");
151 RawTowerGeomContainer *tower_geom = findNode::getClass<RawTowerGeomContainer>(topNode,
"TOWERGEOM_HCALIN");
152 RawTowerGeomContainer *tower_geomOH = findNode::getClass<RawTowerGeomContainer>(topNode,
"TOWERGEOM_HCALOUT");
153 if(!towersEM3 || !towersIH3 || !towersOH3){
155 <<
"MyJetAnalysis::process_event - Error can not find raw tower node "
160 if(!tower_geom || !tower_geomOH){
162 <<
"MyJetAnalysis::process_event - Error can not find raw tower geometry "
169 CentralityInfo* cent_node = findNode::getClass<CentralityInfo>(topNode,
"CentralityInfo");
173 <<
"MyJetAnalysis::process_event - Error can not find centrality node "
178 int m_centrality = cent_node->
get_centile(CentralityInfo::PROP::mbd_NS);
181 TowerBackground *background = findNode::getClass<TowerBackground>(topNode,
"TowerBackground_Sub2");
183 std::cout<<
"Can't get background. Exiting"<<std::endl;
189 float background_v2 = 0;
190 float background_Psi2 = 0;
193 background_v2 = background->
get_v2();
194 background_Psi2 = background->
get_Psi2();
199 Jet* jet = iter->second;
215 if ((*comp).first == 15)
217 tower = towersIH3->getTower((*comp).second);
218 if(!tower || !tower_geom){
222 float tower_phi = tower_geom->get_tower_geometry(tower->
get_key())->get_phi();
223 float tower_eta = tower_geom->get_tower_geometry(tower->
get_key())->get_eta();
224 UE = UE * (1 + 2 * background_v2 * cos(2 * (tower_phi - background_Psi2)));
227 totalPx += pt * cos(tower_phi);
228 totalPy += pt * sin(tower_phi);
229 totalPz += pt * sinh(tower_eta);
231 else if ((*comp).first == 16)
233 tower = towersOH3->getTower((*comp).second);
234 if(!tower || !tower_geomOH)
240 float tower_phi = tower_geomOH->get_tower_geometry(tower->
get_key())->get_phi();
241 float tower_eta = tower_geomOH->get_tower_geometry(tower->
get_key())->get_eta();
242 UE = UE * (1 + 2 * background_v2 * cos(2 * (tower_phi - background_Psi2)));
245 totalPx += pt * cos(tower_phi);
246 totalPy += pt * sin(tower_phi);
247 totalPz += pt * sinh(tower_eta);
249 else if ((*comp).first == 14)
251 tower = towersEM3->
getTower((*comp).second);
252 if(!tower || !tower_geom)
257 float tower_phi = tower_geom->get_tower_geometry(tower->
get_key())->get_phi();
258 float tower_eta = tower_geom->get_tower_geometry(tower->
get_key())->get_eta();
259 UE = UE * (1 + 2 * background_v2 * cos(2 * (tower_phi - background_Psi2)));
262 totalPx += pt * cos(tower_phi);
263 totalPy += pt * sin(tower_phi);
264 totalPz += pt * sinh(tower_eta);
269 unsubjet->
set_px(totalPx);
270 unsubjet->
set_py(totalPy);
271 unsubjet->
set_pz(totalPz);
272 unsubjet->
set_e(totalE);
296 std::cout <<
"JetUnderlyingEvent::EndRun(const int runnumber) Ending Run for Run " << runnumber << std::endl;
303 std::cout <<
"JetValidation::End - Output to " <<
m_outputFileName << std::endl;
311 Centrality ->
Write(Form(
"hsubtractedE%1.0f",
hsubtractedE->GetZaxis()->GetBinLowEdge(
i+1)));
320 std::cout <<
"JetUnderlyingEvent::Reset(PHCompositeNode *topNode) being Reset" << std::endl;
327 std::cout <<
"JetUnderlyingEvent::Print(const std::string &what) const Printing info for " << what << std::endl;