CMS 3D CMS Logo

InputRouter.cc
Go to the documentation of this file.
8 
11 
12 using namespace std;
13 using namespace trklet;
14 
15 InputRouter::InputRouter(string name, Settings const& settings, Globals* global)
16  : ProcessBase(name, settings, global) {}
17 
19  if (settings_.writetrace()) {
20  edm::LogVerbatim("Tracklet") << "In " << name_ << " adding output to " << memory->getName() << " to output "
21  << output;
22  }
23 
24  if (output == "stubout") {
25  InputLinkMemory* tmp = dynamic_cast<InputLinkMemory*>(memory);
26  assert(tmp != nullptr);
27  unsigned int layerdisk = tmp->getName()[4] - '1';
28  if (tmp->getName()[3] == 'D') {
29  layerdisk += N_LAYER;
30  }
31  assert(layerdisk < N_LAYER + N_DISK);
32  unsigned int phireg = tmp->getName()[8] - 'A';
33  std::pair<unsigned int, unsigned int> layerphireg(layerdisk, phireg);
34  irstubs_.emplace_back(layerphireg, tmp);
35  return;
36  }
37 
38  throw cms::Exception("BadConfig") << __FILE__ << " " << __LINE__ << " Could not find output : " << output;
39 }
40 
42  if (settings_.writetrace()) {
43  edm::LogVerbatim("Tracklet") << "In " << name_ << " adding input from " << memory->getName() << " to input "
44  << input;
45  }
46  if (input == "stubin") {
47  dtcstubs_ = dynamic_cast<DTCLinkMemory*>(memory);
48  assert(dtcstubs_ != nullptr);
49  return;
50  }
51  throw cms::Exception("BadConfig") << __FILE__ << " " << __LINE__ << " Could not find input : " << input;
52 }
53 
55  for (unsigned int i = 0; i < settings_.maxStep("IR"); i++) {
56  if (i >= dtcstubs_->nStubs()) {
57  break;
58  }
59 
60  Stub* stub = dtcstubs_->getStub(i);
61 
62  unsigned int layerdisk = stub->l1tstub()->layerdisk();
63 
64  FPGAWord iphi = stub->phicorr();
65  unsigned int iphipos = iphi.value() >> (iphi.nbits() - settings_.nbitsallstubs(layerdisk));
66 
67  std::pair<unsigned int, unsigned int> layerphireg(layerdisk, iphipos);
68 
69  //Fill inner allstubs memories - in HLS this is the same write to multiple memories
70  int iadd = 0;
71  for (auto& irstubmem : irstubs_) {
72  if (layerphireg == irstubmem.first) {
73  irstubmem.second->addStub(stub);
74  iadd++;
75  }
76  }
77  assert(iadd == 1);
78  }
79 }
Settings.h
L1TStub.h
mps_fire.i
i
Definition: mps_fire.py:428
trklet::Settings::writetrace
bool writetrace() const
Definition: Settings.h:183
input
static const std::string input
Definition: EdmProvDump.cc:48
MessageLogger.h
trklet::InputRouter::addOutput
void addOutput(MemoryBase *memory, std::string output) override
Definition: InputRouter.cc:18
trklet::InputRouter::addInput
void addInput(MemoryBase *memory, std::string input) override
Definition: InputRouter.cc:41
convertSQLitetoXML_cfg.output
output
Definition: convertSQLitetoXML_cfg.py:72
memory
Definition: HGCRecHitSoA.h:20
trklet::Settings
Definition: Settings.h:52
trklet::Settings::nbitsallstubs
unsigned int nbitsallstubs(unsigned int layerdisk) const
Definition: Settings.h:106
cms::cuda::assert
assert(be >=bs)
trklet::N_DISK
constexpr int N_DISK
Definition: Settings.h:22
trklet::ProcessBase::settings_
Settings const & settings_
Definition: ProcessBase.h:40
createJobs.tmp
tmp
align.sh
Definition: createJobs.py:716
trklet::Globals
Definition: Globals.h:30
InputLinkMemory.h
LEDCalibrationChannels.iphi
iphi
Definition: LEDCalibrationChannels.py:64
trklet::InputLinkMemory
Definition: InputLinkMemory.h:16
trklet::DTCLinkMemory::getStub
Stub * getStub(unsigned int i)
Definition: DTCLinkMemory.h:27
trklet::Stub
Definition: Stub.h:18
trklet::DTCLinkMemory::nStubs
unsigned int nStubs() const
Definition: DTCLinkMemory.h:25
trklet::N_LAYER
constexpr int N_LAYER
Definition: Settings.h:21
trklet::L1TStub::layerdisk
int layerdisk() const
Definition: L1TStub.h:104
trklet::FPGAWord
Definition: FPGAWord.h:9
trklet::MemoryBase
Definition: MemoryBase.h:13
trklet::InputRouter::execute
void execute()
Definition: InputRouter.cc:54
trklet::InputRouter::irstubs_
std::vector< std::pair< std::pair< unsigned int, unsigned int >, InputLinkMemory * > > irstubs_
Definition: InputRouter.h:36
Globals.h
trklet
Definition: AllInnerStubsMemory.h:10
std
Definition: JetResolutionObject.h:76
trklet::Stub::phicorr
const FPGAWord & phicorr() const
Definition: Stub.h:63
trklet::ProcessBase
Definition: ProcessBase.h:12
trklet::Stub::l1tstub
L1TStub * l1tstub()
Definition: Stub.h:77
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
Exception
Definition: hltDiff.cc:245
trklet::ProcessBase::name_
std::string name_
Definition: ProcessBase.h:38
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
Exception.h
trklet::Settings::maxStep
unsigned int maxStep(std::string module) const
Definition: Settings.h:116
DTCLinkMemory.h
trklet::InputRouter::dtcstubs_
DTCLinkMemory * dtcstubs_
Definition: InputRouter.h:33
Stub.h
InputRouter.h