test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
33  iSetup.get<TrackerDigiGeometryRecord>().get(tracker);
34  assert(tracker.isValid());
35 
36  auto forward = geometryInterface.intern("PXForward");
37  auto nforward = 0;
38 
40  for (it = input->begin(); it != input->end(); ++it) {
41  auto id = DetId(it->detId());
42 
43  const PixelGeomDetUnit* theGeomDet = dynamic_cast<const PixelGeomDetUnit*> ( tracker->idToDet(id) );
44  const PixelTopology& topol = theGeomDet->specificTopology();
45 
46  for(SiPixelCluster const& cluster : *it) {
47  histo[CHARGE].fill(double(cluster.charge()), id, &iEvent);
48  histo[SIZE ].fill(double(cluster.size() ), id, &iEvent);
49  histo[NCLUSTERS].fill(id, &iEvent);
50 
51  LocalPoint clustlp = topol.localPosition(MeasurementPoint(cluster.x(), cluster.y()));
52  GlobalPoint clustgp = theGeomDet->surface().toGlobal(clustlp);
53  histo[POSITION_B ].fill(clustgp.z(), clustgp.phi(), id, &iEvent);
54  histo[POSITION_F ].fill(clustgp.x(), clustgp.y(), id, &iEvent);
55  histo[POSITION_XZ].fill(clustgp.x(), clustgp.z(), id, &iEvent);
56  histo[POSITION_YZ].fill(clustgp.y(), clustgp.z(), id, &iEvent);
57  histo[SIZE_VS_ETA].fill(clustgp.eta(), cluster.sizeY(), id, &iEvent);
58 
60  nforward++;
61  }
62  }
63 
64  if (nforward > 180)
65  histo[EVENTRATE].fill(DetId(0), &iEvent);
66  histo[NCLUSTERS].executePerEventHarvesting(&iEvent);
67 }
68 
70 
T getParameter(std::string const &) const
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
void analyze(const edm::Event &, const edm::EventSetup &)
virtual LocalPoint localPosition(const MeasurementPoint &) const =0
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:457
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
assert(m_qm.get())
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
GeometryInterface geometryInterface
Measurement2DPoint MeasurementPoint
Measurement points are two-dimensional by default.
int iEvent
Definition: GenABIO.cc:230
T z() const
Definition: PV3DBase.h:64
static const Value UNDEFINED
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_
std::vector< HistogramManager > histo
T eta() const
Definition: PV3DBase.h:76
Pixel cluster – collection of neighboring pixels above threshold.
std::pair< Column, Value > extract(Column const &col, InterestingQuantities const &iq)
bool isValid() const
Definition: ESHandle.h:47
ID intern(std::string const &id)
T x() const
Definition: PV3DBase.h:62