#include <MuonIdDQM.h>
Definition at line 51 of file MuonIdDQM.h.
MuonIdDQM::MuonIdDQM | ( | const edm::ParameterSet & | iConfig | ) | [explicit] |
Definition at line 3 of file MuonIdDQM.cc.
References baseFolder_, dbe_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), inputCSCSegmentCollection_, inputDTRecSegment4DCollection_, inputMuonCollection_, cppFunctionSkipper::operator, useGlobalMuons_, useGlobalMuonsNotTrackerMuons_, useTrackerMuons_, and useTrackerMuonsNotGlobalMuons_.
{ inputMuonCollection_ = iConfig.getParameter<edm::InputTag>("inputMuonCollection"); inputDTRecSegment4DCollection_ = iConfig.getParameter<edm::InputTag>("inputDTRecSegment4DCollection"); inputCSCSegmentCollection_ = iConfig.getParameter<edm::InputTag>("inputCSCSegmentCollection"); useTrackerMuons_ = iConfig.getUntrackedParameter<bool>("useTrackerMuons"); useGlobalMuons_ = iConfig.getUntrackedParameter<bool>("useGlobalMuons"); useTrackerMuonsNotGlobalMuons_ = iConfig.getUntrackedParameter<bool>("useTrackerMuonsNotGlobalMuons"); useGlobalMuonsNotTrackerMuons_ = iConfig.getUntrackedParameter<bool>("useGlobalMuonsNotTrackerMuons"); baseFolder_ = iConfig.getUntrackedParameter<std::string>("baseFolder"); dbe_ = 0; dbe_ = edm::Service<DQMStore>().operator->(); }
MuonIdDQM::~MuonIdDQM | ( | ) |
Definition at line 18 of file MuonIdDQM.cc.
{}
void MuonIdDQM::analyze | ( | const edm::Event & | iEvent, |
const edm::EventSetup & | iSetup | ||
) | [private, virtual] |
Implements edm::EDAnalyzer.
Definition at line 121 of file MuonIdDQM.cc.
References MuonSubdetId::CSC, cscSegmentCollectionH_, MuonSubdetId::DT, dtSegmentCollectionH_, Fill(), MonitorElement::Fill(), geometry_, edm::EventSetup::get(), edm::Event::getByLabel(), hCSCDdXdZ, hCSCDdYdZ, hCSCDx, hCSCDy, hCSCNumSegments, hCSCPulldXdZ, hCSCPulldYdZ, hCSCPullx, hCSCPully, hDTDdXdZ, hDTDdYdZ, hDTDx, hDTDy, hDTNumSegments, hDTPulldXdZ, hDTPulldYdZ, hDTPullx, hDTPully, hNumChambers, hNumMatches, hSegmentIsAssociatedBool, i, inputCSCSegmentCollection_, inputDTRecSegment4DCollection_, inputMuonCollection_, metsig::muon, muonCollectionH_, dt_dqm_sourceclient_common_cff::reco, mathSSE::sqrt(), relativeConstraints::station, useGlobalMuons_, useGlobalMuonsNotTrackerMuons_, useTrackerMuons_, useTrackerMuonsNotGlobalMuons_, PV3DBase< T, PVType, FrameType >::x(), LocalError::xx(), PV3DBase< T, PVType, FrameType >::y(), LocalError::yy(), and PV3DBase< T, PVType, FrameType >::z().
{ using namespace edm; using namespace reco; iEvent.getByLabel(inputMuonCollection_, muonCollectionH_); iEvent.getByLabel(inputDTRecSegment4DCollection_, dtSegmentCollectionH_); iEvent.getByLabel(inputCSCSegmentCollection_, cscSegmentCollectionH_); iSetup.get<GlobalTrackingGeometryRecord>().get(geometry_); for(MuonCollection::const_iterator muon = muonCollectionH_->begin(); muon != muonCollectionH_->end(); ++muon) { // trackerMuon == 0; globalMuon == 1; trackerMuon && !globalMuon == 2; globalMuon && !trackerMuon == 3 for (unsigned int i = 0; i < 4; i++) { if (i == 0 && (! useTrackerMuons_ || ! muon->isTrackerMuon())) continue; if (i == 1 && (! useGlobalMuons_ || ! muon->isGlobalMuon())) continue; if (i == 2 && (! useTrackerMuonsNotGlobalMuons_ || (! (muon->isTrackerMuon() && ! muon->isGlobalMuon())))) continue; if (i == 3 && (! useGlobalMuonsNotTrackerMuons_ || (! (muon->isGlobalMuon() && ! muon->isTrackerMuon())))) continue; hNumChambers[i]->Fill(muon->numberOfChambers()); hNumMatches[i]->Fill(muon->numberOfMatches(Muon::SegmentAndTrackArbitration)); // by station for(int station = 0; station < 4; ++station) { // only fill num segments if we crossed (or nearly crossed) a chamber if (muon->trackX(station+1, MuonSubdetId::DT, Muon::NoArbitration) < 900000) hDTNumSegments[i][station]->Fill(muon->numberOfSegments(station+1, MuonSubdetId::DT, Muon::NoArbitration)); Fill(hDTDx[i][station], muon->dX(station+1, MuonSubdetId::DT, Muon::SegmentAndTrackArbitration)); Fill(hDTPullx[i][station], muon->pullX(station+1, MuonSubdetId::DT, Muon::SegmentAndTrackArbitration, true)); Fill(hDTDdXdZ[i][station], muon->dDxDz(station+1, MuonSubdetId::DT, Muon::SegmentAndTrackArbitration)); Fill(hDTPulldXdZ[i][station], muon->pullDxDz(station+1, MuonSubdetId::DT, Muon::SegmentAndTrackArbitration, true)); if (station < 3) { Fill(hDTDy[i][station], muon->dY(station+1, MuonSubdetId::DT, Muon::SegmentAndTrackArbitration)); Fill(hDTPully[i][station], muon->pullY(station+1, MuonSubdetId::DT, Muon::SegmentAndTrackArbitration, true)); Fill(hDTDdYdZ[i][station], muon->dDyDz(station+1, MuonSubdetId::DT, Muon::SegmentAndTrackArbitration)); Fill(hDTPulldYdZ[i][station], muon->pullDyDz(station+1, MuonSubdetId::DT, Muon::SegmentAndTrackArbitration, true)); } // only fill num segments if we crossed (or nearly crossed) a chamber if (muon->trackX(station+1, MuonSubdetId::CSC, Muon::NoArbitration) < 900000) hCSCNumSegments[i][station]->Fill(muon->numberOfSegments(station+1, MuonSubdetId::CSC, Muon::NoArbitration)); Fill(hCSCDx[i][station], muon->dX(station+1, MuonSubdetId::CSC, Muon::SegmentAndTrackArbitration)); Fill(hCSCPullx[i][station], muon->pullX(station+1, MuonSubdetId::CSC, Muon::SegmentAndTrackArbitration, true)); Fill(hCSCDdXdZ[i][station], muon->dDxDz(station+1, MuonSubdetId::CSC, Muon::SegmentAndTrackArbitration)); Fill(hCSCPulldXdZ[i][station], muon->pullDxDz(station+1, MuonSubdetId::CSC, Muon::SegmentAndTrackArbitration, true)); Fill(hCSCDy[i][station], muon->dY(station+1, MuonSubdetId::CSC, Muon::SegmentAndTrackArbitration)); Fill(hCSCPully[i][station], muon->pullY(station+1, MuonSubdetId::CSC, Muon::SegmentAndTrackArbitration, true)); Fill(hCSCDdYdZ[i][station], muon->dDyDz(station+1, MuonSubdetId::CSC, Muon::SegmentAndTrackArbitration)); Fill(hCSCPulldYdZ[i][station], muon->pullDyDz(station+1, MuonSubdetId::CSC, Muon::SegmentAndTrackArbitration, true)); } } }// muon for(DTRecSegment4DCollection::const_iterator segment = dtSegmentCollectionH_->begin(); segment != dtSegmentCollectionH_->end(); ++segment) { LocalPoint segmentLocalPosition = segment->localPosition(); LocalVector segmentLocalDirection = segment->localDirection(); LocalError segmentLocalPositionError = segment->localPositionError(); LocalError segmentLocalDirectionError = segment->localDirectionError(); bool segmentFound = false; for(MuonCollection::const_iterator muon = muonCollectionH_->begin(); muon != muonCollectionH_->end(); ++muon) { if (! muon->isMatchesValid()) continue; for(std::vector<MuonChamberMatch>::const_iterator chamberMatch = muon->matches().begin(); chamberMatch != muon->matches().end(); ++chamberMatch) { for(std::vector<MuonSegmentMatch>::const_iterator segmentMatch = chamberMatch->segmentMatches.begin(); segmentMatch != chamberMatch->segmentMatches.end(); ++segmentMatch) { if (fabs(segmentMatch->x - segmentLocalPosition.x() ) < 1E-6 && fabs(segmentMatch->y - segmentLocalPosition.y() ) < 1E-6 && fabs(segmentMatch->dXdZ - segmentLocalDirection.x()/segmentLocalDirection.z()) < 1E-6 && fabs(segmentMatch->dYdZ - segmentLocalDirection.y()/segmentLocalDirection.z()) < 1E-6 && fabs(segmentMatch->xErr - sqrt(segmentLocalPositionError.xx()) ) < 1E-6 && fabs(segmentMatch->yErr - sqrt(segmentLocalPositionError.yy()) ) < 1E-6 && fabs(segmentMatch->dXdZErr - sqrt(segmentLocalDirectionError.xx()) ) < 1E-6 && fabs(segmentMatch->dYdZErr - sqrt(segmentLocalDirectionError.yy()) ) < 1E-6) { segmentFound = true; break; } }// segmentMatch if (segmentFound) break; }// chamberMatch if (segmentFound) break; }// muon if (segmentFound) hSegmentIsAssociatedBool->Fill(1.); else hSegmentIsAssociatedBool->Fill(0.); }// dt segment for(CSCSegmentCollection::const_iterator segment = cscSegmentCollectionH_->begin(); segment != cscSegmentCollectionH_->end(); ++segment) { LocalPoint segmentLocalPosition = segment->localPosition(); LocalVector segmentLocalDirection = segment->localDirection(); LocalError segmentLocalPositionError = segment->localPositionError(); LocalError segmentLocalDirectionError = segment->localDirectionError(); bool segmentFound = false; for(MuonCollection::const_iterator muon = muonCollectionH_->begin(); muon != muonCollectionH_->end(); ++muon) { if (! muon->isMatchesValid()) continue; for(std::vector<MuonChamberMatch>::const_iterator chamberMatch = muon->matches().begin(); chamberMatch != muon->matches().end(); ++chamberMatch) { for(std::vector<MuonSegmentMatch>::const_iterator segmentMatch = chamberMatch->segmentMatches.begin(); segmentMatch != chamberMatch->segmentMatches.end(); ++segmentMatch) { if (fabs(segmentMatch->x - segmentLocalPosition.x() ) < 1E-6 && fabs(segmentMatch->y - segmentLocalPosition.y() ) < 1E-6 && fabs(segmentMatch->dXdZ - segmentLocalDirection.x()/segmentLocalDirection.z()) < 1E-6 && fabs(segmentMatch->dYdZ - segmentLocalDirection.y()/segmentLocalDirection.z()) < 1E-6 && fabs(segmentMatch->xErr - sqrt(segmentLocalPositionError.xx()) ) < 1E-6 && fabs(segmentMatch->yErr - sqrt(segmentLocalPositionError.yy()) ) < 1E-6 && fabs(segmentMatch->dXdZErr - sqrt(segmentLocalDirectionError.xx()) ) < 1E-6 && fabs(segmentMatch->dYdZErr - sqrt(segmentLocalDirectionError.yy()) ) < 1E-6) { segmentFound = true; break; } }// segmentMatch if (segmentFound) break; }// chamberMatch if (segmentFound) break; }// muon if (segmentFound) hSegmentIsAssociatedBool->Fill(1.); else hSegmentIsAssociatedBool->Fill(0.); }// csc segment }
void MuonIdDQM::beginJob | ( | void | ) | [private, virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 21 of file MuonIdDQM.cc.
References baseFolder_, DQMStore::book1D(), dbe_, hCSCDdXdZ, hCSCDdYdZ, hCSCDx, hCSCDy, hCSCNumSegments, hCSCPulldXdZ, hCSCPulldYdZ, hCSCPullx, hCSCPully, hDTDdXdZ, hDTDdYdZ, hDTDx, hDTDy, hDTNumSegments, hDTPulldXdZ, hDTPulldYdZ, hDTPullx, hDTPully, hNumChambers, hNumMatches, hSegmentIsAssociatedBool, i, mergeVDriftHistosByStation::name, DQMStore::setCurrentFolder(), relativeConstraints::station, indexGen::title, useGlobalMuons_, useGlobalMuonsNotTrackerMuons_, useTrackerMuons_, and useTrackerMuonsNotGlobalMuons_.
{ char name[100], title[200]; // trackerMuon == 0; globalMuon == 1; trackerMuon && !globalMuon == 2; globalMuon && !trackerMuon == 3 for (unsigned int i = 0; i < 4; i++) { if ((i == 0 && ! useTrackerMuons_) || (i == 1 && ! useGlobalMuons_)) continue; if ((i == 2 && ! useTrackerMuonsNotGlobalMuons_) || (i == 3 && ! useGlobalMuonsNotTrackerMuons_)) continue; if (i == 0) dbe_->setCurrentFolder(baseFolder_+"/TrackerMuons"); if (i == 1) dbe_->setCurrentFolder(baseFolder_+"/GlobalMuons"); if (i == 2) dbe_->setCurrentFolder(baseFolder_+"/TrackerMuonsNotGlobalMuons"); if (i == 3) dbe_->setCurrentFolder(baseFolder_+"/GlobalMuonsNotTrackerMuons"); hNumChambers[i] = dbe_->book1D("hNumChambers", "Number of Chambers", 11, -0.5, 10.5); hNumMatches[i] = dbe_->book1D("hNumMatches", "Number of Matches", 11, -0.5, 10.5); // by station for(int station = 0; station < 4; ++station) { sprintf(name, "hDT%iNumSegments", station+1); sprintf(title, "DT Station %i Number of Segments (No Arbitration)", station+1); hDTNumSegments[i][station] = dbe_->book1D(name, title, 11, -0.5, 10.5); sprintf(name, "hDT%iDx", station+1); sprintf(title, "DT Station %i Delta X", station+1); hDTDx[i][station] = dbe_->book1D(name, title, 100, -100., 100.); sprintf(name, "hDT%iPullx", station+1); sprintf(title, "DT Station %i Pull X", station+1); hDTPullx[i][station] = dbe_->book1D(name, title, 100, -20., 20.); sprintf(name, "hDT%iDdXdZ", station+1); sprintf(title, "DT Station %i Delta DxDz", station+1); hDTDdXdZ[i][station] = dbe_->book1D(name, title, 100, -1., 1.); sprintf(name, "hDT%iPulldXdZ", station+1); sprintf(title, "DT Station %i Pull DxDz", station+1); hDTPulldXdZ[i][station] = dbe_->book1D(name, title, 100, -20., 20.); if (station < 3) { sprintf(name, "hDT%iDy", station+1); sprintf(title, "DT Station %i Delta Y", station+1); hDTDy[i][station] = dbe_->book1D(name, title, 100, -150., 150.); sprintf(name, "hDT%iPully", station+1); sprintf(title, "DT Station %i Pull Y", station+1); hDTPully[i][station] = dbe_->book1D(name, title, 100, -20., 20.); sprintf(name, "hDT%iDdYdZ", station+1); sprintf(title, "DT Station %i Delta DyDz", station+1); hDTDdYdZ[i][station] = dbe_->book1D(name, title, 100, -2., 2.); sprintf(name, "hDT%iPulldYdZ", station+1); sprintf(title, "DT Station %i Pull DyDz", station+1); hDTPulldYdZ[i][station] = dbe_->book1D(name, title, 100, -20., 20.); } sprintf(name, "hCSC%iNumSegments", station+1); sprintf(title, "CSC Station %i Number of Segments (No Arbitration)", station+1); hCSCNumSegments[i][station] = dbe_->book1D(name, title, 11, -0.5, 10.5); sprintf(name, "hCSC%iDx", station+1); sprintf(title, "CSC Station %i Delta X", station+1); hCSCDx[i][station] = dbe_->book1D(name, title, 100, -50., 50.); sprintf(name, "hCSC%iPullx", station+1); sprintf(title, "CSC Station %i Pull X", station+1); hCSCPullx[i][station] = dbe_->book1D(name, title, 100, -20., 20.); sprintf(name, "hCSC%iDdXdZ", station+1); sprintf(title, "CSC Station %i Delta DxDz", station+1); hCSCDdXdZ[i][station] = dbe_->book1D(name, title, 100, -1., 1.); sprintf(name, "hCSC%iPulldXdZ", station+1); sprintf(title, "CSC Station %i Pull DxDz", station+1); hCSCPulldXdZ[i][station] = dbe_->book1D(name, title, 100, -20., 20.); sprintf(name, "hCSC%iDy", station+1); sprintf(title, "CSC Station %i Delta Y", station+1); hCSCDy[i][station] = dbe_->book1D(name, title, 100, -50., 50.); sprintf(name, "hCSC%iPully", station+1); sprintf(title, "CSC Station %i Pull Y", station+1); hCSCPully[i][station] = dbe_->book1D(name, title, 100, -20., 20.); sprintf(name, "hCSC%iDdYdZ", station+1); sprintf(title, "CSC Station %i Delta DyDz", station+1); hCSCDdYdZ[i][station] = dbe_->book1D(name, title, 100, -1., 1.); sprintf(name, "hCSC%iPulldYdZ", station+1); sprintf(title, "CSC Station %i Pull DyDz", station+1); hCSCPulldYdZ[i][station] = dbe_->book1D(name, title, 100, -20., 20.); }// station } dbe_->setCurrentFolder(baseFolder_); hSegmentIsAssociatedBool = dbe_->book1D("hSegmentIsAssociatedBool", "Segment Is Associated Boolean", 2, -0.5, 1.5); }
void MuonIdDQM::endJob | ( | void | ) | [private, virtual] |
void MuonIdDQM::Fill | ( | MonitorElement * | me, |
float | f | ||
) | [private, virtual] |
Definition at line 269 of file MuonIdDQM.cc.
References MonitorElement::Fill().
Referenced by analyze().
std::string MuonIdDQM::baseFolder_ [private] |
Definition at line 72 of file MuonIdDQM.h.
Referenced by beginJob(), and MuonIdDQM().
Definition at line 76 of file MuonIdDQM.h.
Referenced by analyze().
DQMStore* MuonIdDQM::dbe_ [private] |
Definition at line 62 of file MuonIdDQM.h.
Referenced by beginJob(), and MuonIdDQM().
Definition at line 75 of file MuonIdDQM.h.
Referenced by analyze().
Definition at line 77 of file MuonIdDQM.h.
Referenced by analyze().
MonitorElement* MuonIdDQM::hCSCDdXdZ[4][4] [private] |
Definition at line 96 of file MuonIdDQM.h.
Referenced by analyze(), and beginJob().
MonitorElement* MuonIdDQM::hCSCDdYdZ[4][4] [private] |
Definition at line 100 of file MuonIdDQM.h.
Referenced by analyze(), and beginJob().
MonitorElement* MuonIdDQM::hCSCDx[4][4] [private] |
Definition at line 94 of file MuonIdDQM.h.
Referenced by analyze(), and beginJob().
MonitorElement* MuonIdDQM::hCSCDy[4][4] [private] |
Definition at line 98 of file MuonIdDQM.h.
Referenced by analyze(), and beginJob().
MonitorElement* MuonIdDQM::hCSCNumSegments[4][4] [private] |
Definition at line 93 of file MuonIdDQM.h.
Referenced by analyze(), and beginJob().
MonitorElement* MuonIdDQM::hCSCPulldXdZ[4][4] [private] |
Definition at line 97 of file MuonIdDQM.h.
Referenced by analyze(), and beginJob().
MonitorElement* MuonIdDQM::hCSCPulldYdZ[4][4] [private] |
Definition at line 101 of file MuonIdDQM.h.
Referenced by analyze(), and beginJob().
MonitorElement* MuonIdDQM::hCSCPullx[4][4] [private] |
Definition at line 95 of file MuonIdDQM.h.
Referenced by analyze(), and beginJob().
MonitorElement* MuonIdDQM::hCSCPully[4][4] [private] |
Definition at line 99 of file MuonIdDQM.h.
Referenced by analyze(), and beginJob().
MonitorElement* MuonIdDQM::hDTDdXdZ[4][4] [private] |
Definition at line 87 of file MuonIdDQM.h.
Referenced by analyze(), and beginJob().
MonitorElement* MuonIdDQM::hDTDdYdZ[4][3] [private] |
Definition at line 91 of file MuonIdDQM.h.
Referenced by analyze(), and beginJob().
MonitorElement* MuonIdDQM::hDTDx[4][4] [private] |
Definition at line 85 of file MuonIdDQM.h.
Referenced by analyze(), and beginJob().
MonitorElement* MuonIdDQM::hDTDy[4][3] [private] |
Definition at line 89 of file MuonIdDQM.h.
Referenced by analyze(), and beginJob().
MonitorElement* MuonIdDQM::hDTNumSegments[4][4] [private] |
Definition at line 84 of file MuonIdDQM.h.
Referenced by analyze(), and beginJob().
MonitorElement* MuonIdDQM::hDTPulldXdZ[4][4] [private] |
Definition at line 88 of file MuonIdDQM.h.
Referenced by analyze(), and beginJob().
MonitorElement* MuonIdDQM::hDTPulldYdZ[4][3] [private] |
Definition at line 92 of file MuonIdDQM.h.
Referenced by analyze(), and beginJob().
MonitorElement* MuonIdDQM::hDTPullx[4][4] [private] |
Definition at line 86 of file MuonIdDQM.h.
Referenced by analyze(), and beginJob().
MonitorElement* MuonIdDQM::hDTPully[4][3] [private] |
Definition at line 90 of file MuonIdDQM.h.
Referenced by analyze(), and beginJob().
MonitorElement* MuonIdDQM::hNumChambers[4] [private] |
Definition at line 80 of file MuonIdDQM.h.
Referenced by analyze(), and beginJob().
MonitorElement* MuonIdDQM::hNumMatches[4] [private] |
Definition at line 81 of file MuonIdDQM.h.
Referenced by analyze(), and beginJob().
Definition at line 104 of file MuonIdDQM.h.
Referenced by analyze(), and beginJob().
Definition at line 67 of file MuonIdDQM.h.
Referenced by analyze(), and MuonIdDQM().
Definition at line 66 of file MuonIdDQM.h.
Referenced by analyze(), and MuonIdDQM().
edm::InputTag MuonIdDQM::inputMuonCollection_ [private] |
Definition at line 65 of file MuonIdDQM.h.
Referenced by analyze(), and MuonIdDQM().
Definition at line 74 of file MuonIdDQM.h.
Referenced by analyze().
bool MuonIdDQM::useGlobalMuons_ [private] |
Definition at line 69 of file MuonIdDQM.h.
Referenced by analyze(), beginJob(), and MuonIdDQM().
bool MuonIdDQM::useGlobalMuonsNotTrackerMuons_ [private] |
Definition at line 71 of file MuonIdDQM.h.
Referenced by analyze(), beginJob(), and MuonIdDQM().
bool MuonIdDQM::useTrackerMuons_ [private] |
Definition at line 68 of file MuonIdDQM.h.
Referenced by analyze(), beginJob(), and MuonIdDQM().
bool MuonIdDQM::useTrackerMuonsNotGlobalMuons_ [private] |
Definition at line 70 of file MuonIdDQM.h.
Referenced by analyze(), beginJob(), and MuonIdDQM().