CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
HLTTauDQMTrkPlotter Class Reference

#include <HLTTauDQMTrkPlotter.h>

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &, const LVColl &)
 
 HLTTauDQMTrkPlotter (const edm::ParameterSet &, int, int, int, double, bool, double)
 
 ~HLTTauDQMTrkPlotter ()
 

Private Member Functions

std::pair< bool, LVmatch (const LV &recoJet, const LVColl &matchingObject)
 
bool matchJet (const reco::Jet &, const reco::CaloJetCollection &)
 

Private Attributes

bool doRef_
 
MonitorElementEtaEffDenom
 
MonitorElementEtaEffNum
 
MonitorElementEtEffDenom
 
MonitorElementEtEffNum
 
double EtMax_
 
std::string folder_
 
MonitorElementhasLeadTrack
 
MonitorElementisoJetEt
 
MonitorElementisoJetEta
 
MonitorElementisoJetPhi
 
edm::InputTag isolJets_
 
MonitorElementjetEt
 
MonitorElementjetEta
 
MonitorElementjetPhi
 
edm::InputTag jetTagSrc_
 
double mcMatch_
 
int NEtaBins_
 
int NPhiBins_
 
int NPtBins_
 
MonitorElementnPxlTrksInL25Jet
 
MonitorElementnQPxlTrksInL25Jet
 
MonitorElementPhiEffDenom
 
MonitorElementPhiEffNum
 
MonitorElementsignalLeadTrkPt
 
DQMStorestore
 
std::string type_
 

Detailed Description

Definition at line 37 of file HLTTauDQMTrkPlotter.h.

Constructor & Destructor Documentation

HLTTauDQMTrkPlotter::HLTTauDQMTrkPlotter ( const edm::ParameterSet iConfig,
int  etbins,
int  etabins,
int  phibins,
double  maxpt,
bool  ref,
double  dr 
)

Definition at line 4 of file HLTTauDQMTrkPlotter.cc.

References DQMStore::book1D(), doRef_, EtaEffDenom, EtaEffNum, EtEffDenom, EtEffNum, EtMax_, folder_, edm::ParameterSet::getParameter(), MonitorElement::getTH1F(), hasLeadTrack, isoJetEt, isoJetEta, isoJetPhi, isolJets_, jetEt, jetEta, jetPhi, jetTagSrc_, mcMatch_, NEtaBins_, NPhiBins_, NPtBins_, nPxlTrksInL25Jet, nQPxlTrksInL25Jet, PhiEffDenom, PhiEffNum, DQMStore::setCurrentFolder(), signalLeadTrkPt, store, and type_.

4  {
5  jetTagSrc_ = iConfig.getParameter<edm::InputTag>("ConeIsolation");
6  isolJets_ = iConfig.getParameter<edm::InputTag>("IsolatedJets");
7  mcMatch_ = dr;
8  doRef_ = ref;
9  folder_ = iConfig.getParameter<std::string>("DQMFolder");
10  type_ = iConfig.getParameter<std::string>("Type");
11  EtMax_ = maxpt;
12  NPtBins_ = etbins;
13  NEtaBins_ = etabins;
14  NPhiBins_ = phibins;
15 
16 
18 
19  if(store)
20  { //Create the histograms
22  jetEt = store->book1D((type_+"TauEt").c_str(), "Tau Et",NPtBins_,0,EtMax_);
23  jetEta = store->book1D((type_+"TauEta").c_str(), "Tau Eta", NEtaBins_, -2.5, 2.5);
24  jetPhi = store->book1D((type_+"TauPhi").c_str(), "Tau Phi", NPhiBins_, -3.2, 3.2);
25  isoJetEt = store->book1D((type_+"IsolJetEt").c_str(), "Selected Jet E_{t}", NPtBins_, 0,EtMax_);
26  isoJetEta = store->book1D((type_+"IsolJetEta").c_str(), "Selected Jet #eta", NEtaBins_, -2.5, 2.5);
27  isoJetPhi = store->book1D((type_+"IsolJetPhi").c_str(), "Selected jet #phi", NPhiBins_, -3.2, 3.2);
28 
29  nPxlTrksInL25Jet = store->book1D((type_+"nTracks").c_str(), "# RECO Tracks", 30, 0, 30);
30  nQPxlTrksInL25Jet = store->book1D((type_+"nQTracks").c_str(),"# Quality RECO tracks", 15, 0, 15);
31  signalLeadTrkPt = store->book1D((type_+"LeadTrackPt").c_str(), "Lead Track p_{t}", 75, 0, 150);
32  hasLeadTrack = store->book1D((type_+"HasLeadTrack").c_str(), "Lead Track ?", 2, 0, 2);
33 
34 
35  EtEffNum=store->book1D((type_+"TauEtEffNum").c_str(),"Efficiency vs E_{t}(Numerator)",NPtBins_,0,EtMax_);
36  EtEffNum->getTH1F()->Sumw2();
37 
38  EtEffDenom=store->book1D((type_+"TauEtEffDenom").c_str(),"Efficiency vs E_{t}(Denominator)",NPtBins_,0,EtMax_);
39  EtEffDenom->getTH1F()->Sumw2();
40 
41  EtaEffNum=store->book1D((type_+"TauEtaEffNum").c_str(),"Efficiency vs #eta (Numerator)",NEtaBins_,-2.5,2.5);
42  EtaEffNum->getTH1F()->Sumw2();
43 
44  EtaEffDenom=store->book1D((type_+"TauEtaEffDenom").c_str(),"Efficiency vs #eta(Denominator)",NEtaBins_,-2.5,2.5);
45  EtaEffDenom->getTH1F()->Sumw2();
46 
47  PhiEffNum=store->book1D((type_+"TauPhiEffNum").c_str(),"Efficiency vs #phi (Numerator)",NPhiBins_,-3.2,3.2);
48  PhiEffNum->getTH1F()->Sumw2();
49 
50  PhiEffDenom=store->book1D((type_+"TauPhiEffDenom").c_str(),"Efficiency vs #phi(Denominator)",NPhiBins_,-3.2,3.2);
51  PhiEffDenom->getTH1F()->Sumw2();
52 
53  }
54 }
T getParameter(std::string const &) const
MonitorElement * EtaEffNum
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:519
MonitorElement * jetPhi
MonitorElement * jetEt
MonitorElement * PhiEffDenom
MonitorElement * isoJetEta
MonitorElement * jetEta
MonitorElement * nPxlTrksInL25Jet
MonitorElement * EtEffNum
MonitorElement * nQPxlTrksInL25Jet
MonitorElement * isoJetEt
MonitorElement * hasLeadTrack
MonitorElement * signalLeadTrkPt
MonitorElement * PhiEffNum
TH1F * getTH1F(void) const
MonitorElement * EtEffDenom
MonitorElement * EtaEffDenom
MonitorElement * isoJetPhi
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:237
HLTTauDQMTrkPlotter::~HLTTauDQMTrkPlotter ( )

Definition at line 57 of file HLTTauDQMTrkPlotter.cc.

57  {
58 }

Member Function Documentation

void HLTTauDQMTrkPlotter::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup,
const LVColl mcInfo 
)

Definition at line 63 of file HLTTauDQMTrkPlotter.cc.

References reco::IsolatedTauTagInfo::allTracks(), doRef_, EtaEffDenom, EtaEffNum, EtEffDenom, EtEffNum, MonitorElement::Fill(), edm::Event::getByLabel(), hasLeadTrack, i, isoJetEt, isoJetEta, isoJetPhi, isolJets_, reco::JTATagInfo::jet(), jetEt, jetEta, jetPhi, jetTagSrc_, reco::IsolatedTauTagInfo::leadingSignalTrack(), m, match(), matchJet(), nPxlTrksInL25Jet, nQPxlTrksInL25Jet, reco::LeafCandidate::p4(), PhiEffDenom, PhiEffNum, dt_offlineAnalysis_common_cff::reco, reco::IsolatedTauTagInfo::selectedTracks(), signalLeadTrkPt, and edm::RefVector< C, T, F >::size().

63  {
64  using namespace edm;
65  using namespace reco;
66 
68  Handle<CaloJetCollection> isolJets;
69 
70 
71  bool gotL3= iEvent.getByLabel(jetTagSrc_, tauTagInfos) &&tauTagInfos.isValid();
72 
73  if(gotL3)
74  {
75  for(unsigned int i=0;i<tauTagInfos->size();++i)
76  {
77  IsolatedTauTagInfo tauTagInfo = (*tauTagInfos)[i];
78  if(&(*tauTagInfo.jet()))
79  {
80  LV theJet=tauTagInfo.jet()->p4();
81 
82  std::pair <bool,LV> m = match(theJet,mcInfo);
83 
84  if((doRef_&&m.first)||(!doRef_))
85  {
86  jetEt->Fill(theJet.Et());
87  jetEta->Fill(theJet.Eta());
88  jetPhi->Fill(theJet.Phi());
89  nPxlTrksInL25Jet->Fill(tauTagInfo.allTracks().size());
90  nQPxlTrksInL25Jet->Fill(tauTagInfo.selectedTracks().size());
91 
92  const TrackRef leadTrk = tauTagInfo.leadingSignalTrack();
93  if(!leadTrk)
94  {
95  hasLeadTrack->Fill(0.5);
96  }
97  else
98  {
99  hasLeadTrack->Fill(1.5);
100  signalLeadTrkPt->Fill(leadTrk->pt());
101  }
102 
103  LV refV;
104  if(doRef_) refV = m.second; else refV=theJet;
105 
106  EtEffDenom->Fill(refV.pt());
107  EtaEffDenom->Fill(refV.eta());
108  PhiEffDenom->Fill(refV.phi());
109 
110 
111  bool gotIsoL3= iEvent.getByLabel(isolJets_, isolJets) && isolJets.isValid();
112 
113 
114 
115  if(gotIsoL3)
116  if(matchJet(*(tauTagInfo.jet()),*isolJets))
117  {
118  isoJetEta->Fill(theJet.Eta());
119  isoJetEt->Fill(theJet.Et());
120  isoJetPhi->Fill(theJet.Phi());
121 
122  EtEffNum->Fill(refV.pt());
123  EtaEffNum->Fill(refV.eta());
124  PhiEffNum->Fill(refV.phi());
125  }
126  }
127  }
128  }
129  }
130 }
int i
Definition: DBlmapReader.cc:9
MonitorElement * EtaEffNum
MonitorElement * jetPhi
MonitorElement * jetEt
math::XYZTLorentzVectorD LV
void Fill(long long x)
const TrackRefVector selectedTracks() const
MonitorElement * PhiEffDenom
MonitorElement * isoJetEta
bool matchJet(const reco::Jet &, const reco::CaloJetCollection &)
MonitorElement * jetEta
MonitorElement * nPxlTrksInL25Jet
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:359
virtual edm::RefToBase< Jet > jet(void) const
returns a polymorphic reference to the tagged jet
Definition: JTATagInfo.h:20
MonitorElement * EtEffNum
MonitorElement * nQPxlTrksInL25Jet
MonitorElement * isoJetEt
MonitorElement * hasLeadTrack
MonitorElement * signalLeadTrkPt
std::pair< bool, LV > match(const LV &recoJet, const LVColl &matchingObject)
MonitorElement * PhiEffNum
const TrackRef leadingSignalTrack() const
size_type size() const
Size of the RefVector.
Definition: RefVector.h:85
MonitorElement * EtEffDenom
MonitorElement * EtaEffDenom
const TrackRefVector allTracks() const
MonitorElement * isoJetPhi
virtual const LorentzVector & p4() const
four-momentum Lorentz vector
std::pair< bool, LV > HLTTauDQMTrkPlotter::match ( const LV recoJet,
const LVColl matchingObject 
)
private

Definition at line 138 of file HLTTauDQMTrkPlotter.cc.

References deltaR(), i, mcMatch_, and L1TEmulatorMonitor_cff::p.

Referenced by analyze().

139 {
140  bool matched = false;
141  LV mLV;
142 
143  if(matchingObject.size() !=0 )
144  {
145  for(LVColl::const_iterator i = matchingObject.begin();i != matchingObject.end(); ++i)
146  {
147  double deltaR = ROOT::Math::VectorUtil::DeltaR(jet, *i);
148  if(deltaR < mcMatch_)
149  {
150  matched = true;
151  mLV = *i;
152  }
153  }
154  }
155 
156  std::pair<bool,LV> p = std::make_pair(matched,mLV);
157 
158  return p;
159 }
int i
Definition: DBlmapReader.cc:9
math::XYZTLorentzVectorD LV
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition: TreeUtility.cc:17
bool HLTTauDQMTrkPlotter::matchJet ( const reco::Jet jet,
const reco::CaloJetCollection McInfo 
)
private

Definition at line 162 of file HLTTauDQMTrkPlotter.cc.

References delta, mcMatch_, and reco::LeafCandidate::p4().

Referenced by analyze().

163 {
164 
165  //Loop On the Collection and see if your tau jet is matched to one there
166  //Also find the nearest Matched MC Particle to your Jet (to be complete)
167 
168  bool matched=false;
169 
170  if(McInfo.size()>0)
171  for(reco::CaloJetCollection::const_iterator it = McInfo.begin();it!=McInfo.end();++it)
172  {
173  double delta = ROOT::Math::VectorUtil::DeltaR(jet.p4().Vect(),it->p4().Vect());
174  if(delta<mcMatch_)
175  {
176  matched=true;
177 
178  }
179  }
180 
181 
182 
183  return matched;
184 }
dbl * delta
Definition: mlp_gen.cc:36
virtual const LorentzVector & p4() const
four-momentum Lorentz vector

Member Data Documentation

bool HLTTauDQMTrkPlotter::doRef_
private

Definition at line 80 of file HLTTauDQMTrkPlotter.h.

Referenced by analyze(), and HLTTauDQMTrkPlotter().

MonitorElement* HLTTauDQMTrkPlotter::EtaEffDenom
private

Definition at line 72 of file HLTTauDQMTrkPlotter.h.

Referenced by analyze(), and HLTTauDQMTrkPlotter().

MonitorElement* HLTTauDQMTrkPlotter::EtaEffNum
private

Definition at line 71 of file HLTTauDQMTrkPlotter.h.

Referenced by analyze(), and HLTTauDQMTrkPlotter().

MonitorElement* HLTTauDQMTrkPlotter::EtEffDenom
private

Definition at line 70 of file HLTTauDQMTrkPlotter.h.

Referenced by analyze(), and HLTTauDQMTrkPlotter().

MonitorElement* HLTTauDQMTrkPlotter::EtEffNum
private

Definition at line 69 of file HLTTauDQMTrkPlotter.h.

Referenced by analyze(), and HLTTauDQMTrkPlotter().

double HLTTauDQMTrkPlotter::EtMax_
private

Definition at line 84 of file HLTTauDQMTrkPlotter.h.

Referenced by HLTTauDQMTrkPlotter().

std::string HLTTauDQMTrkPlotter::folder_
private

Definition at line 52 of file HLTTauDQMTrkPlotter.h.

Referenced by HLTTauDQMTrkPlotter().

MonitorElement* HLTTauDQMTrkPlotter::hasLeadTrack
private

Definition at line 67 of file HLTTauDQMTrkPlotter.h.

Referenced by analyze(), and HLTTauDQMTrkPlotter().

MonitorElement* HLTTauDQMTrkPlotter::isoJetEt
private

Definition at line 60 of file HLTTauDQMTrkPlotter.h.

Referenced by analyze(), and HLTTauDQMTrkPlotter().

MonitorElement* HLTTauDQMTrkPlotter::isoJetEta
private

Definition at line 61 of file HLTTauDQMTrkPlotter.h.

Referenced by analyze(), and HLTTauDQMTrkPlotter().

MonitorElement* HLTTauDQMTrkPlotter::isoJetPhi
private

Definition at line 62 of file HLTTauDQMTrkPlotter.h.

Referenced by analyze(), and HLTTauDQMTrkPlotter().

edm::InputTag HLTTauDQMTrkPlotter::isolJets_
private

Definition at line 49 of file HLTTauDQMTrkPlotter.h.

Referenced by analyze(), and HLTTauDQMTrkPlotter().

MonitorElement* HLTTauDQMTrkPlotter::jetEt
private

Definition at line 56 of file HLTTauDQMTrkPlotter.h.

Referenced by analyze(), and HLTTauDQMTrkPlotter().

MonitorElement* HLTTauDQMTrkPlotter::jetEta
private

Definition at line 57 of file HLTTauDQMTrkPlotter.h.

Referenced by analyze(), and HLTTauDQMTrkPlotter().

MonitorElement* HLTTauDQMTrkPlotter::jetPhi
private

Definition at line 58 of file HLTTauDQMTrkPlotter.h.

Referenced by analyze(), and HLTTauDQMTrkPlotter().

edm::InputTag HLTTauDQMTrkPlotter::jetTagSrc_
private

Definition at line 48 of file HLTTauDQMTrkPlotter.h.

Referenced by analyze(), and HLTTauDQMTrkPlotter().

double HLTTauDQMTrkPlotter::mcMatch_
private

Definition at line 54 of file HLTTauDQMTrkPlotter.h.

Referenced by HLTTauDQMTrkPlotter(), match(), and matchJet().

int HLTTauDQMTrkPlotter::NEtaBins_
private

Definition at line 86 of file HLTTauDQMTrkPlotter.h.

Referenced by HLTTauDQMTrkPlotter().

int HLTTauDQMTrkPlotter::NPhiBins_
private

Definition at line 87 of file HLTTauDQMTrkPlotter.h.

Referenced by HLTTauDQMTrkPlotter().

int HLTTauDQMTrkPlotter::NPtBins_
private

Definition at line 85 of file HLTTauDQMTrkPlotter.h.

Referenced by HLTTauDQMTrkPlotter().

MonitorElement* HLTTauDQMTrkPlotter::nPxlTrksInL25Jet
private

Definition at line 64 of file HLTTauDQMTrkPlotter.h.

Referenced by analyze(), and HLTTauDQMTrkPlotter().

MonitorElement* HLTTauDQMTrkPlotter::nQPxlTrksInL25Jet
private

Definition at line 65 of file HLTTauDQMTrkPlotter.h.

Referenced by analyze(), and HLTTauDQMTrkPlotter().

MonitorElement* HLTTauDQMTrkPlotter::PhiEffDenom
private

Definition at line 74 of file HLTTauDQMTrkPlotter.h.

Referenced by analyze(), and HLTTauDQMTrkPlotter().

MonitorElement* HLTTauDQMTrkPlotter::PhiEffNum
private

Definition at line 73 of file HLTTauDQMTrkPlotter.h.

Referenced by analyze(), and HLTTauDQMTrkPlotter().

MonitorElement* HLTTauDQMTrkPlotter::signalLeadTrkPt
private

Definition at line 66 of file HLTTauDQMTrkPlotter.h.

Referenced by analyze(), and HLTTauDQMTrkPlotter().

DQMStore* HLTTauDQMTrkPlotter::store
private

Definition at line 78 of file HLTTauDQMTrkPlotter.h.

Referenced by HLTTauDQMTrkPlotter().

std::string HLTTauDQMTrkPlotter::type_
private