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 }
#define LogDebug(id)
T getParameter(std::string const &) const
ClusterCount(const edm::ParameterSet &)
Definition: ClusterCount.cc:6
~ClusterCount() override
Definition: ClusterCount.cc:14
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
edm::EDGetTokenT< edm::DetSetVector< SiStripCluster > > clusterToken_
Definition: ClusterCount.h:54
int iEvent
Definition: GenABIO.cc:224
#define end
Definition: vmac.h:39
iterator end()
Return the off-the-end iterator.
Definition: DetSetVector.h:325
T const * product() const
Definition: Handle.h:69
#define begin
Definition: vmac.h:32
HLT enums.
iterator begin()
Return an iterator to the first DetSet.
Definition: DetSetVector.h:314
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: ClusterCount.cc:26
collection_type::const_iterator const_iterator
Definition: DetSet.h:32
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