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 one::DQMEDAnalyzer< T > HistogramManagerHolder one::dqmimplementation::DQMBaseClass< T... >

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
 SiPixelPhase1HitsV (const edm::ParameterSet &conf)
 
- Public Member Functions inherited from SiPixelPhase1Base
void analyze (edm::Event const &e, edm::EventSetup const &eSetup) override=0
 
void bookHistograms (DQMStore::IBooker &iBooker, edm::Run const &run, edm::EventSetup const &iSetup) override
 
 SiPixelPhase1Base (const edm::ParameterSet &iConfig)
 
 ~SiPixelPhase1Base () override
 
- Public Member Functions inherited from one::DQMEDAnalyzer< T >
 DQMEDAnalyzer ()=default
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > const &)=delete
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > &&)=delete
 
 ~DQMEDAnalyzer () override=default
 
- Public Member Functions inherited from HistogramManagerHolder
 HistogramManagerHolder (const edm::ParameterSet &iConfig)
 

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::EDGetTokenT< edm::View< reco::Track > > tracksToken_
 

Additional Inherited Members

- Protected Types inherited from SiPixelPhase1Base
enum  { DCS }
 
- Protected Member Functions inherited from SiPixelPhase1Base
bool checktrigger (const edm::Event &iEvent, const edm::EventSetup &iSetup, const unsigned trgidx) const
 
- Protected Attributes inherited from HistogramManagerHolder
GeometryInterface geometryInterface
 
std::vector< HistogramManagerhisto
 

Detailed Description

Definition at line 21 of file SiPixelPhase1HitsV.h.

Member Enumeration Documentation

anonymous enum
private

Constructor & Destructor Documentation

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

Definition at line 26 of file SiPixelPhase1HitsV.cc.

27  : SiPixelPhase1Base(iConfig),
28  pixelBarrelLowToken_(consumes<edm::PSimHitContainer>(iConfig.getParameter<edm::InputTag>("pixBarrelLowSrc"))),
29  pixelBarrelHighToken_(consumes<edm::PSimHitContainer>(iConfig.getParameter<edm::InputTag>("pixBarrelHighSrc"))),
30  pixelForwardLowToken_(consumes<edm::PSimHitContainer>(iConfig.getParameter<edm::InputTag>("pixForwardLowSrc"))),
31  pixelForwardHighToken_(consumes<edm::PSimHitContainer>(iConfig.getParameter<edm::InputTag>("pixForwardHighSrc"))),
32 
33  tracksToken_(consumes<edm::View<reco::Track>>(iConfig.getParameter<edm::InputTag>("tracksTag"))),
34  tpToken_(consumes<TrackingParticleCollection>(iConfig.getParameter<edm::InputTag>("tpTag"))),
35  trackAssociatorByHitsToken_(consumes<reco::TrackToTrackingParticleAssociator>(
36  iConfig.getParameter<edm::InputTag>("trackAssociatorByHitsTag"))) {}
edm::EDGetTokenT< edm::PSimHitContainer > pixelBarrelHighToken_
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

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

Definition at line 38 of file SiPixelPhase1HitsV.cc.

References funct::abs(), reco::TrackToTrackingParticleAssociator::associateRecoToSim(), DEFINE_FWK_MODULE, EFFICIENCY_TRACK, ELOSS, edm::AssociationMap< Tag >::end(), ENTRY_EXIT_X, ENTRY_EXIT_Y, ENTRY_EXIT_Z, Exception, edm::AssociationMap< Tag >::find(), edm::EventSetup::get(), edm::Event::getByToken(), HistogramManagerHolder::histo, mps_fire::i, triggerObjects_cff::id, TrackerGeometry::idToDetUnit(), iEvent, reco::Track::innerDetId(), edm::HandleBase::isValid(), LOCAL_ETA, LOCAL_PHI, LOCAL_X, LOCAL_Y, LOCAL_Z, phase1PixelTopology::localX(), phase1PixelTopology::localY(), PV3DBase< T, PVType, FrameType >::mag(), AlCaHLTBitMon_ParallelJobs::p, pixelBarrelHighToken_, pixelBarrelLowToken_, pixelForwardHighToken_, pixelForwardLowToken_, edm::Handle< T >::product(), edm::View< T >::size(), TOF_R, tpToken_, HiIsolationCommonParameters_cff::track, trackAssociatorByHitsToken_, trackingTruthProducer_cfi::tracker, 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  iSetup.get<TrackerDigiGeometryRecord>().get(tracker);
65 
66  // get low barrel info
67  for (it = barrelLowInput->begin(); it != barrelLowInput->end(); ++it) {
68  auto id = DetId(it->detUnitId());
69  const GeomDetUnit *det = (const GeomDetUnit *)tracker->idToDetUnit(id);
70  GlobalPoint gpos = det->toGlobal(it->localPosition());
71 
72  float tof = it->timeOfFlight();
73  float globalR = gpos.mag();
74 
75  float energyLoss = it->energyLoss();
76 
77  float entryExitX = (it->entryPoint().x() - it->exitPoint().x());
78  float entryExitY = (it->entryPoint().y() - it->exitPoint().y());
79  float entryExitZ = std::abs(it->entryPoint().z() - it->exitPoint().z());
80 
81  float localX = it->localPosition().x();
82  float localY = it->localPosition().y();
83  float localZ = it->localPosition().z();
84  float localPhi = it->localPosition().phi();
85  float localEta = it->localPosition().eta();
86 
87  histo[TOF_R].fill(globalR, tof, id, &iEvent);
88  histo[ELOSS].fill(energyLoss, id, &iEvent);
89  histo[ENTRY_EXIT_X].fill(entryExitX, id, &iEvent);
90  histo[ENTRY_EXIT_Y].fill(entryExitY, id, &iEvent);
91  histo[ENTRY_EXIT_Z].fill(entryExitZ, id, &iEvent);
92  histo[LOCAL_X].fill(localX, id, &iEvent);
93  histo[LOCAL_Y].fill(localY, id, &iEvent);
94  histo[LOCAL_Z].fill(localZ, id, &iEvent);
95  histo[LOCAL_PHI].fill(localPhi, id, &iEvent);
96  histo[LOCAL_ETA].fill(localEta, id, &iEvent);
97  }
98  // get high barrel info
99  for (it = barrelHighInput->begin(); it != barrelHighInput->end(); ++it) {
100  auto id = DetId(it->detUnitId());
101  const GeomDetUnit *det = (const GeomDetUnit *)tracker->idToDetUnit(id);
102  GlobalPoint gpos = det->toGlobal(it->localPosition());
103 
104  float tof = it->timeOfFlight();
105  float globalR = gpos.mag();
106 
107  float energyLoss = it->energyLoss();
108 
109  float entryExitX = (it->entryPoint().x() - it->exitPoint().x());
110  float entryExitY = (it->entryPoint().y() - it->exitPoint().y());
111  float entryExitZ = std::abs(it->entryPoint().z() - it->exitPoint().z());
112 
113  float localX = it->localPosition().x();
114  float localY = it->localPosition().y();
115  float localZ = it->localPosition().z();
116  float localPhi = it->localPosition().phi();
117  float localEta = it->localPosition().eta();
118 
119  histo[TOF_R].fill(globalR, tof, id, &iEvent);
120  histo[ELOSS].fill(energyLoss, id, &iEvent);
121  histo[ENTRY_EXIT_X].fill(entryExitX, id, &iEvent);
122  histo[ENTRY_EXIT_Y].fill(entryExitY, id, &iEvent);
123  histo[ENTRY_EXIT_Z].fill(entryExitZ, id, &iEvent);
124  histo[LOCAL_X].fill(localX, id, &iEvent);
125  histo[LOCAL_Y].fill(localY, id, &iEvent);
126  histo[LOCAL_Z].fill(localZ, id, &iEvent);
127  histo[LOCAL_PHI].fill(localPhi, id, &iEvent);
128  histo[LOCAL_ETA].fill(localEta, id, &iEvent);
129  }
130 
131  // get low forward info
132  for (it = forwardLowInput->begin(); it != forwardLowInput->end(); ++it) {
133  auto id = DetId(it->detUnitId());
134  const GeomDetUnit *det = (const GeomDetUnit *)tracker->idToDetUnit(id);
135  GlobalPoint gpos = det->toGlobal(it->localPosition());
136 
137  float tof = it->timeOfFlight();
138  float globalR = gpos.mag();
139 
140  float energyLoss = it->energyLoss();
141 
142  float entryExitX = (it->entryPoint().x() - it->exitPoint().x());
143  float entryExitY = (it->entryPoint().y() - it->exitPoint().y());
144  float entryExitZ = std::abs(it->entryPoint().z() - it->exitPoint().z());
145 
146  float localX = it->localPosition().x();
147  float localY = it->localPosition().y();
148  float localZ = it->localPosition().z();
149  float localPhi = it->localPosition().phi();
150  float localEta = it->localPosition().eta();
151 
152  histo[TOF_R].fill(globalR, tof, id, &iEvent);
153  histo[ELOSS].fill(energyLoss, id, &iEvent);
154  histo[ENTRY_EXIT_X].fill(entryExitX, id, &iEvent);
155  histo[ENTRY_EXIT_Y].fill(entryExitY, id, &iEvent);
156  histo[ENTRY_EXIT_Z].fill(entryExitZ, id, &iEvent);
157  histo[LOCAL_X].fill(localX, id, &iEvent);
158  histo[LOCAL_Y].fill(localY, id, &iEvent);
159  histo[LOCAL_Z].fill(localZ, id, &iEvent);
160  histo[LOCAL_PHI].fill(localPhi, id, &iEvent);
161  histo[LOCAL_ETA].fill(localEta, id, &iEvent);
162  }
163 
164  // get high forward info
165  for (it = forwardHighInput->begin(); it != forwardHighInput->end(); ++it) {
166  auto id = DetId(it->detUnitId());
167  const GeomDetUnit *det = (const GeomDetUnit *)tracker->idToDetUnit(id);
168  GlobalPoint gpos = det->toGlobal(it->localPosition());
169 
170  float tof = it->timeOfFlight();
171  float globalR = gpos.mag();
172 
173  float energyLoss = it->energyLoss();
174 
175  float entryExitX = (it->entryPoint().x() - it->exitPoint().x());
176  float entryExitY = (it->entryPoint().y() - it->exitPoint().y());
177  float entryExitZ = std::abs(it->entryPoint().z() - it->exitPoint().z());
178 
179  float localX = it->localPosition().x();
180  float localY = it->localPosition().y();
181  float localZ = it->localPosition().z();
182  float localPhi = it->localPosition().phi();
183  float localEta = it->localPosition().eta();
184 
185  histo[TOF_R].fill(globalR, tof, id, &iEvent);
186  histo[ELOSS].fill(energyLoss, id, &iEvent);
187  histo[ENTRY_EXIT_X].fill(entryExitX, id, &iEvent);
188  histo[ENTRY_EXIT_Y].fill(entryExitY, id, &iEvent);
189  histo[ENTRY_EXIT_Z].fill(entryExitZ, id, &iEvent);
190  histo[LOCAL_X].fill(localX, id, &iEvent);
191  histo[LOCAL_Y].fill(localY, id, &iEvent);
192  histo[LOCAL_Z].fill(localZ, id, &iEvent);
193  histo[LOCAL_PHI].fill(localPhi, id, &iEvent);
194  histo[LOCAL_ETA].fill(localEta, id, &iEvent);
195  }
196 
197  // Sim Hit efficiency info
198  edm::Handle<edm::View<reco::Track>> trackCollectionH;
199  iEvent.getByToken(tracksToken_, trackCollectionH);
200  const edm::View<reco::Track> &tC = *(trackCollectionH.product());
201 
203  iEvent.getByToken(tpToken_, TPCollectionH);
204 
206  iEvent.getByToken(trackAssociatorByHitsToken_, theHitsAssociator);
207  if (!theHitsAssociator.isValid()) {
208  throw cms::Exception("NO VALID HIT ASSOCIATOR");
209  }
210  reco::TrackToTrackingParticleAssociator const *associatorByHits = theHitsAssociator.product();
211 
212  if (TPCollectionH.isValid() && trackCollectionH.isValid()) {
213  reco::RecoToSimCollection const &p = associatorByHits->associateRecoToSim(trackCollectionH, TPCollectionH);
214 
215  for (edm::View<reco::Track>::size_type i = 0; i < tC.size(); ++i) {
216  edm::RefToBase<reco::Track> track(trackCollectionH, i);
217  // const reco::Track& t = *track;
218  auto id = DetId(track->innerDetId()); // histo manager requires a det ID,
219  // use innermost ID for ease
220 
221  auto iter = p.find(track);
222  histo[EFFICIENCY_TRACK].fill(iter != p.end() ? 1 : 0, id, &iEvent);
223  }
224  }
225 }
unsigned int size_type
Definition: View.h:90
const_iterator end() const
last iterator over the map (read only)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
const_iterator find(const key_type &k) const
find element with specified reference key
edm::EDGetTokenT< edm::PSimHitContainer > pixelBarrelHighToken_
constexpr uint16_t localY(uint16_t py)
size_type size() const
edm::EDGetTokenT< edm::PSimHitContainer > pixelForwardHighToken_
edm::EDGetTokenT< reco::TrackToTrackingParticleAssociator > trackAssociatorByHitsToken_
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
int iEvent
Definition: GenABIO.cc:224
T mag() const
Definition: PV3DBase.h:67
edm::EDGetTokenT< edm::View< reco::Track > > tracksToken_
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
edm::EDGetTokenT< edm::PSimHitContainer > pixelBarrelLowToken_
bool isValid() const
Definition: HandleBase.h:74
reco::RecoToSimCollection associateRecoToSim(const edm::Handle< edm::View< reco::Track >> &tCH, const edm::Handle< TrackingParticleCollection > &tPCH) const
Definition: DetId.h:18
T const * product() const
Definition: Handle.h:74
constexpr uint16_t localX(uint16_t px)
std::vector< HistogramManager > histo
T get() const
Definition: EventSetup.h:71
edm::EDGetTokenT< TrackingParticleCollection > tpToken_
edm::EDGetTokenT< edm::PSimHitContainer > pixelForwardLowToken_

Member Data Documentation

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

Definition at line 42 of file SiPixelPhase1HitsV.h.

Referenced by analyze().

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

Definition at line 41 of file SiPixelPhase1HitsV.h.

Referenced by analyze().

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

Definition at line 44 of file SiPixelPhase1HitsV.h.

Referenced by analyze().

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

Definition at line 43 of file SiPixelPhase1HitsV.h.

Referenced by analyze().

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

Definition at line 47 of file SiPixelPhase1HitsV.h.

Referenced by analyze().

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

Definition at line 48 of file SiPixelPhase1HitsV.h.

Referenced by analyze().

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

Definition at line 46 of file SiPixelPhase1HitsV.h.

Referenced by analyze().