CMS 3D CMS Logo

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

#include <TopJetAnalyzer.h>

Inheritance diagram for TopJetAnalyzer:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

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

TH1F * en_
 
TH1F * eta_
 
edm::EDGetTokenT< std::vector< pat::Jet > > inputToken_
 
TH1F * mult_
 
TH1F * phi_
 
TH1F * pt_
 
bool verbose_
 

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 TopJetAnalyzer.h.

Constructor & Destructor Documentation

◆ TopJetAnalyzer()

TopJetAnalyzer::TopJetAnalyzer ( const edm::ParameterSet cfg)
explicit

Definition at line 3 of file TopJetAnalyzer.cc.

4  : inputToken_(consumes<std::vector<pat::Jet> >(cfg.getParameter<edm::InputTag>("input"))),
5  verbose_(cfg.getParameter<bool>("verbose")) {
7 
8  mult_ = fs->make<TH1F>("mult", "multiplicity (jets)", 30, 0, 30);
9  en_ = fs->make<TH1F>("en", "energy (jets)", 60, 0., 300.);
10  pt_ = fs->make<TH1F>("pt", "pt (jets)", 60, 0., 300.);
11  eta_ = fs->make<TH1F>("eta", "eta (jets)", 30, -3., 3.);
12  phi_ = fs->make<TH1F>("phi", "phi (jets)", 40, -4., 4.);
13 }

References en_, eta_, TFileService::make(), mult_, phi_, and pt_.

◆ ~TopJetAnalyzer()

TopJetAnalyzer::~TopJetAnalyzer ( )
override

Definition at line 15 of file TopJetAnalyzer.cc.

15 {}

Member Function Documentation

◆ analyze()

void TopJetAnalyzer::analyze ( const edm::Event evt,
const edm::EventSetup setup 
)
overrideprivatevirtual

Implements edm::EDAnalyzer.

Definition at line 17 of file TopJetAnalyzer.cc.

17  {
20 
21  // fill histograms
22 
23  mult_->Fill(jets->size());
24  for (std::vector<pat::Jet>::const_iterator jet = jets->begin(); jet != jets->end(); ++jet) {
25  pt_->Fill(jet->pt());
26  en_->Fill(jet->energy());
27  eta_->Fill(jet->eta());
28  phi_->Fill(jet->phi());
29  }
30 
31  // produce printout if desired
32 
33  if (jets->empty() || !verbose_)
34  return;
35 
36  int lineWidth = 75;
37  if (jets->begin()->isCaloJet())
38  lineWidth = 100;
39  else if (jets->begin()->isPFJet())
40  lineWidth = 120;
41 
42  std::cout << std::setfill('=') << std::setw(lineWidth) << "\n" << std::setfill(' ');
43  std::cout << std::setw(5) << "jet :" << std::setw(11) << "pt :" << std::setw(9) << "eta :" << std::setw(9)
44  << "phi :" << std::setw(11) << "TCHE :" << std::setw(11) << "TCHP :" << std::setw(9)
45  << "SSVHE :" << std::setw(9) << "SSVHP :";
46  if (jets->begin()->isCaloJet()) {
47  std::cout << std::setw(8) << "emf :" << std::setw(10) << "n90Hits :" << std::setw(7) << "fHPD";
48  }
49  if (jets->begin()->isPFJet()) {
50  std::cout << std::setw(9) << "chf : " << std::setw(8) << "nhf : " << std::setw(8) << "cef : " << std::setw(8)
51  << "nef : " << std::setw(6) << "nCh : " << std::setw(6) << "nConst";
52  }
53  std::cout << std::endl << std::setfill('-') << std::setw(lineWidth) << "\n" << std::setfill(' ');
54  unsigned i = 0;
55  for (std::vector<pat::Jet>::const_iterator jet = jets->begin(); jet != jets->end(); ++jet) {
56  std::cout << std::setw(3) << i << " : " << std::setprecision(3) << std::fixed << std::setw(8) << jet->pt() << " : "
57  << std::setw(6) << jet->eta() << " : " << std::setw(6) << jet->phi() << " : " << std::setw(8)
58  << jet->bDiscriminator("trackCountingHighEffBJetTags") << " : " << std::setw(8)
59  << jet->bDiscriminator("trackCountingHighPurBJetTags") << " : " << std::setw(6)
60  << jet->bDiscriminator("simpleSecondaryVertexHighEffBJetTags") << " : " << std::setw(6)
61  << jet->bDiscriminator("simpleSecondaryVertexHighPurBJetTags") << " : ";
62  if (jet->isCaloJet()) {
63  std::cout << std::setw(5) << jet->emEnergyFraction() << " : " << std::setw(7) << jet->jetID().n90Hits << " : "
64  << std::setw(6) << jet->jetID().fHPD;
65  }
66  if (jet->isPFJet()) {
67  std::cout << std::setw(5) << jet->chargedHadronEnergyFraction() << " : " << std::setw(5)
68  << jet->neutralHadronEnergyFraction() << " : " << std::setw(5) << jet->chargedEmEnergyFraction()
69  << " : " << std::setw(5) << jet->neutralEmEnergyFraction() << " : " << std::setw(3)
70  << jet->chargedMultiplicity() << " : " << std::setw(6) << jet->nConstituents();
71  }
72  std::cout << std::endl;
73  i++;
74  }
75  std::cout << std::setfill('=') << std::setw(lineWidth) << "\n" << std::setfill(' ');
76 }

References gather_cfg::cout, en_, eta_, alignBH_cfg::fixed, edm::Event::getByToken(), mps_fire::i, inputToken_, metsig::jet, singleTopDQM_cfi::jets, RecoTauValidation_cfi::lineWidth, mult_, phi_, pt_, and verbose_.

◆ beginJob()

void TopJetAnalyzer::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 78 of file TopJetAnalyzer.cc.

78 {}

◆ endJob()

void TopJetAnalyzer::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 80 of file TopJetAnalyzer.cc.

80 {}

Member Data Documentation

◆ en_

TH1F* TopJetAnalyzer::en_
private

Definition at line 29 of file TopJetAnalyzer.h.

Referenced by analyze(), and TopJetAnalyzer().

◆ eta_

TH1F* TopJetAnalyzer::eta_
private

Definition at line 31 of file TopJetAnalyzer.h.

Referenced by analyze(), and TopJetAnalyzer().

◆ inputToken_

edm::EDGetTokenT<std::vector<pat::Jet> > TopJetAnalyzer::inputToken_
private

Definition at line 25 of file TopJetAnalyzer.h.

Referenced by analyze().

◆ mult_

TH1F* TopJetAnalyzer::mult_
private

Definition at line 28 of file TopJetAnalyzer.h.

Referenced by analyze(), and TopJetAnalyzer().

◆ phi_

TH1F* TopJetAnalyzer::phi_
private

Definition at line 32 of file TopJetAnalyzer.h.

Referenced by analyze(), and TopJetAnalyzer().

◆ pt_

TH1F* TopJetAnalyzer::pt_
private

Definition at line 30 of file TopJetAnalyzer.h.

Referenced by analyze(), and TopJetAnalyzer().

◆ verbose_

bool TopJetAnalyzer::verbose_
private

Definition at line 26 of file TopJetAnalyzer.h.

Referenced by analyze().

alignBH_cfg.fixed
fixed
Definition: alignBH_cfg.py:54
mps_fire.i
i
Definition: mps_fire.py:428
TopJetAnalyzer::pt_
TH1F * pt_
Definition: TopJetAnalyzer.h:30
gather_cfg.cout
cout
Definition: gather_cfg.py:144
singleTopDQM_cfi.jets
jets
Definition: singleTopDQM_cfi.py:42
edm::Handle
Definition: AssociativeIterator.h:50
TopJetAnalyzer::phi_
TH1F * phi_
Definition: TopJetAnalyzer.h:32
TopJetAnalyzer::verbose_
bool verbose_
Definition: TopJetAnalyzer.h:26
edm::Event::getByToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:531
TopJetAnalyzer::eta_
TH1F * eta_
Definition: TopJetAnalyzer.h:31
edm::Service< TFileService >
looper.cfg
cfg
Definition: looper.py:297
RecoTauValidation_cfi.lineWidth
lineWidth
Definition: RecoTauValidation_cfi.py:305
metsig::jet
Definition: SignAlgoResolutions.h:47
edm::EDConsumerBase::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: EDConsumerBase.h:153
TopJetAnalyzer::en_
TH1F * en_
Definition: TopJetAnalyzer.h:29
edm::InputTag
Definition: InputTag.h:15
TopJetAnalyzer::inputToken_
edm::EDGetTokenT< std::vector< pat::Jet > > inputToken_
Definition: TopJetAnalyzer.h:25
TFileService::make
T * make(const Args &... args) const
make new ROOT object
Definition: TFileService.h:64
TopJetAnalyzer::mult_
TH1F * mult_
Definition: TopJetAnalyzer.h:28