43 , NumberOfTracks(
NULL)
44 , NumberOfMeanRecHitsPerTrack(
NULL)
45 , NumberOfMeanLayersPerTrack(
NULL)
47 , FractionOfGoodTracks(
NULL)
49 , NumberOfSeeds_lumiFlag(
NULL)
50 , NumberOfTrackCandidates(
NULL)
52 , NumberOfTracksVsLS(
NULL)
54 , GoodTracksFractionVsLS(
NULL)
58 , NumberOfTracksVsGoodPVtx(
NULL)
59 , NumberOfTracksVsBXlumi(
NULL)
61 , NumberOfTracks_lumiFlag(
NULL)
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") )
73 , numSelection_ (conf_.getParameter<std::
string>(
"numCut"))
74 , denSelection_ (conf_.getParameter<std::
string>(
"denCut"))
90 allTrackToken_ = consumes<reco::TrackCollection>(alltrackProducer);
93 seedToken_ = consumes<edm::View<TrajectorySeed> >(seedProducer);
101 if (alltrackProducer.label()==trackProducer.label()) doFractionPlot_ =
false;
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");
120 if (primaryVertexInputTags.size()==pvLabels.size() and primaryVertexInputTags.size()==selPrimaryVertexInputTags.size()) {
122 for (
size_t i=0;
i<primaryVertexInputTags.size();
i++) {
164 edm::LogWarning(
"TrackingMonitor") <<
"Qualty Name is invalid, using no quality criterea by default";
199 StateName !=
"OuterSurface" &&
200 StateName !=
"InnerSurface" &&
201 StateName !=
"ImpactPoint" &&
202 StateName !=
"default" &&
206 edm::LogWarning(
"TrackingMonitor") <<
"State Name is invalid, using 'ImpactPoint' by default";
218 histname =
"NumberOfTracks_" + CategoryName;
224 histname =
"NumberOfMeanRecHitsPerTrack_" + CategoryName;
229 histname =
"NumberOfMeanLayersPerTrack_" + CategoryName;
235 histname =
"FractionOfGoodTracks_" + CategoryName;
246 histname =
"NumberOfTracks_lumiFlag_" + CategoryName;
261 histname =
"NumberOfTracksVsLS_"+ CategoryName;
267 histname =
"NumberOfRecHitsPerTrackVsLS_" + CategoryName;
274 histname =
"GoodTracksFractionVsLS_"+ CategoryName;
298 histname =
"NumberOfTracksVsGoodPVtx";
309 int BXlumiBin = BXlumiParameters.
getParameter<
int>(
"BXlumiBin");
310 double BXlumiMin = BXlumiParameters.
getParameter<
double>(
"BXlumiMin");
311 double BXlumiMax = BXlumiParameters.
getParameter<
double>(
"BXlumiMax");
313 histname =
"NumberOfTracksVsBXlumi_"+ CategoryName;
341 histname =
"NumberOfSeeds_"+ seedProducer.
label() +
"_"+ CategoryName;
346 if ( doSeedLumiAnalysis_ ) {
348 histname =
"NumberOfSeeds_lumiFlag_"+ seedProducer.
label() +
"_"+ CategoryName;
361 std::vector<double> histoMin,histoMax;
362 std::vector<int> histoBin;
372 setMaxMinBin(histoMin,histoMax,histoBin,NClusStrMin,NClusStrMax,NClusStrBin,NClusPxMin,NClusPxMax,NClusPxBin);
377 TKNoSeedBin, TKNoSeedMin, TKNoSeedMax)));
391 histname =
"NumberOfTrackCandidates_"+ tcProducer.
label() +
"_"+ CategoryName;
406 if ( doSeedLumiAnalysis_ )
414 std::vector<double> histoMin,histoMax;
415 std::vector<int> histoBin;
430 NClusStrMin,NClusStrMax,NClusStrBin,
431 NClusPxMin, NClusPxMax, NClusPxBin);
440 histoBin[
i], histoMin[i], histoMax[i],
441 NTrk2DBin,NTrk2DMin,NTrk2DMax
445 title =
"# of Clusters in (Pixel+Strip) Detectors";
496 int numberOfTracks_den = 0;
499 if (allTrackHandle.
isValid()) {
501 for (reco::TrackCollection::const_iterator track = allTrackHandle->begin();
502 track!=allTrackHandle->end(); ++track) {
504 numberOfTracks_den++;
510 int numberOfTracks = trackHandle->size();
511 int numberOfTracks_num = 0;
515 int totalRecHits = 0, totalLayers = 0;
517 for (reco::TrackCollection::const_iterator track = trackCollection.begin();
518 track!=trackCollection.end(); ++track) {
521 numberOfTracks_num++;
526 totalRecHits += track->numberOfValidHits();
527 totalLayers += track->hitPattern().trackerLayersWithMeasurement();
535 if (numberOfTracks_den > 0) frac =
static_cast<double>(numberOfTracks_num)/static_cast<double>(numberOfTracks_den);
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);
586 for( TrackCandidateCollection::const_iterator cand = theTCCollection.begin(); cand != theTCCollection.end(); ++cand) {
591 edm::LogWarning(
"TrackingMonitor") <<
"No Track Candidates in the event. Not filling associated histograms";
615 std::vector<int> NClus;
635 for(
size_t i=0;
i < seedHandle->size(); ++
i) {
643 edm::LogWarning(
"TrackingMonitor") <<
"No Trajectory seeds in the event. Not filling associated histograms";
650 std::vector<int> NClus;
665 size_t totalNumGoodPV = 0;
670 for (reco::VertexCollection::const_iterator
pv = pvHandle->begin();
671 pv != pvHandle->end(); ++
pv) {
674 if (
pv->isFake() ||
pv->tracksSize()==0)
continue;
677 if (
pv->ndof() < 4. ||
pv->z() > 24.)
continue;
701 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)
713 arrayMin[
i]=smin; arrayMax[
i]=smax; arrayBin[
i]=sbin;}
723 int ncluster_strip=-1;
731 ncluster_pix = (*pixel_clusters).dataSize();
732 ncluster_strip = (*strip_clusters).dataSize();
742 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)
TrackAnalyzer * theTrackAnalyzer
virtual void setNclus(const edm::Event &, std::vector< int > &)
edm::EDGetTokenT< reco::TrackCollection > allTrackToken_
MonitorElement * bookProfile(Args &&...args)
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
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 * NumberOfMeanRecHitsPerTrack
MonitorElement * NumberOfTracksVsGoodPVtx
LuminosityBlockNumber_t luminosityBlock() const
MonitorElement * GoodTracksFractionVsLS
double getValue(const edm::Event &)
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)
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.
virtual void initHisto(DQMStore::IBooker &ibooker)
MonitorElement * book1D(Args &&...args)
MonitorElement * NumberOfTracksVsLS
bool runTrackBuildingAnalyzerForSeed
std::vector< MonitorElement * > SeedsVsClusters
MonitorElement * NumberOfRecHitsPerTrackVsLS
virtual void endRun(const edm::Run &, const edm::EventSetup &)
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_
virtual void initHisto(DQMStore::IBooker &ibooker)
GenericTriggerEventFlag * genTriggerEventFlag_
edm::InputTag pixelClusterInputTag_
MonitorElement * NumberOfSeeds_lumiFlag
TrackingMonitor(const edm::ParameterSet &)
edm::ESHandle< TransientTrackingRecHitBuilder > theTTRHBuilder
virtual void beginJob(void)
MonitorElement * NumberOfTrackCandidates
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.
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)
void Reset(void)
reset ME (ie. contents, errors, etc)
edm::EDGetTokenT< reco::BeamSpot > bsSrcToken_
MonitorElement * NumberOfTracks
edm::EDGetTokenT< reco::VertexCollection > pvSrcToken_
virtual void beginLuminosityBlock(const edm::LuminosityBlock &lumi, const edm::EventSetup &eSetup)
std::vector< std::string > ClusterLabels