CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
GEMPadDigiClusterProducer Class Reference

#include <GEMPadDigiClusterProducer.h>

Inheritance diagram for GEMPadDigiClusterProducer:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

virtual void beginRun (const edm::Run &, const edm::EventSetup &) override
 
 GEMPadDigiClusterProducer (const edm::ParameterSet &ps)
 
virtual void produce (edm::Event &, const edm::EventSetup &) override
 
virtual ~GEMPadDigiClusterProducer ()
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void buildClusters (const GEMPadDigiCollection &pads, GEMPadDigiClusterCollection &out_clusters)
 

Private Attributes

const GEMGeometrygeometry_
 
unsigned int maxClusters_
 
unsigned int maxClusterSize_
 
edm::EDGetTokenT< GEMPadDigiCollectionpad_token_
 Name of input digi Collection. More...
 
edm::InputTag pads_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- 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

Definition at line 16 of file GEMPadDigiClusterProducer.h.

Constructor & Destructor Documentation

GEMPadDigiClusterProducer::GEMPadDigiClusterProducer ( const edm::ParameterSet ps)
explicit

Definition at line 14 of file GEMPadDigiClusterProducer.cc.

References edm::ParameterSet::getParameter(), maxClusters_, maxClusterSize_, pad_token_, and pads_.

15 : geometry_(nullptr)
16 {
17  pads_ = ps.getParameter<edm::InputTag>("InputCollection");
18  maxClusters_ = ps.getParameter<unsigned int>("maxClusters");
19  maxClusterSize_ = ps.getParameter<unsigned int>("maxClusterSize");
20 
21  pad_token_ = consumes<GEMPadDigiCollection>(pads_);
22 
23  produces<GEMPadDigiClusterCollection>();
24  consumes<GEMPadDigiCollection>(pads_);
25 }
T getParameter(std::string const &) const
edm::EDGetTokenT< GEMPadDigiCollection > pad_token_
Name of input digi Collection.
GEMPadDigiClusterProducer::~GEMPadDigiClusterProducer ( )
virtual

Definition at line 28 of file GEMPadDigiClusterProducer.cc.

29 {}

Member Function Documentation

void GEMPadDigiClusterProducer::beginRun ( const edm::Run run,
const edm::EventSetup eventSetup 
)
overridevirtual

Definition at line 32 of file GEMPadDigiClusterProducer.cc.

References geometry_, and edm::EventSetup::get().

33 {
35  eventSetup.get<MuonGeometryRecord>().get(hGeom);
36  geometry_ = &*hGeom;
37 }
const T & get() const
Definition: EventSetup.h:56
void GEMPadDigiClusterProducer::buildClusters ( const GEMPadDigiCollection pads,
GEMPadDigiClusterCollection out_clusters 
)
private

Definition at line 56 of file GEMPadDigiClusterProducer.cc.

References GEMGeometry::chambers(), GetRecoTauVFromDQM_MC_cff::cl, edmIntegrityCheck::d, and geometry_.

Referenced by produce().

57 {
58  for (auto ch: geometry_->chambers()) {
59  unsigned int nClusters = 0;
60  for (auto part: ch->etaPartitions()) {
61  auto pads = det_pads.get(part->id());
62  std::vector<uint16_t> cl;
63  int startBX = 99;
64  for (auto d = pads.first; d != pads.second; ++d) {
65  if (cl.size() == 0) {
66  cl.push_back((*d).pad());
67  }
68  else {
69  if ((*d).bx() == startBX and (*d).pad() == cl.back() + 1) {
70  cl.push_back((*d).pad());
71  }
72  else {
73  GEMPadDigiCluster pad_cluster(cl, startBX);
74  out_clusters.insertDigi(part->id(), pad_cluster);
75  cl.clear();
76  cl.push_back((*d).pad());
77  nClusters++;
78  }
79  }
80  startBX = (*d).bx();
81  }
82  if (pads.first != pads.second){
83  GEMPadDigiCluster pad_cluster(cl, startBX);
84  out_clusters.insertDigi(part->id(), pad_cluster);
85  nClusters++;
86  }
87  }
88  }
89 }
part
Definition: HCALResponse.h:20
const std::vector< const GEMChamber * > & chambers() const
Return a vector of all GEM chambers.
Definition: GEMGeometry.cc:59
void GEMPadDigiClusterProducer::produce ( edm::Event e,
const edm::EventSetup eventSetup 
)
overridevirtual

Definition at line 40 of file GEMPadDigiClusterProducer.cc.

References buildClusters(), edm::Event::getByToken(), eostools::move(), pad_token_, edm::Handle< T >::product(), and edm::Event::put().

41 {
43  e.getByToken(pad_token_, hpads);
44 
45  // Create empty output
46  std::unique_ptr<GEMPadDigiClusterCollection> pClusters(new GEMPadDigiClusterCollection());
47 
48  // build the clusters
49  buildClusters(*(hpads.product()), *pClusters);
50 
51  // store them in the event
52  e.put(std::move(pClusters));
53 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:122
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:457
MuonDigiCollection< GEMDetId, GEMPadDigiCluster > GEMPadDigiClusterCollection
void buildClusters(const GEMPadDigiCollection &pads, GEMPadDigiClusterCollection &out_clusters)
T const * product() const
Definition: Handle.h:81
edm::EDGetTokenT< GEMPadDigiCollection > pad_token_
Name of input digi Collection.
def move(src, dest)
Definition: eostools.py:510

Member Data Documentation

const GEMGeometry* GEMPadDigiClusterProducer::geometry_
private

Definition at line 39 of file GEMPadDigiClusterProducer.h.

Referenced by beginRun(), and buildClusters().

unsigned int GEMPadDigiClusterProducer::maxClusters_
private

Definition at line 36 of file GEMPadDigiClusterProducer.h.

Referenced by GEMPadDigiClusterProducer().

unsigned int GEMPadDigiClusterProducer::maxClusterSize_
private

Definition at line 37 of file GEMPadDigiClusterProducer.h.

Referenced by GEMPadDigiClusterProducer().

edm::EDGetTokenT<GEMPadDigiCollection> GEMPadDigiClusterProducer::pad_token_
private

Name of input digi Collection.

Definition at line 33 of file GEMPadDigiClusterProducer.h.

Referenced by GEMPadDigiClusterProducer(), and produce().

edm::InputTag GEMPadDigiClusterProducer::pads_
private

Definition at line 34 of file GEMPadDigiClusterProducer.h.

Referenced by GEMPadDigiClusterProducer().