34 doublemuonExpr_ = dimuonparms.getParameter<std::vector<std::string> >(
"hltPaths");
44 cout <<
"[MuonRecoOneHLT] beginJob " << endl;
50 muReco = dbe->
book1D(
"Muon_Reco",
"Muon Reconstructed Tracks", 6, 1, 7);
51 muReco->setBinLabel(1,
"glb+tk+sta");
52 muReco->setBinLabel(2,
"glb+sta");
53 muReco->setBinLabel(3,
"tk+sta");
54 muReco->setBinLabel(4,
"tk");
55 muReco->setBinLabel(5,
"sta");
56 muReco->setBinLabel(6,
"calo");
63 std::string histname =
"GlbMuon_";
118 cout <<
"[MuonRecoOneHLT] beginRun " << endl;
119 cout <<
"[MuonRecoOneHLT] Is MuonEventFlag On? "<< _SignleMuonEventFlag->on() << endl;
133 cout <<
"[MuonRecoOneHLT] analyze "<< endl;
141 std::map<float,reco::Muon> muonMap;
142 for (reco::MuonCollection::const_iterator recoMu = muons->begin(); recoMu!=muons->end(); ++recoMu){
143 muonMap[recoMu->pt()] = *recoMu;
145 std::vector<reco::Muon> LeadingMuon;
146 for( std::map<float,reco::Muon>::reverse_iterator rit=muonMap.rbegin(); rit!=muonMap.rend(); ++rit){
147 LeadingMuon.push_back( (*rit).second );
152 iEvent.
getByLabel(
"offlineBeamSpot", beamSpotHandle);
153 beamSpot = *beamSpotHandle;
156 const unsigned int nTrig(triggerNames.
size());
157 bool _trig_SingleMu =
false;
158 bool _trig_DoubleMu =
false;
159 for (
unsigned int i=0;
i<nTrig;++
i){
161 _trig_SingleMu =
true;
163 _trig_DoubleMu =
true;
166 cout <<
"[MuonRecoOneHLT] Trigger Fired ? "<< _trig_SingleMu << endl;
169 if (!_trig_SingleMu && !_trig_DoubleMu)
return;
170 if (LeadingMuon.size() == 0)
return;
174 if(LeadingMuon[0].isGlobalMuon()) {
175 LogTrace(
metname)<<
"[MuonRecoOneHLT] The mu is global - filling the histos";
176 if(LeadingMuon[0].isTrackerMuon() && LeadingMuon[0].isStandAloneMuon())
muReco->
Fill(1);
177 if(!(LeadingMuon[0].isTrackerMuon()) && LeadingMuon[0].isStandAloneMuon())
muReco->
Fill(2);
178 if(!LeadingMuon[0].isStandAloneMuon())
179 LogTrace(
metname)<<
"[MuonRecoOneHLT] ERROR: the mu is global but not standalone!";
182 reco::TrackRef recoCombinedGlbTrack = LeadingMuon[0].combinedMuon();
200 ptGlbTrack[0]->Fill(recoCombinedGlbTrack->pt());
205 if (LeadingMuon[0].isGlobalMuon() &&
206 LeadingMuon[0].isTrackerMuon() &&
207 LeadingMuon[0].combinedMuon()->normalizedChi2()<10. &&
208 LeadingMuon[0].combinedMuon()->hitPattern().numberOfValidMuonHits()>0 &&
209 fabs(LeadingMuon[0].combinedMuon()->dxy(beamSpot.
position()))<0.2 &&
210 LeadingMuon[0].combinedMuon()->hitPattern().numberOfValidPixelHits()>0 &&
211 LeadingMuon[0].numberOfMatches() > 1){
213 LogTrace(
metname)<<
"[MuonRecoOneHLT] The mu is tracker only - filling the histos";
215 reco::TrackRef recoCombinedGlbTrack = LeadingMuon[0].combinedMuon();
224 if(LeadingMuon[0].isTrackerMuon() && !(LeadingMuon[0].isGlobalMuon())) {
225 LogTrace(
metname)<<
"[MuonRecoOneHLT] The mu is tracker only - filling the histos";
226 if(LeadingMuon[0].isStandAloneMuon())
muReco->
Fill(3);
227 if(!(LeadingMuon[0].isStandAloneMuon()))
muReco->
Fill(4);
239 if(LeadingMuon[0].isStandAloneMuon() && !(LeadingMuon[0].isGlobalMuon())) {
240 LogTrace(
metname)<<
"[MuonRecoOneHLT] The mu is STA only - filling the histos";
241 if(!(LeadingMuon[0].isTrackerMuon()))
muReco->
Fill(5);
252 if(LeadingMuon[0].isCaloMuon() && !(LeadingMuon[0].isGlobalMuon()) && !(LeadingMuon[0].isTrackerMuon()) && !(LeadingMuon[0].isStandAloneMuon()))
T getParameter(std::string const &) const
edm::ParameterSet parameters
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
void beginJob(DQMStore *dbe)
Inizialize parameters for histo binning.
MonitorElement * phiTight
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
GenericTriggerEventFlag * _DoubleMuonEventFlag
MonitorElement * chi2OvDFTrack
bool accept() const
Has at least one path accepted the event?
GenericTriggerEventFlag * _SingleMuonEventFlag
Provides a code based selection for trigger and DCS information in order to have no failing filters i...
Strings::size_type size() const
MonitorElement * etaTight
MonitorElement * etaStaTrack
std::vector< std::string > doublemuonExpr_
std::vector< std::string > expressionsFromDB(const std::string &key, const edm::EventSetup &setup)
Reads and returns logical expressions from DB.
MonitorElement * chi2OvDFStaTrack
edm::InputTag theMuonCollectionLabel
std::vector< MonitorElement * > phiGlbTrack
MonitorElement * ptStaTrack
std::vector< std::string > singlemuonExpr_
std::vector< MonitorElement * > ptGlbTrack
MonitorElement * etaTrack
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
virtual ~MuonRecoOneHLT()
Destructor.
std::vector< MonitorElement * > etaGlbTrack
MonitorElement * phiTrack
std::string const & triggerName(unsigned int index) const
MonitorElement * phiStaTrack
const Point & position() const
position
void initRun(const edm::Run &run, const edm::EventSetup &setup)
To be called from beginRun() methods.
void analyze(const edm::Event &, const edm::EventSetup &, const edm::TriggerResults &)
Get the analysis.
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void beginRun(const edm::Run &iRun, const edm::EventSetup &iSetup)
MuonRecoOneHLT(const edm::ParameterSet &, MuonServiceProxy *theService)
Constructor.
void setCurrentFolder(const std::string &fullpath)
MonitorElement * chi2OvDFTight
std::vector< MonitorElement * > chi2OvDFGlbTrack