44 , NumberOfTracks(
NULL)
45 , NumberOfMeanRecHitsPerTrack(
NULL)
46 , NumberOfMeanLayersPerTrack(
NULL)
48 , FractionOfGoodTracks(
NULL)
50 , NumberOfSeeds_lumiFlag(
NULL)
51 , NumberOfTrackCandidates(
NULL)
53 , NumberOfTracksVsLS(
NULL)
55 , GoodTracksFractionVsLS(
NULL)
59 , NumberOfTracksVsGoodPVtx(
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") )
89 allTrackToken_ = consumes<reco::TrackCollection>(alltrackProducer);
90 trackToken_ = consumes<reco::TrackCollection>(trackProducer);
92 seedToken_ = consumes<edm::View<TrajectorySeed> >(seedProducer);
100 if (alltrackProducer.label()==trackProducer.label()) doFractionPlot_ =
false;
115 std::vector<edm::InputTag> primaryVertexInputTags =
conf_.
getParameter<std::vector<edm::InputTag> >(
"primaryVertexInputTags");
116 std::vector<edm::InputTag> selPrimaryVertexInputTags =
conf_.
getParameter<std::vector<edm::InputTag> >(
"selPrimaryVertexInputTags");
117 std::vector<std::string> pvLabels =
conf_.
getParameter<std::vector<std::string> > (
"pvLabels");
119 if (primaryVertexInputTags.size()==pvLabels.size() and primaryVertexInputTags.size()==selPrimaryVertexInputTags.size()) {
121 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";
484 int numberOfAllTracks = 0;
487 if (allTrackHandle.
isValid()) {
488 numberOfAllTracks = allTrackHandle->size();
493 int numberOfTracks = trackHandle->size();
497 int totalRecHits = 0, totalLayers = 0;
499 for (reco::TrackCollection::const_iterator track = trackCollection.begin();
500 track!=trackCollection.end(); ++track) {
505 totalRecHits += track->numberOfValidHits();
506 totalLayers += track->hitPattern().trackerLayersWithMeasurement();
513 if (numberOfAllTracks > 0) frac =
static_cast<double>(numberOfTracks)/static_cast<double>(numberOfAllTracks);
520 if( numberOfTracks > 0 ) {
521 double meanRecHits =
static_cast<double>(totalRecHits) / static_cast<double>(numberOfTracks);
522 double meanLayers =
static_cast<double>(totalLayers) / static_cast<double>(numberOfTracks);
564 for( TrackCandidateCollection::const_iterator cand = theTCCollection.begin(); cand != theTCCollection.end(); ++cand) {
569 edm::LogWarning(
"TrackingMonitor") <<
"No Track Candidates in the event. Not filling associated histograms";
593 std::vector<int> NClus;
613 for(
size_t i=0;
i < seedHandle->size(); ++
i) {
621 edm::LogWarning(
"TrackingMonitor") <<
"No Trajectory seeds in the event. Not filling associated histograms";
628 std::vector<int> NClus;
643 size_t totalNumGoodPV = 0;
648 for (reco::VertexCollection::const_iterator pv = pvHandle->begin();
649 pv != pvHandle->end(); ++pv) {
652 if (pv->isFake() || pv->tracksSize()==0)
continue;
655 if (pv->ndof() < 4. || pv->z() > 24.)
continue;
683 if(outputMEsInRootFile)
690 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)
702 arrayMin[
i]=smin; arrayMax[
i]=smax; arrayBin[
i]=sbin;}
712 int ncluster_strip=-1;
720 ncluster_pix = (*pixel_clusters).dataSize();
721 ncluster_strip = (*strip_clusters).dataSize();
731 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
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
virtual void setNclus(const edm::Event &, std::vector< int > &)
edm::EDGetTokenT< reco::TrackCollection > allTrackToken_
GetLumi * theLumiDetails_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
std::vector< TrackCandidate > TrackCandidateCollection
virtual void beginRun(const edm::Run &, const edm::EventSetup &)
std::vector< Track > TrackCollection
collection of Tracks
void doReset(DQMStore *dqmStore_)
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.
virtual void endJob(void)
bool accept(const edm::Event &event, const edm::EventSetup &setup)
To be called from analyze/filter() methods.
MonitorElement * NumberOfTracksVsLS
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", const uint32_t run=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
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_
virtual void beginRun(DQMStore *dqmStore_)
bool doGeneralPropertiesPlots_
TrackBuildingAnalyzer * theTrackBuildingAnalyzer
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
virtual void beginRun(DQMStore *dqmStore_)
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 showDirStructure(void) const
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 * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
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_
void setCurrentFolder(const std::string &fullpath)
MonitorElement * NumberOfTracks
edm::EDGetTokenT< reco::VertexCollection > pvSrcToken_
virtual void beginLuminosityBlock(const edm::LuminosityBlock &lumi, const edm::EventSetup &eSetup)
std::vector< std::string > ClusterLabels