Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
EMJetVal.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file EMJetVal.cc
1 // Modified version of JetValidation.cc for the purpose of subjet analysis -- Jennifer James jennifer.l.james@vanderbilt.edu
2 //module for producing a TTree with jet information for doing jet validation studies
3 // for questions/bugs please contact Virginia Bailey vbailey13@gsu.edu and myself
4 
5 #include <fun4all/Fun4AllBase.h>
6 #include <EMJetVal.h>
10 #include <phool/getClass.h>
11 #include <jetbase/JetMap.h>
12 #include <jetbase/JetContainer.h>
13 #include <jetbase/Jetv2.h>
14 #include <jetbase/Jetv1.h>
18 #include <calobase/RawTower.h>
19 #include <calobase/RawTowerContainer.h>
20 #include <calobase/RawTowerGeom.h>
21 #include <calobase/RawTowerGeomContainer.h>
22 #include <calobase/TowerInfoContainer.h>
23 #include <calobase/TowerInfo.h>
24 
25 #include <Pythia8/Pythia.h> // Include the Pythia header
27 
28 #include <TTree.h>
29 #include <iostream>
30 #include <fastjet/PseudoJet.hh>
31 #include <sstream>
32 #include <iomanip>
33 #include <cmath>
34 #include <vector>
35 #include "fastjet/ClusterSequence.hh"
36 #include "fastjet/contrib/SoftDrop.hh" // In external code, this should be fastjet/contrib/SoftDrop.hh
37 
38 using namespace fastjet;
39 
40 // ROOT, for histogramming.
41 #include "TH1.h"
42 #include "TH2.h"
43 
44 // ROOT, for interactive graphics.
45 #include "TVirtualPad.h"
46 #include "TApplication.h"
47 
48 // ROOT, for saving file.
49 #include "TFile.h"
50 #include <TTree.h>
51 
52 using std::cout;
53 using std::endl;
54 
55 //____________________________________________________________________________..
56 EMJetVal::EMJetVal(const std::string& recojetname, const std::string& truthjetname, const std::string& outputfilename)
57  :SubsysReco("EMJetVal_" + recojetname + "_" + truthjetname)
58  , m_recoJetName(recojetname)
59  , m_truthJetName(truthjetname)
60  , m_outputFileName(outputfilename)
61  , m_etaRange(-1, 1)
62  , m_ptRange(5, 100)
63  , m_doTruthJets(0)
64  , m_doSeeds(0)
65  , m_doUnsubJet(0)
66  , m_T(nullptr)
67  , m_event(-1)
68  , m_nTruthJet(-1)
69  , m_nJet(-1)
70  , m_id()
71  , m_nComponent()
72  , m_eta()
73  , m_phi()
74  , m_e()
75  , m_pt()
76  , m_sub_et()
77  , m_truthID()
78  , m_truthNComponent()
79  , m_truthEta()
80  , m_truthPhi()
81  , m_truthE()
82  , m_truthPt()
83  , m_eta_rawseed()
84  , m_phi_rawseed()
85  , m_pt_rawseed()
86  , m_e_rawseed()
87  , m_rawseed_cut()
88  , m_eta_subseed()
89  , m_phi_subseed()
90  , m_pt_subseed()
91  , m_e_subseed()
92  , m_subseed_cut()
93 {
94  std::cout << "EMJetVal::EMJetVal(const std::string &name) Calling ctor" << std::endl;
95 }
96 
97 
98 //____________________________________________________________________________..
100 {
101  std::cout << "EMJetVal::~EMJetVal() Calling dtor" << std::endl;
102 }
103 
104 //____________________________________________________________________________..
106 {
107  // std::cout << "EMJetVal::Init(PHCompositeNode *topNode) Initializing" << std::endl;
108  //PHTFileServer::get().open(m_outputFileName, "RECREATE");
109  std::cout << "EMJetVal::Init - Output to " << m_outputFileName << std::endl;
110  //Analysis hists
111  outFile = new TFile(m_outputFileName.c_str(), "RECREATE");
112  _h_R04_z_sj_10_20= new TH1F("R04_z_sj_10_20","z_sj in subjets 1 & 2", 10, 0, 0.5);
113  _h_R04_theta_sj_10_20= new TH1F("R04_theta_sj_10_20","theta_sj in subjets 1 & 2", 10, 0, 0.5);
114  // softdrop hists
115  _h_R04_z_g_10_20= new TH1F("R04_z_g_10_20","z_g in subjets 1 & 2", 10, 0, 0.5);
116  _h_R04_theta_g_10_20= new TH1F("R04_theta_g_10_20","theta_g in subjets 1 & 2", 10, 0, 0.5);
117  // multiplicity hists
118  _hmult_R04= new TH1F("mult_R04","total number of constituents inside R=0.4 jets", 30, 0, 30);
119  _hmult_R04_pT_10_20GeV= new TH1F("mult_R04_pT_10_20GeV","total number of constituents inside R=0.4 jets with 10 < p_{T} < 20", 30, 0, 30);
120  _hjetpT_R04 = new TH1F("jetpT_R04","jet transverse momentum for R=0.4 jets", 100, 0, 100);
121  _hjeteta_R04 = new TH1F("jeteta_R04","jet pseudorapidity for R=0.4 jets", 50, -0.6, 0.6);
122  // corellation hists
123  correlation_theta_10_20 = new TH2D("correlation_theta_10_20", "Correlation Plot 10 < p_{T} < 20 [GeV/c]; R_{g}; #theta_{sj}", 20, 0, 0.5, 20, 0, 0.5);
124  correlation_z_10_20 = new TH2D("correlation_z_10_20", "Correlation Plot; z_{g}; z_{sj}", 20, 0, 0.5, 20, 0, 0.5);
125  // configure Tree
126 
127  //PHTFileServer::get().open("hist_jets.root", "RECREATE");
128 
129  m_T = new TTree("T", "MyJetAnalysis Tree");
130  m_T->Branch("m_event", &m_event, "event/I");
131  m_T->Branch("nJet", &m_nJet, "nJet/I");
132  m_T->Branch("cent", &m_centrality);
133  m_T->Branch("b", &m_impactparam);
134  m_T->Branch("id", &m_id);
135  m_T->Branch("nComponent", &m_nComponent);
136 
137  m_T->Branch("eta", &m_eta);
138  m_T->Branch("phi", &m_phi);
139  m_T->Branch("e", &m_e);
140  m_T->Branch("pt", &m_pt);
141  if(m_doUnsubJet)
142  {
143  m_T->Branch("pt_unsub", &m_unsub_pt);
144  m_T->Branch("subtracted_et", &m_sub_et);
145  }
146  if(m_doTruthJets){
147  m_T->Branch("nTruthJet", &m_nTruthJet);
148  m_T->Branch("truthID", &m_truthID);
149  m_T->Branch("truthNComponent", &m_truthNComponent);
150  m_T->Branch("truthEta", &m_truthEta);
151  m_T->Branch("truthPhi", &m_truthPhi);
152  m_T->Branch("truthE", &m_truthE);
153  m_T->Branch("truthPt", &m_truthPt);
154  }
155 
156  if(m_doSeeds){
157  m_T->Branch("rawseedEta", &m_eta_rawseed);
158  m_T->Branch("rawseedPhi", &m_phi_rawseed);
159  m_T->Branch("rawseedPt", &m_pt_rawseed);
160  m_T->Branch("rawseedE", &m_e_rawseed);
161  m_T->Branch("rawseedCut", &m_rawseed_cut);
162  m_T->Branch("subseedEta", &m_eta_subseed);
163  m_T->Branch("subseedPhi", &m_phi_subseed);
164  m_T->Branch("subseedPt", &m_pt_subseed);
165  m_T->Branch("subseedE", &m_e_subseed);
166  m_T->Branch("subseedCut", &m_subseed_cut);
167  }
168 
169  std::cout << "finished declaring histos" << std::endl;
170 
172 }
173 //____________________________________________________________________________..
174 
175 int EMJetVal::retrieveEvent(const fastjet::PseudoJet& jet) {
176  // Add the PseudoJet to the event vector
177  eventVector.push_back(jet);
178 
179  return 0; // Return 0 for success
180 }
181 
182 //____________________________________________________________________________..
184 {
185  // std::cout << "EMJetVal::InitRun(PHCompositeNode *topNode) Initializing for Run XXX" << std::endl;
187 }
188 
189 //____________________________________________________________________________..
191 {
192  std::cout << "EMJetVal::process_event(PHCompositeNode *topNode) Processing Event " << m_event << std::endl;
193  ++m_event;
194 
195  // interface to reco jets
196  JetContainer* jets = findNode::getClass<JetContainer>(topNode, m_recoJetName);
197  if (!jets)
198  {
199  std::cout
200  << "MyJetAnalysis::process_event - Error can not find DST Reco JetContainer node "
201  << m_recoJetName << std::endl;
202  exit(-1);
203  }
204 
205  //interface to truth jets
206  JetMap* jetsMC = findNode::getClass<JetMap>(topNode, m_truthJetName);
207  if (!jetsMC && m_doTruthJets)
208  {
209  std::cout
210  << "MyJetAnalysis::process_event - Error can not find DST Truth JetMap node "
211  << m_truthJetName << std::endl;
212  exit(-1);
213  }
214 
215 
216  // interface to jet seeds
217  JetContainer* seedjetsraw = findNode::getClass<JetContainer>(topNode, "AntiKt_TowerInfo_HIRecoSeedsRaw_r02");
218  if (!seedjetsraw && m_doSeeds)
219  {
220  std::cout
221  << "MyJetAnalysis::process_event - Error can not find DST raw seed jets "
222  << std::endl;
223  exit(-1);
224  }
225 
226  JetContainer* seedjetssub = findNode::getClass<JetContainer>(topNode, "AntiKt_TowerInfo_HIRecoSeedsSub_r02");
227  if (!seedjetssub && m_doSeeds)
228  {
229  std::cout
230  << "MyJetAnalysis::process_event - Error can not find DST subtracted seed jets "
231  << std::endl;
232  exit(-1);
233  }
234 
235  //centrality
236  CentralityInfo* cent_node = findNode::getClass<CentralityInfo>(topNode, "CentralityInfo");
237  if (!cent_node)
238  {
239  std::cout
240  << "MyJetAnalysis::process_event - Error can not find centrality node "
241  << std::endl;
242  exit(-1);
243  }
244 
245  //calorimeter towers
246  TowerInfoContainer *towersEM3 = findNode::getClass<TowerInfoContainer>(topNode, "TOWERINFO_CALIB_CEMC_RETOWER");
247  TowerInfoContainer *towersIH3 = findNode::getClass<TowerInfoContainer>(topNode, "TOWERINFO_CALIB_HCALIN");
248  TowerInfoContainer *towersOH3 = findNode::getClass<TowerInfoContainer>(topNode, "TOWERINFO_CALIB_HCALOUT");
249  RawTowerGeomContainer *tower_geom = findNode::getClass<RawTowerGeomContainer>(topNode, "TOWERGEOM_HCALIN");
250  RawTowerGeomContainer *tower_geomOH = findNode::getClass<RawTowerGeomContainer>(topNode, "TOWERGEOM_HCALOUT");
251  if(!towersEM3 || !towersIH3 || !towersOH3){
252  std::cout
253  <<"MyJetAnalysis::process_event - Error can not find raw tower node "
254  << std::endl;
255  exit(-1);
256  }
257 
258  if(!tower_geom || !tower_geomOH){
259  std::cout
260  <<"MyJetAnalysis::process_event - Error can not find raw tower geometry "
261  << std::endl;
262  exit(-1);
263  }
264 
265  //underlying event
266  TowerBackground *background = findNode::getClass<TowerBackground>(topNode, "TowerInfoBackground_Sub2");
267  if(!background){
268  std::cout<<"Can't get background. Exiting"<<std::endl;
270  }
271 
272  //get the event centrality/impact parameter from HIJING
273  m_centrality = cent_node->get_centile(CentralityInfo::PROP::bimp);
274  m_impactparam = cent_node->get_quantity(CentralityInfo::PROP::bimp);
275 
276  //get reco jets
277  m_nJet = 0;
278  float background_v2 = 0;
279  float background_Psi2 = 0;
280  if(m_doUnsubJet)
281  {
282  background_v2 = background->get_v2();
283  background_Psi2 = background->get_Psi2();
284  }
285  for (auto jet : *jets)// jets //JetMap::Iter iter = jets->begin(); iter != jets->end(); ++iter)
286  {
287 
288  std::cout << "working on original jet " << jet->get_id() << " out of " << jets->size() << std::endl;
289 
290  if(jet->get_pt() < 1) continue; // to remove noise jets
291 
292 
293  m_id.push_back(jet->get_id());
294  m_nComponent.push_back(jet->size_comp());
295  m_eta.push_back(jet->get_eta());
296  m_phi.push_back(jet->get_phi());
297  m_e.push_back(jet->get_e());
298  m_pt.push_back(jet->get_pt());
299 
300  std::vector<PseudoJet> particles;
301  particles.clear();
302 
303  float totalPx = 0;
304  float totalPy = 0;
305  float totalPz = 0;
306  float totalE = 0;
307  int nconst = 0;
308 
309  for (auto comp : jet->get_comp_vec()) //Jet::ConstIter comp = jet->begin_comp(); comp != jet->end_comp(); ++comp)
310  {
311  TowerInfo *tower;
312  nconst++;
313  unsigned int channel = comp.second;
314 
315  if (comp.first == 15 || comp.first == 30)
316  {
317  tower = towersIH3->get_tower_at_channel(channel);
318  if(!tower || !tower_geom){
319  continue;
320  }
321  unsigned int calokey = towersIH3->encode_key(channel);
322  int ieta = towersIH3->getTowerEtaBin(calokey);
323  int iphi = towersIH3->getTowerPhiBin(calokey);
325  float UE = background->get_UE(1).at(ieta);
326  float tower_phi = tower_geom->get_tower_geometry(key)->get_phi();
327  float tower_eta = tower_geom->get_tower_geometry(key)->get_eta();
328 
329  UE = UE * (1 + 2 * background_v2 * cos(2 * (tower_phi - background_Psi2)));
330  totalE += tower->get_energy() + UE;
331  double pt = (tower->get_energy() + UE) / cosh(tower_eta);
332  totalPx += pt * cos(tower_phi);
333  totalPy += pt * sin(tower_phi);
334  totalPz += pt * sinh(tower_eta);
335  }
336  else if (comp.first == 16 || comp.first == 31)
337  {
338  tower = towersOH3->get_tower_at_channel(channel);
339  if(!tower || !tower_geomOH)
340  {
341  continue;
342  }
343 
344  unsigned int calokey = towersOH3->encode_key(channel);
345  int ieta = towersOH3->getTowerEtaBin(calokey);
346  int iphi = towersOH3->getTowerPhiBin(calokey);
348  float UE = background->get_UE(2).at(ieta);
349  float tower_phi = tower_geomOH->get_tower_geometry(key)->get_phi();
350  float tower_eta = tower_geomOH->get_tower_geometry(key)->get_eta();
351 
352  UE = UE * (1 + 2 * background_v2 * cos(2 * (tower_phi - background_Psi2)));
353  totalE +=tower->get_energy() + UE;
354  double pt = (tower->get_energy() + UE) / cosh(tower_eta);
355  totalPx += pt * cos(tower_phi);
356  totalPy += pt * sin(tower_phi);
357  totalPz += pt * sinh(tower_eta);
358  }
359  else if (comp.first == 14 || comp.first == 29)
360  {
361  tower = towersEM3->get_tower_at_channel(channel);
362  if(!tower || !tower_geom)
363  {
364  continue;
365  }
366 
367  unsigned int calokey = towersEM3->encode_key(channel);
368  int ieta = towersEM3->getTowerEtaBin(calokey);
369  int iphi = towersEM3->getTowerPhiBin(calokey);
371  float UE = background->get_UE(0).at(ieta);
372  float tower_phi = tower_geom->get_tower_geometry(key)->get_phi();
373  float tower_eta = tower_geom->get_tower_geometry(key)->get_eta();
374 
375 
376  UE = UE * (1 + 2 * background_v2 * cos(2 * (tower_phi - background_Psi2)));
377  double ETmp = tower->get_energy();
378  double pt = tower->get_energy() / cosh(tower_eta);
379  if(m_doUnsubJet){
380  ETmp += UE;
381  pt = ETmp / cosh(tower_eta);
382  }
383  double pxTmp = pt * cos(tower_phi);
384  double pyTmp = pt * sin(tower_phi);
385  double pzTmp = pt * sinh(tower_eta);
386 
387  totalE += ETmp;
388  totalPx += pxTmp;
389  totalPy += pyTmp;
390  totalPz += pzTmp;
391 
392 
393  particles.push_back( PseudoJet( pxTmp, pyTmp, pzTmp, ETmp) );
394 
395  }//end if over sources
396 
397  }//end loop over constituents
398 
399  double radius[5] = {0.05, 0.1, 0.2, 0.4, 0.6}; // jet radius
400  double pseudorapidity = -999.; // pseudorapidity
401  double theta_sj = -1.; // delta radius (value describes an unachievable value)
402  double z_sj = -1.; // delta radius (value describes an unachievable value)
403 
404  // std::cout << "passed here -397 -my jet defs" << std::endl
405  // Set up FastJet jet finders and modified mass-drop tagger.
406  JetDefinition jetDefAKT_R01( antikt_algorithm, radius[1]);
407  JetDefinition jetDefAKT_R04( antikt_algorithm, radius[3]);
408  JetDefinition jetDefCA(cambridge_algorithm, radius[3]);
409 
410  // vector<PseudoJet> particles;
411 
412  // Run Fastjet anti-kT algorithm and sort jets in pT order.
413  ClusterSequence clustSeq_R04( particles, jetDefAKT_R04 );
414  std::vector<PseudoJet> sortedJets_R04 = sorted_by_pt( clustSeq_R04.inclusive_jets() );
415 
417 
418  for (int j = 0; j < (int)sortedJets_R04.size(); j++) {
419 
420  std::cout << "working on reclustered jet " << j << " of " << sortedJets_R04.size() << std::endl;
421 
422  PseudoJet jet_reco = sortedJets_R04.at(j);
423  if(fabs(jet_reco.eta()) > 0.6)
424  continue;
425 
426  std::cout << "jet within eta of 0.6" << std::endl;
427 
428  ClusterSequence clustSeq_R01_con(jet_reco.constituents() , jetDefAKT_R01 );
429  std::cout << "made R=0.1 cluster sequence" << std::endl;
430  std:: vector<PseudoJet> sortedJets_R01_con = sorted_by_pt( clustSeq_R01_con.inclusive_jets() );
431  std::cout << "ran R=0.1 and sorted by pT" << std::endl;
432  std::cout << "number of subjets: " << sortedJets_R01_con.size() << std::endl;
433  // std::cout << "passed here -476 -pseudojet" << std::endl
434  if (sortedJets_R01_con.size() < 2){
435  std::cout << "not enough subjets" << std::endl;
436  continue;
437  }
438 
439  std:: cout << "at least 2 subjets" << std::endl;
440 
441  PseudoJet sj1 = sortedJets_R01_con.at(0);
442  PseudoJet sj2 = sortedJets_R01_con.at(1);
443 
444  // std::cout << "sj1 pt=" << sj1.pt() << std::endl;
445  // std::cout << "sj2 pt=" << sj2.pt() << std::endl;
446  if (sj1.pt() < 3 || sj2.pt() < 3 )
447  continue;
448  // std::cout << "sj1 pt=" << sj1.pt() << std::endl;
449  // std::cout << "sj2 pt=" << sj2.pt() << std::endl;
450  std::cout << "both are above 3" << std::endl;
451 
452  theta_sj = sj1.delta_R(sj2);
453  z_sj = sj2.pt()/(sj2.pt()+sj1.pt());
454 
455  std::cout << "theta_sj = " << theta_sj << " z_sj = " << z_sj << std::endl;
456 
457  // 10 to 20 pT
458  if (jet_reco.pt() > 10 && jet_reco.pt() < 20 ){
459  // cout<<"sorted jets at "<<j<<" the pT = "<<jet.pt()<<endl;
460  std::cout << "jet pt >10 & <20: " << jet_reco.pt() << std::endl;
461  _hjetpT_R04->Fill(jet_reco.perp());
462  pseudorapidity = jet_reco.eta();
463  _hjeteta_R04->Fill(pseudorapidity);
464  _hmult_R04->Fill(jet_reco.constituents().size());
465 
466  ClusterSequence clustSeqCA(jet_reco.constituents(), jetDefCA);
467  std::vector<PseudoJet> cambridgeJets = sorted_by_pt(clustSeqCA.inclusive_jets());
468 
469  std::cout << "have CA sort jets: " << cambridgeJets.size() << std::endl;
470 
471  // SoftDrop parameters
472  double z_cut = 0.30;
473  double beta = 2.0;
474  contrib::SoftDrop sd(beta, z_cut);
476  if (!isnan(theta_sj) && !isnan(z_sj) && !isinf(theta_sj) && !isinf(z_sj)){
477  _h_R04_z_sj_10_20->Fill(z_sj);
478  _h_R04_theta_sj_10_20->Fill(theta_sj);
479  }
480 
481  std::cout << "filled some histos" << std::endl;
482  // Apply SoftDrop to the jet
483  PseudoJet sd_jet = sd(jet_reco);
484  std::cout << "ran sd" << std::endl;
485  if (sd_jet == 0)
486 
487  continue;
488  std::cout << "sd jet exists" << std::endl;
489  double delta_R_subjets = sd_jet.structure_of<contrib::SoftDrop>().delta_R();
490  double z_subjets = sd_jet.structure_of<contrib::SoftDrop>().symmetry();
491 
492  _h_R04_z_g_10_20->Fill(z_subjets);
493  _h_R04_theta_g_10_20->Fill(delta_R_subjets);
494 
495  correlation_theta_10_20->Fill(delta_R_subjets, theta_sj);
496  correlation_z_10_20->Fill(z_subjets, z_sj);
497 
498  // SoftDrop failed, handle the case as needed
499  // e.g., skip this jet or perform alternative analysis
500  } else {
501  _hmult_R04_pT_10_20GeV->Fill(jet_reco.constituents().size());
502  }
503 
505  // Rjet = 0.4 End
506 
507  //filled nEvent in histogram
508  _hmult_R04->Fill(m_nJet);
509 
510  // std::// cout << "iZ = " << nEvent << std::endl;
511  std::cout << "finished jet " << j << std::endl;
512 
513  }
514 
515 
516  std::cout << "finished loop over reclustered jets" << std::endl;
517 
518  // End of event loop. Statistics. Histograms. Done.
519 
520 
521  m_nJet++;
522  std::cout << "m_nJet: " << m_nJet << std::endl;
523  }
524 
525  std::cout << "finised loop over original jets" << std::endl;
526  /*
527 //get truth jets
528 if(m_doTruthJets)
529  {
530  m_nTruthJet = 0;
531  for (JetMap::Iter iter = jetsMC->begin(); iter != jetsMC->end(); ++iter)
532  {
533  Jet* truthjet = iter->second;
534 
535  bool eta_cut = (truthjet->get_eta() >= m_etaRange.first) and (truthjet->get_eta() <= m_etaRange.second);
536  bool pt_cut = (truthjet->get_pt() >= m_ptRange.first) and (truthjet->get_pt() <= m_ptRange.second);
537  if ((not eta_cut) or (not pt_cut)) continue;
538  m_truthID.push_back(truthjet->get_id());
539  m_truthNComponent.push_back(truthjet->size_comp());
540  m_truthEta.push_back(truthjet->get_eta());
541  m_truthPhi.push_back(truthjet->get_phi());
542  m_truthE.push_back(truthjet->get_e());
543  m_truthPt.push_back(truthjet->get_pt());
544  m_nTruthJet++;
545  }
546  }
547  //get seed jets
548  if(m_doSeeds)
549  {
550  for (auto jet : *seedjetsraw)
551  {
552  int passesCut = jet->get_property(Jet::PROPERTY::prop_SeedItr);
553  m_eta_rawseed.push_back(jet->get_eta());
554  m_phi_rawseed.push_back(jet->get_phi());
555  m_e_rawseed.push_back(jet->get_e());
556  m_pt_rawseed.push_back(jet->get_pt());
557  m_rawseed_cut.push_back(passesCut);
558  }
559 
560  for (auto jet : *seedjetssub) //JetMap::Iter iter = seedjetssub->begin(); iter != seedjetssub->end(); ++iter)
561  {
562  int passesCut = jet->get_property(Jet::PROPERTY::prop_SeedItr);
563  m_eta_subseed.push_back(jet->get_eta());
564  m_phi_subseed.push_back(jet->get_phi());
565  m_e_subseed.push_back(jet->get_e());
566  m_pt_subseed.push_back(jet->get_pt());
567  m_subseed_cut.push_back(passesCut);
568  }
569  }
570  */
571  //fill the tree
572 
573  m_T->Fill();
574  std::cout << "filled TTree" << std::endl;
575 
577 }
578 
579 
580  //____________________________________________________________________________..
582  {
583  //std::cout << "EMJetVal::ResetEvent(PHCompositeNode *topNode) Resetting internal structures, prepare for next event" << std::endl;
584  m_id.clear();
585  m_nComponent.clear();
586  m_eta.clear();
587  m_phi.clear();
588  m_e.clear();
589  m_pt.clear();
590  m_unsub_pt.clear();
591  m_sub_et.clear();
592 
593  m_truthID.clear();
594  m_truthNComponent.clear();
595  m_truthEta.clear();
596  m_truthPhi.clear();
597  m_truthE.clear();
598  m_truthPt.clear();
599  m_truthdR.clear();
600 
601  m_eta_subseed.clear();
602  m_phi_subseed.clear();
603  m_e_subseed.clear();
604  m_pt_subseed.clear();
605  m_subseed_cut.clear();
606 
607  m_eta_rawseed.clear();
608  m_phi_rawseed.clear();
609  m_e_rawseed.clear();
610  m_pt_rawseed.clear();
611  m_rawseed_cut.clear();
613 
614  }
615  //____________________________________________________________________________..
617  {
618  std::cout << "EMJetVal::EndRun(const int runnumber) Ending Run for Run " << runnumber << std::endl;
620  }
621 
622  //____________________________________________________________________________..
624  {
625 
626  /*
627 
628  // Normalize 10-20 hists
629  _h_R04_z_sj_10_20->Scale(1./_h_R04_z_sj_10_20->Integral());
630  _h_R04_theta_sj_10_20->Scale(1./_h_R04_theta_sj_10_20->Integral());
631 
632  _h_R04_z_sj_10_20->Scale(1./0.05);
633  _h_R04_theta_sj_10_20->Scale(1./0.05);
634  //SoftDrop Normalization
635  // Normalize 10-20 hists
636  _h_R04_z_g_10_20->Scale(1./_h_R04_z_g_10_20->Integral());
637  _h_R04_theta_g_10_20->Scale(1./_h_R04_theta_g_10_20->Integral());
638 
639  _h_R04_z_g_10_20->Scale(1./0.05);
640  _h_R04_theta_g_10_20->Scale(1./0.05);
641  */
642 
643 
644  outFile->cd();
645  outFile->Write();
646  outFile->Close();
647 
648  //std::cout << "EMJetVal::End - Output to " << m_outputFileName << std::endl;
649 
650 
651  // PHTFileServer::get().cd(m_outputFileName);
652 
653  //m_T->Write();
654  std::cout << "EMJetVal::End(PHCompositeNode *topNode) This is the End..." << std::endl;
656  }
657 
658  //____________________________________________________________________________..
660  {
661  // std::cout << "EMJetVal::Reset(PHCompositeNode *topNode) being Reset" << std::endl;
663  }
664 
665  //____________________________________________________________________________..
666  void EMJetVal::Print(const std::string &what) const
667  {
668  std::cout << "EMJetVal::Print(const std::string &what) const Printing info for " << what << std::endl;
669  }
670 
671