Get the analysis.
137 unsigned int theIndexOfThePrimaryVertex = 999.;
142 for (
unsigned int ind=0; ind<vertex->size(); ++ind) {
143 if ( (*vertex)[ind].isValid() && !((*vertex)[ind].isFake()) ) {
144 theIndexOfThePrimaryVertex = ind;
150 if (theIndexOfThePrimaryVertex<100) {
151 posVtx = ((*vertex)[theIndexOfThePrimaryVertex]).
position();
152 errVtx = ((*vertex)[theIndexOfThePrimaryVertex]).
error();
155 LogInfo(
"RecoMuonValidator") <<
"reco::PrimaryVertex not found, use BeamSpot position instead\n";
164 errVtx(2,2) = bs.
sigmaZ();
182 std::map<float,reco::Muon> muonMap;
183 for (reco::MuonCollection::const_iterator recoMu = muons->begin(); recoMu!=muons->end(); ++recoMu){
184 muonMap[recoMu->pt()] = *recoMu;
186 std::vector<reco::Muon> LeadingMuon;
187 for( std::map<float,reco::Muon>::reverse_iterator rit=muonMap.rbegin(); rit!=muonMap.rend(); ++rit){
188 LeadingMuon.push_back( (*rit).second );
193 const unsigned int nTrig(triggerNames.
size());
194 bool _trig_SingleMu =
false;
195 bool _trig_DoubleMu =
false;
196 for (
unsigned int i=0;
i<nTrig;++
i){
198 _trig_SingleMu =
true;
200 _trig_DoubleMu =
true;
203 cout <<
"[MuonRecoOneHLT] Trigger Fired ? "<< (_trig_SingleMu || _trig_DoubleMu) << endl;
206 if (!_trig_SingleMu && !_trig_DoubleMu)
return;
207 if (LeadingMuon.size() == 0)
return;
211 if(LeadingMuon[0].isGlobalMuon()) {
212 LogTrace(
metname)<<
"[MuonRecoOneHLT] The mu is global - filling the histos";
213 if(LeadingMuon[0].isTrackerMuon() && LeadingMuon[0].isStandAloneMuon())
muReco->
Fill(1);
214 if(!(LeadingMuon[0].isTrackerMuon()) && LeadingMuon[0].isStandAloneMuon())
muReco->
Fill(2);
215 if(!LeadingMuon[0].isStandAloneMuon())
216 LogTrace(
metname)<<
"[MuonRecoOneHLT] ERROR: the mu is global but not standalone!";
219 reco::TrackRef recoCombinedGlbTrack = LeadingMuon[0].combinedMuon();
237 ptGlbTrack[0]->Fill(recoCombinedGlbTrack->pt());
244 LogTrace(
metname)<<
"[MuonRecoOneHLT] The mu is tracker only - filling the histos";
246 reco::TrackRef recoCombinedGlbTrack = LeadingMuon[0].combinedMuon();
255 if(LeadingMuon[0].isTrackerMuon() && !(LeadingMuon[0].isGlobalMuon())) {
256 LogTrace(
metname)<<
"[MuonRecoOneHLT] The mu is tracker only - filling the histos";
257 if(LeadingMuon[0].isStandAloneMuon())
muReco->
Fill(3);
258 if(!(LeadingMuon[0].isStandAloneMuon()))
muReco->
Fill(4);
270 if(LeadingMuon[0].isStandAloneMuon() && !(LeadingMuon[0].isGlobalMuon())) {
271 LogTrace(
metname)<<
"[MuonRecoOneHLT] The mu is STA only - filling the histos";
272 if(!(LeadingMuon[0].isTrackerMuon()))
muReco->
Fill(5);
283 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
static int position[TOTALCHAMBERS][3]
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
MonitorElement * phiStaTrack
const Point & position() const
position
bool isTightMuon(const reco::Muon &, const reco::Vertex &)
MonitorElement * chi2OvDFTight
std::vector< MonitorElement * > chi2OvDFGlbTrack