CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
Phase2TrackerRecHits Class Reference
Inheritance diagram for Phase2TrackerRecHits:
edm::global::EDProducer<> edm::global::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 Phase2TrackerRecHits (const edm::ParameterSet &conf)
 
void produce (edm::StreamID sid, edm::Event &event, const edm::EventSetup &eventSetup) const final
 
 ~Phase2TrackerRecHits () override
 
- Public Member Functions inherited from edm::global::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsStreamLuminosityBlocks () const final
 
bool wantsStreamRuns () const final
 
- Public Member Functions inherited from edm::global::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducerBase () override
 
- 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 ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
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, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 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 & itemsToGetFrom (BranchType iType) 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
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

edm::ESInputTag cpeTag_
 
edm::EDGetTokenT< Phase2TrackerCluster1DCollectionNewtoken_
 

Additional Inherited Members

- Public Types inherited from edm::global::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::global::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 30 of file Phase2TrackerRecHits.cc.

Constructor & Destructor Documentation

Phase2TrackerRecHits::Phase2TrackerRecHits ( const edm::ParameterSet conf)
explicit

Definition at line 45 of file Phase2TrackerRecHits.cc.

45  :
46  token_(consumes< Phase2TrackerCluster1DCollectionNew >(conf.getParameter<edm::InputTag>("src"))),
47  cpeTag_(conf.getParameter<edm::ESInputTag>("Phase2StripCPE")) {
48  produces<Phase2TrackerRecHit1DCollectionNew>();
49 }
T getParameter(std::string const &) const
edm::EDGetTokenT< Phase2TrackerCluster1DCollectionNew > token_
Phase2TrackerRecHits::~Phase2TrackerRecHits ( )
inlineoverride

Definition at line 35 of file Phase2TrackerRecHits.cc.

References produce().

35 {};

Member Function Documentation

void Phase2TrackerRecHits::produce ( edm::StreamID  sid,
edm::Event event,
const edm::EventSetup eventSetup 
) const
final

Definition at line 51 of file Phase2TrackerRecHits.cc.

References fastPrimaryVertexProducer_cfi::clusters, cpeTag_, DEFINE_FWK_MODULE, edm::EventSetup::get(), TrackerGeometry::idToDetUnit(), edmNew::makeRefTo(), eostools::move(), TrackInfoProducer_cfi::rechits, and token_.

Referenced by ~Phase2TrackerRecHits().

51  {
52 
53  // Get the Clusters
55  event.getByToken(token_, clusters);
56 
57  // load the cpe via the eventsetup
59  eventSetup.get<TkStripCPERecord>().get(cpeTag_, cpe);
60 
61  // Get the geometry
63  eventSetup.get< TrackerDigiGeometryRecord >().get(geomHandle);
64  const TrackerGeometry* tkGeom(&(*geomHandle));
65 
66  // Global container for the RecHits of each module
67  auto outputRecHits = std::make_unique<Phase2TrackerRecHit1DCollectionNew>();
68 
69  // Loop over clusters
70  for (const auto &clusterDetSet : *clusters) {
71 
72  DetId detId(clusterDetSet.detId());
73 
74  // Geometry
75  const GeomDetUnit * geomDetUnit(tkGeom->idToDetUnit(detId));
76 
77  // Container for the clusters that will be produced for this modules
78  Phase2TrackerRecHit1DCollectionNew::FastFiller rechits(*outputRecHits, clusterDetSet.detId());
79 
80  for (const auto &clusterRef : clusterDetSet) {
81  ClusterParameterEstimator< Phase2TrackerCluster1D >::LocalValues lv = cpe->localParameters(clusterRef, *geomDetUnit);
82 
83  // Create a persistent edm::Ref to the cluster
85 
86  // Make a RecHit and add it to the DetSet
87  Phase2TrackerRecHit1D hit(lv.first, lv.second, *geomDetUnit, cluster);
88 
89  rechits.push_back(hit);
90  }
91  }
92 
93  outputRecHits->shrink_to_fit();
94  event.put(std::move(outputRecHits));
95 
96 }
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)
Definition: DetId.h:18
T get() const
Definition: EventSetup.h:62
edm::EDGetTokenT< Phase2TrackerCluster1DCollectionNew > token_
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

edm::ESInputTag Phase2TrackerRecHits::cpeTag_
private

Definition at line 41 of file Phase2TrackerRecHits.cc.

Referenced by produce().

edm::EDGetTokenT< Phase2TrackerCluster1DCollectionNew > Phase2TrackerRecHits::token_
private

Definition at line 40 of file Phase2TrackerRecHits.cc.

Referenced by produce().