Skip to content

Commit

Permalink
Added switch to run on RECO (StandaloneTrackMonitor loops over recHit…
Browse files Browse the repository at this point in the history
…s, not available in AOD)
  • Loading branch information
dbruschi committed Oct 11, 2023
1 parent 2c5f4d0 commit cf63d0c
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 20 deletions.
46 changes: 26 additions & 20 deletions DQM/TrackingMonitorSource/plugins/StandaloneTrackMonitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ class StandaloneTrackMonitor : public DQMEDAnalyzer {
const std::string moduleName_;
const std::string folderName_;

const bool isRECO_;

SiStripClusterInfo siStripClusterInfo_;

const edm::InputTag trackTag_;
Expand Down Expand Up @@ -370,6 +372,7 @@ void StandaloneTrackMonitor::fillDescriptions(edm::ConfigurationDescriptions& de
edm::ParameterSetDescription desc;
desc.addUntracked<std::string>("moduleName", "StandaloneTrackMonitor");
desc.addUntracked<std::string>("folderName", "highPurityTracks");
desc.addUntracked<bool>("isRECO", false);
desc.addUntracked<edm::InputTag>("trackInputTag", edm::InputTag("generalTracks"));
desc.addUntracked<edm::InputTag>("offlineBeamSpot", edm::InputTag("offlineBeamSpot"));
desc.addUntracked<edm::InputTag>("vertexTag", edm::InputTag("offlinePrimaryVertices"));
Expand Down Expand Up @@ -424,6 +427,7 @@ void StandaloneTrackMonitor::fillDescriptions(edm::ConfigurationDescriptions& de
StandaloneTrackMonitor::StandaloneTrackMonitor(const edm::ParameterSet& ps)
: moduleName_(ps.getUntrackedParameter<std::string>("moduleName", "StandaloneTrackMonitor")),
folderName_(ps.getUntrackedParameter<std::string>("folderName", "highPurityTracks")),
isRECO_(ps.getUntrackedParameter<bool>("isRECO", false)),
siStripClusterInfo_(consumesCollector()),
trackTag_(ps.getUntrackedParameter<edm::InputTag>("trackInputTag", edm::InputTag("generalTracks"))),
bsTag_(ps.getUntrackedParameter<edm::InputTag>("offlineBeamSpot", edm::InputTag("offlineBeamSpot"))),
Expand Down Expand Up @@ -1674,26 +1678,28 @@ void StandaloneTrackMonitor::analyze(edm::Event const& iEvent, edm::EventSetup c
vertexZposH_->Fill(vz, wfac);

int nPixBarrel = 0, nPixEndcap = 0, nStripTIB = 0, nStripTOB = 0, nStripTEC = 0, nStripTID = 0;
for (auto it = track.recHitsBegin(); it != track.recHitsEnd(); ++it) {
const TrackingRecHit& hit = (**it);
if (hit.isValid()) {
if (hit.geographicalId().det() == DetId::Tracker) {
int subdetId = hit.geographicalId().subdetId();
if (subdetId == PixelSubdetector::PixelBarrel)
++nPixBarrel;
else if (subdetId == PixelSubdetector::PixelEndcap)
++nPixEndcap;
else if (subdetId == StripSubdetector::TIB)
++nStripTIB;
else if (subdetId == StripSubdetector::TOB)
++nStripTOB;
else if (subdetId == StripSubdetector::TEC)
++nStripTEC;
else if (subdetId == StripSubdetector::TID)
++nStripTID;

// Find on-track clusters
processHit(hit, iSetup, tkGeom, wfac);
if (isRECO_) {
for (auto it = track.recHitsBegin(); it != track.recHitsEnd(); ++it) {
const TrackingRecHit& hit = (**it);
if (hit.isValid()) {
if (hit.geographicalId().det() == DetId::Tracker) {
int subdetId = hit.geographicalId().subdetId();
if (subdetId == PixelSubdetector::PixelBarrel)
++nPixBarrel;
else if (subdetId == PixelSubdetector::PixelEndcap)
++nPixEndcap;
else if (subdetId == StripSubdetector::TIB)
++nStripTIB;
else if (subdetId == StripSubdetector::TOB)
++nStripTOB;
else if (subdetId == StripSubdetector::TEC)
++nStripTEC;
else if (subdetId == StripSubdetector::TID)
++nStripTID;

// Find on-track clusters
processHit(hit, iSetup, tkGeom, wfac);
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
standaloneTrackMonitor = standaloneTrackMonitorDefault.clone(
moduleName = "StandaloneTrackMonitor",
folderName = "highPurityTracks",
isRECO = False,
vertexTag = "selectedPrimaryVertices", # "offlinePrimaryVertices",
puTag = "addPileupInfo",
clusterTag = "siStripClusters",
Expand Down

0 comments on commit cf63d0c

Please sign in to comment.