CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
Phase2ITValidateCluster Class Reference

bookLayer More...

#include <Phase2ITValidateCluster.cc>

Inheritance diagram for Phase2ITValidateCluster:
DQMEDAnalyzer edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >

Classes

struct  ClusterMEs
 

Public Types

typedef std::map< unsigned int, std::vector< PSimHit > > SimHitsMap
 
typedef std::map< unsigned int, SimTrackSimTracksMap
 
- Public Types inherited from DQMEDAnalyzer
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Public Member Functions

void analyze (const edm::Event &iEvent, const edm::EventSetup &iSetup) override
 
void bookHistograms (DQMStore::IBooker &ibooker, edm::Run const &iRun, edm::EventSetup const &iSetup) override
 
void dqmBeginRun (const edm::Run &iRun, const edm::EventSetup &iSetup) override
 
 Phase2ITValidateCluster (const edm::ParameterSet &)
 
 ~Phase2ITValidateCluster () override
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &event, edm::EventSetup const &setup) final
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
void beginStream (edm::StreamID id) final
 
 DQMEDAnalyzer ()
 
void endLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static void globalEndJob (DQMEDAnalyzerGlobalCache const *)
 
static void globalEndLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup, LuminosityBlockContext const *context)
 
static void globalEndRunProduce (edm::Run &run, edm::EventSetup const &setup, RunContext const *context)
 
static std::unique_ptr< DQMEDAnalyzerGlobalCacheinitializeGlobalCache (edm::ParameterSet const &)
 

Private Member Functions

void bookLayerHistos (DQMStore::IBooker &ibooker, uint32_t det_it, const std::string &subdir)
 
void fillITHistos (const edm::Event &iEvent, const std::vector< edm::Handle< edm::PSimHitContainer >> &simHits, const std::map< unsigned int, SimTrack > &simTracks)
 
std::vector< unsigned int > getSimTrackId (const edm::Handle< edm::DetSetVector< PixelDigiSimLink >> &pixelSimLinks, const DetId &detId, unsigned int channel)
 

Private Attributes

edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > clustersToken_
 
edm::ParameterSet config_
 
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecordgeomToken_
 
std::map< std::string, ClusterMEslayerMEs_
 
std::vector< edm::InputTagpSimHitSrc_
 
std::vector< edm::EDGetTokenT< edm::PSimHitContainer > > simHitTokens_
 
edm::EDGetTokenT< edm::DetSetVector< PixelDigiSimLink > > simITLinksToken_
 
double simtrackminpt_
 
edm::EDGetTokenT< edm::SimTrackContainersimTracksToken_
 
const TrackerGeometrytkGeom_ = nullptr
 
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcdtopoToken_
 
const TrackerTopologytTopo_ = nullptr
 

Additional Inherited Members

- Protected Member Functions inherited from DQMEDAnalyzer
uint64_t meId () const
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 
unsigned int streamId_
 

Detailed Description

bookLayer

Description: Validation plots tracker clusters.

Definition at line 49 of file Phase2ITValidateCluster.cc.

Member Typedef Documentation

◆ SimHitsMap

typedef std::map<unsigned int, std::vector<PSimHit> > Phase2ITValidateCluster::SimHitsMap

Definition at line 51 of file Phase2ITValidateCluster.cc.

◆ SimTracksMap

typedef std::map<unsigned int, SimTrack> Phase2ITValidateCluster::SimTracksMap

Definition at line 52 of file Phase2ITValidateCluster.cc.

Constructor & Destructor Documentation

◆ Phase2ITValidateCluster()

Phase2ITValidateCluster::Phase2ITValidateCluster ( const edm::ParameterSet iConfig)
explicit

Definition at line 98 of file Phase2ITValidateCluster.cc.

References pSimHitSrc_, and simHitTokens_.

99  : config_(iConfig),
100  simtrackminpt_(config_.getParameter<double>("SimTrackMinPt")),
102  config_.getParameter<edm::InputTag>("InnerTrackerDigiSimLinkSource"))),
103  simTracksToken_(consumes<edm::SimTrackContainer>(config_.getParameter<edm::InputTag>("simtracks"))),
106  pSimHitSrc_(config_.getParameter<std::vector<edm::InputTag>>("PSimHitSource")),
107  geomToken_(esConsumes<TrackerGeometry, TrackerDigiGeometryRecord, edm::Transition::BeginRun>()),
108  topoToken_(esConsumes<TrackerTopology, TrackerTopologyRcd, edm::Transition::BeginRun>()) {
109  edm::LogInfo("Phase2ITValidateCluster") << ">>> Construct Phase2ITValidateCluster ";
110  for (const auto& itag : pSimHitSrc_)
111  simHitTokens_.push_back(consumes<edm::PSimHitContainer>(itag));
112 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
std::vector< edm::InputTag > pSimHitSrc_
std::vector< edm::EDGetTokenT< edm::PSimHitContainer > > simHitTokens_
edm::EDGetTokenT< edm::DetSetVector< PixelDigiSimLink > > simITLinksToken_
edm::EDGetTokenT< edm::SimTrackContainer > simTracksToken_
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > geomToken_
Log< level::Info, false > LogInfo
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > clustersToken_
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > topoToken_

◆ ~Phase2ITValidateCluster()

Phase2ITValidateCluster::~Phase2ITValidateCluster ( )
override

Definition at line 114 of file Phase2ITValidateCluster.cc.

114  {
115  // do anything here that needs to be done at desctruction time
116  // (e.g. close files, deallocate resources etc.)
117  edm::LogInfo("Phase2ITValidateCluster") << ">>> Destroy Phase2ITValidateCluster ";
118 }
Log< level::Info, false > LogInfo

Member Function Documentation

◆ analyze()

void Phase2ITValidateCluster::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overridevirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 129 of file Phase2ITValidateCluster.cc.

References fillITHistos(), iEvent, FastTrackerRecHitCombiner_cfi::simHits, simHitTokens_, simtrackminpt_, TrackCandidateProducer_cfi::simTracks, and simTracksToken_.

129  {
130  // Getting simHits
131  std::vector<edm::Handle<edm::PSimHitContainer>> simHits;
132  for (const auto& itoken : simHitTokens_) {
133  const auto& simHitHandle = iEvent.getHandle(itoken);
134  if (!simHitHandle.isValid())
135  continue;
136  simHits.emplace_back(simHitHandle);
137  }
138  // Get the SimTracks
139  const auto& simTracksRaw = iEvent.getHandle(simTracksToken_);
140  // Rearrange the simTracks for ease of use <simTrackID, simTrack>
142  for (edm::SimTrackContainer::const_iterator simTrackIt(simTracksRaw->begin()); simTrackIt != simTracksRaw->end();
143  ++simTrackIt) {
144  if (simTrackIt->momentum().pt() > simtrackminpt_) {
145  simTracks.emplace(simTrackIt->trackId(), *simTrackIt);
146  }
147  }
149 }
std::vector< edm::EDGetTokenT< edm::PSimHitContainer > > simHitTokens_
edm::EDGetTokenT< edm::SimTrackContainer > simTracksToken_
int iEvent
Definition: GenABIO.cc:224
void fillITHistos(const edm::Event &iEvent, const std::vector< edm::Handle< edm::PSimHitContainer >> &simHits, const std::map< unsigned int, SimTrack > &simTracks)
std::map< unsigned int, SimTrack > SimTracksMap

◆ bookHistograms()

void Phase2ITValidateCluster::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
overridevirtual

Implements DQMEDAnalyzer.

Definition at line 239 of file Phase2ITValidateCluster.cc.

References bookLayerHistos(), edm::ESWatcher< T >::check(), config_, TrackerGeometry::detUnits(), edm::ParameterSet::getParameter(), GeomDetEnumerators::P2PXB, GeomDetEnumerators::P2PXEC, AlCaHLTBitMon_QueryRunRegistry::string, and tkGeom_.

241  {
242  std::string top_folder = config_.getParameter<std::string>("TopFolderName");
243  edm::LogInfo("Phase2ITValidateCluster") << " Booking Histograms in: " << top_folder;
244 
245  edm::ESWatcher<TrackerDigiGeometryRecord> theTkDigiGeomWatcher;
246  if (theTkDigiGeomWatcher.check(iSetup)) {
247  for (auto const& det_u : tkGeom_->detUnits()) {
248  //Always check TrackerNumberingBuilder before changing this part
249  if (!(det_u->subDetector() == GeomDetEnumerators::SubDetector::P2PXB ||
250  det_u->subDetector() == GeomDetEnumerators::SubDetector::P2PXEC))
251  continue; //continue if not Pixel
252  uint32_t detId_raw = det_u->geographicalId().rawId();
253  bookLayerHistos(ibooker, detId_raw, top_folder);
254  }
255  }
256 }
const TrackerGeometry * tkGeom_
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
const DetContainer & detUnits() const override
Returm a vector of all GeomDet.
Log< level::Info, false > LogInfo
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:57
void bookLayerHistos(DQMStore::IBooker &ibooker, uint32_t det_it, const std::string &subdir)

◆ bookLayerHistos()

void Phase2ITValidateCluster::bookLayerHistos ( DQMStore::IBooker ibooker,
uint32_t  det_it,
const std::string &  subdir 
)
private

Definition at line 259 of file Phase2ITValidateCluster.cc.

References phase2tkutil::book1DFromPSet(), dqm::implementation::NavigatorBase::cd(), config_, Phase2ITValidateCluster::ClusterMEs::deltaX_P, Phase2ITValidateCluster::ClusterMEs::deltaX_P_primary, Phase2ITValidateCluster::ClusterMEs::deltaY_P, Phase2ITValidateCluster::ClusterMEs::deltaY_P_primary, ALCARECODTCalibSynchCosmicsDQM_cff::folderName, phase2tkutil::getITHistoId(), edm::ParameterSet::getParameter(), layerMEs_, dqm::implementation::NavigatorBase::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, mkLumiAveragedPlots::subdir, and tTopo_.

Referenced by bookHistograms().

259  {
261  if (folderName.empty()) {
262  edm::LogWarning("Phase2ITValidateCluster") << ">>>> Invalid histo_id ";
263  return;
264  }
265 
266  if (layerMEs_.find(folderName) == layerMEs_.end()) {
267  ibooker.cd();
268  ibooker.setCurrentFolder(subdir + '/' + folderName);
269  edm::LogInfo("Phase2TrackerValidateDigi") << " Booking Histograms in: " << subdir + '/' + folderName;
270  ClusterMEs local_mes;
271 
272  local_mes.deltaX_P =
274 
275  local_mes.deltaY_P =
277 
278  // Puting primary digis in a subfolder
279  ibooker.setCurrentFolder(subdir + '/' + folderName + "/PrimarySimHits");
280 
281  local_mes.deltaX_P_primary =
282  phase2tkutil::book1DFromPSet(config_.getParameter<edm::ParameterSet>("Delta_X_Pixel_Primary"), ibooker);
283 
284  local_mes.deltaY_P_primary =
285  phase2tkutil::book1DFromPSet(config_.getParameter<edm::ParameterSet>("Delta_Y_Pixel_Primary"), ibooker);
286  layerMEs_.emplace(folderName, local_mes);
287  }
288 }
std::map< std::string, ClusterMEs > layerMEs_
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
const TrackerTopology * tTopo_
std::string getITHistoId(uint32_t det_id, const TrackerTopology *tTopo)
MonitorElement * book1DFromPSet(const edm::ParameterSet &hpars, DQMStore::IBooker &ibooker)
Log< level::Info, false > LogInfo
Log< level::Warning, false > LogWarning

◆ dqmBeginRun()

void Phase2ITValidateCluster::dqmBeginRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)
overridevirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 122 of file Phase2ITValidateCluster.cc.

References geomToken_, edm::EventSetup::getData(), tkGeom_, topoToken_, and tTopo_.

122  {
123  tkGeom_ = &iSetup.getData(geomToken_);
124  tTopo_ = &iSetup.getData(topoToken_);
125 }
const TrackerGeometry * tkGeom_
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
const TrackerTopology * tTopo_
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > geomToken_
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > topoToken_

◆ fillDescriptions()

void Phase2ITValidateCluster::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 304 of file Phase2ITValidateCluster.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), submitPVResolutionJobs::desc, ProducerED_cfi::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

304  {
306  //for macro-pixel sensors
307  {
309  psd0.add<std::string>("name", "Delta_X_Pixel");
310  psd0.add<std::string>("title", "#Delta X;Cluster resolution X coordinate [#mum]");
311  psd0.add<bool>("switch", true);
312  psd0.add<double>("xmax", 250.);
313  psd0.add<double>("xmin", -250.);
314  psd0.add<int>("NxBins", 100);
315  desc.add<edm::ParameterSetDescription>("Delta_X_Pixel", psd0);
316  }
317  {
319  psd0.add<std::string>("name", "Delta_Y_Pixel");
320  psd0.add<std::string>("title", "#Delta Y ;Cluster resolution Y coordinate [#mum]");
321  psd0.add<double>("xmin", -250.);
322  psd0.add<double>("xmax", 250.);
323  psd0.add<bool>("switch", true);
324  psd0.add<int>("NxBins", 100);
325  desc.add<edm::ParameterSetDescription>("Delta_Y_Pixel", psd0);
326  }
327  {
329  psd0.add<std::string>("name", "Delta_X_Pixel_Primary");
330  psd0.add<std::string>("title", "#Delta X ;cluster resolution X coordinate [#mum]");
331  psd0.add<double>("xmin", -250.);
332  psd0.add<double>("xmax", 250.);
333  psd0.add<bool>("switch", true);
334  psd0.add<int>("NxBins", 100);
335  desc.add<edm::ParameterSetDescription>("Delta_X_Pixel_Primary", psd0);
336  }
337  {
339  psd0.add<std::string>("name", "Delta_Y_Pixel_Primary");
340  psd0.add<std::string>("title", "#Delta Y ;cluster resolution Y coordinate [#mum]");
341  psd0.add<double>("xmin", -250.);
342  psd0.add<double>("xmax", 250.);
343  psd0.add<bool>("switch", true);
344  psd0.add<int>("NxBins", 100);
345  desc.add<edm::ParameterSetDescription>("Delta_Y_Pixel_Primary", psd0);
346  }
347 
348  desc.add<std::string>("TopFolderName", "TrackerPhase2ITClusterV");
349  desc.add<edm::InputTag>("ClusterSource", edm::InputTag("siPixelClusters"));
350  desc.add<edm::InputTag>("InnerTrackerDigiSimLinkSource", edm::InputTag("simSiPixelDigis", "Pixel"));
351  desc.add<edm::InputTag>("simtracks", edm::InputTag("g4SimHits"));
352  desc.add<double>("SimTrackMinPt", 0.0);
353  desc.add<std::vector<edm::InputTag>>("PSimHitSource",
354  {
355  edm::InputTag("g4SimHits:TrackerHitsPixelBarrelLowTof"),
356  edm::InputTag("g4SimHits:TrackerHitsPixelBarrelHighTof"),
357  edm::InputTag("g4SimHits:TrackerHitsPixelEndcapLowTof"),
358  edm::InputTag("g4SimHits:TrackerHitsPixelEndcapHighTof"),
359  });
360  descriptions.add("Phase2ITValidateCluster", desc);
361 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ fillITHistos()

void Phase2ITValidateCluster::fillITHistos ( const edm::Event iEvent,
const std::vector< edm::Handle< edm::PSimHitContainer >> &  simHits,
const std::map< unsigned int, SimTrack > &  simTracks 
)
private

Definition at line 151 of file Phase2ITValidateCluster.cc.

References PVValHelper::add(), clustersToken_, phase2tkutil::cmtomicron, Phase2ITValidateCluster::ClusterMEs::deltaX_P, Phase2ITValidateCluster::ClusterMEs::deltaX_P_primary, Phase2ITValidateCluster::ClusterMEs::deltaY_P, Phase2ITValidateCluster::ClusterMEs::deltaY_P_primary, hcalRecHitTable_cff::detId, PVValHelper::dx, PVValHelper::dy, dqm::impl::MonitorElement::Fill(), phase2tkutil::getITHistoId(), getSimTrackId(), TrackerGeometry::idToDetUnit(), iEvent, phase2tkutil::isPrimary(), dqmiolumiharvest::j, layerMEs_, pfDeepBoostedJetPreprocessParams_cfi::lower_bound, PixelChannelIdentifier::pixelToChannel(), FastTrackerRecHitCombiner_cfi::simHits, simITLinksToken_, TrackCandidateProducer_cfi::simTracks, jetUpdater_cfi::sort, AlCaHLTBitMon_QueryRunRegistry::string, tkGeom_, and tTopo_.

Referenced by analyze().

153  {
154  // Getting the clusters
155  const auto& clusterHandle = iEvent.getHandle(clustersToken_);
156  // Getting PixelDigiSimLinks
157  const auto& pixelSimLinksHandle = iEvent.getHandle(simITLinksToken_);
158 
159  for (const auto& DSVItr : *clusterHandle) {
160  // Getting the id of detector unit
161  uint32_t rawid = DSVItr.detId();
162  DetId detId(rawid);
163  const GeomDetUnit* geomDetUnit(tkGeom_->idToDetUnit(detId));
164  if (!geomDetUnit)
165  continue;
166 
168  for (const auto& clusterItr : DSVItr) {
169  MeasurementPoint mpCluster(clusterItr.x(), clusterItr.y());
170  Local3DPoint localPosCluster = geomDetUnit->topology().localPosition(mpCluster);
171  // Get simTracks from the cluster
172  std::vector<unsigned int> clusterSimTrackIds;
173  for (int irow = clusterItr.minPixelRow(); irow <= clusterItr.maxPixelRow(); ++irow) {
174  for (int icol = clusterItr.minPixelCol(); icol <= clusterItr.maxPixelCol(); ++icol) {
175  uint32_t channel = PixelChannelIdentifier::pixelToChannel(irow, icol);
176  std::vector<unsigned int> simTrackIds(getSimTrackId(pixelSimLinksHandle, detId, channel));
177  for (auto it : simTrackIds) {
178  bool add = true;
179  for (unsigned int j = 0; j < clusterSimTrackIds.size(); ++j) {
180  // only save simtrackids that are not present yet
181  if (it == clusterSimTrackIds.at(j))
182  add = false;
183  }
184  if (add)
185  clusterSimTrackIds.push_back(it);
186  }
187  }
188  }
189  std::sort(clusterSimTrackIds.begin(), clusterSimTrackIds.end());
190  const PSimHit* closestSimHit = nullptr;
191  float mind = 10000.;
192  // Get the SimHit
193  for (const auto& psimhitCont : simHits) {
194  for (const auto& simhitIt : *psimhitCont) {
195  if (rawid == simhitIt.detUnitId()) {
196  auto it = std::lower_bound(clusterSimTrackIds.begin(), clusterSimTrackIds.end(), simhitIt.trackId());
197  if (it != clusterSimTrackIds.end() && *it == simhitIt.trackId()) {
198  float dx = simhitIt.localPosition().x() - localPosCluster.x();
199  float dy = simhitIt.localPosition().y() - localPosCluster.y();
200  float dist = dx * dx + dy * dy;
201  if (!closestSimHit || dist < mind) {
202  mind = dist;
203  closestSimHit = &simhitIt;
204  }
205  }
206  }
207  } //end loop over PSimhitcontainers
208  } //end loop over simHits
209 
210  if (!closestSimHit)
211  continue;
212  // only look at simhits from highpT tracks
213  auto simTrackIt(simTracks.find(closestSimHit->trackId()));
214  if (simTrackIt == simTracks.end())
215  continue;
216  Local3DPoint localPosSimHit(closestSimHit->localPosition());
217  const double deltaX = phase2tkutil::cmtomicron * (localPosCluster.x() - localPosSimHit.x());
218  const double deltaY = phase2tkutil::cmtomicron * (localPosCluster.y() - localPosSimHit.y());
219 
220  auto layerMEIt = layerMEs_.find(folderkey);
221  if (layerMEIt == layerMEs_.end())
222  continue;
223 
224  ClusterMEs& local_mes = layerMEIt->second;
225  local_mes.deltaX_P->Fill(deltaX);
226  local_mes.deltaY_P->Fill(deltaY);
227  // Primary particles only
228  if (phase2tkutil::isPrimary(simTrackIt->second, closestSimHit)) {
229  local_mes.deltaX_P_primary->Fill(deltaX);
230  local_mes.deltaY_P_primary->Fill(deltaY);
231  }
232  }
233  }
234 }
std::map< std::string, ClusterMEs > layerMEs_
const TrackerGeometry * tkGeom_
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
static constexpr float cmtomicron
const TrackerTopology * tTopo_
bool isPrimary(const SimTrack &simTrk, const PSimHit *simHit)
edm::EDGetTokenT< edm::DetSetVector< PixelDigiSimLink > > simITLinksToken_
std::string getITHistoId(uint32_t det_id, const TrackerTopology *tTopo)
int iEvent
Definition: GenABIO.cc:224
Definition: DetId.h:17
std::vector< unsigned int > getSimTrackId(const edm::Handle< edm::DetSetVector< PixelDigiSimLink >> &pixelSimLinks, const DetId &detId, unsigned int channel)
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > clustersToken_
void add(std::map< std::string, TH1 *> &h, TH1 *hist)
static int pixelToChannel(int row, int col)

◆ getSimTrackId()

std::vector< unsigned int > Phase2ITValidateCluster::getSimTrackId ( const edm::Handle< edm::DetSetVector< PixelDigiSimLink >> &  pixelSimLinks,
const DetId detId,
unsigned int  channel 
)
private

Definition at line 290 of file Phase2ITValidateCluster.cc.

References hcalRecHitTable_cff::detId.

Referenced by fillITHistos().

291  {
292  std::vector<unsigned int> retvec;
294  if (DSViter == pixelSimLinks->end())
295  return retvec;
296  for (edm::DetSet<PixelDigiSimLink>::const_iterator it = DSViter->data.begin(); it != DSViter->data.end(); ++it) {
297  if (channel == it->channel()) {
298  retvec.push_back(it->SimTrackId());
299  }
300  }
301  return retvec;
302 }
iterator find(det_id_type id)
Definition: DetSetVector.h:255
iterator end()
Return the off-the-end iterator.
Definition: DetSetVector.h:316
collection_type::const_iterator const_iterator
Definition: DetSet.h:31
collection_type::const_iterator const_iterator
Definition: DetSetVector.h:102

Member Data Documentation

◆ clustersToken_

edm::EDGetTokenT<edmNew::DetSetVector<SiPixelCluster> > Phase2ITValidateCluster::clustersToken_
private

Definition at line 84 of file Phase2ITValidateCluster.cc.

Referenced by fillITHistos().

◆ config_

edm::ParameterSet Phase2ITValidateCluster::config_
private

Definition at line 79 of file Phase2ITValidateCluster.cc.

Referenced by bookHistograms(), and bookLayerHistos().

◆ geomToken_

const edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> Phase2ITValidateCluster::geomToken_
private

Definition at line 86 of file Phase2ITValidateCluster.cc.

Referenced by dqmBeginRun().

◆ layerMEs_

std::map<std::string, ClusterMEs> Phase2ITValidateCluster::layerMEs_
private

Definition at line 77 of file Phase2ITValidateCluster.cc.

Referenced by bookLayerHistos(), and fillITHistos().

◆ pSimHitSrc_

std::vector<edm::InputTag> Phase2ITValidateCluster::pSimHitSrc_
private

Definition at line 85 of file Phase2ITValidateCluster.cc.

Referenced by Phase2ITValidateCluster().

◆ simHitTokens_

std::vector<edm::EDGetTokenT<edm::PSimHitContainer> > Phase2ITValidateCluster::simHitTokens_
private

Definition at line 81 of file Phase2ITValidateCluster.cc.

Referenced by analyze(), and Phase2ITValidateCluster().

◆ simITLinksToken_

edm::EDGetTokenT<edm::DetSetVector<PixelDigiSimLink> > Phase2ITValidateCluster::simITLinksToken_
private

Definition at line 82 of file Phase2ITValidateCluster.cc.

Referenced by fillITHistos().

◆ simtrackminpt_

double Phase2ITValidateCluster::simtrackminpt_
private

Definition at line 80 of file Phase2ITValidateCluster.cc.

Referenced by analyze().

◆ simTracksToken_

edm::EDGetTokenT<edm::SimTrackContainer> Phase2ITValidateCluster::simTracksToken_
private

Definition at line 83 of file Phase2ITValidateCluster.cc.

Referenced by analyze().

◆ tkGeom_

const TrackerGeometry* Phase2ITValidateCluster::tkGeom_ = nullptr
private

Definition at line 88 of file Phase2ITValidateCluster.cc.

Referenced by bookHistograms(), dqmBeginRun(), and fillITHistos().

◆ topoToken_

const edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> Phase2ITValidateCluster::topoToken_
private

Definition at line 87 of file Phase2ITValidateCluster.cc.

Referenced by dqmBeginRun().

◆ tTopo_

const TrackerTopology* Phase2ITValidateCluster::tTopo_ = nullptr
private

Definition at line 89 of file Phase2ITValidateCluster.cc.

Referenced by bookLayerHistos(), dqmBeginRun(), and fillITHistos().