CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_4/src/DQM/SiStripCommissioningSources/plugins/tracking/ClusterCount.cc

Go to the documentation of this file.
00001 #include "DQM/SiStripCommissioningSources/plugins/tracking/ClusterCount.h"
00002 
00003 //
00004 // constructors and destructor
00005 //
00006 ClusterCount::ClusterCount(const edm::ParameterSet& iConfig)
00007 
00008 {
00009    //now do what ever initialization is needed
00010    clusterLabel_ = iConfig.getParameter<edm::InputTag>("ClustersLabel");
00011    
00012 }
00013 
00014 
00015 ClusterCount::~ClusterCount()
00016 {
00017  
00018    // do anything here that needs to be done at desctruction time
00019    // (e.g. close files, deallocate resources etc.)
00020 
00021 }
00022 
00023 
00024 //
00025 // member functions
00026 //
00027 
00028 // ------------ method called to for each event  ------------
00029 void
00030 ClusterCount::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup)
00031 {
00032    using namespace edm;
00033    // look at the clusters
00034    edm::Handle<edm::DetSetVector<SiStripCluster> > clusters;
00035    iEvent.getByLabel(clusterLabel_, clusters);
00036    const edm::DetSetVector<SiStripCluster>* clusterSet = clusters.product();
00037    // loop on the detsetvector<cluster>
00038    for (edm::DetSetVector<SiStripCluster>::const_iterator DSViter=clusterSet->begin(); DSViter!=clusterSet->end();DSViter++ ) {
00039      edm::DetSet<SiStripCluster>::const_iterator begin=DSViter->data.begin();
00040      edm::DetSet<SiStripCluster>::const_iterator end  =DSViter->data.end();
00041      for(edm::DetSet<SiStripCluster>::const_iterator iter=begin;iter!=end;++iter) {
00042        LogDebug("ReconstructedClusters") << "Detid/Strip: " << std::hex << DSViter->id << std::dec << " / " << iter->barycenter();
00043      }
00044    }
00045 }
00046