CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Types | Private Attributes
SiPixelClusterShapeCacheProducer Class Reference
Inheritance diagram for SiPixelClusterShapeCacheProducer:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

void produce (edm::Event &iEvent, const edm::EventSetup &iSetup)
 
 SiPixelClusterShapeCacheProducer (const edm::ParameterSet &iConfig)
 
 ~SiPixelClusterShapeCacheProducer ()
 
- 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
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- 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
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Types

using InputCollection = edmNew::DetSetVector< SiPixelCluster >
 

Private Attributes

const bool onDemand_
 
edm::EDGetTokenT< InputCollectiontoken_
 

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, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Protected Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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 51 of file SiPixelClusterShapeCacheProducer.cc.

Member Typedef Documentation

Definition at line 61 of file SiPixelClusterShapeCacheProducer.cc.

Constructor & Destructor Documentation

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

Definition at line 67 of file SiPixelClusterShapeCacheProducer.cc.

67  :
68  token_(consumes<InputCollection>(iConfig.getParameter<edm::InputTag>("src"))),
69  onDemand_(iConfig.getParameter<bool>("onDemand"))
70 {
71  produces<SiPixelClusterShapeCache>();
72 }
T getParameter(std::string const &) const
edm::EDGetTokenT< InputCollection > token_
SiPixelClusterShapeCacheProducer::~SiPixelClusterShapeCacheProducer ( )

Definition at line 74 of file SiPixelClusterShapeCacheProducer.cc.

74 {}

Member Function Documentation

void SiPixelClusterShapeCacheProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 76 of file SiPixelClusterShapeCacheProducer.cc.

References edm::ConfigurationDescriptions::add(), and edm::ParameterSetDescription::add().

76  {
78  desc.add<edm::InputTag>("src", edm::InputTag("siPixelClusters"));
79  desc.add<bool>("onDemand", false);
80  descriptions.add("siPixelClusterShapeCache", desc);
81 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void SiPixelClusterShapeCacheProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Implements edm::stream::EDProducerBase.

Definition at line 83 of file SiPixelClusterShapeCacheProducer.cc.

References relativeConstraints::geom, edm::EventSetup::get(), edm::Event::getByToken(), input, edmNew::makeRefTo(), onDemand_, convertSQLitetoXML_cfg::output, edm::Event::put(), and token_.

83  {
85  iEvent.getByToken(token_, input);
86 
88  iSetup.get<TrackerDigiGeometryRecord>().get(geom);
89 
90  auto filler = std::make_shared<ClusterShapeLazyGetter>();
91 
92  std::auto_ptr<SiPixelClusterShapeCache> output(onDemand_ ?
93  new SiPixelClusterShapeCache(input, filler) :
94  new SiPixelClusterShapeCache(input));
95  output->resize(input->data().size());
96 
97  if(!onDemand_) {
98  for(const auto& detSet: *input) {
99  const GeomDetUnit *genericDet = geom->idToDetUnit(detSet.detId());
100  const PixelGeomDetUnit *pixDet = dynamic_cast<const PixelGeomDetUnit *>(genericDet);
101  assert(pixDet);
102 
103  edmNew::DetSet<SiPixelCluster>::const_iterator iCluster = detSet.begin(), endCluster = detSet.end();
104  for(; iCluster != endCluster; ++iCluster) {
105  SiPixelClusterShapeCache::ClusterRef clusterRef = edmNew::makeRefTo(input, iCluster);
106  filler->fill(clusterRef, pixDet, *output);
107  }
108  }
109  output->shrink_to_fit();
110  }
111 
112  iEvent.put(output);
113 }
edm::Ref< typename HandleT::element_type, typename HandleT::element_type::value_type::value_type > makeRefTo(const HandleT &iHandle, typename HandleT::element_type::value_type::const_iterator itIter)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:446
data_type const * const_iterator
Definition: DetSetNew.h:30
static std::string const input
Definition: EdmProvDump.cc:44
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:113
const T & get() const
Definition: EventSetup.h:55
edm::EDGetTokenT< InputCollection > token_

Member Data Documentation

const bool SiPixelClusterShapeCacheProducer::onDemand_
private

Definition at line 64 of file SiPixelClusterShapeCacheProducer.cc.

Referenced by produce().

edm::EDGetTokenT<InputCollection> SiPixelClusterShapeCacheProducer::token_
private

Definition at line 63 of file SiPixelClusterShapeCacheProducer.cc.

Referenced by produce().