test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
TrackingMonitor Class Reference

#include <DQM/TrackerMonitorTrack/src/TrackingMonitor.cc>

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

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginJob (void)
 
virtual void beginLuminosityBlock (const edm::LuminosityBlock &lumi, const edm::EventSetup &eSetup)
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
virtual void endRun (const edm::Run &, const edm::EventSetup &)
 
virtual void setMaxMinBin (std::vector< double > &, std::vector< double > &, std::vector< int > &, double, double, int, double, double, int)
 
virtual void setNclus (const edm::Event &, std::vector< int > &)
 
 TrackingMonitor (const edm::ParameterSet &)
 
 ~TrackingMonitor ()
 
- Public Member Functions inherited from DQMEDAnalyzer
virtual void beginRun (edm::Run const &, edm::EventSetup const &) final
 
virtual void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer (void)
 
virtual void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
virtual 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
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

void doProfileX (TH2 *th2, MonitorElement *me)
 
void doProfileX (MonitorElement *th2m, MonitorElement *me)
 

Private Attributes

std::string AlgoName_
 
edm::EDGetTokenT
< reco::TrackCollection
allTrackToken_
 
edm::InputTag bsSrc_
 
edm::EDGetTokenT< reco::BeamSpotbsSrcToken_
 
std::string builderName
 
std::vector< std::string > ClusterLabels
 
edm::ParameterSet conf_
 
StringCutObjectSelector
< reco::Track, true > 
denSelection_
 
bool doAllPlots
 
bool doAllSeedPlots
 
bool doDCAPlots_
 
bool doFractionPlot_
 
bool doGeneralPropertiesPlots_
 
bool doHitPropertiesPlots_
 
bool doLumiAnalysis
 
bool doPlotsVsBXlumi_
 
bool doPlotsVsGoodPVtx_
 
bool doProfilesVsLS_
 
bool doPUmonitoring_
 
bool doSeedLumiAnalysis_
 
bool doSeedNumberPlot
 
bool doSeedVsClusterPlot
 
bool doTkCandPlots
 
bool doTrackerSpecific_
 
MonitorElementFractionOfGoodTracks
 
GenericTriggerEventFlaggenTriggerEventFlag_
 
MonitorElementGoodTracksFractionVsLS
 
std::string histname
 
MonitorElementNumberOfMeanLayersPerTrack
 
MonitorElementNumberOfMeanRecHitsPerTrack
 
MonitorElementNumberOfRecHitsPerTrackVsLS
 
MonitorElementNumberOfSeeds
 
MonitorElementNumberOfSeeds_lumiFlag
 
MonitorElementNumberOfTrackCandidates
 
MonitorElementNumberOfTracks
 
MonitorElementNumberOfTracks_lumiFlag
 
MonitorElementNumberOfTracksVsBXlumi
 
MonitorElementNumberOfTracksVsGoodPVtx
 
MonitorElementNumberOfTracksVsLS
 
MonitorElementNumberOfTracksVsPUPVtx
 
MonitorElementNumberOfTrkVsClus
 
std::vector< MonitorElement * > NumberOfTrkVsClusters
 
MonitorElementNumberOfTrkVsPixelClus
 
MonitorElementNumberOfTrkVsStripClus
 
StringCutObjectSelector
< reco::Track, true > 
numSelection_
 
edm::InputTag pixelClusterInputTag_
 
edm::EDGetTokenT
< edmNew::DetSetVector
< SiPixelCluster > > 
pixelClustersToken_
 
int pvNDOF_
 
edm::InputTag pvSrc_
 
edm::EDGetTokenT
< reco::VertexCollection
pvSrcToken_
 
std::string Quality_
 
bool runTrackBuildingAnalyzerForSeed
 
std::vector< MonitorElement * > SeedsVsClusters
 
edm::EDGetTokenT< edm::View
< TrajectorySeed > > 
seedToken_
 
edm::InputTag stripClusterInputTag_
 
edm::EDGetTokenT
< edmNew::DetSetVector
< SiStripCluster > > 
stripClustersToken_
 
GetLumitheLumiDetails_
 
TrackAnalyzertheTrackAnalyzer
 
TrackBuildingAnalyzertheTrackBuildingAnalyzer
 
edm::ESHandle
< TransientTrackingRecHitBuilder
theTTRHBuilder
 
std::vector< VertexMonitor * > theVertexMonitor
 
edm::EDGetTokenT
< TrackCandidateCollection
trackCandidateToken_
 
edm::EDGetTokenT
< reco::TrackCollection
trackToken_
 

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, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
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::NoCache
globalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr
< dqmDetails::NoCache
globalBeginRunSummary (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

Monitoring source for general quantities related to tracks.

Definition at line 47 of file TrackingMonitor.h.

Constructor & Destructor Documentation

TrackingMonitor::TrackingMonitor ( const edm::ParameterSet iConfig)
explicit

Definition at line 40 of file TrackingMonitor.cc.

References AlgoName_, allTrackToken_, bsSrc_, bsSrcToken_, EnergyCorrector::c, conf_, edm::EDConsumerBase::consumesCollector(), doFractionPlot_, doPlotsVsBXlumi_, doPlotsVsGoodPVtx_, doPUmonitoring_, edm::ParameterSet::getParameter(), i, pixelClusterInputTag_, pixelClustersToken_, pvSrc_, pvSrcToken_, Quality_, seedToken_, AlCaHLTBitMon_QueryRunRegistry::string, stripClusterInputTag_, stripClustersToken_, theLumiDetails_, theTrackAnalyzer, theVertexMonitor, trackCandidateToken_, HLT_25ns10e33_v2_cff::trackProducer, and trackToken_.

41  : conf_ ( iConfig )
46  // , NumberOfGoodTracks(NULL)
51  // , NumberOfGoodTrkVsClus(NULL)
53  // , NumberOfGoodTracksVsLS(NULL)
55  // , GoodTracksNumberOfRecHitsPerTrackVsLS(NULL)
56  // ADD by Mia for PU monitoring
57  // vertex plots to be moved in ad hoc class
61 
63  // , NumberOfGoodTracks_lumiFlag(NULL)
64 
65  , builderName ( conf_.getParameter<std::string>("TTRHBuilder"))
66  , doTrackerSpecific_ ( conf_.getParameter<bool>("doTrackerSpecific") )
67  , doLumiAnalysis ( conf_.getParameter<bool>("doLumiAnalysis"))
68  , doProfilesVsLS_ ( conf_.getParameter<bool>("doProfilesVsLS"))
69  , doAllPlots ( conf_.getParameter<bool>("doAllPlots"))
70  , doGeneralPropertiesPlots_( conf_.getParameter<bool>("doGeneralPropertiesPlots"))
71  , doHitPropertiesPlots_ ( conf_.getParameter<bool>("doHitPropertiesPlots"))
72  , doPUmonitoring_ ( conf_.getParameter<bool>("doPUmonitoring") )
73  , genTriggerEventFlag_(new GenericTriggerEventFlag(iConfig.getParameter<edm::ParameterSet>("genericTriggerEventPSet"),consumesCollector(), *this))
76  , pvNDOF_ ( conf_.getParameter<int> ("pvNDOF") )
77 {
78 
81 
82  // input tags for collections from the configuration
83  bsSrc_ = conf_.getParameter<edm::InputTag>("beamSpot");
84  pvSrc_ = conf_.getParameter<edm::InputTag>("primaryVertex");
85  bsSrcToken_ = consumes<reco::BeamSpot>(bsSrc_);
86  pvSrcToken_ = mayConsume<reco::VertexCollection>(pvSrc_);
87 
88  edm::InputTag alltrackProducer = conf_.getParameter<edm::InputTag>("allTrackProducer");
90  edm::InputTag tcProducer = conf_.getParameter<edm::InputTag>("TCProducer");
91  edm::InputTag seedProducer = conf_.getParameter<edm::InputTag>("SeedProducer");
92  allTrackToken_ = consumes<reco::TrackCollection>(alltrackProducer);
93  trackToken_ = consumes<reco::TrackCollection>(trackProducer);
94  trackCandidateToken_ = consumes<TrackCandidateCollection>(tcProducer);
95  seedToken_ = consumes<edm::View<TrajectorySeed> >(seedProducer);
96 
99  stripClustersToken_ = mayConsume<edmNew::DetSetVector<SiStripCluster> > (stripClusterInputTag_);
100  pixelClustersToken_ = mayConsume<edmNew::DetSetVector<SiPixelCluster> > (pixelClusterInputTag_);
101 
102  doFractionPlot_ = true;
103  if (alltrackProducer.label()==trackProducer.label()) doFractionPlot_ = false;
104 
105  Quality_ = conf_.getParameter<std::string>("Quality");
106  AlgoName_ = conf_.getParameter<std::string>("AlgoName");
107 
108  // get flag from the configuration
109  doPlotsVsBXlumi_ = conf_.getParameter<bool>("doPlotsVsBXlumi");
110  if ( doPlotsVsBXlumi_ )
111  theLumiDetails_ = new GetLumi( iConfig.getParameter<edm::ParameterSet>("BXlumiSetup"), c );
112  doPlotsVsGoodPVtx_ = conf_.getParameter<bool>("doPlotsVsGoodPVtx");
113 
114 
115  if ( doPUmonitoring_ ) {
116 
117  std::vector<edm::InputTag> primaryVertexInputTags = conf_.getParameter<std::vector<edm::InputTag> >("primaryVertexInputTags");
118  std::vector<edm::InputTag> selPrimaryVertexInputTags = conf_.getParameter<std::vector<edm::InputTag> >("selPrimaryVertexInputTags");
119  std::vector<std::string> pvLabels = conf_.getParameter<std::vector<std::string> > ("pvLabels");
120 
121  if (primaryVertexInputTags.size()==pvLabels.size() and primaryVertexInputTags.size()==selPrimaryVertexInputTags.size()) {
122  // for (auto const& tag : primaryVertexInputTags) {
123  for (size_t i=0; i<primaryVertexInputTags.size(); i++) {
124  edm::InputTag iPVinputTag = primaryVertexInputTags[i];
125  edm::InputTag iSelPVinputTag = selPrimaryVertexInputTags[i];
126  std::string iPVlabel = pvLabels[i];
127 
128  theVertexMonitor.push_back(new VertexMonitor(conf_,iPVinputTag,iSelPVinputTag,iPVlabel,c) );
129  }
130  }
131  }
132 
133 }
T getParameter(std::string const &) const
edm::EDGetTokenT< edm::View< TrajectorySeed > > seedToken_
int i
Definition: DBlmapReader.cc:9
MonitorElement * FractionOfGoodTracks
TrackAnalyzer * theTrackAnalyzer
edm::ParameterSet conf_
edm::EDGetTokenT< reco::TrackCollection > allTrackToken_
GetLumi * theLumiDetails_
edm::InputTag pvSrc_
#define NULL
Definition: scimark2.h:8
Provides a code based selection for trigger and DCS information in order to have no failing filters i...
MonitorElement * NumberOfMeanRecHitsPerTrack
MonitorElement * NumberOfTracksVsGoodPVtx
MonitorElement * GoodTracksFractionVsLS
MonitorElement * NumberOfTracksVsPUPVtx
std::string Quality_
edm::InputTag bsSrc_
MonitorElement * NumberOfSeeds
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
MonitorElement * NumberOfTracksVsLS
std::vector< VertexMonitor * > theVertexMonitor
MonitorElement * NumberOfTracksVsBXlumi
edm::InputTag stripClusterInputTag_
bool doGeneralPropertiesPlots_
TrackBuildingAnalyzer * theTrackBuildingAnalyzer
std::string AlgoName_
edm::EDGetTokenT< reco::TrackCollection > trackToken_
edm::EDGetTokenT< TrackCandidateCollection > trackCandidateToken_
MonitorElement * NumberOfMeanLayersPerTrack
StringCutObjectSelector< reco::Track, true > denSelection_
StringCutObjectSelector< reco::Track, true > numSelection_
GenericTriggerEventFlag * genTriggerEventFlag_
edm::InputTag pixelClusterInputTag_
MonitorElement * NumberOfSeeds_lumiFlag
MonitorElement * NumberOfTrackCandidates
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > pixelClustersToken_
edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > stripClustersToken_
MonitorElement * NumberOfTracks_lumiFlag
edm::EDGetTokenT< reco::BeamSpot > bsSrcToken_
MonitorElement * NumberOfTracks
edm::EDGetTokenT< reco::VertexCollection > pvSrcToken_
std::string builderName
TrackingMonitor::~TrackingMonitor ( )

Definition at line 136 of file TrackingMonitor.cc.

References doPUmonitoring_, genTriggerEventFlag_, i, theTrackAnalyzer, theTrackBuildingAnalyzer, and theVertexMonitor.

137 {
140  if ( doPUmonitoring_ )
141  for (size_t i=0; i<theVertexMonitor.size(); i++)
142  if (theVertexMonitor[i]) delete theVertexMonitor[i];
144 }
int i
Definition: DBlmapReader.cc:9
TrackAnalyzer * theTrackAnalyzer
std::vector< VertexMonitor * > theVertexMonitor
TrackBuildingAnalyzer * theTrackBuildingAnalyzer
GenericTriggerEventFlag * genTriggerEventFlag_

Member Function Documentation

void TrackingMonitor::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Implements edm::stream::EDAnalyzerBase.

Definition at line 489 of file TrackingMonitor.cc.

References funct::abs(), GenericTriggerEventFlag::accept(), allTrackToken_, TrackBuildingAnalyzer::analyze(), TrackAnalyzer::analyze(), bsSrcToken_, builderName, ClusterLabels, denSelection_, doAllPlots, doAllSeedPlots, doFractionPlot_, doGeneralPropertiesPlots_, doLumiAnalysis, doPlotsVsBXlumi_, doPlotsVsGoodPVtx_, doProfilesVsLS_, doPUmonitoring_, doSeedLumiAnalysis_, doSeedNumberPlot, doSeedVsClusterPlot, doTkCandPlots, doTrackerSpecific_, MonitorElement::Fill(), HcalObjRepresent::Fill(), cropTnPTrees::frac, FractionOfGoodTracks, genTriggerEventFlag_, edm::EventSetup::get(), edm::Event::getByToken(), GetLumi::getValue(), GoodTracksFractionVsLS, i, edm::EventBase::id(), reco::Vertex::isFake(), edm::HandleBase::isValid(), edm::EventID::luminosityBlock(), reco::Vertex::ndof(), NumberOfMeanLayersPerTrack, NumberOfMeanRecHitsPerTrack, NumberOfRecHitsPerTrackVsLS, NumberOfSeeds, NumberOfSeeds_lumiFlag, NumberOfTrackCandidates, NumberOfTracks, NumberOfTracks_lumiFlag, NumberOfTracksVsBXlumi, NumberOfTracksVsGoodPVtx, NumberOfTracksVsLS, NumberOfTracksVsPUPVtx, NumberOfTrkVsClusters, numSelection_, GenericTriggerEventFlag::on(), reco::Vertex::position(), MetAnalyzer::pv(), pvNDOF_, pvSrcToken_, runTrackBuildingAnalyzerForSeed, fileCollector::seed, SeedsVsClusters, seedToken_, TrackAnalyzer::setBX(), setNclus(), TrackAnalyzer::setNumberOfGoodVertices(), edm::View< T >::size(), theLumiDetails_, theTrackAnalyzer, theTrackBuildingAnalyzer, theTTRHBuilder, theVertexMonitor, trackCandidateToken_, HLT_25ns10e33_v2_cff::trackCollection, reco::Vertex::tracksSize(), trackToken_, and reco::Vertex::z().

490 {
491 
492  // Filter out events if Trigger Filtering is requested
493  if (genTriggerEventFlag_->on()&& ! genTriggerEventFlag_->accept( iEvent, iSetup) ) return;
494 
495  // Analyse the tracks
496  // if the collection is empty, do not fill anything
497  // ---------------------------------------------------------------------------------//
498 
499  // get the track collection
501  iEvent.getByToken(trackToken_, trackHandle);
502 
503  // int numberOfAllTracks = 0;
504  int numberOfTracks_den = 0;
505  edm::Handle<reco::TrackCollection> allTrackHandle;
506  iEvent.getByToken(allTrackToken_,allTrackHandle);
507  if (allTrackHandle.isValid()) {
508  // numberOfAllTracks = allTrackHandle->size();
509  for (reco::TrackCollection::const_iterator track = allTrackHandle->begin();
510  track!=allTrackHandle->end(); ++track) {
511  if ( denSelection_(*track) )
512  numberOfTracks_den++;
513  }
514  }
515 
517  iEvent.getByToken(pvSrcToken_, pvHandle );
518  reco::Vertex const * pv0 = nullptr;
519  if (pvHandle.isValid()) {
520  pv0 = &pvHandle->front();
521  //--- pv fake (the pv collection should have size==1 and the pv==beam spot)
522  if ( pv0->isFake() || pv0->tracksSize()==0
523  // definition of goodOfflinePrimaryVertex
524  || pv0->ndof() < pvNDOF_ || pv0->z() > 24.) pv0 = nullptr;
525  }
526 
527 
528  if (trackHandle.isValid()) {
529 
530  int numberOfTracks = trackHandle->size();
531  int numberOfTracks_num = 0;
532  int numberOfTracks_pv0 = 0;
533 
534  reco::TrackCollection trackCollection = *trackHandle;
535  // calculate the mean # rechits and layers
536  int totalRecHits = 0, totalLayers = 0;
537 
539  theTrackAnalyzer->setBX(iEvent);
540  for (reco::TrackCollection::const_iterator track = trackCollection.begin();
541  track!=trackCollection.end(); ++track) {
542 
543  if ( numSelection_(*track) ) {
544  numberOfTracks_num++;
545  if (pv0 && std::abs(track->dz(pv0->position()))<0.15) ++numberOfTracks_pv0;
546  }
547 
548  if ( doProfilesVsLS_ || doAllPlots)
549  NumberOfRecHitsPerTrackVsLS->Fill(static_cast<double>(iEvent.id().luminosityBlock()),track->numberOfValidHits());
550 
551  totalRecHits += track->numberOfValidHits();
552  totalLayers += track->hitPattern().trackerLayersWithMeasurement();
553 
554  // do analysis per track
555  theTrackAnalyzer->analyze(iEvent, iSetup, *track);
556  }
557 
558  double frac = -1.;
559  // if (numberOfAllTracks > 0) frac = static_cast<double>(numberOfTracks)/static_cast<double>(numberOfAllTracks);
560  if (numberOfTracks_den > 0) frac = static_cast<double>(numberOfTracks_num)/static_cast<double>(numberOfTracks_den);
561 
563  NumberOfTracks -> Fill(numberOfTracks);
564  if (doFractionPlot_)
565  FractionOfGoodTracks -> Fill(frac);
566 
567  if( numberOfTracks > 0 ) {
568  double meanRecHits = static_cast<double>(totalRecHits) / static_cast<double>(numberOfTracks);
569  double meanLayers = static_cast<double>(totalLayers) / static_cast<double>(numberOfTracks);
570  NumberOfMeanRecHitsPerTrack -> Fill(meanRecHits);
571  NumberOfMeanLayersPerTrack -> Fill(meanLayers);
572  }
573  }
574 
575  if ( doProfilesVsLS_ || doAllPlots) {
576  NumberOfTracksVsLS ->Fill(static_cast<double>(iEvent.id().luminosityBlock()),numberOfTracks);
577  if (doFractionPlot_)
578  GoodTracksFractionVsLS->Fill(static_cast<double>(iEvent.id().luminosityBlock()),frac);
579  }
580 
581  if ( doLumiAnalysis ) {
582  NumberOfTracks_lumiFlag -> Fill(numberOfTracks);
583  }
584 
585 
586  // Analyse the Track Building variables
587  // if the collection is empty, do not fill anything
588  // ---------------------------------------------------------------------------------//
589 
590 
591  // fill the TrackCandidate info
592  if (doTkCandPlots) {
593  // magnetic field
595  iSetup.get<IdealMagneticFieldRecord>().get(theMF);
596 
597  // get the candidate collection
599  iEvent.getByToken( trackCandidateToken_, theTCHandle );
600  const TrackCandidateCollection& theTCCollection = *theTCHandle;
601 
602  if (theTCHandle.isValid()) {
603 
604  // get the beam spot
605  edm::Handle<reco::BeamSpot> recoBeamSpotHandle;
606  iEvent.getByToken(bsSrcToken_, recoBeamSpotHandle );
607  const reco::BeamSpot& bs = *recoBeamSpotHandle;
608 
609  NumberOfTrackCandidates->Fill(theTCCollection.size());
611  for( TrackCandidateCollection::const_iterator cand = theTCCollection.begin(); cand != theTCCollection.end(); ++cand) {
612 
613  theTrackBuildingAnalyzer->analyze(iEvent, iSetup, *cand, bs, theMF, theTTRHBuilder);
614  }
615  } else {
616  edm::LogWarning("TrackingMonitor") << "No Track Candidates in the event. Not filling associated histograms";
617  }
618  }
619 
620  //plots for trajectory seeds
621 
623 
624  // get the seed collection
626  iEvent.getByToken(seedToken_, seedHandle );
627  const edm::View<TrajectorySeed>& seedCollection = *seedHandle;
628 
629  // fill the seed info
630  if (seedHandle.isValid()) {
631 
633  NumberOfSeeds->Fill(seedCollection.size());
634  if ( doSeedLumiAnalysis_ )
635  NumberOfSeeds_lumiFlag->Fill(seedCollection.size());
636  }
637 
639 
640  std::vector<int> NClus;
641  setNclus(iEvent,NClus);
642  for (uint i=0; i< ClusterLabels.size(); i++){
643  SeedsVsClusters[i]->Fill(NClus[i],seedCollection.size());
644  }
645  }
646 
648 
649  //here duplication of mag field and be informations is needed to allow seed and track cand histos to be independent
650  // magnetic field
652  iSetup.get<IdealMagneticFieldRecord>().get(theMF);
653 
654  // get the beam spot
655  edm::Handle<reco::BeamSpot> recoBeamSpotHandle;
656  iEvent.getByToken(bsSrcToken_, recoBeamSpotHandle );
657  const reco::BeamSpot& bs = *recoBeamSpotHandle;
658 
660  for(size_t i=0; i < seedHandle->size(); ++i) {
661 
663  theTrackBuildingAnalyzer->analyze(iEvent, iSetup, *seed, bs, theMF, theTTRHBuilder);
664  }
665  }
666 
667  } else {
668  edm::LogWarning("TrackingMonitor") << "No Trajectory seeds in the event. Not filling associated histograms";
669  }
670  }
671 
672 
674 
675  std::vector<int> NClus;
676  setNclus(iEvent,NClus);
677  for (uint i=0; i< ClusterLabels.size(); i++) {
678  NumberOfTrkVsClusters[i]->Fill(NClus[i],numberOfTracks);
679  }
680  }
681 
682  if ( doPUmonitoring_ ) {
683 
684  // do vertex monitoring
685  for (size_t i=0; i<theVertexMonitor.size(); i++)
686  theVertexMonitor[i]->analyze(iEvent, iSetup);
687  }
688  if ( doPlotsVsGoodPVtx_ ) {
689 
690  size_t totalNumGoodPV = 0;
691  if (pvHandle.isValid()) {
692 
693  for (reco::VertexCollection::const_iterator pv = pvHandle->begin();
694  pv != pvHandle->end(); ++pv) {
695 
696  //--- pv fake (the pv collection should have size==1 and the pv==beam spot)
697  if (pv->isFake() || pv->tracksSize()==0) continue;
698 
699  // definition of goodOfflinePrimaryVertex
700  if (pv->ndof() < pvNDOF_ || pv->z() > 24.) continue;
701  totalNumGoodPV++;
702  }
703 
704  NumberOfTracksVsGoodPVtx -> Fill( totalNumGoodPV, numberOfTracks );
705  if (totalNumGoodPV>1) NumberOfTracksVsPUPVtx-> Fill( totalNumGoodPV-1, double(numberOfTracks-numberOfTracks_pv0)/double(totalNumGoodPV-1) );
706  }
707 
708 
709  if ( doPlotsVsBXlumi_ ) {
710  double bxlumi = theLumiDetails_->getValue(iEvent);
711  NumberOfTracksVsBXlumi -> Fill( bxlumi, numberOfTracks );
712  }
713 
714  } // PU monitoring
715 
716  } // trackHandle is valid
717 
718 }
edm::EDGetTokenT< edm::View< TrajectorySeed > > seedToken_
int i
Definition: DBlmapReader.cc:9
std::vector< MonitorElement * > NumberOfTrkVsClusters
MonitorElement * FractionOfGoodTracks
TrackAnalyzer * theTrackAnalyzer
virtual void setNclus(const edm::Event &, std::vector< int > &)
edm::EDGetTokenT< reco::TrackCollection > allTrackToken_
GetLumi * theLumiDetails_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
std::vector< TrackCandidate > TrackCandidateCollection
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14
size_type size() const
virtual void analyze(const edm::Event &, const edm::EventSetup &)
MonitorElement * NumberOfMeanRecHitsPerTrack
MonitorElement * NumberOfTracksVsGoodPVtx
LuminosityBlockNumber_t luminosityBlock() const
Definition: EventID.h:40
const Point & position() const
position
Definition: Vertex.h:99
MonitorElement * GoodTracksFractionVsLS
MonitorElement * NumberOfTracksVsPUPVtx
void Fill(long long x)
double getValue(const edm::Event &)
Definition: GetLumi.cc:64
virtual void analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup, const TrajectorySeed &seed, const reco::BeamSpot &bs, const edm::ESHandle< MagneticField > &theMF, const edm::ESHandle< TransientTrackingRecHitBuilder > &theTTRHBuilder)
MonitorElement * NumberOfSeeds
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
bool accept(const edm::Event &event, const edm::EventSetup &setup)
To be called from analyze/filter() methods.
void setBX(const edm::Event &)
MonitorElement * NumberOfTracksVsLS
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double z() const
y coordinate
Definition: Vertex.h:105
bool runTrackBuildingAnalyzerForSeed
bool isValid() const
Definition: HandleBase.h:75
std::vector< MonitorElement * > SeedsVsClusters
MonitorElement * NumberOfRecHitsPerTrackVsLS
double ndof() const
Definition: Vertex.h:95
std::vector< VertexMonitor * > theVertexMonitor
MonitorElement * NumberOfTracksVsBXlumi
bool doGeneralPropertiesPlots_
TrackBuildingAnalyzer * theTrackBuildingAnalyzer
bool isFake() const
Definition: Vertex.h:64
virtual void analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup, const reco::Track &track)
edm::EDGetTokenT< reco::TrackCollection > trackToken_
edm::EDGetTokenT< TrackCandidateCollection > trackCandidateToken_
MonitorElement * NumberOfMeanLayersPerTrack
StringCutObjectSelector< reco::Track, true > denSelection_
const T & get() const
Definition: EventSetup.h:56
StringCutObjectSelector< reco::Track, true > numSelection_
GenericTriggerEventFlag * genTriggerEventFlag_
MonitorElement * NumberOfSeeds_lumiFlag
edm::EventID id() const
Definition: EventBase.h:59
edm::ESHandle< TransientTrackingRecHitBuilder > theTTRHBuilder
MonitorElement * NumberOfTrackCandidates
void setNumberOfGoodVertices(const edm::Event &)
MonitorElement * NumberOfTracks_lumiFlag
edm::EDGetTokenT< reco::BeamSpot > bsSrcToken_
MonitorElement * NumberOfTracks
size_t tracksSize() const
number of tracks
Definition: Vertex.cc:34
edm::EDGetTokenT< reco::VertexCollection > pvSrcToken_
std::vector< std::string > ClusterLabels
std::string builderName
void TrackingMonitor::beginJob ( void  )
virtual

Definition at line 147 of file TrackingMonitor.cc.

148 {
149 
150 
151 }
void TrackingMonitor::beginLuminosityBlock ( const edm::LuminosityBlock lumi,
const edm::EventSetup eSetup 
)
virtual

Reimplemented from edm::stream::EDAnalyzerBase.

Definition at line 475 of file TrackingMonitor.cc.

References doAllSeedPlots, doLumiAnalysis, TrackAnalyzer::doReset(), doSeedLumiAnalysis_, doSeedNumberPlot, NumberOfSeeds_lumiFlag, NumberOfTracks_lumiFlag, MonitorElement::Reset(), HcalObjRepresent::Reset(), and theTrackAnalyzer.

475  {
476 
477  if (doLumiAnalysis) {
480  }
482  if ( doSeedLumiAnalysis_ )
484  }
485 }
TrackAnalyzer * theTrackAnalyzer
MonitorElement * NumberOfSeeds_lumiFlag
void Reset(std::vector< TH2F > &depth)
MonitorElement * NumberOfTracks_lumiFlag
void Reset(void)
reset ME (ie. contents, errors, etc)
void TrackingMonitor::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
overridevirtual

Implements DQMEDAnalyzer.

Definition at line 153 of file TrackingMonitor.cc.

References HLT_25ns10e33_v2_cff::AlgoName, AlgoName_, DQMStore::IBooker::book1D(), DQMStore::IBooker::book2D(), DQMStore::IBooker::bookProfile(), ClusterLabels, compare_using_db::compare, conf_, doAllPlots, doAllSeedPlots, doFractionPlot_, doGeneralPropertiesPlots_, doLumiAnalysis, doPlotsVsBXlumi_, doPlotsVsGoodPVtx_, doProfilesVsLS_, doPUmonitoring_, doSeedLumiAnalysis_, doSeedNumberPlot, doSeedVsClusterPlot, doTkCandPlots, doTrackerSpecific_, FractionOfGoodTracks, genTriggerEventFlag_, edm::ParameterSet::getParameter(), MonitorElement::getTH1(), GoodTracksFractionVsLS, histname, i, TrackAnalyzer::initHisto(), TrackBuildingAnalyzer::initHisto(), GenericTriggerEventFlag::initRun(), edm::InputTag::label(), NumberOfMeanLayersPerTrack, NumberOfMeanRecHitsPerTrack, NumberOfRecHitsPerTrackVsLS, NumberOfSeeds, NumberOfSeeds_lumiFlag, NumberOfTrackCandidates, NumberOfTracks, NumberOfTracks_lumiFlag, NumberOfTracksVsBXlumi, NumberOfTracksVsGoodPVtx, NumberOfTracksVsLS, NumberOfTracksVsPUPVtx, NumberOfTrkVsClusters, GenericTriggerEventFlag::on(), Quality_, runTrackBuildingAnalyzerForSeed, SeedsVsClusters, MonitorElement::setAxisTitle(), DQMStore::IBooker::setCurrentFolder(), TrackAnalyzer::setLumiFlag(), MonitorElement::setLumiFlag(), setMaxMinBin(), AlCaHLTBitMon_QueryRunRegistry::string, theTrackAnalyzer, theTrackBuildingAnalyzer, theVertexMonitor, and indexGen::title.

156 {
157  // parameters from the configuration
160  std::string MEFolderName = conf_.getParameter<std::string>("FolderName");
161 
162  // test for the Quality veriable validity
163  if( Quality_ != "") {
164  if( Quality_ != "highPurity" && Quality_ != "tight" && Quality_ != "loose") {
165  edm::LogWarning("TrackingMonitor") << "Qualty Name is invalid, using no quality criterea by default";
166  Quality_ = "";
167  }
168  }
169 
170  // use the AlgoName and Quality Name
171  std::string CategoryName = Quality_ != "" ? AlgoName_ + "_" + Quality_ : AlgoName_;
172 
173  // get binning from the configuration
174  int TKNoBin = conf_.getParameter<int>( "TkSizeBin");
175  double TKNoMin = conf_.getParameter<double>("TkSizeMin");
176  double TKNoMax = conf_.getParameter<double>("TkSizeMax");
177 
178  int TCNoBin = conf_.getParameter<int>( "TCSizeBin");
179  double TCNoMin = conf_.getParameter<double>("TCSizeMin");
180  double TCNoMax = conf_.getParameter<double>("TCSizeMax");
181 
182  int TKNoSeedBin = conf_.getParameter<int>( "TkSeedSizeBin");
183  double TKNoSeedMin = conf_.getParameter<double>("TkSeedSizeMin");
184  double TKNoSeedMax = conf_.getParameter<double>("TkSeedSizeMax");
185 
186  int MeanHitBin = conf_.getParameter<int>( "MeanHitBin");
187  double MeanHitMin = conf_.getParameter<double>("MeanHitMin");
188  double MeanHitMax = conf_.getParameter<double>("MeanHitMax");
189 
190  int MeanLayBin = conf_.getParameter<int>( "MeanLayBin");
191  double MeanLayMin = conf_.getParameter<double>("MeanLayMin");
192  double MeanLayMax = conf_.getParameter<double>("MeanLayMax");
193 
194  int LSBin = conf_.getParameter<int>( "LSBin");
195  int LSMin = conf_.getParameter<double>("LSMin");
196  int LSMax = conf_.getParameter<double>("LSMax");
197 
198  std::string StateName = conf_.getParameter<std::string>("MeasurementState");
199  if (
200  StateName != "OuterSurface" &&
201  StateName != "InnerSurface" &&
202  StateName != "ImpactPoint" &&
203  StateName != "default" &&
204  StateName != "All"
205  ) {
206  // print warning
207  edm::LogWarning("TrackingMonitor") << "State Name is invalid, using 'ImpactPoint' by default";
208  }
209 
210  ibooker.setCurrentFolder(MEFolderName);
211 
212  // book the General Property histograms
213  // ---------------------------------------------------------------------------------//
214 
216 
217  ibooker.setCurrentFolder(MEFolderName+"/GeneralProperties");
218 
219  histname = "NumberOfTracks_" + CategoryName;
220  // MODIFY by Mia in order to cope w/ high multiplicity
221  NumberOfTracks = ibooker.book1D(histname, histname, 3*TKNoBin, TKNoMin, (TKNoMax+0.5)*3.-0.5);
222  NumberOfTracks->setAxisTitle("Number of Tracks per Event", 1);
223  NumberOfTracks->setAxisTitle("Number of Events", 2);
224 
225  histname = "NumberOfMeanRecHitsPerTrack_" + CategoryName;
226  NumberOfMeanRecHitsPerTrack = ibooker.book1D(histname, histname, MeanHitBin, MeanHitMin, MeanHitMax);
227  NumberOfMeanRecHitsPerTrack->setAxisTitle("Mean number of valid RecHits per Track", 1);
229 
230  histname = "NumberOfMeanLayersPerTrack_" + CategoryName;
231  NumberOfMeanLayersPerTrack = ibooker.book1D(histname, histname, MeanLayBin, MeanLayMin, MeanLayMax);
232  NumberOfMeanLayersPerTrack->setAxisTitle("Mean number of Layers per Track", 1);
234 
235  if (doFractionPlot_) {
236  histname = "FractionOfGoodTracks_" + CategoryName;
237  FractionOfGoodTracks = ibooker.book1D(histname, histname, 101, -0.005, 1.005);
238  FractionOfGoodTracks->setAxisTitle("Fraction of Tracks (w.r.t. generalTracks)", 1);
239  FractionOfGoodTracks->setAxisTitle("Entries", 2);
240  }
241  }
242 
243  if ( doLumiAnalysis ) {
244  // add by Mia in order to deal with LS transitions
245  ibooker.setCurrentFolder(MEFolderName+"/LSanalysis");
246 
247  histname = "NumberOfTracks_lumiFlag_" + CategoryName;
248  NumberOfTracks_lumiFlag = ibooker.book1D(histname, histname, 3*TKNoBin, TKNoMin, (TKNoMax+0.5)*3.-0.5);
249  NumberOfTracks_lumiFlag->setAxisTitle("Number of Tracks per Event", 1);
250  NumberOfTracks_lumiFlag->setAxisTitle("Number of Events", 2);
251 
252  }
253 
254  // book profile plots vs LS :
255  //---------------------------
256 
257 
258  if ( doProfilesVsLS_ || doAllPlots) {
259 
260  ibooker.setCurrentFolder(MEFolderName+"/GeneralProperties");
261 
262  histname = "NumberOfTracksVsLS_"+ CategoryName;
263  NumberOfTracksVsLS = ibooker.bookProfile(histname,histname, LSBin,LSMin,LSMax, TKNoMin, (TKNoMax+0.5)*3.-0.5,"");
264  NumberOfTracksVsLS->getTH1()->SetCanExtend(TH1::kAllAxes);
265  NumberOfTracksVsLS->setAxisTitle("#Lumi section",1);
266  NumberOfTracksVsLS->setAxisTitle("Number of Tracks",2);
267 
268  histname = "NumberOfRecHitsPerTrackVsLS_" + CategoryName;
269  NumberOfRecHitsPerTrackVsLS = ibooker.bookProfile(histname,histname, LSBin,LSMin,LSMax,0.,40.,"");
270  NumberOfRecHitsPerTrackVsLS->getTH1()->SetCanExtend(TH1::kAllAxes);
271  NumberOfRecHitsPerTrackVsLS->setAxisTitle("#Lumi section",1);
272  NumberOfRecHitsPerTrackVsLS->setAxisTitle("Mean number of Valid RecHits per track",2);
273 
274  if (doFractionPlot_) {
275  histname = "GoodTracksFractionVsLS_"+ CategoryName;
276  GoodTracksFractionVsLS = ibooker.bookProfile(histname,histname, LSBin,LSMin,LSMax,0,1.1,"");
277  GoodTracksFractionVsLS->getTH1()->SetCanExtend(TH1::kAllAxes);
278  GoodTracksFractionVsLS->setAxisTitle("#Lumi section",1);
279  GoodTracksFractionVsLS->setAxisTitle("Fraction of Good Tracks",2);
280  }
281  }
282 
283  // book PU monitoring plots :
284  //---------------------------
285 
286  if ( doPUmonitoring_ ) {
287 
288  for (size_t i=0; i<theVertexMonitor.size(); i++)
289  theVertexMonitor[i]->initHisto(ibooker);
290  }
291 
292  if ( doPlotsVsGoodPVtx_ ) {
293  ibooker.setCurrentFolder(MEFolderName+"/PUmonitoring");
294  // get binning from the configuration
295  int GoodPVtxBin = conf_.getParameter<int>("GoodPVtxBin");
296  double GoodPVtxMin = conf_.getParameter<double>("GoodPVtxMin");
297  double GoodPVtxMax = conf_.getParameter<double>("GoodPVtxMax");
298 
299  histname = "NumberOfTracksVsGoodPVtx";
300  NumberOfTracksVsGoodPVtx = ibooker.bookProfile(histname,histname,GoodPVtxBin,GoodPVtxMin,GoodPVtxMax,TKNoMin, (TKNoMax+0.5)*3.-0.5,"");
301  NumberOfTracksVsGoodPVtx->getTH1()->SetCanExtend(TH1::kAllAxes);
302  NumberOfTracksVsGoodPVtx->setAxisTitle("Number of PV",1);
303  NumberOfTracksVsGoodPVtx->setAxisTitle("Mean number of Tracks per Event",2);
304 
305  histname = "NumberOfTracksVsPUPVtx";
306  NumberOfTracksVsPUPVtx = ibooker.bookProfile(histname,histname,GoodPVtxBin,GoodPVtxMin,GoodPVtxMax,0., 100.,"");
307  NumberOfTracksVsPUPVtx->getTH1()->SetCanExtend(TH1::kAllAxes);
308  NumberOfTracksVsPUPVtx->setAxisTitle("Number of PU",1);
309  NumberOfTracksVsPUPVtx->setAxisTitle("Mean number of Tracks per PUvtx",2);
310 
311  }
312 
313  if ( doPlotsVsBXlumi_ ) {
314  ibooker.setCurrentFolder(MEFolderName+"/PUmonitoring");
315  // get binning from the configuration
316  edm::ParameterSet BXlumiParameters = conf_.getParameter<edm::ParameterSet>("BXlumiSetup");
317  int BXlumiBin = BXlumiParameters.getParameter<int>("BXlumiBin");
318  double BXlumiMin = BXlumiParameters.getParameter<double>("BXlumiMin");
319  double BXlumiMax = BXlumiParameters.getParameter<double>("BXlumiMax");
320 
321  histname = "NumberOfTracksVsBXlumi_"+ CategoryName;
322  NumberOfTracksVsBXlumi = ibooker.bookProfile(histname,histname, BXlumiBin,BXlumiMin,BXlumiMax, TKNoMin, TKNoMax,"");
323  NumberOfTracksVsBXlumi->getTH1()->SetCanExtend(TH1::kAllAxes);
324  NumberOfTracksVsBXlumi->setAxisTitle("lumi BX [10^{30}Hzcm^{-2}]",1);
325  NumberOfTracksVsBXlumi->setAxisTitle("Mean number of Tracks",2);
326 
327  }
328 
329 
330  theTrackAnalyzer->initHisto(ibooker, iSetup);
331 
332  // book the Seed Property histograms
333  // ---------------------------------------------------------------------------------//
334 
335  ibooker.setCurrentFolder(MEFolderName+"/TrackBuilding");
336 
337  doAllSeedPlots = conf_.getParameter<bool>("doSeedParameterHistos");
338  doSeedNumberPlot = conf_.getParameter<bool>("doSeedNumberHisto");
339  doSeedLumiAnalysis_ = conf_.getParameter<bool>("doSeedLumiAnalysis");
340  doSeedVsClusterPlot = conf_.getParameter<bool>("doSeedVsClusterHisto");
341  // if (doAllPlots) doAllSeedPlots=true;
342 
343  runTrackBuildingAnalyzerForSeed=(doAllSeedPlots || conf_.getParameter<bool>("doSeedPTHisto") ||conf_.getParameter<bool>("doSeedETAHisto") || conf_.getParameter<bool>("doSeedPHIHisto") || conf_.getParameter<bool>("doSeedPHIVsETAHisto") || conf_.getParameter<bool>("doSeedThetaHisto") || conf_.getParameter<bool>("doSeedQHisto") || conf_.getParameter<bool>("doSeedDxyHisto") || conf_.getParameter<bool>("doSeedDzHisto") || conf_.getParameter<bool>("doSeedNRecHitsHisto") || conf_.getParameter<bool>("doSeedNVsPhiProf")|| conf_.getParameter<bool>("doSeedNVsEtaProf"));
344 
345  edm::InputTag seedProducer = conf_.getParameter<edm::InputTag>("SeedProducer");
346 
347  if (doAllSeedPlots || doSeedNumberPlot){
348  ibooker.setCurrentFolder(MEFolderName+"/TrackBuilding");
349  histname = "NumberOfSeeds_"+ seedProducer.label() + "_"+ CategoryName;
350  NumberOfSeeds = ibooker.book1D(histname, histname, TKNoSeedBin, TKNoSeedMin, TKNoSeedMax);
351  NumberOfSeeds->setAxisTitle("Number of Seeds per Event", 1);
352  NumberOfSeeds->setAxisTitle("Number of Events", 2);
353 
354  if ( doSeedLumiAnalysis_ ) {
355  ibooker.setCurrentFolder(MEFolderName+"/LSanalysis");
356  histname = "NumberOfSeeds_lumiFlag_"+ seedProducer.label() + "_"+ CategoryName;
357  NumberOfSeeds_lumiFlag = ibooker.book1D(histname, histname, TKNoSeedBin, TKNoSeedMin, TKNoSeedMax);
358  NumberOfSeeds_lumiFlag->setAxisTitle("Number of Seeds per Event", 1);
359  NumberOfSeeds_lumiFlag->setAxisTitle("Number of Events", 2);
360  }
361 
362  }
363 
364  if (doAllSeedPlots || doSeedVsClusterPlot){
365  ibooker.setCurrentFolder(MEFolderName+"/TrackBuilding");
366 
367  ClusterLabels= conf_.getParameter<std::vector<std::string> >("ClusterLabels");
368 
369  std::vector<double> histoMin,histoMax;
370  std::vector<int> histoBin; //these vectors are for max min and nbins in histograms
371 
372  int NClusPxBin = conf_.getParameter<int>( "NClusPxBin");
373  double NClusPxMin = conf_.getParameter<double>("NClusPxMin");
374  double NClusPxMax = conf_.getParameter<double>("NClusPxMax");
375 
376  int NClusStrBin = conf_.getParameter<int>( "NClusStrBin");
377  double NClusStrMin = conf_.getParameter<double>("NClusStrMin");
378  double NClusStrMax = conf_.getParameter<double>("NClusStrMax");
379 
380  setMaxMinBin(histoMin,histoMax,histoBin,NClusStrMin,NClusStrMax,NClusStrBin,NClusPxMin,NClusPxMax,NClusPxBin);
381 
382  for (uint i=0; i<ClusterLabels.size(); i++){
383  histname = "SeedsVsClusters_" + seedProducer.label() + "_Vs_" + ClusterLabels[i] + "_" + CategoryName;
384  SeedsVsClusters.push_back(dynamic_cast<MonitorElement*>(ibooker.book2D(histname, histname, histoBin[i], histoMin[i], histoMax[i],
385  TKNoSeedBin, TKNoSeedMin, TKNoSeedMax)));
386  SeedsVsClusters[i]->setAxisTitle("Number of Clusters", 1);
387  SeedsVsClusters[i]->setAxisTitle("Number of Seeds", 2);
388  }
389  }
390 
391  doTkCandPlots=conf_.getParameter<bool>("doTrackCandHistos");
392  // if (doAllPlots) doTkCandPlots=true;
393 
394  if (doTkCandPlots){
395  ibooker.setCurrentFolder(MEFolderName+"/TrackBuilding");
396 
397  edm::InputTag tcProducer = conf_.getParameter<edm::InputTag>("TCProducer");
398 
399  histname = "NumberOfTrackCandidates_"+ tcProducer.label() + "_"+ CategoryName;
400  NumberOfTrackCandidates = ibooker.book1D(histname, histname, TCNoBin, TCNoMin, TCNoMax);
401  NumberOfTrackCandidates->setAxisTitle("Number of Track Candidates per Event", 1);
402  NumberOfTrackCandidates->setAxisTitle("Number of Event", 2);
403  }
404 
406 
407 
408  if (doLumiAnalysis) {
409  if ( NumberOfTracks_lumiFlag ) NumberOfTracks_lumiFlag -> setLumiFlag();
411  }
412 
413  if(doAllSeedPlots || doSeedNumberPlot){
414  if ( doSeedLumiAnalysis_ )
416  }
417 
419 
420  ClusterLabels= conf_.getParameter<std::vector<std::string> >("ClusterLabels");
421 
422  std::vector<double> histoMin,histoMax;
423  std::vector<int> histoBin; //these vectors are for max min and nbins in histograms
424 
425  int NClusStrBin = conf_.getParameter<int>( "NClusStrBin");
426  double NClusStrMin = conf_.getParameter<double>("NClusStrMin");
427  double NClusStrMax = conf_.getParameter<double>("NClusStrMax");
428 
429  int NClusPxBin = conf_.getParameter<int>( "NClusPxBin");
430  double NClusPxMin = conf_.getParameter<double>("NClusPxMin");
431  double NClusPxMax = conf_.getParameter<double>("NClusPxMax");
432 
433  int NTrk2DBin = conf_.getParameter<int>( "NTrk2DBin");
434  double NTrk2DMin = conf_.getParameter<double>("NTrk2DMin");
435  double NTrk2DMax = conf_.getParameter<double>("NTrk2DMax");
436 
437  setMaxMinBin(histoMin,histoMax,histoBin,
438  NClusStrMin,NClusStrMax,NClusStrBin,
439  NClusPxMin, NClusPxMax, NClusPxBin);
440 
441  ibooker.setCurrentFolder(MEFolderName+"/HitProperties");
442 
443  for (uint i=0; i<ClusterLabels.size(); i++){
444 
445  ibooker.setCurrentFolder(MEFolderName+"/HitProperties");
446  histname = "TracksVs" + ClusterLabels[i] + "Cluster_" + CategoryName;
447  NumberOfTrkVsClusters.push_back(dynamic_cast<MonitorElement*>(ibooker.book2D(histname, histname,
448  histoBin[i], histoMin[i], histoMax[i],
449  NTrk2DBin,NTrk2DMin,NTrk2DMax
450  )));
451  std::string title = "Number of " + ClusterLabels[i] + " Clusters";
452  if(ClusterLabels[i].compare("Tot")==0)
453  title = "# of Clusters in (Pixel+Strip) Detectors";
454  NumberOfTrkVsClusters[i]->setAxisTitle(title, 1);
455  NumberOfTrkVsClusters[i]->setAxisTitle("Number of Tracks", 2);
456  }
457  }
458 
459  // Initialize the GenericTriggerEventFlag
460  if ( genTriggerEventFlag_->on() ) genTriggerEventFlag_->initRun( iRun, iSetup );
461 
462 }
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
std::vector< MonitorElement * > NumberOfTrkVsClusters
MonitorElement * FractionOfGoodTracks
virtual void setMaxMinBin(std::vector< double > &, std::vector< double > &, std::vector< int > &, double, double, int, double, double, int)
TrackAnalyzer * theTrackAnalyzer
edm::ParameterSet conf_
MonitorElement * bookProfile(Args &&...args)
Definition: DQMStore.h:157
MonitorElement * NumberOfMeanRecHitsPerTrack
MonitorElement * NumberOfTracksVsGoodPVtx
MonitorElement * GoodTracksFractionVsLS
MonitorElement * NumberOfTracksVsPUPVtx
std::string Quality_
MonitorElement * NumberOfSeeds
virtual void initHisto(DQMStore::IBooker &ibooker)
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
MonitorElement * NumberOfTracksVsLS
TH1 * getTH1(void) const
bool runTrackBuildingAnalyzerForSeed
std::vector< MonitorElement * > SeedsVsClusters
MonitorElement * NumberOfRecHitsPerTrackVsLS
std::string histname
std::vector< VertexMonitor * > theVertexMonitor
MonitorElement * NumberOfTracksVsBXlumi
bool doGeneralPropertiesPlots_
TrackBuildingAnalyzer * theTrackBuildingAnalyzer
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:276
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
std::string AlgoName_
MonitorElement * NumberOfMeanLayersPerTrack
GenericTriggerEventFlag * genTriggerEventFlag_
std::string const & label() const
Definition: InputTag.h:36
MonitorElement * NumberOfSeeds_lumiFlag
MonitorElement * NumberOfTrackCandidates
virtual void initHisto(DQMStore::IBooker &ibooker, const edm::EventSetup &)
void initRun(const edm::Run &run, const edm::EventSetup &setup)
To be called from beginRun() methods.
void setLumiFlag(void)
this ME is meant to be stored for each luminosity section
MonitorElement * NumberOfTracks_lumiFlag
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
MonitorElement * NumberOfTracks
std::vector< std::string > ClusterLabels
void TrackingMonitor::doProfileX ( TH2 *  th2,
MonitorElement me 
)
private
void TrackingMonitor::doProfileX ( MonitorElement th2m,
MonitorElement me 
)
private
void TrackingMonitor::endRun ( const edm::Run ,
const edm::EventSetup  
)
virtual

Reimplemented from edm::stream::EDAnalyzerBase.

Definition at line 721 of file TrackingMonitor.cc.

722 {
723 }
void TrackingMonitor::setMaxMinBin ( std::vector< double > &  arrayMin,
std::vector< double > &  arrayMax,
std::vector< int > &  arrayBin,
double  smin,
double  smax,
int  sbin,
double  pmin,
double  pmax,
int  pbin 
)
virtual

Definition at line 725 of file TrackingMonitor.cc.

References ClusterLabels, compare_using_db::compare, and i.

Referenced by bookHistograms().

726 {
727  arrayMin.resize(ClusterLabels.size());
728  arrayMax.resize(ClusterLabels.size());
729  arrayBin.resize(ClusterLabels.size());
730 
731  for (uint i=0; i<ClusterLabels.size(); ++i) {
732 
733  if (ClusterLabels[i].compare("Pix")==0 ) {arrayMin[i]=pmin; arrayMax[i]=pmax; arrayBin[i]=pbin;}
734  else if(ClusterLabels[i].compare("Strip")==0) {arrayMin[i]=smin; arrayMax[i]=smax; arrayBin[i]=sbin;}
735  else if(ClusterLabels[i].compare("Tot")==0 ) {arrayMin[i]=smin; arrayMax[i]=smax+pmax; arrayBin[i]=sbin;}
736  else {edm::LogWarning("TrackingMonitor") << "Cluster Label " << ClusterLabels[i] << " not defined, using strip parameters ";
737  arrayMin[i]=smin; arrayMax[i]=smax; arrayBin[i]=sbin;}
738 
739  }
740 
741 }
int i
Definition: DBlmapReader.cc:9
std::vector< std::string > ClusterLabels
void TrackingMonitor::setNclus ( const edm::Event iEvent,
std::vector< int > &  arrayNclus 
)
virtual

Definition at line 743 of file TrackingMonitor.cc.

References ClusterLabels, compare_using_db::compare, edm::Event::getByToken(), i, edm::HandleBase::isValid(), pixelClustersToken_, and stripClustersToken_.

Referenced by analyze().

744 {
745 
746  int ncluster_pix=-1;
747  int ncluster_strip=-1;
748 
750  iEvent.getByToken(stripClustersToken_, strip_clusters );
752  iEvent.getByToken(pixelClustersToken_, pixel_clusters );
753 
754  if (strip_clusters.isValid() && pixel_clusters.isValid()) {
755  ncluster_pix = (*pixel_clusters).dataSize();
756  ncluster_strip = (*strip_clusters).dataSize();
757  }
758 
759  arrayNclus.resize(ClusterLabels.size());
760  for (uint i=0; i<ClusterLabels.size(); ++i){
761 
762  if (ClusterLabels[i].compare("Pix")==0 ) arrayNclus[i]=ncluster_pix ;
763  else if(ClusterLabels[i].compare("Strip")==0) arrayNclus[i]=ncluster_strip;
764  else if(ClusterLabels[i].compare("Tot")==0 ) arrayNclus[i]=ncluster_pix+ncluster_strip;
765  else {edm::LogWarning("TrackingMonitor") << "Cluster Label " << ClusterLabels[i] << " not defined using stri parametrs ";
766  arrayNclus[i]=ncluster_strip ;}
767  }
768 
769 }
int i
Definition: DBlmapReader.cc:9
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
bool isValid() const
Definition: HandleBase.h:75
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > pixelClustersToken_
edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > stripClustersToken_
std::vector< std::string > ClusterLabels

Member Data Documentation

std::string TrackingMonitor::AlgoName_
private

Definition at line 93 of file TrackingMonitor.h.

Referenced by bookHistograms(), and TrackingMonitor().

edm::EDGetTokenT<reco::TrackCollection> TrackingMonitor::allTrackToken_
private

Definition at line 82 of file TrackingMonitor.h.

Referenced by analyze(), and TrackingMonitor().

edm::InputTag TrackingMonitor::bsSrc_
private

Definition at line 77 of file TrackingMonitor.h.

Referenced by TrackingMonitor().

edm::EDGetTokenT<reco::BeamSpot> TrackingMonitor::bsSrcToken_
private

Definition at line 79 of file TrackingMonitor.h.

Referenced by analyze(), and TrackingMonitor().

std::string TrackingMonitor::builderName
private

Definition at line 137 of file TrackingMonitor.h.

Referenced by analyze().

std::vector<std::string> TrackingMonitor::ClusterLabels
private

Definition at line 113 of file TrackingMonitor.h.

Referenced by analyze(), bookHistograms(), setMaxMinBin(), and setNclus().

edm::ParameterSet TrackingMonitor::conf_
private

Definition at line 74 of file TrackingMonitor.h.

Referenced by bookHistograms(), and TrackingMonitor().

StringCutObjectSelector<reco::Track,true> TrackingMonitor::denSelection_
private

Definition at line 162 of file TrackingMonitor.h.

Referenced by analyze().

bool TrackingMonitor::doAllPlots
private

Definition at line 144 of file TrackingMonitor.h.

Referenced by analyze(), and bookHistograms().

bool TrackingMonitor::doAllSeedPlots
private

Definition at line 143 of file TrackingMonitor.h.

Referenced by analyze(), beginLuminosityBlock(), and bookHistograms().

bool TrackingMonitor::doDCAPlots_
private

Definition at line 145 of file TrackingMonitor.h.

bool TrackingMonitor::doFractionPlot_
private

Definition at line 157 of file TrackingMonitor.h.

Referenced by analyze(), bookHistograms(), and TrackingMonitor().

bool TrackingMonitor::doGeneralPropertiesPlots_
private

Definition at line 146 of file TrackingMonitor.h.

Referenced by analyze(), and bookHistograms().

bool TrackingMonitor::doHitPropertiesPlots_
private

Definition at line 147 of file TrackingMonitor.h.

bool TrackingMonitor::doLumiAnalysis
private

Definition at line 141 of file TrackingMonitor.h.

Referenced by analyze(), beginLuminosityBlock(), and bookHistograms().

bool TrackingMonitor::doPlotsVsBXlumi_
private

Definition at line 155 of file TrackingMonitor.h.

Referenced by analyze(), bookHistograms(), and TrackingMonitor().

bool TrackingMonitor::doPlotsVsGoodPVtx_
private

Definition at line 156 of file TrackingMonitor.h.

Referenced by analyze(), bookHistograms(), and TrackingMonitor().

bool TrackingMonitor::doProfilesVsLS_
private

Definition at line 142 of file TrackingMonitor.h.

Referenced by analyze(), and bookHistograms().

bool TrackingMonitor::doPUmonitoring_
private

Definition at line 154 of file TrackingMonitor.h.

Referenced by analyze(), bookHistograms(), TrackingMonitor(), and ~TrackingMonitor().

bool TrackingMonitor::doSeedLumiAnalysis_
private

Definition at line 150 of file TrackingMonitor.h.

Referenced by analyze(), beginLuminosityBlock(), and bookHistograms().

bool TrackingMonitor::doSeedNumberPlot
private

Definition at line 149 of file TrackingMonitor.h.

Referenced by analyze(), beginLuminosityBlock(), and bookHistograms().

bool TrackingMonitor::doSeedVsClusterPlot
private

Definition at line 151 of file TrackingMonitor.h.

Referenced by analyze(), and bookHistograms().

bool TrackingMonitor::doTkCandPlots
private

Definition at line 148 of file TrackingMonitor.h.

Referenced by analyze(), and bookHistograms().

bool TrackingMonitor::doTrackerSpecific_
private

Definition at line 140 of file TrackingMonitor.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* TrackingMonitor::FractionOfGoodTracks
private

Definition at line 107 of file TrackingMonitor.h.

Referenced by analyze(), and bookHistograms().

GenericTriggerEventFlag* TrackingMonitor::genTriggerEventFlag_
private

Definition at line 159 of file TrackingMonitor.h.

Referenced by analyze(), bookHistograms(), and ~TrackingMonitor().

MonitorElement* TrackingMonitor::GoodTracksFractionVsLS
private

Definition at line 127 of file TrackingMonitor.h.

Referenced by analyze(), and bookHistograms().

std::string TrackingMonitor::histname
private

Definition at line 70 of file TrackingMonitor.h.

Referenced by bookHistograms().

MonitorElement* TrackingMonitor::NumberOfMeanLayersPerTrack
private

Definition at line 104 of file TrackingMonitor.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* TrackingMonitor::NumberOfMeanRecHitsPerTrack
private

Definition at line 103 of file TrackingMonitor.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* TrackingMonitor::NumberOfRecHitsPerTrackVsLS
private

Definition at line 128 of file TrackingMonitor.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* TrackingMonitor::NumberOfSeeds
private

Definition at line 110 of file TrackingMonitor.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* TrackingMonitor::NumberOfSeeds_lumiFlag
private

Definition at line 111 of file TrackingMonitor.h.

Referenced by analyze(), beginLuminosityBlock(), and bookHistograms().

MonitorElement* TrackingMonitor::NumberOfTrackCandidates
private

Definition at line 117 of file TrackingMonitor.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* TrackingMonitor::NumberOfTracks
private

Definition at line 102 of file TrackingMonitor.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* TrackingMonitor::NumberOfTracks_lumiFlag
private

Definition at line 135 of file TrackingMonitor.h.

Referenced by analyze(), beginLuminosityBlock(), and bookHistograms().

MonitorElement* TrackingMonitor::NumberOfTracksVsBXlumi
private

Definition at line 132 of file TrackingMonitor.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* TrackingMonitor::NumberOfTracksVsGoodPVtx
private

Definition at line 131 of file TrackingMonitor.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* TrackingMonitor::NumberOfTracksVsLS
private

Definition at line 126 of file TrackingMonitor.h.

Referenced by analyze(), and bookHistograms().

MonitorElement * TrackingMonitor::NumberOfTracksVsPUPVtx
private

Definition at line 131 of file TrackingMonitor.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* TrackingMonitor::NumberOfTrkVsClus
private

Definition at line 121 of file TrackingMonitor.h.

std::vector<MonitorElement*> TrackingMonitor::NumberOfTrkVsClusters
private

Definition at line 120 of file TrackingMonitor.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* TrackingMonitor::NumberOfTrkVsPixelClus
private

Definition at line 123 of file TrackingMonitor.h.

MonitorElement* TrackingMonitor::NumberOfTrkVsStripClus
private

Definition at line 122 of file TrackingMonitor.h.

StringCutObjectSelector<reco::Track,true> TrackingMonitor::numSelection_
private

Definition at line 161 of file TrackingMonitor.h.

Referenced by analyze().

edm::InputTag TrackingMonitor::pixelClusterInputTag_
private

Definition at line 88 of file TrackingMonitor.h.

Referenced by TrackingMonitor().

edm::EDGetTokenT<edmNew::DetSetVector<SiPixelCluster> > TrackingMonitor::pixelClustersToken_
private

Definition at line 90 of file TrackingMonitor.h.

Referenced by setNclus(), and TrackingMonitor().

int TrackingMonitor::pvNDOF_
private

Definition at line 163 of file TrackingMonitor.h.

Referenced by analyze().

edm::InputTag TrackingMonitor::pvSrc_
private

Definition at line 78 of file TrackingMonitor.h.

Referenced by TrackingMonitor().

edm::EDGetTokenT<reco::VertexCollection> TrackingMonitor::pvSrcToken_
private

Definition at line 80 of file TrackingMonitor.h.

Referenced by analyze(), and TrackingMonitor().

std::string TrackingMonitor::Quality_
private

Definition at line 92 of file TrackingMonitor.h.

Referenced by bookHistograms(), and TrackingMonitor().

bool TrackingMonitor::runTrackBuildingAnalyzerForSeed
private

Definition at line 152 of file TrackingMonitor.h.

Referenced by analyze(), and bookHistograms().

std::vector<MonitorElement *> TrackingMonitor::SeedsVsClusters
private

Definition at line 112 of file TrackingMonitor.h.

Referenced by analyze(), and bookHistograms().

edm::EDGetTokenT<edm::View<TrajectorySeed> > TrackingMonitor::seedToken_
private

Definition at line 85 of file TrackingMonitor.h.

Referenced by analyze(), and TrackingMonitor().

edm::InputTag TrackingMonitor::stripClusterInputTag_
private

Definition at line 87 of file TrackingMonitor.h.

Referenced by TrackingMonitor().

edm::EDGetTokenT<edmNew::DetSetVector<SiStripCluster> > TrackingMonitor::stripClustersToken_
private

Definition at line 89 of file TrackingMonitor.h.

Referenced by setNclus(), and TrackingMonitor().

GetLumi* TrackingMonitor::theLumiDetails_
private

Definition at line 99 of file TrackingMonitor.h.

Referenced by analyze(), and TrackingMonitor().

TrackAnalyzer* TrackingMonitor::theTrackAnalyzer
private
TrackBuildingAnalyzer* TrackingMonitor::theTrackBuildingAnalyzer
private

Definition at line 97 of file TrackingMonitor.h.

Referenced by analyze(), bookHistograms(), and ~TrackingMonitor().

edm::ESHandle<TransientTrackingRecHitBuilder> TrackingMonitor::theTTRHBuilder
private

Definition at line 138 of file TrackingMonitor.h.

Referenced by analyze().

std::vector<VertexMonitor*> TrackingMonitor::theVertexMonitor
private

Definition at line 98 of file TrackingMonitor.h.

Referenced by analyze(), bookHistograms(), TrackingMonitor(), and ~TrackingMonitor().

edm::EDGetTokenT<TrackCandidateCollection> TrackingMonitor::trackCandidateToken_
private

Definition at line 84 of file TrackingMonitor.h.

Referenced by analyze(), and TrackingMonitor().

edm::EDGetTokenT<reco::TrackCollection> TrackingMonitor::trackToken_
private

Definition at line 83 of file TrackingMonitor.h.

Referenced by analyze(), and TrackingMonitor().