test
CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SiPixelPhase1RecHits.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: SiPixelPhase1RecHits
4 // Class: SiPixelPhase1RecHits
5 //
6 
7 // Original Author: Marcel Schneider
8 
11 
14 
15 
17  SiPixelPhase1Base(iConfig)
18 {
19  srcToken_ = consumes<SiPixelRecHitCollection>(iConfig.getParameter<edm::InputTag>("src"));
20 }
21 
24  iEvent.getByToken(srcToken_, input);
25  if (!input.isValid()) return;
26 
28  for (it = input->begin(); it != input->end(); ++it) {
29  auto id = DetId(it->detId());
30 
31  for(SiPixelRecHit const& rechit : *it) {
32  SiPixelRecHit::ClusterRef const& clust = rechit.cluster();
33  int sizeX = (*clust).sizeX();
34  int sizeY = (*clust).sizeY();
35 
36  LocalPoint lp = rechit.localPosition();
37  float rechit_x = lp.x();
38  float rechit_y = lp.y();
39 
40  LocalError lerr = rechit.localPositionError();
41  float lerr_x = sqrt(lerr.xx());
42  float lerr_y = sqrt(lerr.yy());
43 
44  histo[NRECHITS].fill(id, &iEvent);
45 
46  histo[CLUST_X].fill(sizeX, id, &iEvent);
47  histo[CLUST_Y].fill(sizeY, id, &iEvent);
48 
49  histo[ERROR_X].fill(lerr_x, id, &iEvent);
50  histo[ERROR_Y].fill(lerr_y, id, &iEvent);
51 
52  histo[POS].fill(rechit_x, rechit_y, id, &iEvent);
53  }
54  }
55 
56  histo[NRECHITS].executePerEventHarvesting(&iEvent);
57 }
58 
60 
T getParameter(std::string const &) const
float xx() const
Definition: LocalError.h:24
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
edm::EDGetTokenT< SiPixelRecHitCollection > srcToken_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:457
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
void analyze(const edm::Event &, const edm::EventSetup &)
SiPixelPhase1RecHits(const edm::ParameterSet &conf)
T y() const
Definition: PV3DBase.h:63
static std::string const input
Definition: EdmProvDump.cc:44
int iEvent
Definition: GenABIO.cc:230
float yy() const
Definition: LocalError.h:26
T sqrt(T t)
Definition: SSEVec.h:18
bool isValid() const
Definition: HandleBase.h:75
Definition: DetId.h:18
std::vector< HistogramManager > histo
T x() const
Definition: PV3DBase.h:62
Our base class.
Definition: SiPixelRecHit.h:23