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 , NumberOfTracksVsPUPVtx(
NULL)
60 , NumberOfTracksVsBXlumi(
NULL)
62 , NumberOfTracks_lumiFlag(
NULL)
65 , builderName ( conf_.getParameter<std::
string>(
"TTRHBuilder"))
66 , doTrackerSpecific_ ( conf_.getParameter<bool>(
"doTrackerSpecific") )
67 , doLumiAnalysis ( conf_.getParameter<bool>(
"doLumiAnalysis"))
68 , doProfilesVsLS_ ( conf_.getParameter<bool>(
"doProfilesVsLS"))
69 , doAllPlots ( conf_.getParameter<bool>(
"doAllPlots"))
70 , doGeneralPropertiesPlots_( conf_.getParameter<bool>(
"doGeneralPropertiesPlots"))
71 , doHitPropertiesPlots_ ( conf_.getParameter<bool>(
"doHitPropertiesPlots"))
72 , doPUmonitoring_ ( conf_.getParameter<bool>(
"doPUmonitoring") )
74 , numSelection_ (conf_.getParameter<std::
string>(
"numCut"))
75 , denSelection_ (conf_.getParameter<std::
string>(
"denCut"))
91 allTrackToken_ = consumes<reco::TrackCollection>(alltrackProducer);
94 seedToken_ = consumes<edm::View<TrajectorySeed> >(seedProducer);
102 if (alltrackProducer.label()==trackProducer.label()) doFractionPlot_ =
false;
109 if ( doPlotsVsBXlumi_ )
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";
304 histname =
"NumberOfTracksVsPUPVtx";
316 int BXlumiBin = BXlumiParameters.
getParameter<
int>(
"BXlumiBin");
317 double BXlumiMin = BXlumiParameters.
getParameter<
double>(
"BXlumiMin");
318 double BXlumiMax = BXlumiParameters.
getParameter<
double>(
"BXlumiMax");
320 histname =
"NumberOfTracksVsBXlumi_"+ CategoryName;
348 histname =
"NumberOfSeeds_"+ seedProducer.
label() +
"_"+ CategoryName;
353 if ( doSeedLumiAnalysis_ ) {
355 histname =
"NumberOfSeeds_lumiFlag_"+ seedProducer.
label() +
"_"+ CategoryName;
368 std::vector<double> histoMin,histoMax;
369 std::vector<int> histoBin;
379 setMaxMinBin(histoMin,histoMax,histoBin,NClusStrMin,NClusStrMax,NClusStrBin,NClusPxMin,NClusPxMax,NClusPxBin);
384 TKNoSeedBin, TKNoSeedMin, TKNoSeedMax)));
398 histname =
"NumberOfTrackCandidates_"+ tcProducer.
label() +
"_"+ CategoryName;
413 if ( doSeedLumiAnalysis_ )
421 std::vector<double> histoMin,histoMax;
422 std::vector<int> histoBin;
437 NClusStrMin,NClusStrMax,NClusStrBin,
438 NClusPxMin, NClusPxMax, NClusPxBin);
447 histoBin[
i], histoMin[i], histoMax[i],
448 NTrk2DBin,NTrk2DMin,NTrk2DMax
452 title =
"# of Clusters in (Pixel+Strip) Detectors";
503 int numberOfTracks_den = 0;
506 if (allTrackHandle.
isValid()) {
508 for (reco::TrackCollection::const_iterator track = allTrackHandle->begin();
509 track!=allTrackHandle->end(); ++track) {
511 numberOfTracks_den++;
519 pv0 = &pvHandle->front();
523 || pv0->
ndof() < 4. || pv0->
z() > 24.) pv0 =
nullptr;
529 int numberOfTracks = trackHandle->size();
530 int numberOfTracks_num = 0;
531 int numberOfTracks_pv0 = 0;
535 int totalRecHits = 0, totalLayers = 0;
537 for (reco::TrackCollection::const_iterator track = trackCollection.begin();
538 track!=trackCollection.end(); ++track) {
541 numberOfTracks_num++;
548 totalRecHits += track->numberOfValidHits();
549 totalLayers += track->hitPattern().trackerLayersWithMeasurement();
557 if (numberOfTracks_den > 0) frac =
static_cast<double>(numberOfTracks_num)/static_cast<double>(numberOfTracks_den);
564 if( numberOfTracks > 0 ) {
565 double meanRecHits =
static_cast<double>(totalRecHits) / static_cast<double>(numberOfTracks);
566 double meanLayers =
static_cast<double>(totalLayers) / static_cast<double>(numberOfTracks);
608 for( TrackCandidateCollection::const_iterator cand = theTCCollection.begin(); cand != theTCCollection.end(); ++cand) {
613 edm::LogWarning(
"TrackingMonitor") <<
"No Track Candidates in the event. Not filling associated histograms";
637 std::vector<int> NClus;
657 for(
size_t i=0;
i < seedHandle->size(); ++
i) {
665 edm::LogWarning(
"TrackingMonitor") <<
"No Trajectory seeds in the event. Not filling associated histograms";
672 std::vector<int> NClus;
687 size_t totalNumGoodPV = 0;
690 for (reco::VertexCollection::const_iterator
pv = pvHandle->begin();
691 pv != pvHandle->end(); ++
pv) {
694 if (
pv->isFake() ||
pv->tracksSize()==0)
continue;
697 if (
pv->ndof() < 4. ||
pv->z() > 24.)
continue;
702 if (totalNumGoodPV>1)
NumberOfTracksVsPUPVtx->
Fill( totalNumGoodPV-1,
double(numberOfTracks-numberOfTracks_pv0)/
double(totalNumGoodPV-1) );
722 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)
734 arrayMin[
i]=smin; arrayMax[
i]=smax; arrayBin[
i]=sbin;}
744 int ncluster_strip=-1;
752 ncluster_pix = (*pixel_clusters).dataSize();
753 ncluster_strip = (*strip_clusters).dataSize();
763 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
void compare(std::vector< std::string > const &old_files, std::string const &old_process, std::vector< std::string > const &new_files, std::string const &new_process, unsigned int max_events, bool ignore_prescales, int verbose)
#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
const Point & position() const
position
MonitorElement * GoodTracksFractionVsLS
MonitorElement * NumberOfTracksVsPUPVtx
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
Abs< T >::type abs(const T &t)
double z() const
y coordinate
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
size_t tracksSize() const
number of tracks
edm::EDGetTokenT< reco::VertexCollection > pvSrcToken_
virtual void beginLuminosityBlock(const edm::LuminosityBlock &lumi, const edm::EventSetup &eSetup)
std::vector< std::string > ClusterLabels