CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
PatZjetsJetAnalyzer Class Reference
Inheritance diagram for PatZjetsJetAnalyzer:
edm::one::EDAnalyzer< edm::one::SharedResources > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 PatZjetsJetAnalyzer (const edm::ParameterSet &)
 
 ~PatZjetsJetAnalyzer () 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)
 

Private Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void beginJob () override
 
void endJob () override
 

Private Attributes

std::map< std::string, TH1F * > histContainer_
 
edm::EDGetTokenT< edm::View< pat::Jet > > srcToken_
 

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 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 15 of file PatZjetsJetAnalyzer.cc.

Constructor & Destructor Documentation

◆ PatZjetsJetAnalyzer()

PatZjetsJetAnalyzer::PatZjetsJetAnalyzer ( const edm::ParameterSet iConfig)
explicit

Definition at line 34 of file PatZjetsJetAnalyzer.cc.

References TFileService::kSharedResource.

36  usesResource(TFileService::kSharedResource);
37 }
static const std::string kSharedResource
Definition: TFileService.h:76
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< edm::View< pat::Jet > > srcToken_
std::map< std::string, TH1F * > histContainer_

◆ ~PatZjetsJetAnalyzer()

PatZjetsJetAnalyzer::~PatZjetsJetAnalyzer ( )
override

Definition at line 39 of file PatZjetsJetAnalyzer.cc.

39 {}

Member Function Documentation

◆ analyze()

void PatZjetsJetAnalyzer::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 41 of file PatZjetsJetAnalyzer.cc.

References histContainer_, mps_fire::i, iEvent, metsig::jet, PDWG_EXODelayedJetMET_cff::jets, and srcToken_.

41  {
42  // get electron collection
44  iEvent.getByToken(srcToken_, jets);
45 
46  // loop jets
47  for (edm::View<pat::Jet>::const_iterator ijet = jets->begin(); ijet != jets->end(); ++ijet) {
48  // fill simple histograms
49  pat::Jet jet = ijet->correctedJet("had", "uds");
50  histContainer_["pt"]->Fill(jet.pt());
51  histContainer_["eta"]->Fill(jet.eta());
52  histContainer_["phi"]->Fill(jet.phi());
53  histContainer_["emf"]->Fill(jet.emEnergyFraction());
54  for (unsigned int i = 0; i < jet.getCaloConstituents().size(); ++i) {
55  histContainer_["dEta"]->Fill(jet.getCaloConstituent(i)->eta() - jet.eta());
56  }
57  }
58 }
int iEvent
Definition: GenABIO.cc:224
edm::EDGetTokenT< edm::View< pat::Jet > > srcToken_
Analysis-level calorimeter jet class.
Definition: Jet.h:77
std::map< std::string, TH1F * > histContainer_
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:86

◆ beginJob()

void PatZjetsJetAnalyzer::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 60 of file PatZjetsJetAnalyzer.cc.

References compareTotals::fs, and histContainer_.

60  {
61  // register to the TFileService
63 
64  // book histograms:
65  histContainer_["pt"] = fs->make<TH1F>("pt", "pt", 150, 0., 150.);
66  histContainer_["eta"] = fs->make<TH1F>("eta", "eta", 50, 0., 5.);
67  histContainer_["phi"] = fs->make<TH1F>("phi", "phi", 60, 3.14, 3.14);
68  histContainer_["emf"] = fs->make<TH1F>("emf", "emf", 40, 0., 1.);
69  histContainer_["dEta"] = fs->make<TH1F>("dEta", "dEta", 40, 0., 1.);
70 }
std::map< std::string, TH1F * > histContainer_

◆ endJob()

void PatZjetsJetAnalyzer::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 72 of file PatZjetsJetAnalyzer.cc.

72 {}

Member Data Documentation

◆ histContainer_

std::map<std::string, TH1F*> PatZjetsJetAnalyzer::histContainer_
private

Definition at line 28 of file PatZjetsJetAnalyzer.cc.

Referenced by analyze(), and beginJob().

◆ srcToken_

edm::EDGetTokenT<edm::View<pat::Jet> > PatZjetsJetAnalyzer::srcToken_
private

Definition at line 31 of file PatZjetsJetAnalyzer.cc.

Referenced by analyze().