CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Private Member Functions | Private Attributes
Phase2TrackerValidateDigi Class Reference

#include <Phase2TrackerValidateDigi.h>

Inheritance diagram for Phase2TrackerValidateDigi:
DQMEDAnalyzer edm::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::EndLuminosityBlockProducer, edm::one::WatchLuminosityBlocks, edm::Accumulator > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Classes

struct  DigiMEs
 

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
 
 Phase2TrackerValidateDigi (const edm::ParameterSet &)
 
 ~Phase2TrackerValidateDigi () override
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &event, edm::EventSetup const &setup) final
 
virtual void analyze (edm::Event const &, edm::EventSetup const &)
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual void dqmBeginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
virtual void dqmEndLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void dqmEndRun (edm::Run const &, edm::EventSetup const &)
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &, edm::EventSetup const &) final
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::EndLuminosityBlockProducer, edm::one::WatchLuminosityBlocks, edm::Accumulator >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void bookLayerHistos (DQMStore::IBooker &ibooker, unsigned int det_id, const TrackerTopology *tTopo, bool flag)
 
void fillHistogram (MonitorElement *th1, MonitorElement *th2, MonitorElement *th3, float val, int primary)
 
void fillHitsPerTrack ()
 
void fillITPixelBXInfo ()
 
void fillOTBXInfo ()
 
int fillSimHitInfo (const edm::Event &iEvent, const SimTrack simTrk, const edm::ESHandle< TrackerGeometry > gHandle)
 
bool findITPixelDigi (unsigned int detid, unsigned int id)
 
bool findOTDigi (unsigned int detid, unsigned int id)
 
unsigned int getSimTrackId (const edm::DetSetVector< PixelDigiSimLink > *simLinks, const DetId &detId, unsigned int &channel)
 
bool isPrimary (const SimTrack &simTrk, const PSimHit &simHit)
 
int matchedSimTrack (edm::Handle< edm::SimTrackContainer > &SimTk, unsigned int simTrkId)
 

Private Attributes

edm::ParameterSet config_
 
const float cval
 
float etaCut_
 
std::string geomType_
 
const float GeVperElectron
 
edm::Handle< edm::DetSetVector< PixelDigi > > itPixelDigiHandle_
 
edm::InputTag itPixelDigiSimLinkSrc_
 
const edm::EDGetTokenT< edm::DetSetVector< PixelDigiSimLink > > itPixelDigiSimLinkToken_
 
edm::InputTag itPixelDigiSrc_
 
const edm::EDGetTokenT< edm::DetSetVector< PixelDigi > > itPixelDigiToken_
 
edm::Handle< edm::DetSetVector< PixelDigiSimLink > > itPixelSimLinkHandle_
 
std::map< unsigned int, DigiMEslayerMEs
 
MonitorElementMatchedRZPositionMap
 
MonitorElementMatchedXYPositionMap
 
MonitorElementnSimHitsPerTrack
 
MonitorElementnSimulatedTracks
 
MonitorElementnSimulatedTracksP
 
MonitorElementnSimulatedTracksS
 
MonitorElementnSimVertices
 
edm::Handle< edm::DetSetVector< Phase2TrackerDigi > > otDigiHandle_
 
edm::InputTag otDigiSimLinkSrc_
 
const edm::EDGetTokenT< edm::DetSetVector< PixelDigiSimLink > > otDigiSimLinkToken_
 
edm::InputTag otDigiSrc_
 
const edm::EDGetTokenT< edm::DetSetVector< Phase2TrackerDigi > > otDigiToken_
 
edm::Handle< edm::DetSetVector< PixelDigiSimLink > > otSimLinkHandle_
 
bool pixelFlag_
 
std::vector< edm::InputTagpSimHitSrc_
 
float ptCut_
 
edm::Handle< edm::PSimHitContainersimHits
 
std::vector< edm::EDGetTokenT< edm::PSimHitContainer > > simHitTokens_
 
edm::Handle< edm::SimTrackContainersimTracks
 
edm::InputTag simTrackSrc_
 
const edm::EDGetTokenT< edm::SimTrackContainersimTrackToken_
 
MonitorElementSimulatedRZPositionMap
 
MonitorElementSimulatedTOFEtaMap
 
MonitorElementSimulatedTOFPhiMap
 
MonitorElementSimulatedTOFRMap
 
MonitorElementSimulatedTOFZMap
 
MonitorElementSimulatedTrackEta
 
MonitorElementSimulatedTrackEtaP
 
MonitorElementSimulatedTrackEtaS
 
MonitorElementSimulatedTrackPhi
 
MonitorElementSimulatedTrackPhiP
 
MonitorElementSimulatedTrackPhiS
 
MonitorElementSimulatedTrackPt
 
MonitorElementSimulatedTrackPtP
 
MonitorElementSimulatedTrackPtS
 
MonitorElementSimulatedXYPositionMap
 
edm::InputTag simVertexSrc_
 
const edm::EDGetTokenT< edm::SimVertexContainersimVertexToken_
 
edm::Handle< edm::SimVertexContainersimVertices
 
float tofLowerCut_
 
float tofUpperCut_
 
edm::ESHandle< TrackerTopologytTopoHandle_
 

Additional Inherited Members

- Public Types inherited from DQMEDAnalyzer
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::ProducerBase
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Description: Test pixel digis.

Definition at line 28 of file Phase2TrackerValidateDigi.h.

Constructor & Destructor Documentation

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

Definition at line 49 of file Phase2TrackerValidateDigi.cc.

References config_, etaCut_, edm::ParameterSet::getParameter(), pSimHitSrc_, ptCut_, simHitTokens_, tofLowerCut_, and tofUpperCut_.

50  : config_(iConfig),
51  pixelFlag_(config_.getParameter<bool>("PixelPlotFillingFlag")),
52  geomType_(config_.getParameter<std::string>("GeometryType")),
53  otDigiSrc_(config_.getParameter<edm::InputTag>("OuterTrackerDigiSource")),
54  otDigiSimLinkSrc_(config_.getParameter<edm::InputTag>("OuterTrackerDigiSimLinkSource")),
55  itPixelDigiSrc_(config_.getParameter<edm::InputTag>("InnerPixelDigiSource")),
56  itPixelDigiSimLinkSrc_(config_.getParameter<edm::InputTag>("InnerPixelDigiSimLinkSource")),
57  pSimHitSrc_(config_.getParameter<std::vector<edm::InputTag> >("PSimHitSource")),
58  simTrackSrc_(config_.getParameter<edm::InputTag>("SimTrackSource")),
59  simVertexSrc_(config_.getParameter<edm::InputTag>("SimVertexSource")),
64  simTrackToken_(consumes<edm::SimTrackContainer>(simTrackSrc_)),
65  simVertexToken_(consumes<edm::SimVertexContainer>(simVertexSrc_)),
66  GeVperElectron(3.61E-09), // 1 electron(3.61eV, 1keV(277e, mod 9/06 d.k.
67  cval(30.) {
68  for (const auto& itag : pSimHitSrc_)
69  simHitTokens_.push_back(consumes<edm::PSimHitContainer>(itag));
70 
71  etaCut_ = config_.getParameter<double>("EtaCutOff");
72  ptCut_ = config_.getParameter<double>("PtCutOff");
73  tofUpperCut_ = config_.getParameter<double>("TOFUpperCutOff");
74  tofLowerCut_ = config_.getParameter<double>("TOFLowerCutOff");
75 
76  edm::LogInfo("Phase2TrackerValidateDigi") << ">>> Construct Phase2TrackerValidateDigi ";
77 }
T getParameter(std::string const &) const
const edm::EDGetTokenT< edm::DetSetVector< Phase2TrackerDigi > > otDigiToken_
const edm::EDGetTokenT< edm::DetSetVector< PixelDigiSimLink > > itPixelDigiSimLinkToken_
std::vector< edm::InputTag > pSimHitSrc_
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
const edm::EDGetTokenT< edm::SimVertexContainer > simVertexToken_
std::vector< edm::EDGetTokenT< edm::PSimHitContainer > > simHitTokens_
const edm::EDGetTokenT< edm::DetSetVector< PixelDigi > > itPixelDigiToken_
const edm::EDGetTokenT< edm::DetSetVector< PixelDigiSimLink > > otDigiSimLinkToken_
const edm::EDGetTokenT< edm::SimTrackContainer > simTrackToken_
Phase2TrackerValidateDigi::~Phase2TrackerValidateDigi ( )
override

Definition at line 82 of file Phase2TrackerValidateDigi.cc.

82  {
83  // do anything here that needs to be done at desctruction time
84  // (e.g. close files, deallocate resources etc.)
85  edm::LogInfo("Phase2TrackerValidateDigi") << ">>> Destroy Phase2TrackerValidateDigi ";
86 }

Member Function Documentation

void Phase2TrackerValidateDigi::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Definition at line 96 of file Phase2TrackerValidateDigi.cc.

References edm::ESWatcher< T >::check(), etaCut_, dqm::impl::MonitorElement::Fill(), fillHistogram(), fillHitsPerTrack(), fillITPixelBXInfo(), fillOTBXInfo(), fillSimHitInfo(), geomType_, edm::EventSetup::get(), edm::Event::getByToken(), edm::ESHandleBase::isValid(), itPixelDigiHandle_, itPixelDigiSimLinkToken_, itPixelDigiToken_, itPixelSimLinkHandle_, layerMEs, matchedSimTrack(), Phase2TrackerValidateDigi::DigiMEs::MissedHitTrackEta, Phase2TrackerValidateDigi::DigiMEs::MissedHitTrackPhi, Phase2TrackerValidateDigi::DigiMEs::MissedHitTrackPt, SimVertex::noParent(), nSimulatedTracks, nSimulatedTracksP, nSimulatedTracksS, nSimVertices, nTracks(), otDigiHandle_, otDigiSimLinkToken_, otDigiToken_, otSimLinkHandle_, SimVertex::parentIndex(), pixelFlag_, ptCut_, simTracks, simTrackToken_, SimulatedTrackEta, SimulatedTrackEtaP, SimulatedTrackEtaS, SimulatedTrackPhi, SimulatedTrackPhiP, SimulatedTrackPhiS, SimulatedTrackPt, SimulatedTrackPtP, SimulatedTrackPtS, simVertexToken_, simVertices, tTopoHandle_, and badGlobalMuonTaggersAOD_cff::vtx.

96  {
97  using namespace edm;
98 
99  // Get digis
102 
103  // DigiSimLink
106 
107  // SimTrack
109 
110  // SimVertex
112 
113  // Tracker Topology
114  iSetup.get<TrackerTopologyRcd>().get(tTopoHandle_);
115 
116  edm::ESWatcher<TrackerDigiGeometryRecord> theTkDigiGeomWatcher;
117 
119  if (theTkDigiGeomWatcher.check(iSetup)) {
120  iSetup.get<TrackerDigiGeometryRecord>().get(geomType_, geomHandle);
121  }
122  if (!geomHandle.isValid())
123  return;
124 
125  // Fil # of SIM Vertices@
126  nSimVertices->Fill((*simVertices).size());
127  // Loop over Sim Tracks and Fill relevant histograms
128  int nTracks = 0;
129  int nTracksP = 0;
130  int nTracksS = 0;
131  for (edm::SimTrackContainer::const_iterator simTrkItr = simTracks->begin(); simTrkItr != simTracks->end();
132  ++simTrkItr) {
133  if (simTrkItr->charge() == 0)
134  continue;
135  int vtxIndex = simTrkItr->vertIndex();
136  int vtxParent = -1;
137  if (vtxIndex > 0) {
138  SimVertex vtx = (*simVertices)[vtxIndex];
139  if (!vtx.noParent()) {
140  int trkId = vtx.parentIndex();
141  vtxParent = (*simTracks)[matchedSimTrack(simTracks, trkId)].vertIndex();
142  }
143  }
144  int simTk_type = -1;
145  if (vtxIndex == 0 || vtxParent == 0)
146  simTk_type = 1;
147  else
148  simTk_type = 0;
149  nTracks++;
150  if (simTk_type == 1)
151  nTracksP++;
152  else
153  nTracksS++;
154 
155  float simTk_pt = simTrkItr->momentum().pt();
156  float simTk_eta = simTrkItr->momentum().eta();
157  float simTk_phi = simTrkItr->momentum().phi();
158 
159  if (fabs(simTk_eta) < etaCut_)
161  if (simTk_pt > ptCut_)
163  if (fabs(simTk_eta) < etaCut_ && simTk_pt > ptCut_)
165 
166  // initialize
167  for (auto& it : layerMEs) {
168  it.second.nDigis = 0;
169  it.second.nHits = 0;
170  }
171 
172  fillSimHitInfo(iEvent, (*simTrkItr), geomHandle);
174 
175  int nHitCutoff = 2;
176  if (pixelFlag_)
177  nHitCutoff = 1;
178  for (auto& it : layerMEs) {
179  DigiMEs& local_mes = it.second;
180  if (it.second.nHits < nHitCutoff) {
181  if (std::fabs(simTk_eta) < 1.0)
182  local_mes.MissedHitTrackPt->Fill(simTk_pt);
183  if (simTk_pt > ptCut_ && std::fabs(simTk_eta) < 1.0)
184  local_mes.MissedHitTrackEta->Fill(simTk_eta);
185  if (std::fabs(simTk_eta) < 1.0 && simTk_pt > ptCut_)
186  local_mes.MissedHitTrackPhi->Fill(simTk_phi);
187  }
188  }
189  }
190  nSimulatedTracks->Fill(nTracks);
191  nSimulatedTracksP->Fill(nTracksP);
192  nSimulatedTracksS->Fill(nTracksS);
193  if (pixelFlag_)
195  else
196  fillOTBXInfo();
197 }
const edm::EDGetTokenT< edm::DetSetVector< Phase2TrackerDigi > > otDigiToken_
const unsigned int nTracks(const reco::Vertex &sv)
edm::Handle< edm::SimTrackContainer > simTracks
std::map< unsigned int, DigiMEs > layerMEs
const edm::EDGetTokenT< edm::DetSetVector< PixelDigiSimLink > > itPixelDigiSimLinkToken_
edm::Handle< edm::DetSetVector< PixelDigiSimLink > > itPixelSimLinkHandle_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
edm::ESHandle< TrackerTopology > tTopoHandle_
int matchedSimTrack(edm::Handle< edm::SimTrackContainer > &SimTk, unsigned int simTrkId)
int fillSimHitInfo(const edm::Event &iEvent, const SimTrack simTrk, const edm::ESHandle< TrackerGeometry > gHandle)
const edm::EDGetTokenT< edm::SimVertexContainer > simVertexToken_
void Fill(long long x)
edm::Handle< edm::DetSetVector< PixelDigiSimLink > > otSimLinkHandle_
int parentIndex() const
Definition: SimVertex.h:29
edm::Handle< edm::DetSetVector< PixelDigi > > itPixelDigiHandle_
void fillHistogram(MonitorElement *th1, MonitorElement *th2, MonitorElement *th3, float val, int primary)
edm::Handle< edm::SimVertexContainer > simVertices
const edm::EDGetTokenT< edm::DetSetVector< PixelDigi > > itPixelDigiToken_
const edm::EDGetTokenT< edm::DetSetVector< PixelDigiSimLink > > otDigiSimLinkToken_
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:52
const edm::EDGetTokenT< edm::SimTrackContainer > simTrackToken_
HLT enums.
T get() const
Definition: EventSetup.h:73
bool noParent() const
Definition: SimVertex.h:30
edm::Handle< edm::DetSetVector< Phase2TrackerDigi > > otDigiHandle_
bool isValid() const
Definition: ESHandle.h:44
void Phase2TrackerValidateDigi::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
overridevirtual

Implements DQMEDAnalyzer.

Definition at line 379 of file Phase2TrackerValidateDigi.cc.

References dqm::dqmstoreimpl::DQMStore::IBooker::book1D(), dqm::dqmstoreimpl::DQMStore::IBooker::book2D(), bookLayerHistos(), dqm::dqmstoreimpl::DQMStore::IBooker::cd(), edm::ESWatcher< T >::check(), config_, TrackerGeometry::detUnits(), fed_dqm_sourceclient-live_cfg::folder_name, geomType_, edm::EventSetup::get(), edm::ParameterSet::getParameter(), MatchedRZPositionMap, MatchedXYPositionMap, nSimHitsPerTrack, nSimulatedTracks, nSimulatedTracksP, nSimulatedTracksS, nSimVertices, pixelFlag_, edm::ESHandle< T >::product(), dqm::dqmstoreimpl::DQMStore::IBooker::setCurrentFolder(), SimulatedRZPositionMap, SimulatedTOFEtaMap, SimulatedTOFPhiMap, SimulatedTOFRMap, SimulatedTOFZMap, SimulatedTrackEta, SimulatedTrackEtaP, SimulatedTrackEtaS, SimulatedTrackPhi, SimulatedTrackPhiP, SimulatedTrackPhiS, SimulatedTrackPt, SimulatedTrackPtP, SimulatedTrackPtS, SimulatedXYPositionMap, AlCaHLTBitMon_QueryRunRegistry::string, and tTopoHandle_.

381  {
382  std::string top_folder = config_.getParameter<std::string>("TopFolderName");
383  std::stringstream folder_name;
384 
385  ibooker.cd();
386  folder_name << top_folder << "/"
387  << "SimTrackInfo";
388  ibooker.setCurrentFolder(folder_name.str());
389 
390  edm::LogInfo("Phase2TrackerValidateDigi") << " Booking Histograms in : " << folder_name.str();
391  std::stringstream HistoName;
392 
393  HistoName.str("");
394  HistoName << "NumberOfSimulatedTracks";
395  nSimulatedTracks = ibooker.book1D(HistoName.str(), HistoName.str(), 501, -0.5, 500.5);
396 
397  HistoName.str("");
398  HistoName << "NumberOfSimulatedTracksP";
399  nSimulatedTracksP = ibooker.book1D(HistoName.str(), HistoName.str(), 501, -0.5, 500.5);
400 
401  HistoName.str("");
402  HistoName << "NumberOfSimulatedTracksS";
403  nSimulatedTracksS = ibooker.book1D(HistoName.str(), HistoName.str(), 501, -0.5, 500.5);
404 
405  HistoName.str("");
406  HistoName << "NumberOfSimulatedVertices";
407  nSimVertices = ibooker.book1D(HistoName.str(), HistoName.str(), 101, -0.5, 100.5);
408 
410  HistoName.str("");
411  HistoName << "SimulatedTrackPt";
412  if (Parameters.getParameter<bool>("switch"))
413  SimulatedTrackPt = ibooker.book1D(HistoName.str(),
414  HistoName.str(),
415  Parameters.getParameter<int32_t>("Nbins"),
416  Parameters.getParameter<double>("xmin"),
417  Parameters.getParameter<double>("xmax"));
418  else
419  SimulatedTrackPt = nullptr;
420  /*
421  HistoName.str("");
422  HistoName << "SimulatedTrackPt";
423  SimulatedTrackPt = ibooker.book1D(HistoName.str(),HistoName.str(),
424  Parameters.getParameter<int32_t>("Nbins"),
425  Parameters.getParameter<double>("xmin"),
426  Parameters.getParameter<double>("xmax");*/
427  HistoName.str("");
428  HistoName << "SimulatedTrackPtP";
429  if (Parameters.getParameter<bool>("switch"))
430  SimulatedTrackPtP = ibooker.book1D(HistoName.str(),
431  HistoName.str(),
432  Parameters.getParameter<int32_t>("Nbins"),
433  Parameters.getParameter<double>("xmin"),
434  Parameters.getParameter<double>("xmax"));
435  else
436  SimulatedTrackPtP = nullptr;
437  HistoName.str("");
438  HistoName << "SimulatedTrackPtS";
439  if (Parameters.getParameter<bool>("switch"))
440  SimulatedTrackPtS = ibooker.book1D(HistoName.str(),
441  HistoName.str(),
442  Parameters.getParameter<int32_t>("Nbins"),
443  Parameters.getParameter<double>("xmin"),
444  Parameters.getParameter<double>("xmax"));
445  else
446  SimulatedTrackPtS = nullptr;
447 
448  Parameters = config_.getParameter<edm::ParameterSet>("TrackEtaH");
449  HistoName.str("");
450  HistoName << "SimulatedTrackEta";
451  if (Parameters.getParameter<bool>("switch"))
452  SimulatedTrackEta = ibooker.book1D(HistoName.str(),
453  HistoName.str(),
454  Parameters.getParameter<int32_t>("Nbins"),
455  Parameters.getParameter<double>("xmin"),
456  Parameters.getParameter<double>("xmax"));
457  else
458  SimulatedTrackEta = nullptr;
459  HistoName.str("");
460  HistoName << "SimulatedTrackEtaP";
461  if (Parameters.getParameter<bool>("switch"))
462  SimulatedTrackEtaP = ibooker.book1D(HistoName.str(),
463  HistoName.str(),
464  Parameters.getParameter<int32_t>("Nbins"),
465  Parameters.getParameter<double>("xmin"),
466  Parameters.getParameter<double>("xmax"));
467  else
468  SimulatedTrackEtaP = nullptr;
469  HistoName.str("");
470  HistoName << "SimulatedTrackEtaS";
471  if (Parameters.getParameter<bool>("switch"))
472  SimulatedTrackEtaS = ibooker.book1D(HistoName.str(),
473  HistoName.str(),
474  Parameters.getParameter<int32_t>("Nbins"),
475  Parameters.getParameter<double>("xmin"),
476  Parameters.getParameter<double>("xmax"));
477  else
478  SimulatedTrackEtaS = nullptr;
479 
480  Parameters = config_.getParameter<edm::ParameterSet>("TrackPhiH");
481  HistoName.str("");
482  HistoName << "SimulatedTrackPhi";
483  if (Parameters.getParameter<bool>("switch"))
484  SimulatedTrackPhi = ibooker.book1D(HistoName.str(),
485  HistoName.str(),
486  Parameters.getParameter<int32_t>("Nbins"),
487  Parameters.getParameter<double>("xmin"),
488  Parameters.getParameter<double>("xmax"));
489  else
490  SimulatedTrackPhi = nullptr;
491 
492  HistoName.str("");
493  HistoName << "SimulatedTrackPhiP";
494  if (Parameters.getParameter<bool>("switch"))
495  SimulatedTrackPhiP = ibooker.book1D(HistoName.str(),
496  HistoName.str(),
497  Parameters.getParameter<int32_t>("Nbins"),
498  Parameters.getParameter<double>("xmin"),
499  Parameters.getParameter<double>("xmax"));
500  else
501  SimulatedTrackPhiP = nullptr;
502 
503  HistoName.str("");
504  HistoName << "SimulatedTrackPhiS";
505  if (Parameters.getParameter<bool>("switch"))
506  SimulatedTrackPhiS = ibooker.book1D(HistoName.str(),
507  HistoName.str(),
508  Parameters.getParameter<int32_t>("Nbins"),
509  Parameters.getParameter<double>("xmin"),
510  Parameters.getParameter<double>("xmax"));
511  else
512  SimulatedTrackPhiS = nullptr;
513 
514  Parameters = config_.getParameter<edm::ParameterSet>("XYPositionMapH");
515  HistoName.str("");
516  HistoName << "SimulatedXPosVsYPos";
517  if (Parameters.getParameter<bool>("switch"))
518  SimulatedXYPositionMap = ibooker.book2D(HistoName.str(),
519  HistoName.str(),
520  Parameters.getParameter<int32_t>("Nxbins"),
521  Parameters.getParameter<double>("xmin"),
522  Parameters.getParameter<double>("xmax"),
523  Parameters.getParameter<int32_t>("Nybins"),
524  Parameters.getParameter<double>("ymin"),
525  Parameters.getParameter<double>("ymax"));
526  else
527  SimulatedXYPositionMap = nullptr;
528 
529  Parameters = config_.getParameter<edm::ParameterSet>("RZPositionMapH");
530  HistoName.str("");
531  HistoName << "SimulatedRPosVsZPos";
532  if (Parameters.getParameter<bool>("switch"))
533  SimulatedRZPositionMap = ibooker.book2D(HistoName.str(),
534  HistoName.str(),
535  Parameters.getParameter<int32_t>("Nxbins"),
536  Parameters.getParameter<double>("xmin"),
537  Parameters.getParameter<double>("xmax"),
538  Parameters.getParameter<int32_t>("Nybins"),
539  Parameters.getParameter<double>("ymin"),
540  Parameters.getParameter<double>("ymax"));
541  else
542  SimulatedRZPositionMap = nullptr;
543 
544  //add TOF maps
545  Parameters = config_.getParameter<edm::ParameterSet>("TOFEtaMapH");
546  HistoName.str("");
547  HistoName << "SimulatedTOFVsEta";
548  if (Parameters.getParameter<bool>("switch"))
549  SimulatedTOFEtaMap = ibooker.book2D(HistoName.str(),
550  HistoName.str(),
551  Parameters.getParameter<int32_t>("Nxbins"),
552  Parameters.getParameter<double>("xmin"),
553  Parameters.getParameter<double>("xmax"),
554  Parameters.getParameter<int32_t>("Nybins"),
555  Parameters.getParameter<double>("ymin"),
556  Parameters.getParameter<double>("ymax"));
557  else
558  SimulatedTOFEtaMap = nullptr;
559  Parameters = config_.getParameter<edm::ParameterSet>("TOFPhiMapH");
560  HistoName.str("");
561  HistoName << "SimulatedTOFVsPhi";
562  if (Parameters.getParameter<bool>("switch"))
563  SimulatedTOFPhiMap = ibooker.book2D(HistoName.str(),
564  HistoName.str(),
565  Parameters.getParameter<int32_t>("Nxbins"),
566  Parameters.getParameter<double>("xmin"),
567  Parameters.getParameter<double>("xmax"),
568  Parameters.getParameter<int32_t>("Nybins"),
569  Parameters.getParameter<double>("ymin"),
570  Parameters.getParameter<double>("ymax"));
571  else
572  SimulatedTOFPhiMap = nullptr;
573  Parameters = config_.getParameter<edm::ParameterSet>("TOFRMapH");
574  HistoName.str("");
575  HistoName << "SimulatedTOFVsR";
576  if (Parameters.getParameter<bool>("switch"))
577  SimulatedTOFRMap = ibooker.book2D(HistoName.str(),
578  HistoName.str(),
579  Parameters.getParameter<int32_t>("Nxbins"),
580  Parameters.getParameter<double>("xmin"),
581  Parameters.getParameter<double>("xmax"),
582  Parameters.getParameter<int32_t>("Nybins"),
583  Parameters.getParameter<double>("ymin"),
584  Parameters.getParameter<double>("ymax"));
585  else
586  SimulatedTOFRMap = nullptr;
587  Parameters = config_.getParameter<edm::ParameterSet>("TOFZMapH");
588  HistoName.str("");
589  HistoName << "SimulatedTOFVsZ";
590  if (Parameters.getParameter<bool>("switch"))
591  SimulatedTOFZMap = ibooker.book2D(HistoName.str(),
592  HistoName.str(),
593  Parameters.getParameter<int32_t>("Nxbins"),
594  Parameters.getParameter<double>("xmin"),
595  Parameters.getParameter<double>("xmax"),
596  Parameters.getParameter<int32_t>("Nybins"),
597  Parameters.getParameter<double>("ymin"),
598  Parameters.getParameter<double>("ymax"));
599  else
600  SimulatedTOFZMap = nullptr;
601 
602  HistoName.str("");
603  HistoName << "NumberOfSimHitsPerTrackVsLayer";
604  nSimHitsPerTrack = ibooker.book2D(HistoName.str(), HistoName.str(), 45, -22.5, 22.5, 101, -0.5, 100.5);
605 
606  edm::ESWatcher<TrackerDigiGeometryRecord> theTkDigiGeomWatcher;
607 
608  iSetup.get<TrackerTopologyRcd>().get(tTopoHandle_);
609  const TrackerTopology* const tTopo = tTopoHandle_.product();
610 
611  if (theTkDigiGeomWatcher.check(iSetup)) {
612  edm::ESHandle<TrackerGeometry> geom_handle;
613  iSetup.get<TrackerDigiGeometryRecord>().get(geomType_, geom_handle);
614  const TrackerGeometry* tGeom = geom_handle.product();
615 
616  for (auto const& det_u : tGeom->detUnits()) {
617  unsigned int detId_raw = det_u->geographicalId().rawId();
618  bookLayerHistos(ibooker, detId_raw, tTopo, pixelFlag_);
619  }
620  }
621  ibooker.cd();
622  folder_name.str("");
623  folder_name << top_folder << "/"
624  << "DigiMonitor";
625  ibooker.setCurrentFolder(folder_name.str());
626 
627  Parameters = config_.getParameter<edm::ParameterSet>("XYPositionMapH");
628  HistoName.str("");
629  HistoName << "MatchedSimXPosVsYPos";
630  if (Parameters.getParameter<bool>("switch"))
631  MatchedXYPositionMap = ibooker.book2D(HistoName.str(),
632  HistoName.str(),
633  Parameters.getParameter<int32_t>("Nxbins"),
634  Parameters.getParameter<double>("xmin"),
635  Parameters.getParameter<double>("xmax"),
636  Parameters.getParameter<int32_t>("Nybins"),
637  Parameters.getParameter<double>("ymin"),
638  Parameters.getParameter<double>("ymax"));
639  else
640  MatchedXYPositionMap = nullptr;
641 
642  Parameters = config_.getParameter<edm::ParameterSet>("RZPositionMapH");
643  HistoName.str("");
644  HistoName << "MatchedSimRPosVsZPos";
645  if (Parameters.getParameter<bool>("switch"))
646  MatchedRZPositionMap = ibooker.book2D(HistoName.str(),
647  HistoName.str(),
648  Parameters.getParameter<int32_t>("Nxbins"),
649  Parameters.getParameter<double>("xmin"),
650  Parameters.getParameter<double>("xmax"),
651  Parameters.getParameter<int32_t>("Nybins"),
652  Parameters.getParameter<double>("ymin"),
653  Parameters.getParameter<double>("ymax"));
654  else
655  MatchedRZPositionMap = nullptr;
656 }
T getParameter(std::string const &) const
const DetContainer & detUnits() const override
Returm a vector of all GeomDet.
edm::ESHandle< TrackerTopology > tTopoHandle_
vector< ParameterSet > Parameters
void bookLayerHistos(DQMStore::IBooker &ibooker, unsigned int det_id, const TrackerTopology *tTopo, bool flag)
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:52
std::string HistoName
T const * product() const
Definition: ESHandle.h:86
void Phase2TrackerValidateDigi::bookLayerHistos ( DQMStore::IBooker ibooker,
unsigned int  det_id,
const TrackerTopology tTopo,
bool  flag 
)
private

Definition at line 660 of file Phase2TrackerValidateDigi.cc.

References dqm::dqmstoreimpl::DQMStore::IBooker::book1D(), dqm::dqmstoreimpl::DQMStore::IBooker::book2D(), dqm::dqmstoreimpl::DQMStore::IBooker::bookProfile(), Phase2TrackerValidateDigi::DigiMEs::BunchXTimeBin, dqm::dqmstoreimpl::DQMStore::IBooker::cd(), config_, fed_dqm_sourceclient-live_cfg::folder_name, Phase2TrackerValidateDigi::DigiMEs::FractionOfOOTDigis, TrackerTopology::getITPixelLayerNumber(), TrackerTopology::getOTLayerNumber(), edm::ParameterSet::getParameter(), layerMEs, Phase2TrackerValidateDigi::DigiMEs::MatchedSimHitElossP, Phase2TrackerValidateDigi::DigiMEs::MatchedSimHitElossS, Phase2TrackerValidateDigi::DigiMEs::MatchedTrackEta, Phase2TrackerValidateDigi::DigiMEs::MatchedTrackPhi, Phase2TrackerValidateDigi::DigiMEs::MatchedTrackPt, Phase2TrackerValidateDigi::DigiMEs::MissedDigiLocalXposVsYPos, Phase2TrackerValidateDigi::DigiMEs::MissedDigiSimHitElossP, Phase2TrackerValidateDigi::DigiMEs::MissedDigiSimHitElossS, Phase2TrackerValidateDigi::DigiMEs::MissedDigiTimeWindow, Phase2TrackerValidateDigi::DigiMEs::MissedDigiTrackEta, Phase2TrackerValidateDigi::DigiMEs::MissedDigiTrackPhi, Phase2TrackerValidateDigi::DigiMEs::MissedDigiTrackPt, Phase2TrackerValidateDigi::DigiMEs::MissedHitTrackEta, Phase2TrackerValidateDigi::DigiMEs::MissedHitTrackPhi, Phase2TrackerValidateDigi::DigiMEs::MissedHitTrackPt, Phase2TrackerValidateDigi::DigiMEs::nDigis, dqm::dqmstoreimpl::DQMStore::IBooker::setCurrentFolder(), Phase2TrackerValidateDigi::DigiMEs::SimHitDx, Phase2TrackerValidateDigi::DigiMEs::SimHitDy, Phase2TrackerValidateDigi::DigiMEs::SimHitDz, Phase2TrackerValidateDigi::DigiMEs::SimTrackEta, Phase2TrackerValidateDigi::DigiMEs::SimTrackPhi, Phase2TrackerValidateDigi::DigiMEs::SimTrackPt, AlCaHLTBitMon_QueryRunRegistry::string, and GlobalPosition_Frontier_DevDB_cff::tag.

Referenced by bookHistograms().

663  {
664  int layer;
665  if (flag)
666  layer = tTopo->getITPixelLayerNumber(det_id);
667  else
668  layer = tTopo->getOTLayerNumber(det_id);
669 
670  if (layer < 0)
671  return;
672  std::map<uint32_t, DigiMEs>::iterator pos = layerMEs.find(layer);
673  if (pos == layerMEs.end()) {
674  std::string top_folder = config_.getParameter<std::string>("TopFolderName");
675  std::stringstream folder_name;
676 
677  std::ostringstream fname1, fname2, tag;
678  if (layer < 100) {
679  fname1 << "Barrel";
680  fname2 << "Layer_" << layer;
681  } else {
682  int side = layer / 100;
683  int idisc = layer - side * 100;
684  fname1 << "EndCap_Side_" << side;
685  fname2 << "Disc_" << idisc;
686  }
687 
688  ibooker.cd();
689  folder_name << top_folder << "/"
690  << "DigiMonitor"
691  << "/" << fname1.str() << "/" << fname2.str();
692  edm::LogInfo("Phase2TrackerValidateDigi") << " Booking Histograms in : " << folder_name.str();
693 
694  ibooker.setCurrentFolder(folder_name.str());
695 
696  std::ostringstream HistoName;
697 
698  DigiMEs local_mes;
699 
701  HistoName.str("");
702  HistoName << "SimTrackPt_" << fname2.str();
703  if (Parameters.getParameter<bool>("switch"))
704  local_mes.SimTrackPt = ibooker.book1D(HistoName.str(),
705  HistoName.str(),
706  Parameters.getParameter<int32_t>("Nbins"),
707  Parameters.getParameter<double>("xmin"),
708  Parameters.getParameter<double>("xmax"));
709  else
710  local_mes.SimTrackPt = nullptr;
711  HistoName.str("");
712  HistoName << "MatchedTrackPt_" << fname2.str();
713  if (Parameters.getParameter<bool>("switch"))
714  local_mes.MatchedTrackPt = ibooker.book1D(HistoName.str(),
715  HistoName.str(),
716  Parameters.getParameter<int32_t>("Nbins"),
717  Parameters.getParameter<double>("xmin"),
718  Parameters.getParameter<double>("xmax"));
719  else
720  local_mes.MatchedTrackPt = nullptr;
721  HistoName.str("");
722  HistoName << "MissedHitTrackPt_" << fname2.str();
723  if (Parameters.getParameter<bool>("switch"))
724  local_mes.MissedHitTrackPt = ibooker.book1D(HistoName.str(),
725  HistoName.str(),
726  Parameters.getParameter<int32_t>("Nbins"),
727  Parameters.getParameter<double>("xmin"),
728  Parameters.getParameter<double>("xmax"));
729  else
730  local_mes.MissedHitTrackPt = nullptr;
731  HistoName.str("");
732  HistoName << "MissedDigiTrackPt_" << fname2.str();
733  if (Parameters.getParameter<bool>("switch"))
734  local_mes.MissedDigiTrackPt = ibooker.book1D(HistoName.str(),
735  HistoName.str(),
736  Parameters.getParameter<int32_t>("Nbins"),
737  Parameters.getParameter<double>("xmin"),
738  Parameters.getParameter<double>("xmax"));
739  else
740  local_mes.MissedDigiTrackPt = nullptr;
741 
742  Parameters = config_.getParameter<edm::ParameterSet>("TrackEtaH");
743  HistoName.str("");
744  HistoName << "SimTrackEta_" << fname2.str();
745  if (Parameters.getParameter<bool>("switch"))
746  local_mes.SimTrackEta = ibooker.book1D(HistoName.str(),
747  HistoName.str(),
748  Parameters.getParameter<int32_t>("Nbins"),
749  Parameters.getParameter<double>("xmin"),
750  Parameters.getParameter<double>("xmax"));
751  else
752  local_mes.SimTrackEta = nullptr;
753  HistoName.str("");
754  HistoName << "MatchedTrackEta_" << fname2.str();
755  if (Parameters.getParameter<bool>("switch"))
756  local_mes.MatchedTrackEta = ibooker.book1D(HistoName.str(),
757  HistoName.str(),
758  Parameters.getParameter<int32_t>("Nbins"),
759  Parameters.getParameter<double>("xmin"),
760  Parameters.getParameter<double>("xmax"));
761  else
762  local_mes.MatchedTrackEta = nullptr;
763  HistoName.str("");
764  HistoName << "MissedHitTrackEta_" << fname2.str();
765  if (Parameters.getParameter<bool>("switch"))
766  local_mes.MissedHitTrackEta = ibooker.book1D(HistoName.str(),
767  HistoName.str(),
768  Parameters.getParameter<int32_t>("Nbins"),
769  Parameters.getParameter<double>("xmin"),
770  Parameters.getParameter<double>("xmax"));
771  else
772  local_mes.MissedHitTrackEta = nullptr;
773  HistoName.str("");
774  HistoName << "MissedDigiTrackEta_" << fname2.str();
775  if (Parameters.getParameter<bool>("switch"))
776  local_mes.MissedDigiTrackEta = ibooker.book1D(HistoName.str(),
777  HistoName.str(),
778  Parameters.getParameter<int32_t>("Nbins"),
779  Parameters.getParameter<double>("xmin"),
780  Parameters.getParameter<double>("xmax"));
781  else
782  local_mes.MissedDigiTrackEta = nullptr;
783 
784  Parameters = config_.getParameter<edm::ParameterSet>("TrackPhiH");
785  HistoName.str("");
786  HistoName << "SimTrackPhi_" << fname2.str();
787  if (Parameters.getParameter<bool>("switch"))
788  local_mes.SimTrackPhi = ibooker.book1D(HistoName.str(),
789  HistoName.str(),
790  Parameters.getParameter<int32_t>("Nbins"),
791  Parameters.getParameter<double>("xmin"),
792  Parameters.getParameter<double>("xmax"));
793  else
794  local_mes.SimTrackPhi = nullptr;
795  HistoName.str("");
796  HistoName << "MatchedTrackPhi_" << fname2.str();
797  if (Parameters.getParameter<bool>("switch"))
798  local_mes.MatchedTrackPhi = ibooker.book1D(HistoName.str(),
799  HistoName.str(),
800  Parameters.getParameter<int32_t>("Nbins"),
801  Parameters.getParameter<double>("xmin"),
802  Parameters.getParameter<double>("xmax"));
803  else
804  local_mes.MatchedTrackPhi = nullptr;
805  HistoName.str("");
806  HistoName << "MissedHitTrackPhi_" << fname2.str();
807  if (Parameters.getParameter<bool>("switch"))
808  local_mes.MissedHitTrackPhi = ibooker.book1D(HistoName.str(),
809  HistoName.str(),
810  Parameters.getParameter<int32_t>("Nbins"),
811  Parameters.getParameter<double>("xmin"),
812  Parameters.getParameter<double>("xmax"));
813  else
814  local_mes.MissedHitTrackPhi = nullptr;
815  HistoName.str("");
816  HistoName << "MissedDigiTrackPhi_" << fname2.str();
817  if (Parameters.getParameter<bool>("switch"))
818  local_mes.MissedDigiTrackPhi = ibooker.book1D(HistoName.str(),
819  HistoName.str(),
820  Parameters.getParameter<int32_t>("Nbins"),
821  Parameters.getParameter<double>("xmin"),
822  Parameters.getParameter<double>("xmax"));
823  else
824  local_mes.MissedDigiTrackPhi = nullptr;
825 
826  Parameters = config_.getParameter<edm::ParameterSet>("SimHitElossH");
827  HistoName.str("");
828  HistoName << "MatchedSimHitElossS_" << fname2.str();
829  if (Parameters.getParameter<bool>("switch"))
830  local_mes.MatchedSimHitElossS = ibooker.book1D(HistoName.str(),
831  HistoName.str(),
832  Parameters.getParameter<int32_t>("Nbins"),
833  Parameters.getParameter<double>("xmin"),
834  Parameters.getParameter<double>("xmax"));
835  else
836  local_mes.MatchedSimHitElossS = nullptr;
837  HistoName.str("");
838  HistoName << "MatchedSimHitElossP_" << fname2.str();
839  if (Parameters.getParameter<bool>("switch"))
840  local_mes.MatchedSimHitElossP = ibooker.book1D(HistoName.str(),
841  HistoName.str(),
842  Parameters.getParameter<int32_t>("Nbins"),
843  Parameters.getParameter<double>("xmin"),
844  Parameters.getParameter<double>("xmax"));
845  else
846  local_mes.MatchedSimHitElossP = nullptr;
847  HistoName.str("");
848  HistoName << "MissedDigiSimHitElossS_" << fname2.str();
849  if (Parameters.getParameter<bool>("switch"))
850  local_mes.MissedDigiSimHitElossS = ibooker.book1D(HistoName.str(),
851  HistoName.str(),
852  Parameters.getParameter<int32_t>("Nbins"),
853  Parameters.getParameter<double>("xmin"),
854  Parameters.getParameter<double>("xmax"));
855  else
856  local_mes.MissedDigiSimHitElossS = nullptr;
857  HistoName.str("");
858  HistoName << "MissedDigiSimHitElossP_" << fname2.str();
859  if (Parameters.getParameter<bool>("switch"))
860  local_mes.MissedDigiSimHitElossP = ibooker.book1D(HistoName.str(),
861  HistoName.str(),
862  Parameters.getParameter<int32_t>("Nbins"),
863  Parameters.getParameter<double>("xmin"),
864  Parameters.getParameter<double>("xmax"));
865  else
866  local_mes.MissedDigiSimHitElossP = nullptr;
867 
868  Parameters = config_.getParameter<edm::ParameterSet>("SimHitDxH");
869  HistoName.str("");
870  HistoName << "SimHitDx_" << fname2.str();
871  if (Parameters.getParameter<bool>("switch"))
872  local_mes.SimHitDx = ibooker.book1D(HistoName.str(),
873  HistoName.str(),
874  Parameters.getParameter<int32_t>("Nbins"),
875  Parameters.getParameter<double>("xmin"),
876  Parameters.getParameter<double>("xmax"));
877  else
878  local_mes.SimHitDx = nullptr;
879 
880  Parameters = config_.getParameter<edm::ParameterSet>("SimHitDyH");
881  HistoName.str("");
882  HistoName << "SimHitDy_" << fname2.str();
883  if (Parameters.getParameter<bool>("switch"))
884  local_mes.SimHitDy = ibooker.book1D(HistoName.str(),
885  HistoName.str(),
886  Parameters.getParameter<int32_t>("Nbins"),
887  Parameters.getParameter<double>("xmin"),
888  Parameters.getParameter<double>("xmax"));
889  else
890  local_mes.SimHitDy = nullptr;
891 
892  Parameters = config_.getParameter<edm::ParameterSet>("SimHitDzH");
893  HistoName.str("");
894  HistoName << "SimHitDz_" << fname2.str();
895  if (Parameters.getParameter<bool>("switch"))
896  local_mes.SimHitDz = ibooker.book1D(HistoName.str(),
897  HistoName.str(),
898  Parameters.getParameter<int32_t>("Nbins"),
899  Parameters.getParameter<double>("xmin"),
900  Parameters.getParameter<double>("xmax"));
901  else
902  local_mes.SimHitDz = nullptr;
903 
904  HistoName.str("");
905  HistoName << "BunchXingWindow_" << fname2.str();
906  local_mes.BunchXTimeBin = ibooker.book1D(HistoName.str(), HistoName.str(), 8, -5.5, 2.5);
907 
908  HistoName.str("");
909  HistoName << "FractionOfOOTPUDigi_" << fname2.str();
910  local_mes.FractionOfOOTDigis = ibooker.bookProfile(HistoName.str(), HistoName.str(), 8, -5.5, 2.5, 0., 1.0, "s");
911 
912  HistoName.str("");
913  HistoName << "MissedDigiLocalXPosvsYPos_" << fname2.str();
914  local_mes.MissedDigiLocalXposVsYPos =
915  ibooker.book2D(HistoName.str(), HistoName.str(), 130, -6.5, 6.5, 130, -6.5, 6.5);
916 
917  Parameters = config_.getParameter<edm::ParameterSet>("TOFEtaMapH");
918  HistoName.str("");
919  HistoName << "MissedDigiTimeWindow_" << fname2.str();
920  if (Parameters.getParameter<bool>("switch"))
921  local_mes.MissedDigiTimeWindow = ibooker.book1D(HistoName.str(), HistoName.str(), 100, -0.5, 49.5);
922  else
923  local_mes.MissedDigiTimeWindow = nullptr;
924  local_mes.nDigis = 0;
925  layerMEs.insert(std::make_pair(layer, local_mes));
926  }
927 }
T getParameter(std::string const &) const
std::map< unsigned int, DigiMEs > layerMEs
vector< ParameterSet > Parameters
int getITPixelLayerNumber(const DetId &id) const
std::string HistoName
int getOTLayerNumber(const DetId &id) const
void Phase2TrackerValidateDigi::dqmBeginRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)
override

Definition at line 90 of file Phase2TrackerValidateDigi.cc.

90  {
91  edm::LogInfo("Phase2TrackerValidateDigi") << "Initialize Phase2TrackerValidateDigi ";
92 }
void Phase2TrackerValidateDigi::fillHistogram ( MonitorElement th1,
MonitorElement th2,
MonitorElement th3,
float  val,
int  primary 
)
private

Definition at line 1051 of file Phase2TrackerValidateDigi.cc.

References dqm::impl::MonitorElement::Fill().

Referenced by analyze().

1052  {
1053  if (th1)
1054  th1->Fill(val);
1055  if (th2 && primary == 1)
1056  th2->Fill(val);
1057  if (th3 && primary != 1)
1058  th3->Fill(val);
1059 }
void Fill(long long x)
void Phase2TrackerValidateDigi::fillHitsPerTrack ( )
private

Definition at line 1063 of file Phase2TrackerValidateDigi.cc.

References DEFINE_FWK_MODULE, dqm::impl::MonitorElement::Fill(), layerMEs, Phase2TrackerValidateDigi::DigiMEs::nHits, and nSimHitsPerTrack.

Referenced by analyze().

1063  {
1064  for (const auto& it : layerMEs) {
1065  const DigiMEs& local_mes = it.second;
1066  unsigned int layer = it.first;
1067  int lval;
1068  if (layer < 10)
1069  lval = layer;
1070  else if (layer / 100 == 1)
1071  lval = 100 - (layer + 10);
1072  else if (layer / 100 == 2)
1073  lval = (layer + 10) - 200;
1074  else
1075  lval = 0;
1076  nSimHitsPerTrack->Fill(lval, local_mes.nHits);
1077  }
1078 }
std::map< unsigned int, DigiMEs > layerMEs
void Fill(long long x)
void Phase2TrackerValidateDigi::fillITPixelBXInfo ( )
private

Definition at line 987 of file Phase2TrackerValidateDigi.cc.

References edm::DetSetVector< T >::begin(), Phase2TrackerValidateDigi::DigiMEs::BunchXTimeBin, l1GtPatternGenerator_cfi::bx, edm::DetSetVector< T >::end(), dqm::impl::MonitorElement::Fill(), Phase2TrackerValidateDigi::DigiMEs::FractionOfOOTDigis, TrackerTopology::getITPixelLayerNumber(), itPixelSimLinkHandle_, layerMEs, electronStore::links, edm::Handle< T >::product(), align::Tracker, tTopoHandle_, and findQualityFiles::v.

Referenced by analyze().

987  {
989 
990  for (typename edm::DetSetVector<PixelDigiSimLink>::const_iterator DSViter = links->begin(); DSViter != links->end();
991  DSViter++) {
992  unsigned int rawid = DSViter->id;
993  DetId detId(rawid);
994  if (DetId(detId).det() != DetId::Detector::Tracker)
995  continue;
996  int layer = tTopoHandle_->getITPixelLayerNumber(rawid);
997  if (layer < 0)
998  continue;
999  std::map<uint32_t, DigiMEs>::iterator pos = layerMEs.find(layer);
1000  if (pos == layerMEs.end())
1001  continue;
1002  DigiMEs& local_mes = pos->second;
1003  int tot_digi = 0;
1004  std::map<int, float> bxMap;
1005  for (typename edm::DetSet<PixelDigiSimLink>::const_iterator di = DSViter->begin(); di != DSViter->end(); di++) {
1006  tot_digi++;
1007  int bx = di->eventId().bunchCrossing();
1008  std::map<int, float>::iterator ic = bxMap.find(bx);
1009  if (ic == bxMap.end())
1010  bxMap[bx] = 1.0;
1011  else
1012  bxMap[bx] += 1.0;
1013  }
1014  for (const auto& v : bxMap) {
1015  if (tot_digi) {
1016  local_mes.BunchXTimeBin->Fill(v.first, v.second);
1017  local_mes.FractionOfOOTDigis->Fill(v.first, v.second / tot_digi);
1018  }
1019  }
1020  }
1021 }
std::map< unsigned int, DigiMEs > layerMEs
edm::Handle< edm::DetSetVector< PixelDigiSimLink > > itPixelSimLinkHandle_
edm::ESHandle< TrackerTopology > tTopoHandle_
int getITPixelLayerNumber(const DetId &id) const
iterator end()
Return the off-the-end iterator.
Definition: DetSetVector.h:325
Definition: DetId.h:17
T const * product() const
Definition: Handle.h:69
iterator begin()
Return an iterator to the first DetSet.
Definition: DetSetVector.h:314
collection_type::const_iterator const_iterator
Definition: DetSet.h:32
collection_type::const_iterator const_iterator
Definition: DetSetVector.h:102
void Phase2TrackerValidateDigi::fillOTBXInfo ( )
private

Definition at line 952 of file Phase2TrackerValidateDigi.cc.

References edm::DetSetVector< T >::begin(), Phase2TrackerValidateDigi::DigiMEs::BunchXTimeBin, l1GtPatternGenerator_cfi::bx, edm::DetSetVector< T >::end(), dqm::impl::MonitorElement::Fill(), Phase2TrackerValidateDigi::DigiMEs::FractionOfOOTDigis, TrackerTopology::getOTLayerNumber(), layerMEs, electronStore::links, otSimLinkHandle_, edm::Handle< T >::product(), align::Tracker, tTopoHandle_, and findQualityFiles::v.

Referenced by analyze().

952  {
954 
955  for (typename edm::DetSetVector<PixelDigiSimLink>::const_iterator DSViter = links->begin(); DSViter != links->end();
956  DSViter++) {
957  unsigned int rawid = DSViter->id;
958  DetId detId(rawid);
959  if (DetId(detId).det() != DetId::Detector::Tracker)
960  continue;
961  int layer = tTopoHandle_->getOTLayerNumber(rawid);
962  if (layer < 0)
963  continue;
964  std::map<uint32_t, DigiMEs>::iterator pos = layerMEs.find(layer);
965  if (pos == layerMEs.end())
966  continue;
967  DigiMEs& local_mes = pos->second;
968  int tot_digi = 0;
969  std::map<int, float> bxMap;
970  for (typename edm::DetSet<PixelDigiSimLink>::const_iterator di = DSViter->begin(); di != DSViter->end(); di++) {
971  tot_digi++;
972  int bx = di->eventId().bunchCrossing();
973  std::map<int, float>::iterator ic = bxMap.find(bx);
974  if (ic == bxMap.end())
975  bxMap[bx] = 1.0;
976  else
977  bxMap[bx] += 1.0;
978  }
979  for (const auto& v : bxMap) {
980  if (tot_digi) {
981  local_mes.BunchXTimeBin->Fill(v.first, v.second);
982  local_mes.FractionOfOOTDigis->Fill(v.first, v.second / tot_digi);
983  }
984  }
985  }
986 }
std::map< unsigned int, DigiMEs > layerMEs
edm::ESHandle< TrackerTopology > tTopoHandle_
edm::Handle< edm::DetSetVector< PixelDigiSimLink > > otSimLinkHandle_
iterator end()
Return the off-the-end iterator.
Definition: DetSetVector.h:325
Definition: DetId.h:17
T const * product() const
Definition: Handle.h:69
iterator begin()
Return an iterator to the first DetSet.
Definition: DetSetVector.h:314
collection_type::const_iterator const_iterator
Definition: DetSet.h:32
collection_type::const_iterator const_iterator
Definition: DetSetVector.h:102
int getOTLayerNumber(const DetId &id) const
int Phase2TrackerValidateDigi::fillSimHitInfo ( const edm::Event iEvent,
const SimTrack  simTrk,
const edm::ESHandle< TrackerGeometry gHandle 
)
private

Definition at line 199 of file Phase2TrackerValidateDigi.cc.

References cval, PVValHelper::eta, PV3DBase< T, PVType, FrameType >::eta(), etaCut_, dqm::impl::MonitorElement::Fill(), findITPixelDigi(), findOTDigi(), edm::Event::getByToken(), TrackerTopology::getITPixelLayerNumber(), TrackerTopology::getOTLayerNumber(), GeVperElectron, triggerObjects_cff::id, TrackerGeometry::idToDet(), TrackerGeometry::idToDetUnit(), isPrimary(), edm::HandleBase::isValid(), layerMEs, PV3DBase< T, PVType, FrameType >::mag(), MatchedRZPositionMap, Phase2TrackerValidateDigi::DigiMEs::MatchedSimHitElossP, Phase2TrackerValidateDigi::DigiMEs::MatchedSimHitElossS, Phase2TrackerValidateDigi::DigiMEs::MatchedTrackEta, Phase2TrackerValidateDigi::DigiMEs::MatchedTrackPhi, Phase2TrackerValidateDigi::DigiMEs::MatchedTrackPt, MatchedXYPositionMap, Phase2TrackerValidateDigi::DigiMEs::MissedDigiLocalXposVsYPos, Phase2TrackerValidateDigi::DigiMEs::MissedDigiSimHitElossP, Phase2TrackerValidateDigi::DigiMEs::MissedDigiSimHitElossS, Phase2TrackerValidateDigi::DigiMEs::MissedDigiTimeWindow, Phase2TrackerValidateDigi::DigiMEs::MissedDigiTrackEta, Phase2TrackerValidateDigi::DigiMEs::MissedDigiTrackPhi, Phase2TrackerValidateDigi::DigiMEs::MissedDigiTrackPt, CoreSimTrack::momentum(), hgcaltilesconstants::nColumns, phi, PV3DBase< T, PVType, FrameType >::phi(), pixelFlag_, edm::Handle< T >::product(), edm::ESHandle< T >::product(), DiDispStaMuonMonitor_cfi::pt, ptCut_, rpcPointValidation_cfi::simHit, Phase2TrackerValidateDigi::DigiMEs::SimHitDx, Phase2TrackerValidateDigi::DigiMEs::SimHitDy, Phase2TrackerValidateDigi::DigiMEs::SimHitDz, simHits, simHitTokens_, Phase2TrackerValidateDigi::DigiMEs::SimTrackEta, Phase2TrackerValidateDigi::DigiMEs::SimTrackPhi, Phase2TrackerValidateDigi::DigiMEs::SimTrackPt, SimulatedRZPositionMap, SimulatedTOFEtaMap, SimulatedTOFPhiMap, SimulatedTOFRMap, SimulatedTOFZMap, SimulatedXYPositionMap, GeomDet::surface(), tofLowerCut_, tofUpperCut_, Surface::toGlobal(), align::Tracker, CoreSimTrack::trackId(), tTopoHandle_, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by analyze().

201  {
202  const TrackerTopology* tTopo = tTopoHandle_.product();
203  const TrackerGeometry* tGeom = gHandle.product();
204  int totalHits = 0;
205 
206  unsigned int id = simTrk.trackId();
207  for (const auto& itoken : simHitTokens_) {
209  iEvent.getByToken(itoken, simHitHandle);
210  if (!simHitHandle.isValid())
211  continue;
212  const edm::PSimHitContainer& simHits = (*simHitHandle.product());
213  for (edm::PSimHitContainer::const_iterator isim = simHits.begin(); isim != simHits.end(); ++isim) {
214  if ((*isim).trackId() != id)
215  continue;
216  const PSimHit& simHit = (*isim);
217 
218  if (!isPrimary(simTrk, simHit))
219  continue;
220 
221  unsigned int rawid = (*isim).detUnitId();
222  int layer;
223  if (pixelFlag_)
224  layer = tTopo->getITPixelLayerNumber(rawid);
225  else
226  layer = tTopo->getOTLayerNumber(rawid);
227  if (layer < 0)
228  continue;
229 
230  auto pos = layerMEs.find(layer);
231  if (pos == layerMEs.end())
232  continue;
233  DigiMEs& local_mes = pos->second;
234 
235  const DetId detId(rawid);
236  float dZ = (*isim).entryPoint().z() - (*isim).exitPoint().z();
237  if (fabs(dZ) <= 0.01)
238  continue;
239 
240  if (DetId(detId).det() != DetId::Detector::Tracker)
241  continue;
242 
243  const GeomDet* geomDet = tGeom->idToDet(detId);
244  if (!geomDet)
245  continue;
246  Global3DPoint pdPos = geomDet->surface().toGlobal(isim->localPosition());
247 
248  if (((*isim).tof() - pdPos.mag() / cval) < tofLowerCut_ || ((*isim).tof() - pdPos.mag() / cval) > tofUpperCut_)
249  continue;
250 
252  SimulatedXYPositionMap->Fill(pdPos.x() * 10., pdPos.y() * 10.);
254  SimulatedRZPositionMap->Fill(pdPos.z() * 10., std::hypot(pdPos.x(), pdPos.y()) * 10.);
255 
256  const TrackerGeomDet* geomDetUnit(tGeom->idToDetUnit(detId));
257  const Phase2TrackerGeomDetUnit* tkDetUnit = dynamic_cast<const Phase2TrackerGeomDetUnit*>(geomDetUnit);
258  int nColumns = tkDetUnit->specificTopology().ncolumns();
259 
260  float pt = simTrk.momentum().pt();
261  float eta = simTrk.momentum().eta();
262  float phi = simTrk.momentum().phi();
263  totalHits++;
264  pos->second.nHits++;
265 
266  if (local_mes.SimHitDx)
267  local_mes.SimHitDx->Fill(std::fabs((*isim).entryPoint().x() - (*isim).exitPoint().x()));
268  if (local_mes.SimHitDy)
269  local_mes.SimHitDy->Fill(std::fabs((*isim).entryPoint().y() - (*isim).exitPoint().y()));
270  if (local_mes.SimHitDz)
271  local_mes.SimHitDz->Fill(std::fabs((*isim).entryPoint().z() - (*isim).exitPoint().z()));
272 
273  if (SimulatedTOFEtaMap)
274  SimulatedTOFEtaMap->Fill(pdPos.eta(), (*isim).timeOfFlight());
275  if (SimulatedTOFPhiMap)
276  SimulatedTOFPhiMap->Fill(pdPos.phi(), (*isim).timeOfFlight());
277  if (SimulatedTOFRMap)
278  SimulatedTOFRMap->Fill(std::hypot(pdPos.x(), pdPos.y()), (*isim).timeOfFlight());
279  if (SimulatedTOFZMap)
280  SimulatedTOFZMap->Fill(pdPos.z(), (*isim).timeOfFlight());
281 
282  bool digiFlag;
283 
284  if (pixelFlag_)
285  digiFlag = findITPixelDigi(rawid, id);
286  else
287  digiFlag = findOTDigi(rawid, id);
288 
289  if (fabs(eta) < etaCut_) {
290  if (local_mes.SimTrackPt)
291  local_mes.SimTrackPt->Fill(pt);
292  if (digiFlag && local_mes.MatchedTrackPt)
293  local_mes.MatchedTrackPt->Fill(pt);
294  else if (local_mes.MissedDigiTrackPt)
295  local_mes.MissedDigiTrackPt->Fill(pt);
296  }
297  if (pt > ptCut_) {
298  if (local_mes.SimTrackEta)
299  local_mes.SimTrackEta->Fill(eta);
300  if (digiFlag && local_mes.MatchedTrackEta)
301  local_mes.MatchedTrackEta->Fill(eta);
302  else if (local_mes.MissedDigiTrackEta)
303  local_mes.MissedDigiTrackEta->Fill(eta);
304  }
305  if (fabs(eta) < etaCut_ && pt > ptCut_) {
306  if (local_mes.SimTrackPhi)
307  local_mes.SimTrackPhi->Fill(phi);
308  if (digiFlag && local_mes.MatchedTrackPhi)
309  local_mes.MatchedTrackPhi->Fill(phi);
310  else if (local_mes.MissedDigiTrackPhi)
311  local_mes.MissedDigiTrackPhi->Fill(phi);
312  }
313  if (digiFlag) {
314  pos->second.nDigis++;
316  MatchedRZPositionMap->Fill(pdPos.z() * 10., std::hypot(pdPos.x(), pdPos.y()) * 10.);
318  MatchedXYPositionMap->Fill(pdPos.x() * 10., pdPos.y() * 10.);
319  if (nColumns <= 2 && local_mes.MatchedSimHitElossS)
320  local_mes.MatchedSimHitElossS->Fill((*isim).energyLoss() / GeVperElectron);
321  else if (local_mes.MatchedSimHitElossP)
322  local_mes.MatchedSimHitElossP->Fill((*isim).energyLoss() / GeVperElectron);
323  } else {
324  if (local_mes.MissedDigiLocalXposVsYPos)
325  local_mes.MissedDigiLocalXposVsYPos->Fill((*isim).localPosition().x(), (*isim).localPosition().y());
326  if (local_mes.MissedDigiTimeWindow)
327  local_mes.MissedDigiTimeWindow->Fill(std::fabs((*isim).timeOfFlight() - pdPos.mag() / cval));
328  if (nColumns <= 2 && local_mes.MissedDigiSimHitElossS)
329  local_mes.MissedDigiSimHitElossS->Fill((*isim).energyLoss() / GeVperElectron);
330  else if (local_mes.MissedDigiSimHitElossP)
331  local_mes.MissedDigiSimHitElossP->Fill((*isim).energyLoss() / GeVperElectron);
332  }
333  }
334  }
335  return totalHits;
336 }
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:81
std::map< unsigned int, DigiMEs > layerMEs
bool isPrimary(const SimTrack &simTrk, const PSimHit &simHit)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
edm::ESHandle< TrackerTopology > tTopoHandle_
bool findOTDigi(unsigned int detid, unsigned int id)
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
T y() const
Definition: PV3DBase.h:60
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
void Fill(long long x)
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
T mag() const
Definition: PV3DBase.h:64
bool findITPixelDigi(unsigned int detid, unsigned int id)
edm::Handle< edm::PSimHitContainer > simHits
std::vector< edm::EDGetTokenT< edm::PSimHitContainer > > simHitTokens_
T z() const
Definition: PV3DBase.h:61
bool isValid() const
Definition: HandleBase.h:70
int getITPixelLayerNumber(const DetId &id) const
Definition: DetId.h:17
unsigned int trackId() const
Definition: CoreSimTrack.h:31
T const * product() const
Definition: Handle.h:69
T eta() const
Definition: PV3DBase.h:73
const math::XYZTLorentzVectorD & momentum() const
Definition: CoreSimTrack.h:19
const TrackerGeomDet * idToDet(DetId) const override
std::vector< PSimHit > PSimHitContainer
T x() const
Definition: PV3DBase.h:59
T const * product() const
Definition: ESHandle.h:86
int getOTLayerNumber(const DetId &id) const
bool Phase2TrackerValidateDigi::findITPixelDigi ( unsigned int  detid,
unsigned int  id 
)
private

Definition at line 356 of file Phase2TrackerValidateDigi.cc.

References edm::DetSetVector< T >::begin(), cuy::col, edm::DetSetVector< T >::end(), edm::DetSetVector< T >::find(), getSimTrackId(), itPixelDigiHandle_, itPixelSimLinkHandle_, electronStore::links, muonTagProbeFilters_cff::matched, PixelDigi::pixelToChannel(), and edm::Handle< T >::product().

Referenced by fillSimHitInfo().

356  {
357  bool matched = false;
360 
361  edm::DetSetVector<PixelDigi>::const_iterator DSVIter = digis->find(detid);
362  if (DSVIter != digis->end()) {
363  for (edm::DetSet<PixelDigi>::const_iterator di = DSVIter->begin(); di != DSVIter->end(); di++) {
364  int col = di->column(); // column
365  int row = di->row(); // row
366  unsigned int channel = PixelDigi::pixelToChannel(row, col);
367  unsigned int simTkId = getSimTrackId(links, detid, channel);
368  if (simTkId == id) {
369  matched = true;
370  break;
371  }
372  }
373  }
374  return matched;
375 }
iterator find(det_id_type id)
Definition: DetSetVector.h:264
edm::Handle< edm::DetSetVector< PixelDigiSimLink > > itPixelSimLinkHandle_
static int pixelToChannel(int row, int col)
Definition: PixelDigi.h:71
unsigned int getSimTrackId(const edm::DetSetVector< PixelDigiSimLink > *simLinks, const DetId &detId, unsigned int &channel)
edm::Handle< edm::DetSetVector< PixelDigi > > itPixelDigiHandle_
iterator end()
Return the off-the-end iterator.
Definition: DetSetVector.h:325
T const * product() const
Definition: Handle.h:69
col
Definition: cuy.py:1010
iterator begin()
Return an iterator to the first DetSet.
Definition: DetSetVector.h:314
collection_type::const_iterator const_iterator
Definition: DetSet.h:32
collection_type::const_iterator const_iterator
Definition: DetSetVector.h:102
bool Phase2TrackerValidateDigi::findOTDigi ( unsigned int  detid,
unsigned int  id 
)
private

Definition at line 337 of file Phase2TrackerValidateDigi.cc.

References edm::DetSetVector< T >::begin(), cuy::col, edm::DetSetVector< T >::end(), edm::DetSetVector< T >::find(), getSimTrackId(), electronStore::links, muonTagProbeFilters_cff::matched, otDigiHandle_, otSimLinkHandle_, Phase2TrackerDigi::pixelToChannel(), and edm::Handle< T >::product().

Referenced by fillSimHitInfo().

337  {
338  bool matched = false;
342  if (DSVIter != digis->end()) {
343  for (edm::DetSet<Phase2TrackerDigi>::const_iterator di = DSVIter->begin(); di != DSVIter->end(); di++) {
344  int col = di->column(); // column
345  int row = di->row(); // row
346  unsigned int channel = Phase2TrackerDigi::pixelToChannel(row, col);
347  unsigned int simTkId = getSimTrackId(links, detid, channel);
348  if (simTkId == id) {
349  matched = true;
350  break;
351  }
352  }
353  }
354  return matched;
355 }
iterator find(det_id_type id)
Definition: DetSetVector.h:264
unsigned int getSimTrackId(const edm::DetSetVector< PixelDigiSimLink > *simLinks, const DetId &detId, unsigned int &channel)
edm::Handle< edm::DetSetVector< PixelDigiSimLink > > otSimLinkHandle_
static PackedDigiType pixelToChannel(unsigned int row, unsigned int col)
iterator end()
Return the off-the-end iterator.
Definition: DetSetVector.h:325
T const * product() const
Definition: Handle.h:69
col
Definition: cuy.py:1010
iterator begin()
Return an iterator to the first DetSet.
Definition: DetSetVector.h:314
edm::Handle< edm::DetSetVector< Phase2TrackerDigi > > otDigiHandle_
collection_type::const_iterator const_iterator
Definition: DetSet.h:32
collection_type::const_iterator const_iterator
Definition: DetSetVector.h:102
unsigned int Phase2TrackerValidateDigi::getSimTrackId ( const edm::DetSetVector< PixelDigiSimLink > *  simLinks,
const DetId detId,
unsigned int &  channel 
)
private

Definition at line 931 of file Phase2TrackerValidateDigi.cc.

References edm::DetSet< T >::data, edm::DetSetVector< T >::end(), and edm::DetSetVector< T >::find().

Referenced by findITPixelDigi(), and findOTDigi().

933  {
935 
936  unsigned int simTrkId(0);
937  if (isearch == simLinks->end())
938  return simTrkId;
939 
940  edm::DetSet<PixelDigiSimLink> link_detset = (*simLinks)[detId];
941  // Loop over DigiSimLink in this det unit
942  int iSimLink = 0;
943  for (edm::DetSet<PixelDigiSimLink>::const_iterator it = link_detset.data.begin(); it != link_detset.data.end();
944  it++, iSimLink++) {
945  if (channel == it->channel()) {
946  simTrkId = it->SimTrackId();
947  break;
948  }
949  }
950  return simTrkId;
951 }
iterator find(det_id_type id)
Definition: DetSetVector.h:264
iterator end()
Return the off-the-end iterator.
Definition: DetSetVector.h:325
collection_type data
Definition: DetSet.h:81
collection_type::const_iterator const_iterator
Definition: DetSet.h:32
collection_type::const_iterator const_iterator
Definition: DetSetVector.h:102
bool Phase2TrackerValidateDigi::isPrimary ( const SimTrack simTrk,
const PSimHit simHit 
)
private

Definition at line 1037 of file Phase2TrackerValidateDigi.cc.

References PSimHit::processType(), OfflineHarvestingSequence_cosmic::ptype, CoreSimTrack::trackId(), PSimHit::trackId(), and SimTrack::vertIndex().

Referenced by fillSimHitInfo().

1037  {
1038  bool retval = false;
1039  unsigned int trkId = simTrk.trackId();
1040  if (trkId != simHit.trackId())
1041  return retval;
1042  int vtxIndex = simTrk.vertIndex();
1043  int ptype = simHit.processType();
1044  if ((vtxIndex == 0) && (ptype == 0))
1045  retval = true;
1046  return retval;
1047 }
int vertIndex() const
index of the vertex in the Event container (-1 if no vertex)
Definition: SimTrack.h:30
unsigned int trackId() const
Definition: CoreSimTrack.h:31
unsigned short processType() const
Definition: PSimHit.h:120
unsigned int trackId() const
Definition: PSimHit.h:106
int Phase2TrackerValidateDigi::matchedSimTrack ( edm::Handle< edm::SimTrackContainer > &  SimTk,
unsigned int  simTrkId 
)
private

Definition at line 1025 of file Phase2TrackerValidateDigi.cc.

References edm::Handle< T >::product().

Referenced by analyze().

1025  {
1026  edm::SimTrackContainer sim_tracks = (*SimTk.product());
1027  for (unsigned int it = 0; it < sim_tracks.size(); it++) {
1028  if (sim_tracks[it].trackId() == simTrkId) {
1029  return it;
1030  }
1031  }
1032  return -1;
1033 }
T const * product() const
Definition: Handle.h:69
std::vector< SimTrack > SimTrackContainer

Member Data Documentation

edm::ParameterSet Phase2TrackerValidateDigi::config_
private
const float Phase2TrackerValidateDigi::cval
private

Definition at line 148 of file Phase2TrackerValidateDigi.h.

Referenced by fillSimHitInfo().

float Phase2TrackerValidateDigi::etaCut_
private

Definition at line 95 of file Phase2TrackerValidateDigi.h.

Referenced by analyze(), fillSimHitInfo(), and Phase2TrackerValidateDigi().

std::string Phase2TrackerValidateDigi::geomType_
private

Definition at line 119 of file Phase2TrackerValidateDigi.h.

Referenced by analyze(), and bookHistograms().

const float Phase2TrackerValidateDigi::GeVperElectron
private

Definition at line 147 of file Phase2TrackerValidateDigi.h.

Referenced by fillSimHitInfo().

edm::Handle<edm::DetSetVector<PixelDigi> > Phase2TrackerValidateDigi::itPixelDigiHandle_
private

Definition at line 138 of file Phase2TrackerValidateDigi.h.

Referenced by analyze(), and findITPixelDigi().

edm::InputTag Phase2TrackerValidateDigi::itPixelDigiSimLinkSrc_
private

Definition at line 124 of file Phase2TrackerValidateDigi.h.

const edm::EDGetTokenT<edm::DetSetVector<PixelDigiSimLink> > Phase2TrackerValidateDigi::itPixelDigiSimLinkToken_
private

Definition at line 132 of file Phase2TrackerValidateDigi.h.

Referenced by analyze().

edm::InputTag Phase2TrackerValidateDigi::itPixelDigiSrc_
private

Definition at line 123 of file Phase2TrackerValidateDigi.h.

const edm::EDGetTokenT<edm::DetSetVector<PixelDigi> > Phase2TrackerValidateDigi::itPixelDigiToken_
private

Definition at line 131 of file Phase2TrackerValidateDigi.h.

Referenced by analyze().

edm::Handle<edm::DetSetVector<PixelDigiSimLink> > Phase2TrackerValidateDigi::itPixelSimLinkHandle_
private

Definition at line 140 of file Phase2TrackerValidateDigi.h.

Referenced by analyze(), fillITPixelBXInfo(), and findITPixelDigi().

std::map<unsigned int, DigiMEs> Phase2TrackerValidateDigi::layerMEs
private
MonitorElement* Phase2TrackerValidateDigi::MatchedRZPositionMap
private

Definition at line 87 of file Phase2TrackerValidateDigi.h.

Referenced by bookHistograms(), and fillSimHitInfo().

MonitorElement* Phase2TrackerValidateDigi::MatchedXYPositionMap
private

Definition at line 86 of file Phase2TrackerValidateDigi.h.

Referenced by bookHistograms(), and fillSimHitInfo().

MonitorElement* Phase2TrackerValidateDigi::nSimHitsPerTrack
private

Definition at line 94 of file Phase2TrackerValidateDigi.h.

Referenced by bookHistograms(), and fillHitsPerTrack().

MonitorElement* Phase2TrackerValidateDigi::nSimulatedTracks
private

Definition at line 65 of file Phase2TrackerValidateDigi.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* Phase2TrackerValidateDigi::nSimulatedTracksP
private

Definition at line 66 of file Phase2TrackerValidateDigi.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* Phase2TrackerValidateDigi::nSimulatedTracksS
private

Definition at line 67 of file Phase2TrackerValidateDigi.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* Phase2TrackerValidateDigi::nSimVertices
private

Definition at line 69 of file Phase2TrackerValidateDigi.h.

Referenced by analyze(), and bookHistograms().

edm::Handle<edm::DetSetVector<Phase2TrackerDigi> > Phase2TrackerValidateDigi::otDigiHandle_
private

Definition at line 139 of file Phase2TrackerValidateDigi.h.

Referenced by analyze(), and findOTDigi().

edm::InputTag Phase2TrackerValidateDigi::otDigiSimLinkSrc_
private

Definition at line 122 of file Phase2TrackerValidateDigi.h.

const edm::EDGetTokenT<edm::DetSetVector<PixelDigiSimLink> > Phase2TrackerValidateDigi::otDigiSimLinkToken_
private

Definition at line 130 of file Phase2TrackerValidateDigi.h.

Referenced by analyze().

edm::InputTag Phase2TrackerValidateDigi::otDigiSrc_
private

Definition at line 121 of file Phase2TrackerValidateDigi.h.

const edm::EDGetTokenT<edm::DetSetVector<Phase2TrackerDigi> > Phase2TrackerValidateDigi::otDigiToken_
private

Definition at line 129 of file Phase2TrackerValidateDigi.h.

Referenced by analyze().

edm::Handle<edm::DetSetVector<PixelDigiSimLink> > Phase2TrackerValidateDigi::otSimLinkHandle_
private

Definition at line 141 of file Phase2TrackerValidateDigi.h.

Referenced by analyze(), fillOTBXInfo(), and findOTDigi().

bool Phase2TrackerValidateDigi::pixelFlag_
private

Definition at line 118 of file Phase2TrackerValidateDigi.h.

Referenced by analyze(), bookHistograms(), and fillSimHitInfo().

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

Definition at line 125 of file Phase2TrackerValidateDigi.h.

Referenced by Phase2TrackerValidateDigi().

float Phase2TrackerValidateDigi::ptCut_
private

Definition at line 96 of file Phase2TrackerValidateDigi.h.

Referenced by analyze(), fillSimHitInfo(), and Phase2TrackerValidateDigi().

edm::Handle<edm::PSimHitContainer> Phase2TrackerValidateDigi::simHits
private
std::vector<edm::EDGetTokenT<edm::PSimHitContainer> > Phase2TrackerValidateDigi::simHitTokens_
private

Definition at line 136 of file Phase2TrackerValidateDigi.h.

Referenced by fillSimHitInfo(), and Phase2TrackerValidateDigi().

edm::Handle<edm::SimTrackContainer> Phase2TrackerValidateDigi::simTracks
private

Definition at line 143 of file Phase2TrackerValidateDigi.h.

Referenced by analyze().

edm::InputTag Phase2TrackerValidateDigi::simTrackSrc_
private

Definition at line 126 of file Phase2TrackerValidateDigi.h.

const edm::EDGetTokenT<edm::SimTrackContainer> Phase2TrackerValidateDigi::simTrackToken_
private

Definition at line 134 of file Phase2TrackerValidateDigi.h.

Referenced by analyze().

MonitorElement* Phase2TrackerValidateDigi::SimulatedRZPositionMap
private

Definition at line 84 of file Phase2TrackerValidateDigi.h.

Referenced by bookHistograms(), and fillSimHitInfo().

MonitorElement* Phase2TrackerValidateDigi::SimulatedTOFEtaMap
private

Definition at line 89 of file Phase2TrackerValidateDigi.h.

Referenced by bookHistograms(), and fillSimHitInfo().

MonitorElement* Phase2TrackerValidateDigi::SimulatedTOFPhiMap
private

Definition at line 90 of file Phase2TrackerValidateDigi.h.

Referenced by bookHistograms(), and fillSimHitInfo().

MonitorElement* Phase2TrackerValidateDigi::SimulatedTOFRMap
private

Definition at line 91 of file Phase2TrackerValidateDigi.h.

Referenced by bookHistograms(), and fillSimHitInfo().

MonitorElement* Phase2TrackerValidateDigi::SimulatedTOFZMap
private

Definition at line 92 of file Phase2TrackerValidateDigi.h.

Referenced by bookHistograms(), and fillSimHitInfo().

MonitorElement* Phase2TrackerValidateDigi::SimulatedTrackEta
private

Definition at line 72 of file Phase2TrackerValidateDigi.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* Phase2TrackerValidateDigi::SimulatedTrackEtaP
private

Definition at line 76 of file Phase2TrackerValidateDigi.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* Phase2TrackerValidateDigi::SimulatedTrackEtaS
private

Definition at line 80 of file Phase2TrackerValidateDigi.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* Phase2TrackerValidateDigi::SimulatedTrackPhi
private

Definition at line 73 of file Phase2TrackerValidateDigi.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* Phase2TrackerValidateDigi::SimulatedTrackPhiP
private

Definition at line 77 of file Phase2TrackerValidateDigi.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* Phase2TrackerValidateDigi::SimulatedTrackPhiS
private

Definition at line 81 of file Phase2TrackerValidateDigi.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* Phase2TrackerValidateDigi::SimulatedTrackPt
private

Definition at line 71 of file Phase2TrackerValidateDigi.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* Phase2TrackerValidateDigi::SimulatedTrackPtP
private

Definition at line 75 of file Phase2TrackerValidateDigi.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* Phase2TrackerValidateDigi::SimulatedTrackPtS
private

Definition at line 79 of file Phase2TrackerValidateDigi.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* Phase2TrackerValidateDigi::SimulatedXYPositionMap
private

Definition at line 83 of file Phase2TrackerValidateDigi.h.

Referenced by bookHistograms(), and fillSimHitInfo().

edm::InputTag Phase2TrackerValidateDigi::simVertexSrc_
private

Definition at line 127 of file Phase2TrackerValidateDigi.h.

const edm::EDGetTokenT<edm::SimVertexContainer> Phase2TrackerValidateDigi::simVertexToken_
private

Definition at line 135 of file Phase2TrackerValidateDigi.h.

Referenced by analyze().

edm::Handle<edm::SimVertexContainer> Phase2TrackerValidateDigi::simVertices
private

Definition at line 144 of file Phase2TrackerValidateDigi.h.

Referenced by analyze().

float Phase2TrackerValidateDigi::tofLowerCut_
private

Definition at line 98 of file Phase2TrackerValidateDigi.h.

Referenced by fillSimHitInfo(), and Phase2TrackerValidateDigi().

float Phase2TrackerValidateDigi::tofUpperCut_
private

Definition at line 97 of file Phase2TrackerValidateDigi.h.

Referenced by fillSimHitInfo(), and Phase2TrackerValidateDigi().

edm::ESHandle<TrackerTopology> Phase2TrackerValidateDigi::tTopoHandle_
private