131 unsigned int theIndexOfThePrimaryVertex = 999.;
136 for (
unsigned int ind=0; ind<vertex->size(); ++ind) {
137 if ( (*vertex)[ind].isValid() && !((*vertex)[ind].isFake()) ) {
138 theIndexOfThePrimaryVertex = ind;
144 if (theIndexOfThePrimaryVertex<100) {
145 posVtx = ((*vertex)[theIndexOfThePrimaryVertex]).
position();
146 errVtx = ((*vertex)[theIndexOfThePrimaryVertex]).
error();
149 LogInfo(
"RecoMuonValidator") <<
"reco::PrimaryVertex not found, use BeamSpot position instead\n";
158 errVtx(2,2) = bs.
sigmaZ();
176 std::map<float,reco::Muon> muonMap;
177 for (reco::MuonCollection::const_iterator recoMu = muons->begin(); recoMu!=muons->end(); ++recoMu){
178 muonMap[recoMu->pt()] = *recoMu;
180 std::vector<reco::Muon> LeadingMuon;
181 for( std::map<float,reco::Muon>::reverse_iterator rit=muonMap.rbegin(); rit!=muonMap.rend(); ++rit){
182 LeadingMuon.push_back( (*rit).second );
187 const unsigned int nTrig(triggerNames.
size());
188 bool _trig_SingleMu =
false;
189 bool _trig_DoubleMu =
false;
190 for (
unsigned int i=0;
i<nTrig;++
i){
192 _trig_SingleMu =
true;
194 _trig_DoubleMu =
true;
197 cout <<
"[MuonRecoOneHLT] Trigger Fired ? "<< (_trig_SingleMu || _trig_DoubleMu) << endl;
200 if (!_trig_SingleMu && !_trig_DoubleMu)
return;
201 if (LeadingMuon.size() == 0)
return;
205 if(LeadingMuon[0].isGlobalMuon()) {
206 LogTrace(
metname)<<
"[MuonRecoOneHLT] The mu is global - filling the histos";
207 if(LeadingMuon[0].isTrackerMuon() && LeadingMuon[0].isStandAloneMuon())
muReco->
Fill(1);
208 if(!(LeadingMuon[0].isTrackerMuon()) && LeadingMuon[0].isStandAloneMuon())
muReco->
Fill(2);
209 if(!LeadingMuon[0].isStandAloneMuon())
210 LogTrace(
metname)<<
"[MuonRecoOneHLT] ERROR: the mu is global but not standalone!";
213 reco::TrackRef recoCombinedGlbTrack = LeadingMuon[0].combinedMuon();
231 ptGlbTrack[0]->Fill(recoCombinedGlbTrack->pt());
238 LogTrace(
metname)<<
"[MuonRecoOneHLT] The mu is tracker only - filling the histos";
240 reco::TrackRef recoCombinedGlbTrack = LeadingMuon[0].combinedMuon();
249 if(LeadingMuon[0].isTrackerMuon() && !(LeadingMuon[0].isGlobalMuon())) {
250 LogTrace(
metname)<<
"[MuonRecoOneHLT] The mu is tracker only - filling the histos";
251 if(LeadingMuon[0].isStandAloneMuon())
muReco->
Fill(3);
252 if(!(LeadingMuon[0].isStandAloneMuon()))
muReco->
Fill(4);
264 if(LeadingMuon[0].isStandAloneMuon() && !(LeadingMuon[0].isGlobalMuon())) {
265 LogTrace(
metname)<<
"[MuonRecoOneHLT] The mu is STA only - filling the histos";
266 if(!(LeadingMuon[0].isTrackerMuon()))
muReco->
Fill(5);
277 if(LeadingMuon[0].isCaloMuon() && !(LeadingMuon[0].isGlobalMuon()) && !(LeadingMuon[0].isTrackerMuon()) && !(LeadingMuon[0].isStandAloneMuon()))
edm::EDGetTokenT< edm::TriggerResults > theTriggerResultsLabel_
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
MonitorElement * phiTight
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::EDGetTokenT< reco::BeamSpot > theBeamSpotLabel_
MonitorElement * chi2OvDFTrack
edm::EDGetTokenT< reco::VertexCollection > theVertexLabel_
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 &)
MonitorElement * chi2OvDFTight
std::vector< MonitorElement * > chi2OvDFGlbTrack