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
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 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
std::vector< ConsumesInfoconsumesInfo () const
 
 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
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) 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
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- 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 47 of file SiPixelClusterShapeCacheProducer.cc.

Member Typedef Documentation

Definition at line 57 of file SiPixelClusterShapeCacheProducer.cc.

Constructor & Destructor Documentation

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

Definition at line 63 of file SiPixelClusterShapeCacheProducer.cc.

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

Definition at line 70 of file SiPixelClusterShapeCacheProducer.cc.

70 {}

Member Function Documentation

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

Definition at line 72 of file SiPixelClusterShapeCacheProducer.cc.

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

72  {
74  desc.add<edm::InputTag>("src", edm::InputTag("siPixelClusters"));
75  desc.add<bool>("onDemand", false);
76  descriptions.add("siPixelClusterShapeCache", desc);
77 }
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 79 of file SiPixelClusterShapeCacheProducer.cc.

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

79  {
81  iEvent.getByToken(token_, input);
82 
84  iSetup.get<TrackerDigiGeometryRecord>().get(geom);
85 
86  auto filler = std::make_shared<ClusterShapeLazyGetter>();
87 
88  std::auto_ptr<SiPixelClusterShapeCache> output(onDemand_ ?
89  new SiPixelClusterShapeCache(input, filler) :
90  new SiPixelClusterShapeCache(input));
91  output->resize(input->data().size());
92 
93  if(!onDemand_) {
94  for(const auto& detSet: *input) {
95  const GeomDetUnit *genericDet = geom->idToDetUnit(detSet.detId());
96  const PixelGeomDetUnit *pixDet = dynamic_cast<const PixelGeomDetUnit *>(genericDet);
97  assert(pixDet);
98 
99  edmNew::DetSet<SiPixelCluster>::const_iterator iCluster = detSet.begin(), endCluster = detSet.end();
100  for(; iCluster != endCluster; ++iCluster) {
101  SiPixelClusterShapeCache::ClusterRef clusterRef = edmNew::makeRefTo(input, iCluster);
102  filler->fill(clusterRef, pixDet, *output);
103  }
104  }
105  output->shrink_to_fit();
106  }
107 
108  iEvent.put(output);
109 }
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:464
assert(m_qm.get())
data_type const * const_iterator
Definition: DetSetNew.h:30
static std::string const input
Definition: EdmProvDump.cc:43
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:120
const T & get() const
Definition: EventSetup.h:56
edm::EDGetTokenT< InputCollection > token_

Member Data Documentation

const bool SiPixelClusterShapeCacheProducer::onDemand_
private

Definition at line 60 of file SiPixelClusterShapeCacheProducer.cc.

Referenced by produce().

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

Definition at line 59 of file SiPixelClusterShapeCacheProducer.cc.

Referenced by produce().