Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:25:26

0001 // Template class: JetAnaPythia
0002 // Description:  Example of simple analyzer for jets produced by Pythia
0003 // Author: R. Harris
0004 // Date:  28 - October - 2008
0005 #ifndef JetAnaPythia_h
0006 #define JetAnaPythia_h
0007 #include <TTree.h>
0008 #include <TH1.h>
0009 #include <TFile.h>
0010 #include "TNamed.h"
0011 #include <vector>
0012 #include <map>
0013 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0014 
0015 template <class Jet>
0016 class JetAnaPythia : public edm::one::EDAnalyzer<> {
0017 public:
0018   JetAnaPythia(edm::ParameterSet const& cfg);
0019 
0020 private:
0021   typedef std::vector<Jet> JetCollection;
0022   void FillHist1D(const TString& histName, const Double_t& x, const Double_t& wt);
0023   void beginJob() override;
0024   void analyze(edm::Event const& e, edm::EventSetup const& iSetup) override;
0025   void endJob() override;
0026   std::map<TString, TH1*> m_HistNames1D;
0027   //// TTree variables //////
0028   TTree* mcTruthTree_;
0029   float xsec;
0030   float weight;
0031   float pt_hat;
0032   int nJets;
0033   float etaJet1, etaJet2;
0034   float ptJet1, ptJet2;
0035   float etaPart1, etaPart2;
0036   float ptPart1, ptPart2;
0037   float diJetMass;
0038   float diPartMass;
0039   TFile* m_file;
0040   /////// Configurable parameters /////////////////////////////////////
0041   /////// Jet algorithm: it can be any Calo, Gen or PF algorithm //////
0042   std::string JetAlgorithm;
0043   /////// Histogram where the plots are stored ////////////////////////
0044   std::string HistoFileName;
0045   /////// Number of jets used for the plots ///////////////////////////
0046   int NJets;
0047   /////   Debug printout //////////////////
0048   bool debug;
0049   /////  Number used to calculate weight: total events gen in pthat bin ///
0050   int eventsGen;
0051   ////   Analysis level string.  Can speed up job by looking at less  ///
0052   ///    PtHatOnly: only get PtHat and make PtHat histos
0053   ///    Jets:  do histogram analysis of jets, but not partons
0054   ///    all:   do analysis of everything and make histos and root tree
0055   ///    generating: analysis of everything, make histos and root tree
0056   std::string anaLevel;
0057   /// Generator cross section
0058   ///            Only 1 entry in case analysis level is "generating" ////
0059   ///            Multiple entries when analyzing ///
0060   std::vector<double> xsecGen;
0061   std::vector<double> ptHatEdges;
0062 };
0063 #endif