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 , NumberEventsOfVsLUMI(
NULL)
75 , NumberOfTracksVsLUMI(
NULL)
76 , GoodTracksFractionVsLUMI(
NULL)
77 , NumberOfRecHitsPerTrackVsLUMI(
NULL)
78 , NumberOfGoodPVtxVsLUMI(
NULL)
79 , NumberOfGoodPVtxWO0VsLUMI(
NULL)
80 , NumberOfTracks_lumiFlag(
NULL)
83 , builderName ( conf_.getParameter<std::
string>(
"TTRHBuilder"))
84 , doTrackerSpecific_ ( conf_.getParameter<bool>(
"doTrackerSpecific") )
85 , doLumiAnalysis ( conf_.getParameter<bool>(
"doLumiAnalysis"))
86 , doProfilesVsLS_ ( conf_.getParameter<bool>(
"doProfilesVsLS"))
87 , doAllPlots ( conf_.getParameter<bool>(
"doAllPlots"))
88 , doGeneralPropertiesPlots_( conf_.getParameter<bool>(
"doGeneralPropertiesPlots"))
89 , doHitPropertiesPlots_ ( conf_.getParameter<bool>(
"doHitPropertiesPlots"))
90 , doPUmonitoring_ ( conf_.getParameter<bool>(
"doPUmonitoring") )
92 , numSelection_ (conf_.getParameter<std::
string>(
"numCut"))
93 , denSelection_ (conf_.getParameter<std::
string>(
"denCut"))
94 , pvNDOF_ ( conf_.getParameter<int> (
"pvNDOF") )
112 allTrackToken_ = consumes<reco::TrackCollection>(alltrackProducer);
115 seedToken_ = consumes<edm::View<TrajectorySeed> >(seedProducer);
123 if (alltrackProducer.
label()==trackProducer.label()) doFractionPlot_ =
false;
130 if ( doPlotsVsBXlumi_ )
138 std::vector<edm::InputTag> primaryVertexInputTags =
conf_.
getParameter<std::vector<edm::InputTag> >(
"primaryVertexInputTags");
139 std::vector<edm::InputTag> selPrimaryVertexInputTags =
conf_.
getParameter<std::vector<edm::InputTag> >(
"selPrimaryVertexInputTags");
140 std::vector<std::string> pvLabels =
conf_.
getParameter<std::vector<std::string> > (
"pvLabels");
142 if (primaryVertexInputTags.size()==pvLabels.size() and primaryVertexInputTags.size()==selPrimaryVertexInputTags.size()) {
143 for (
size_t i=0;
i<primaryVertexInputTags.size();
i++) {
185 edm::LogWarning(
"TrackingMonitor") <<
"Qualty Name is invalid, using no quality criterea by default";
220 StateName !=
"OuterSurface" &&
221 StateName !=
"InnerSurface" &&
222 StateName !=
"ImpactPoint" &&
223 StateName !=
"default" &&
227 edm::LogWarning(
"TrackingMonitor") <<
"State Name is invalid, using 'ImpactPoint' by default";
239 histname =
"NumberOfTracks_" + CategoryName;
245 histname =
"NumberOfMeanRecHitsPerTrack_" + CategoryName;
250 histname =
"NumberOfMeanLayersPerTrack_" + CategoryName;
256 histname =
"FractionOfGoodTracks_" + CategoryName;
267 histname =
"NumberOfTracks_lumiFlag_" + CategoryName;
282 histname =
"NumberOfTracksVsLS_"+ CategoryName;
288 histname =
"NumberOfRecHitsPerTrackVsLS_" + CategoryName;
294 histname =
"NumberEventsVsLS_" + CategoryName;
303 histname =
"NumberOfGoodPVtxVsLS_" + CategoryName;
309 histname =
"NumberOfGoodPVtxWO0VsLS_" + CategoryName;
316 histname =
"GoodTracksFractionVsLS_"+ CategoryName;
325 int BXBin = 3564;
double BXMin = 0.5;
double BXMax = 3564.5;
327 histname =
"NumberEventsVsBX_" + CategoryName;
333 histname =
"NumberOfTracksVsBX_"+ CategoryName;
339 histname =
"NumberOfRecHitsPerTrackVsBX_" + CategoryName;
345 histname =
"NumberOfGoodPVtxVsBX_" + CategoryName;
351 histname =
"NumberOfGoodPVtxWO0VsBX_" + CategoryName;
358 histname =
"GoodTracksFractionVsBX_"+ CategoryName;
384 histname =
"NumberOfTracksVsGoodPVtx";
390 histname =
"NumberOfTracksVsPUPVtx";
396 histname =
"NumberEventsVsGoodPVtx";
403 histname =
"GoodTracksFractionVsGoodPVtx";
410 histname =
"NumberOfRecHitsPerTrackVsGoodPVtx";
416 histname =
"NumberOfPVtxVsGoodPVtx";
436 histname =
"NumberOfTracksVsLUMI";
443 histname =
"GoodTracksFractionVsLUMI";
450 histname =
"NumberOfRecHitsPerTrackVsLUMI";
459 histname =
"NumberOfGoodPVtxVsLUMI";
465 histname =
"NumberOfGoodPVtxWO0VsLUMI";
477 int BXlumiBin = BXlumiParameters.
getParameter<
int>(
"BXlumiBin");
478 double BXlumiMin = BXlumiParameters.
getParameter<
double>(
"BXlumiMin");
479 double BXlumiMax = BXlumiParameters.
getParameter<
double>(
"BXlumiMax");
481 histname =
"NumberOfTracksVsBXlumi_"+ CategoryName;
509 histname =
"NumberOfSeeds_"+ seedProducer.
label() +
"_"+ CategoryName;
514 if ( doSeedLumiAnalysis_ ) {
516 histname =
"NumberOfSeeds_lumiFlag_"+ seedProducer.
label() +
"_"+ CategoryName;
529 std::vector<double> histoMin,histoMax;
530 std::vector<int> histoBin;
540 setMaxMinBin(histoMin,histoMax,histoBin,NClusStrMin,NClusStrMax,NClusStrBin,NClusPxMin,NClusPxMax,NClusPxBin);
545 TKNoSeedBin, TKNoSeedMin, TKNoSeedMax)));
560 histname =
"NumberOfTrackCandidates_"+ tcProducer.
label() +
"_"+ CategoryName;
575 if ( doSeedLumiAnalysis_ )
583 std::vector<double> histoMin,histoMax;
584 std::vector<int> histoBin;
599 NClusStrMin,NClusStrMax,NClusStrBin,
600 NClusPxMin, NClusPxMax, NClusPxBin);
609 histoBin[
i], histoMin[i], histoMax[i],
610 NTrk2DBin,NTrk2DMin,NTrk2DMax
614 title =
"# of Clusters in (Pixel+Strip) Detectors";
660 if ( lumiScalers.
isValid() && lumiScalers->size() ) {
661 LumiScalersCollection::const_iterator scalit = lumiScalers->begin();
662 lumi = scalit->instantLumi();
681 int numberOfTracks_den = 0;
684 if (allTrackHandle.
isValid()) {
685 for (reco::TrackCollection::const_iterator track = allTrackHandle->begin();
686 track!=allTrackHandle->end(); ++track) {
688 numberOfTracks_den++;
696 pv0 = &pvHandle->front();
700 || pv0->
ndof() <
pvNDOF_ || pv0->
z() > 24.) pv0 =
nullptr;
706 int numberOfTracks = trackHandle->size();
707 int numberOfTracks_num = 0;
708 int numberOfTracks_pv0 = 0;
712 int totalRecHits = 0, totalLayers = 0;
717 for (reco::TrackCollection::const_iterator track = trackCollection.begin();
718 track!=trackCollection.end(); ++track) {
723 numberOfTracks_num++;
733 totalRecHits += track->numberOfValidHits();
734 totalLayers += track->hitPattern().trackerLayersWithMeasurement();
742 if (numberOfTracks_den > 0) frac =
static_cast<double>(numberOfTracks_num)/static_cast<double>(numberOfTracks_den);
760 if( numberOfTracks > 0 ) {
761 double meanRecHits =
static_cast<double>(totalRecHits) / static_cast<double>(numberOfTracks);
762 double meanLayers =
static_cast<double>(totalLayers) / static_cast<double>(numberOfTracks);
806 for( TrackCandidateCollection::const_iterator cand = theTCCollection.begin(); cand != theTCCollection.end(); ++cand) {
811 edm::LogWarning(
"TrackingMonitor") <<
"No Track Candidates in the event. Not filling associated histograms";
835 std::vector<int> NClus;
855 for(
size_t i=0;
i < seedHandle->size(); ++
i) {
863 edm::LogWarning(
"TrackingMonitor") <<
"No Trajectory seeds in the event. Not filling associated histograms";
870 std::vector<int> NClus;
885 size_t totalNumGoodPV = 0;
888 for (reco::VertexCollection::const_iterator
pv = pvHandle->begin();
889 pv != pvHandle->end(); ++
pv) {
892 if (
pv->isFake() ||
pv->tracksSize()==0)
continue;
895 if (
pv->ndof() <
pvNDOF_ ||
pv->z() > 24.)
continue;
901 if (totalNumGoodPV>1)
NumberOfTracksVsPUPVtx->
Fill( totalNumGoodPV-1,
double(numberOfTracks-numberOfTracks_pv0)/
double(totalNumGoodPV-1) );
904 for (reco::TrackCollection::const_iterator track = trackCollection.begin();
905 track!=trackCollection.end(); ++track) {
942 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)
954 arrayMin[
i]=smin; arrayMax[
i]=smax; arrayBin[
i]=sbin;}
964 int ncluster_strip=-1;
972 ncluster_pix = (*pixel_clusters).dataSize();
973 ncluster_strip = (*strip_clusters).dataSize();
983 arrayNclus[
i]=ncluster_strip ;}
T getParameter(std::string const &) const
edm::EDGetTokenT< edm::View< TrajectorySeed > > seedToken_
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 > &)
edm::EDGetTokenT< reco::TrackCollection > allTrackToken_
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
std::vector< Track > TrackCollection
collection of Tracks
int bunchCrossing() const
MonitorElement * GoodTracksFractionVsLUMI
virtual void analyze(const edm::Event &, const edm::EventSetup &)
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
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
MonitorElement * NumberOfGoodPVtxVsLS
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)
MonitorElement * NumberOfTracksVsLS
Abs< T >::type abs(const T &t)
MonitorElement * NumberOfGoodPVtxWO0VsLS
double z() const
y coordinate
MonitorElement * NumberOfTracksVsPUPVtx
edm::EDGetTokenT< LumiScalersCollection > lumiscalersToken_
MonitorElement * NumberEventsOfVsBX
bool runTrackBuildingAnalyzerForSeed
std::vector< MonitorElement * > SeedsVsClusters
MonitorElement * NumberOfRecHitsPerTrackVsLS
MonitorElement * GoodTracksFractionVsGoodPVtx
virtual void endRun(const edm::Run &, const edm::EventSetup &)
MonitorElement * NumberOfRecHitsPerTrackVsGoodPVtx
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< reco::TrackCollection > trackToken_
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
TrackingMonitor(const edm::ParameterSet &)
edm::ESHandle< TransientTrackingRecHitBuilder > theTTRHBuilder
virtual void beginJob(void)
MonitorElement * NumberOfTrackCandidates
virtual void initHisto(DQMStore::IBooker &ibooker, const edm::EventSetup &)
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
virtual void beginLuminosityBlock(const edm::LuminosityBlock &lumi, const edm::EventSetup &eSetup)
std::vector< std::string > ClusterLabels
MonitorElement * NumberOfGoodPVtxWO0VsBX