CMS 3D CMS Logo

SiPixelPhase1Clusters.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: SiPixelPhase1Clusters
4 // Class: SiPixelPhase1Clusters
5 //
6 
7 // Original Author: Marcel Schneider
8 
11 
19 
20 
22  SiPixelPhase1Base(iConfig)
23 {
24  srcToken_ = consumes<edmNew::DetSetVector<SiPixelCluster>>(iConfig.getParameter<edm::InputTag>("src"));
25 }
26 
29  iEvent.getByToken(srcToken_, input);
30  if (!input.isValid()) return;
31 
32  bool hasClusters=false;
33 
35  iSetup.get<TrackerDigiGeometryRecord>().get(tracker);
36  assert(tracker.isValid());
37 
39  for (it = input->begin(); it != input->end(); ++it) {
40  auto id = DetId(it->detId());
41 
42  const PixelGeomDetUnit* theGeomDet = dynamic_cast<const PixelGeomDetUnit*> ( tracker->idToDet(id) );
43  const PixelTopology& topol = theGeomDet->specificTopology();
44 
45  for(SiPixelCluster const& cluster : *it) {
46  int row = cluster.x()-0.5, col = cluster.y()-0.5;
47  histo[READOUT_CHARGE].fill(double(cluster.charge()), id, &iEvent, col, row);
48  histo[CHARGE].fill(double(cluster.charge()), id, &iEvent, col, row);
49  histo[SIZE ].fill(double(cluster.size() ), id, &iEvent, col, row);
50  histo[SIZEX ].fill(double(cluster.sizeX() ), id, &iEvent, col, row);
51  histo[SIZEY ].fill(double(cluster.sizeY() ), id, &iEvent, col, row);
52  histo[NCLUSTERS].fill(id, &iEvent, col, row);
53  histo[NCLUSTERSINCLUSIVE].fill(id, &iEvent);
54  hasClusters=true;
55  if (cluster.size()>1){
56  histo[READOUT_NCLUSTERS].fill(id, &iEvent);
57  }
58 
59  LocalPoint clustlp = topol.localPosition(MeasurementPoint(cluster.x(), cluster.y()));
60  GlobalPoint clustgp = theGeomDet->surface().toGlobal(clustlp);
61  histo[POSITION_B ].fill(clustgp.z(), clustgp.phi(), id, &iEvent);
62  histo[POSITION_F ].fill(clustgp.x(), clustgp.y(), id, &iEvent);
63  histo[POSITION_XZ].fill(clustgp.x(), clustgp.z(), id, &iEvent);
64  histo[POSITION_YZ].fill(clustgp.y(), clustgp.z(), id, &iEvent);
65  histo[SIZE_VS_ETA].fill(clustgp.eta(), cluster.sizeY(), id, &iEvent);
66 
67  }
68  }
69 
70 
71  if (hasClusters) histo[EVENTRATE].fill(DetId(0), &iEvent);
72 
73  histo[NCLUSTERS].executePerEventHarvesting(&iEvent);
74  histo[READOUT_NCLUSTERS].executePerEventHarvesting(&iEvent);
75  histo[NCLUSTERSINCLUSIVE].executePerEventHarvesting(&iEvent);
76 
77 }
78 
80 
T getParameter(std::string const &) const
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
void analyze(const edm::Event &, const edm::EventSetup &)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:457
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
T y() const
Definition: PV3DBase.h:63
SiPixelPhase1Clusters(const edm::ParameterSet &conf)
static std::string const input
Definition: EdmProvDump.cc:44
Measurement2DPoint MeasurementPoint
Measurement points are two-dimensional by default.
int iEvent
Definition: GenABIO.cc:230
T z() const
Definition: PV3DBase.h:64
bool isValid() const
Definition: HandleBase.h:75
Definition: DetId.h:18
const T & get() const
Definition: EventSetup.h:56
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > srcToken_
virtual LocalPoint localPosition(const MeasurementPoint &) const =0
std::vector< HistogramManager > histo
T eta() const
Definition: PV3DBase.h:76
Pixel cluster – collection of neighboring pixels above threshold.
col
Definition: cuy.py:1008
bool isValid() const
Definition: ESHandle.h:47
T x() const
Definition: PV3DBase.h:62
const TrackerGeomDet * idToDet(DetId) const