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);
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_")){
149 LogWarning(
"") <<
">>> TRIGGER collection does not exist !!!";
156 for (
unsigned int i=0;
i<triggerResults->size();
i++) {
160 if ( trigName ==
hltPath_ && triggerResults->accept(
i)) {
167 LogWarning(
"errorTriggerEventValid" ) <<
"trigger::TriggerEvent product with InputTag " <<
trigEv_.
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 !!!";
204 std::vector<reco::Muon> highPtGlbMuons;
206 for (
unsigned int i=0;
i<muons->size();
i++ ){
214 unsigned int nHighPtGlbMu = highPtGlbMuons.size();
215 std::cout <<
"I've got " << nHighPtGlbMu <<
" nHighPtGlbMu" << std::endl;
219 (nHighPtGlbMu> 10)? nHighPtGlbMu=10 : 1;
221 if (nHighPtGlbMu>0 ){
223 for(
unsigned int i =0 ;
i < nHighPtGlbMu ;
i++) {
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
virtual const LorentzVector & p4() const GCC11_FINAL
four-momentum Lorentz vector
#define DEFINE_FWK_MODULE(type)
edm::Handle< trigger::TriggerEvent > handleTriggerEvent_
bool isGlobalMuon() const
edm::TriggerNames const * trigNames_
edm::Handle< edm::TriggerResults > triggerResults_
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
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
virtual float eta() const GCC11_FINAL
momentum pseudorapidity
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::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 float pt() const GCC11_FINAL
transverse momentum
std::string L3FilterName_
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")