CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
BjetAnalyzer.cc
Go to the documentation of this file.
3 #include <iostream>
4 #include "TH1.h"
5 
6 class BjetAnalysis : public edm::EDAnalyzer {
7 public:
8  BjetAnalysis(const edm::ParameterSet & cfg);
9  virtual void analyze(const edm::Event&, const edm::EventSetup&) override;
10  // virtual void endJob();
11 private:
13  std::vector<unsigned int> matched_, unMatched_;
15  int nHitCut_;
17 
18 };
19 
29 using namespace std;
30 using namespace reco;
31 using namespace edm;
35 
36 
38  src_(cfg.getParameter<InputTag>("src")),
39  ptMin_(cfg.getUntrackedParameter<double>("ptMin")),
40  massMin_(cfg.getUntrackedParameter<double>("massMin")),
41  massMax_(cfg.getUntrackedParameter<double>("massMax")),
42  etaMin_(cfg.getUntrackedParameter<double>("etaMin")),
43  etaMax_(cfg.getUntrackedParameter<double>("etaMax")),
44  trkIso_(cfg.getUntrackedParameter<double>("trkIso")),
45  chi2Cut_(cfg.getUntrackedParameter<double>("chi2Cut")),
46  nHitCut_(cfg.getUntrackedParameter<int>("nHitCut"))
47 {
49  TFileDirectory trackEffDir = fs->mkdir("QualityOfGlbMu");
50  h_GlbMuNofHitsGlbMu_= trackEffDir.make<TH1D>("# of Hits of GlobalMuon", "# of Hits of GlobalMuon", 100, 0, 100);
51  h_TrkMuNofHitsGlbMu_= trackEffDir.make<TH1D>("# of Hits of TrackerMuon", "# of Hits of TrackerMuon", 100, 0, 100);
52  h_GlbMuChi2_= trackEffDir.make<TH1D>("chi2 of GlobalMuon", "chi2 of GlobalMuon", 100,0,10);
53  h_GlbMuDxy_= trackEffDir.make<TH1D>("Dxy of GlobalMuon", "Dxy of GlobalMuon", 1000,-5.,5.);
54 }
55 
56 /*void BjetAnalysis::endJob() {
57  cout << src_.encode() << endl ;
58 
59 }
60 */
62 
63 
64  // Get b tag information
66  evt.getByLabel("trackCountingHighEffBJetTags", bTagHandle);
67  const reco::JetTagCollection & bTags = *(bTagHandle.product());
68 
69  // Loop over jets and study b tag info.
70  for (unsigned int i = 0; i != bTags.size(); ++i) {
71  cout<<" Jet "<< i
72  <<" has b tag discriminator (trackCountingHighEffBJetTags)= "<<bTags[i].second
73  << " and jet Pt = "<<bTags[i].first->pt()<<endl;
74  }
75 
76  // Get b tag information
78  evt.getByLabel("jetProbabilityBJetTags", bTagHandle2);
79  const reco::JetTagCollection & bTags2 = *(bTagHandle2.product());
80 
81  // Loop over jets and study b tag info.
82  for (unsigned int i = 0; i != bTags2.size(); ++i) {
83  cout<<" Jet "<< i
84  <<" has b tag discriminator (jetProbabilityBJetTags) = "<<bTags2[i].second
85  << " and jet Pt = "<<bTags2[i].first->pt()<<endl;
86  }
87 
88 
89  // Get b tag information
91  evt.getByLabel("jetBProbabilityBJetTags", bTagHandle3);
92  const reco::JetTagCollection & bTags3 = *(bTagHandle3.product());
93 
94  // Loop over jets and study b tag info.
95  for (unsigned int i = 0; i != bTags3.size(); ++i) {
96  cout<<" Jet "<< i
97  <<" has b tag discriminator (jetBProbabilityBJetTags) = "<<bTags3[i].second
98  << " and jet Pt = "<<bTags3[i].first->pt()<<endl;
99  }
100 
101 
102 
103 
104 
105 
106 
107 
108 
109 
110 }
111 
112 
113 
115 
int i
Definition: DBlmapReader.cc:9
double massMax_
Definition: BjetAnalyzer.cc:14
double chi2Cut_
Definition: BjetAnalyzer.cc:14
TH1D * h_GlbMuDxy_
Definition: BjetAnalyzer.cc:16
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
double massMin_
Definition: BjetAnalyzer.cc:14
std::vector< unsigned int > matched_
Definition: BjetAnalyzer.cc:13
double trkIso_
Definition: BjetAnalyzer.cc:14
BjetAnalysis(const edm::ParameterSet &cfg)
Definition: BjetAnalyzer.cc:37
T * make(const Args &...args) const
make new ROOT object
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:390
double etaMax_
Definition: BjetAnalyzer.cc:14
TH1D * h_GlbMuChi2_
Definition: BjetAnalyzer.cc:16
TFileDirectory mkdir(const std::string &dir, const std::string &descr="")
create a new subdirectory
Definition: TFileService.h:69
T const * product() const
Definition: Handle.h:81
tuple cout
Definition: gather_cfg.py:121
TH1D * h_TrkMuNofHitsGlbMu_
Definition: BjetAnalyzer.cc:16
edm::InputTag src_
Definition: BjetAnalyzer.cc:12
double etaMin_
Definition: BjetAnalyzer.cc:14
virtual void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: BjetAnalyzer.cc:61
std::vector< unsigned int > unMatched_
Definition: BjetAnalyzer.cc:13
size_type size() const
TH1D * h_GlbMuNofHitsGlbMu_
Definition: BjetAnalyzer.cc:16