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") )
74 , numSelection_ (conf_.getParameter<std::
string>(
"numCut"))
75 , denSelection_ (conf_.getParameter<std::
string>(
"denCut"))
91 allTrackToken_ = consumes<reco::TrackCollection>(alltrackProducer);
92 trackToken_ = consumes<reco::TrackCollection>(trackProducer);
94 seedToken_ = consumes<edm::View<TrajectorySeed> >(seedProducer);
102 if (alltrackProducer.label()==trackProducer.label()) doFractionPlot_ =
false;
117 std::vector<edm::InputTag> primaryVertexInputTags =
conf_.
getParameter<std::vector<edm::InputTag> >(
"primaryVertexInputTags");
118 std::vector<edm::InputTag> selPrimaryVertexInputTags =
conf_.
getParameter<std::vector<edm::InputTag> >(
"selPrimaryVertexInputTags");
119 std::vector<std::string> pvLabels =
conf_.
getParameter<std::vector<std::string> > (
"pvLabels");
121 if (primaryVertexInputTags.size()==pvLabels.size() and primaryVertexInputTags.size()==selPrimaryVertexInputTags.size()) {
123 for (
size_t i=0;
i<primaryVertexInputTags.size();
i++) {
165 edm::LogWarning(
"TrackingMonitor") <<
"Qualty Name is invalid, using no quality criterea by default";
200 StateName !=
"OuterSurface" &&
201 StateName !=
"InnerSurface" &&
202 StateName !=
"ImpactPoint" &&
203 StateName !=
"default" &&
207 edm::LogWarning(
"TrackingMonitor") <<
"State Name is invalid, using 'ImpactPoint' by default";
219 histname =
"NumberOfTracks_" + CategoryName;
225 histname =
"NumberOfMeanRecHitsPerTrack_" + CategoryName;
230 histname =
"NumberOfMeanLayersPerTrack_" + CategoryName;
236 histname =
"FractionOfGoodTracks_" + CategoryName;
247 histname =
"NumberOfTracks_lumiFlag_" + CategoryName;
262 histname =
"NumberOfTracksVsLS_"+ CategoryName;
268 histname =
"NumberOfRecHitsPerTrackVsLS_" + CategoryName;
275 histname =
"GoodTracksFractionVsLS_"+ CategoryName;
299 histname =
"NumberOfTracksVsGoodPVtx";
310 int BXlumiBin = BXlumiParameters.
getParameter<
int>(
"BXlumiBin");
311 double BXlumiMin = BXlumiParameters.
getParameter<
double>(
"BXlumiMin");
312 double BXlumiMax = BXlumiParameters.
getParameter<
double>(
"BXlumiMax");
314 histname =
"NumberOfTracksVsBXlumi_"+ CategoryName;
342 histname =
"NumberOfSeeds_"+ seedProducer.
label() +
"_"+ CategoryName;
347 if ( doSeedLumiAnalysis_ ) {
349 histname =
"NumberOfSeeds_lumiFlag_"+ seedProducer.
label() +
"_"+ CategoryName;
362 std::vector<double> histoMin,histoMax;
363 std::vector<int> histoBin;
373 setMaxMinBin(histoMin,histoMax,histoBin,NClusStrMin,NClusStrMax,NClusStrBin,NClusPxMin,NClusPxMax,NClusPxBin);
378 TKNoSeedBin, TKNoSeedMin, TKNoSeedMax)));
392 histname =
"NumberOfTrackCandidates_"+ tcProducer.
label() +
"_"+ CategoryName;
407 if ( doSeedLumiAnalysis_ )
415 std::vector<double> histoMin,histoMax;
416 std::vector<int> histoBin;
431 NClusStrMin,NClusStrMax,NClusStrBin,
432 NClusPxMin, NClusPxMax, NClusPxBin);
441 histoBin[
i], histoMin[i], histoMax[i],
442 NTrk2DBin,NTrk2DMin,NTrk2DMax
446 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;
705 if(outputMEsInRootFile)
712 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)
724 arrayMin[
i]=smin; arrayMax[
i]=smax; arrayBin[
i]=sbin;}
734 int ncluster_strip=-1;
742 ncluster_pix = (*pixel_clusters).dataSize();
743 ncluster_strip = (*strip_clusters).dataSize();
753 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.
virtual void endJob(void)
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
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", const uint32_t run=0, const uint32_t lumi=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE", const bool resetMEsAfterWriting=false)
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 * 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