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;
538 for (reco::TrackCollection::const_iterator track = trackCollection.begin();
539 track!=trackCollection.end(); ++track) {
542 numberOfTracks_num++;
549 totalRecHits += track->numberOfValidHits();
550 totalLayers += track->hitPattern().trackerLayersWithMeasurement();
558 if (numberOfTracks_den > 0) frac =
static_cast<double>(numberOfTracks_num)/static_cast<double>(numberOfTracks_den);
565 if( numberOfTracks > 0 ) {
566 double meanRecHits =
static_cast<double>(totalRecHits) / static_cast<double>(numberOfTracks);
567 double meanLayers =
static_cast<double>(totalLayers) / static_cast<double>(numberOfTracks);
609 for( TrackCandidateCollection::const_iterator cand = theTCCollection.begin(); cand != theTCCollection.end(); ++cand) {
614 edm::LogWarning(
"TrackingMonitor") <<
"No Track Candidates in the event. Not filling associated histograms";
638 std::vector<int> NClus;
658 for(
size_t i=0;
i < seedHandle->size(); ++
i) {
666 edm::LogWarning(
"TrackingMonitor") <<
"No Trajectory seeds in the event. Not filling associated histograms";
673 std::vector<int> NClus;
688 size_t totalNumGoodPV = 0;
691 for (reco::VertexCollection::const_iterator
pv = pvHandle->begin();
692 pv != pvHandle->end(); ++
pv) {
695 if (
pv->isFake() ||
pv->tracksSize()==0)
continue;
698 if (
pv->ndof() < 4. ||
pv->z() > 24.)
continue;
703 if (totalNumGoodPV>1)
NumberOfTracksVsPUPVtx->
Fill( totalNumGoodPV-1,
double(numberOfTracks-numberOfTracks_pv0)/
double(totalNumGoodPV-1) );
723 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)
735 arrayMin[
i]=smin; arrayMax[
i]=smax; arrayBin[
i]=sbin;}
745 int ncluster_strip=-1;
753 ncluster_pix = (*pixel_clusters).dataSize();
754 ncluster_strip = (*strip_clusters).dataSize();
764 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
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
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, int quiet)
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_
GenericTriggerEventFlag * genTriggerEventFlag_
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.
void setLumiFlag(void)
this ME is meant to be stored for each luminosity section
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_
virtual void beginLuminosityBlock(const edm::LuminosityBlock &lumi, const edm::EventSetup &eSetup)
std::vector< std::string > ClusterLabels