17 #include "TGraphAsymmErrors.h"
55 virtual void endJob()
override;
81 size_t dim = HLTMu.size();
85 double muRecoPt= mu.
pt();
86 hTrigMuonPtDenS_->
Fill(muRecoPt);
88 if (dim==0)
return false;
89 for (
size_t k =0;
k< dim;
k++ ) {
90 if ( (
deltaR(HLTMu[
k], mu) < DR) && (fabs(HLTMu[k].
pt() - mu.
pt())/ HLTMu[k].
pt()<DPtRel)){
92 std::cout<<
" matching a muon " << std::endl;
93 std::cout <<
"muon reco pt : " << muRecoPt<< std::endl;
95 std::cout <<
"muon trigger pt "<< HLTMu[
k].pt() << std::endl;
97 hTrigMuonPtNumS_->
Fill(muRecoPt);
99 deltaPtOverPt_->
Fill(fabs(HLTMu[k].
pt() - mu.
pt())/ HLTMu[k].
pt());
102 std::cout <<
"muon trigger eta : "<< HLTMu[
k].eta() << std::endl;
103 std::cout <<
"deltaR((HLTMu[k], mu)): "<<
deltaR(HLTMu[k], mu) << std::endl;
104 std::cout <<
"deltaPtOverPt: "<< fabs(HLTMu[k].
pt() - mu.
pt())/ HLTMu[k].
pt() << std::endl;
115 trigEvTag_(cfg.getParameter<edm::
InputTag> (
"triggerEvent")),
116 trigEvToken_(consumes< trigger::TriggerEvent >(trigEvTag_)),
117 muonToken_(consumes<
View<
Muon> > (cfg.getUntrackedParameter<edm::
InputTag>(
"muons"))),
118 ptMuCut_(cfg.getUntrackedParameter<double>(
"ptMuCut")),
119 etaMuCut_(cfg.getUntrackedParameter<double>(
"etaMuCut")),
120 hltPath_(cfg.getParameter<std::
string >(
"hltPath")),
121 L3FilterName_(cfg.getParameter<std::
string >(
"L3FilterName")),
122 maxDPtRel_(cfg.getParameter<double>(
"maxDPtRel")),
123 maxDeltaR_(cfg.getParameter<double>(
"maxDeltaR")),
124 nbins_(cfg.getParameter<double>(
"ptMax_")),
125 ptMax_(cfg.getParameter<double>(
"ptMax_")){
151 LogWarning(
"") <<
">>> TRIGGER collection does not exist !!!";
157 for (
unsigned int i=0;
i<triggerResults->size();
i++) {
161 if ( trigName ==
hltPath_ && triggerResults->accept(
i)) {
168 LogWarning(
"errorTriggerEventValid" ) <<
"trigger::TriggerEvent product with InputTag " <<
trigEvTag_.
encode() <<
" not in event";
173 std::vector<reco::Particle> HLTMuMatched;
174 for (
size_t ia = 0; ia < handleTriggerEvent->sizeFilters(); ++ ia) {
175 std::string fullname = handleTriggerEvent->filterTag(ia).encode();
177 size_t p = fullname.find_first_of(
':');
178 if ( p != std::string::npos) {
179 name = fullname.substr(0, p);
186 for (trigger::Keys::const_iterator ki = k.begin(); ki !=k.end(); ++ki ) {
188 HLTMuMatched.push_back(toc[*ki].particle());
198 LogError(
"") <<
">>> muon collection does not exist !!!";
202 std::vector<reco::Muon> highPtGlbMuons;
204 for (
unsigned int i=0;
i<muons->size();
i++ ){
212 unsigned int nHighPtGlbMu = highPtGlbMuons.size();
213 std::cout <<
"I've got " << nHighPtGlbMu <<
" nHighPtGlbMu" << std::endl;
217 (nHighPtGlbMu> 10)? nHighPtGlbMu=10 : 1;
219 if (nHighPtGlbMu>0 ){
221 for(
unsigned int i =0 ;
i < nHighPtGlbMu ;
i++) {
bool IsMuMatchedToHLTMu(const reco::Muon &, std::vector< reco::Particle > &, double, double)
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
edm::EDGetTokenT< View< Muon > > muonToken_
virtual float pt() const
transverse momentum
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
edm::Handle< trigger::TriggerEvent > handleTriggerEvent_
bool isGlobalMuon() const
edm::TriggerNames const * trigNames_
T * make(const Args &...args) const
make new ROOT object
virtual void analyze(const edm::Event &event, const edm::EventSetup &setup) override
edm::Handle< edm::TriggerResults > triggerResults_
edm::EDGetTokenT< TriggerResults > trigToken_
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
virtual void endJob() override
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
virtual float eta() const
momentum pseudorapidity
static std::string const triggerResults
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
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)
std::string const & triggerName(unsigned int index) const
std::vector< size_type > Keys
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_
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
edm::EDGetTokenT< trigger::TriggerEvent > trigEvToken_