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>

Inheritance diagram for HLTTauDQMTrkPlotter:
HLTTauDQMPlotter

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &, const std::map< int, LVColl > &)
 
 HLTTauDQMTrkPlotter (const edm::ParameterSet &, int, int, int, double, bool, double, std::string)
 
const std::string name ()
 
 ~HLTTauDQMTrkPlotter ()
 
- Public Member Functions inherited from HLTTauDQMPlotter
 HLTTauDQMPlotter ()
 
bool isValid () const
 
virtual ~HLTTauDQMPlotter ()
 

Private Member Functions

bool matchJet (const reco::Jet &, const reco::CaloJetCollection &)
 

Private Attributes

bool doRef_
 
MonitorElementEtaEffDenom
 
MonitorElementEtaEffNum
 
MonitorElementEtEffDenom
 
MonitorElementEtEffNum
 
double EtMax_
 
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
 
std::string type_
 

Additional Inherited Members

- Protected Member Functions inherited from HLTTauDQMPlotter
std::pair< bool, LVmatch (const LV &, const LVColl &, double)
 
std::string triggerTag ()
 
- Protected Attributes inherited from HLTTauDQMPlotter
std::string dqmBaseFolder_
 
std::string name_
 
DQMStorestore_
 
std::string triggerTag_
 
std::string triggerTagAlias_
 
bool validity_
 

Detailed Description

Definition at line 13 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,
std::string  dqmBaseFolder 
)

Definition at line 3 of file HLTTauDQMTrkPlotter.cc.

References DQMStore::book1D(), doRef_, HLTTauDQMPlotter::dqmBaseFolder_, alignCSCRings::e, EtaEffDenom, EtaEffNum, EtEffDenom, EtEffNum, EtMax_, MonitorElement::getTH1F(), edm::ParameterSet::getUntrackedParameter(), hasLeadTrack, isoJetEt, isoJetEta, isoJetPhi, isolJets_, jetEt, jetEta, jetPhi, jetTagSrc_, mcMatch_, HLTTauDQMPlotter::name_, NEtaBins_, NPhiBins_, NPtBins_, nPxlTrksInL25Jet, nQPxlTrksInL25Jet, PhiEffDenom, PhiEffNum, DQMStore::removeContents(), DQMStore::setCurrentFolder(), signalLeadTrkPt, HLTTauDQMPlotter::store_, HLTTauDQMPlotter::triggerTag(), HLTTauDQMPlotter::triggerTag_, HLTTauDQMPlotter::triggerTagAlias_, type_, HLTTauDQMPlotter::validity_, and cms::Exception::what().

3  {
4  //Initialize Plotter
5  name_ = "HLTTauDQMTrkPlotter";
6 
7  //Process PSet
8  try {
9  jetTagSrc_ = iConfig.getUntrackedParameter<edm::InputTag>("ConeIsolation");
10  isolJets_ = iConfig.getUntrackedParameter<edm::InputTag>("IsolatedJets");
11  triggerTag_ = iConfig.getUntrackedParameter<std::string>("DQMFolder");
12  triggerTagAlias_ = iConfig.getUntrackedParameter<std::string>("Alias","");
13  type_ = iConfig.getUntrackedParameter<std::string>("Type");
14  mcMatch_ = dr;
15  EtMax_ = maxpt;
16  NPtBins_ = etbins;
17  NEtaBins_ = etabins;
18  NPhiBins_ = phibins;
19  dqmBaseFolder_ = dqmBaseFolder;
20  doRef_ = ref;
21  validity_ = true;
22  } catch ( cms::Exception &e ) {
23  edm::LogWarning("HLTTauDQMTrkPlotter::HLTTauDQMTrkPlotter") << e.what() << std::endl;
24  validity_ = false;
25  return;
26  }
27 
28  if (store_) {
29  //Create the histograms
32 
33  jetEt = store_->book1D((type_+"TauEt").c_str(), "#tau E_{T}",NPtBins_,0,EtMax_);
34  jetEta = store_->book1D((type_+"TauEta").c_str(), "#tau #eta", NEtaBins_, -2.5, 2.5);
35  jetPhi = store_->book1D((type_+"TauPhi").c_str(), "#tau #phi", NPhiBins_, -3.2, 3.2);
36  isoJetEt = store_->book1D((type_+"IsolJetEt").c_str(), "Selected Jet E_{T}", NPtBins_, 0,EtMax_);
37  isoJetEta = store_->book1D((type_+"IsolJetEta").c_str(), "Selected Jet #eta", NEtaBins_, -2.5, 2.5);
38  isoJetPhi = store_->book1D((type_+"IsolJetPhi").c_str(), "Selected jet #phi", NPhiBins_, -3.2, 3.2);
39 
40  nPxlTrksInL25Jet = store_->book1D((type_+"nTracks").c_str(), "# RECO Tracks", 30, 0, 30);
41  nQPxlTrksInL25Jet = store_->book1D((type_+"nQTracks").c_str(),"# Quality RECO Tracks", 15, 0, 15);
42  signalLeadTrkPt = store_->book1D((type_+"LeadTrackPt").c_str(), "Lead Track p_{T}", 75, 0, 150);
43  hasLeadTrack = store_->book1D((type_+"HasLeadTrack").c_str(), "Lead Track ?", 2, 0, 2);
44 
45  EtEffNum = store_->book1D((type_+"TauEtEffNum").c_str(),"Efficiency vs E_{T} (Numerator)",NPtBins_,0,EtMax_);
46  EtEffNum->getTH1F()->Sumw2();
47 
48  EtEffDenom = store_->book1D((type_+"TauEtEffDenom").c_str(),"Efficiency vs E_{T} (Denominator)",NPtBins_,0,EtMax_);
49  EtEffDenom->getTH1F()->Sumw2();
50 
51  EtaEffNum = store_->book1D((type_+"TauEtaEffNum").c_str(),"Efficiency vs #eta (Numerator)",NEtaBins_,-2.5,2.5);
52  EtaEffNum->getTH1F()->Sumw2();
53 
54  EtaEffDenom = store_->book1D((type_+"TauEtaEffDenom").c_str(),"Efficiency vs #eta (Denominator)",NEtaBins_,-2.5,2.5);
55  EtaEffDenom->getTH1F()->Sumw2();
56 
57  PhiEffNum = store_->book1D((type_+"TauPhiEffNum").c_str(),"Efficiency vs #phi (Numerator)",NPhiBins_,-3.2,3.2);
58  PhiEffNum->getTH1F()->Sumw2();
59 
60  PhiEffDenom = store_->book1D((type_+"TauPhiEffDenom").c_str(),"Efficiency vs #phi (Denominator)",NPhiBins_,-3.2,3.2);
61  PhiEffDenom->getTH1F()->Sumw2();
62  }
63 }
virtual char const * what() const
Definition: Exception.cc:141
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * EtaEffNum
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:717
MonitorElement * jetPhi
MonitorElement * jetEt
MonitorElement * PhiEffDenom
MonitorElement * isoJetEta
void removeContents(void)
erase all monitoring elements in current directory (not including subfolders);
Definition: DQMStore.cc:2564
std::string triggerTagAlias_
MonitorElement * jetEta
MonitorElement * nPxlTrksInL25Jet
MonitorElement * EtEffNum
MonitorElement * nQPxlTrksInL25Jet
MonitorElement * isoJetEt
MonitorElement * hasLeadTrack
MonitorElement * signalLeadTrkPt
std::string triggerTag()
MonitorElement * PhiEffNum
TH1F * getTH1F(void) const
MonitorElement * EtEffDenom
MonitorElement * EtaEffDenom
std::string triggerTag_
MonitorElement * isoJetPhi
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
std::string dqmBaseFolder_
HLTTauDQMTrkPlotter::~HLTTauDQMTrkPlotter ( )

Definition at line 66 of file HLTTauDQMTrkPlotter.cc.

66  {
67 }

Member Function Documentation

void HLTTauDQMTrkPlotter::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup,
const std::map< int, LVColl > &  mcInfo 
)

Definition at line 69 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, HLTTauDQMPlotter::match(), matchJet(), mcMatch_, nPxlTrksInL25Jet, nQPxlTrksInL25Jet, reco::LeafCandidate::p4(), PhiEffDenom, PhiEffNum, dt_dqm_sourceclient_common_cff::reco, reco::IsolatedTauTagInfo::selectedTracks(), signalLeadTrkPt, and edm::RefVector< C, T, F >::size().

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

Definition at line 136 of file HLTTauDQMTrkPlotter.cc.

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

Referenced by analyze().

136  {
137  //Loop On the Collection and see if your tau jet is matched to one there
138  //Also find the nearest Matched MC Particle to your Jet (to be complete)
139 
140  bool matched = false;
141 
142  for ( reco::CaloJetCollection::const_iterator it = McInfo.begin(); it != McInfo.end(); ++it ) {
143  double delta = ROOT::Math::VectorUtil::DeltaR(jet.p4().Vect(),it->p4().Vect());
144  if ( delta < mcMatch_ ) {
145  matched = true;
146  }
147  }
148  return matched;
149 }
dbl * delta
Definition: mlp_gen.cc:36
virtual const LorentzVector & p4() const
four-momentum Lorentz vector
const std::string HLTTauDQMTrkPlotter::name ( void  )
inlinevirtual

Implements HLTTauDQMPlotter.

Definition at line 17 of file HLTTauDQMTrkPlotter.h.

References HLTTauDQMPlotter::name_.

Referenced by Vispa.Views.PropertyView.Property::valueChanged().

17 { return name_; }

Member Data Documentation

bool HLTTauDQMTrkPlotter::doRef_
private

Definition at line 51 of file HLTTauDQMTrkPlotter.h.

Referenced by analyze(), and HLTTauDQMTrkPlotter().

MonitorElement* HLTTauDQMTrkPlotter::EtaEffDenom
private

Definition at line 47 of file HLTTauDQMTrkPlotter.h.

Referenced by analyze(), and HLTTauDQMTrkPlotter().

MonitorElement* HLTTauDQMTrkPlotter::EtaEffNum
private

Definition at line 46 of file HLTTauDQMTrkPlotter.h.

Referenced by analyze(), and HLTTauDQMTrkPlotter().

MonitorElement* HLTTauDQMTrkPlotter::EtEffDenom
private

Definition at line 45 of file HLTTauDQMTrkPlotter.h.

Referenced by analyze(), and HLTTauDQMTrkPlotter().

MonitorElement* HLTTauDQMTrkPlotter::EtEffNum
private

Definition at line 44 of file HLTTauDQMTrkPlotter.h.

Referenced by analyze(), and HLTTauDQMTrkPlotter().

double HLTTauDQMTrkPlotter::EtMax_
private

Definition at line 54 of file HLTTauDQMTrkPlotter.h.

Referenced by HLTTauDQMTrkPlotter().

MonitorElement* HLTTauDQMTrkPlotter::hasLeadTrack
private

Definition at line 42 of file HLTTauDQMTrkPlotter.h.

Referenced by analyze(), and HLTTauDQMTrkPlotter().

MonitorElement* HLTTauDQMTrkPlotter::isoJetEt
private

Definition at line 35 of file HLTTauDQMTrkPlotter.h.

Referenced by analyze(), and HLTTauDQMTrkPlotter().

MonitorElement* HLTTauDQMTrkPlotter::isoJetEta
private

Definition at line 36 of file HLTTauDQMTrkPlotter.h.

Referenced by analyze(), and HLTTauDQMTrkPlotter().

MonitorElement* HLTTauDQMTrkPlotter::isoJetPhi
private

Definition at line 37 of file HLTTauDQMTrkPlotter.h.

Referenced by analyze(), and HLTTauDQMTrkPlotter().

edm::InputTag HLTTauDQMTrkPlotter::isolJets_
private

Definition at line 25 of file HLTTauDQMTrkPlotter.h.

Referenced by analyze(), and HLTTauDQMTrkPlotter().

MonitorElement* HLTTauDQMTrkPlotter::jetEt
private

Definition at line 31 of file HLTTauDQMTrkPlotter.h.

Referenced by analyze(), and HLTTauDQMTrkPlotter().

MonitorElement* HLTTauDQMTrkPlotter::jetEta
private

Definition at line 32 of file HLTTauDQMTrkPlotter.h.

Referenced by analyze(), and HLTTauDQMTrkPlotter().

MonitorElement* HLTTauDQMTrkPlotter::jetPhi
private

Definition at line 33 of file HLTTauDQMTrkPlotter.h.

Referenced by analyze(), and HLTTauDQMTrkPlotter().

edm::InputTag HLTTauDQMTrkPlotter::jetTagSrc_
private

Definition at line 24 of file HLTTauDQMTrkPlotter.h.

Referenced by analyze(), and HLTTauDQMTrkPlotter().

double HLTTauDQMTrkPlotter::mcMatch_
private

Definition at line 29 of file HLTTauDQMTrkPlotter.h.

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

int HLTTauDQMTrkPlotter::NEtaBins_
private

Definition at line 56 of file HLTTauDQMTrkPlotter.h.

Referenced by HLTTauDQMTrkPlotter().

int HLTTauDQMTrkPlotter::NPhiBins_
private

Definition at line 57 of file HLTTauDQMTrkPlotter.h.

Referenced by HLTTauDQMTrkPlotter().

int HLTTauDQMTrkPlotter::NPtBins_
private

Definition at line 55 of file HLTTauDQMTrkPlotter.h.

Referenced by HLTTauDQMTrkPlotter().

MonitorElement* HLTTauDQMTrkPlotter::nPxlTrksInL25Jet
private

Definition at line 39 of file HLTTauDQMTrkPlotter.h.

Referenced by analyze(), and HLTTauDQMTrkPlotter().

MonitorElement* HLTTauDQMTrkPlotter::nQPxlTrksInL25Jet
private

Definition at line 40 of file HLTTauDQMTrkPlotter.h.

Referenced by analyze(), and HLTTauDQMTrkPlotter().

MonitorElement* HLTTauDQMTrkPlotter::PhiEffDenom
private

Definition at line 49 of file HLTTauDQMTrkPlotter.h.

Referenced by analyze(), and HLTTauDQMTrkPlotter().

MonitorElement* HLTTauDQMTrkPlotter::PhiEffNum
private

Definition at line 48 of file HLTTauDQMTrkPlotter.h.

Referenced by analyze(), and HLTTauDQMTrkPlotter().

MonitorElement* HLTTauDQMTrkPlotter::signalLeadTrkPt
private

Definition at line 41 of file HLTTauDQMTrkPlotter.h.

Referenced by analyze(), and HLTTauDQMTrkPlotter().

std::string HLTTauDQMTrkPlotter::type_
private