CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
CMSDAS11DijetTestAnalyzer Class Reference

#include <CMSDAS11DijetTestAnalyzer.h>

Inheritance diagram for CMSDAS11DijetTestAnalyzer:
edm::one::EDAnalyzer< edm::one::SharedResources > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void beginJob () override
 
 CMSDAS11DijetTestAnalyzer (const edm::ParameterSet &)
 
void endJob (void) override
 
 ~CMSDAS11DijetTestAnalyzer () override
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::SharedResources >
 EDAnalyzer ()=default
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const 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
 
bool wantsStreamRuns () const
 
 ~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
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > 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
 
bool registeredToConsumeMany (TypeID const &, 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::ESRecordsToProxyIndices const &)
 
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::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

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::one::EDAnalyzerBase
typedef EDAnalyzerBase 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)
 
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 ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
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

Definition at line 20 of file CMSDAS11DijetTestAnalyzer.h.

Constructor & Destructor Documentation

◆ CMSDAS11DijetTestAnalyzer()

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

Definition at line 22 of file CMSDAS11DijetTestAnalyzer.cc.

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

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

◆ ~CMSDAS11DijetTestAnalyzer()

CMSDAS11DijetTestAnalyzer::~CMSDAS11DijetTestAnalyzer ( )
inlineoverride

Definition at line 24 of file CMSDAS11DijetTestAnalyzer.h.

24 {}

Member Function Documentation

◆ analyze()

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

Implements edm::one::EDAnalyzerBase.

Definition at line 70 of file CMSDAS11DijetTestAnalyzer.cc.

References pfClustersFromHGC3DClusters_cfi::corrector, gather_cfg::cout, JetCorrector::getJetCorrector(), hVertexZ, iEvent, edm::HandleBase::isValid(), metsig::jet, jetCorrections, jetSrc, reco::Vertex::ndof(), reco::Vertex::position(), objectSelection_cff::selectedJets, vertexSrc, GenEventInfoProduct::weight(), and reco::Vertex::z().

70  {
72  double mWeight;
74  iEvent.getByLabel("generator", hEventInfo);
75  if (hEventInfo.isValid()) {
76  mWeight = hEventInfo->weight();
77  } else
78  mWeight = 1.;
79 
81  // Get event ID information
83  //int nrun=iEvent.id().run();
84  //int nlumi=iEvent.luminosityBlock();
85  //int nevent=iEvent.id().event();
86 
88  // Get Primary Vertex Information
90 
91  // magic to get the vertices from EDM
93  iEvent.getByLabel(vertexSrc, vertices_h);
94  if (!vertices_h.isValid()) {
95  std::cout << "Didja hear the one about the empty vertex collection?\n";
96  return;
97  }
98 
99  // require in the event that there is at least one reconstructed vertex
100  if (vertices_h->empty())
101  return;
102 
103  // pick the first (i.e. highest sum pt) verte
104  const reco::Vertex* theVertex = &(vertices_h->front());
105 
106  // require that the vertex meets certain criteria
107  if (theVertex->ndof() < 5)
108  return;
109  if (fabs(theVertex->z()) > 24.0)
110  return;
111  if (fabs(theVertex->position().rho()) > 2.0)
112  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:27
double z() const
z coordinate
Definition: Vertex.h:133
const Point & position() const
position
Definition: Vertex.h:127
double ndof() const
Definition: Vertex.h:123
int iEvent
Definition: GenABIO.cc:224
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:48
bool isValid() const
Definition: HandleBase.h:70

◆ beginJob()

void CMSDAS11DijetTestAnalyzer::beginJob ( void  )
inlineoverridevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 25 of file CMSDAS11DijetTestAnalyzer.h.

25 {}

◆ compare_JetPt()

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 { return (jet1.pt() > jet2.pt()); }
double pt() const final
transverse momentum

◆ endJob()

void CMSDAS11DijetTestAnalyzer::endJob ( void  )
overridevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 68 of file CMSDAS11DijetTestAnalyzer.cc.

68 {}

Member Data Documentation

◆ hCorDijetMass

TH1D* CMSDAS11DijetTestAnalyzer::hCorDijetMass
private

Definition at line 48 of file CMSDAS11DijetTestAnalyzer.h.

Referenced by CMSDAS11DijetTestAnalyzer().

◆ hCorDijetXsec

TH1D* CMSDAS11DijetTestAnalyzer::hCorDijetXsec
private

Definition at line 49 of file CMSDAS11DijetTestAnalyzer.h.

◆ hDijetDeltaEta

TH1D* CMSDAS11DijetTestAnalyzer::hDijetDeltaEta
private

Definition at line 59 of file CMSDAS11DijetTestAnalyzer.h.

Referenced by CMSDAS11DijetTestAnalyzer().

◆ hDijetDeltaPhi

TH1D* CMSDAS11DijetTestAnalyzer::hDijetDeltaPhi
private

Definition at line 58 of file CMSDAS11DijetTestAnalyzer.h.

Referenced by CMSDAS11DijetTestAnalyzer().

◆ hDijetDeltaPhiNJets

TH2D* CMSDAS11DijetTestAnalyzer::hDijetDeltaPhiNJets
private

Definition at line 60 of file CMSDAS11DijetTestAnalyzer.h.

Referenced by CMSDAS11DijetTestAnalyzer().

◆ hDijetEta1Eta2

TH2D* CMSDAS11DijetTestAnalyzer::hDijetEta1Eta2
private

Definition at line 61 of file CMSDAS11DijetTestAnalyzer.h.

Referenced by CMSDAS11DijetTestAnalyzer().

◆ hInnerDijetMass

TH1D* CMSDAS11DijetTestAnalyzer::hInnerDijetMass
private

Definition at line 63 of file CMSDAS11DijetTestAnalyzer.h.

Referenced by CMSDAS11DijetTestAnalyzer().

◆ hJet1EMF

TH1D* CMSDAS11DijetTestAnalyzer::hJet1EMF
private

Definition at line 53 of file CMSDAS11DijetTestAnalyzer.h.

Referenced by CMSDAS11DijetTestAnalyzer().

◆ hJet1Eta

TH1D* CMSDAS11DijetTestAnalyzer::hJet1Eta
private

Definition at line 51 of file CMSDAS11DijetTestAnalyzer.h.

Referenced by CMSDAS11DijetTestAnalyzer().

◆ hJet1Phi

TH1D* CMSDAS11DijetTestAnalyzer::hJet1Phi
private

Definition at line 52 of file CMSDAS11DijetTestAnalyzer.h.

Referenced by CMSDAS11DijetTestAnalyzer().

◆ hJet1Pt

TH1D* CMSDAS11DijetTestAnalyzer::hJet1Pt
private

Definition at line 50 of file CMSDAS11DijetTestAnalyzer.h.

Referenced by CMSDAS11DijetTestAnalyzer().

◆ hJet2EMF

TH1D* CMSDAS11DijetTestAnalyzer::hJet2EMF
private

Definition at line 57 of file CMSDAS11DijetTestAnalyzer.h.

Referenced by CMSDAS11DijetTestAnalyzer().

◆ hJet2Eta

TH1D* CMSDAS11DijetTestAnalyzer::hJet2Eta
private

Definition at line 55 of file CMSDAS11DijetTestAnalyzer.h.

Referenced by CMSDAS11DijetTestAnalyzer().

◆ hJet2Phi

TH1D* CMSDAS11DijetTestAnalyzer::hJet2Phi
private

Definition at line 56 of file CMSDAS11DijetTestAnalyzer.h.

Referenced by CMSDAS11DijetTestAnalyzer().

◆ hJet2Pt

TH1D* CMSDAS11DijetTestAnalyzer::hJet2Pt
private

Definition at line 54 of file CMSDAS11DijetTestAnalyzer.h.

Referenced by CMSDAS11DijetTestAnalyzer().

◆ hJetCorrPt

TH1D* CMSDAS11DijetTestAnalyzer::hJetCorrPt
private

Definition at line 41 of file CMSDAS11DijetTestAnalyzer.h.

Referenced by CMSDAS11DijetTestAnalyzer().

◆ hJetEMF

TH1D* CMSDAS11DijetTestAnalyzer::hJetEMF
private

Definition at line 45 of file CMSDAS11DijetTestAnalyzer.h.

Referenced by CMSDAS11DijetTestAnalyzer().

◆ hJetEta

TH1D* CMSDAS11DijetTestAnalyzer::hJetEta
private

Definition at line 43 of file CMSDAS11DijetTestAnalyzer.h.

Referenced by CMSDAS11DijetTestAnalyzer().

◆ hJetPhi

TH1D* CMSDAS11DijetTestAnalyzer::hJetPhi
private

Definition at line 44 of file CMSDAS11DijetTestAnalyzer.h.

Referenced by CMSDAS11DijetTestAnalyzer().

◆ hJetRawPt

TH1D* CMSDAS11DijetTestAnalyzer::hJetRawPt
private

Definition at line 42 of file CMSDAS11DijetTestAnalyzer.h.

Referenced by CMSDAS11DijetTestAnalyzer().

◆ hOuterDijetMass

TH1D* CMSDAS11DijetTestAnalyzer::hOuterDijetMass
private

Definition at line 64 of file CMSDAS11DijetTestAnalyzer.h.

Referenced by CMSDAS11DijetTestAnalyzer().

◆ hRawDijetMass

TH1D* CMSDAS11DijetTestAnalyzer::hRawDijetMass
private

Definition at line 47 of file CMSDAS11DijetTestAnalyzer.h.

◆ hVertexZ

TH1D* CMSDAS11DijetTestAnalyzer::hVertexZ
private

Definition at line 40 of file CMSDAS11DijetTestAnalyzer.h.

Referenced by analyze(), and CMSDAS11DijetTestAnalyzer().

◆ innerDeltaEta

double CMSDAS11DijetTestAnalyzer::innerDeltaEta
private

Definition at line 35 of file CMSDAS11DijetTestAnalyzer.h.

◆ JESbias

double CMSDAS11DijetTestAnalyzer::JESbias
private

Definition at line 37 of file CMSDAS11DijetTestAnalyzer.h.

◆ jetCorrections

std::string CMSDAS11DijetTestAnalyzer::jetCorrections
private

Definition at line 34 of file CMSDAS11DijetTestAnalyzer.h.

Referenced by analyze().

◆ jetSrc

edm::InputTag CMSDAS11DijetTestAnalyzer::jetSrc
private

Definition at line 32 of file CMSDAS11DijetTestAnalyzer.h.

Referenced by analyze().

◆ outerDeltaEta

double CMSDAS11DijetTestAnalyzer::outerDeltaEta
private

Definition at line 36 of file CMSDAS11DijetTestAnalyzer.h.

◆ vertexSrc

edm::InputTag CMSDAS11DijetTestAnalyzer::vertexSrc
private

Definition at line 33 of file CMSDAS11DijetTestAnalyzer.h.

Referenced by analyze().