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 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 overridefinal
 
virtual ~Phase2TrackerRecHits ()
 
- Public Member Functions inherited from edm::global::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::global::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 (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &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 ()
 

Private Attributes

edm::ESInputTag cpeTag_
 
edm::EDGetTokenT
< Phase2TrackerCluster1DCollectionNew
token_
 

Additional Inherited Members

- Public Types inherited from edm::global::EDProducerBase
typedef EDProducerBase 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::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_
virtual Phase2TrackerRecHits::~Phase2TrackerRecHits ( )
inlinevirtual

Definition at line 35 of file Phase2TrackerRecHits.cc.

35 {};

Member Function Documentation

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

Implements edm::global::EDProducerBase.

Definition at line 51 of file Phase2TrackerRecHits.cc.

References HLT_FULL_cff::clusters, cpeTag_, edm::EventSetup::get(), TrackerGeometry::idToDetUnit(), edmNew::makeRefTo(), HI_PhotonSkim_cff::rechits, and token_.

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 
67  eventSetup.get< IdealGeometryRecord >().get(tTopoHandle);
68  //const TrackerTopology* tTopo(tTopoHandle.product());
69 
70  // Global container for the RecHits of each module
71  std::auto_ptr< Phase2TrackerRecHit1DCollectionNew > outputRecHits(new Phase2TrackerRecHit1DCollectionNew());
72 
73  // Loop over clusters
74  for (auto DSViter : *clusters) {
75 
76  DetId detId(DSViter.detId());
77 
78  // Geometry
79  const GeomDetUnit * geomDetUnit(tkGeom->idToDetUnit(detId));
80 
81  // Container for the clusters that will be produced for this modules
82  Phase2TrackerRecHit1DCollectionNew::FastFiller rechits(*outputRecHits, DSViter.detId());
83 
84  for (auto clustIt : DSViter) {
85  ClusterParameterEstimator< Phase2TrackerCluster1D >::LocalValues lv = cpe->localParameters(clustIt, *geomDetUnit);
86 
87  // Create a persistent edm::Ref to the cluster
89 
90  // Make a RecHit and add it to the DetSet
91  Phase2TrackerRecHit1D hit(lv.first, lv.second, cluster);
92 
93  rechits.push_back(hit);
94  }
95  }
96 
97  outputRecHits->shrink_to_fit();
98  event.put(outputRecHits);
99 
100 }
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)
edmNew::DetSetVector< Phase2TrackerRecHit1D > Phase2TrackerRecHit1DCollectionNew
Definition: DetId.h:18
const T & get() const
Definition: EventSetup.h:56
edm::EDGetTokenT< Phase2TrackerCluster1DCollectionNew > token_

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().