CMS 3D CMS Logo

List of all members | Public Member Functions | Private Types | Private Attributes
SiPixelPhase1HitsV Class Reference

#include <SiPixelPhase1HitsV.h>

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

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
 SiPixelPhase1HitsV (const edm::ParameterSet &conf)
 
- Public Member Functions inherited from SiPixelPhase1Base
void bookHistograms (DQMStore::IBooker &iBooker, edm::Run const &run, edm::EventSetup const &) override
 
 SiPixelPhase1Base (const edm::ParameterSet &iConfig)
 
 ~SiPixelPhase1Base () 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
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 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
 
- Public Member Functions inherited from HistogramManagerHolder
 HistogramManagerHolder (const edm::ParameterSet &iConfig, edm::ConsumesCollector &&iC, edm::Transition transition=edm::Transition::BeginRun)
 

Private Types

enum  {
  TOF_R, ELOSS, ENTRY_EXIT_X, ENTRY_EXIT_Y,
  ENTRY_EXIT_Z, LOCAL_X, LOCAL_Y, LOCAL_Z,
  LOCAL_PHI, LOCAL_ETA, EFFICIENCY_TRACK
}
 

Private Attributes

edm::EDGetTokenT< edm::PSimHitContainerpixelBarrelHighToken_
 
edm::EDGetTokenT< edm::PSimHitContainerpixelBarrelLowToken_
 
edm::EDGetTokenT< edm::PSimHitContainerpixelForwardHighToken_
 
edm::EDGetTokenT< edm::PSimHitContainerpixelForwardLowToken_
 
edm::EDGetTokenT< TrackingParticleCollectiontpToken_
 
edm::EDGetTokenT< reco::TrackToTrackingParticleAssociatortrackAssociatorByHitsToken_
 
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecordtrackerGeomToken_
 
edm::EDGetTokenT< edm::View< reco::Track > > tracksToken_
 

Additional Inherited Members

- 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
 
- 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 &)
 
- Protected Types inherited from SiPixelPhase1Base
enum  { DCS }
 
- Protected Member Functions inherited from SiPixelPhase1Base
bool checktrigger (const edm::Event &iEvent, const edm::EventSetup &, const unsigned trgidx) const
 
- Protected Member Functions inherited from DQMEDAnalyzer
uint64_t meId () const
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 
unsigned int streamId_
 
- Protected Attributes inherited from HistogramManagerHolder
GeometryInterface geometryInterface
 
std::vector< HistogramManagerhisto
 

Detailed Description

Definition at line 23 of file SiPixelPhase1HitsV.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private

Constructor & Destructor Documentation

◆ SiPixelPhase1HitsV()

SiPixelPhase1HitsV::SiPixelPhase1HitsV ( const edm::ParameterSet conf)
explicit

Definition at line 24 of file SiPixelPhase1HitsV.cc.

25  : SiPixelPhase1Base(iConfig),
26  pixelBarrelLowToken_(consumes<edm::PSimHitContainer>(iConfig.getParameter<edm::InputTag>("pixBarrelLowSrc"))),
27  pixelBarrelHighToken_(consumes<edm::PSimHitContainer>(iConfig.getParameter<edm::InputTag>("pixBarrelHighSrc"))),
28  pixelForwardLowToken_(consumes<edm::PSimHitContainer>(iConfig.getParameter<edm::InputTag>("pixForwardLowSrc"))),
29  pixelForwardHighToken_(consumes<edm::PSimHitContainer>(iConfig.getParameter<edm::InputTag>("pixForwardHighSrc"))),
30 
31  tracksToken_(consumes<edm::View<reco::Track>>(iConfig.getParameter<edm::InputTag>("tracksTag"))),
32  tpToken_(consumes<TrackingParticleCollection>(iConfig.getParameter<edm::InputTag>("tpTag"))),
33  trackAssociatorByHitsToken_(consumes<reco::TrackToTrackingParticleAssociator>(
34  iConfig.getParameter<edm::InputTag>("trackAssociatorByHitsTag"))),
35 
36  trackerGeomToken_(esConsumes<TrackerGeometry, TrackerDigiGeometryRecord>()) {}
edm::EDGetTokenT< edm::PSimHitContainer > pixelBarrelHighToken_
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > trackerGeomToken_
edm::EDGetTokenT< edm::PSimHitContainer > pixelForwardHighToken_
SiPixelPhase1Base(const edm::ParameterSet &iConfig)
edm::EDGetTokenT< reco::TrackToTrackingParticleAssociator > trackAssociatorByHitsToken_
edm::EDGetTokenT< edm::View< reco::Track > > tracksToken_
edm::EDGetTokenT< edm::PSimHitContainer > pixelBarrelLowToken_
edm::EDGetTokenT< TrackingParticleCollection > tpToken_
edm::EDGetTokenT< edm::PSimHitContainer > pixelForwardLowToken_

Member Function Documentation

◆ analyze()

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

Implements SiPixelPhase1Base.

Definition at line 38 of file SiPixelPhase1HitsV.cc.

References funct::abs(), reco::TrackToTrackingParticleAssociator::associateRecoToSim(), EFFICIENCY_TRACK, ELOSS, fastSimProducer_cff::energyLoss, ENTRY_EXIT_X, ENTRY_EXIT_Y, ENTRY_EXIT_Z, Exception, edm::EventSetup::getHandle(), HistogramManagerHolder::histo, mps_fire::i, l1ctLayer2EG_cff::id, iEvent, edm::HandleBase::isValid(), ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, LOCAL_ETA, LOCAL_PHI, LOCAL_X, LOCAL_Y, LOCAL_Z, PV3DBase< T, PVType, FrameType >::mag(), AlCaHLTBitMon_ParallelJobs::p, pixelBarrelHighToken_, pixelBarrelLowToken_, pixelForwardHighToken_, pixelForwardLowToken_, edm::Handle< T >::product(), edm::View< T >::size(), TOF_R, tpToken_, HLT_2024v12_cff::track, trackAssociatorByHitsToken_, PbPb_ZMuSkimMuonDPG_cff::tracker, trackerGeomToken_, and tracksToken_.

38  {
40  iEvent.getByToken(pixelBarrelLowToken_, barrelLowInput);
41  if (!barrelLowInput.isValid())
42  return;
43 
44  edm::Handle<edm::PSimHitContainer> barrelHighInput;
45  iEvent.getByToken(pixelBarrelHighToken_, barrelHighInput);
46  if (!barrelHighInput.isValid())
47  return;
48 
49  edm::Handle<edm::PSimHitContainer> forwardLowInput;
50  iEvent.getByToken(pixelForwardLowToken_, forwardLowInput);
51  if (!forwardLowInput.isValid())
52  return;
53 
54  edm::Handle<edm::PSimHitContainer> forwardHighInput;
55  iEvent.getByToken(pixelForwardHighToken_, forwardHighInput);
56  if (!forwardHighInput.isValid())
57  return;
58 
59  edm::PSimHitContainer::const_iterator it;
60 
61  // Get geometry information
62 
64 
65  // get low barrel info
66  for (it = barrelLowInput->begin(); it != barrelLowInput->end(); ++it) {
67  auto id = DetId(it->detUnitId());
68  const GeomDetUnit *det = (const GeomDetUnit *)tracker->idToDetUnit(id);
69  GlobalPoint gpos = det->toGlobal(it->localPosition());
70 
71  float tof = it->timeOfFlight();
72  float globalR = gpos.mag();
73 
74  float energyLoss = it->energyLoss();
75 
76  float entryExitX = (it->entryPoint().x() - it->exitPoint().x());
77  float entryExitY = (it->entryPoint().y() - it->exitPoint().y());
78  float entryExitZ = std::abs(it->entryPoint().z() - it->exitPoint().z());
79 
80  float localX = it->localPosition().x();
81  float localY = it->localPosition().y();
82  float localZ = it->localPosition().z();
83  float localPhi = it->localPosition().phi();
84  float localEta = it->localPosition().eta();
85 
86  histo[TOF_R].fill(globalR, tof, id, &iEvent);
87  histo[ELOSS].fill(energyLoss, id, &iEvent);
88  histo[ENTRY_EXIT_X].fill(entryExitX, id, &iEvent);
89  histo[ENTRY_EXIT_Y].fill(entryExitY, id, &iEvent);
90  histo[ENTRY_EXIT_Z].fill(entryExitZ, id, &iEvent);
91  histo[LOCAL_X].fill(localX, id, &iEvent);
92  histo[LOCAL_Y].fill(localY, id, &iEvent);
93  histo[LOCAL_Z].fill(localZ, id, &iEvent);
94  histo[LOCAL_PHI].fill(localPhi, id, &iEvent);
95  histo[LOCAL_ETA].fill(localEta, id, &iEvent);
96  }
97  // get high barrel info
98  for (it = barrelHighInput->begin(); it != barrelHighInput->end(); ++it) {
99  auto id = DetId(it->detUnitId());
100  const GeomDetUnit *det = (const GeomDetUnit *)tracker->idToDetUnit(id);
101  GlobalPoint gpos = det->toGlobal(it->localPosition());
102 
103  float tof = it->timeOfFlight();
104  float globalR = gpos.mag();
105 
106  float energyLoss = it->energyLoss();
107 
108  float entryExitX = (it->entryPoint().x() - it->exitPoint().x());
109  float entryExitY = (it->entryPoint().y() - it->exitPoint().y());
110  float entryExitZ = std::abs(it->entryPoint().z() - it->exitPoint().z());
111 
112  float localX = it->localPosition().x();
113  float localY = it->localPosition().y();
114  float localZ = it->localPosition().z();
115  float localPhi = it->localPosition().phi();
116  float localEta = it->localPosition().eta();
117 
118  histo[TOF_R].fill(globalR, tof, id, &iEvent);
119  histo[ELOSS].fill(energyLoss, id, &iEvent);
120  histo[ENTRY_EXIT_X].fill(entryExitX, id, &iEvent);
121  histo[ENTRY_EXIT_Y].fill(entryExitY, id, &iEvent);
122  histo[ENTRY_EXIT_Z].fill(entryExitZ, id, &iEvent);
123  histo[LOCAL_X].fill(localX, id, &iEvent);
124  histo[LOCAL_Y].fill(localY, id, &iEvent);
125  histo[LOCAL_Z].fill(localZ, id, &iEvent);
126  histo[LOCAL_PHI].fill(localPhi, id, &iEvent);
127  histo[LOCAL_ETA].fill(localEta, id, &iEvent);
128  }
129 
130  // get low forward info
131  for (it = forwardLowInput->begin(); it != forwardLowInput->end(); ++it) {
132  auto id = DetId(it->detUnitId());
133  const GeomDetUnit *det = (const GeomDetUnit *)tracker->idToDetUnit(id);
134  GlobalPoint gpos = det->toGlobal(it->localPosition());
135 
136  float tof = it->timeOfFlight();
137  float globalR = gpos.mag();
138 
139  float energyLoss = it->energyLoss();
140 
141  float entryExitX = (it->entryPoint().x() - it->exitPoint().x());
142  float entryExitY = (it->entryPoint().y() - it->exitPoint().y());
143  float entryExitZ = std::abs(it->entryPoint().z() - it->exitPoint().z());
144 
145  float localX = it->localPosition().x();
146  float localY = it->localPosition().y();
147  float localZ = it->localPosition().z();
148  float localPhi = it->localPosition().phi();
149  float localEta = it->localPosition().eta();
150 
151  histo[TOF_R].fill(globalR, tof, id, &iEvent);
152  histo[ELOSS].fill(energyLoss, id, &iEvent);
153  histo[ENTRY_EXIT_X].fill(entryExitX, id, &iEvent);
154  histo[ENTRY_EXIT_Y].fill(entryExitY, id, &iEvent);
155  histo[ENTRY_EXIT_Z].fill(entryExitZ, id, &iEvent);
156  histo[LOCAL_X].fill(localX, id, &iEvent);
157  histo[LOCAL_Y].fill(localY, id, &iEvent);
158  histo[LOCAL_Z].fill(localZ, id, &iEvent);
159  histo[LOCAL_PHI].fill(localPhi, id, &iEvent);
160  histo[LOCAL_ETA].fill(localEta, id, &iEvent);
161  }
162 
163  // get high forward info
164  for (it = forwardHighInput->begin(); it != forwardHighInput->end(); ++it) {
165  auto id = DetId(it->detUnitId());
166  const GeomDetUnit *det = (const GeomDetUnit *)tracker->idToDetUnit(id);
167  GlobalPoint gpos = det->toGlobal(it->localPosition());
168 
169  float tof = it->timeOfFlight();
170  float globalR = gpos.mag();
171 
172  float energyLoss = it->energyLoss();
173 
174  float entryExitX = (it->entryPoint().x() - it->exitPoint().x());
175  float entryExitY = (it->entryPoint().y() - it->exitPoint().y());
176  float entryExitZ = std::abs(it->entryPoint().z() - it->exitPoint().z());
177 
178  float localX = it->localPosition().x();
179  float localY = it->localPosition().y();
180  float localZ = it->localPosition().z();
181  float localPhi = it->localPosition().phi();
182  float localEta = it->localPosition().eta();
183 
184  histo[TOF_R].fill(globalR, tof, id, &iEvent);
185  histo[ELOSS].fill(energyLoss, id, &iEvent);
186  histo[ENTRY_EXIT_X].fill(entryExitX, id, &iEvent);
187  histo[ENTRY_EXIT_Y].fill(entryExitY, id, &iEvent);
188  histo[ENTRY_EXIT_Z].fill(entryExitZ, id, &iEvent);
189  histo[LOCAL_X].fill(localX, id, &iEvent);
190  histo[LOCAL_Y].fill(localY, id, &iEvent);
191  histo[LOCAL_Z].fill(localZ, id, &iEvent);
192  histo[LOCAL_PHI].fill(localPhi, id, &iEvent);
193  histo[LOCAL_ETA].fill(localEta, id, &iEvent);
194  }
195 
196  // Sim Hit efficiency info
197  edm::Handle<edm::View<reco::Track>> trackCollectionH;
198  iEvent.getByToken(tracksToken_, trackCollectionH);
199  const edm::View<reco::Track> &tC = *(trackCollectionH.product());
200 
202  iEvent.getByToken(tpToken_, TPCollectionH);
203 
205  iEvent.getByToken(trackAssociatorByHitsToken_, theHitsAssociator);
206  if (!theHitsAssociator.isValid()) {
207  throw cms::Exception("NO VALID HIT ASSOCIATOR");
208  }
209  reco::TrackToTrackingParticleAssociator const *associatorByHits = theHitsAssociator.product();
210 
211  if (TPCollectionH.isValid() && trackCollectionH.isValid()) {
212  reco::RecoToSimCollection const &p = associatorByHits->associateRecoToSim(trackCollectionH, TPCollectionH);
213 
214  for (edm::View<reco::Track>::size_type i = 0; i < tC.size(); ++i) {
215  edm::RefToBase<reco::Track> track(trackCollectionH, i);
216  // const reco::Track& t = *track;
217  auto id = DetId(track->innerDetId()); // histo manager requires a det ID,
218  // use innermost ID for ease
219 
220  auto iter = p.find(track);
221  histo[EFFICIENCY_TRACK].fill(iter != p.end() ? 1 : 0, id, &iEvent);
222  }
223  }
224 }
unsigned int size_type
Definition: View.h:92
reco::RecoToSimCollection associateRecoToSim(const edm::Handle< edm::View< reco::Track >> &tCH, const edm::Handle< TrackingParticleCollection > &tPCH) const
T const * product() const
Definition: Handle.h:70
edm::EDGetTokenT< edm::PSimHitContainer > pixelBarrelHighToken_
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > trackerGeomToken_
edm::EDGetTokenT< edm::PSimHitContainer > pixelForwardHighToken_
edm::EDGetTokenT< reco::TrackToTrackingParticleAssociator > trackAssociatorByHitsToken_
size_type size() const
int iEvent
Definition: GenABIO.cc:224
T mag() const
Definition: PV3DBase.h:64
edm::EDGetTokenT< edm::View< reco::Track > > tracksToken_
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
edm::EDGetTokenT< edm::PSimHitContainer > pixelBarrelLowToken_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:130
Definition: DetId.h:17
bool isValid() const
Definition: HandleBase.h:70
std::vector< HistogramManager > histo
edm::EDGetTokenT< TrackingParticleCollection > tpToken_
edm::EDGetTokenT< edm::PSimHitContainer > pixelForwardLowToken_

Member Data Documentation

◆ pixelBarrelHighToken_

edm::EDGetTokenT<edm::PSimHitContainer> SiPixelPhase1HitsV::pixelBarrelHighToken_
private

Definition at line 44 of file SiPixelPhase1HitsV.h.

Referenced by analyze().

◆ pixelBarrelLowToken_

edm::EDGetTokenT<edm::PSimHitContainer> SiPixelPhase1HitsV::pixelBarrelLowToken_
private

Definition at line 43 of file SiPixelPhase1HitsV.h.

Referenced by analyze().

◆ pixelForwardHighToken_

edm::EDGetTokenT<edm::PSimHitContainer> SiPixelPhase1HitsV::pixelForwardHighToken_
private

Definition at line 46 of file SiPixelPhase1HitsV.h.

Referenced by analyze().

◆ pixelForwardLowToken_

edm::EDGetTokenT<edm::PSimHitContainer> SiPixelPhase1HitsV::pixelForwardLowToken_
private

Definition at line 45 of file SiPixelPhase1HitsV.h.

Referenced by analyze().

◆ tpToken_

edm::EDGetTokenT<TrackingParticleCollection> SiPixelPhase1HitsV::tpToken_
private

Definition at line 49 of file SiPixelPhase1HitsV.h.

Referenced by analyze().

◆ trackAssociatorByHitsToken_

edm::EDGetTokenT<reco::TrackToTrackingParticleAssociator> SiPixelPhase1HitsV::trackAssociatorByHitsToken_
private

Definition at line 50 of file SiPixelPhase1HitsV.h.

Referenced by analyze().

◆ trackerGeomToken_

edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> SiPixelPhase1HitsV::trackerGeomToken_
private

Definition at line 52 of file SiPixelPhase1HitsV.h.

Referenced by analyze().

◆ tracksToken_

edm::EDGetTokenT<edm::View<reco::Track> > SiPixelPhase1HitsV::tracksToken_
private

Definition at line 48 of file SiPixelPhase1HitsV.h.

Referenced by analyze().