CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
ClusterCount Class Reference

#include <mytests/ClusterCount/src/ClusterCount.cc>

Inheritance diagram for ClusterCount:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 ClusterCount (const edm::ParameterSet &)
 
 ~ClusterCount ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 

Private Attributes

edm::EDGetTokenT
< edm::DetSetVector
< SiStripCluster > > 
clusterToken_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Description: <one line="" class="" summary>="">

Implementation: <Notes on="" implementation>="">

Definition at line 44 of file ClusterCount.h.

Constructor & Destructor Documentation

ClusterCount::ClusterCount ( const edm::ParameterSet iConfig)
explicit

Definition at line 6 of file ClusterCount.cc.

References clusterToken_, and edm::ParameterSet::getParameter().

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 }
T getParameter(std::string const &) const
edm::EDGetTokenT< edm::DetSetVector< SiStripCluster > > clusterToken_
Definition: ClusterCount.h:58
ClusterCount::~ClusterCount ( )

Definition at line 16 of file ClusterCount.cc.

17 {
18 
19  // do anything here that needs to be done at desctruction time
20  // (e.g. close files, deallocate resources etc.)
21 
22 }

Member Function Documentation

void ClusterCount::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

Implements edm::EDAnalyzer.

Definition at line 31 of file ClusterCount.cc.

References begin, clusterToken_, end, edm::Event::getByToken(), and LogDebug.

32 {
33  using namespace edm;
34  // look at the clusters
36  // iEvent.getByLabel(clusterLabel_, clusters);
37  iEvent.getByToken(clusterToken_, clusters);
38  const edm::DetSetVector<SiStripCluster>* clusterSet = clusters.product();
39  // loop on the detsetvector<cluster>
40  for (edm::DetSetVector<SiStripCluster>::const_iterator DSViter=clusterSet->begin(); DSViter!=clusterSet->end();DSViter++ ) {
43  for(edm::DetSet<SiStripCluster>::const_iterator iter=begin;iter!=end;++iter) {
44  LogDebug("ReconstructedClusters") << "Detid/Strip: " << std::hex << DSViter->id << std::dec << " / " << iter->barycenter();
45  }
46  }
47 }
#define LogDebug(id)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
edm::EDGetTokenT< edm::DetSetVector< SiStripCluster > > clusterToken_
Definition: ClusterCount.h:58
#define end
Definition: vmac.h:37
#define begin
Definition: vmac.h:30
collection_type::const_iterator const_iterator
Definition: DetSet.h:33
collection_type::const_iterator const_iterator
Definition: DetSetVector.h:106

Member Data Documentation

edm::EDGetTokenT<edm::DetSetVector<SiStripCluster> > ClusterCount::clusterToken_
private

Definition at line 58 of file ClusterCount.h.

Referenced by analyze(), and ClusterCount().