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 }
14 
15 
17 {
18 
19  // do anything here that needs to be done at desctruction time
20  // (e.g. close files, deallocate resources etc.)
21 
22 }
23 
25  edm::Run const &,
26  edm::EventSetup const &) {
27 }
28 
29 //
30 // member functions
31 //
32 
33 // ------------ method called to for each event ------------
34 void
36 {
37  using namespace edm;
38  // look at the clusters
40  iEvent.getByToken(clusterToken_, clusters);
41  const edm::DetSetVector<SiStripCluster>* clusterSet = clusters.product();
42  // loop on the detsetvector<cluster>
43  for (edm::DetSetVector<SiStripCluster>::const_iterator DSViter=clusterSet->begin(); DSViter!=clusterSet->end();DSViter++ ) {
46  for(edm::DetSet<SiStripCluster>::const_iterator iter=begin;iter!=end;++iter) {
47  LogDebug("ReconstructedClusters") << "Detid/Strip: " << std::hex << DSViter->id << std::dec << " / " << iter->barycenter();
48  }
49  }
50 }
51 
#define LogDebug(id)
T getParameter(std::string const &) const
ClusterCount(const edm::ParameterSet &)
Definition: ClusterCount.cc:6
~ClusterCount() override
Definition: ClusterCount.cc:16
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
edm::EDGetTokenT< edm::DetSetVector< SiStripCluster > > clusterToken_
Definition: ClusterCount.h:59
int iEvent
Definition: GenABIO.cc:224
#define end
Definition: vmac.h:39
iterator end()
Return the off-the-end iterator.
Definition: DetSetVector.h:361
T const * product() const
Definition: Handle.h:74
#define begin
Definition: vmac.h:32
HLT enums.
iterator begin()
Return an iterator to the first DetSet.
Definition: DetSetVector.h:346
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: ClusterCount.cc:35
collection_type::const_iterator const_iterator
Definition: DetSet.h:33
collection_type::const_iterator const_iterator
Definition: DetSetVector.h:104
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition: ClusterCount.cc:24
Definition: Run.h:45