CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
CMSDAS11DijetTestAnalyzer Class Reference

#include <CMSDAS11DijetTestAnalyzer.h>

Inheritance diagram for CMSDAS11DijetTestAnalyzer:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginJob ()
 
 CMSDAS11DijetTestAnalyzer (const edm::ParameterSet &)
 
virtual void endJob (void)
 
virtual ~CMSDAS11DijetTestAnalyzer ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
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 & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, 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
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static bool compare_JetPt (const reco::CaloJet &jet1, const reco::CaloJet &jet2)
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 

Private Attributes

TH1D * hCorDijetMass
 
TH1D * hCorDijetXsec
 
TH1D * hDijetDeltaEta
 
TH1D * hDijetDeltaPhi
 
TH2D * hDijetDeltaPhiNJets
 
TH2D * hDijetEta1Eta2
 
TH1D * hInnerDijetMass
 
TH1D * hJet1EMF
 
TH1D * hJet1Eta
 
TH1D * hJet1Phi
 
TH1D * hJet1Pt
 
TH1D * hJet2EMF
 
TH1D * hJet2Eta
 
TH1D * hJet2Phi
 
TH1D * hJet2Pt
 
TH1D * hJetCorrPt
 
TH1D * hJetEMF
 
TH1D * hJetEta
 
TH1D * hJetPhi
 
TH1D * hJetRawPt
 
TH1D * hOuterDijetMass
 
TH1D * hRawDijetMass
 
TH1D * hVertexZ
 
double innerDeltaEta
 
double JESbias
 
std::string jetCorrections
 
edm::InputTag jetSrc
 
double outerDeltaEta
 
edm::InputTag vertexSrc
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
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 ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
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)
 

Detailed Description

Definition at line 20 of file CMSDAS11DijetTestAnalyzer.h.

Constructor & Destructor Documentation

CMSDAS11DijetTestAnalyzer::CMSDAS11DijetTestAnalyzer ( const edm::ParameterSet params)

Definition at line 22 of file CMSDAS11DijetTestAnalyzer.cc.

References fs, hCorDijetMass, hDijetDeltaEta, hDijetDeltaPhi, hDijetDeltaPhiNJets, hDijetEta1Eta2, hInnerDijetMass, hJet1EMF, hJet1Eta, hJet1Phi, hJet1Pt, hJet2EMF, hJet2Eta, hJet2Phi, hJet2Pt, hJetCorrPt, hJetEMF, hJetEta, hJetPhi, hJetRawPt, hOuterDijetMass, hVertexZ, TFileService::make(), and NBINS.

22  :
24  jetSrc(params.getParameter<edm::InputTag>("jetSrc")),
25  vertexSrc(params.getParameter<edm::InputTag>("vertexSrc")),
26  jetCorrections(params.getParameter<std::string>("jetCorrections")),
27  innerDeltaEta(params.getParameter<double>("innerDeltaEta")),
28  outerDeltaEta(params.getParameter<double>("outerDeltaEta")),
29  JESbias(params.getParameter<double>("JESbias"))
30 {
31  // setup file service
33 
34  const int NBINS=36;
35  Double_t BOUNDARIES[NBINS] = { 220, 244, 270, 296, 325, 354, 386, 419, 453,
36  489, 526, 565, 606, 649, 693, 740, 788, 838,
37  890, 944, 1000, 1058, 1118, 1181, 1246, 1313, 1383,
38  1455, 1530, 1607, 1687, 1770, 1856, 1945, 2037, 2132 };
39 
40  // setup histograms
41  hVertexZ = fs->make<TH1D>("hVertexZ", "Z position of the Vertex",50,-20,20);
42  hJetRawPt = fs->make<TH1D>("hJetRawPt","Raw Jet Pt",50,0,1000);
43  hJetCorrPt = fs->make<TH1D>("hJetCorrPt","Corrected Jet Pt",50,0,1000);
44  hJet1Pt = fs->make<TH1D>("hJet1Pt","Corrected Jet1 Pt",50,0,1000);
45  hJet2Pt = fs->make<TH1D>("hJet2Pt","Corrected Jet2 Pt",50,0,1000);
46 
47  hJetEta = fs->make<TH1D>("hJetEta","Corrected Jet Eta", 50,-5,5);
48  hJet1Eta = fs->make<TH1D>("hJet1Eta","Corrected Jet1 Eta",50,-5,5);
49  hJet2Eta = fs->make<TH1D>("hJet2Eta","Corrected Jet2 Eta",50,-5,5);
50 
51  hJetPhi = fs->make<TH1D>("hJetPhi","Corrected Jet Phi", 50,-3.1415,3.1415);
52  hJet1Phi = fs->make<TH1D>("hJet1Phi","Corrected Jet1 Phi",50,-3.1415,3.1415);
53  hJet2Phi = fs->make<TH1D>("hJet2Phi","Corrected Jet2 Phi",50,-3.1415,3.1415);
54 
55  hJetEMF = fs->make<TH1D>("hJetEMF","EM Fraction of Jets",50,0,1);
56  hJet1EMF = fs->make<TH1D>("hJet1EMF","EM Fraction of Jet1",50,0,1);
57  hJet2EMF = fs->make<TH1D>("hJet2EMF","EM Fraction of Jet2",50,0,1);
58 
59  hCorDijetMass = fs->make<TH1D>("hCorDijetMass","Corrected Dijet Mass",NBINS-1,BOUNDARIES);
60  hDijetDeltaPhi= fs->make<TH1D>("hDijetDeltaPhi","Dijet |#Delta #phi|",50,0,3.1415);
61  hDijetDeltaEta= fs->make<TH1D>("hDijetDeltaEta","Dijet |#Delta #eta|",50,0,1.3);
62  hDijetDeltaPhiNJets= fs->make<TH2D>("hDijetDeltaPhiNJets","Dijet |#Delta #phi| v. the number of jets",50,0,3.1415,7,0.5,7.5);
63  hDijetEta1Eta2=fs->make<TH2D>("hDijetEta1Eta2","Eta 1 versus Eta 2 of dijet events",50,-5,5,50,-5,5);
64 
65  hInnerDijetMass = fs->make<TH1D>("hInnerDijetMass","Corrected Inner Dijet Mass",NBINS-1,BOUNDARIES);
66  hOuterDijetMass = fs->make<TH1D>("hOuterDijetMass","Corrected Outer Dijet Mass",NBINS-1,BOUNDARIES);
67 }
T getParameter(std::string const &) const
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
const int NBINS
edm::Service< TFileService > fs
virtual CMSDAS11DijetTestAnalyzer::~CMSDAS11DijetTestAnalyzer ( )
inlinevirtual

Definition at line 24 of file CMSDAS11DijetTestAnalyzer.h.

24 {}

Member Function Documentation

void CMSDAS11DijetTestAnalyzer::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Implements edm::EDAnalyzer.

Definition at line 72 of file CMSDAS11DijetTestAnalyzer.cc.

References mvaPFMET_cff::corrector, gather_cfg::cout, edm::Event::getByLabel(), JetCorrector::getJetCorrector(), hVertexZ, edm::HandleBase::isValid(), metsig::jet, jetCorrections, jetSrc, reco::Vertex::ndof(), reco::Vertex::position(), patRefSel_refMuJets_cfi::selectedJets, JetCorrector::vectorialCorrection(), vertexSrc, and reco::Vertex::z().

73 {
75  double mWeight;
77  iEvent.getByLabel("generator", hEventInfo);
78  if (hEventInfo.isValid()) {
79  mWeight = hEventInfo->weight();
80  }
81  else
82  mWeight = 1.;
83 
85  // Get event ID information
87  //int nrun=iEvent.id().run();
88  //int nlumi=iEvent.luminosityBlock();
89  //int nevent=iEvent.id().event();
90 
92  // Get Primary Vertex Information
94 
95  // magic to get the vertices from EDM
97  iEvent.getByLabel(vertexSrc, vertices_h);
98  if (!vertices_h.isValid()) {
99  std::cout<<"Didja hear the one about the empty vertex collection?\n";
100  return;
101  }
102 
103  // require in the event that there is at least one reconstructed vertex
104  if(vertices_h->size()<=0) return;
105 
106  // pick the first (i.e. highest sum pt) verte
107  const reco::Vertex* theVertex=&(vertices_h->front());
108 
109  // require that the vertex meets certain criteria
110  if(theVertex->ndof()<5) return;
111  if(fabs(theVertex->z())>24.0) return;
112  if(fabs(theVertex->position().rho())>2.0) return;
113 
115  // Get Jet Information
117 
118  // magic to get the jets from EDM
120  iEvent.getByLabel(jetSrc, jets_h);
121  if (!jets_h.isValid()) {
122  std::cout<<"Didja hear the one about the empty jet collection?\n";
123  return;
124  }
125 
126  // magic to get the jet energy corrections
128  corrector->vectorialCorrection();
129  // collection of selected jets
130  std::vector<reco::CaloJet> selectedJets;
131 
132  // loop over the jet collection
133  for(reco::CaloJetCollection::const_iterator j_it = jets_h->begin(); j_it!=jets_h->end(); j_it++) {
134  reco::CaloJet jet = *j_it;
135 
136  // put the selected jets into a collection
137  selectedJets.push_back(jet);
138  }
139 
140  hVertexZ->Fill(theVertex->z(), mWeight);
141  return;
142 }
Jets made from CaloTowers.
Definition: CaloJet.h:29
const Point & position() const
position
Definition: Vertex.h:109
tuple corrector
Definition: mvaPFMET_cff.py:86
double z() const
z coordinate
Definition: Vertex.h:115
bool isValid() const
Definition: HandleBase.h:75
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:413
double ndof() const
Definition: Vertex.h:105
virtual bool vectorialCorrection() const
if vectorial correction is provided
Definition: JetCorrector.h:66
static const JetCorrector * getJetCorrector(const std::string &fName, const edm::EventSetup &fSetup)
retrieve corrector from the event setup. troughs exception if something is missing ...
Definition: JetCorrector.cc:50
tuple cout
Definition: gather_cfg.py:145
virtual void CMSDAS11DijetTestAnalyzer::beginJob ( void  )
inlinevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 25 of file CMSDAS11DijetTestAnalyzer.h.

25 {}
static bool CMSDAS11DijetTestAnalyzer::compare_JetPt ( const reco::CaloJet jet1,
const reco::CaloJet jet2 
)
inlinestatic

Definition at line 28 of file CMSDAS11DijetTestAnalyzer.h.

References reco::LeafCandidate::pt().

28  {
29  return (jet1.pt() > jet2.pt() );
30  }
virtual double pt() const final
transverse momentum
void CMSDAS11DijetTestAnalyzer::endJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 69 of file CMSDAS11DijetTestAnalyzer.cc.

69  {
70 }

Member Data Documentation

TH1D* CMSDAS11DijetTestAnalyzer::hCorDijetMass
private

Definition at line 50 of file CMSDAS11DijetTestAnalyzer.h.

Referenced by CMSDAS11DijetTestAnalyzer().

TH1D* CMSDAS11DijetTestAnalyzer::hCorDijetXsec
private

Definition at line 51 of file CMSDAS11DijetTestAnalyzer.h.

TH1D* CMSDAS11DijetTestAnalyzer::hDijetDeltaEta
private

Definition at line 61 of file CMSDAS11DijetTestAnalyzer.h.

Referenced by CMSDAS11DijetTestAnalyzer().

TH1D* CMSDAS11DijetTestAnalyzer::hDijetDeltaPhi
private

Definition at line 60 of file CMSDAS11DijetTestAnalyzer.h.

Referenced by CMSDAS11DijetTestAnalyzer().

TH2D* CMSDAS11DijetTestAnalyzer::hDijetDeltaPhiNJets
private

Definition at line 62 of file CMSDAS11DijetTestAnalyzer.h.

Referenced by CMSDAS11DijetTestAnalyzer().

TH2D* CMSDAS11DijetTestAnalyzer::hDijetEta1Eta2
private

Definition at line 63 of file CMSDAS11DijetTestAnalyzer.h.

Referenced by CMSDAS11DijetTestAnalyzer().

TH1D* CMSDAS11DijetTestAnalyzer::hInnerDijetMass
private

Definition at line 65 of file CMSDAS11DijetTestAnalyzer.h.

Referenced by CMSDAS11DijetTestAnalyzer().

TH1D* CMSDAS11DijetTestAnalyzer::hJet1EMF
private

Definition at line 55 of file CMSDAS11DijetTestAnalyzer.h.

Referenced by CMSDAS11DijetTestAnalyzer().

TH1D* CMSDAS11DijetTestAnalyzer::hJet1Eta
private

Definition at line 53 of file CMSDAS11DijetTestAnalyzer.h.

Referenced by CMSDAS11DijetTestAnalyzer().

TH1D* CMSDAS11DijetTestAnalyzer::hJet1Phi
private

Definition at line 54 of file CMSDAS11DijetTestAnalyzer.h.

Referenced by CMSDAS11DijetTestAnalyzer().

TH1D* CMSDAS11DijetTestAnalyzer::hJet1Pt
private

Definition at line 52 of file CMSDAS11DijetTestAnalyzer.h.

Referenced by CMSDAS11DijetTestAnalyzer().

TH1D* CMSDAS11DijetTestAnalyzer::hJet2EMF
private

Definition at line 59 of file CMSDAS11DijetTestAnalyzer.h.

Referenced by CMSDAS11DijetTestAnalyzer().

TH1D* CMSDAS11DijetTestAnalyzer::hJet2Eta
private

Definition at line 57 of file CMSDAS11DijetTestAnalyzer.h.

Referenced by CMSDAS11DijetTestAnalyzer().

TH1D* CMSDAS11DijetTestAnalyzer::hJet2Phi
private

Definition at line 58 of file CMSDAS11DijetTestAnalyzer.h.

Referenced by CMSDAS11DijetTestAnalyzer().

TH1D* CMSDAS11DijetTestAnalyzer::hJet2Pt
private

Definition at line 56 of file CMSDAS11DijetTestAnalyzer.h.

Referenced by CMSDAS11DijetTestAnalyzer().

TH1D* CMSDAS11DijetTestAnalyzer::hJetCorrPt
private

Definition at line 43 of file CMSDAS11DijetTestAnalyzer.h.

Referenced by CMSDAS11DijetTestAnalyzer().

TH1D* CMSDAS11DijetTestAnalyzer::hJetEMF
private

Definition at line 47 of file CMSDAS11DijetTestAnalyzer.h.

Referenced by CMSDAS11DijetTestAnalyzer().

TH1D* CMSDAS11DijetTestAnalyzer::hJetEta
private

Definition at line 45 of file CMSDAS11DijetTestAnalyzer.h.

Referenced by CMSDAS11DijetTestAnalyzer().

TH1D* CMSDAS11DijetTestAnalyzer::hJetPhi
private

Definition at line 46 of file CMSDAS11DijetTestAnalyzer.h.

Referenced by CMSDAS11DijetTestAnalyzer().

TH1D* CMSDAS11DijetTestAnalyzer::hJetRawPt
private

Definition at line 44 of file CMSDAS11DijetTestAnalyzer.h.

Referenced by CMSDAS11DijetTestAnalyzer().

TH1D* CMSDAS11DijetTestAnalyzer::hOuterDijetMass
private

Definition at line 66 of file CMSDAS11DijetTestAnalyzer.h.

Referenced by CMSDAS11DijetTestAnalyzer().

TH1D* CMSDAS11DijetTestAnalyzer::hRawDijetMass
private

Definition at line 49 of file CMSDAS11DijetTestAnalyzer.h.

TH1D* CMSDAS11DijetTestAnalyzer::hVertexZ
private

Definition at line 42 of file CMSDAS11DijetTestAnalyzer.h.

Referenced by analyze(), and CMSDAS11DijetTestAnalyzer().

double CMSDAS11DijetTestAnalyzer::innerDeltaEta
private

Definition at line 37 of file CMSDAS11DijetTestAnalyzer.h.

double CMSDAS11DijetTestAnalyzer::JESbias
private

Definition at line 39 of file CMSDAS11DijetTestAnalyzer.h.

std::string CMSDAS11DijetTestAnalyzer::jetCorrections
private

Definition at line 36 of file CMSDAS11DijetTestAnalyzer.h.

Referenced by analyze().

edm::InputTag CMSDAS11DijetTestAnalyzer::jetSrc
private

Definition at line 34 of file CMSDAS11DijetTestAnalyzer.h.

Referenced by analyze().

double CMSDAS11DijetTestAnalyzer::outerDeltaEta
private

Definition at line 38 of file CMSDAS11DijetTestAnalyzer.h.

edm::InputTag CMSDAS11DijetTestAnalyzer::vertexSrc
private

Definition at line 35 of file CMSDAS11DijetTestAnalyzer.h.

Referenced by analyze().