164 moduleName_(parameters_.getUntrackedParameter<std::
string>(
"moduleName",
"StandaloneTrackMonitor")),
165 folderName_(parameters_.getUntrackedParameter<std::
string>(
"folderName",
"highPurityTracks")),
166 trackTag_(parameters_.getUntrackedParameter<edm::
InputTag>(
"trackInputTag", edm::
InputTag(
"generalTracks"))),
167 bsTag_(parameters_.getUntrackedParameter<edm::
InputTag>(
"offlineBeamSpot", edm::
InputTag(
"offlineBeamSpot"))),
169 parameters_.getUntrackedParameter<edm::
InputTag>(
"vertexTag", edm::
InputTag(
"offlinePrimaryVertices"))),
170 puSummaryTag_(parameters_.getUntrackedParameter<edm::
InputTag>(
"puTag", edm::
InputTag(
"addPileupInfo"))),
171 clusterTag_(parameters_.getUntrackedParameter<edm::
InputTag>(
"clusterTag", edm::
InputTag(
"siStripClusters"))),
176 clusterToken_(consumes<edmNew::DetSetVector<
SiStripCluster> >(clusterTag_)),
177 trackQuality_(parameters_.getUntrackedParameter<std::
string>(
"trackQuality",
"highPurity")),
178 siStripClusterInfo_(consumesCollector()),
179 doPUCorrection_(parameters_.getUntrackedParameter<bool>(
"doPUCorrection",
false)),
180 isMC_(parameters_.getUntrackedParameter<bool>(
"isMC",
false)),
181 haveAllHistograms_(parameters_.getUntrackedParameter<bool>(
"haveAllHistograms",
false)),
183 parameters_.getUntrackedParameter<std::
string>(
"puScaleFactorFile",
"PileupScaleFactor_run203002.root")),
184 verbose_(parameters_.getUntrackedParameter<bool>(
"verbose",
false)),
257 TH1F* h1 =
dynamic_cast<TH1F*
>(f1->Get(
"pileupweight"));
258 for (
int i = 1;
i <= h1->GetNbinsX(); ++
i)
259 vpu_.push_back(h1->GetBinContent(
i));
297 trackPH_ = iBook.
book1D(
"trackP",
"Track 4-momentum", 50, 0.0, 10.0);
301 TrackPtHistoPar.getParameter<int32_t>(
"Xbins"),
302 TrackPtHistoPar.getParameter<
double>(
"Xmin"),
303 TrackPtHistoPar.getParameter<
double>(
"Xmax"));
338 iBook.
book1D(
"pixelLayerwithMeasurement",
"No. of Pixel Layers per Track", 10, 0.0, 10.0);
341 iBook.
book1D(
"stripLayerwithMeasurement",
"No. of Strip Layers per Track", 20, 0.0, 20.0);
362 nPixBarrelH_ = iBook.
book1D(
"nHitPixelBarrel",
"No. of hits in Pixel Barrel per Track", 20, 0, 20.0);
364 nPixEndcapH_ = iBook.
book1D(
"nHitPixelEndcap",
"No. of hits in Pixel Endcap per Track", 20, 0, 20.0);
366 nStripTIBH_ = iBook.
book1D(
"nHitStripTIB",
"No. of hits in Strip TIB per Track", 30, 0, 30.0);
368 nStripTOBH_ = iBook.
book1D(
"nHitStripTOB",
"No. of hits in Strip TOB per Track", 30, 0, 30.0);
370 nStripTECH_ = iBook.
book1D(
"nHitStripTEC",
"No. of hits in Strip TEC per Track", 30, 0, 30.0);
372 nStripTIDH_ = iBook.
book1D(
"nHitStripTID",
"No. of hits in Strip TID per Tracks", 30, 0, 30.0);
375 nTracksH_ = iBook.
book1D(
"nTracks",
"No. of Tracks", 100, -0.5, 999.5);
381 nPUH_ = iBook.
book1D(
"nPU",
"No of Pileup", 60, 0, 60.0);
383 trueNIntH_ = iBook.
book1D(
"trueNInt",
"True no of Interactions", 60, 0, 60.0);
388 "Number of Hits Vs pT",
389 TrackPtHistoPar.getParameter<int32_t>(
"Xbins"),
390 TrackPtHistoPar.getParameter<
double>(
"Xmin"),
391 TrackPtHistoPar.getParameter<
double>(
"Xmax"),
396 nHitsVsnVtxH_ = iBook.
bookProfile(
"nHitsVsnVtx",
"Number of Hits Vs Number of Vertex", 100, 0.0, 50, 0.0, 0.0,
"g");
399 "Number of Hits Vs Eta",
408 iBook.
bookProfile(
"nHitsVsCosTheta",
"Number of Hits Vs Cos(Theta)", 50, -1.0, 1.0, 0.0, 0.0,
"g");
414 "Number of Lost Hits Vs pT",
415 TrackPtHistoPar.getParameter<int32_t>(
"Xbins"),
416 TrackPtHistoPar.getParameter<
double>(
"Xmin"),
417 TrackPtHistoPar.getParameter<
double>(
"Xmax"),
423 "Number of Lost Hits Vs Eta",
432 iBook.
bookProfile(
"nLostHitsVsCosTheta",
"Number of Lost Hits Vs Cos(Theta)", 50, -1.0, 1.0, 0.0, 0.0,
"g");
439 iBook.
book1D(
"hOnTrkClusChargeThin",
"On-track Cluster Charge (Thin Sensor)", 100, 0, 1000);
444 iBook.
book1D(
"hOnTrkClusChargeThick",
"On-track Cluster Charge (Thick Sensor)", 100, 0, 1000);
447 iBook.
book1D(
"hOnTrkClusWidthThick",
"On-track Cluster Width (Thick Sensor)", 20, -0.5, 19.5);
451 iBook.
book1D(
"hOffTrkClusChargeThin",
"Off-track Cluster Charge (Thin Sensor)", 100, 0, 1000);
454 iBook.
book1D(
"hOffTrkClusWidthThin",
"Off-track Cluster Width (Thin Sensor)", 20, -0.5, 19.5);
457 iBook.
book1D(
"hOffTrkClusChargeThick",
"Off-track Cluster Charge (Thick Sensor)", 100, 0, 1000);
460 iBook.
book1D(
"hOffTrkClusWidthThick",
"Off-track Cluster Width (Thick Sensor)", 20, -0.5, 19.5);
486 edm::LogInfo(
"StandaloneTrackMonitor") <<
"nPUColl = " << PupInfo->size();
487 for (
auto const&
v : *PupInfo) {
488 int bx =
v.getBunchCrossing();
494 int ntrueInt =
v.getTrueNumInteractions();
498 if (ntrueInt > -1 && ntrueInt <
int(
vpu_.size()))
499 wfac =
vpu_.at(ntrueInt);
504 edm::LogInfo(
"StandaloneTrackMonitor") <<
"PU reweight factor = " << wfac;
509 int nvtx = (vertexColl.
isValid() ? vertexColl->size() : 0);
515 edm::LogInfo(
"StandaloneTrackMonitor") <<
"Total # of Tracks: " << tracks->size();
517 edm::LogInfo(
"StandaloneTrackMonitor") <<
"Total # of Tracks: " << tracks->size();
519 for (
auto const&
track : *tracks) {
520 if (!
track.quality(quality))
538 int nLostHits =
track.numberOfLostHits();
550 double etaError =
track.etaError();
551 double thetaError =
track.thetaError();
552 double phiError =
track.phiError();
554 double ptError =
track.ptError();
555 double qoverp =
track.qoverp();
556 double qoverpError =
track.qoverpError();
561 double dxy =
track.dxy(beamSpot->position());
562 double dxyError =
track.dxyError();
563 double dz =
track.dz(beamSpot->position());
564 double dzError =
track.dzError();
566 double trkd0 =
track.d0();
569 double vx =
track.vx();
570 double vy =
track.vy();
571 double vz =
track.vz();
613 int nPixBarrel = 0, nPixEndcap = 0, nStripTIB = 0, nStripTOB = 0, nStripTEC = 0, nStripTID = 0;
614 for (
auto it =
track.recHitsBegin(); it !=
track.recHitsEnd(); ++it) {
639 <<
" >>> HITs: nPixBarrel: " << nPixBarrel <<
" nPixEndcap: " << nPixEndcap <<
" nStripTIB: " << nStripTIB
640 <<
" nStripTOB: " << nStripTOB <<
" nStripTEC: " << nStripTEC <<
" nStripTID: " << nStripTID;
667 dsvit != clusterHandle->end();
669 uint32_t detId = dsvit->id();
670 std::map<uint32_t, std::set<const SiStripCluster*> >::iterator jt =
clusterMap_.find(detId);
671 bool detid_found = (jt !=
clusterMap_.end()) ?
true :
false;
676 std::set<const SiStripCluster*>&
s = jt->second;
677 if (s.find(&*clusit) != s.end())
687 if (thickness > 0.035) {
709 auto const& clus = thit.firstClusterRef();
715 if (thit.isMatched()) {
720 if (thickness > 0.035) {
731 if (thickness > 0.035) {
740 auto& cluster = clus.stripCluster();
742 if (thickness > 0.035) {
753 std::map<uint32_t, std::set<const SiStripCluster*> >::iterator it =
clusterMap_.find(detid);
755 std::set<const SiStripCluster*>
s;
757 clusterMap_.insert(std::pair<uint32_t, std::set<const SiStripCluster*> >(detid, s));
759 std::set<const SiStripCluster*>&
s = it->second;
MonitorElement * pixelLayerwithMeasurementH_
const TrackerGeometry * tkGeom_
MonitorElement * hOnTrkClusChargeThickH_
const edm::InputTag trackTag_
static constexpr auto TEC
unsigned long long m_cacheID_
void analyze(edm::Event const &iEvent, edm::EventSetup const &iSetup) override
MonitorElement * hOnTrkClusChargeThinH_
MonitorElement * trackqOverpH_
MonitorElement * nLostHitsVsPhiH_
MonitorElement * trackPtOver10GeVH_
const std::string trackQuality_
void setCluster(const SiStripCluster &cluster, int detId)
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
const edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > clusterToken_
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > geomToken_
MonitorElement * nStripTIDH_
std::vector< float > vpu_
virtual void setCurrentFolder(std::string const &fullpath)
StandaloneTrackMonitor(const edm::ParameterSet &)
const bool haveAllHistograms_
MonitorElement * trackChi2bynDOFH_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
TrackQuality
track quality
MonitorElement * hOffTrkClusWidthThickH_
const edm::EDGetTokenT< reco::TrackCollection > trackToken_
void processClusters(edm::Event const &iEvent, edm::EventSetup const &iSetup, double wfac=1)
#define DEFINE_FWK_MODULE(type)
SiStripCluster const & monoCluster() const
uint32_t const *__restrict__ Quality * quality
const edm::EDGetTokenT< std::vector< PileupSummaryInfo > > puSummaryToken_
std::vector< Track > TrackCollection
collection of Tracks
MonitorElement * beamSpotZposH_
Geom::Theta< T > theta() const
MonitorElement * stripLayerwithMeasurementH_
int numberOfValidStripHits() const
edm::ParameterSet parameters_
const Bounds & bounds() const
auto const & tracks
cannot be loose
data_type const * const_iterator
int pixelLayersWithMeasurement() const
void processHit(const TrackingRecHit &recHit, edm::EventSetup const &iSetup, double wfac=1)
Log< level::Error, false > LogError
std::vector< Vertex > VertexCollection
MonitorElement * hOnTrkClusWidthThinH_
MonitorElement * nStripTECH_
int trackerLayersWithMeasurement() const
const Plane & surface() const
The nominal surface of the GeomDet.
MonitorElement * hOffTrkClusWidthThinH_
const std::string puScaleFactorFile_
MonitorElement * hOffTrkClusChargeThinH_
SiStripClusterInfo siStripClusterInfo_
MonitorElement * trackChi2H_
const edm::InputTag vertexTag_
virtual float thickness() const =0
MonitorElement * nlostHitsH_
bool getData(T &iHolder) const
MonitorElement * beamSpotXYposH_
const bool doPUCorrection_
MonitorElement * nTracksH_
MonitorElement * hOnTrkClusWidthThickH_
MonitorElement * trackqOverperrH_
MonitorElement * nHitsVsEtaH_
MonitorElement * bookProfile(TString const &name, TString const &title, int nchX, double lowX, double highX, int, double lowY, double highY, char const *option="s", FUNC onbooking=NOOP())
MonitorElement * trackThetaerrH_
MonitorElement * bunchCrossingH_
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
MonitorElement * nStripTIBH_
Cos< T >::type cos(const T &t)
MonitorElement * trackPterrH_
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
const edm::InputTag puSummaryTag_
MonitorElement * nvalidStripHitsH_
MonitorElement * trackPhiH_
MonitorElement * vertexXposH_
static constexpr auto TOB
MonitorElement * beamSpotZposerrH_
MonitorElement * nLostHitsVsCosThetaH_
MonitorElement * trackPtH_
MonitorElement * beamSpotXYposerrH_
MonitorElement * trackChargeH_
MonitorElement * hOffTrkClusChargeThickH_
Log< level::Info, false > LogInfo
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
MonitorElement * trackCosThetaH_
const edm::InputTag clusterTag_
MonitorElement * nvalidTrackerHitsH_
MonitorElement * nHitsVsCosThetaH_
void addClusterToMap(uint32_t detid, const SiStripCluster *cluster)
static TrackQuality qualityByName(const std::string &name)
static constexpr auto TIB
const edm::EDGetTokenT< reco::BeamSpot > bsToken_
MonitorElement * trkLayerwithMeasurementH_
MonitorElement * trackd0H_
MonitorElement * trackEtaerrH_
int stripLayersWithMeasurement() const
MonitorElement * trueNIntH_
T getParameter(std::string const &) const
std::map< uint32_t, std::set< const SiStripCluster * > > clusterMap_
const edm::InputTag bsTag_
int numberOfValidTrackerHits() const
MonitorElement * vertexYposH_
SiStripCluster const & stereoCluster() const
void dqmBeginRun(const edm::Run &iRun, const edm::EventSetup &iSetup) override
MonitorElement * trackPH_
const edm::EDGetTokenT< reco::VertexCollection > vertexToken_
MonitorElement * nPixBarrelH_
MonitorElement * nPixEndcapH_
MonitorElement * nHitsVsPhiH_
int numberOfValidPixelHits() const
MonitorElement * nLostHitsVspTH_
MonitorElement * nvalidPixelHitsH_
MonitorElement * tracknDOFH_
MonitorElement * trackPtUpto2GeVH_
DetId geographicalId() const
void initEvent(const edm::EventSetup &iSetup)
MonitorElement * trackEtaH_
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
MonitorElement * nLostHitsVsEtaH_
MonitorElement * nHitsVsnVtxH_
static constexpr auto TID
MonitorElement * nHitsVspTH_
MonitorElement * nVertexH_
MonitorElement * vertexZposH_
MonitorElement * trackPhierrH_
MonitorElement * nStripTOBH_
constexpr Detector det() const
get the detector field from this detid