Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:33:38

0001 // -*- C++ -*-
0002 //
0003 // Package:     SiPixelPhase1TrackClustersV
0004 // Class:       SiPixelPhase1TrackClustersV
0005 //
0006 
0007 // Original Author: Marcel Schneider
0008 // Additional Authors: Alexander Morton - modifying code for validation use
0009 
0010 #include "FWCore/Framework/interface/MakerMacros.h"
0011 #include "Validation/SiPixelPhase1TrackClustersV/interface/SiPixelPhase1TrackClustersV.h"
0012 
0013 SiPixelPhase1TrackClustersV::SiPixelPhase1TrackClustersV(const edm::ParameterSet &iConfig)
0014     : SiPixelPhase1Base(iConfig) {
0015   clustersToken_ = consumes<edmNew::DetSetVector<SiPixelCluster>>(iConfig.getParameter<edm::InputTag>("clusters"));
0016 }
0017 
0018 void SiPixelPhase1TrackClustersV::analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) {
0019   // get clusters
0020   edm::Handle<edmNew::DetSetVector<SiPixelCluster>> clusterColl;
0021   iEvent.getByToken(clustersToken_, clusterColl);
0022 
0023   edmNew::DetSetVector<SiPixelCluster>::const_iterator it;
0024   for (it = clusterColl->begin(); it != clusterColl->end(); ++it) {
0025     auto id = DetId(it->detId());
0026 
0027     for (auto subit = it->begin(); subit != it->end(); ++subit) {
0028       SiPixelCluster const &cluster = *subit;
0029 
0030       histo[CHARGE].fill(double(cluster.charge()), id, &iEvent);
0031       histo[SIZE_X].fill(double(cluster.sizeX()), id, &iEvent);
0032       histo[SIZE_Y].fill(double(cluster.sizeY()), id, &iEvent);
0033     }
0034   }
0035 }
0036 
0037 DEFINE_FWK_MODULE(SiPixelPhase1TrackClustersV);