CMS 3D CMS Logo

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

#include <SUSY_HLT_MuonFakes.h>

Inheritance diagram for SUSY_HLT_MuonFakes:
DQMEDAnalyzer edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >

Public Member Functions

 SUSY_HLT_MuonFakes (const edm::ParameterSet &ps)
 
 ~SUSY_HLT_MuonFakes () override
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &event, edm::EventSetup const &setup) final
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
void beginStream (edm::StreamID id) final
 
 DQMEDAnalyzer ()
 
void endLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Protected Member Functions

void analyze (edm::Event const &e, edm::EventSetup const &eSetup) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
void dqmBeginRun (edm::Run const &, edm::EventSetup const &) override
 
- Protected Member Functions inherited from DQMEDAnalyzer
uint64_t meId () const
 

Private Member Functions

void bookHistos (DQMStore::IBooker &)
 

Private Attributes

HLTConfigProvider fHltConfig
 
MonitorElementh_triggerMuEta
 
MonitorElementh_triggerMuPhi
 
MonitorElementh_triggerMuPt
 
std::string HLTProcess_
 
edm::EDGetTokenT< trigger::TriggerEventtheTrigSummary_
 
edm::InputTag triggerFilter_
 
std::string triggerPath_
 
edm::EDGetTokenT< edm::TriggerResultstriggerResults_
 

Additional Inherited Members

- Public Types inherited from DQMEDAnalyzer
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static void globalEndJob (DQMEDAnalyzerGlobalCache const *)
 
static void globalEndLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup, LuminosityBlockContext const *context)
 
static void globalEndRunProduce (edm::Run &run, edm::EventSetup const &setup, RunContext const *context)
 
static std::unique_ptr< DQMEDAnalyzerGlobalCacheinitializeGlobalCache (edm::ParameterSet const &)
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 
unsigned int streamId_
 

Detailed Description

Definition at line 33 of file SUSY_HLT_MuonFakes.h.

Constructor & Destructor Documentation

◆ SUSY_HLT_MuonFakes()

SUSY_HLT_MuonFakes::SUSY_HLT_MuonFakes ( const edm::ParameterSet ps)

Definition at line 8 of file SUSY_HLT_MuonFakes.cc.

References edm::ParameterSet::getParameter(), HLTProcess_, AlCaHLTBitMon_QueryRunRegistry::string, theTrigSummary_, triggerFilter_, triggerPath_, and triggerResults_.

8  {
9  edm::LogInfo("SUSY_HLT_MuonFakes") << "Constructor SUSY_HLT_MuonFakes::SUSY_HLT_MuonFakes " << std::endl;
10  // Get parameters from configuration file
11  theTrigSummary_ = consumes<trigger::TriggerEvent>(ps.getParameter<edm::InputTag>("trigSummary"));
12  triggerResults_ = consumes<edm::TriggerResults>(ps.getParameter<edm::InputTag>("TriggerResults"));
13  HLTProcess_ = ps.getParameter<std::string>("HLTProcess");
14  triggerPath_ = ps.getParameter<std::string>("TriggerPath");
15  triggerFilter_ = ps.getParameter<edm::InputTag>("TriggerFilter");
16 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
edm::EDGetTokenT< edm::TriggerResults > triggerResults_
edm::InputTag triggerFilter_
edm::EDGetTokenT< trigger::TriggerEvent > theTrigSummary_
Log< level::Info, false > LogInfo

◆ ~SUSY_HLT_MuonFakes()

SUSY_HLT_MuonFakes::~SUSY_HLT_MuonFakes ( )
override

Definition at line 18 of file SUSY_HLT_MuonFakes.cc.

18  {
19  edm::LogInfo("SUSY_HLT_MuonFakes") << "Destructor SUSY_HLT_MuonFakes::~SUSY_HLT_MuonFakes " << std::endl;
20 }
Log< level::Info, false > LogInfo

Member Function Documentation

◆ analyze()

void SUSY_HLT_MuonFakes::analyze ( edm::Event const &  e,
edm::EventSetup const &  eSetup 
)
overrideprotectedvirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 52 of file SUSY_HLT_MuonFakes.cc.

References MillePedeFileConverter_cfg::e, trigger::TriggerObject::eta(), dqm::impl::MonitorElement::Fill(), h_triggerMuEta, h_triggerMuPhi, h_triggerMuPt, HLTBitAnalyser_cfi::hltresults, trigger::TriggerObject::id(), dqmiolumiharvest::j, relativeConstraints::keys, trigger::TriggerObject::phi(), trigger::TriggerObject::pt(), theTrigSummary_, triggerFilter_, triggerMatchMonitor_cfi::triggerObjects, triggerResults_, and HLTMuonOfflineAnalyzer_cfi::triggerSummary.

52  {
53  edm::LogInfo("SUSY_HLT_MuonFakes") << "SUSY_HLT_MuonFakes::analyze" << std::endl;
54 
55  //-------------------------------
56  //--- Trigger
57  //-------------------------------
59  e.getByToken(triggerResults_, hltresults);
60  if (!hltresults.isValid()) {
61  edm::LogError("SUSY_HLT_MuonFakes") << "invalid collection: TriggerResults"
62  << "\n";
63  return;
64  }
66  e.getByToken(theTrigSummary_, triggerSummary);
67  if (!triggerSummary.isValid()) {
68  edm::LogError("SUSY_HLT_MuonFakes") << "invalid collection: TriggerSummary"
69  << "\n";
70  return;
71  }
72 
73  // get online objects
74  std::vector<float> ptMuon, etaMuon, phiMuon;
75  size_t filterIndex = triggerSummary->filterIndex(triggerFilter_);
77  if (!(filterIndex >= triggerSummary->sizeFilters())) {
78  const trigger::Keys &keys = triggerSummary->filterKeys(filterIndex);
79  for (size_t j = 0; j < keys.size(); ++j) {
81  if (foundObject.id() == 13) { // Muons check number
82  h_triggerMuPt->Fill(foundObject.pt());
83  h_triggerMuEta->Fill(foundObject.eta());
84  h_triggerMuPhi->Fill(foundObject.phi());
85  ptMuon.push_back(foundObject.pt());
86  etaMuon.push_back(foundObject.eta());
87  phiMuon.push_back(foundObject.phi());
88  }
89  }
90  }
91 
92  // bool hasFired = false;
93  // const edm::TriggerNames& trigNames = e.triggerNames(*hltresults);
94  // unsigned int numTriggers = trigNames.size();
95  // for( unsigned int hltIndex=0; hltIndex<numTriggers; ++hltIndex ){
96  // if (trigNames.triggerName(hltIndex)==triggerPath_ &&
97  // hltresults->wasrun(hltIndex) && hltresults->accept(hltIndex)) hasFired =
98  // true;
99  // }
100 }
MonitorElement * h_triggerMuEta
edm::EDGetTokenT< edm::TriggerResults > triggerResults_
Log< level::Error, false > LogError
void Fill(long long x)
Single trigger physics object (e.g., an isolated muon)
Definition: TriggerObject.h:21
edm::InputTag triggerFilter_
int id() const
getters
Definition: TriggerObject.h:51
edm::EDGetTokenT< trigger::TriggerEvent > theTrigSummary_
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
Definition: TriggerObject.h:75
Log< level::Info, false > LogInfo
MonitorElement * h_triggerMuPhi
MonitorElement * h_triggerMuPt
std::vector< size_type > Keys

◆ bookHistograms()

void SUSY_HLT_MuonFakes::bookHistograms ( DQMStore::IBooker ibooker_,
edm::Run const &  ,
edm::EventSetup const &   
)
overrideprotectedvirtual

Implements DQMEDAnalyzer.

Definition at line 46 of file SUSY_HLT_MuonFakes.cc.

References bookHistos().

46  {
47  edm::LogInfo("SUSY_HLT_MuonFakes") << "SUSY_HLT_MuonFakes::bookHistograms" << std::endl;
48  // book at beginRun
49  bookHistos(ibooker_);
50 }
void bookHistos(DQMStore::IBooker &)
Log< level::Info, false > LogInfo

◆ bookHistos()

void SUSY_HLT_MuonFakes::bookHistos ( DQMStore::IBooker ibooker_)
private

Definition at line 102 of file SUSY_HLT_MuonFakes.cc.

References dqm::implementation::IBooker::book1D(), dqm::implementation::NavigatorBase::cd(), h_triggerMuEta, h_triggerMuPhi, h_triggerMuPt, dqm::implementation::NavigatorBase::setCurrentFolder(), and triggerPath_.

Referenced by bookHistograms().

102  {
103  ibooker_.cd();
104  ibooker_.setCurrentFolder("HLT/SUSYBSM/" + triggerPath_);
105 
106  // online quantities
107  h_triggerMuPt = ibooker_.book1D("triggerMuPt", "Trigger Mu Pt; GeV", 40, 0.0, 80.0);
108  h_triggerMuEta = ibooker_.book1D("triggerMuEta", "Trigger Mu Eta", 20, -2.5, 2.5);
109  h_triggerMuPhi = ibooker_.book1D("triggerMuPhi", "Trigger Mu Phi", 20, -3.5, 3.5);
110 
111  // num and den hists to be divided in harvesting step to make turn on curves
112  ibooker_.cd();
113 }
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
MonitorElement * h_triggerMuEta
MonitorElement * h_triggerMuPhi
MonitorElement * h_triggerMuPt
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98

◆ dqmBeginRun()

void SUSY_HLT_MuonFakes::dqmBeginRun ( edm::Run const &  run,
edm::EventSetup const &  e 
)
overrideprotectedvirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 22 of file SUSY_HLT_MuonFakes.cc.

References MillePedeFileConverter_cfg::e, fHltConfig, spr::find(), HLTProcess_, HLTConfigProvider::init(), dqmiolumiharvest::j, writedatasetfile::run, HLTConfigProvider::triggerNames(), and triggerPath_.

22  {
23  bool changed;
24 
25  if (!fHltConfig.init(run, e, HLTProcess_, changed)) {
26  edm::LogError("SUSY_HLT_MuonFakes") << "Initialization of HLTConfigProvider failed!!";
27  return;
28  }
29 
30  bool pathFound = false;
31  const std::vector<std::string> allTrigNames = fHltConfig.triggerNames();
32  for (size_t j = 0; j < allTrigNames.size(); ++j) {
33  if (allTrigNames[j].find(triggerPath_) != std::string::npos) {
34  pathFound = true;
35  }
36  }
37 
38  if (!pathFound) {
39  edm::LogInfo("SUSY_HLT_MuonFakes") << "Path not found"
40  << "\n";
41  return;
42  }
43  edm::LogInfo("SUSY_HLT_MuonFakes") << "SUSY_HLT_MuonFakes::beginRun" << std::endl;
44 }
HLTConfigProvider fHltConfig
Log< level::Error, false > LogError
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
Log< level::Info, false > LogInfo
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d&#39;tor
const std::vector< std::string > & triggerNames() const
names of trigger paths

Member Data Documentation

◆ fHltConfig

HLTConfigProvider SUSY_HLT_MuonFakes::fHltConfig
private

Definition at line 51 of file SUSY_HLT_MuonFakes.h.

Referenced by dqmBeginRun().

◆ h_triggerMuEta

MonitorElement* SUSY_HLT_MuonFakes::h_triggerMuEta
private

Definition at line 59 of file SUSY_HLT_MuonFakes.h.

Referenced by analyze(), and bookHistos().

◆ h_triggerMuPhi

MonitorElement* SUSY_HLT_MuonFakes::h_triggerMuPhi
private

Definition at line 60 of file SUSY_HLT_MuonFakes.h.

Referenced by analyze(), and bookHistos().

◆ h_triggerMuPt

MonitorElement* SUSY_HLT_MuonFakes::h_triggerMuPt
private

Definition at line 58 of file SUSY_HLT_MuonFakes.h.

Referenced by analyze(), and bookHistos().

◆ HLTProcess_

std::string SUSY_HLT_MuonFakes::HLTProcess_
private

Definition at line 53 of file SUSY_HLT_MuonFakes.h.

Referenced by dqmBeginRun(), and SUSY_HLT_MuonFakes().

◆ theTrigSummary_

edm::EDGetTokenT<trigger::TriggerEvent> SUSY_HLT_MuonFakes::theTrigSummary_
private

Definition at line 49 of file SUSY_HLT_MuonFakes.h.

Referenced by analyze(), and SUSY_HLT_MuonFakes().

◆ triggerFilter_

edm::InputTag SUSY_HLT_MuonFakes::triggerFilter_
private

Definition at line 55 of file SUSY_HLT_MuonFakes.h.

Referenced by analyze(), and SUSY_HLT_MuonFakes().

◆ triggerPath_

std::string SUSY_HLT_MuonFakes::triggerPath_
private

Definition at line 54 of file SUSY_HLT_MuonFakes.h.

Referenced by bookHistos(), dqmBeginRun(), and SUSY_HLT_MuonFakes().

◆ triggerResults_

edm::EDGetTokenT<edm::TriggerResults> SUSY_HLT_MuonFakes::triggerResults_
private

Definition at line 48 of file SUSY_HLT_MuonFakes.h.

Referenced by analyze(), and SUSY_HLT_MuonFakes().