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

bool checkHistory_
 
EDGetTokenT< TTStubDetSetVecedGetToken_
 
EDPutTokenT< TTDTCedPutTokenAccepted_
 
EDPutTokenT< TTDTCedPutTokenLost_
 
ESGetToken< Setup, SetupRcdesGetToken_
 
ParameterSet iConfig_
 
Setup setup_
 

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 35 of file ProducerED.cc.

Constructor & Destructor Documentation

◆ ProducerED()

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

Definition at line 60 of file ProducerED.cc.

61  : iConfig_(iConfig), checkHistory_(iConfig.getParameter<bool>("CheckHistory")) {
62  // book in- and output ED products
63  const auto& inputTag = iConfig.getParameter<InputTag>("InputTag");
64  const auto& branchAccepted = iConfig.getParameter<string>("BranchAccepted");
65  const auto& branchLost = iConfig.getParameter<string>("BranchLost");
66  edGetToken_ = consumes<TTStubDetSetVec>(inputTag);
67  edPutTokenAccepted_ = produces<TTDTC>(branchAccepted);
68  edPutTokenLost_ = produces<TTDTC>(branchLost);
69  // book ES product
70  esGetToken_ = esConsumes<Setup, SetupRcd, Transition::BeginRun>();
71  }

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

◆ ~ProducerED()

trackerDTC::ProducerED::~ProducerED ( )
inlineoverride

Definition at line 38 of file ProducerED.cc.

38 {}

Member Function Documentation

◆ beginRun()

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

Definition at line 73 of file ProducerED.cc.

73  {
74  setup_ = iSetup.getData(esGetToken_);
76  return;
77  // check process history if desired
78  if (checkHistory_)
80  }

References trackerDTC::Setup::checkHistory(), checkHistory_, trackerDTC::Setup::configurationSupported(), esGetToken_, edm::EventSetup::getData(), edm::Run::processHistory(), and setup_.

◆ endJob()

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

Definition at line 43 of file ProducerED.cc.

43 {}

◆ produce()

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

Definition at line 82 of file ProducerED.cc.

82  {
83  // empty DTC products
84  TTDTC productAccepted = setup_.ttDTC();
85  TTDTC productLost = setup_.ttDTC();
87  // read in stub collection
89  iEvent.getByToken(edGetToken_, handle);
90  // apply cabling map, reorganise stub collections
91  vector<vector<vector<TTStubRef>>> stubsDTCs(setup_.numDTCs(),
92  vector<vector<TTStubRef>>(setup_.numModulesPerDTC()));
93  for (auto module = handle->begin(); module != handle->end(); module++) {
94  // DetSetVec->detId + 1 = tk layout det id
95  const DetId detId = module->detId() + setup_.offsetDetIdDSV();
96  // corresponding sensor module
97  SensorModule* sm = setup_.sensorModule(detId);
98  // empty stub collection
99  vector<TTStubRef>& stubsModule = stubsDTCs[sm->dtcId()][sm->modId()];
100  stubsModule.reserve(module->size());
101  for (TTStubDetSet::const_iterator ttStub = module->begin(); ttStub != module->end(); ttStub++)
102  stubsModule.emplace_back(makeRefTo(handle, ttStub));
103  }
104  // board level processing
105  for (int dtcId = 0; dtcId < setup_.numDTCs(); dtcId++) {
106  // create single outer tracker DTC board
107  DTC dtc(iConfig_, setup_, dtcId, stubsDTCs.at(dtcId));
108  // route stubs and fill products
109  dtc.produce(productAccepted, productLost);
110  }
111  }
112  // store ED products
113  iEvent.emplace(edPutTokenAccepted_, move(productAccepted));
114  iEvent.emplace(edPutTokenLost_, move(productLost));
115  }

References trackerDTC::Setup::configurationSupported(), trackerDTC::SensorModule::dtcId(), edGetToken_, edPutTokenAccepted_, edPutTokenLost_, patZpeak::handle, iConfig_, iEvent, edm::makeRefTo(), trackerDTC::SensorModule::modId(), callgraph::module, eostools::move(), trackerDTC::Setup::numDTCs(), trackerDTC::Setup::numModulesPerDTC(), trackerDTC::Setup::offsetDetIdDSV(), trackerDTC::DTC::produce(), trackerDTC::Setup::sensorModule(), setup_, and trackerDTC::Setup::ttDTC().

Member Data Documentation

◆ checkHistory_

bool trackerDTC::ProducerED::checkHistory_
private

Definition at line 57 of file ProducerED.cc.

Referenced by beginRun().

◆ edGetToken_

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

Definition at line 47 of file ProducerED.cc.

Referenced by produce(), and ProducerED().

◆ edPutTokenAccepted_

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

Definition at line 49 of file ProducerED.cc.

Referenced by produce(), and ProducerED().

◆ edPutTokenLost_

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

Definition at line 51 of file ProducerED.cc.

Referenced by produce(), and ProducerED().

◆ esGetToken_

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

Definition at line 53 of file ProducerED.cc.

Referenced by beginRun(), and ProducerED().

◆ iConfig_

ParameterSet trackerDTC::ProducerED::iConfig_
private

Definition at line 55 of file ProducerED.cc.

Referenced by produce().

◆ setup_

Setup trackerDTC::ProducerED::setup_
private
trackerDTC::Setup::configurationSupported
bool configurationSupported() const
Definition: Setup.h:57
trackerDTC::ProducerED::edPutTokenAccepted_
EDPutTokenT< TTDTC > edPutTokenAccepted_
Definition: ProducerED.cc:49
TTDTC
Class to store hardware like structured TTStub Collection used by Track Trigger emulators.
Definition: TTDTC.h:17
patZpeak.handle
handle
Definition: patZpeak.py:23
trackerDTC::Setup::ttDTC
TTDTC ttDTC() const
Definition: Setup.h:83
trackerDTC::Setup::numDTCs
int numDTCs() const
Definition: Setup.h:243
trackerDTC::ProducerED::checkHistory_
bool checkHistory_
Definition: ProducerED.cc:57
edm::makeRefTo
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
edm::Handle
Definition: AssociativeIterator.h:50
DetId
Definition: DetId.h:17
trackerDTC::ProducerED::esGetToken_
ESGetToken< Setup, SetupRcd > esGetToken_
Definition: ProducerED.cc:53
trackerDTC::Setup::sensorModule
SensorModule * sensorModule(const DetId &detId) const
Definition: Setup.cc:321
trackerDTC::Setup::checkHistory
void checkHistory(const edm::ProcessHistory &processHistory) const
Definition: Setup.cc:220
trackerDTC::ProducerED::setup_
Setup setup_
Definition: ProducerED.cc:45
trackerDTC::Setup::numModulesPerDTC
int numModulesPerDTC() const
Definition: Setup.h:225
trackerDTC::ProducerED::iConfig_
ParameterSet iConfig_
Definition: ProducerED.cc:55
iEvent
int iEvent
Definition: GenABIO.cc:224
trackerDTC::Setup::offsetDetIdDSV
int offsetDetIdDSV() const
Definition: Setup.h:235
ProducerES_cfi.DTC
DTC
Definition: ProducerES_cfi.py:104
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:127
callgraph.module
module
Definition: callgraph.py:61
trackerDTC::ProducerED::edPutTokenLost_
EDPutTokenT< TTDTC > edPutTokenLost_
Definition: ProducerED.cc:51
eostools.move
def move(src, dest)
Definition: eostools.py:511
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
trackerDTC::ProducerED::edGetToken_
EDGetTokenT< TTStubDetSetVec > edGetToken_
Definition: ProducerED.cc:47
SimL1EmulatorRepack_Full_cff.inputTag
inputTag
Definition: SimL1EmulatorRepack_Full_cff.py:56
edm::InputTag
Definition: InputTag.h:15
edm::Run::processHistory
ProcessHistory const & processHistory() const
Definition: Run.cc:113
edmNew::DetSet::const_iterator
const data_type * const_iterator
Definition: DetSetNew.h:31