CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Private Member Functions | Private Attributes
Tau3MuMonitor Class Reference

#include <Tau3MuMonitor.h>

Inheritance diagram for Tau3MuMonitor:
one::DQMEDAnalyzer< T > one::dqmimplementation::DQMBaseClass< T... >

Public Member Functions

 Tau3MuMonitor (const edm::ParameterSet &)
 
 ~Tau3MuMonitor () override
 
- Public Member Functions inherited from one::DQMEDAnalyzer< T >
 DQMEDAnalyzer ()=default
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > const &)=delete
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > &&)=delete
 
 ~DQMEDAnalyzer () override=default
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
static void fillHistoPSetDescription (edm::ParameterSetDescription &pset)
 

Protected Member Functions

void analyze (edm::Event const &iEvent, edm::EventSetup const &iSetup) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 

Static Private Member Functions

static MEbinning getHistoPSet (edm::ParameterSet pset)
 

Private Attributes

MEbinning eta_binning_
 
std::string folderName_
 
std::unique_ptr< GenericTriggerEventFlaggenTriggerEventFlag_
 
MEbinning mass_binning_
 
MEbinning phi_binning_
 
MEbinning pt_binning_
 
MonitorElementtau1DEta_
 
MonitorElementtau1DMass_
 
MonitorElementtau1DPhi_
 
MonitorElementtau1DPt_
 
MonitorElementtau2DEtaPhi_
 
edm::EDGetTokenT< reco::CompositeCandidateCollectiontauToken_
 
bool validProduct_ = true
 

Detailed Description

Definition at line 35 of file Tau3MuMonitor.h.

Constructor & Destructor Documentation

Tau3MuMonitor::Tau3MuMonitor ( const edm::ParameterSet iConfig)

Definition at line 3 of file Tau3MuMonitor.cc.

References tau1DEta_, tau1DMass_, tau1DPhi_, tau1DPt_, tau2DEtaPhi_, and ~Tau3MuMonitor().

3  :
4  folderName_ ( iConfig.getParameter<std::string>("FolderName") ) ,
5  tauToken_ ( mayConsume<reco::CompositeCandidateCollection>(iConfig.getParameter<edm::InputTag>("taus") ) ) ,
10  genTriggerEventFlag_( new GenericTriggerEventFlag(iConfig.getParameter<edm::ParameterSet>("GenericTriggerEventPSet"),consumesCollector(), *this) )
11 {
12  // initialise histograms to null
13  tau1DPt_ = nullptr;
14  tau1DEta_ = nullptr;
15  tau1DPhi_ = nullptr;
16  tau1DMass_ = nullptr;
17  tau2DEtaPhi_ = nullptr;
18 }
T getParameter(std::string const &) const
std::string folderName_
Definition: Tau3MuMonitor.h:50
MonitorElement * tau1DEta_
Definition: Tau3MuMonitor.h:57
MonitorElement * tau1DPt_
Definition: Tau3MuMonitor.h:56
MEbinning pt_binning_
Definition: Tau3MuMonitor.h:62
Provides a code based selection for trigger and DCS information in order to have no failing filters i...
static MEbinning getHistoPSet(edm::ParameterSet pset)
std::unique_ptr< GenericTriggerEventFlag > genTriggerEventFlag_
Definition: Tau3MuMonitor.h:67
MonitorElement * tau1DMass_
Definition: Tau3MuMonitor.h:59
MonitorElement * tau1DPhi_
Definition: Tau3MuMonitor.h:58
MEbinning mass_binning_
Definition: Tau3MuMonitor.h:65
MonitorElement * tau2DEtaPhi_
Definition: Tau3MuMonitor.h:60
MEbinning phi_binning_
Definition: Tau3MuMonitor.h:64
MEbinning eta_binning_
Definition: Tau3MuMonitor.h:63
edm::EDGetTokenT< reco::CompositeCandidateCollection > tauToken_
Definition: Tau3MuMonitor.h:54
Tau3MuMonitor::~Tau3MuMonitor ( )
overridedefault

Referenced by Tau3MuMonitor().

Member Function Documentation

void Tau3MuMonitor::analyze ( edm::Event const &  iEvent,
edm::EventSetup const &  iSetup 
)
overrideprotected

Definition at line 86 of file Tau3MuMonitor.cc.

References MonitorElement::Fill(), genTriggerEventFlag_, edm::Event::getByToken(), edm::HandleBase::isValid(), tau1DEta_, tau1DMass_, tau1DPhi_, tau1DPt_, tau2DEtaPhi_, tauToken_, and validProduct_.

87 {
88 
89  // require the trigger to be fired
90  if (genTriggerEventFlag_->on() && !genTriggerEventFlag_->accept(iEvent, iSetup) ) return;
91 
92  // check if the previous event failed because of missing tau3mu collection.
93  // Return silently, a warning must have been issued already at this point
94  if (!validProduct_) return;
95 
96  // get ahold of the tau(3mu) collection
98  iEvent.getByToken( tauToken_, tauHandle );
99 
100  // if the handle is not valid issue a warning (only for the forst occurrency)
101  if (!tauHandle.isValid()) {
102  edm::LogWarning("ProductNotValid") << "Tau3Mu trigger product not valid";
103  validProduct_ = false;
104  return;
105  }
106 
107  // loop and fill
108  for (auto const & itau : *tauHandle) {
109  tau1DPt_ ->Fill(itau.pt ());
110  tau1DEta_ ->Fill(itau.eta ());
111  tau1DPhi_ ->Fill(itau.phi ());
112  tau1DMass_ ->Fill(itau.mass());
113  tau2DEtaPhi_->Fill(itau.eta(), itau.phi());
114  }
115 
116 }
MonitorElement * tau1DEta_
Definition: Tau3MuMonitor.h:57
MonitorElement * tau1DPt_
Definition: Tau3MuMonitor.h:56
std::unique_ptr< GenericTriggerEventFlag > genTriggerEventFlag_
Definition: Tau3MuMonitor.h:67
void Fill(long long x)
MonitorElement * tau1DMass_
Definition: Tau3MuMonitor.h:59
int iEvent
Definition: GenABIO.cc:230
MonitorElement * tau1DPhi_
Definition: Tau3MuMonitor.h:58
bool isValid() const
Definition: HandleBase.h:74
MonitorElement * tau2DEtaPhi_
Definition: Tau3MuMonitor.h:60
edm::EDGetTokenT< reco::CompositeCandidateCollection > tauToken_
Definition: Tau3MuMonitor.h:54
void Tau3MuMonitor::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
overrideprotected

Definition at line 41 of file Tau3MuMonitor.cc.

References DQMStore::IBooker::book1D(), DQMStore::IBooker::book2D(), eta_binning_, folderName_, genTriggerEventFlag_, mass_binning_, phi_binning_, pt_binning_, MonitorElement::setAxisTitle(), DQMStore::IBooker::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, tau1DEta_, tau1DMass_, tau1DPhi_, tau1DPt_, and tau2DEtaPhi_.

44 {
45  std::string histname;
46 
47  std::string currentFolder = folderName_ ;
48  ibooker.setCurrentFolder(currentFolder);
49 
50  // tau 3 mu 1D pt
51  histname = "tau1DPt";
52  tau1DPt_ = ibooker.book1D(histname, "", pt_binning_.nbins, pt_binning_.xmin, pt_binning_.xmax);
53  tau1DPt_->setAxisTitle("3-#mu p_{T} [GeV]", 1);
54  tau1DPt_->setAxisTitle("counts" , 2);
55 
56  // tau 3 mu 1D eta
57  histname = "tau1DEta";
58  tau1DEta_ = ibooker.book1D(histname, "", eta_binning_.nbins, eta_binning_.xmin, eta_binning_.xmax);
59  tau1DEta_->setAxisTitle("3-#mu #eta", 1);
60  tau1DEta_->setAxisTitle("counts" , 2);
61 
62  // tau 3 mu 1D phi
63  histname = "tau1DPhi";
64  tau1DPhi_ = ibooker.book1D(histname, "", phi_binning_.nbins, phi_binning_.xmin, phi_binning_.xmax);
65  tau1DPhi_->setAxisTitle("3-#mu #phi", 1);
66  tau1DPhi_->setAxisTitle("counts" , 2);
67 
68  // tau 3 mu 1D mass
69  histname = "tau1DMass";
70  tau1DMass_ = ibooker.book1D(histname, "", mass_binning_.nbins, mass_binning_.xmin, mass_binning_.xmax);
71  tau1DMass_->setAxisTitle("mass_{3#mu} [GeV]", 1);
72  tau1DMass_->setAxisTitle("counts" , 2);
73 
74  // tau 3 mu 2D eta vs phi
75  histname = "tau2DEtaPhi";
76  tau2DEtaPhi_ = ibooker.book2D(histname, "", eta_binning_.nbins, eta_binning_.xmin, eta_binning_.xmax,
77  phi_binning_.nbins, phi_binning_.xmin, phi_binning_.xmax);
78  tau2DEtaPhi_->setAxisTitle("3-#mu #eta", 1);
79  tau2DEtaPhi_->setAxisTitle("3-#mu #phi", 2);
80 
81  // Initialize the GenericTriggerEventFlag
82  if ( genTriggerEventFlag_ && genTriggerEventFlag_->on() ) genTriggerEventFlag_->initRun( iRun, iSetup );
83 
84 }
std::string folderName_
Definition: Tau3MuMonitor.h:50
MonitorElement * tau1DEta_
Definition: Tau3MuMonitor.h:57
MonitorElement * tau1DPt_
Definition: Tau3MuMonitor.h:56
MEbinning pt_binning_
Definition: Tau3MuMonitor.h:62
std::unique_ptr< GenericTriggerEventFlag > genTriggerEventFlag_
Definition: Tau3MuMonitor.h:67
MonitorElement * tau1DMass_
Definition: Tau3MuMonitor.h:59
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
MonitorElement * tau1DPhi_
Definition: Tau3MuMonitor.h:58
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:106
MEbinning mass_binning_
Definition: Tau3MuMonitor.h:65
MonitorElement * tau2DEtaPhi_
Definition: Tau3MuMonitor.h:60
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:109
MEbinning phi_binning_
Definition: Tau3MuMonitor.h:64
MEbinning eta_binning_
Definition: Tau3MuMonitor.h:63
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void Tau3MuMonitor::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 118 of file Tau3MuMonitor.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), DEFINE_FWK_MODULE, funct::false, fillHistoPSetDescription(), AlCaHLTBitMon_QueryRunRegistry::string, and funct::true.

119 {
121  //
122  desc.add<std::string> ( "FolderName", "HLT/BPH/" );
123  //
124  desc.add<edm::InputTag>( "taus", edm::InputTag("hltTauPt10MuPts511Mass1p2to2p3Iso", "Taus") );
125  //
131  fillHistoPSetDescription(ptPSet ); // order matters: this must come before the PSets are added
132  fillHistoPSetDescription(etaPSet );
133  fillHistoPSetDescription(phiPSet );
134  fillHistoPSetDescription(massPSet);
135  histoPSet.add<edm::ParameterSetDescription>("ptPSet" , ptPSet );
136  histoPSet.add<edm::ParameterSetDescription>("etaPSet" , etaPSet );
137  histoPSet.add<edm::ParameterSetDescription>("phiPSet" , phiPSet );
138  histoPSet.add<edm::ParameterSetDescription>("massPSet", massPSet);
139  desc.add<edm::ParameterSetDescription>("histoPSet", histoPSet);
140  //
141  edm::ParameterSetDescription genericTriggerEventPSet;
142  genericTriggerEventPSet.add<bool> ("andOr" );
143  genericTriggerEventPSet.add<edm::InputTag> ("dcsInputTag" , edm::InputTag("scalersRawToDigi") );
144  genericTriggerEventPSet.add<std::vector<int> > ("dcsPartitions" , {} );
145  genericTriggerEventPSet.add<bool> ("andOrDcs" , false );
146  genericTriggerEventPSet.add<bool> ("errorReplyDcs" , true );
147  genericTriggerEventPSet.add<std::string> ("dbLabel" , "" );
148  genericTriggerEventPSet.add<bool> ("andOrHlt" , true );
149  genericTriggerEventPSet.add<edm::InputTag> ("hltInputTag" , edm::InputTag("TriggerResults::HLT") );
150  genericTriggerEventPSet.add<std::vector<std::string> >("hltPaths" , {} );
151  genericTriggerEventPSet.add<std::string> ("hltDBKey" , "" );
152  genericTriggerEventPSet.add<bool> ("errorReplyHlt" , false );
153  genericTriggerEventPSet.add<unsigned int> ("verbosityLevel", 0 );
154  desc.add<edm::ParameterSetDescription>("GenericTriggerEventPSet", genericTriggerEventPSet);
155  //
156  descriptions.add("tau3muMonitoring", desc);
157 }
static void fillHistoPSetDescription(edm::ParameterSetDescription &pset)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void Tau3MuMonitor::fillHistoPSetDescription ( edm::ParameterSetDescription pset)
static

Definition at line 23 of file Tau3MuMonitor.cc.

References edm::ParameterSetDescription::add().

Referenced by fillDescriptions().

24 {
25  pset.add<unsigned int>( "nbins" );
26  pset.add<double> ( "xmin" );
27  pset.add<double> ( "xmax" );
28 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
MEbinning Tau3MuMonitor::getHistoPSet ( edm::ParameterSet  pset)
staticprivate

Definition at line 31 of file Tau3MuMonitor.cc.

References edm::ParameterSet::getParameter().

32 {
33  return MEbinning{
34  pset.getParameter<unsigned int>("nbins"),
35  pset.getParameter<double > ("xmin" ),
36  pset.getParameter<double > ("xmax" ),
37  };
38 }
T getParameter(std::string const &) const

Member Data Documentation

MEbinning Tau3MuMonitor::eta_binning_
private

Definition at line 63 of file Tau3MuMonitor.h.

Referenced by bookHistograms().

std::string Tau3MuMonitor::folderName_
private

Definition at line 50 of file Tau3MuMonitor.h.

Referenced by bookHistograms().

std::unique_ptr<GenericTriggerEventFlag> Tau3MuMonitor::genTriggerEventFlag_
private

Definition at line 67 of file Tau3MuMonitor.h.

Referenced by analyze(), and bookHistograms().

MEbinning Tau3MuMonitor::mass_binning_
private

Definition at line 65 of file Tau3MuMonitor.h.

Referenced by bookHistograms().

MEbinning Tau3MuMonitor::phi_binning_
private

Definition at line 64 of file Tau3MuMonitor.h.

Referenced by bookHistograms().

MEbinning Tau3MuMonitor::pt_binning_
private

Definition at line 62 of file Tau3MuMonitor.h.

Referenced by bookHistograms().

MonitorElement* Tau3MuMonitor::tau1DEta_
private

Definition at line 57 of file Tau3MuMonitor.h.

Referenced by analyze(), bookHistograms(), and Tau3MuMonitor().

MonitorElement* Tau3MuMonitor::tau1DMass_
private

Definition at line 59 of file Tau3MuMonitor.h.

Referenced by analyze(), bookHistograms(), and Tau3MuMonitor().

MonitorElement* Tau3MuMonitor::tau1DPhi_
private

Definition at line 58 of file Tau3MuMonitor.h.

Referenced by analyze(), bookHistograms(), and Tau3MuMonitor().

MonitorElement* Tau3MuMonitor::tau1DPt_
private

Definition at line 56 of file Tau3MuMonitor.h.

Referenced by analyze(), bookHistograms(), and Tau3MuMonitor().

MonitorElement* Tau3MuMonitor::tau2DEtaPhi_
private

Definition at line 60 of file Tau3MuMonitor.h.

Referenced by analyze(), bookHistograms(), and Tau3MuMonitor().

edm::EDGetTokenT<reco::CompositeCandidateCollection> Tau3MuMonitor::tauToken_
private

Definition at line 54 of file Tau3MuMonitor.h.

Referenced by analyze().

bool Tau3MuMonitor::validProduct_ = true
private

Definition at line 52 of file Tau3MuMonitor.h.

Referenced by analyze().