CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Protected Attributes | Private Attributes
RecoMuonValidator Class Reference

#include <RecoMuonValidator.h>

Inheritance diagram for RecoMuonValidator:
DQMEDAnalyzer edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > > edm::stream::EDAnalyzerBase edm::EDConsumerBase

Classes

struct  CommonME
 
struct  HistoDimensions
 
struct  MuonME
 

Public Member Functions

virtual void analyze (const edm::Event &event, const edm::EventSetup &eventSetup) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
virtual int countMuonHits (const reco::Track &track) const
 
virtual int countTrackerHits (const reco::Track &track) const
 
virtual void dqmBeginRun (const edm::Run &, const edm::EventSetup &eventSetup) override
 
virtual void endRun (edm::Run const &, edm::EventSetup const &) override
 
 RecoMuonValidator (const edm::ParameterSet &pset)
 
 ~RecoMuonValidator ()
 
- Public Member Functions inherited from DQMEDAnalyzer
void beginRun (edm::Run const &, edm::EventSetup const &) final
 
void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer (void)
 
void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
void endRunSummary (edm::Run const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
uint32_t streamId () const
 
- Public Member Functions inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDAnalyzerBase () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Attributes

edm::InputTag beamspotLabel_
 
edm::EDGetTokenT< reco::BeamSpotbeamspotToken_
 
CommonMEcommonME_
 
DQMStoredbe_
 
bool doAbsEta_
 
bool doAssoc_
 
HistoDimensions hDim
 
edm::InputTag muAssocLabel_
 
edm::EDGetTokenT< reco::MuonToTrackingParticleAssociatormuAssocToken_
 
edm::InputTag muonLabel_
 
MuonMEmuonME_
 
std::string muonSelection_
 
edm::EDGetTokenT< edm::View< reco::Muon > > muonToken_
 
std::string outputFileName_
 
edm::InputTag primvertexLabel_
 
edm::EDGetTokenT< reco::VertexCollectionprimvertexToken_
 
edm::ParameterSet pset
 
edm::InputTag simLabel_
 
edm::EDGetTokenT< TrackingParticleCollectionsimToken_
 
std::string subDir_
 
std::string subsystemname_
 
MuonServiceProxytheMuonService
 
TrackingParticleSelector tpSelector_
 
reco::MuonTrackType trackType_
 
bool usePFMuon_
 
unsigned int verbose_
 

Private Attributes

StringCutObjectSelector< reco::Muonselector_
 
bool wantTightMuon_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDAnalyzerBase
typedef EDAnalyzerAdaptorBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static std::shared_ptr< dqmDetails::NoCacheglobalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr< dqmDetails::NoCacheglobalBeginRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *)
 
static void globalEndLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *, dqmDetails::NoCache *)
 
static void globalEndRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *, dqmDetails::NoCache *)
 
- Static Public Member Functions inherited from edm::stream::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 33 of file RecoMuonValidator.h.

Constructor & Destructor Documentation

RecoMuonValidator::RecoMuonValidator ( const edm::ParameterSet pset)

Definition at line 416 of file RecoMuonValidator.cc.

References beamspotLabel_, beamspotToken_, dbe_, RecoMuonValidator::HistoDimensions::doAbsEta, doAbsEta_, doAssoc_, Exception, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), reco::GlobalTk, hDim, reco::InnerTk, RecoMuonValidator::HistoDimensions::maxDxy, RecoMuonValidator::HistoDimensions::maxDz, RecoMuonValidator::HistoDimensions::maxErrDxy, RecoMuonValidator::HistoDimensions::maxErrDz, RecoMuonValidator::HistoDimensions::maxErrEta, RecoMuonValidator::HistoDimensions::maxErrP, RecoMuonValidator::HistoDimensions::maxErrPhi, RecoMuonValidator::HistoDimensions::maxErrPt, RecoMuonValidator::HistoDimensions::maxErrQPt, RecoMuonValidator::HistoDimensions::maxEta, RecoMuonValidator::HistoDimensions::maxP, RecoMuonValidator::HistoDimensions::maxPhi, RecoMuonValidator::HistoDimensions::maxPt, RecoMuonValidator::HistoDimensions::minDxy, RecoMuonValidator::HistoDimensions::minDz, RecoMuonValidator::HistoDimensions::minErrDxy, RecoMuonValidator::HistoDimensions::minErrDz, RecoMuonValidator::HistoDimensions::minErrEta, RecoMuonValidator::HistoDimensions::minErrP, RecoMuonValidator::HistoDimensions::minErrPhi, RecoMuonValidator::HistoDimensions::minErrPt, RecoMuonValidator::HistoDimensions::minErrQPt, RecoMuonValidator::HistoDimensions::minEta, RecoMuonValidator::HistoDimensions::minP, RecoMuonValidator::HistoDimensions::minPhi, RecoMuonValidator::HistoDimensions::minPt, muAssocLabel_, muAssocToken_, muonLabel_, MuonServiceProxy_cff::MuonServiceProxy, muonToken_, RecoMuonValidator::HistoDimensions::nAssoc, RecoMuonValidator::HistoDimensions::nBinDxy, RecoMuonValidator::HistoDimensions::nBinDz, RecoMuonValidator::HistoDimensions::nBinErr, RecoMuonValidator::HistoDimensions::nBinEta, RecoMuonValidator::HistoDimensions::nBinP, RecoMuonValidator::HistoDimensions::nBinPhi, RecoMuonValidator::HistoDimensions::nBinPt, RecoMuonValidator::HistoDimensions::nBinPull, RecoMuonValidator::HistoDimensions::nDof, RecoMuonValidator::HistoDimensions::nTrks, Utilities::operator, reco::OuterTk, outputFileName_, Pi, primvertexLabel_, primvertexToken_, reco::Segments, simLabel_, simToken_, AlCaHLTBitMon_QueryRunRegistry::string, subDir_, subsystemname_, theMuonService, tpSelector_, tkIsoDeposits_cff::trackType, trackType_, RecoMuonValidator::HistoDimensions::usePFMuon, usePFMuon_, verbose_, wantTightMuon_, and RecoMuonValidator::HistoDimensions::wPull.

416  :
417  selector_(pset.getParameter<std::string>("selection"))
418 {
419 // pset=ps;
420  verbose_ = pset.getUntrackedParameter<unsigned int>("verbose", 0);
421 
422  outputFileName_ = pset.getUntrackedParameter<string>("outputFileName", "");
423 
424  wantTightMuon_ = pset.getParameter<bool>("wantTightMuon");
425  beamspotLabel_ = pset.getParameter< edm::InputTag >("beamSpot");
426  primvertexLabel_ = pset.getParameter< edm::InputTag >("primaryVertex");
427  beamspotToken_ = consumes<reco::BeamSpot>(beamspotLabel_);
428  primvertexToken_ = consumes<reco::VertexCollection>(primvertexLabel_);
429 
430  // Set histogram dimensions from config
431 
432 
433  hDim.nBinP = pset.getUntrackedParameter<unsigned int>("nBinP");
434  hDim.minP = pset.getUntrackedParameter<double>("minP");
435  hDim.maxP = pset.getUntrackedParameter<double>("maxP");
436 
437  hDim.nBinPt = pset.getUntrackedParameter<unsigned int>("nBinPt");
438  hDim.minPt = pset.getUntrackedParameter<double>("minPt");
439  hDim.maxPt = pset.getUntrackedParameter<double>("maxPt");
440 
441  doAbsEta_ = pset.getUntrackedParameter<bool>("doAbsEta");
443  hDim.nBinEta = pset.getUntrackedParameter<unsigned int>("nBinEta");
444  hDim.minEta = pset.getUntrackedParameter<double>("minEta");
445  hDim.maxEta = pset.getUntrackedParameter<double>("maxEta");
446 
447  hDim.nBinDxy = pset.getUntrackedParameter<unsigned int>("nBinDxy");
448  hDim.minDxy = pset.getUntrackedParameter<double>("minDxy");
449  hDim.maxDxy = pset.getUntrackedParameter<double>("maxDxy");
450 
451  hDim.nBinDz = pset.getUntrackedParameter<unsigned int>("nBinDz");
452  hDim.minDz = pset.getUntrackedParameter<double>("minDz");
453  hDim.maxDz = pset.getUntrackedParameter<double>("maxDz");
454 
455  hDim.nBinPhi = pset.getUntrackedParameter<unsigned int>("nBinPhi");
456  hDim.minPhi = pset.getUntrackedParameter<double>("minPhi", -TMath::Pi());
457  hDim.maxPhi = pset.getUntrackedParameter<double>("maxPhi", TMath::Pi());
458 
459  hDim.nBinErr = pset.getUntrackedParameter<unsigned int>("nBinErr");
460  hDim.nBinPull = pset.getUntrackedParameter<unsigned int>("nBinPull");
461 
462  hDim.wPull = pset.getUntrackedParameter<double>("wPull");
463 
464  hDim.minErrP = pset.getUntrackedParameter<double>("minErrP");
465  hDim.maxErrP = pset.getUntrackedParameter<double>("maxErrP");
466 
467  hDim.minErrPt = pset.getUntrackedParameter<double>("minErrPt");
468  hDim.maxErrPt = pset.getUntrackedParameter<double>("maxErrPt");
469 
470  hDim.minErrQPt = pset.getUntrackedParameter<double>("minErrQPt");
471  hDim.maxErrQPt = pset.getUntrackedParameter<double>("maxErrQPt");
472 
473  hDim.minErrEta = pset.getUntrackedParameter<double>("minErrEta");
474  hDim.maxErrEta = pset.getUntrackedParameter<double>("maxErrEta");
475 
476  hDim.minErrPhi = pset.getUntrackedParameter<double>("minErrPhi");
477  hDim.maxErrPhi = pset.getUntrackedParameter<double>("maxErrPhi");
478 
479  hDim.minErrDxy = pset.getUntrackedParameter<double>("minErrDxy");
480  hDim.maxErrDxy = pset.getUntrackedParameter<double>("maxErrDxy");
481 
482  hDim.minErrDz = pset.getUntrackedParameter<double>("minErrDz" );
483  hDim.maxErrDz = pset.getUntrackedParameter<double>("maxErrDz" );
484 
485  hDim.nTrks = pset.getUntrackedParameter<unsigned int>("nTrks");
486  hDim.nAssoc = pset.getUntrackedParameter<unsigned int>("nAssoc");
487  hDim.nDof = pset.getUntrackedParameter<unsigned int>("nDof", 55);
488 
489 
490  // Labels for simulation and reconstruction tracks
491  simLabel_ = pset.getParameter<InputTag>("simLabel" );
492  muonLabel_ = pset.getParameter<InputTag>("muonLabel");
493  simToken_ = consumes<TrackingParticleCollection>(simLabel_);
494  muonToken_ = consumes<edm::View<reco::Muon> >(muonLabel_);
495 
496  // Labels for sim-reco association
497  doAssoc_ = pset.getUntrackedParameter<bool>("doAssoc", true);
498  muAssocLabel_ = pset.getParameter<InputTag>("muAssocLabel");
499  if(doAssoc_) {
500  muAssocToken_ = consumes<reco::MuonToTrackingParticleAssociator>(muAssocLabel_);
501  }
502 
503 // Different momentum assignment and additional histos in case of PF muons
504  usePFMuon_ = pset.getUntrackedParameter<bool>("usePFMuon");
506 
507 
508 
509  //type of track
510  std::string trackType = pset.getParameter< std::string >("trackType");
511  if (trackType == "inner") trackType_ = reco::InnerTk;
512  else if (trackType == "outer") trackType_ = reco::OuterTk;
513  else if (trackType == "global") trackType_ = reco::GlobalTk;
514  else if (trackType == "segments") trackType_ = reco::Segments;
515  else throw cms::Exception("Configuration") << "Track type '" << trackType << "' not supported.\n";
516 
517 // seedPropagatorName_ = pset.getParameter<string>("SeedPropagator");
518 
519  ParameterSet tpset = pset.getParameter<ParameterSet>("tpSelector");
520  tpSelector_ = TrackingParticleSelector(tpset.getParameter<double>("ptMin"),
521  tpset.getParameter<double>("ptMax"),
522  tpset.getParameter<double>("minRapidity"),
523  tpset.getParameter<double>("maxRapidity"),
524  tpset.getParameter<double>("tip"),
525  tpset.getParameter<double>("lip"),
526  tpset.getParameter<int>("minHit"),
527  tpset.getParameter<bool>("signalOnly"),
528  tpset.getParameter<bool>("intimeOnly"),
529  tpset.getParameter<bool>("chargedOnly"),
530  tpset.getParameter<bool>("stableOnly"),
531  tpset.getParameter<std::vector<int> >("pdgId"));
532 
533 
534  // the service parameters
535  ParameterSet serviceParameters
536  = pset.getParameter<ParameterSet>("ServiceParameters");
537  theMuonService = new MuonServiceProxy(serviceParameters);
538 
539  // retrieve the instance of DQMService
541  subsystemname_ = pset.getUntrackedParameter<std::string>("subSystemFolder", "YourSubsystem") ;
542 
543  subDir_ = pset.getUntrackedParameter<string>("subDir");
544  if ( subDir_.empty() ) subDir_ = "RecoMuonV";
545  if ( subDir_[subDir_.size()-1] == '/' ) subDir_.erase(subDir_.size()-1);
546 
547 
548 }
const double Pi
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< edm::View< reco::Muon > > muonToken_
edm::EDGetTokenT< TrackingParticleCollection > simToken_
edm::InputTag simLabel_
StringCutObjectSelector< reco::Muon > selector_
reco::MuonTrackType trackType_
edm::EDGetTokenT< reco::VertexCollection > primvertexToken_
TrackingParticleSelector tpSelector_
SingleObjectSelector< TrackingParticleCollection,::TrackingParticleSelector > TrackingParticleSelector
MuonServiceProxy * theMuonService
edm::InputTag muAssocLabel_
HistoDimensions hDim
std::string outputFileName_
edm::EDGetTokenT< reco::BeamSpot > beamspotToken_
unsigned int verbose_
edm::InputTag muonLabel_
std::string subsystemname_
edm::EDGetTokenT< reco::MuonToTrackingParticleAssociator > muAssocToken_
edm::InputTag beamspotLabel_
edm::InputTag primvertexLabel_
RecoMuonValidator::~RecoMuonValidator ( )

Definition at line 607 of file RecoMuonValidator.cc.

References theMuonService.

608 {
609  if ( theMuonService ) delete theMuonService;
610 }
MuonServiceProxy * theMuonService

Member Function Documentation

void RecoMuonValidator::analyze ( const edm::Event event,
const edm::EventSetup eventSetup 
)
overridevirtual

Definition at line 632 of file RecoMuonValidator.cc.

References reco::MuonToTrackingParticleAssociator::associateMuons(), beamspotToken_, reco::BeamSpot::BeamWidthX(), reco::BeamSpot::BeamWidthY(), edm::View< T >::begin(), commonME_, funct::cos(), countMuonHits(), countTrackerHits(), doAbsEta_, doAssoc_, edm::View< T >::end(), relativeConstraints::error, MonitorElement::Fill(), RecoMuonValidator::MuonME::fill(), edm::Ref< C, T, F >::get(), RecoMuonValidator::CommonME::hMuonAllEta_, RecoMuonValidator::CommonME::hMuonAllP_, RecoMuonValidator::CommonME::hMuonAllPhi_, RecoMuonValidator::CommonME::hMuonAllPt_, RecoMuonValidator::CommonME::hMuonEta_, RecoMuonValidator::CommonME::hMuonP_, RecoMuonValidator::CommonME::hMuonPhi_, RecoMuonValidator::CommonME::hMuonPt_, RecoMuonValidator::CommonME::hMuonTrackDxy_, RecoMuonValidator::CommonME::hMuonTrackDz_, RecoMuonValidator::CommonME::hMuonTrackEta_, RecoMuonValidator::CommonME::hMuonTrackP_, RecoMuonValidator::CommonME::hMuonTrackPhi_, RecoMuonValidator::CommonME::hMuonTrackPt_, RecoMuonValidator::CommonME::hNDeltaInvalidHitsHitPattern_, RecoMuonValidator::CommonME::hNInvalidHitsGTHitPattern_, RecoMuonValidator::CommonME::hNInvalidHitsITHitPattern_, RecoMuonValidator::CommonME::hNInvalidHitsOTHitPattern_, RecoMuonValidator::MuonME::hNMuon_, RecoMuonValidator::MuonME::hNMuonHits_, RecoMuonValidator::MuonME::hNMuonHits_vs_Eta_, RecoMuonValidator::MuonME::hNMuonHits_vs_Pt_, RecoMuonValidator::MuonME::hNSim_, RecoMuonValidator::MuonME::hNSimHits_, RecoMuonValidator::MuonME::hNSimToReco_, RecoMuonValidator::MuonME::hNTrackerHits_, RecoMuonValidator::MuonME::hNTrackerHits_vs_Eta_, RecoMuonValidator::MuonME::hNTrackerHits_vs_Pt_, RecoMuonValidator::MuonME::hNTrksEta_, RecoMuonValidator::MuonME::hNTrksPt_, RecoMuonValidator::MuonME::hSimDxy_, RecoMuonValidator::MuonME::hSimDz_, RecoMuonValidator::MuonME::hSimEta_, RecoMuonValidator::MuonME::hSimP_, RecoMuonValidator::MuonME::hSimPhi_, RecoMuonValidator::MuonME::hSimPt_, RecoMuonValidator::CommonME::hStaToGlbDiffNMuonHits_, RecoMuonValidator::CommonME::hStaToGlbDiffNMuonHitsEta_, RecoMuonValidator::CommonME::hStaToGlbDiffNMuonHitsPt_, RecoMuonValidator::CommonME::hTrkToGlbDiffNTrackerHits_, RecoMuonValidator::CommonME::hTrkToGlbDiffNTrackerHitsEta_, RecoMuonValidator::CommonME::hTrkToGlbDiffNTrackerHitsPt_, mps_fire::i, edm::Ref< C, T, F >::isNonnull(), muon::isTightMuon(), Mu, muAssocToken_, PatBasicFWLiteAnalyzer::muonEta, muonME_, PatBasicFWLiteAnalyzer::muonPhi, PatBasicFWLiteAnalyzer::muonPt, Reconstruction_hiPF_cff::Muons, muonToken_, reco::BeamSpot::position(), position, primvertexToken_, edm::Handle< T >::product(), edm::RefToBaseVector< T >::push_back(), edm::RefVector< C, T, F >::push_back(), selector_, reco::BeamSpot::sigmaZ(), simToken_, funct::sin(), edm::View< T >::size(), tpSelector_, trackType_, usePFMuon_, wantTightMuon_, and PV3DBase< T, PVType, FrameType >::x().

633 {
634  // Look for the Primary Vertex (and use the BeamSpot instead, if you can't find it):
635  reco::Vertex::Point posVtx;
636  reco::Vertex::Error errVtx;
638  event.getByToken(primvertexToken_,recVtxs);
639  unsigned int theIndexOfThePrimaryVertex = 999.;
640  for (unsigned int ind=0; ind<recVtxs->size(); ++ind) {
641  if ( (*recVtxs)[ind].isValid() && !((*recVtxs)[ind].isFake()) ) {
642  theIndexOfThePrimaryVertex = ind;
643  break;
644  }
645  }
646  if (theIndexOfThePrimaryVertex<100) {
647  posVtx = ((*recVtxs)[theIndexOfThePrimaryVertex]).position();
648  errVtx = ((*recVtxs)[theIndexOfThePrimaryVertex]).error();
649  }
650  else {
651  LogInfo("RecoMuonValidator") << "reco::PrimaryVertex not found, use BeamSpot position instead\n";
652  edm::Handle<reco::BeamSpot> recoBeamSpotHandle;
653  event.getByToken(beamspotToken_,recoBeamSpotHandle);
654  reco::BeamSpot bs = *recoBeamSpotHandle;
655  posVtx = bs.position();
656  errVtx(0,0) = bs.BeamWidthX();
657  errVtx(1,1) = bs.BeamWidthY();
658  errVtx(2,2) = bs.sigmaZ();
659  }
660  const reco::Vertex thePrimaryVertex(posVtx,errVtx);
661 
662 
663  // Get TrackingParticles
665  event.getByToken(simToken_, simHandle);
666  const TrackingParticleCollection simColl = *(simHandle.product());
667 
668  // Get Muons
669  Handle<edm::View<Muon> > muonHandle;
670  event.getByToken(muonToken_, muonHandle);
671  View<Muon> muonColl = *(muonHandle.product());
672 
673  reco::MuonToTrackingParticleAssociator const* assoByHits = nullptr;
674  if ( doAssoc_ ) {
676  event.getByToken(muAssocToken_, associatorBase);
677  assoByHits = associatorBase.product();
678  }
679 
680  const TrackingParticleCollection::size_type nSim = simColl.size();
681 
683  for (size_t i = 0; i < muonHandle->size(); ++i) {
684  Muons.push_back(muonHandle->refAt(i));
685  }
686 
688  for (size_t i = 0; i < nSim; ++i) {
689  allTPs.push_back(TrackingParticleRef(simHandle,i));
690  }
691 
692 
693  muonME_->hNSim_->Fill(nSim);
694  muonME_->hNMuon_->Fill(muonColl.size());
695 
696  reco::MuonToSimCollection muonToSimColl;
697  reco::SimToMuonCollection simToMuonColl;
698 
699 
700  if ( doAssoc_ ) {
701  assoByHits->associateMuons(muonToSimColl, simToMuonColl, Muons, trackType_, allTPs);
702  } else {
703 
704 /*
705  // SimToMuon associations
706  Handle<reco::RecoToSimCollection> simToTrkMuHandle;
707  event.getByLabel(trkMuAssocLabel_, simToTrkMuHandle);
708  trkSimRecColl = *(simToTrkMuHandle.product());
709 
710  Handle<reco::RecoToSimCollection> simToStaMuHandle;
711  event.getByLabel(staMuAssocLabel_, simToStaMuHandle);
712  staSimRecColl = *(simToStaMuHandle.product());
713 
714  Handle<reco::RecoToSimCollection> simToGlbMuHandle;
715  event.getByLabel(glbMuAssocLabel_, simToGlbMuHandle);
716  glbSimRecColl = *(simToGlbMuHandle.product());
717 
718  // MuonToSim associations
719  Handle<reco::SimToRecoCollection> trkMuToSimHandle;
720  event.getByLabel(trkMuAssocLabel_, trkMuToSimHandle);
721  trkRecSimColl = *(trkMuToSimHandle.product());
722 
723  Handle<reco::SimToRecoCollection> staMuToSimHandle;
724  event.getByLabel(staMuAssocLabel_, staMuToSimHandle);
725  staRecSimColl = *(staMuToSimHandle.product());
726 
727  Handle<reco::SimToRecoCollection> glbMuToSimHandle;
728  event.getByLabel(glbMuAssocLabel_, glbMuToSimHandle);
729  glbRecSimColl = *(glbMuToSimHandle.product());
730 */
731  }
732 
733 
734 
735  int glbNTrackerHits = 0; int trkNTrackerHits = 0;
736  int glbNMuonHits = 0; int staNMuonHits = 0;
737  int NTrackerHits = 0; int NMuonHits = 0;
738 
739 
740  // Analyzer reco::Muon
741  for(View<Muon>::const_iterator iMuon = muonColl.begin();
742  iMuon != muonColl.end(); ++iMuon) {
743 
744  double muonP, muonPt, muonEta, muonPhi;
745  if (usePFMuon_) {
746  muonP = iMuon->pfP4().P();
747  muonPt = iMuon->pfP4().Pt();
748  muonEta = iMuon->pfP4().Eta();
749  muonPhi = iMuon->pfP4().Phi();
750  }
751  else {
752  muonP = iMuon->p();
753  muonPt = iMuon->pt();
754  muonEta = iMuon->eta();
755  muonPhi = iMuon->phi();
756  }
757 
758  //histograms for fractions
759  commonME_->hMuonAllP_->Fill(muonP);
760  commonME_->hMuonAllPt_->Fill(muonPt);
761  commonME_->hMuonAllEta_->Fill(muonEta);
762  commonME_->hMuonAllPhi_->Fill(muonPhi);
763 
764  if (!selector_(*iMuon)) continue;
765  if (wantTightMuon_)
766  {
767  if (!muon::isTightMuon(*iMuon, thePrimaryVertex)) continue;
768  }
769 
770  TrackRef Track = iMuon->track();
771 
772  if (Track.isNonnull()) {
773  commonME_->hMuonTrackP_->Fill(Track->p());
774  commonME_->hMuonTrackPt_->Fill(Track->pt());
775  commonME_->hMuonTrackEta_->Fill(Track->eta());
776  commonME_->hMuonTrackPhi_->Fill(Track->phi());
777 
778  //ip histograms
779  commonME_->hMuonTrackDxy_->Fill(Track->dxy());
780  commonME_->hMuonTrackDz_->Fill(Track->dz());
781  }
782 
783  if (iMuon->isGlobalMuon()) {
784  Track = iMuon->combinedMuon();
785  glbNTrackerHits = countTrackerHits(*Track);
786  glbNMuonHits = countMuonHits(*Track);
787  } else if (iMuon->isTrackerMuon()) {
788  Track = iMuon->track();
789  trkNTrackerHits = countTrackerHits(*Track);
790  } else {
791  Track = iMuon->standAloneMuon();
792  }
793 
794  NTrackerHits = countTrackerHits(*Track);
795  muonME_->hNTrackerHits_->Fill(NTrackerHits);
796  muonME_->hNTrackerHits_vs_Pt_->Fill(Track->pt(), NTrackerHits);
797  muonME_->hNTrackerHits_vs_Eta_->Fill(Track->eta(), NTrackerHits);
798 
799  NMuonHits = countMuonHits(*Track);
800  muonME_->hNMuonHits_->Fill(NMuonHits);
801  muonME_->hNMuonHits_vs_Pt_->Fill(Track->pt(), NMuonHits);
802  muonME_->hNMuonHits_vs_Eta_->Fill(Track->eta(), NMuonHits);
803 
804 //list of histos for each type
805 
806 // muonME_->hNTrks_->Fill();
807  muonME_->hNTrksEta_->Fill(Track->eta());
808  muonME_->hNTrksPt_->Fill(Track->pt());
809 
810  commonME_->hMuonP_->Fill(muonP);
811  commonME_->hMuonPt_->Fill(muonPt);
812  commonME_->hMuonEta_->Fill(muonEta);
813  commonME_->hMuonPhi_->Fill(muonPhi);
814 
815  if (iMuon->isGlobalMuon()) {
816  double gtHitPat = iMuon->globalTrack()->hitPattern().numberOfAllHits(HitPattern::TRACK_HITS)
817  - iMuon->globalTrack()->hitPattern().numberOfValidHits();
818 
819  double itHitPat = iMuon->innerTrack()->hitPattern().numberOfAllHits(HitPattern::TRACK_HITS)
820  - iMuon->innerTrack()->hitPattern().numberOfValidHits();
821 
822  double otHitPat = iMuon->outerTrack()->hitPattern().numberOfAllHits(HitPattern::TRACK_HITS)
823  - iMuon->outerTrack()->hitPattern().numberOfValidHits();
824 
828  commonME_->hNDeltaInvalidHitsHitPattern_->Fill(gtHitPat - itHitPat - otHitPat);
829 
830  //must be global and standalone
831  if (iMuon->isStandAloneMuon()) {
832  commonME_->hStaToGlbDiffNMuonHitsEta_->Fill(Track->eta(),staNMuonHits-glbNMuonHits);
833  commonME_->hStaToGlbDiffNMuonHitsPt_->Fill(Track->pt(),staNMuonHits-glbNMuonHits);
834  commonME_->hStaToGlbDiffNMuonHits_->Fill(staNMuonHits-glbNMuonHits);
835  }
836 
837  //must be global and tracker
838  if (iMuon->isTrackerMuon()) {
839  commonME_->hTrkToGlbDiffNTrackerHitsEta_->Fill(Track->eta(),trkNTrackerHits-glbNTrackerHits);
840  commonME_->hTrkToGlbDiffNTrackerHitsPt_->Fill(Track->pt(),trkNTrackerHits-glbNTrackerHits);
841  commonME_->hTrkToGlbDiffNTrackerHits_->Fill(trkNTrackerHits-glbNTrackerHits);
842  }
843  }
844 
845  }//end of reco muon loop
846 
847 
848  // Associate by hits
849  for(TrackingParticleCollection::size_type i=0; i<nSim; i++) {
850  TrackingParticleRef simRef(simHandle, i);
851  const TrackingParticle* simTP = simRef.get();
852  if ( ! tpSelector_(*simTP) ) continue;
853 
854  //denominators for efficiency plots
855  const double simP = simRef->p();
856  const double simPt = simRef->pt();
857  const double simEta = doAbsEta_ ? fabs(simRef->eta()) : simRef->eta();
858  const double simPhi = simRef->phi();
859 
860  GlobalPoint simVtx(simRef->vertex().x(), simRef->vertex().y(), simRef->vertex().z());
861  GlobalVector simMom(simRef->momentum().x(), simRef->momentum().y(), simRef->momentum().z());
862  const double simDxy = -simVtx.x()*sin(simPhi)+simVtx.y()*cos(simPhi);
863  const double simDz = simVtx.z() - (simVtx.x()*simMom.x()+simVtx.y()*simMom.y())*simMom.z()/simMom.perp2();
864 
865  const unsigned int nSimHits = simRef->numberOfHits();
866 
867  muonME_->hSimP_ ->Fill(simP );
868  muonME_->hSimPt_ ->Fill(simPt );
869  muonME_->hSimEta_->Fill(simEta);
870  muonME_->hSimPhi_->Fill(simPhi);
871  muonME_->hSimDxy_->Fill(simDxy);
872  muonME_->hSimDz_->Fill(simDz);
873  muonME_->hNSimHits_->Fill(nSimHits);
874 
875  // Get sim-reco association for a simRef
876  vector<pair<RefToBase<Muon>, double> > MuRefV;
877  if ( simToMuonColl.find(simRef) != simToMuonColl.end() ) {
878  MuRefV = simToMuonColl[simRef];
879 
880  if ( !MuRefV.empty()) {
881  muonME_->hNSimToReco_->Fill(MuRefV.size());
882  const Muon* Mu = MuRefV.begin()->first.get();
883  if (!selector_(*Mu)) continue;
884  if (wantTightMuon_)
885  {
886  if (!muon::isTightMuon(*Mu, thePrimaryVertex)) continue;
887  }
888 
889  muonME_->fill(&*simTP, Mu);
890  }
891  }
892  }
893 }
edm::EDGetTokenT< edm::View< reco::Muon > > muonToken_
edm::EDGetTokenT< TrackingParticleCollection > simToken_
std::map< edm::RefToBase< reco::Muon >, std::vector< std::pair< TrackingParticleRef, double > >, RefToBaseSort > MuonToSimCollection
Definition: MuonTrackType.h:34
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:253
std::vector< TrackingParticle > TrackingParticleCollection
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
StringCutObjectSelector< reco::Muon > selector_
math::Error< dimension >::type Error
covariance error matrix (3x3)
Definition: Vertex.h:43
size_type size() const
reco::MuonTrackType trackType_
edm::EDGetTokenT< reco::VertexCollection > primvertexToken_
virtual int countTrackerHits(const reco::Track &track) const
uint16_t size_type
void Fill(long long x)
std::map< TrackingParticleRef, std::vector< std::pair< edm::RefToBase< reco::Muon >, double > > > SimToMuonCollection
Definition: MuonTrackType.h:35
TrackingParticleSelector tpSelector_
const_iterator begin() const
Definition: Muon.py:1
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
void associateMuons(MuonToSimCollection &recoToSim, SimToMuonCollection &simToReco, const edm::RefToBaseVector< reco::Muon > &muons, MuonTrackType type, const edm::RefVector< TrackingParticleCollection > &tpColl) const
virtual int countMuonHits(const reco::Track &track) const
edm::EDGetTokenT< reco::BeamSpot > beamspotToken_
double p() const
Magnitude of momentum vector. Note this is taken from the first SimTrack only.
math::XYZPoint Point
point in the space
Definition: Vertex.h:39
double BeamWidthX() const
beam width X
Definition: BeamSpot.h:86
void fill(const TrackingParticle *simRef, const Muon *muonRef)
Definition: L1GtObject.h:30
T const * product() const
Definition: Handle.h:81
double sigmaZ() const
sigma z
Definition: BeamSpot.h:80
double BeamWidthY() const
beam width Y
Definition: BeamSpot.h:88
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:86
static int position[264][3]
Definition: ReadPGInfo.cc:509
void push_back(const RefToBase< T > &)
edm::EDGetTokenT< reco::MuonToTrackingParticleAssociator > muAssocToken_
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
Definition: RefVector.h:69
Monte Carlo truth information used for tracking validation.
const Point & position() const
position
Definition: BeamSpot.h:62
const_iterator end() const
bool isTightMuon(const reco::Muon &, const reco::Vertex &)
T x() const
Definition: PV3DBase.h:62
edm::Ref< TrackingParticleCollection > TrackingParticleRef
void RecoMuonValidator::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  iRun,
edm::EventSetup const &   
)
overridevirtual

Implements DQMEDAnalyzer.

Definition at line 550 of file RecoMuonValidator.cc.

References DQMStore::IBooker::book1D(), DQMStore::IBooker::book2D(), RecoMuonValidator::MuonME::bookHistos(), DQMStore::IBooker::cd(), commonME_, hDim, RecoMuonValidator::CommonME::hMuonAllEta_, RecoMuonValidator::CommonME::hMuonAllP_, RecoMuonValidator::CommonME::hMuonAllPhi_, RecoMuonValidator::CommonME::hMuonAllPt_, RecoMuonValidator::CommonME::hMuonEta_, RecoMuonValidator::CommonME::hMuonP_, RecoMuonValidator::CommonME::hMuonPhi_, RecoMuonValidator::CommonME::hMuonPt_, RecoMuonValidator::CommonME::hMuonTrackDxy_, RecoMuonValidator::CommonME::hMuonTrackDz_, RecoMuonValidator::CommonME::hMuonTrackEta_, RecoMuonValidator::CommonME::hMuonTrackP_, RecoMuonValidator::CommonME::hMuonTrackPhi_, RecoMuonValidator::CommonME::hMuonTrackPt_, RecoMuonValidator::CommonME::hNDeltaInvalidHitsHitPattern_, RecoMuonValidator::CommonME::hNInvalidHitsGTHitPattern_, RecoMuonValidator::CommonME::hNInvalidHitsITHitPattern_, RecoMuonValidator::CommonME::hNInvalidHitsOTHitPattern_, RecoMuonValidator::CommonME::hStaToGlbDiffNMuonHits_, RecoMuonValidator::CommonME::hStaToGlbDiffNMuonHitsEta_, RecoMuonValidator::CommonME::hStaToGlbDiffNMuonHitsPt_, RecoMuonValidator::CommonME::hTrkToGlbDiffNTrackerHits_, RecoMuonValidator::CommonME::hTrkToGlbDiffNTrackerHitsEta_, RecoMuonValidator::CommonME::hTrkToGlbDiffNTrackerHitsPt_, RecoMuonValidator::HistoDimensions::maxDxy, RecoMuonValidator::HistoDimensions::maxDz, RecoMuonValidator::HistoDimensions::maxEta, RecoMuonValidator::HistoDimensions::maxP, RecoMuonValidator::HistoDimensions::maxPhi, RecoMuonValidator::HistoDimensions::maxPt, RecoMuonValidator::HistoDimensions::minDxy, RecoMuonValidator::HistoDimensions::minDz, RecoMuonValidator::HistoDimensions::minEta, RecoMuonValidator::HistoDimensions::minP, RecoMuonValidator::HistoDimensions::minPhi, RecoMuonValidator::HistoDimensions::minPt, muonME_, RecoMuonValidator::HistoDimensions::nBinDxy, RecoMuonValidator::HistoDimensions::nBinDz, RecoMuonValidator::HistoDimensions::nBinEta, RecoMuonValidator::HistoDimensions::nBinP, RecoMuonValidator::HistoDimensions::nBinPhi, RecoMuonValidator::HistoDimensions::nBinPt, DQMStore::IBooker::setCurrentFolder(), and subDir_.

552  {
553 
554 
555  // book histograms
556  ibooker.cd();
557 
558  ibooker.setCurrentFolder(subDir_);
559 
560  commonME_ = new CommonME;
561  muonME_ = new MuonME;
562 
563  //commonME
564  const int nHits = 100;
565 
566  // - diffs
567  commonME_->hTrkToGlbDiffNTrackerHits_ = ibooker.book1D("TrkGlbDiffNTrackerHits", "Difference of number of tracker hits (tkMuon - globalMuon)", 2*nHits+1, -nHits-0.5, nHits+0.5);
568  commonME_->hStaToGlbDiffNMuonHits_ = ibooker.book1D("StaGlbDiffNMuonHits", "Difference of number of muon hits (staMuon - globalMuon)", 2*nHits+1, -nHits-0.5, nHits+0.5);
569 
570  commonME_->hTrkToGlbDiffNTrackerHitsEta_ = ibooker.book2D("TrkGlbDiffNTrackerHitsEta", "Difference of number of tracker hits (tkMuon - globalMuon)", hDim.nBinEta, hDim.minEta, hDim.maxEta,2*nHits+1, -nHits-0.5, nHits+0.5);
571  commonME_->hStaToGlbDiffNMuonHitsEta_ = ibooker.book2D("StaGlbDiffNMuonHitsEta", "Difference of number of muon hits (staMuon - globalMuon)", hDim.nBinEta, hDim.minEta, hDim.maxEta,2*nHits+1, -nHits-0.5, nHits+0.5);
572 
573  commonME_->hTrkToGlbDiffNTrackerHitsPt_ = ibooker.book2D("TrkGlbDiffNTrackerHitsPt", "Difference of number of tracker hits (tkMuon - globalMuon)", hDim.nBinPt, hDim.minPt, hDim.maxPt,2*nHits+1, -nHits-0.5, nHits+0.5);
574  commonME_->hStaToGlbDiffNMuonHitsPt_ = ibooker.book2D("StaGlbDiffNMuonHitsPt", "Difference of number of muon hits (staMuon - globalMuon)", hDim.nBinPt, hDim.minPt, hDim.maxPt,2*nHits+1, -nHits-0.5, nHits+0.5);
575 
576  // -global muon hit pattern
577  commonME_->hNInvalidHitsGTHitPattern_ = ibooker.book1D("NInvalidHitsGTHitPattern", "Number of invalid hits on a global track", nHits+1, -0.5, nHits+0.5);
578  commonME_->hNInvalidHitsITHitPattern_ = ibooker.book1D("NInvalidHitsITHitPattern", "Number of invalid hits on an inner track", nHits+1, -0.5, nHits+0.5);
579  commonME_->hNInvalidHitsOTHitPattern_ = ibooker.book1D("NInvalidHitsOTHitPattern", "Number of invalid hits on an outer track", nHits+1, -0.5, nHits+0.5);
580  commonME_->hNDeltaInvalidHitsHitPattern_ = ibooker.book1D("hNDeltaInvalidHitsHitPattern", "The discrepancy for Number of invalid hits on an global track and inner and outer tracks", 2*nHits+1, -nHits-0.5, nHits+0.5);
581 
582  //muon based kinematics
583  commonME_->hMuonP_ = ibooker.book1D("PMuon" , "p of muon" , hDim.nBinP , hDim.minP , hDim.maxP );
584  commonME_->hMuonPt_ = ibooker.book1D("PtMuon" , "p_{T} of muon", hDim.nBinPt , hDim.minPt , hDim.maxPt );
585  commonME_->hMuonEta_ = ibooker.book1D("EtaMuon", "#eta of muon" , hDim.nBinEta, hDim.minEta, hDim.maxEta);
586  commonME_->hMuonPhi_ = ibooker.book1D("PhiMuon", "#phi of muon" , hDim.nBinPhi, hDim.minPhi, hDim.maxPhi);
587  //track based kinematics
588  commonME_->hMuonTrackP_ = ibooker.book1D("PMuonTrack" , "p of reco muon track" , hDim.nBinP , hDim.minP , hDim.maxP );
589  commonME_->hMuonTrackPt_ = ibooker.book1D("PtMuonTrack" , "p_{T} of reco muon track", hDim.nBinPt , hDim.minPt , hDim.maxPt );
590  commonME_->hMuonTrackEta_ = ibooker.book1D("EtaMuonTrack", "#eta of reco muon track" , hDim.nBinEta, hDim.minEta, hDim.maxEta);
591  commonME_->hMuonTrackPhi_ = ibooker.book1D("PhiMuonTrack", "#phi of reco muon track" , hDim.nBinPhi, hDim.minPhi, hDim.maxPhi);
592  commonME_->hMuonTrackDxy_ = ibooker.book1D("DxyMuonTrack", "Dxy of reco muon track" , hDim.nBinDxy, hDim.minDxy, hDim.maxDxy);
593  commonME_->hMuonTrackDz_ = ibooker.book1D("DzMuonTrack", "Dz of reco muon track" , hDim.nBinDz, hDim.minDz, hDim.maxDz);
594 
595  //histograms for fractions
596  commonME_->hMuonAllP_ = ibooker.book1D("PMuonAll" , "p of muons of all types" , hDim.nBinP , hDim.minP , hDim.maxP );
597  commonME_->hMuonAllPt_ = ibooker.book1D("PtMuonAll" , "p_{T} of muon of all types", hDim.nBinPt , hDim.minPt , hDim.maxPt );
598  commonME_->hMuonAllEta_ = ibooker.book1D("EtaMuonAll", "#eta of muon of all types" , hDim.nBinEta, hDim.minEta, hDim.maxEta);
599  commonME_->hMuonAllPhi_ = ibooker.book1D("PhiMuonAll", "#phi of muon of all types" , hDim.nBinPhi, hDim.minPhi, hDim.maxPhi);
600 
601  muonME_->bookHistos(ibooker, subDir_, hDim);
602 }
void cd(void)
Definition: DQMStore.cc:269
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
HistoDimensions hDim
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:277
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
void bookHistos(DQMStore::IBooker &ibooker, const string &dirName, const HistoDimensions &hDim)
int RecoMuonValidator::countMuonHits ( const reco::Track track) const
virtual

Definition at line 896 of file RecoMuonValidator.cc.

References KineDebug3::count(), DetId::det(), DetId::Muon, reco::Track::recHitsBegin(), reco::Track::recHitsEnd(), and mps_fire::result.

Referenced by analyze().

896  {
898 
899  int count = 0;
900 
901  for (trackingRecHit_iterator hit = track.recHitsBegin(); hit != track.recHitsEnd(); ++hit) {
902  if((*hit)->isValid()) {
903  DetId recoid = (*hit)->geographicalId();
904  if ( recoid.det() == DetId::Muon ) count++;
905  }
906  }
907  return count;
908 }
trackingRecHit_iterator recHitsBegin() const
Iterator to first hit on the track.
Definition: Track.h:104
std::vector< ConstRecHitPointer > ConstRecHitContainer
Definition: DetId.h:18
Detector det() const
get the detector field from this detid
Definition: DetId.h:35
TrackingRecHitCollection::base::const_iterator trackingRecHit_iterator
iterator over a vector of reference to TrackingRecHit in the same collection
trackingRecHit_iterator recHitsEnd() const
Iterator to last hit on the track.
Definition: Track.h:109
int RecoMuonValidator::countTrackerHits ( const reco::Track track) const
virtual

Definition at line 911 of file RecoMuonValidator.cc.

References KineDebug3::count(), DetId::det(), reco::Track::recHitsBegin(), reco::Track::recHitsEnd(), mps_fire::result, and DetId::Tracker.

Referenced by analyze().

911  {
913 
914  int count = 0;
915 
916  for (trackingRecHit_iterator hit = track.recHitsBegin(); hit != track.recHitsEnd(); ++hit) {
917  if((*hit)->isValid()) {
918  DetId recoid = (*hit)->geographicalId();
919  if ( recoid.det() == DetId::Tracker ) count++;
920  }
921  }
922  return count;
923 }
trackingRecHit_iterator recHitsBegin() const
Iterator to first hit on the track.
Definition: Track.h:104
std::vector< ConstRecHitPointer > ConstRecHitContainer
Definition: DetId.h:18
Detector det() const
get the detector field from this detid
Definition: DetId.h:35
TrackingRecHitCollection::base::const_iterator trackingRecHit_iterator
iterator over a vector of reference to TrackingRecHit in the same collection
trackingRecHit_iterator recHitsEnd() const
Iterator to last hit on the track.
Definition: Track.h:109
void RecoMuonValidator::dqmBeginRun ( const edm::Run ,
const edm::EventSetup eventSetup 
)
overridevirtual

Definition at line 616 of file RecoMuonValidator.cc.

References theMuonService.

617 {
618  if ( theMuonService ) theMuonService->update(eventSetup);
619 }
MuonServiceProxy * theMuonService
void RecoMuonValidator::endRun ( edm::Run const &  ,
edm::EventSetup const &   
)
overridevirtual

Reimplemented from edm::stream::EDAnalyzerBase.

Definition at line 624 of file RecoMuonValidator.cc.

References dbe_, and outputFileName_.

625 {
626  if ( dbe_ && ! outputFileName_.empty() ) dbe_->save(outputFileName_);
627 }
std::string outputFileName_

Member Data Documentation

edm::InputTag RecoMuonValidator::beamspotLabel_
protected

Definition at line 58 of file RecoMuonValidator.h.

Referenced by RecoMuonValidator().

edm::EDGetTokenT<reco::BeamSpot> RecoMuonValidator::beamspotToken_
protected

Definition at line 60 of file RecoMuonValidator.h.

Referenced by analyze(), and RecoMuonValidator().

CommonME* RecoMuonValidator::commonME_
protected

Definition at line 84 of file RecoMuonValidator.h.

Referenced by analyze(), and bookHistograms().

DQMStore* RecoMuonValidator::dbe_
protected

Definition at line 69 of file RecoMuonValidator.h.

Referenced by endRun(), and RecoMuonValidator().

bool RecoMuonValidator::doAbsEta_
protected

Definition at line 71 of file RecoMuonValidator.h.

Referenced by analyze(), and RecoMuonValidator().

bool RecoMuonValidator::doAssoc_
protected

Definition at line 72 of file RecoMuonValidator.h.

Referenced by analyze(), and RecoMuonValidator().

HistoDimensions RecoMuonValidator::hDim
protected

Definition at line 130 of file RecoMuonValidator.h.

Referenced by bookHistograms(), and RecoMuonValidator().

edm::InputTag RecoMuonValidator::muAssocLabel_
protected

Definition at line 55 of file RecoMuonValidator.h.

Referenced by RecoMuonValidator().

edm::EDGetTokenT<reco::MuonToTrackingParticleAssociator> RecoMuonValidator::muAssocToken_
protected

Definition at line 56 of file RecoMuonValidator.h.

Referenced by analyze(), and RecoMuonValidator().

edm::InputTag RecoMuonValidator::muonLabel_
protected

Definition at line 50 of file RecoMuonValidator.h.

Referenced by RecoMuonValidator().

MuonME* RecoMuonValidator::muonME_
protected

Definition at line 81 of file RecoMuonValidator.h.

Referenced by analyze(), and bookHistograms().

std::string RecoMuonValidator::muonSelection_
protected

Definition at line 51 of file RecoMuonValidator.h.

edm::EDGetTokenT<edm::View<reco::Muon> > RecoMuonValidator::muonToken_
protected

Definition at line 53 of file RecoMuonValidator.h.

Referenced by analyze(), and RecoMuonValidator().

std::string RecoMuonValidator::outputFileName_
protected

Definition at line 63 of file RecoMuonValidator.h.

Referenced by endRun(), and RecoMuonValidator().

edm::InputTag RecoMuonValidator::primvertexLabel_
protected

Definition at line 59 of file RecoMuonValidator.h.

Referenced by RecoMuonValidator().

edm::EDGetTokenT<reco::VertexCollection> RecoMuonValidator::primvertexToken_
protected

Definition at line 61 of file RecoMuonValidator.h.

Referenced by analyze(), and RecoMuonValidator().

edm::ParameterSet RecoMuonValidator::pset
protected

Definition at line 66 of file RecoMuonValidator.h.

StringCutObjectSelector<reco::Muon> RecoMuonValidator::selector_
private

Definition at line 132 of file RecoMuonValidator.h.

Referenced by analyze().

edm::InputTag RecoMuonValidator::simLabel_
protected

Definition at line 49 of file RecoMuonValidator.h.

Referenced by RecoMuonValidator().

edm::EDGetTokenT<TrackingParticleCollection> RecoMuonValidator::simToken_
protected

Definition at line 52 of file RecoMuonValidator.h.

Referenced by analyze(), and RecoMuonValidator().

std::string RecoMuonValidator::subDir_
protected

Definition at line 64 of file RecoMuonValidator.h.

Referenced by bookHistograms(), and RecoMuonValidator().

std::string RecoMuonValidator::subsystemname_
protected

Definition at line 65 of file RecoMuonValidator.h.

Referenced by RecoMuonValidator().

MuonServiceProxy* RecoMuonValidator::theMuonService
protected

Definition at line 68 of file RecoMuonValidator.h.

Referenced by dqmBeginRun(), RecoMuonValidator(), and ~RecoMuonValidator().

TrackingParticleSelector RecoMuonValidator::tpSelector_
protected

Definition at line 76 of file RecoMuonValidator.h.

Referenced by analyze(), and RecoMuonValidator().

reco::MuonTrackType RecoMuonValidator::trackType_
protected

Definition at line 79 of file RecoMuonValidator.h.

Referenced by analyze(), and RecoMuonValidator().

bool RecoMuonValidator::usePFMuon_
protected

Definition at line 73 of file RecoMuonValidator.h.

Referenced by analyze(), and RecoMuonValidator().

unsigned int RecoMuonValidator::verbose_
protected

Definition at line 47 of file RecoMuonValidator.h.

Referenced by RecoMuonValidator().

bool RecoMuonValidator::wantTightMuon_
private

Definition at line 133 of file RecoMuonValidator.h.

Referenced by analyze(), and RecoMuonValidator().