Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:08:34

0001 #include "DQM/SiStripCommissioningSources/plugins/tracking/ClusterCount.h"
0002 
0003 //
0004 // constructors and destructor
0005 //
0006 ClusterCount::ClusterCount(const edm::ParameterSet& iConfig)
0007 
0008 {
0009   //now do what ever initialization is needed
0010   //   clusterLabel_ = iConfig.getParameter<edm::InputTag>("ClustersLabel");
0011   clusterToken_ = consumes<edm::DetSetVector<SiStripCluster> >(iConfig.getParameter<edm::InputTag>("ClustersLabel"));
0012 }
0013 
0014 ClusterCount::~ClusterCount() {
0015   // do anything here that needs to be done at desctruction time
0016   // (e.g. close files, deallocate resources etc.)
0017 }
0018 
0019 void ClusterCount::bookHistograms(DQMStore::IBooker& iBooker, edm::Run const&, edm::EventSetup const&) {}
0020 
0021 //
0022 // member functions
0023 //
0024 
0025 // ------------ method called to for each event  ------------
0026 void ClusterCount::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) {
0027   using namespace edm;
0028   // look at the clusters
0029   edm::Handle<edm::DetSetVector<SiStripCluster> > clusters;
0030   iEvent.getByToken(clusterToken_, clusters);
0031   const edm::DetSetVector<SiStripCluster>* clusterSet = clusters.product();
0032   // loop on the detsetvector<cluster>
0033   for (edm::DetSetVector<SiStripCluster>::const_iterator DSViter = clusterSet->begin(); DSViter != clusterSet->end();
0034        DSViter++) {
0035     edm::DetSet<SiStripCluster>::const_iterator begin = DSViter->data.begin();
0036     edm::DetSet<SiStripCluster>::const_iterator end = DSViter->data.end();
0037     for (edm::DetSet<SiStripCluster>::const_iterator iter = begin; iter != end; ++iter) {
0038       LogDebug("ReconstructedClusters") << "Detid/Strip: " << std::hex << DSViter->id << std::dec << " / "
0039                                         << iter->barycenter();
0040     }
0041   }
0042 }