CMS 3D CMS Logo

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

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
 BjetAnalysis (const edm::ParameterSet &cfg)
 
- 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 Attributes

edm::EDGetTokenT< reco::JetTagCollectionbTagToken2_
 
edm::EDGetTokenT< reco::JetTagCollectionbTagToken3_
 
edm::EDGetTokenT< reco::JetTagCollectionbTagToken_
 
double chi2Cut_
 
double etaMax_
 
double etaMin_
 
TH1D * h_GlbMuChi2_
 
TH1D * h_GlbMuDxy_
 
TH1D * h_GlbMuNofHitsGlbMu_
 
TH1D * h_TrkMuNofHitsGlbMu_
 
double massMax_
 
double massMin_
 
std::vector< unsigned int > matched_
 
int nHitCut_
 
double ptMin_
 
double trkIso_
 
std::vector< unsigned int > unMatched_
 

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

Constructor & Destructor Documentation

◆ BjetAnalysis()

BjetAnalysis::BjetAnalysis ( const edm::ParameterSet cfg)

Definition at line 37 of file BjetAnalyzer.cc.

38  : bTagToken_(consumes<reco::JetTagCollection>(edm::InputTag("trackCountingHighEffBJetTags"))),
39  bTagToken2_(consumes<reco::JetTagCollection>(edm::InputTag("jetProbabilityBJetTags"))),
40  bTagToken3_(consumes<reco::JetTagCollection>(edm::InputTag("jetBProbabilityBJetTags"))),
41  ptMin_(cfg.getUntrackedParameter<double>("ptMin")),
42  massMin_(cfg.getUntrackedParameter<double>("massMin")),
43  massMax_(cfg.getUntrackedParameter<double>("massMax")),
44  etaMin_(cfg.getUntrackedParameter<double>("etaMin")),
45  etaMax_(cfg.getUntrackedParameter<double>("etaMax")),
46  trkIso_(cfg.getUntrackedParameter<double>("trkIso")),
47  chi2Cut_(cfg.getUntrackedParameter<double>("chi2Cut")),
48  nHitCut_(cfg.getUntrackedParameter<int>("nHitCut")) {
50  TFileDirectory trackEffDir = fs->mkdir("QualityOfGlbMu");
51  h_GlbMuNofHitsGlbMu_ = trackEffDir.make<TH1D>("# of Hits of GlobalMuon", "# of Hits of GlobalMuon", 100, 0, 100);
52  h_TrkMuNofHitsGlbMu_ = trackEffDir.make<TH1D>("# of Hits of TrackerMuon", "# of Hits of TrackerMuon", 100, 0, 100);
53  h_GlbMuChi2_ = trackEffDir.make<TH1D>("chi2 of GlobalMuon", "chi2 of GlobalMuon", 100, 0, 10);
54  h_GlbMuDxy_ = trackEffDir.make<TH1D>("Dxy of GlobalMuon", "Dxy of GlobalMuon", 1000, -5., 5.);
55 }

References h_GlbMuChi2_, h_GlbMuDxy_, h_GlbMuNofHitsGlbMu_, h_TrkMuNofHitsGlbMu_, TFileDirectory::make(), and TFileService::mkdir().

Member Function Documentation

◆ analyze()

void BjetAnalysis::analyze ( const edm::Event evt,
const edm::EventSetup  
)
overridevirtual

Implements edm::EDAnalyzer.

Definition at line 57 of file BjetAnalyzer.cc.

57  {
58  // Get b tag information
60  evt.getByToken(bTagToken_, bTagHandle);
61  const reco::JetTagCollection& bTags = *(bTagHandle.product());
62 
63  // Loop over jets and study b tag info.
64  for (unsigned int i = 0; i != bTags.size(); ++i) {
65  cout << " Jet " << i << " has b tag discriminator (trackCountingHighEffBJetTags)= " << bTags[i].second
66  << " and jet Pt = " << bTags[i].first->pt() << endl;
67  }
68 
69  // Get b tag information
71  evt.getByToken(bTagToken2_, bTagHandle2);
72  const reco::JetTagCollection& bTags2 = *(bTagHandle2.product());
73 
74  // Loop over jets and study b tag info.
75  for (unsigned int i = 0; i != bTags2.size(); ++i) {
76  cout << " Jet " << i << " has b tag discriminator (jetProbabilityBJetTags) = " << bTags2[i].second
77  << " and jet Pt = " << bTags2[i].first->pt() << endl;
78  }
79 
80  // Get b tag information
82  evt.getByToken(bTagToken3_, bTagHandle3);
83  const reco::JetTagCollection& bTags3 = *(bTagHandle3.product());
84 
85  // Loop over jets and study b tag info.
86  for (unsigned int i = 0; i != bTags3.size(); ++i) {
87  cout << " Jet " << i << " has b tag discriminator (jetBProbabilityBJetTags) = " << bTags3[i].second
88  << " and jet Pt = " << bTags3[i].first->pt() << endl;
89  }
90 }

References TtFullHadKinFitProducer_cfi::bTags, bTagToken2_, bTagToken3_, bTagToken_, gather_cfg::cout, edm::Event::getByToken(), mps_fire::i, edm::Handle< T >::product(), and edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::size().

Member Data Documentation

◆ bTagToken2_

edm::EDGetTokenT<reco::JetTagCollection> BjetAnalysis::bTagToken2_
private

Definition at line 14 of file BjetAnalyzer.cc.

Referenced by analyze().

◆ bTagToken3_

edm::EDGetTokenT<reco::JetTagCollection> BjetAnalysis::bTagToken3_
private

Definition at line 15 of file BjetAnalyzer.cc.

Referenced by analyze().

◆ bTagToken_

edm::EDGetTokenT<reco::JetTagCollection> BjetAnalysis::bTagToken_
private

Definition at line 13 of file BjetAnalyzer.cc.

Referenced by analyze().

◆ chi2Cut_

double BjetAnalysis::chi2Cut_
private

Definition at line 17 of file BjetAnalyzer.cc.

◆ etaMax_

double BjetAnalysis::etaMax_
private

Definition at line 17 of file BjetAnalyzer.cc.

◆ etaMin_

double BjetAnalysis::etaMin_
private

Definition at line 17 of file BjetAnalyzer.cc.

◆ h_GlbMuChi2_

TH1D * BjetAnalysis::h_GlbMuChi2_
private

Definition at line 19 of file BjetAnalyzer.cc.

Referenced by BjetAnalysis().

◆ h_GlbMuDxy_

TH1D * BjetAnalysis::h_GlbMuDxy_
private

Definition at line 19 of file BjetAnalyzer.cc.

Referenced by BjetAnalysis().

◆ h_GlbMuNofHitsGlbMu_

TH1D* BjetAnalysis::h_GlbMuNofHitsGlbMu_
private

Definition at line 19 of file BjetAnalyzer.cc.

Referenced by BjetAnalysis().

◆ h_TrkMuNofHitsGlbMu_

TH1D * BjetAnalysis::h_TrkMuNofHitsGlbMu_
private

Definition at line 19 of file BjetAnalyzer.cc.

Referenced by BjetAnalysis().

◆ massMax_

double BjetAnalysis::massMax_
private

Definition at line 17 of file BjetAnalyzer.cc.

◆ massMin_

double BjetAnalysis::massMin_
private

Definition at line 17 of file BjetAnalyzer.cc.

◆ matched_

std::vector<unsigned int> BjetAnalysis::matched_
private

Definition at line 16 of file BjetAnalyzer.cc.

◆ nHitCut_

int BjetAnalysis::nHitCut_
private

Definition at line 18 of file BjetAnalyzer.cc.

◆ ptMin_

double BjetAnalysis::ptMin_
private

Definition at line 17 of file BjetAnalyzer.cc.

◆ trkIso_

double BjetAnalysis::trkIso_
private

Definition at line 17 of file BjetAnalyzer.cc.

◆ unMatched_

std::vector<unsigned int> BjetAnalysis::unMatched_
private

Definition at line 16 of file BjetAnalyzer.cc.

BjetAnalysis::bTagToken_
edm::EDGetTokenT< reco::JetTagCollection > bTagToken_
Definition: BjetAnalyzer.cc:13
BjetAnalysis::h_GlbMuChi2_
TH1D * h_GlbMuChi2_
Definition: BjetAnalyzer.cc:19
BjetAnalysis::etaMax_
double etaMax_
Definition: BjetAnalyzer.cc:17
mps_fire.i
i
Definition: mps_fire.py:428
edm::Handle::product
T const * product() const
Definition: Handle.h:70
BjetAnalysis::h_TrkMuNofHitsGlbMu_
TH1D * h_TrkMuNofHitsGlbMu_
Definition: BjetAnalyzer.cc:19
TFileDirectory::make
T * make(const Args &... args) const
make new ROOT object
Definition: TFileDirectory.h:53
gather_cfg.cout
cout
Definition: gather_cfg.py:144
TFileDirectory
Definition: TFileDirectory.h:24
edm::Handle
Definition: AssociativeIterator.h:50
BjetAnalysis::bTagToken2_
edm::EDGetTokenT< reco::JetTagCollection > bTagToken2_
Definition: BjetAnalyzer.cc:14
BjetAnalysis::nHitCut_
int nHitCut_
Definition: BjetAnalyzer.cc:18
BjetAnalysis::massMax_
double massMax_
Definition: BjetAnalyzer.cc:17
edm::Event::getByToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:531
BjetAnalysis::chi2Cut_
double chi2Cut_
Definition: BjetAnalyzer.cc:17
edm::AssociationVector
Definition: AssociationVector.h:67
BjetAnalysis::bTagToken3_
edm::EDGetTokenT< reco::JetTagCollection > bTagToken3_
Definition: BjetAnalyzer.cc:15
TFileService::mkdir
TFileDirectory mkdir(const std::string &dir, const std::string &descr="")
create a new subdirectory
Definition: TFileService.h:69
BjetAnalysis::h_GlbMuNofHitsGlbMu_
TH1D * h_GlbMuNofHitsGlbMu_
Definition: BjetAnalyzer.cc:19
edm::Service< TFileService >
TtFullHadKinFitProducer_cfi.bTags
bTags
Definition: TtFullHadKinFitProducer_cfi.py:40
edm::AssociationVector::size
size_type size() const
Definition: AssociationVector.h:227
BjetAnalysis::etaMin_
double etaMin_
Definition: BjetAnalyzer.cc:17
looper.cfg
cfg
Definition: looper.py:297
BjetAnalysis::ptMin_
double ptMin_
Definition: BjetAnalyzer.cc:17
BjetAnalysis::massMin_
double massMin_
Definition: BjetAnalyzer.cc:17
BjetAnalysis::trkIso_
double trkIso_
Definition: BjetAnalyzer.cc:17
BjetAnalysis::h_GlbMuDxy_
TH1D * h_GlbMuDxy_
Definition: BjetAnalyzer.cc:19
edm::InputTag
Definition: InputTag.h:15