CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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

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

Definition at line 60 of file ProducerED.cc.

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

Definition at line 38 of file ProducerED.cc.

38 {}

Member Function Documentation

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  }
ESGetToken< Setup, SetupRcd > esGetToken_
Definition: ProducerED.cc:53
bool getData(T &iHolder) const
Definition: EventSetup.h:122
bool configurationSupported() const
Definition: Setup.h:58
ProcessHistory const & processHistory() const
Definition: Run.cc:113
void checkHistory(const edm::ProcessHistory &processHistory) const
Definition: Setup.cc:222
void trackerDTC::ProducerED::endJob ( void  )
inlineprivate

Definition at line 43 of file ProducerED.cc.

43 {}
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_, edm::Event::emplace(), edm::Event::getByToken(), patZpeak::handle, iConfig_, 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  }
int numModulesPerDTC() const
Definition: Setup.h:226
EDGetTokenT< TTStubDetSetVec > edGetToken_
Definition: ProducerED.cc:47
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
data_type const * const_iterator
Definition: DetSetNew.h:31
int numDTCs() const
Definition: Setup.h:244
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
TTDTC ttDTC() const
Definition: Setup.h:84
bool configurationSupported() const
Definition: Setup.h:58
def move
Definition: eostools.py:511
tuple handle
Definition: patZpeak.py:25
EDPutTokenT< TTDTC > edPutTokenLost_
Definition: ProducerED.cc:51
Definition: DetId.h:17
OrphanHandle< PROD > emplace(EDPutTokenT< PROD > token, Args &&...args)
puts a new product
Definition: Event.h:433
SensorModule * sensorModule(const DetId &detId) const
Definition: Setup.cc:323
int offsetDetIdDSV() const
Definition: Setup.h:236
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
tuple module
Definition: callgraph.py:69

Member Data Documentation

bool trackerDTC::ProducerED::checkHistory_
private

Definition at line 57 of file ProducerED.cc.

Referenced by beginRun().

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

Definition at line 47 of file ProducerED.cc.

Referenced by produce(), and ProducerED().

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

Definition at line 49 of file ProducerED.cc.

Referenced by produce(), and ProducerED().

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

Definition at line 51 of file ProducerED.cc.

Referenced by produce(), and ProducerED().

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

Definition at line 53 of file ProducerED.cc.

Referenced by beginRun(), and ProducerED().

ParameterSet trackerDTC::ProducerED::iConfig_
private

Definition at line 55 of file ProducerED.cc.

Referenced by produce().

Setup trackerDTC::ProducerED::setup_
private