CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
trackerDTC::ProducerED Class Reference

Class to produce hardware like structured TTStub Collection used by Track Trigger emulators. More...

Inheritance diagram for trackerDTC::ProducerED:
edm::stream::EDProducer<>

Public Member Functions

 ProducerED (const ParameterSet &)
 
 ~ProducerED () 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 Member Functions

void beginRun (const Run &, const EventSetup &) override
 
void endJob ()
 
void produce (Event &, const EventSetup &) override
 

Private Attributes

EDGetTokenT< TTStubDetSetVecedGetToken_
 
EDPutTokenT< TTDTCedPutTokenAccepted_
 
EDPutTokenT< TTDTCedPutTokenLost_
 
ESGetToken< LayerEncoding, LayerEncodingRcdesGetTokenLayerEncoding_
 
ESGetToken< Setup, SetupRcdesGetTokenSetup_
 
ParameterSet iConfig_
 
const LayerEncodinglayerEncoding_ = nullptr
 
const Setupsetup_ = nullptr
 

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

Class to produce hardware like structured TTStub Collection used by Track Trigger emulators.

Author
Thomas Schuh
Date
2020, Jan

Definition at line 37 of file ProducerED.cc.

Constructor & Destructor Documentation

◆ ProducerED()

trackerDTC::ProducerED::ProducerED ( const ParameterSet iConfig)
explicit

Definition at line 64 of file ProducerED.cc.

References edGetToken_, edPutTokenAccepted_, edPutTokenLost_, esGetTokenLayerEncoding_, esGetTokenSetup_, edm::ParameterSet::getParameter(), and SimL1EmulatorRepack_Full_cff::inputTag.

64  : iConfig_(iConfig) {
65  // book in- and output ED products
66  const auto& inputTag = iConfig.getParameter<InputTag>("InputTag");
67  const auto& branchAccepted = iConfig.getParameter<string>("BranchAccepted");
68  const auto& branchLost = iConfig.getParameter<string>("BranchLost");
69  edGetToken_ = consumes<TTStubDetSetVec>(inputTag);
70  edPutTokenAccepted_ = produces<TTDTC>(branchAccepted);
71  edPutTokenLost_ = produces<TTDTC>(branchLost);
72  // book ES products
73  esGetTokenSetup_ = esConsumes<Setup, SetupRcd, Transition::BeginRun>();
74  esGetTokenLayerEncoding_ = esConsumes<LayerEncoding, LayerEncodingRcd, Transition::BeginRun>();
75  }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
EDGetTokenT< TTStubDetSetVec > edGetToken_
Definition: ProducerED.cc:51
ESGetToken< Setup, SetupRcd > esGetTokenSetup_
Definition: ProducerED.cc:57
EDPutTokenT< TTDTC > edPutTokenLost_
Definition: ProducerED.cc:55
ESGetToken< LayerEncoding, LayerEncodingRcd > esGetTokenLayerEncoding_
Definition: ProducerED.cc:59
ParameterSet iConfig_
Definition: ProducerED.cc:61
EDPutTokenT< TTDTC > edPutTokenAccepted_
Definition: ProducerED.cc:53

◆ ~ProducerED()

trackerDTC::ProducerED::~ProducerED ( )
inlineoverride

Definition at line 40 of file ProducerED.cc.

40 {}

Member Function Documentation

◆ beginRun()

void trackerDTC::ProducerED::beginRun ( const Run iRun,
const EventSetup iSetup 
)
overrideprivate

Definition at line 77 of file ProducerED.cc.

References tt::Setup::checkHistory(), tt::Setup::configurationSupported(), esGetTokenLayerEncoding_, esGetTokenSetup_, edm::EventSetup::getData(), edm::ParameterSet::getParameter(), iConfig_, layerEncoding_, edm::Run::processHistory(), and setup_.

77  {
78  setup_ = &iSetup.getData(esGetTokenSetup_);
80  return;
81  // check process history if desired
82  if (iConfig_.getParameter<bool>("CheckHistory"))
85  }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
const LayerEncoding * layerEncoding_
Definition: ProducerED.cc:49
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
const Setup * setup_
Definition: ProducerED.cc:47
ESGetToken< Setup, SetupRcd > esGetTokenSetup_
Definition: ProducerED.cc:57
bool configurationSupported() const
Definition: Setup.h:60
ProcessHistory const & processHistory() const
Definition: Run.cc:115
void checkHistory(const edm::ProcessHistory &processHistory) const
Definition: Setup.cc:238
ESGetToken< LayerEncoding, LayerEncodingRcd > esGetTokenLayerEncoding_
Definition: ProducerED.cc:59
ParameterSet iConfig_
Definition: ProducerED.cc:61

◆ endJob()

void trackerDTC::ProducerED::endJob ( void  )
inlineprivate

Definition at line 45 of file ProducerED.cc.

45 {}

◆ produce()

void trackerDTC::ProducerED::produce ( Event iEvent,
const EventSetup iSetup 
)
overrideprivate

Definition at line 87 of file ProducerED.cc.

References tt::Setup::configurationSupported(), hcalRecHitTable_cff::detId, tt::SensorModule::dtcId(), edGetToken_, edPutTokenAccepted_, edPutTokenLost_, patZpeak::handle, iConfig_, iEvent, layerEncoding_, edm::makeRefTo(), tt::SensorModule::modId(), eostools::move(), tt::Setup::numDTCs(), tt::Setup::numModulesPerDTC(), tt::Setup::offsetDetIdDSV(), tt::Setup::sensorModule(), setup_, and tt::Setup::ttDTC().

87  {
88  // empty DTC products
89  TTDTC productAccepted = setup_->ttDTC();
90  TTDTC productLost = setup_->ttDTC();
92  // read in stub collection
94  iEvent.getByToken(edGetToken_, handle);
95  // apply cabling map, reorganise stub collections
96  vector<vector<vector<TTStubRef>>> stubsDTCs(setup_->numDTCs(),
97  vector<vector<TTStubRef>>(setup_->numModulesPerDTC()));
98  for (auto module = handle->begin(); module != handle->end(); module++) {
99  // DetSetVec->detId + 1 = tk layout det id
100  const DetId detId = module->detId() + setup_->offsetDetIdDSV();
101  // corresponding sensor module
103  // empty stub collection
104  vector<TTStubRef>& stubsModule = stubsDTCs[sm->dtcId()][sm->modId()];
105  stubsModule.reserve(module->size());
106  for (TTStubDetSet::const_iterator ttStub = module->begin(); ttStub != module->end(); ttStub++)
107  stubsModule.emplace_back(makeRefTo(handle, ttStub));
108  }
109  // board level processing
110  for (int dtcId = 0; dtcId < setup_->numDTCs(); dtcId++) {
111  // create single outer tracker DTC board
112  DTC dtc(iConfig_, setup_, layerEncoding_, dtcId, stubsDTCs.at(dtcId));
113  // route stubs and fill products
114  dtc.produce(productAccepted, productLost);
115  }
116  }
117  // store ED products
118  iEvent.emplace(edPutTokenAccepted_, std::move(productAccepted));
119  iEvent.emplace(edPutTokenLost_, std::move(productLost));
120  }
const LayerEncoding * layerEncoding_
Definition: ProducerED.cc:49
EDGetTokenT< TTStubDetSetVec > edGetToken_
Definition: ProducerED.cc:51
const Setup * setup_
Definition: ProducerED.cc:47
data_type const * const_iterator
Definition: DetSetNew.h:31
int offsetDetIdDSV() const
Definition: Setup.h:363
int modId() const
Definition: SensorModule.h:23
int iEvent
Definition: GenABIO.cc:224
Ref< typename HandleT::element_type, typename HandleT::element_type::value_type::value_type > makeRefTo(const HandleT &iHandle, det_id_type iDetID, typename HandleT::element_type::value_type::const_iterator itIter)
Definition: DetSetVector.h:418
bool configurationSupported() const
Definition: Setup.h:60
int dtcId() const
Definition: SensorModule.h:21
EDPutTokenT< TTDTC > edPutTokenLost_
Definition: ProducerED.cc:55
TTDTC ttDTC() const
Definition: Setup.h:90
Definition: DetId.h:17
int numModulesPerDTC() const
Definition: Setup.h:353
Class to store hardware like structured TTStub Collection used by Track Trigger emulators.
Definition: TTDTC.h:17
int numDTCs() const
Definition: Setup.h:373
ParameterSet iConfig_
Definition: ProducerED.cc:61
EDPutTokenT< TTDTC > edPutTokenAccepted_
Definition: ProducerED.cc:53
SensorModule * sensorModule(const DetId &detId) const
Definition: Setup.cc:361
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ edGetToken_

EDGetTokenT<TTStubDetSetVec> trackerDTC::ProducerED::edGetToken_
private

Definition at line 51 of file ProducerED.cc.

Referenced by produce(), and ProducerED().

◆ edPutTokenAccepted_

EDPutTokenT<TTDTC> trackerDTC::ProducerED::edPutTokenAccepted_
private

Definition at line 53 of file ProducerED.cc.

Referenced by produce(), and ProducerED().

◆ edPutTokenLost_

EDPutTokenT<TTDTC> trackerDTC::ProducerED::edPutTokenLost_
private

Definition at line 55 of file ProducerED.cc.

Referenced by produce(), and ProducerED().

◆ esGetTokenLayerEncoding_

ESGetToken<LayerEncoding, LayerEncodingRcd> trackerDTC::ProducerED::esGetTokenLayerEncoding_
private

Definition at line 59 of file ProducerED.cc.

Referenced by beginRun(), and ProducerED().

◆ esGetTokenSetup_

ESGetToken<Setup, SetupRcd> trackerDTC::ProducerED::esGetTokenSetup_
private

Definition at line 57 of file ProducerED.cc.

Referenced by beginRun(), and ProducerED().

◆ iConfig_

ParameterSet trackerDTC::ProducerED::iConfig_
private

Definition at line 61 of file ProducerED.cc.

Referenced by beginRun(), and produce().

◆ layerEncoding_

const LayerEncoding* trackerDTC::ProducerED::layerEncoding_ = nullptr
private

Definition at line 49 of file ProducerED.cc.

Referenced by beginRun(), and produce().

◆ setup_

const Setup* trackerDTC::ProducerED::setup_ = nullptr
private