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
 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 (const std::string &iProcessName, std::vector< const char * > &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
 
MonitorElementNumberOfTrkVsClus
 
std::vector< MonitorElement * > NumberOfTrkVsClusters
 
MonitorElementNumberOfTrkVsPixelClus
 
MonitorElementNumberOfTrkVsStripClus
 
StringCutObjectSelector
< reco::Track, true > 
numSelection_
 
edm::InputTag pixelClusterInputTag_
 
edm::EDGetTokenT
< edmNew::DetSetVector
< SiPixelCluster > > 
pixelClustersToken_
 
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
 
- 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::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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_25ns14e33_v1_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
60 
62  // , NumberOfGoodTracks_lumiFlag(NULL)
63 
64  , builderName ( conf_.getParameter<std::string>("TTRHBuilder"))
65  , doTrackerSpecific_ ( conf_.getParameter<bool>("doTrackerSpecific") )
66  , doLumiAnalysis ( conf_.getParameter<bool>("doLumiAnalysis"))
67  , doProfilesVsLS_ ( conf_.getParameter<bool>("doProfilesVsLS"))
68  , doAllPlots ( conf_.getParameter<bool>("doAllPlots"))
69  , doGeneralPropertiesPlots_( conf_.getParameter<bool>("doGeneralPropertiesPlots"))
70  , doHitPropertiesPlots_ ( conf_.getParameter<bool>("doHitPropertiesPlots"))
71  , doPUmonitoring_ ( conf_.getParameter<bool>("doPUmonitoring") )
75 {
76 
79 
80  // input tags for collections from the configuration
81  bsSrc_ = conf_.getParameter<edm::InputTag>("beamSpot");
82  pvSrc_ = conf_.getParameter<edm::InputTag>("primaryVertex");
83  bsSrcToken_ = consumes<reco::BeamSpot>(bsSrc_);
84  pvSrcToken_ = mayConsume<reco::VertexCollection>(pvSrc_);
85 
86  edm::InputTag alltrackProducer = conf_.getParameter<edm::InputTag>("allTrackProducer");
88  edm::InputTag tcProducer = conf_.getParameter<edm::InputTag>("TCProducer");
89  edm::InputTag seedProducer = conf_.getParameter<edm::InputTag>("SeedProducer");
90  allTrackToken_ = consumes<reco::TrackCollection>(alltrackProducer);
91  trackToken_ = consumes<reco::TrackCollection>(trackProducer);
92  trackCandidateToken_ = consumes<TrackCandidateCollection>(tcProducer);
93  seedToken_ = consumes<edm::View<TrajectorySeed> >(seedProducer);
94 
97  stripClustersToken_ = mayConsume<edmNew::DetSetVector<SiStripCluster> > (stripClusterInputTag_);
98  pixelClustersToken_ = mayConsume<edmNew::DetSetVector<SiPixelCluster> > (pixelClusterInputTag_);
99 
100  doFractionPlot_ = true;
101  if (alltrackProducer.label()==trackProducer.label()) doFractionPlot_ = false;
102 
103  Quality_ = conf_.getParameter<std::string>("Quality");
104  AlgoName_ = conf_.getParameter<std::string>("AlgoName");
105 
106 
107  if ( doPUmonitoring_ ) {
108 
109  // get flag from the configuration
110  doPlotsVsBXlumi_ = conf_.getParameter<bool>("doPlotsVsBXlumi");
111  doPlotsVsGoodPVtx_ = conf_.getParameter<bool>("doPlotsVsGoodPVtx");
112 
113  if ( doPlotsVsBXlumi_ )
114  theLumiDetails_ = new GetLumi( iConfig.getParameter<edm::ParameterSet>("BXlumiSetup"), c );
115 
116  std::vector<edm::InputTag> primaryVertexInputTags = conf_.getParameter<std::vector<edm::InputTag> >("primaryVertexInputTags");
117  std::vector<edm::InputTag> selPrimaryVertexInputTags = conf_.getParameter<std::vector<edm::InputTag> >("selPrimaryVertexInputTags");
118  std::vector<std::string> pvLabels = conf_.getParameter<std::vector<std::string> > ("pvLabels");
119 
120  if (primaryVertexInputTags.size()==pvLabels.size() and primaryVertexInputTags.size()==selPrimaryVertexInputTags.size()) {
121  // for (auto const& tag : primaryVertexInputTags) {
122  for (size_t i=0; i<primaryVertexInputTags.size(); i++) {
123  edm::InputTag iPVinputTag = primaryVertexInputTags[i];
124  edm::InputTag iSelPVinputTag = selPrimaryVertexInputTags[i];
125  std::string iPVlabel = pvLabels[i];
126 
127  theVertexMonitor.push_back(new VertexMonitor(conf_,iPVinputTag,iSelPVinputTag,iPVlabel,c) );
128  }
129  }
130  }
131 
132 }
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
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 135 of file TrackingMonitor.cc.

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

136 {
139  if ( doPUmonitoring_ )
140  for (size_t i=0; i<theVertexMonitor.size(); i++)
141  if (theVertexMonitor[i]) delete theVertexMonitor[i];
143 }
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 481 of file TrackingMonitor.cc.

References GenericTriggerEventFlag::accept(), allTrackToken_, TrackAnalyzer::analyze(), TrackBuildingAnalyzer::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(), edm::HandleBase::isValid(), edm::EventID::luminosityBlock(), NumberOfMeanLayersPerTrack, NumberOfMeanRecHitsPerTrack, NumberOfRecHitsPerTrackVsLS, NumberOfSeeds, NumberOfSeeds_lumiFlag, NumberOfTrackCandidates, NumberOfTracks, NumberOfTracks_lumiFlag, NumberOfTracksVsBXlumi, NumberOfTracksVsGoodPVtx, NumberOfTracksVsLS, NumberOfTrkVsClusters, numSelection_, GenericTriggerEventFlag::on(), MetAnalyzer::pv(), pvSrcToken_, runTrackBuildingAnalyzerForSeed, fileCollector::seed, SeedsVsClusters, seedToken_, setNclus(), edm::View< T >::size(), theLumiDetails_, theTrackAnalyzer, theTrackBuildingAnalyzer, theTTRHBuilder, theVertexMonitor, trackCandidateToken_, HLT_50ns_5e33_v1_cff::trackCollection, and trackToken_.

482 {
483 
484  // Filter out events if Trigger Filtering is requested
485  if (genTriggerEventFlag_->on()&& ! genTriggerEventFlag_->accept( iEvent, iSetup) ) return;
486 
487  // Analyse the tracks
488  // if the collection is empty, do not fill anything
489  // ---------------------------------------------------------------------------------//
490 
491  // get the track collection
493  iEvent.getByToken(trackToken_, trackHandle);
494 
495  // int numberOfAllTracks = 0;
496  int numberOfTracks_den = 0;
497  edm::Handle<reco::TrackCollection> allTrackHandle;
498  iEvent.getByToken(allTrackToken_,allTrackHandle);
499  if (allTrackHandle.isValid()) {
500  // numberOfAllTracks = allTrackHandle->size();
501  for (reco::TrackCollection::const_iterator track = allTrackHandle->begin();
502  track!=allTrackHandle->end(); ++track) {
503  if ( denSelection_(*track) )
504  numberOfTracks_den++;
505  }
506  }
507 
508  if (trackHandle.isValid()) {
509 
510  int numberOfTracks = trackHandle->size();
511  int numberOfTracks_num = 0;
512 
513  reco::TrackCollection trackCollection = *trackHandle;
514  // calculate the mean # rechits and layers
515  int totalRecHits = 0, totalLayers = 0;
516 
517  for (reco::TrackCollection::const_iterator track = trackCollection.begin();
518  track!=trackCollection.end(); ++track) {
519 
520  if ( numSelection_(*track) )
521  numberOfTracks_num++;
522 
523  if ( doProfilesVsLS_ || doAllPlots)
524  NumberOfRecHitsPerTrackVsLS->Fill(static_cast<double>(iEvent.id().luminosityBlock()),track->numberOfValidHits());
525 
526  totalRecHits += track->numberOfValidHits();
527  totalLayers += track->hitPattern().trackerLayersWithMeasurement();
528 
529  // do analysis per track
530  theTrackAnalyzer->analyze(iEvent, iSetup, *track);
531  }
532 
533  double frac = -1.;
534  // if (numberOfAllTracks > 0) frac = static_cast<double>(numberOfTracks)/static_cast<double>(numberOfAllTracks);
535  if (numberOfTracks_den > 0) frac = static_cast<double>(numberOfTracks_num)/static_cast<double>(numberOfTracks_den);
536 
538  NumberOfTracks -> Fill(numberOfTracks);
539  if (doFractionPlot_)
540  FractionOfGoodTracks -> Fill(frac);
541 
542  if( numberOfTracks > 0 ) {
543  double meanRecHits = static_cast<double>(totalRecHits) / static_cast<double>(numberOfTracks);
544  double meanLayers = static_cast<double>(totalLayers) / static_cast<double>(numberOfTracks);
545  NumberOfMeanRecHitsPerTrack -> Fill(meanRecHits);
546  NumberOfMeanLayersPerTrack -> Fill(meanLayers);
547  }
548  }
549 
550  if ( doProfilesVsLS_ || doAllPlots) {
551  NumberOfTracksVsLS ->Fill(static_cast<double>(iEvent.id().luminosityBlock()),numberOfTracks);
552  if (doFractionPlot_)
553  GoodTracksFractionVsLS->Fill(static_cast<double>(iEvent.id().luminosityBlock()),frac);
554  }
555 
556  if ( doLumiAnalysis ) {
557  NumberOfTracks_lumiFlag -> Fill(numberOfTracks);
558  }
559 
560 
561  // Analyse the Track Building variables
562  // if the collection is empty, do not fill anything
563  // ---------------------------------------------------------------------------------//
564 
565 
566  // fill the TrackCandidate info
567  if (doTkCandPlots) {
568  // magnetic field
570  iSetup.get<IdealMagneticFieldRecord>().get(theMF);
571 
572  // get the candidate collection
574  iEvent.getByToken( trackCandidateToken_, theTCHandle );
575  const TrackCandidateCollection& theTCCollection = *theTCHandle;
576 
577  if (theTCHandle.isValid()) {
578 
579  // get the beam spot
580  edm::Handle<reco::BeamSpot> recoBeamSpotHandle;
581  iEvent.getByToken(bsSrcToken_, recoBeamSpotHandle );
582  const reco::BeamSpot& bs = *recoBeamSpotHandle;
583 
584  NumberOfTrackCandidates->Fill(theTCCollection.size());
586  for( TrackCandidateCollection::const_iterator cand = theTCCollection.begin(); cand != theTCCollection.end(); ++cand) {
587 
588  theTrackBuildingAnalyzer->analyze(iEvent, iSetup, *cand, bs, theMF, theTTRHBuilder);
589  }
590  } else {
591  edm::LogWarning("TrackingMonitor") << "No Track Candidates in the event. Not filling associated histograms";
592  }
593  }
594 
595  //plots for trajectory seeds
596 
598 
599  // get the seed collection
601  iEvent.getByToken(seedToken_, seedHandle );
602  const edm::View<TrajectorySeed>& seedCollection = *seedHandle;
603 
604  // fill the seed info
605  if (seedHandle.isValid()) {
606 
608  NumberOfSeeds->Fill(seedCollection.size());
609  if ( doSeedLumiAnalysis_ )
610  NumberOfSeeds_lumiFlag->Fill(seedCollection.size());
611  }
612 
614 
615  std::vector<int> NClus;
616  setNclus(iEvent,NClus);
617  for (uint i=0; i< ClusterLabels.size(); i++){
618  SeedsVsClusters[i]->Fill(NClus[i],seedCollection.size());
619  }
620  }
621 
623 
624  //here duplication of mag field and be informations is needed to allow seed and track cand histos to be independent
625  // magnetic field
627  iSetup.get<IdealMagneticFieldRecord>().get(theMF);
628 
629  // get the beam spot
630  edm::Handle<reco::BeamSpot> recoBeamSpotHandle;
631  iEvent.getByToken(bsSrcToken_, recoBeamSpotHandle );
632  const reco::BeamSpot& bs = *recoBeamSpotHandle;
633 
635  for(size_t i=0; i < seedHandle->size(); ++i) {
636 
638  theTrackBuildingAnalyzer->analyze(iEvent, iSetup, *seed, bs, theMF, theTTRHBuilder);
639  }
640  }
641 
642  } else {
643  edm::LogWarning("TrackingMonitor") << "No Trajectory seeds in the event. Not filling associated histograms";
644  }
645  }
646 
647 
649 
650  std::vector<int> NClus;
651  setNclus(iEvent,NClus);
652  for (uint i=0; i< ClusterLabels.size(); i++) {
653  NumberOfTrkVsClusters[i]->Fill(NClus[i],numberOfTracks);
654  }
655  }
656 
657  if ( doPUmonitoring_ ) {
658 
659  // do vertex monitoring
660  for (size_t i=0; i<theVertexMonitor.size(); i++)
661  theVertexMonitor[i]->analyze(iEvent, iSetup);
662 
663  if ( doPlotsVsGoodPVtx_ ) {
664 
665  size_t totalNumGoodPV = 0;
667  iEvent.getByToken(pvSrcToken_, pvHandle );
668  if (pvHandle.isValid()) {
669 
670  for (reco::VertexCollection::const_iterator pv = pvHandle->begin();
671  pv != pvHandle->end(); ++pv) {
672 
673  //--- pv fake (the pv collection should have size==1 and the pv==beam spot)
674  if (pv->isFake() || pv->tracksSize()==0) continue;
675 
676  // definition of goodOfflinePrimaryVertex
677  if (pv->ndof() < 4. || pv->z() > 24.) continue;
678  totalNumGoodPV++;
679  }
680 
681  NumberOfTracksVsGoodPVtx -> Fill( totalNumGoodPV, numberOfTracks );
682  }
683  }
684 
685  if ( doPlotsVsBXlumi_ ) {
686  double bxlumi = theLumiDetails_->getValue(iEvent);
687  NumberOfTracksVsBXlumi -> Fill( bxlumi, numberOfTracks );
688  }
689 
690  } // PU monitoring
691 
692  } // trackHandle is valid
693 
694 }
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:449
std::vector< TrackCandidate > TrackCandidateCollection
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:13
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
MonitorElement * GoodTracksFractionVsLS
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.
MonitorElement * NumberOfTracksVsLS
bool runTrackBuildingAnalyzerForSeed
bool isValid() const
Definition: HandleBase.h:75
std::vector< MonitorElement * > SeedsVsClusters
MonitorElement * NumberOfRecHitsPerTrackVsLS
std::vector< VertexMonitor * > theVertexMonitor
MonitorElement * NumberOfTracksVsBXlumi
bool doGeneralPropertiesPlots_
TrackBuildingAnalyzer * theTrackBuildingAnalyzer
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:55
StringCutObjectSelector< reco::Track, true > numSelection_
GenericTriggerEventFlag * genTriggerEventFlag_
MonitorElement * NumberOfSeeds_lumiFlag
edm::EventID id() const
Definition: EventBase.h:60
edm::ESHandle< TransientTrackingRecHitBuilder > theTTRHBuilder
MonitorElement * NumberOfTrackCandidates
MonitorElement * NumberOfTracks_lumiFlag
edm::EDGetTokenT< reco::BeamSpot > bsSrcToken_
MonitorElement * NumberOfTracks
edm::EDGetTokenT< reco::VertexCollection > pvSrcToken_
std::vector< std::string > ClusterLabels
std::string builderName
void TrackingMonitor::beginJob ( void  )
virtual

Definition at line 146 of file TrackingMonitor.cc.

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

Reimplemented from edm::stream::EDAnalyzerBase.

Definition at line 467 of file TrackingMonitor.cc.

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

467  {
468 
469  if (doLumiAnalysis) {
472  }
474  if ( doSeedLumiAnalysis_ )
476  }
477 }
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 152 of file TrackingMonitor.cc.

References HLT_25ns14e33_v1_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, 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.

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

698 {
699 }
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 701 of file TrackingMonitor.cc.

References ClusterLabels, compare_using_db::compare, and i.

Referenced by bookHistograms().

702 {
703  arrayMin.resize(ClusterLabels.size());
704  arrayMax.resize(ClusterLabels.size());
705  arrayBin.resize(ClusterLabels.size());
706 
707  for (uint i=0; i<ClusterLabels.size(); ++i) {
708 
709  if (ClusterLabels[i].compare("Pix")==0 ) {arrayMin[i]=pmin; arrayMax[i]=pmax; arrayBin[i]=pbin;}
710  else if(ClusterLabels[i].compare("Strip")==0) {arrayMin[i]=smin; arrayMax[i]=smax; arrayBin[i]=sbin;}
711  else if(ClusterLabels[i].compare("Tot")==0 ) {arrayMin[i]=smin; arrayMax[i]=smax+pmax; arrayBin[i]=sbin;}
712  else {edm::LogWarning("TrackingMonitor") << "Cluster Label " << ClusterLabels[i] << " not defined, using strip parameters ";
713  arrayMin[i]=smin; arrayMax[i]=smax; arrayBin[i]=sbin;}
714 
715  }
716 
717 }
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 719 of file TrackingMonitor.cc.

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

Referenced by analyze().

720 {
721 
722  int ncluster_pix=-1;
723  int ncluster_strip=-1;
724 
726  iEvent.getByToken(stripClustersToken_, strip_clusters );
728  iEvent.getByToken(pixelClustersToken_, pixel_clusters );
729 
730  if (strip_clusters.isValid() && pixel_clusters.isValid()) {
731  ncluster_pix = (*pixel_clusters).dataSize();
732  ncluster_strip = (*strip_clusters).dataSize();
733  }
734 
735  arrayNclus.resize(ClusterLabels.size());
736  for (uint i=0; i<ClusterLabels.size(); ++i){
737 
738  if (ClusterLabels[i].compare("Pix")==0 ) arrayNclus[i]=ncluster_pix ;
739  else if(ClusterLabels[i].compare("Strip")==0) arrayNclus[i]=ncluster_strip;
740  else if(ClusterLabels[i].compare("Tot")==0 ) arrayNclus[i]=ncluster_pix+ncluster_strip;
741  else {edm::LogWarning("TrackingMonitor") << "Cluster Label " << ClusterLabels[i] << " not defined using stri parametrs ";
742  arrayNclus[i]=ncluster_strip ;}
743  }
744 
745 }
int i
Definition: DBlmapReader.cc:9
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:449
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::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().

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().