CMS 3D CMS Logo

List of all members | Public Member Functions | Private Types | Private Member Functions | Private Attributes
JetAnaPythia< Jet > Class Template Reference

#include <JetAnaPythia.h>

Inheritance diagram for JetAnaPythia< Jet >:
edm::one::EDAnalyzer<> edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 JetAnaPythia (edm::ParameterSet const &cfg)
 
- Public Member Functions inherited from edm::one::EDAnalyzer<>
 EDAnalyzer ()=default
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
bool wantsGlobalLuminosityBlocks () const noexcept final
 
bool wantsGlobalRuns () const noexcept final
 
bool wantsInputProcessBlocks () const noexcept final
 
bool wantsProcessBlocks () const noexcept final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const noexcept
 
bool wantsStreamRuns () const noexcept
 
 ~EDAnalyzerBase () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const *> const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Types

typedef std::vector< Jet > JetCollection
 

Private Member Functions

void analyze (edm::Event const &e, edm::EventSetup const &iSetup) override
 
void beginJob () override
 
void endJob () override
 
void FillHist1D (const TString &histName, const Double_t &x, const Double_t &wt)
 

Private Attributes

std::string anaLevel
 
bool debug
 
float diJetMass
 
float diPartMass
 
float etaJet1
 
float etaJet2
 
float etaPart1
 
float etaPart2
 
int eventsGen
 
std::string HistoFileName
 
std::string JetAlgorithm
 
TFile * m_file
 
std::map< TString, TH1 * > m_HistNames1D
 
TTree * mcTruthTree_
 
int nJets
 
int NJets
 
float pt_hat
 
std::vector< double > ptHatEdges
 
float ptJet1
 
float ptJet2
 
float ptPart1
 
float ptPart2
 
float weight
 
float xsec
 
std::vector< double > xsecGen
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

template<class Jet>
class JetAnaPythia< Jet >

Definition at line 16 of file JetAnaPythia.h.

Member Typedef Documentation

◆ JetCollection

template<class Jet >
typedef std::vector<Jet> JetAnaPythia< Jet >::JetCollection
private

Definition at line 21 of file JetAnaPythia.h.

Constructor & Destructor Documentation

◆ JetAnaPythia()

template<class Jet >
JetAnaPythia< Jet >::JetAnaPythia ( edm::ParameterSet const &  cfg)

Definition at line 27 of file JetAnaPythia.cc.

References looper::cfg, debug, and AlCaHLTBitMon_QueryRunRegistry::string.

27  {
28  JetAlgorithm = cfg.getParameter<std::string>("JetAlgorithm");
29  HistoFileName = cfg.getParameter<std::string>("HistoFileName");
30  NJets = cfg.getParameter<int>("NJets");
31  debug = cfg.getParameter<bool>("debug");
32  eventsGen = cfg.getParameter<int>("eventsGen");
33  anaLevel = cfg.getParameter<std::string>("anaLevel");
34  xsecGen = cfg.getParameter<vector<double> >("xsecGen");
35  ptHatEdges = cfg.getParameter<vector<double> >("ptHatEdges");
36 }
std::vector< double > xsecGen
Definition: JetAnaPythia.h:60
std::string JetAlgorithm
Definition: JetAnaPythia.h:42
std::string HistoFileName
Definition: JetAnaPythia.h:44
std::vector< double > ptHatEdges
Definition: JetAnaPythia.h:61
std::string anaLevel
Definition: JetAnaPythia.h:56

Member Function Documentation

◆ analyze()

template<class Jet >
void JetAnaPythia< Jet >::analyze ( edm::Event const &  e,
edm::EventSetup const &  iSetup 
)
overrideprivatevirtual

evt.getRun().getByLabel("generator", genInfoProduct );

Histograms for Dijet Mass Analysis ////

Histograms for Dijet Ratio Analysis: Inner region ///

Histograms for Dijet Ratio Analysis: Outer region ////

We are looking at dijet resonances. ////

We are looking at QCD ////

Diparton mass for dijet mass analysis ////

Diparton mass for dijet ratio analysis: inner region ///

Diparton mass for dijet ratio analysis: outer region ///

Implements edm::one::EDAnalyzerBase.

Definition at line 142 of file JetAnaPythia.cc.

References funct::abs(), gather_cfg::cout, debug, nano_mu_digi_cff::float, edm::Event::getByLabel(), edm::HepMCProduct::GetEvent(), mps_fire::i, PDWG_EXODelayedJetMET_cff::jets, EgHLTOffHistBins_cfi::mass, nJets, AlCaHLTBitMon_ParallelJobs::p, and submitPVResolutionJobs::q.

142  {
143  int notDone = 1;
144  while (notDone) { //while loop to allow us to tailor the analysis level for faster running.
145  TString hname;
146 
147  // Process Info
148 
149  //edm::Handle< double > genEventScale;
150  //evt.getByLabel("genEventScale", genEventScale );
151  //pt_hat = *genEventScale;
152 
154  evt.getByLabel("generatorSmeared", MCevt);
155  HepMC::GenEvent* myGenEvent = new HepMC::GenEvent(*(MCevt->GetEvent()));
156 
157  double pthat = myGenEvent->event_scale();
158  pt_hat = float(pthat);
159 
160  delete myGenEvent;
161 
162  if (anaLevel != "generating") { //We are not generating events, so xsec is there
163  //edm::Handle< GenRunInfoProduct > genInfoProduct;
165  //xsec = (double)genInfoProduct->externalXSecLO();
166  xsec = 0.0;
167  if (ptHatEdges.size() > xsecGen.size()) {
168  for (unsigned int i_pthat = 0; i_pthat < xsecGen.size(); ++i_pthat) {
169  if (pthat >= ptHatEdges[i_pthat] && pthat < ptHatEdges[i_pthat + 1])
170  xsec = float(xsecGen[i_pthat]);
171  }
172  } else {
173  std::cout << "Number of PtHat bin edges too small. Xsec set to zero" << std::endl;
174  }
175  } else {
176  xsec = xsecGen[0]; //Generating events, no xsec in event, get xsec from user input
177  }
178  if (debug)
179  std::cout << "cross section=" << xsec << " pb" << std::endl;
180  weight = xsec / eventsGen;
181 
182  if (debug)
183  std::cout << "pt_hat=" << pt_hat << std::endl;
184  hname = "PtHat";
185  FillHist1D(hname, pt_hat, 1.0);
186  hname = "PtHatFine";
187  FillHist1D(hname, pt_hat, 1.0);
188  hname = "PtHatWt";
189  FillHist1D(hname, pt_hat, weight);
190  hname = "PtHatFineWt";
191  FillHist1D(hname, pt_hat, weight);
192  if (anaLevel == "PtHatOnly")
193  break; //ptHatOnly should be very fast
194 
195  // Jet Info
196  math::XYZTLorentzVector p4jet[2];
197  float etajet[2];
200  evt.getByLabel(JetAlgorithm, jets);
201  typename JetCollection::const_iterator i_jet;
202  int index = 0;
203 
205  hname = "NumberOfJets";
206  nJets = jets->size();
207  FillHist1D(hname, nJets, 1.0);
208 
209  // Two Leading Jet Info
210  for (i_jet = jets->begin(); i_jet != jets->end() && index < 2; ++i_jet) {
211  hname = "JetPt";
212  FillHist1D(hname, i_jet->pt(), 1.0);
213  hname = "JetEta";
214  FillHist1D(hname, i_jet->eta(), 1.0);
215  hname = "JetPhi";
216  FillHist1D(hname, i_jet->phi(), 1.0);
217  p4jet[index] = i_jet->p4();
218  etajet[index] = i_jet->eta();
219  if (debug)
220  std::cout << "jet " << index + 1 << ": pt=" << i_jet->pt() << ", eta=" << etajet[index] << std::endl;
221  index++;
222  }
223 
224  // TTree variables //
225  etaJet1 = etajet[0];
226  etaJet2 = etajet[1];
227  ptJet1 = p4jet[0].pt();
228  ptJet2 = p4jet[1].pt();
229  diJetMass = (p4jet[0] + p4jet[1]).mass();
230 
232  if (index == 2 && abs(etaJet1) < 1.3 && abs(etaJet2) < 1.3) {
233  hname = "DijetMass";
234  FillHist1D(hname, diJetMass, 1.0);
235  hname = "DijetMassWt";
236  FillHist1D(hname, diJetMass, weight);
237  }
238 
240  if (index == 2 && abs(etaJet1) < 0.7 && abs(etaJet2) < 0.7) {
241  hname = "DijetMassIn";
242  FillHist1D(hname, diJetMass, 1.0);
243  hname = "DijetMassInWt";
244  FillHist1D(hname, diJetMass, weight);
245  }
247  if (index == 2 && (abs(etaJet1) > 0.7 && abs(etaJet1) < 1.3) && (abs(etaJet2) > 0.7 && abs(etaJet2) < 1.3)) {
248  hname = "DijetMassOut";
249  FillHist1D(hname, diJetMass, 1.0);
250  hname = "DijetMassOutWt";
251  FillHist1D(hname, diJetMass, weight);
252  }
253  if (anaLevel == "Jets")
254  break; //Jets level for samples without genParticles
255 
256  // Parton Info
257  edm::Handle<std::vector<reco::GenParticle> > genParticlesHandle_;
258  evt.getByLabel("genParticles", genParticlesHandle_);
259  if (debug)
260  for (size_t i = 0; i < genParticlesHandle_->size(); ++i) {
261  const reco::GenParticle& p = (*genParticlesHandle_)[i];
262  int id = p.pdgId();
263  int st = p.status();
264  const math::XYZTLorentzVector& genP4 = p.p4();
265  if (i >= 2 && i <= 8)
266  std::cout << "particle " << i << ": id=" << id << ", status=" << st << ", mass=" << genP4.mass()
267  << ", pt=" << genP4.pt() << ", eta=" << genP4.eta() << std::endl;
268  }
269  // Examine the 7th particle in pythia.
270  // It should be either a resonance (abs(id)>=32) or the first outgoing parton
271  // for the processes we will consider: dijet resonances, QCD, or QCD +contact interactions.
272  const reco::GenParticle& p = (*genParticlesHandle_)[6];
273  int id = p.pdgId();
274  math::XYZTLorentzVector resonance_p, parton1_p, parton2_p;
275  if (abs(id) >= 32) {
277  resonance_p = p.p4();
278  hname = "ResonanceMass";
279  FillHist1D(hname, resonance_p.mass(), 1.0);
280  const reco::GenParticle& q = (*genParticlesHandle_)[7];
281  parton1_p = q.p4();
282  const reco::GenParticle& r = (*genParticlesHandle_)[8];
283  parton2_p = r.p4();
284  if (debug)
285  std::cout << "Resonance mass=" << resonance_p.mass() << ", parton 1 pt=" << parton1_p.pt()
286  << ", parton 2 pt=" << parton2_p.pt() << ", diparton mass=" << (parton1_p + parton2_p).mass()
287  << std::endl;
288  } else {
290  parton1_p = p.p4();
291  const reco::GenParticle& q = (*genParticlesHandle_)[7];
292  parton2_p = q.p4();
293  if (debug)
294  std::cout << "parton 1 pt=" << parton1_p.pt() << ", parton 2 pt=" << parton2_p.pt()
295  << ", diparton mass=" << (parton1_p + parton2_p).mass() << std::endl;
296  }
297 
298  etaPart1 = parton1_p.eta();
299  etaPart2 = parton2_p.eta();
300  ptPart1 = parton1_p.pt();
301  ptPart2 = parton2_p.pt();
302  diPartMass = (parton1_p + parton2_p).mass();
304  if (abs(etaPart1) < 1.3 && abs(etaPart2) < 1.3) {
305  hname = "DipartonMass";
306  FillHist1D(hname, diPartMass, 1.0);
307  hname = "DipartonMassWt";
308  FillHist1D(hname, diPartMass, weight);
309  }
311  if (abs(etaPart1) < 0.7 && abs(etaPart2) < 0.7) {
312  hname = "DipartonMassIn";
313  FillHist1D(hname, diPartMass, 1.0);
314  hname = "DipartonMassInWt";
315  FillHist1D(hname, diPartMass, weight);
316  }
318  if ((abs(etaPart1) > 0.7 && abs(etaPart1) < 1.3) && (abs(etaPart2) > 0.7 && abs(etaPart2) < 1.3)) {
319  hname = "DipartonMassOut";
320  FillHist1D(hname, diPartMass, 1.0);
321  hname = "DipartonMassOutWt";
322  FillHist1D(hname, diPartMass, weight);
323  }
324 
325  // Fill the TTree //
326  mcTruthTree_->Fill();
327 
328  notDone = 0; //We are done, exit the while loop
329  } //end of while
330 }
std::vector< double > xsecGen
Definition: JetAnaPythia.h:60
float diJetMass
Definition: JetAnaPythia.h:37
void FillHist1D(const TString &histName, const Double_t &x, const Double_t &wt)
float etaPart2
Definition: JetAnaPythia.h:35
std::string JetAlgorithm
Definition: JetAnaPythia.h:42
Definition: weight.py:1
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
float etaPart1
Definition: JetAnaPythia.h:35
float diPartMass
Definition: JetAnaPythia.h:38
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
TTree * mcTruthTree_
Definition: JetAnaPythia.h:28
const HepMC::GenEvent * GetEvent() const
Definition: HepMCProduct.h:37
std::vector< double > ptHatEdges
Definition: JetAnaPythia.h:61
std::string anaLevel
Definition: JetAnaPythia.h:56

◆ beginJob()

template<class Jet >
void JetAnaPythia< Jet >::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 39 of file JetAnaPythia.cc.

References M_PI, and nJets.

39  {
40  TString hname;
41  m_file = new TFile(HistoFileName.c_str(), "RECREATE");
43  const int nMassBins = 103;
44  double massBoundaries[nMassBins + 1] = {
45  1, 3, 6, 10, 16, 23, 31, 40, 50, 61, 74, 88, 103, 119, 137,
46  156, 176, 197, 220, 244, 270, 296, 325, 354, 386, 419, 453, 489, 526, 565,
47  606, 649, 693, 740, 788, 838, 890, 944, 1000, 1058, 1118, 1181, 1246, 1313, 1383,
48  1455, 1530, 1607, 1687, 1770, 1856, 1945, 2037, 2132, 2231, 2332, 2438, 2546, 2659, 2775,
49  2895, 3019, 3147, 3279, 3416, 3558, 3704, 3854, 4010, 4171, 4337, 4509, 4686, 4869, 5058,
50  5253, 5455, 5663, 5877, 6099, 6328, 6564, 6808, 7060, 7320, 7589, 7866, 8152, 8447, 8752,
51  9067, 9391, 9726, 10072, 10430, 10798, 11179, 11571, 11977, 12395, 12827, 13272, 13732, 14000};
52 
53  hname = "JetPt";
54  m_HistNames1D[hname] = new TH1F(hname, hname, 500, 0, 5000);
55 
56  hname = "JetEta";
57  m_HistNames1D[hname] = new TH1F(hname, hname, 120, -6, 6);
58 
59  hname = "JetPhi";
60  m_HistNames1D[hname] = new TH1F(hname, hname, 100, -M_PI, M_PI);
61 
62  hname = "NumberOfJets";
63  m_HistNames1D[hname] = new TH1F(hname, hname, 100, 0, 100);
64 
65  hname = "DijetMass";
66  m_HistNames1D[hname] = new TH1F(hname, hname, nMassBins, massBoundaries);
67 
68  hname = "DijetMassWt";
69  m_HistNames1D[hname] = new TH1F(hname, hname, nMassBins, massBoundaries);
70  m_HistNames1D.find(hname)->second->Sumw2();
71 
72  hname = "DijetMassIn";
73  m_HistNames1D[hname] = new TH1F(hname, hname, nMassBins, massBoundaries);
74 
75  hname = "DijetMassInWt";
76  m_HistNames1D[hname] = new TH1F(hname, hname, nMassBins, massBoundaries);
77  m_HistNames1D.find(hname)->second->Sumw2();
78 
79  hname = "DijetMassOut";
80  m_HistNames1D[hname] = new TH1F(hname, hname, nMassBins, massBoundaries);
81 
82  hname = "DijetMassOutWt";
83  m_HistNames1D[hname] = new TH1F(hname, hname, nMassBins, massBoundaries);
84  m_HistNames1D.find(hname)->second->Sumw2();
85 
86  hname = "ResonanceMass";
87  m_HistNames1D[hname] = new TH1F(hname, hname, nMassBins, massBoundaries);
88 
89  hname = "DipartonMass";
90  m_HistNames1D[hname] = new TH1F(hname, hname, nMassBins, massBoundaries);
91 
92  hname = "DipartonMassWt";
93  m_HistNames1D[hname] = new TH1F(hname, hname, nMassBins, massBoundaries);
94  m_HistNames1D.find(hname)->second->Sumw2();
95 
96  hname = "DipartonMassIn";
97  m_HistNames1D[hname] = new TH1F(hname, hname, nMassBins, massBoundaries);
98 
99  hname = "DipartonMassInWt";
100  m_HistNames1D[hname] = new TH1F(hname, hname, nMassBins, massBoundaries);
101  m_HistNames1D.find(hname)->second->Sumw2();
102 
103  hname = "DipartonMassOut";
104  m_HistNames1D[hname] = new TH1F(hname, hname, nMassBins, massBoundaries);
105 
106  hname = "DipartonMassOutWt";
107  m_HistNames1D[hname] = new TH1F(hname, hname, nMassBins, massBoundaries);
108  m_HistNames1D.find(hname)->second->Sumw2();
109 
110  hname = "PtHat";
111  m_HistNames1D[hname] = new TH1F(hname, hname, 1000, 0, 5000);
112 
113  hname = "PtHatWt";
114  m_HistNames1D[hname] = new TH1F(hname, hname, 1000, 0, 5000);
115  m_HistNames1D.find(hname)->second->Sumw2();
116 
117  hname = "PtHatFine";
118  m_HistNames1D[hname] = new TH1F(hname, hname, 5000, 0, 5000);
119 
120  hname = "PtHatFineWt";
121  m_HistNames1D[hname] = new TH1F(hname, hname, 5000, 0, 5000);
122  m_HistNames1D.find(hname)->second->Sumw2();
123 
124  mcTruthTree_ = new TTree("mcTruthTree", "mcTruthTree");
125  mcTruthTree_->Branch("xsec", &xsec, "xsec/F");
126  mcTruthTree_->Branch("weight", &weight, "weight/F");
127  mcTruthTree_->Branch("pt_hat", &pt_hat, "pt_hat/F");
128  mcTruthTree_->Branch("nJets", &nJets, "nJets/I");
129  mcTruthTree_->Branch("etaJet1", &etaJet1, "etaJet1/F");
130  mcTruthTree_->Branch("etaJet2", &etaJet2, "etaJet2/F");
131  mcTruthTree_->Branch("ptJet1", &ptJet1, "ptJet1/F");
132  mcTruthTree_->Branch("ptJet2", &ptJet2, "ptJet2/F");
133  mcTruthTree_->Branch("diJetMass", &diJetMass, "diJetMass/F");
134  mcTruthTree_->Branch("etaPart1", &etaPart1, "etaPart1/F");
135  mcTruthTree_->Branch("etaPart2", &etaPart2, "etaPart2/F");
136  mcTruthTree_->Branch("ptPart1", &ptPart1, "ptPart1/F");
137  mcTruthTree_->Branch("ptPart2", &ptPart2, "ptPart2/F");
138  mcTruthTree_->Branch("diPartMass", &diPartMass, "diPartMass/F");
139 }
float diJetMass
Definition: JetAnaPythia.h:37
float etaPart2
Definition: JetAnaPythia.h:35
std::string HistoFileName
Definition: JetAnaPythia.h:44
Definition: weight.py:1
float etaPart1
Definition: JetAnaPythia.h:35
std::map< TString, TH1 * > m_HistNames1D
Definition: JetAnaPythia.h:26
TFile * m_file
Definition: JetAnaPythia.h:39
float diPartMass
Definition: JetAnaPythia.h:38
TTree * mcTruthTree_
Definition: JetAnaPythia.h:28
#define M_PI

◆ endJob()

template<class Jet >
void JetAnaPythia< Jet >::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 333 of file JetAnaPythia.cc.

333  {
335  if (m_file != nullptr) {
336  m_file->cd();
337  mcTruthTree_->Write();
338  for (std::map<TString, TH1*>::iterator hid = m_HistNames1D.begin(); hid != m_HistNames1D.end(); hid++)
339  hid->second->Write();
340  delete m_file;
341  m_file = nullptr;
342  }
343 }
std::map< TString, TH1 * > m_HistNames1D
Definition: JetAnaPythia.h:26
TFile * m_file
Definition: JetAnaPythia.h:39
TTree * mcTruthTree_
Definition: JetAnaPythia.h:28

◆ FillHist1D()

template<class Jet >
void JetAnaPythia< Jet >::FillHist1D ( const TString &  histName,
const Double_t &  x,
const Double_t &  wt 
)
private

Definition at line 346 of file JetAnaPythia.cc.

References gather_cfg::cout.

346  {
347  std::map<TString, TH1*>::iterator hid = m_HistNames1D.find(histName);
348  if (hid == m_HistNames1D.end())
349  std::cout << "%fillHist -- Could not find histogram with name: " << histName << std::endl;
350  else
351  hid->second->Fill(value, wt);
352 }
std::map< TString, TH1 * > m_HistNames1D
Definition: JetAnaPythia.h:26
Definition: value.py:1

Member Data Documentation

◆ anaLevel

template<class Jet >
std::string JetAnaPythia< Jet >::anaLevel
private

Analysis level string. Can speed up job by looking at less /// PtHatOnly: only get PtHat and make PtHat histos Jets: do histogram analysis of jets, but not partons all: do analysis of everything and make histos and root tree generating: analysis of everything, make histos and root tree

Definition at line 56 of file JetAnaPythia.h.

◆ debug

template<class Jet >
bool JetAnaPythia< Jet >::debug
private

◆ diJetMass

template<class Jet >
float JetAnaPythia< Jet >::diJetMass
private

Definition at line 37 of file JetAnaPythia.h.

◆ diPartMass

template<class Jet >
float JetAnaPythia< Jet >::diPartMass
private

Definition at line 38 of file JetAnaPythia.h.

◆ etaJet1

template<class Jet >
float JetAnaPythia< Jet >::etaJet1
private

Definition at line 33 of file JetAnaPythia.h.

◆ etaJet2

template<class Jet >
float JetAnaPythia< Jet >::etaJet2
private

Definition at line 33 of file JetAnaPythia.h.

◆ etaPart1

template<class Jet >
float JetAnaPythia< Jet >::etaPart1
private

Definition at line 35 of file JetAnaPythia.h.

◆ etaPart2

template<class Jet >
float JetAnaPythia< Jet >::etaPart2
private

Definition at line 35 of file JetAnaPythia.h.

◆ eventsGen

template<class Jet >
int JetAnaPythia< Jet >::eventsGen
private

Definition at line 50 of file JetAnaPythia.h.

◆ HistoFileName

template<class Jet >
std::string JetAnaPythia< Jet >::HistoFileName
private

Definition at line 44 of file JetAnaPythia.h.

◆ JetAlgorithm

template<class Jet >
std::string JetAnaPythia< Jet >::JetAlgorithm
private

Definition at line 42 of file JetAnaPythia.h.

◆ m_file

template<class Jet >
TFile* JetAnaPythia< Jet >::m_file
private

Definition at line 39 of file JetAnaPythia.h.

◆ m_HistNames1D

template<class Jet >
std::map<TString, TH1*> JetAnaPythia< Jet >::m_HistNames1D
private

Definition at line 26 of file JetAnaPythia.h.

◆ mcTruthTree_

template<class Jet >
TTree* JetAnaPythia< Jet >::mcTruthTree_
private

Definition at line 28 of file JetAnaPythia.h.

◆ nJets

template<class Jet >
int JetAnaPythia< Jet >::nJets
private

Definition at line 32 of file JetAnaPythia.h.

◆ NJets

template<class Jet >
int JetAnaPythia< Jet >::NJets
private

Definition at line 46 of file JetAnaPythia.h.

◆ pt_hat

template<class Jet >
float JetAnaPythia< Jet >::pt_hat
private

Definition at line 31 of file JetAnaPythia.h.

◆ ptHatEdges

template<class Jet >
std::vector<double> JetAnaPythia< Jet >::ptHatEdges
private

Definition at line 61 of file JetAnaPythia.h.

◆ ptJet1

template<class Jet >
float JetAnaPythia< Jet >::ptJet1
private

Definition at line 34 of file JetAnaPythia.h.

◆ ptJet2

template<class Jet >
float JetAnaPythia< Jet >::ptJet2
private

Definition at line 34 of file JetAnaPythia.h.

◆ ptPart1

template<class Jet >
float JetAnaPythia< Jet >::ptPart1
private

Definition at line 36 of file JetAnaPythia.h.

◆ ptPart2

template<class Jet >
float JetAnaPythia< Jet >::ptPart2
private

Definition at line 36 of file JetAnaPythia.h.

◆ weight

template<class Jet >
float JetAnaPythia< Jet >::weight
private

◆ xsec

template<class Jet >
float JetAnaPythia< Jet >::xsec
private

Definition at line 29 of file JetAnaPythia.h.

◆ xsecGen

template<class Jet >
std::vector<double> JetAnaPythia< Jet >::xsecGen
private

Generator cross section Only 1 entry in case analysis level is "generating" //// Multiple entries when analyzing ///

Definition at line 60 of file JetAnaPythia.h.