17 #include "TGraphAsymmErrors.h"
55 virtual void endJob();
80 size_t dim = HLTMu.size();
84 double muRecoPt= mu.
pt();
85 hTrigMuonPtDenS_-> Fill(muRecoPt);
87 if (dim==0)
return false;
88 for (
size_t k =0;
k< dim;
k++ ) {
89 if ( (
deltaR(HLTMu[
k], mu) < DR) && (fabs(HLTMu[k].
pt() - mu.
pt())/ HLTMu[k].
pt()<DPtRel)){
91 std::cout<<
" matching a muon " << std::endl;
92 std::cout <<
"muon reco pt : " << muRecoPt<< std::endl;
94 std::cout <<
"muon trigger pt "<< HLTMu[
k].pt() << std::endl;
96 hTrigMuonPtNumS_-> Fill(muRecoPt);
97 deltaR_-> Fill(
deltaR(HLTMu[k], mu));
98 deltaPtOverPt_-> Fill(fabs(HLTMu[k].
pt() - mu.
pt())/ HLTMu[k].
pt());
101 std::cout <<
"muon trigger eta : "<< HLTMu[
k].eta() << std::endl;
102 std::cout <<
"deltaR((HLTMu[k], mu)): "<<
deltaR(HLTMu[k], mu) << std::endl;
103 std::cout <<
"deltaPtOverPt: "<< fabs(HLTMu[k].
pt() - mu.
pt())/ HLTMu[k].
pt() << std::endl;
113 trigTag_(cfg.getParameter<edm::
InputTag> (
"TrigTag")),
114 trigEv_(cfg.getParameter<edm::
InputTag> (
"triggerEvent")),
115 muonTag_(cfg.getUntrackedParameter<edm::
InputTag>(
"muons")),
116 ptMuCut_(cfg.getUntrackedParameter<double>(
"ptMuCut")),
117 etaMuCut_(cfg.getUntrackedParameter<double>(
"etaMuCut")),
118 hltPath_(cfg.getParameter<std::string >(
"hltPath")),
119 L3FilterName_(cfg.getParameter<std::string >(
"L3FilterName")),
120 maxDPtRel_(cfg.getParameter<double>(
"maxDPtRel")),
121 maxDeltaR_(cfg.getParameter<double>(
"maxDeltaR")),
122 nbins_(cfg.getParameter<double>(
"ptMax_")),
123 ptMax_(cfg.getParameter<double>(
"ptMax_")){
143 bool singleTrigFlag1 =
false;
150 LogWarning(
"") <<
">>> TRIGGER collection does not exist !!!";
156 bool trigger_fired =
false;
157 for (
unsigned int i=0;
i<triggerResults->size();
i++) {
161 if ( trigName ==
hltPath_ && triggerResults->accept(
i)) {
162 trigger_fired =
true;
168 LogWarning(
"errorTriggerEventValid" ) <<
"trigger::TriggerEvent product with InputTag " <<
trigEv_.
encode() <<
" not in event";
174 std::vector<reco::Particle> HLTMuMatched;
175 for (
size_t ia = 0; ia < handleTriggerEvent->sizeFilters(); ++ ia) {
176 std::string fullname = handleTriggerEvent->filterTag(ia).encode();
178 size_t p = fullname.find_first_of(
':');
179 if ( p != std::string::npos) {
180 name = fullname.substr(0, p);
187 for (trigger::Keys::const_iterator ki = k.begin(); ki !=k.end(); ++ki ) {
189 HLTMuMatched.push_back(toc[*ki].particle());
199 LogError(
"") <<
">>> muon collection does not exist !!!";
205 std::vector<reco::Muon> highPtGlbMuons;
207 for (
unsigned int i=0;
i<muons->size();
i++ ){
215 unsigned int nHighPtGlbMu = highPtGlbMuons.size();
216 std::cout <<
"I've got " << nHighPtGlbMu <<
" nHighPtGlbMu" << std::endl;
220 (nHighPtGlbMu> 10)? nHighPtGlbMu=10 : 1;
222 if (nHighPtGlbMu>0 ){
224 for(
unsigned int i =0 ;
i < nHighPtGlbMu ;
i++) {
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
#define DEFINE_FWK_MODULE(type)
edm::Handle< trigger::TriggerEvent > handleTriggerEvent_
bool isGlobalMuon() const
edm::TriggerNames const * trigNames_
edm::Handle< edm::TriggerResults > triggerResults_
virtual double eta() const
momentum pseudorapidity
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
virtual void analyze(const edm::Event &event, const edm::EventSetup &setup)
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
double deltaR(double eta1, double eta2, double phi1, double phi2)
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
static const char *const trigNames[]
MuTriggerAnalyzer(const edm::ParameterSet &pset)
virtual double pt() const
transverse momentum
std::string const & triggerName(unsigned int index) const
std::vector< size_type > Keys
bool IsMuMatchedToHLTMu(const reco::Muon &, std::vector< reco::Particle >, double, double)
T * make() const
make new ROOT object
bool IsMuMatchedToHLTMu(const reco::Candidate *dau, std::vector< reco::Particle > HLTMu, double DR, double DPtRel)
virtual const LorentzVector & p4() const
four-momentum Lorentz vector
std::string L3FilterName_