17 #include "TGraphAsymmErrors.h" 55 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_)),
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++) {
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) {
177 size_t p = fullname.find_first_of(
':');
178 if ( p != std::string::npos) {
179 name = fullname.substr(0, p);
184 if ( !toc.empty() ) {
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;
216 if (nHighPtGlbMu> 10) nHighPtGlbMu=10;
218 for(
unsigned int i =0 ;
i < nHighPtGlbMu ;
i++) {
bool IsMuMatchedToHLTMu(const reco::Muon &, std::vector< reco::Particle > &, double, double)
edm::EDGetTokenT< View< Muon > > muonToken_
double eta() const final
momentum pseudorapidity
trigger::size_type sizeFilters() const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
def analyze(function, filename, filter=None)
#define DEFINE_FWK_MODULE(type)
edm::Handle< trigger::TriggerEvent > handleTriggerEvent_
bool accept() const
Has at least one path accepted the event?
const Keys & filterKeys(trigger::size_type index) const
def setup(process, global_tag, zero_tesla=False)
double pt() const final
transverse momentum
edm::TriggerNames const * trigNames_
T * make(const Args &...args) const
make new ROOT object
void analyze(const edm::Event &event, const edm::EventSetup &setup) override
edm::Handle< edm::TriggerResults > triggerResults_
edm::EDGetTokenT< TriggerResults > trigToken_
bool isGlobalMuon() const override
const TriggerObjectCollection & getObjects() const
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
unsigned int size() const
Get number of paths stored.
static std::string const triggerResults
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)
const edm::InputTag filterTag(trigger::size_type index) const
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)
std::string L3FilterName_
edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const override
edm::EDGetTokenT< trigger::TriggerEvent > trigEvToken_