43 , NumberOfTracks(
NULL)
44 , NumberOfMeanRecHitsPerTrack(
NULL)
45 , NumberOfMeanLayersPerTrack(
NULL)
47 , FractionOfGoodTracks(
NULL)
49 , NumberOfSeeds_lumiFlag(
NULL)
50 , NumberOfTrackCandidates(
NULL)
52 , NumberEventsOfVsLS(
NULL)
53 , NumberOfTracksVsLS(
NULL)
55 , GoodTracksFractionVsLS(
NULL)
59 , NumberOfGoodPVtxVsLS(
NULL)
60 , NumberOfGoodPVtxWO0VsLS(
NULL)
61 , NumberEventsOfVsBX (
NULL)
62 , NumberOfTracksVsBX(
NULL)
63 , GoodTracksFractionVsBX(
NULL)
64 , NumberOfRecHitsPerTrackVsBX(
NULL)
65 , NumberOfGoodPVtxVsBX(
NULL)
66 , NumberOfGoodPVtxWO0VsBX(
NULL)
67 , NumberOfTracksVsBXlumi(
NULL)
68 , NumberOfTracksVsGoodPVtx(
NULL)
69 , NumberOfTracksVsPUPVtx(
NULL)
70 , NumberEventsOfVsGoodPVtx(
NULL)
71 , GoodTracksFractionVsGoodPVtx(
NULL)
72 , NumberOfRecHitsPerTrackVsGoodPVtx(
NULL)
73 , NumberOfPVtxVsGoodPVtx(
NULL)
74 , NumberOfPixelClustersVsGoodPVtx(
NULL)
75 , NumberOfStripClustersVsGoodPVtx(
NULL)
76 , NumberEventsOfVsLUMI(
NULL)
77 , NumberOfTracksVsLUMI(
NULL)
78 , GoodTracksFractionVsLUMI(
NULL)
79 , NumberOfRecHitsPerTrackVsLUMI(
NULL)
80 , NumberOfGoodPVtxVsLUMI(
NULL)
81 , NumberOfGoodPVtxWO0VsLUMI(
NULL)
82 , NumberOfPixelClustersVsLUMI(
NULL)
83 , NumberOfStripClustersVsLUMI(
NULL)
84 , NumberOfTracks_lumiFlag(
NULL)
87 , builderName ( conf_.getParameter<
std::
string>(
"TTRHBuilder"))
88 , doTrackerSpecific_ ( conf_.getParameter<bool>(
"doTrackerSpecific") )
89 , doLumiAnalysis ( conf_.getParameter<bool>(
"doLumiAnalysis"))
90 , doProfilesVsLS_ ( conf_.getParameter<bool>(
"doProfilesVsLS"))
91 , doAllPlots ( conf_.getParameter<bool>(
"doAllPlots"))
92 , doGeneralPropertiesPlots_( conf_.getParameter<bool>(
"doGeneralPropertiesPlots"))
93 , doHitPropertiesPlots_ ( conf_.getParameter<bool>(
"doHitPropertiesPlots"))
94 , doPUmonitoring_ ( conf_.getParameter<bool>(
"doPUmonitoring") )
96 , numSelection_ (conf_.getParameter<
std::
string>(
"numCut"))
97 , denSelection_ (conf_.getParameter<
std::
string>(
"denCut"))
98 , pvNDOF_ ( conf_.getParameter<
int> (
"pvNDOF") )
116 allTrackToken_ = consumes<edm::View<reco::Track> >(alltrackProducer);
119 seedToken_ = consumes<edm::View<TrajectorySeed> >(seedProducer);
127 if (alltrackProducer.
label()==trackProducer.label()) doFractionPlot_ =
false;
134 if ( doPlotsVsBXlumi_ )
142 std::vector<edm::InputTag> primaryVertexInputTags =
conf_.
getParameter<std::vector<edm::InputTag> >(
"primaryVertexInputTags");
143 std::vector<edm::InputTag> selPrimaryVertexInputTags =
conf_.
getParameter<std::vector<edm::InputTag> >(
"selPrimaryVertexInputTags");
144 std::vector<std::string> pvLabels =
conf_.
getParameter<std::vector<std::string> > (
"pvLabels");
146 if (primaryVertexInputTags.size()==pvLabels.size() and primaryVertexInputTags.size()==selPrimaryVertexInputTags.size()) {
147 for (
size_t i=0;
i<primaryVertexInputTags.size();
i++) {
189 edm::LogWarning(
"TrackingMonitor") <<
"Qualty Name is invalid, using no quality criterea by default";
224 StateName !=
"OuterSurface" &&
225 StateName !=
"InnerSurface" &&
226 StateName !=
"ImpactPoint" &&
227 StateName !=
"default" &&
231 edm::LogWarning(
"TrackingMonitor") <<
"State Name is invalid, using 'ImpactPoint' by default";
243 histname =
"NumberOfTracks_" + CategoryName;
249 histname =
"NumberOfMeanRecHitsPerTrack_" + CategoryName;
254 histname =
"NumberOfMeanLayersPerTrack_" + CategoryName;
260 histname =
"FractionOfGoodTracks_" + CategoryName;
271 histname =
"NumberOfTracks_lumiFlag_" + CategoryName;
286 histname =
"NumberOfTracksVsLS_"+ CategoryName;
292 histname =
"NumberOfRecHitsPerTrackVsLS_" + CategoryName;
298 histname =
"NumberEventsVsLS_" + CategoryName;
307 histname =
"NumberOfGoodPVtxVsLS_" + CategoryName;
313 histname =
"NumberOfGoodPVtxWO0VsLS_" + CategoryName;
320 histname =
"GoodTracksFractionVsLS_"+ CategoryName;
329 int BXBin = 3564;
double BXMin = 0.5;
double BXMax = 3564.5;
331 histname =
"NumberEventsVsBX_" + CategoryName;
337 histname =
"NumberOfTracksVsBX_"+ CategoryName;
343 histname =
"NumberOfRecHitsPerTrackVsBX_" + CategoryName;
349 histname =
"NumberOfGoodPVtxVsBX_" + CategoryName;
355 histname =
"NumberOfGoodPVtxWO0VsBX_" + CategoryName;
362 histname =
"GoodTracksFractionVsBX_"+ CategoryName;
388 histname =
"NumberOfTracksVsGoodPVtx";
394 histname =
"NumberOfTracksVsPUPVtx";
400 histname =
"NumberEventsVsGoodPVtx";
407 histname =
"GoodTracksFractionVsGoodPVtx";
414 histname =
"NumberOfRecHitsPerTrackVsGoodPVtx";
420 histname =
"NumberOfPVtxVsGoodPVtx";
428 histname =
"NumberOfPixelClustersVsGoodPVtx";
436 histname =
"NumberOfStripClustersVsGoodPVtx";
457 histname =
"NumberOfTracksVsLUMI";
464 histname =
"GoodTracksFractionVsLUMI";
471 histname =
"NumberOfRecHitsPerTrackVsLUMI";
480 histname =
"NumberOfGoodPVtxVsLUMI";
486 histname =
"NumberOfGoodPVtxWO0VsLUMI";
494 histname =
"NumberOfPixelClustersVsGoodPVtx";
502 histname =
"NumberOfStripClustersVsLUMI";
515 int BXlumiBin = BXlumiParameters.
getParameter<
int>(
"BXlumiBin");
516 double BXlumiMin = BXlumiParameters.
getParameter<
double>(
"BXlumiMin");
517 double BXlumiMax = BXlumiParameters.
getParameter<
double>(
"BXlumiMax");
519 histname =
"NumberOfTracksVsBXlumi_"+ CategoryName;
547 histname =
"NumberOfSeeds_"+ seedProducer.
label() +
"_"+ CategoryName;
552 if ( doSeedLumiAnalysis_ ) {
554 histname =
"NumberOfSeeds_lumiFlag_"+ seedProducer.
label() +
"_"+ CategoryName;
567 std::vector<double> histoMin,histoMax;
568 std::vector<int> histoBin;
578 setMaxMinBin(histoMin,histoMax,histoBin,NClusStrMin,NClusStrMax,NClusStrBin,NClusPxMin,NClusPxMax,NClusPxBin);
583 TKNoSeedBin, TKNoSeedMin, TKNoSeedMax)));
598 histname =
"NumberOfTrackCandidates_"+ tcProducer.
label() +
"_"+ CategoryName;
613 if ( doSeedLumiAnalysis_ )
621 std::vector<double> histoMin,histoMax;
622 std::vector<int> histoBin;
637 NClusStrMin,NClusStrMax,NClusStrBin,
638 NClusPxMin, NClusPxMax, NClusPxBin);
647 histoBin[
i], histoMin[i], histoMax[i],
648 NTrk2DBin,NTrk2DMin,NTrk2DMax
652 title =
"# of Clusters in (Pixel+Strip) Detectors";
698 if ( lumiScalers.
isValid() && lumiScalers->size() ) {
699 LumiScalersCollection::const_iterator scalit = lumiScalers->begin();
700 lumi = scalit->instantLumi();
719 int numberOfTracks_den = 0;
722 if (allTrackHandle.
isValid()) {
727 numberOfTracks_den++;
735 pv0 = &pvHandle->front();
739 || pv0->
ndof() <
pvNDOF_ || pv0->
z() > 24.) pv0 =
nullptr;
745 int numberOfTracks = trackHandle->size();
746 int numberOfTracks_num = 0;
747 int numberOfTracks_pv0 = 0;
751 int totalRecHits = 0, totalLayers = 0;
762 numberOfTracks_num++;
772 totalRecHits +=
track->numberOfValidHits();
773 totalLayers +=
track->hitPattern().trackerLayersWithMeasurement();
781 if (numberOfTracks_den > 0) frac =
static_cast<double>(numberOfTracks_num)/static_cast<double>(numberOfTracks_den);
799 if( numberOfTracks > 0 ) {
800 double meanRecHits =
static_cast<double>(totalRecHits) / static_cast<double>(numberOfTracks);
801 double meanLayers =
static_cast<double>(totalLayers) / static_cast<double>(numberOfTracks);
845 for( TrackCandidateCollection::const_iterator
cand = theTCCollection.begin();
cand != theTCCollection.end(); ++
cand) {
850 edm::LogWarning(
"TrackingMonitor") <<
"No Track Candidates in the event. Not filling associated histograms";
874 std::vector<int> NClus;
894 for(
size_t i=0;
i < seedHandle->size(); ++
i) {
902 edm::LogWarning(
"TrackingMonitor") <<
"No Trajectory seeds in the event. Not filling associated histograms";
909 std::vector<int> NClus;
924 size_t totalNumGoodPV = 0;
927 for (reco::VertexCollection::const_iterator
pv = pvHandle->begin();
928 pv != pvHandle->end(); ++
pv) {
931 if (
pv->isFake() ||
pv->tracksSize()==0)
continue;
934 if (
pv->ndof() <
pvNDOF_ ||
pv->z() > 24.)
continue;
940 if (totalNumGoodPV>1)
NumberOfTracksVsPUPVtx->
Fill( totalNumGoodPV-1,
double(numberOfTracks-numberOfTracks_pv0)/
double(totalNumGoodPV-1) );
961 std::vector<int> NClus;
992 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)
1004 arrayMin[
i]=smin; arrayMax[
i]=smax; arrayBin[
i]=sbin;}
1013 int ncluster_pix=-1;
1014 int ncluster_strip=-1;
1022 ncluster_pix = (*pixel_clusters).dataSize();
1023 ncluster_strip = (*strip_clusters).dataSize();
1033 arrayNclus[
i]=ncluster_strip ;}
edm::EDGetTokenT< edm::View< reco::Track > > trackToken_
T getParameter(std::string const &) const
edm::EDGetTokenT< edm::View< TrajectorySeed > > seedToken_
bool compare(const P &i, const P &j)
std::vector< MonitorElement * > NumberOfTrkVsClusters
MonitorElement * FractionOfGoodTracks
virtual void setMaxMinBin(std::vector< double > &, std::vector< double > &, std::vector< int > &, double, double, int, double, double, int)
MonitorElement * NumberOfTracksVsBX
TrackAnalyzer * theTrackAnalyzer
MonitorElement * NumberOfRecHitsPerTrackVsBX
MonitorElement * NumberOfRecHitsPerTrackVsLUMI
virtual void setNclus(const edm::Event &, std::vector< int > &)
MonitorElement * bookProfile(Args &&...args)
MonitorElement * NumberEventsOfVsGoodPVtx
GetLumi * theLumiDetails_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
std::vector< TrackCandidate > TrackCandidateCollection
int bunchCrossing() const
MonitorElement * GoodTracksFractionVsLUMI
Provides a code based selection for trigger and DCS information in order to have no failing filters i...
MonitorElement * NumberOfPVtxVsGoodPVtx
MonitorElement * NumberOfMeanRecHitsPerTrack
MonitorElement * NumberOfTracksVsGoodPVtx
LuminosityBlockNumber_t luminosityBlock() const
const Point & position() const
position
virtual void analyze(const edm::Event &, const edm::EventSetup &) override
MonitorElement * NumberOfStripClustersVsLUMI
MonitorElement * GoodTracksFractionVsLS
void setLumi(const edm::Event &, const edm::EventSetup &iSetup)
double getValue(const edm::Event &)
MonitorElement * NumberOfGoodPVtxWO0VsLUMI
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
const_iterator begin() const
MonitorElement * NumberOfGoodPVtxVsLS
edm::EDGetTokenT< edm::View< reco::Track > > allTrackToken_
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
MonitorElement * NumberOfGoodPVtxVsLUMI
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
bool accept(const edm::Event &event, const edm::EventSetup &setup)
To be called from analyze/filter() methods.
void setBX(const edm::Event &)
virtual void initHisto(DQMStore::IBooker &ibooker)
MonitorElement * book1D(Args &&...args)
virtual void endRun(const edm::Run &, const edm::EventSetup &) override
MonitorElement * NumberOfTracksVsLS
Abs< T >::type abs(const T &t)
MonitorElement * NumberOfGoodPVtxWO0VsLS
double z() const
z coordinate
MonitorElement * NumberOfTracksVsPUPVtx
edm::EDGetTokenT< LumiScalersCollection > lumiscalersToken_
MonitorElement * NumberEventsOfVsBX
bool runTrackBuildingAnalyzerForSeed
MonitorElement * NumberOfStripClustersVsGoodPVtx
std::vector< MonitorElement * > SeedsVsClusters
MonitorElement * NumberOfPixelClustersVsGoodPVtx
MonitorElement * NumberOfRecHitsPerTrackVsLS
MonitorElement * GoodTracksFractionVsGoodPVtx
MonitorElement * NumberOfRecHitsPerTrackVsGoodPVtx
MonitorElement * NumberOfPixelClustersVsLUMI
std::vector< VertexMonitor * > theVertexMonitor
MonitorElement * NumberOfTracksVsBXlumi
edm::InputTag stripClusterInputTag_
bool doGeneralPropertiesPlots_
TrackBuildingAnalyzer * theTrackBuildingAnalyzer
void setCurrentFolder(const std::string &fullpath)
MonitorElement * book2D(Args &&...args)
virtual void analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup, const reco::Track &track)
edm::EDGetTokenT< TrackCandidateCollection > trackCandidateToken_
MonitorElement * NumberOfMeanLayersPerTrack
StringCutObjectSelector< reco::Track, true > denSelection_
StringCutObjectSelector< reco::Track, true > numSelection_
GenericTriggerEventFlag * genTriggerEventFlag_
MonitorElement * GoodTracksFractionVsBX
edm::InputTag pixelClusterInputTag_
MonitorElement * NumberOfSeeds_lumiFlag
virtual void beginLuminosityBlock(const edm::LuminosityBlock &lumi, const edm::EventSetup &eSetup) override
TrackingMonitor(const edm::ParameterSet &)
edm::ESHandle< TransientTrackingRecHitBuilder > theTTRHBuilder
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
virtual void beginJob(void)
MonitorElement * NumberOfTrackCandidates
virtual void initHisto(DQMStore::IBooker &ibooker, const edm::EventSetup &)
const_iterator end() const
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > pixelClustersToken_
void Reset(std::vector< TH2F > &depth)
edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > stripClustersToken_
void initRun(const edm::Run &run, const edm::EventSetup &setup)
To be called from beginRun() methods.
MonitorElement * NumberOfGoodPVtxVsBX
void setLumiFlag(void)
this ME is meant to be stored for each luminosity section
MonitorElement * NumberEventsOfVsLUMI
void setNumberOfGoodVertices(const edm::Event &)
MonitorElement * NumberOfTracks_lumiFlag
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void Reset(void)
reset ME (ie. contents, errors, etc)
edm::EDGetTokenT< reco::BeamSpot > bsSrcToken_
MonitorElement * NumberOfTracks
size_t tracksSize() const
number of tracks
edm::EDGetTokenT< reco::VertexCollection > pvSrcToken_
MonitorElement * NumberEventsOfVsLS
MonitorElement * NumberOfTracksVsLUMI
std::vector< std::string > ClusterLabels
MonitorElement * NumberOfGoodPVtxWO0VsBX