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.

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

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  }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
EDGetTokenT< TTStubDetSetVec > edGetToken_
Definition: ProducerED.cc:47
ESGetToken< Setup, SetupRcd > esGetToken_
Definition: ProducerED.cc:53
EDPutTokenT< TTDTC > edPutTokenLost_
Definition: ProducerED.cc:51
ParameterSet iConfig_
Definition: ProducerED.cc:55
EDPutTokenT< TTDTC > edPutTokenAccepted_
Definition: ProducerED.cc:49

◆ ~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.

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

73  {
74  setup_ = iSetup.getData(esGetToken_);
76  return;
77  // check process history if desired
78  if (checkHistory_)
80  }
bool configurationSupported() const
Definition: Setup.h:58
ESGetToken< Setup, SetupRcd > esGetToken_
Definition: ProducerED.cc:53
ProcessHistory const & processHistory() const
Definition: Run.cc:113
bool getData(T &iHolder) const
Definition: EventSetup.h:122
void checkHistory(const edm::ProcessHistory &processHistory) const
Definition: Setup.cc:222

◆ 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.

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

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  }
SensorModule * sensorModule(const DetId &detId) const
Definition: Setup.cc:323
EDGetTokenT< TTStubDetSetVec > edGetToken_
Definition: ProducerED.cc:47
bool configurationSupported() const
Definition: Setup.h:58
data_type const * const_iterator
Definition: DetSetNew.h:31
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
EDPutTokenT< TTDTC > edPutTokenLost_
Definition: ProducerED.cc:51
int numDTCs() const
Definition: Setup.h:244
Definition: DetId.h:17
Class to store hardware like structured TTStub Collection used by Track Trigger emulators.
Definition: TTDTC.h:17
ParameterSet iConfig_
Definition: ProducerED.cc:55
EDPutTokenT< TTDTC > edPutTokenAccepted_
Definition: ProducerED.cc:49
TTDTC ttDTC() const
Definition: Setup.h:84
int numModulesPerDTC() const
Definition: Setup.h:226
int offsetDetIdDSV() const
Definition: Setup.h:236
def move(src, dest)
Definition: eostools.py:511

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