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::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > > edm::stream::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 SUSY_HLT_MuonFakes (const edm::ParameterSet &ps)
 
virtual ~SUSY_HLT_MuonFakes ()
 
- Public Member Functions inherited from DQMEDAnalyzer
virtual void beginRun (edm::Run const &, edm::EventSetup const &) final
 
virtual void beginStream (edm::StreamID id) final
 
 DQMEDAnalyzer (void)
 
virtual void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
virtual void endRunSummary (edm::Run const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
uint32_t streamId () const
 
- Public Member Functions inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Member Functions

void analyze (edm::Event const &e, edm::EventSetup const &eSetup) override
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, 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
 
void endLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &eSetup) override
 
void endRun (edm::Run const &run, edm::EventSetup const &eSetup) override
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

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 edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDAnalyzerBase
typedef EDAnalyzerAdaptorBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static std::shared_ptr< dqmDetails::NoCacheglobalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr< dqmDetails::NoCacheglobalBeginRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *)
 
static void globalEndLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *, dqmDetails::NoCache *)
 
static void globalEndRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *, dqmDetails::NoCache *)
 
- Static Public Member Functions inherited from edm::stream::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Detailed Description

Definition at line 39 of file SUSY_HLT_MuonFakes.h.

Constructor & Destructor Documentation

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

Definition at line 9 of file SUSY_HLT_MuonFakes.cc.

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

10 {
11  edm::LogInfo("SUSY_HLT_MuonFakes") << "Constructor SUSY_HLT_MuonFakes::SUSY_HLT_MuonFakes " << std::endl;
12  // Get parameters from configuration file
13  theTrigSummary_ = consumes<trigger::TriggerEvent>(ps.getParameter<edm::InputTag>("trigSummary"));
14  triggerResults_ = consumes<edm::TriggerResults>(ps.getParameter<edm::InputTag>("TriggerResults"));
15  HLTProcess_ = ps.getParameter<std::string>("HLTProcess");
16  triggerPath_ = ps.getParameter<std::string>("TriggerPath");
17  triggerFilter_ = ps.getParameter<edm::InputTag>("TriggerFilter");
18 }
T getParameter(std::string const &) const
edm::EDGetTokenT< edm::TriggerResults > triggerResults_
edm::InputTag triggerFilter_
edm::EDGetTokenT< trigger::TriggerEvent > theTrigSummary_
SUSY_HLT_MuonFakes::~SUSY_HLT_MuonFakes ( )
virtual

Definition at line 20 of file SUSY_HLT_MuonFakes.cc.

21 {
22  edm::LogInfo("SUSY_HLT_MuonFakes") << "Destructor SUSY_HLT_MuonFakes::~SUSY_HLT_MuonFakes " << std::endl;
23 }

Member Function Documentation

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

Implements edm::stream::EDAnalyzerBase.

Definition at line 65 of file SUSY_HLT_MuonFakes.cc.

References trigger::TriggerObject::eta(), MonitorElement::Fill(), trigger::TriggerEvent::filterIndex(), trigger::TriggerEvent::filterKeys(), edm::Event::getByToken(), trigger::TriggerEvent::getObjects(), h_triggerMuEta, h_triggerMuPhi, h_triggerMuPt, trigger::TriggerObject::id(), edm::HandleBase::isValid(), relativeConstraints::keys, trigger::TriggerObject::phi(), trigger::TriggerObject::pt(), trigger::TriggerEvent::sizeFilters(), theTrigSummary_, triggerFilter_, TriggerAnalyzer::triggerObjects, and triggerResults_.

65  {
66  edm::LogInfo("SUSY_HLT_MuonFakes") << "SUSY_HLT_MuonFakes::analyze" << std::endl;
67 
68 
69  //-------------------------------
70  //--- Trigger
71  //-------------------------------
73  e.getByToken(triggerResults_,hltresults);
74  if(!hltresults.isValid()){
75  edm::LogError ("SUSY_HLT_MuonFakes") << "invalid collection: TriggerResults" << "\n";
76  return;
77  }
79  e.getByToken(theTrigSummary_, triggerSummary);
80  if(!triggerSummary.isValid()) {
81  edm::LogError ("SUSY_HLT_MuonFakes") << "invalid collection: TriggerSummary" << "\n";
82  return;
83  }
84 
85 
86  //get online objects
87  std::vector<float> ptMuon, etaMuon, phiMuon;
88  size_t filterIndex = triggerSummary->filterIndex( triggerFilter_ );
90  if( !(filterIndex >= triggerSummary->sizeFilters()) ){
91  const trigger::Keys& keys = triggerSummary->filterKeys( filterIndex );
92  for( size_t j = 0; j < keys.size(); ++j ){
93  trigger::TriggerObject foundObject = triggerObjects[keys[j]];
94  if(foundObject.id() == 13){ //Muons check number
95  h_triggerMuPt->Fill(foundObject.pt());
96  h_triggerMuEta->Fill(foundObject.eta());
97  h_triggerMuPhi->Fill(foundObject.phi());
98  ptMuon.push_back(foundObject.pt());
99  etaMuon.push_back(foundObject.eta());
100  phiMuon.push_back(foundObject.phi());
101  }
102  }
103  }
104 
105 
106 // bool hasFired = false;
107 // const edm::TriggerNames& trigNames = e.triggerNames(*hltresults);
108 // unsigned int numTriggers = trigNames.size();
109 // for( unsigned int hltIndex=0; hltIndex<numTriggers; ++hltIndex ){
110 // if (trigNames.triggerName(hltIndex)==triggerPath_ && hltresults->wasrun(hltIndex) && hltresults->accept(hltIndex)) hasFired = true;
111 // }
112 
113 }
int id() const
getters
Definition: TriggerObject.h:55
trigger::size_type sizeFilters() const
Definition: TriggerEvent.h:135
float phi() const
Definition: TriggerObject.h:58
const Keys & filterKeys(trigger::size_type index) const
Definition: TriggerEvent.h:111
trigger::size_type filterIndex(const edm::InputTag &filterTag) const
find index of filter in data-member vector from filter tag
Definition: TriggerEvent.h:123
MonitorElement * h_triggerMuEta
float eta() const
Definition: TriggerObject.h:57
edm::EDGetTokenT< edm::TriggerResults > triggerResults_
void Fill(long long x)
Single trigger physics object (e.g., an isolated muon)
Definition: TriggerObject.h:22
edm::InputTag triggerFilter_
const TriggerObjectCollection & getObjects() const
Definition: TriggerEvent.h:98
bool isValid() const
Definition: HandleBase.h:74
edm::EDGetTokenT< trigger::TriggerEvent > theTrigSummary_
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
Definition: TriggerObject.h:81
MonitorElement * h_triggerMuPhi
MonitorElement * h_triggerMuPt
std::vector< size_type > Keys
void SUSY_HLT_MuonFakes::beginLuminosityBlock ( edm::LuminosityBlock const &  lumi,
edm::EventSetup const &  eSetup 
)
overrideprotectedvirtual

Reimplemented from edm::stream::EDAnalyzerBase.

Definition at line 57 of file SUSY_HLT_MuonFakes.cc.

59 {
60  edm::LogInfo("SUSY_HLT_MuonFakes") << "SUSY_HLT_MuonFakes::beginLuminosityBlock" << std::endl;
61 }
void SUSY_HLT_MuonFakes::bookHistograms ( DQMStore::IBooker ibooker_,
edm::Run const &  ,
edm::EventSetup const &   
)
overrideprotectedvirtual

Implements DQMEDAnalyzer.

Definition at line 50 of file SUSY_HLT_MuonFakes.cc.

References bookHistos().

51 {
52  edm::LogInfo("SUSY_HLT_MuonFakes") << "SUSY_HLT_MuonFakes::bookHistograms" << std::endl;
53  //book at beginRun
54  bookHistos(ibooker_);
55 }
void bookHistos(DQMStore::IBooker &)
void SUSY_HLT_MuonFakes::bookHistos ( DQMStore::IBooker ibooker_)
private

Definition at line 127 of file SUSY_HLT_MuonFakes.cc.

References DQMStore::IBooker::book1D(), DQMStore::IBooker::cd(), DEFINE_FWK_MODULE, h_triggerMuEta, h_triggerMuPhi, h_triggerMuPt, DQMStore::IBooker::setCurrentFolder(), and triggerPath_.

Referenced by bookHistograms().

128 {
129  ibooker_.cd();
130  ibooker_.setCurrentFolder("HLT/SUSYBSM/" + triggerPath_);
131 
132  //online quantities
133  h_triggerMuPt = ibooker_.book1D("triggerMuPt", "Trigger Mu Pt; GeV", 40, 0.0, 80.0);
134  h_triggerMuEta = ibooker_.book1D("triggerMuEta", "Trigger Mu Eta", 20, -2.5, 2.5);
135  h_triggerMuPhi = ibooker_.book1D("triggerMuPhi", "Trigger Mu Phi", 20, -3.5, 3.5);
136 
137 
138  //num and den hists to be divided in harvesting step to make turn on curves
139  ibooker_.cd();
140 }
void cd(void)
Definition: DQMStore.cc:269
MonitorElement * h_triggerMuEta
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
MonitorElement * h_triggerMuPhi
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:277
MonitorElement * h_triggerMuPt
void SUSY_HLT_MuonFakes::dqmBeginRun ( edm::Run const &  run,
edm::EventSetup const &  e 
)
overrideprotectedvirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 25 of file SUSY_HLT_MuonFakes.cc.

References fHltConfig, spr::find(), HLTProcess_, HLTConfigProvider::init(), HLTConfigProvider::triggerNames(), and triggerPath_.

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

Reimplemented from edm::stream::EDAnalyzerBase.

Definition at line 116 of file SUSY_HLT_MuonFakes.cc.

117 {
118  edm::LogInfo("SUSY_HLT_MuonFakes") << "SUSY_HLT_MuonFakes::endLuminosityBlock" << std::endl;
119 }
void SUSY_HLT_MuonFakes::endRun ( edm::Run const &  run,
edm::EventSetup const &  eSetup 
)
overrideprotectedvirtual

Reimplemented from edm::stream::EDAnalyzerBase.

Definition at line 122 of file SUSY_HLT_MuonFakes.cc.

123 {
124  edm::LogInfo("SUSY_HLT_MuonFakes") << "SUSY_HLT_MuonFakes::endRun" << std::endl;
125 }

Member Data Documentation

HLTConfigProvider SUSY_HLT_MuonFakes::fHltConfig
private

Definition at line 62 of file SUSY_HLT_MuonFakes.h.

Referenced by dqmBeginRun().

MonitorElement* SUSY_HLT_MuonFakes::h_triggerMuEta
private

Definition at line 70 of file SUSY_HLT_MuonFakes.h.

Referenced by analyze(), and bookHistos().

MonitorElement* SUSY_HLT_MuonFakes::h_triggerMuPhi
private

Definition at line 71 of file SUSY_HLT_MuonFakes.h.

Referenced by analyze(), and bookHistos().

MonitorElement* SUSY_HLT_MuonFakes::h_triggerMuPt
private

Definition at line 69 of file SUSY_HLT_MuonFakes.h.

Referenced by analyze(), and bookHistos().

std::string SUSY_HLT_MuonFakes::HLTProcess_
private

Definition at line 64 of file SUSY_HLT_MuonFakes.h.

Referenced by dqmBeginRun(), and SUSY_HLT_MuonFakes().

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

Definition at line 59 of file SUSY_HLT_MuonFakes.h.

Referenced by analyze(), and SUSY_HLT_MuonFakes().

edm::InputTag SUSY_HLT_MuonFakes::triggerFilter_
private

Definition at line 66 of file SUSY_HLT_MuonFakes.h.

Referenced by analyze(), and SUSY_HLT_MuonFakes().

std::string SUSY_HLT_MuonFakes::triggerPath_
private

Definition at line 65 of file SUSY_HLT_MuonFakes.h.

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

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

Definition at line 58 of file SUSY_HLT_MuonFakes.h.

Referenced by analyze(), and SUSY_HLT_MuonFakes().