136 unsigned int theIndexOfThePrimaryVertex = 999.;
141 for (
unsigned int ind = 0; ind < vertex->size(); ++ind) {
142 if ((*vertex)[ind].isValid() && !((*vertex)[ind].isFake())) {
143 theIndexOfThePrimaryVertex = ind;
149 if (theIndexOfThePrimaryVertex < 100) {
150 posVtx = ((*vertex)[theIndexOfThePrimaryVertex]).
position();
151 errVtx = ((*vertex)[theIndexOfThePrimaryVertex]).
error();
153 LogInfo(
"RecoMuonValidator") <<
"reco::PrimaryVertex not found, use BeamSpot position instead\n";
162 errVtx(2, 2) = bs.
sigmaZ();
180 std::map<float, const reco::Muon*> muonMap;
181 for (reco::MuonCollection::const_iterator recoMu = muons->begin(); recoMu != muons->end(); ++recoMu) {
182 muonMap[recoMu->pt()] = &*recoMu;
184 std::vector<const reco::Muon*> LeadingMuon;
185 for (std::map<float, const reco::Muon*>::reverse_iterator rit = muonMap.rbegin(); rit != muonMap.rend(); ++rit) {
186 LeadingMuon.push_back((*rit).second);
191 const unsigned int nTrig(triggerNames.
size());
192 bool _trig_SingleMu =
false;
193 bool _trig_DoubleMu =
false;
194 for (
unsigned int i = 0;
i < nTrig; ++
i) {
198 _trig_SingleMu =
true;
202 _trig_DoubleMu =
true;
205 cout <<
"[MuonRecoOneHLT] Trigger Fired ? " << (_trig_SingleMu || _trig_DoubleMu) << endl;
208 if (!_trig_SingleMu && !_trig_DoubleMu)
210 if (LeadingMuon.empty())
215 if ((*LeadingMuon[0]).isGlobalMuon()) {
216 LogTrace(
metname) <<
"[MuonRecoOneHLT] The mu is global - filling the histos";
217 if ((*LeadingMuon[0]).isTrackerMuon() && (*LeadingMuon[0]).isStandAloneMuon())
219 if (!((*LeadingMuon[0]).isTrackerMuon()) && (*LeadingMuon[0]).isStandAloneMuon())
221 if (!(*LeadingMuon[0]).isStandAloneMuon())
222 LogTrace(
metname) <<
"[MuonRecoOneHLT] ERROR: the mu is global but not standalone!";
225 reco::TrackRef recoCombinedGlbTrack = (*LeadingMuon[0]).combinedMuon();
243 ptGlbTrack[0]->Fill(recoCombinedGlbTrack->pt());
249 LogTrace(
metname) <<
"[MuonRecoOneHLT] The mu is tracker only - filling the histos";
251 reco::TrackRef recoCombinedGlbTrack = (*LeadingMuon[0]).combinedMuon();
260 if ((*LeadingMuon[0]).isTrackerMuon() && !((*LeadingMuon[0]).isGlobalMuon())) {
261 LogTrace(
metname) <<
"[MuonRecoOneHLT] The mu is tracker only - filling the histos";
262 if ((*LeadingMuon[0]).isStandAloneMuon())
264 if (!((*LeadingMuon[0]).isStandAloneMuon()))
277 if ((*LeadingMuon[0]).isStandAloneMuon() && !((*LeadingMuon[0]).isGlobalMuon())) {
278 LogTrace(
metname) <<
"[MuonRecoOneHLT] The mu is STA only - filling the histos";
279 if (!((*LeadingMuon[0]).isTrackerMuon()))
291 if ((*LeadingMuon[0]).isCaloMuon() && !((*LeadingMuon[0]).isGlobalMuon()) && !((*LeadingMuon[0]).isTrackerMuon()) &&
292 !((*LeadingMuon[0]).isStandAloneMuon()))
edm::EDGetTokenT< edm::TriggerResults > theTriggerResultsLabel_
MonitorElement * phiTight
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::EDGetTokenT< reco::BeamSpot > theBeamSpotLabel_
MonitorElement * chi2OvDFTrack
edm::EDGetTokenT< reco::VertexCollection > theVertexLabel_
bool accept() const
Has at least one path accepted the event?
math::Error< dimension >::type Error
covariance error matrix (3x3)
Strings::size_type size() const
MonitorElement * etaTight
MonitorElement * etaStaTrack
std::vector< std::string > doublemuonExpr_
MonitorElement * chi2OvDFStaTrack
math::XYZPoint Point
point in the space
double BeamWidthX() const
beam width X
std::vector< MonitorElement * > phiGlbTrack
static std::string const triggerResults
MonitorElement * ptStaTrack
std::vector< std::string > singlemuonExpr_
std::vector< MonitorElement * > ptGlbTrack
MonitorElement * etaTrack
std::vector< MonitorElement * > etaGlbTrack
MonitorElement * phiTrack
edm::EDGetTokenT< reco::MuonCollection > theMuonCollectionLabel_
std::string const & triggerName(unsigned int index) const
double sigmaZ() const
sigma z
double BeamWidthY() const
beam width Y
MuonServiceProxy * theService
static int position[264][3]
MonitorElement * phiStaTrack
const Point & position() const
position
bool isTightMuon(const reco::Muon &, const reco::Vertex &)
edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const override
MonitorElement * chi2OvDFTight
std::vector< MonitorElement * > chi2OvDFGlbTrack