CMS 3D CMS Logo

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

Public Member Functions

 PatZjetsJetAnalyzer (const edm::ParameterSet &)
 
 ~PatZjetsJetAnalyzer () override
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
 ~EDAnalyzer () 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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
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::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
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::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsInputProcessBlocks ()
 
static bool wantsProcessBlocks ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

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.

◆ ~PatZjetsJetAnalyzer()

PatZjetsJetAnalyzer::~PatZjetsJetAnalyzer ( )
override

Definition at line 38 of file PatZjetsJetAnalyzer.cc.

38 {}

Member Function Documentation

◆ analyze()

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

Implements edm::EDAnalyzer.

Definition at line 40 of file PatZjetsJetAnalyzer.cc.

40  {
41  // get electron collection
43  iEvent.getByToken(srcToken_, jets);
44 
45  // loop jets
46  for (edm::View<pat::Jet>::const_iterator ijet = jets->begin(); ijet != jets->end(); ++ijet) {
47  // fill simple histograms
48  pat::Jet jet = ijet->correctedJet("had", "uds");
49  histContainer_["pt"]->Fill(jet.pt());
50  histContainer_["eta"]->Fill(jet.eta());
51  histContainer_["phi"]->Fill(jet.phi());
52  histContainer_["emf"]->Fill(jet.emEnergyFraction());
53  for (unsigned int i = 0; i < jet.getCaloConstituents().size(); ++i) {
54  histContainer_["dEta"]->Fill(jet.getCaloConstituent(i)->eta() - jet.eta());
55  }
56  }
57 }

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

◆ beginJob()

void PatZjetsJetAnalyzer::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 59 of file PatZjetsJetAnalyzer.cc.

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

References histContainer_, and TFileService::make().

◆ endJob()

void PatZjetsJetAnalyzer::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 71 of file PatZjetsJetAnalyzer.cc.

71 {}

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().

mps_fire.i
i
Definition: mps_fire.py:428
PatZjetsJetAnalyzer::histContainer_
std::map< std::string, TH1F * > histContainer_
Definition: PatZjetsJetAnalyzer.cc:28
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
singleTopDQM_cfi.jets
jets
Definition: singleTopDQM_cfi.py:42
edm::Handle
Definition: AssociativeIterator.h:50
pat::Jet
Analysis-level calorimeter jet class.
Definition: Jet.h:77
edm::View
Definition: CaloClusterFwd.h:14
edm::Service< TFileService >
iEvent
int iEvent
Definition: GenABIO.cc:224
metsig::jet
Definition: SignAlgoResolutions.h:47
edm::View::const_iterator
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:86
edm::EDConsumerBase::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: EDConsumerBase.h:153
PatZjetsJetAnalyzer::srcToken_
edm::EDGetTokenT< edm::View< pat::Jet > > srcToken_
Definition: PatZjetsJetAnalyzer.cc:31
edm::InputTag
Definition: InputTag.h:15
TFileService::make
T * make(const Args &... args) const
make new ROOT object
Definition: TFileService.h:64