CMS 3D CMS Logo

ClusterCount.cc
Go to the documentation of this file.
2 
3 //
4 // constructors and destructor
5 //
7 
8 {
9  //now do what ever initialization is needed
10  // clusterLabel_ = iConfig.getParameter<edm::InputTag>("ClustersLabel");
11  clusterToken_ = consumes<edm::DetSetVector<SiStripCluster> >(iConfig.getParameter<edm::InputTag>("ClustersLabel"));
12 }
13 
15  // do anything here that needs to be done at desctruction time
16  // (e.g. close files, deallocate resources etc.)
17 }
18 
20 
21 //
22 // member functions
23 //
24 
25 // ------------ method called to for each event ------------
27  using namespace edm;
28  // look at the clusters
30  iEvent.getByToken(clusterToken_, clusters);
31  const edm::DetSetVector<SiStripCluster>* clusterSet = clusters.product();
32  // loop on the detsetvector<cluster>
33  for (edm::DetSetVector<SiStripCluster>::const_iterator DSViter = clusterSet->begin(); DSViter != clusterSet->end();
34  DSViter++) {
35  edm::DetSet<SiStripCluster>::const_iterator begin = DSViter->data.begin();
37  for (edm::DetSet<SiStripCluster>::const_iterator iter = begin; iter != end; ++iter) {
38  LogDebug("ReconstructedClusters") << "Detid/Strip: " << std::hex << DSViter->id << std::dec << " / "
39  << iter->barycenter();
40  }
41  }
42 }
ClusterCount(const edm::ParameterSet &)
Definition: ClusterCount.cc:6
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
~ClusterCount() override
Definition: ClusterCount.cc:14
edm::EDGetTokenT< edm::DetSetVector< SiStripCluster > > clusterToken_
Definition: ClusterCount.h:54
int iEvent
Definition: GenABIO.cc:224
iterator end()
Return the off-the-end iterator.
Definition: DetSetVector.h:316
HLT enums.
iterator begin()
Return an iterator to the first DetSet.
Definition: DetSetVector.h:305
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: ClusterCount.cc:26
collection_type::const_iterator const_iterator
Definition: DetSet.h:31
collection_type::const_iterator const_iterator
Definition: DetSetVector.h:102
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition: ClusterCount.cc:19
Definition: Run.h:45
#define LogDebug(id)