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 
25 
27  SiPixelPhase1Base(iConfig)
28 {
29  clustersToken_ = consumes<edmNew::DetSetVector<SiPixelCluster>>(iConfig.getParameter<edm::InputTag>("clusters"));
30  tracksToken_ = consumes<reco::TrackCollection>(iConfig.getParameter<edm::InputTag>("tracks"));
31 }
32 
34 
35  // get geometry
37  iSetup.get<TrackerDigiGeometryRecord>().get(tracker);
38  assert(tracker.isValid());
39 
40  //get the map
42  iEvent.getByToken( tracksToken_, tracks);
43 
44  // get clusters
46  iEvent.getByToken( clustersToken_, clusterColl );
47 
49  for (it = clusterColl->begin(); it != clusterColl->end(); ++it) {
50  auto id = DetId(it->detId());
51 
52  for(auto subit = it->begin(); subit != it->end(); ++subit) {
53  SiPixelCluster const& cluster = *subit;
54 
55  histo[CHARGE].fill(double(cluster.charge() ), id, &iEvent);
56  histo[SIZE_X].fill(double(cluster.sizeX() ), id, &iEvent);
57  histo[SIZE_Y].fill(double(cluster.sizeY() ), id, &iEvent);
58  }
59  }
60 
61 }
62 
64 
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:579
SiPixelPhase1TrackClustersV(const edm::ParameterSet &conf)
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
int charge() const
int iEvent
Definition: GenABIO.cc:230
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:63
bool isValid() const
Definition: ESHandle.h:47
int sizeX() const
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > clustersToken_
const_iterator begin(bool update=false) const