28 moduleName_(parameters_.getUntrackedParameter<std::
string>(
"moduleName",
"StandaloneTrackMonitor")),
29 folderName_(parameters_.getUntrackedParameter<std::
string>(
"folderName",
"highPurityTracks")),
30 trackTag_(parameters_.getUntrackedParameter<edm::
InputTag>(
"trackInputTag", edm::
InputTag(
"generalTracks"))),
31 bsTag_(parameters_.getUntrackedParameter<edm::
InputTag>(
"offlineBeamSpot", edm::
InputTag(
"offlineBeamSpot"))),
32 vertexTag_(parameters_.getUntrackedParameter<edm::
InputTag>(
"vertexTag", edm::
InputTag(
"offlinePrimaryVertices"))),
33 puSummaryTag_(parameters_.getUntrackedParameter<edm::
InputTag>(
"puTag", edm::
InputTag(
"addPileupInfo"))),
34 clusterTag_(parameters_.getUntrackedParameter<edm::
InputTag>(
"clusterTag", edm::
InputTag(
"siStripClusters"))),
39 clusterToken_(consumes<edmNew::DetSetVector<
SiStripCluster> >(clusterTag_)),
40 trackQuality_(parameters_.getUntrackedParameter<std::
string>(
"trackQuality",
"highPurity")),
41 doPUCorrection_(parameters_.getUntrackedParameter<bool>(
"doPUCorrection",
false)),
42 isMC_(parameters_.getUntrackedParameter<bool>(
"isMC",
false)),
43 haveAllHistograms_(parameters_.getUntrackedParameter<bool>(
"haveAllHistograms",
false)),
44 puScaleFactorFile_(parameters_.getUntrackedParameter<std::
string>(
"puScaleFactorFile",
"PileupScaleFactor_run203002.root")),
45 verbose_(parameters_.getUntrackedParameter<bool>(
"verbose",
false))
118 TH1F* h1 =
dynamic_cast<TH1F*
>(f1->Get(
"pileupweight"));
119 for (
int i = 1;
i <= h1->GetNbinsX(); ++
i)
vpu_.push_back(h1->GetBinContent(
i));
146 TrackPtHistoPar.getParameter<int32_t>(
"Xbins"),
147 TrackPtHistoPar.getParameter<
double>(
"Xmin"),
148 TrackPtHistoPar.getParameter<
double>(
"Xmax"));
183 nPixBarrelH_ = iBook.
book1D(
"nHitPixelBarrel",
"No. of hits in Pixel Barrel per Track", 20, 0, 20.0);
185 nPixEndcapH_ = iBook.
book1D(
"nHitPixelEndcap",
"No. of hits in Pixel Endcap per Track", 20, 0, 20.0);
187 nStripTIBH_ = iBook.
book1D(
"nHitStripTIB",
"No. of hits in Strip TIB per Track", 30, 0, 30.0);
189 nStripTOBH_ = iBook.
book1D(
"nHitStripTOB",
"No. of hits in Strip TOB per Track", 30, 0, 30.0);
191 nStripTECH_ = iBook.
book1D(
"nHitStripTEC",
"No. of hits in Strip TEC per Track", 30, 0, 30.0);
193 nStripTIDH_ = iBook.
book1D(
"nHitStripTID",
"No. of hits in Strip TID per Tracks", 30, 0, 30.0);
205 TrackPtHistoPar.getParameter<int32_t>(
"Xbins"),
206 TrackPtHistoPar.getParameter<
double>(
"Xmin"),
207 TrackPtHistoPar.getParameter<
double>(
"Xmax"),0.0,0.0,
"g");
214 TrackEtaHistoPar.
getParameter<
double>(
"Xmax"),0.0,0.0,
"g");
222 TrackPtHistoPar.getParameter<int32_t>(
"Xbins"),
223 TrackPtHistoPar.getParameter<
double>(
"Xmin"),
224 TrackPtHistoPar.getParameter<
double>(
"Xmax"),0.0,0.0,
"g");
229 TrackEtaHistoPar.
getParameter<
double>(
"Xmax"),0.0,0.0,
"g");
279 for (
auto const&
v : *PupInfo) {
280 int bx =
v.getBunchCrossing();
284 int ntrueInt =
v.getTrueNumInteractions();
287 if (ntrueInt > -1 && ntrueInt <
int(
vpu_.size())) wfac =
vpu_.at(ntrueInt);
296 int nvtx = (vertexColl.
isValid() ? vertexColl->size() : 0);
302 edm::LogInfo(
"StandaloneTrackMonitor") <<
"Total # of Tracks: " << tracks->size();
305 for (
auto const& track : *tracks) {
306 if (!track.quality(quality))
continue;
310 double eta = track.eta();
311 double theta = track.theta();
312 double phi = track.phi();
313 double pt = track.pt();
323 int nLostHits = track.numberOfLostHits();
335 double etaError = track.etaError();
336 double thetaError = track.thetaError();
337 double phiError = track.phiError();
338 double p = track.p();
339 double ptError = track.ptError();
340 double qoverp = track.qoverp();
341 double qoverpError = track.qoverpError();
342 double charge = track.charge();
346 double dxy = track.dxy(beamSpot->position());
347 double dxyError = track.dxyError();
348 double dz = track.dz(beamSpot->position());
349 double dzError = track.dzError();
351 double trkd0 = track.d0();
352 double chi2 = track.chi2();
353 double ndof = track.ndof();
354 double vx = track.vx();
355 double vy = track.vy();
356 double vz = track.vz();
396 int nPixBarrel = 0, nPixEndcap = 0, nStripTIB = 0, nStripTOB = 0, nStripTEC = 0, nStripTID = 0;
397 for (
auto it = track.recHitsBegin(); it != track.recHitsEnd(); ++it) {
415 <<
" >>> HITs: nPixBarrel: " << nPixBarrel
416 <<
" nPixEndcap: " << nPixEndcap
417 <<
" nStripTIB: " << nStripTIB
418 <<
" nStripTOB: " << nStripTOB
419 <<
" nStripTEC: " << nStripTEC
420 <<
" nStripTID: " << nStripTID;
448 dsvit != clusterHandle->end();
451 uint32_t detId = dsvit->id();
452 std::map<uint32_t, std::set<const SiStripCluster*> >::iterator jt =
clusterMap_.find(detId);
453 bool detid_found = (jt !=
clusterMap_.end()) ?
true :
false;
457 clusit != dsvit->end();
461 std::set<const SiStripCluster*>&
s = jt->second;
462 if (s.find(&*clusit) != s.end())
continue;
466 float charge = info.
charge();
471 if (thickness > 0.035) {
493 if (!thit.isValid())
return;
495 auto const& clus = thit.firstClusterRef();
496 if (!clus.isValid())
return;
497 if (!clus.isStrip())
return;
499 if (thit.isMatched()) {
504 if (thickness > 0.035) {
516 if (thickness > 0.035) {
527 auto& cluster = clus.stripCluster();
529 if (thickness > 0.035) {
541 std::map<uint32_t, std::set<const SiStripCluster*> >::iterator it =
clusterMap_.find(detid);
543 std::set<const SiStripCluster*>
s;
545 clusterMap_.insert(std::pair<uint32_t, std::set<const SiStripCluster*> >(detid, s));
548 std::set<const SiStripCluster*>&
s = it->second;
MonitorElement * pixelLayerwithMeasurementH_
MonitorElement * hOnTrkClusChargeThickH_
const edm::InputTag trackTag_
T getParameter(std::string const &) const
virtual const TrackerGeomDet * idToDetUnit(DetId) const
Return the pointer to the GeomDetUnit corresponding to a given DetId.
void analyze(edm::Event const &iEvent, edm::EventSetup const &iSetup) override
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
MonitorElement * hOnTrkClusChargeThinH_
MonitorElement * trackqOverpH_
MonitorElement * nLostHitsVsPhiH_
MonitorElement * trackPtOver10GeVH_
const std::string trackQuality_
const edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > clusterToken_
MonitorElement * nStripTIDH_
std::vector< float > vpu_
StandaloneTrackMonitor(const edm::ParameterSet &)
MonitorElement * bookProfile(Args &&...args)
const bool haveAllHistograms_
MonitorElement * trackChi2bynDOFH_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
TrackQuality
track quality
MonitorElement * hOffTrkClusWidthThickH_
const edm::EDGetTokenT< reco::TrackCollection > trackToken_
#define DEFINE_FWK_MODULE(type)
SiStripCluster const & monoCluster() const
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_
std::vector< Vertex > VertexCollection
collection of Vertex objects
const Bounds & bounds() const
data_type const * const_iterator
int pixelLayersWithMeasurement() const
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_
MonitorElement * trackChi2H_
const edm::InputTag vertexTag_
virtual float thickness() const =0
MonitorElement * nlostHitsH_
MonitorElement * beamSpotXYposH_
const bool doPUCorrection_
uint16_t hitPattern[ARRAY_LENGTH]
MonitorElement * nTracksH_
MonitorElement * hOnTrkClusWidthThickH_
MonitorElement * trackqOverperrH_
MonitorElement * nHitsVsEtaH_
MonitorElement * trackThetaerrH_
MonitorElement * bunchCrossingH_
MonitorElement * nStripTIBH_
Cos< T >::type cos(const T &t)
MonitorElement * trackPterrH_
MonitorElement * book1D(Args &&...args)
MonitorElement * nvalidStripHitsH_
MonitorElement * trackPhiH_
MonitorElement * vertexXposH_
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
MonitorElement * beamSpotZposerrH_
MonitorElement * nLostHitsVsCosThetaH_
MonitorElement * trackPtH_
MonitorElement * beamSpotXYposerrH_
MonitorElement * trackChargeH_
MonitorElement * hOffTrkClusChargeThickH_
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)
void setCurrentFolder(const std::string &fullpath)
const edm::EDGetTokenT< reco::BeamSpot > bsToken_
MonitorElement * trkLayerwithMeasurementH_
MonitorElement * trackd0H_
MonitorElement * trackEtaerrH_
int stripLayersWithMeasurement() const
MonitorElement * trueNIntH_
std::map< uint32_t, std::set< const SiStripCluster * > > clusterMap_
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &)
int numberOfValidTrackerHits() const
MonitorElement * vertexYposH_
SiStripCluster const & stereoCluster() const
MonitorElement * trackPH_
const edm::EDGetTokenT< reco::VertexCollection > vertexToken_
void processClusters(edm::Event const &iEvent, edm::EventSetup const &iSetup, const TrackerGeometry &tkGeom, double wfac=1)
MonitorElement * nPixBarrelH_
MonitorElement * nPixEndcapH_
MonitorElement * nHitsVsPhiH_
int numberOfValidPixelHits() const
MonitorElement * nLostHitsVspTH_
MonitorElement * nvalidPixelHitsH_
MonitorElement * tracknDOFH_
MonitorElement * trackPtUpto2GeVH_
DetId geographicalId() const
volatile std::atomic< bool > shutdown_flag false
MonitorElement * trackEtaH_
void processHit(const TrackingRecHit &recHit, edm::EventSetup const &iSetup, const TrackerGeometry &tkGeom, double wfac=1)
MonitorElement * nLostHitsVsEtaH_
Detector det() const
get the detector field from this detid
MonitorElement * nHitsVsnVtxH_
MonitorElement * nHitsVspTH_
MonitorElement * nVertexH_
MonitorElement * vertexZposH_
void endLuminosityBlock(edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &eSetup) override
MonitorElement * trackPhierrH_
MonitorElement * nStripTOBH_