CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
MTDRecHitProducer Class Reference
Inheritance diagram for MTDRecHitProducer:
edm::stream::EDProducer<>

Public Member Functions

 MTDRecHitProducer (const edm::ParameterSet &ps)
 
void produce (edm::Event &evt, const edm::EventSetup &es) override
 
 ~MTDRecHitProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Private Attributes

std::unique_ptr< MTDRecHitAlgoBasebarrel_
 
std::unique_ptr< MTDRecHitAlgoBaseendcap_
 
const std::string ftlbInstance_
 
const edm::EDGetTokenT< FTLUncalibratedRecHitCollectionftlbURecHits_
 
const std::string ftleInstance_
 
const edm::EDGetTokenT< FTLUncalibratedRecHitCollectionftleURecHits_
 
const MTDGeometrygeom_
 
edm::ESGetToken< MTDGeometry, MTDDigiGeometryRecordmtdgeoToken_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

Definition at line 22 of file MTDRecHitProducer.cc.

Constructor & Destructor Documentation

◆ MTDRecHitProducer()

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

Definition at line 41 of file MTDRecHitProducer.cc.

42  : ftlbURecHits_(
43  consumes<FTLUncalibratedRecHitCollection>(ps.getParameter<edm::InputTag>("barrelUncalibratedRecHits"))),
45  consumes<FTLUncalibratedRecHitCollection>(ps.getParameter<edm::InputTag>("endcapUncalibratedRecHits"))),
46  ftlbInstance_(ps.getParameter<std::string>("BarrelHitsName")),
47  ftleInstance_(ps.getParameter<std::string>("EndcapHitsName")) {
48  produces<FTLRecHitCollection>(ftlbInstance_);
49  produces<FTLRecHitCollection>(ftleInstance_);
50 
51  auto sumes = consumesCollector();
52  mtdgeoToken_ = esConsumes<MTDGeometry, MTDDigiGeometryRecord>();
53 
54  const edm::ParameterSet& barrel = ps.getParameterSet("barrel");
55  const std::string& barrelAlgo = barrel.getParameter<std::string>("algoName");
56  barrel_ = MTDRecHitAlgoFactory::get()->create(barrelAlgo, barrel, sumes);
57 
58  const edm::ParameterSet& endcap = ps.getParameterSet("endcap");
59  const std::string& endcapAlgo = endcap.getParameter<std::string>("algoName");
60  endcap_ = MTDRecHitAlgoFactory::get()->create(endcapAlgo, endcap, sumes);
61 }

References Reference_intrackfit_cff::barrel, barrel_, makeMuonMisalignmentScenario::endcap, endcap_, ftlbInstance_, ftleInstance_, get, edm::ParameterSet::getParameterSet(), mtdgeoToken_, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ ~MTDRecHitProducer()

MTDRecHitProducer::~MTDRecHitProducer ( )
override

Definition at line 63 of file MTDRecHitProducer.cc.

63 {}

Member Function Documentation

◆ produce()

void MTDRecHitProducer::produce ( edm::Event evt,
const edm::EventSetup es 
)
override

Definition at line 65 of file MTDRecHitProducer.cc.

65  {
67  geom_ = geom.product();
68 
69  // tranparently get things from event setup
70  barrel_->getEventSetup(es);
71  endcap_->getEventSetup(es);
72 
73  barrel_->getEvent(evt);
74  endcap_->getEvent(evt);
75 
76  // prepare output
77  auto barrelRechits = std::make_unique<FTLRecHitCollection>();
78  auto endcapRechits = std::make_unique<FTLRecHitCollection>();
79 
81  evt.getByToken(ftlbURecHits_, hBarrel);
82  barrelRechits->reserve(hBarrel->size() / 2);
83  for (const auto& uhit : *hBarrel) {
84  uint32_t flags = FTLRecHit::kGood;
85  auto rechit = barrel_->makeRecHit(uhit, flags);
86  if (flags == FTLRecHit::kGood)
87  barrelRechits->push_back(rechit);
88  }
89 
91  evt.getByToken(ftleURecHits_, hEndcap);
92  endcapRechits->reserve(hEndcap->size() / 2);
93  for (const auto& uhit : *hEndcap) {
94  uint32_t flags = FTLRecHit::kGood;
95  auto rechit = endcap_->makeRecHit(uhit, flags);
96  if (flags == FTLRecHit::kGood)
97  endcapRechits->push_back(rechit);
98  }
99 
100  // put the collection of recunstructed hits in the event
101  // get the orphan handles so we can make refs for the tracking rechits
102  auto barrelHandle = evt.put(std::move(barrelRechits), ftlbInstance_);
103  auto endcapHandle = evt.put(std::move(endcapRechits), ftleInstance_);
104 }

References barrel_, endcap_, HLT_FULL_cff::flags, ftlbInstance_, ftlbURecHits_, ftleInstance_, ftleURecHits_, relativeConstraints::geom, geom_, edm::Event::getByToken(), edm::EventSetup::getTransientHandle(), FTLRecHit::kGood, eostools::move(), mtdgeoToken_, edm::Event::put(), and edm::SortedCollection< T, SORT >::size().

Member Data Documentation

◆ barrel_

std::unique_ptr<MTDRecHitAlgoBase> MTDRecHitProducer::barrel_
private

Definition at line 35 of file MTDRecHitProducer.cc.

Referenced by MTDRecHitProducer(), and produce().

◆ endcap_

std::unique_ptr<MTDRecHitAlgoBase> MTDRecHitProducer::endcap_
private

Definition at line 35 of file MTDRecHitProducer.cc.

Referenced by MTDRecHitProducer(), and produce().

◆ ftlbInstance_

const std::string MTDRecHitProducer::ftlbInstance_
private

Definition at line 32 of file MTDRecHitProducer.cc.

Referenced by MTDRecHitProducer(), and produce().

◆ ftlbURecHits_

const edm::EDGetTokenT<FTLUncalibratedRecHitCollection> MTDRecHitProducer::ftlbURecHits_
private

Definition at line 29 of file MTDRecHitProducer.cc.

Referenced by produce().

◆ ftleInstance_

const std::string MTDRecHitProducer::ftleInstance_
private

Definition at line 33 of file MTDRecHitProducer.cc.

Referenced by MTDRecHitProducer(), and produce().

◆ ftleURecHits_

const edm::EDGetTokenT<FTLUncalibratedRecHitCollection> MTDRecHitProducer::ftleURecHits_
private

Definition at line 30 of file MTDRecHitProducer.cc.

Referenced by produce().

◆ geom_

const MTDGeometry* MTDRecHitProducer::geom_
private

Definition at line 37 of file MTDRecHitProducer.cc.

Referenced by produce().

◆ mtdgeoToken_

edm::ESGetToken<MTDGeometry, MTDDigiGeometryRecord> MTDRecHitProducer::mtdgeoToken_
private

Definition at line 38 of file MTDRecHitProducer.cc.

Referenced by MTDRecHitProducer(), and produce().

Reference_intrackfit_cff.barrel
list barrel
Definition: Reference_intrackfit_cff.py:37
MTDRecHitProducer::barrel_
std::unique_ptr< MTDRecHitAlgoBase > barrel_
Definition: MTDRecHitProducer.cc:35
edm::SortedCollection::size
size_type size() const
Definition: SortedCollection.h:215
makeMuonMisalignmentScenario.endcap
endcap
Definition: makeMuonMisalignmentScenario.py:320
edm::Handle
Definition: AssociativeIterator.h:50
relativeConstraints.geom
geom
Definition: relativeConstraints.py:72
MTDRecHitProducer::ftlbInstance_
const std::string ftlbInstance_
Definition: MTDRecHitProducer.cc:32
edm::Event::getByToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
MTDRecHitProducer::mtdgeoToken_
edm::ESGetToken< MTDGeometry, MTDDigiGeometryRecord > mtdgeoToken_
Definition: MTDRecHitProducer.cc:38
edm::ParameterSet
Definition: ParameterSet.h:47
MTDRecHitProducer::endcap_
std::unique_ptr< MTDRecHitAlgoBase > endcap_
Definition: MTDRecHitProducer.cc:35
MTDRecHitProducer::ftleURecHits_
const edm::EDGetTokenT< FTLUncalibratedRecHitCollection > ftleURecHits_
Definition: MTDRecHitProducer.cc:30
edm::Event::put
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
MTDRecHitProducer::ftlbURecHits_
const edm::EDGetTokenT< FTLUncalibratedRecHitCollection > ftlbURecHits_
Definition: MTDRecHitProducer.cc:29
MTDRecHitProducer::geom_
const MTDGeometry * geom_
Definition: MTDRecHitProducer.cc:37
get
#define get
edm::EventSetup::getTransientHandle
ESTransientHandle< T > getTransientHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:166
FTLRecHit::kGood
Definition: FTLRecHit.h:21
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
MTDRecHitProducer::ftleInstance_
const std::string ftleInstance_
Definition: MTDRecHitProducer.cc:33
eostools.move
def move(src, dest)
Definition: eostools.py:511
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
HLT_FULL_cff.flags
flags
Definition: HLT_FULL_cff.py:13168
edm::InputTag
Definition: InputTag.h:15
edm::ParameterSet::getParameterSet
ParameterSet const & getParameterSet(std::string const &) const
Definition: ParameterSet.cc:2128