CMS 3D CMS Logo

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

#include <SiPixelPhase1RecHitsV.h>

Inheritance diagram for SiPixelPhase1RecHitsV:
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
 
 SiPixelPhase1RecHitsV (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
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
- Public Member Functions inherited from HistogramManagerHolder
 HistogramManagerHolder (const edm::ParameterSet &iConfig, edm::ConsumesCollector &&iC, edm::Transition transition=edm::Transition::BeginRun)
 

Private Types

enum  {
  IN_TIME_BUNCH, OUT_TIME_BUNCH, NSIMHITS, RECHIT_X,
  RECHIT_Y, RES_X, RES_Y, ERROR_X,
  ERROR_Y, PULL_X, PULL_Y
}
 

Private Attributes

edm::EDGetTokenT< SiPixelRecHitCollectionsrcToken_
 
TrackerHitAssociator::Config trackerHitAssociatorConfig_
 

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 >
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache 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 16 of file SiPixelPhase1RecHitsV.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private
Enumerator
IN_TIME_BUNCH 
OUT_TIME_BUNCH 
NSIMHITS 
RECHIT_X 
RECHIT_Y 
RES_X 
RES_Y 
ERROR_X 
ERROR_Y 
PULL_X 
PULL_Y 

Definition at line 17 of file SiPixelPhase1RecHitsV.h.

17  {
20  NSIMHITS,
21  RECHIT_X,
22  RECHIT_Y,
23  RES_X,
24  RES_Y,
25  ERROR_X,
26  ERROR_Y,
27  PULL_X,
28  PULL_Y,
29  };

Constructor & Destructor Documentation

◆ SiPixelPhase1RecHitsV()

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

Definition at line 19 of file SiPixelPhase1RecHitsV.cc.

20  : SiPixelPhase1Base(iConfig),
21  trackerHitAssociatorConfig_(iConfig, consumesCollector()),
22  srcToken_(consumes<SiPixelRecHitCollection>(iConfig.getParameter<edm::InputTag>("src"))) {}

Member Function Documentation

◆ analyze()

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

Implements SiPixelPhase1Base.

Definition at line 24 of file SiPixelPhase1RecHitsV.cc.

24  {
26  iEvent.getByToken(srcToken_, input);
27  if (!input.isValid())
28  return;
29 
31 
33  for (it = input->begin(); it != input->end(); ++it) {
34  auto id = DetId(it->detId());
35 
36  for (SiPixelRecHit const& rechit : *it) {
37  std::vector<PSimHit> associateSimHit;
38  associateSimHit = associate.associateHit(rechit);
39  std::vector<PSimHit>::const_iterator closestIt = associateSimHit.begin();
40 
41  LocalPoint lp = rechit.localPosition();
42  float rechit_x = lp.x();
43  float rechit_y = lp.y();
44 
45  LocalError lerr = rechit.localPositionError();
46  float lerr_x = sqrt(lerr.xx());
47  float lerr_y = sqrt(lerr.yy());
48 
49  // loop over associated sim hits and find the closest
50  if (!associateSimHit.empty()) {
51  float closestSimHit = 9999.9;
52 
53  for (std::vector<PSimHit>::const_iterator m = associateSimHit.begin(); m < associateSimHit.end(); m++) {
54  float sim_x1((*m).entryPoint().x()), sim_x2((*m).exitPoint().x()), sim_xpos(0.5 * (sim_x1 + sim_x2));
55  float sim_y1((*m).entryPoint().y()), sim_y2((*m).exitPoint().y()), sim_ypos(0.5 * (sim_y1 + sim_y2));
56 
57  float xres(std::abs(sim_xpos - rechit_x)), yres(std::abs(sim_ypos - rechit_y));
58  float dist = std::sqrt(xres * xres + yres * yres);
59 
60  if (dist < closestSimHit) {
61  closestSimHit = dist;
62  closestIt = m;
63  }
64  }
65  }
66 
67  // Sim Hit stuff
68 
69  if (!associateSimHit.empty()) {
70  const PSimHit& simHit = *closestIt;
71 
72  int bunch = simHit.eventId().bunchCrossing();
73  int event = simHit.eventId().event();
74 
75  float sim_x1(simHit.entryPoint().x()), sim_x2(simHit.exitPoint().x()), sim_xpos(0.5 * (sim_x1 + sim_x2));
76  float sim_y1(simHit.entryPoint().y()), sim_y2(simHit.exitPoint().y()), sim_ypos(0.5 * (sim_y1 + sim_y2));
77 
78  float res_x = (rechit_x - sim_xpos) * 10000.0;
79  float res_y = (rechit_y - sim_ypos) * 10000.0;
80 
81  float pull_x = (rechit_x - sim_xpos) / lerr_x;
82  float pull_y = (rechit_y - sim_ypos) / lerr_y;
83 
84  // Now Plotting stuff
85  if (bunch == 0)
86  histo[IN_TIME_BUNCH].fill(bunch, id, &iEvent);
87  if (bunch != 0)
88  histo[OUT_TIME_BUNCH].fill(bunch, id, &iEvent);
89 
90  histo[NSIMHITS].fill(event, id, &iEvent);
91 
92  histo[RECHIT_X].fill(rechit_x, id, &iEvent);
93  histo[RECHIT_Y].fill(rechit_y, id, &iEvent);
94 
95  histo[RES_X].fill(res_x, id, &iEvent);
96  histo[RES_Y].fill(res_y, id, &iEvent);
97 
98  histo[ERROR_X].fill(lerr_x, id, &iEvent);
99  histo[ERROR_Y].fill(lerr_y, id, &iEvent);
100 
101  histo[PULL_X].fill(pull_x, id, &iEvent);
102  histo[PULL_Y].fill(pull_y, id, &iEvent);
103  }
104  }
105  }
106 }

References funct::abs(), TrackerHitAssociator::associateHit(), ERROR_X, ERROR_Y, HistogramManagerHolder::histo, iEvent, IN_TIME_BUNCH, input, visualization-live-secondInstance_cfg::m, NSIMHITS, OUT_TIME_BUNCH, PULL_X, PULL_Y, RECHIT_X, RECHIT_Y, RES_X, RES_Y, rpcPointValidation_cfi::simHit, mathSSE::sqrt(), srcToken_, trackerHitAssociatorConfig_, PV3DBase< T, PVType, FrameType >::x(), LocalError::xx(), PV3DBase< T, PVType, FrameType >::y(), and LocalError::yy().

Member Data Documentation

◆ srcToken_

edm::EDGetTokenT<SiPixelRecHitCollection> SiPixelPhase1RecHitsV::srcToken_
private

Definition at line 37 of file SiPixelPhase1RecHitsV.h.

Referenced by analyze().

◆ trackerHitAssociatorConfig_

TrackerHitAssociator::Config SiPixelPhase1RecHitsV::trackerHitAssociatorConfig_
private

Definition at line 36 of file SiPixelPhase1RecHitsV.h.

Referenced by analyze().

SiPixelPhase1RecHitsV::ERROR_X
Definition: SiPixelPhase1RecHitsV.h:25
SiPixelPhase1RecHitsV::PULL_Y
Definition: SiPixelPhase1RecHitsV.h:28
input
static const std::string input
Definition: EdmProvDump.cc:48
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
SiPixelPhase1RecHitsV::RES_X
Definition: SiPixelPhase1RecHitsV.h:23
SiPixelPhase1RecHitsV::RECHIT_X
Definition: SiPixelPhase1RecHitsV.h:21
SiPixelPhase1RecHitsV::PULL_X
Definition: SiPixelPhase1RecHitsV.h:27
SiPixelPhase1RecHitsV::RECHIT_Y
Definition: SiPixelPhase1RecHitsV.h:22
edmNew::DetSetVector::const_iterator
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
Definition: DetSetVectorNew.h:197
SiPixelPhase1RecHitsV::trackerHitAssociatorConfig_
TrackerHitAssociator::Config trackerHitAssociatorConfig_
Definition: SiPixelPhase1RecHitsV.h:36
HistogramManagerHolder::histo
std::vector< HistogramManager > histo
Definition: SiPixelPhase1Base.h:37
SiPixelPhase1RecHitsV::NSIMHITS
Definition: SiPixelPhase1RecHitsV.h:20
edm::Handle
Definition: AssociativeIterator.h:50
SiPixelPhase1Base::SiPixelPhase1Base
SiPixelPhase1Base(const edm::ParameterSet &iConfig)
Definition: SiPixelPhase1Base.cc:14
SiPixelRecHit
Our base class.
Definition: SiPixelRecHit.h:23
DetId
Definition: DetId.h:17
LocalError::xx
float xx() const
Definition: LocalError.h:22
rpcPointValidation_cfi.simHit
simHit
Definition: rpcPointValidation_cfi.py:24
SiPixelPhase1RecHitsV::RES_Y
Definition: SiPixelPhase1RecHitsV.h:24
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:72
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
SiPixelPhase1RecHitsV::IN_TIME_BUNCH
Definition: SiPixelPhase1RecHitsV.h:18
Point3DBase< float, LocalTag >
SiPixelPhase1RecHitsV::OUT_TIME_BUNCH
Definition: SiPixelPhase1RecHitsV.h:19
LocalError
Definition: LocalError.h:12
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
iEvent
int iEvent
Definition: GenABIO.cc:224
SiPixelPhase1RecHitsV::ERROR_Y
Definition: SiPixelPhase1RecHitsV.h:26
TrackerHitAssociator
Definition: TrackerHitAssociator.h:55
SiPixelPhase1RecHitsV::srcToken_
edm::EDGetTokenT< SiPixelRecHitCollection > srcToken_
Definition: SiPixelPhase1RecHitsV.h:37
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
PSimHit
Definition: PSimHit.h:15
event
Definition: event.py:1
LocalError::yy
float yy() const
Definition: LocalError.h:24
edm::InputTag
Definition: InputTag.h:15