CMS 3D CMS Logo

SiPixelPhase1TrackClustersV.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: SiPixelPhase1TrackClustersV
4 // Class: SiPixelPhase1TrackClustersV
5 //
6 
7 // Original Author: Marcel Schneider
8 // Additional Authors: Alexander Morton - modifying code for validation use
9 
12 
24 
26  : SiPixelPhase1Base(iConfig) {
27  clustersToken_ = consumes<edmNew::DetSetVector<SiPixelCluster>>(iConfig.getParameter<edm::InputTag>("clusters"));
28  tracksToken_ = consumes<reco::TrackCollection>(iConfig.getParameter<edm::InputTag>("tracks"));
29 }
30 
32  // get geometry
34  iSetup.get<TrackerDigiGeometryRecord>().get(tracker);
35  assert(tracker.isValid());
36 
37  // get the map
39  iEvent.getByToken(tracksToken_, tracks);
40 
41  // get clusters
43  iEvent.getByToken(clustersToken_, clusterColl);
44 
46  for (it = clusterColl->begin(); it != clusterColl->end(); ++it) {
47  auto id = DetId(it->detId());
48 
49  for (auto subit = it->begin(); subit != it->end(); ++subit) {
50  SiPixelCluster const &cluster = *subit;
51 
52  histo[CHARGE].fill(double(cluster.charge()), id, &iEvent);
53  histo[SIZE_X].fill(double(cluster.sizeX()), id, &iEvent);
54  histo[SIZE_Y].fill(double(cluster.sizeY()), id, &iEvent);
55  }
56  }
57 }
58 
T getParameter(std::string const &) const
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
const_iterator end(bool update=false) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
SiPixelPhase1TrackClustersV(const edm::ParameterSet &conf)
int charge() const
int iEvent
Definition: GenABIO.cc:224
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
edm::EDGetTokenT< reco::TrackCollection > tracksToken_
Definition: DetId.h:18
void analyze(const edm::Event &, const edm::EventSetup &) override
std::vector< HistogramManager > histo
int sizeY() const
Pixel cluster – collection of neighboring pixels above threshold.
T get() const
Definition: EventSetup.h:71
bool isValid() const
Definition: ESHandle.h:44
int sizeX() const
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > clustersToken_
const_iterator begin(bool update=false) const