7 #include <calobase/RawTower.h>
8 #include <calobase/RawTowerContainer.h>
9 #include <calobase/RawTowerGeom.h>
10 #include <calobase/RawTowerGeomContainer.h>
13 #include <g4jets/Jet.h>
14 #include <g4jets/JetMap.h>
15 #include <g4jets/JetV1.h>
16 #include <g4jets/JetMapV1.h>
31 RawTowerContainer* towersEM3 = findNode::getClass<RawTowerContainer>(topNode,
"TOWER_CALIB_CEMC");
32 RawTowerContainer* towersIH3 = findNode::getClass<RawTowerContainer>(topNode,
"TOWER_CALIB_HCALIN");
33 RawTowerContainer* towersOH3 = findNode::getClass<RawTowerContainer>(topNode,
"TOWER_CALIB_HCALOUT");
37 RawTowerGeomContainer* geomIH = findNode::getClass<RawTowerGeomContainer>(topNode,
"TOWERGEOM_HCALIN");
38 RawTowerGeomContainer* geomOH = findNode::getClass<RawTowerGeomContainer>(topNode,
"TOWERGEOM_HCALOUT");
41 JetMap* old_jets = findNode::getClass<JetMap>(topNode,
"AntiKt_Tower_r02");
42 JetMap* new_jets = findNode::getClass<JetMap>(topNode,
"AntiKt_Tower_Mod_r02");
45 cout <<
"Regular jet node: " << old_jets << endl;
46 cout <<
"Modified jet node: " << new_jets << endl;
48 if ( !old_jets || ! new_jets )
50 cout <<
"One or more invalid pointers, exiting event" << endl;
57 cout <<
"process_event: entering with # original jets = " << old_jets->
size() << endl;
58 cout <<
"process_event: entering with # new jets = " << new_jets->size() << endl;
63 for (
JetMap::Iter iter = old_jets->begin(); iter != old_jets->end(); ++iter )
66 Jet* this_jet = iter->second;
67 float this_e = this_jet->
get_e();
68 float this_pt = this_jet->
get_pt();
69 float this_phi = this_jet->
get_phi();
70 float this_eta = this_jet->
get_eta();
72 Jet *new_jet =
new JetV1();
73 float new_total_px = 0;
74 float new_total_py = 0;
75 float new_total_pz = 0;
76 float new_total_e = 0;
79 cout <<
"process_event: unsubtracted jet with e / pt / eta / phi = "
80 << this_e <<
" / " << this_pt <<
" / " << this_eta <<
" / " << this_phi << endl;
112 if ( (*comp).first == 5 )
114 tower = towersIH3->getTower( (*comp).second );
115 tower_geom = geomIH->get_tower_geometry(tower->
get_key());
116 comp_ieta = geomIH->get_etabin( tower_geom->
get_eta() );
117 comp_iphi = geomIH->get_phibin( tower_geom->
get_phi() );
120 else if ( (*comp).first == 7 )
122 tower = towersOH3->getTower( (*comp).second );
123 tower_geom = geomOH->get_tower_geometry(tower->
get_key());
124 comp_ieta = geomOH->get_etabin( tower_geom->
get_eta() );
125 comp_iphi = geomOH->get_phibin( tower_geom->
get_phi() );
129 else if ( (*comp).first == 3 )
131 tower = towersEM3->
getTower( (*comp).second );
132 tower_geom = geomEM->get_tower_geometry(tower->
get_key());
133 comp_ieta = geomEM->get_etabin( tower_geom->
get_eta() );
134 comp_iphi = geomEM->get_phibin( tower_geom->
get_phi() );
138 if ( tower && tower_geom )
141 comp_eta = tower_geom->
get_eta();
142 comp_phi = tower_geom->
get_phi();
148 cout <<
"process_event: --> constituent in layer " << (*comp).first
149 <<
", has unsub E = " << comp_e <<
", is at ieta #" << comp_ieta
150 <<
" and iphi # = " << comp_iphi << endl;
154 double comp_new_e = comp_e;
157 double comp_px = comp_new_e / cosh( comp_eta ) * cos( comp_phi );
158 double comp_py = comp_new_e / cosh( comp_eta ) * sin( comp_phi );
159 double comp_pz = comp_new_e * tanh( comp_eta );
162 new_total_px += comp_px;
163 new_total_py += comp_py;
164 new_total_pz += comp_pz;
165 new_total_e += comp_new_e;
169 new_jet->
set_px( new_total_px );
170 new_jet->
set_py( new_total_py );
171 new_jet->
set_pz( new_total_pz );
172 new_jet->
set_e( new_total_e );
176 new_jets->insert( new_jet );
180 cout <<
"process_event: old jet #" << ijet <<
", old px / py / pz / e = "
181 << this_jet->
get_px() <<
" / " << this_jet->
get_py() <<
" / "
182 << this_jet->
get_pz() <<
" / " << this_jet->
get_e() << endl;
183 cout <<
"process_event: new jet #" << ijet <<
", new px / py / pz / e = "
184 << new_jet->
get_px() <<
" / " << new_jet->
get_py() <<
" / "
185 << new_jet->
get_pz() <<
" / " << new_jet->
get_e() << endl;
194 cout <<
"process_event: exiting with # original jets = " << old_jets->size() << endl;
195 cout <<
"process_event: exiting with # new jets = " << new_jets->size() << endl;