CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Attributes
trklet::ProcessBase Class Referenceabstract

#include <ProcessBase.h>

Inheritance diagram for trklet::ProcessBase:
trklet::FitTrack trklet::InputRouter trklet::MatchCalculator trklet::MatchEngine trklet::MatchProcessor trklet::ProjectionRouter trklet::PurgeDuplicate trklet::TrackletCalculatorBase trklet::TrackletCalculatorDisplaced trklet::TrackletEngine trklet::TrackletEngineDisplaced trklet::TripletEngine trklet::VMRouter trklet::VMRouterCM

Public Member Functions

virtual void addInput (MemoryBase *memory, std::string input)=0
 
virtual void addOutput (MemoryBase *memory, std::string output)=0
 
unsigned int getISeed (const std::string &name)
 
std::string const & getName () const
 
unsigned int initLayerDisk (unsigned int pos)
 
void initLayerDisk (unsigned int pos, int &layer, int &disk)
 
void initLayerDisk (unsigned int pos, int &layer, int &disk, int &layerdisk)
 
void initLayerDisksandISeed (unsigned int &layerdisk1, unsigned int &layerdisk2, unsigned int &iSeed)
 
unsigned int nbits (unsigned int power)
 
 ProcessBase (std::string name, Settings const &settings, Globals *global)
 
virtual ~ProcessBase ()=default
 

Protected Attributes

Globalsglobals_
 
std::string name_
 
Settings const & settings_
 

Detailed Description

Definition at line 12 of file ProcessBase.h.

Constructor & Destructor Documentation

◆ ProcessBase()

ProcessBase::ProcessBase ( std::string  name,
Settings const &  settings,
Globals global 
)

Definition at line 14 of file ProcessBase.cc.

15  : name_(name), settings_(settings), globals_(global) {}

◆ ~ProcessBase()

virtual trklet::ProcessBase::~ProcessBase ( )
virtualdefault

Member Function Documentation

◆ addInput()

virtual void trklet::ProcessBase::addInput ( MemoryBase memory,
std::string  input 
)
pure virtual

◆ addOutput()

virtual void trklet::ProcessBase::addOutput ( MemoryBase memory,
std::string  output 
)
pure virtual

◆ getISeed()

unsigned int ProcessBase::getISeed ( const std::string &  name)

Definition at line 119 of file ProcessBase.cc.

119  {
120  std::size_t pos = name.find('_');
121  std::string name1 = name.substr(pos + 1);
122  pos = name1.find('_');
123  std::string name2 = name1.substr(0, pos);
124 
125  unordered_map<string, unsigned int> seedmap = {
126  {"L1L2", 0}, {"L2L3", 1}, {"L3L4", 2}, {"L5L6", 3}, {"D1D2", 4}, {"D3D4", 5}, {"L1D1", 6},
127  {"L2D1", 7}, {"L1L2XX", 0}, {"L2L3XX", 1}, {"L3L4XX", 2}, {"L5L6XX", 3}, {"D1D2XX", 4}, {"D3D4XX", 5},
128  {"L1D1XX", 6}, {"L2D1XX", 7}, {"L3L4L2", 8}, {"L5L6L4", 9}, {"L2L3D1", 10}, {"D1D2L2", 11}};
129  auto found = seedmap.find(name2);
130  if (found != seedmap.end())
131  return found->second;
132 
133  throw cms::Exception("LogicError") << __FILE__ << " " << __LINE__ << " " << getName() << " name name1 name2 " << name
134  << " - " << name1 << " - " << name2;
135  return 0;
136 }

References newFWLiteAna::found, getName(), Skims_PA_cff::name, hfnoseParametersInitialization_cfi::name2, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by trklet::MatchCalculator::addOutput(), and trklet::MatchProcessor::addOutput().

◆ getName()

std::string const& trklet::ProcessBase::getName ( void  ) const
inline

Definition at line 22 of file ProcessBase.h.

22 { return name_; }

References name_.

Referenced by trklet::TrackletProcessor::addInput(), trklet::VMRouterCM::addOutput(), trklet::VMRouter::addOutput(), trklet::TrackletCalculatorDisplaced::addProjection(), trklet::TrackletCalculatorBase::addProjection(), trklet::TrackletCalculatorDisplaced::addProjectionDisk(), trklet::TrackletCalculatorBase::addProjectionDisk(), trklet::TrackletCalculatorBase::barrelSeeding(), trklet::TrackletCalculatorDisplaced::DDLSeeding(), plotting.Plot::draw(), trklet::ProjectionRouter::execute(), trklet::MatchEngine::execute(), trklet::TripletEngine::execute(), trklet::TrackletEngine::execute(), trklet::TrackletEngineDisplaced::execute(), trklet::TrackletCalculator::execute(), trklet::TrackletCalculatorDisplaced::execute(), trklet::MatchCalculator::execute(), trklet::MatchProcessor::execute(), trklet::TrackletProcessor::execute(), trklet::VMRouterCM::execute(), trklet::FitTrack::execute(), trklet::VMRouter::execute(), getISeed(), trklet::TrackletCalculatorBase::goodTrackPars(), trklet::TrackletCalculatorBase::inSector(), trklet::TrackletCalculatorDisplaced::LLDSeeding(), trklet::TrackletCalculatorDisplaced::LLLSeeding(), trklet::MatchCalculator::MatchCalculator(), trklet::MatchProcessor::matchCalculator(), trklet::MatchProcessor::MatchProcessor(), trklet::MatchCalculator::mergeMatches(), trklet::FitTrack::orderedMatches(), trklet::TrackletCalculatorBase::overlapSeeding(), and trklet::FitTrack::trackFitChisq().

◆ initLayerDisk() [1/3]

unsigned int ProcessBase::initLayerDisk ( unsigned int  pos)

Definition at line 54 of file ProcessBase.cc.

54  {
55  int layer, disk;
56  initLayerDisk(pos, layer, disk);
57 
58  if (disk > 0)
59  return N_LAYER + disk - 1;
60  return layer - 1;
61 }

References initLayerDisk(), phase1PixelTopology::layer, and trklet::N_LAYER.

◆ initLayerDisk() [2/3]

void ProcessBase::initLayerDisk ( unsigned int  pos,
int &  layer,
int &  disk 
)

Definition at line 33 of file ProcessBase.cc.

33  {
34  string subname = name_.substr(pos, 2);
35  layer = 0;
36  disk = 0;
37  if (subname.substr(0, 1) == "L")
38  layer = stoi(subname.substr(1, 1));
39  else if (subname.substr(0, 1) == "D")
40  disk = stoi(subname.substr(1, 1));
41  else
42  throw cms::Exception("BadConfig") << __FILE__ << " " << __LINE__ << " " << name_ << " subname = " << subname << " "
43  << layer << " " << disk;
44 }

References Exception, phase1PixelTopology::layer, and name_.

Referenced by initLayerDisk(), trklet::MatchCalculator::MatchCalculator(), trklet::MatchEngine::MatchEngine(), trklet::MatchProcessor::MatchProcessor(), trklet::ProjectionRouter::ProjectionRouter(), trklet::VMRouter::VMRouter(), and trklet::VMRouterCM::VMRouterCM().

◆ initLayerDisk() [3/3]

void ProcessBase::initLayerDisk ( unsigned int  pos,
int &  layer,
int &  disk,
int &  layerdisk 
)

Definition at line 46 of file ProcessBase.cc.

46  {
47  initLayerDisk(pos, layer, disk);
48 
49  layerdisk = layer - 1;
50  if (disk > 0)
51  layerdisk = N_LAYER + disk - 1;
52 }

References initLayerDisk(), phase1PixelTopology::layer, and trklet::N_LAYER.

◆ initLayerDisksandISeed()

void ProcessBase::initLayerDisksandISeed ( unsigned int &  layerdisk1,
unsigned int &  layerdisk2,
unsigned int &  iSeed 
)

Definition at line 63 of file ProcessBase.cc.

63  {
64  layerdisk1 = 99;
65  layerdisk2 = 99;
66 
67  if (name_.substr(0, 3) == "TE_") {
68  if (name_[3] == 'L') {
69  layerdisk1 = name_[4] - '1';
70  } else if (name_[3] == 'D') {
71  layerdisk1 = N_LAYER + name_[4] - '1';
72  }
73  if (name_[11] == 'L') {
74  layerdisk2 = name_[12] - '1';
75  } else if (name_[11] == 'D') {
76  layerdisk2 = N_LAYER + name_[12] - '1';
77  } else if (name_[12] == 'L') {
78  layerdisk2 = name_[13] - '1';
79  } else if (name_[12] == 'D') {
80  layerdisk2 = N_LAYER + name_[13] - '1';
81  }
82  }
83 
84  if ((name_.substr(0, 3) == "TC_") || (name_.substr(0, 3) == "TP_")) {
85  if (name_[3] == 'L') {
86  layerdisk1 = name_[4] - '1';
87  } else if (name_[3] == 'D') {
88  layerdisk1 = N_LAYER + name_[4] - '1';
89  }
90  if (name_[5] == 'L') {
91  layerdisk2 = name_[6] - '1';
92  } else if (name_[5] == 'D') {
93  layerdisk2 = N_LAYER + name_[6] - '1';
94  }
95  }
96 
97  if (layerdisk1 == LayerDisk::L1 && layerdisk2 == LayerDisk::L2)
98  iSeed = Seed::L1L2;
99  else if (layerdisk1 == LayerDisk::L2 && layerdisk2 == LayerDisk::L3)
100  iSeed = Seed::L2L3;
101  else if (layerdisk1 == LayerDisk::L3 && layerdisk2 == LayerDisk::L4)
102  iSeed = Seed::L3L4;
103  else if (layerdisk1 == LayerDisk::L5 && layerdisk2 == LayerDisk::L6)
104  iSeed = Seed::L5L6;
105  else if (layerdisk1 == LayerDisk::D1 && layerdisk2 == LayerDisk::D2)
106  iSeed = Seed::D1D2;
107  else if (layerdisk1 == LayerDisk::D3 && layerdisk2 == LayerDisk::D4)
108  iSeed = Seed::D3D4;
109  else if (layerdisk1 == LayerDisk::L1 && layerdisk2 == LayerDisk::D1)
110  iSeed = Seed::L1D1;
111  else if (layerdisk1 == LayerDisk::L2 && layerdisk2 == LayerDisk::D1)
112  iSeed = Seed::L2D1;
113  else {
114  throw cms::Exception("LogicError") << __FILE__ << " " << __LINE__ << " layerdisk1 " << layerdisk1 << " layerdisk2 "
115  << layerdisk2;
116  }
117 }

References trklet::D1D2, trklet::D3, trklet::D3D4, trklet::D4, Exception, PixelRegions::L1, trklet::L1D1, trklet::L1L2, PixelRegions::L2, trklet::L2D1, trklet::L2L3, PixelRegions::L3, trklet::L3L4, PixelRegions::L4, trklet::L5, trklet::L5L6, trklet::L6, trklet::N_LAYER, and name_.

Referenced by trklet::TrackletCalculator::TrackletCalculator(), trklet::TrackletEngine::TrackletEngine(), and trklet::TrackletProcessor::TrackletProcessor().

◆ nbits()

unsigned int ProcessBase::nbits ( unsigned int  power)

Definition at line 17 of file ProcessBase.cc.

17  {
18  if (power == 2)
19  return 1;
20  if (power == 4)
21  return 2;
22  if (power == 8)
23  return 3;
24  if (power == 16)
25  return 4;
26  if (power == 32)
27  return 5;
28 
29  throw cms::Exception("LogicError") << __FILE__ << " " << __LINE__ << "nbits: power = " << power;
30  return 0;
31 }

References Exception.

Referenced by trklet::MatchEngine::execute(), trklet::TripletEngine::execute(), and trklet::TrackletEngine::execute().

Member Data Documentation

◆ globals_

Globals* trklet::ProcessBase::globals_
protected

◆ name_

std::string trklet::ProcessBase::name_
protected

Definition at line 38 of file ProcessBase.h.

Referenced by trklet::ProjectionRouter::addInput(), trklet::MatchEngine::addInput(), trklet::TrackletEngine::addInput(), trklet::TripletEngine::addInput(), trklet::FitTrack::addInput(), trklet::TrackletEngineDisplaced::addInput(), trklet::PurgeDuplicate::addInput(), trklet::InputRouter::addInput(), trklet::TrackletCalculator::addInput(), trklet::MatchCalculator::addInput(), trklet::TrackletCalculatorDisplaced::addInput(), trklet::MatchProcessor::addInput(), trklet::TrackletProcessor::addInput(), trklet::VMRouterCM::addInput(), trklet::VMRouter::addInput(), trklet::ProjectionRouter::addOutput(), trklet::MatchEngine::addOutput(), trklet::TrackletEngine::addOutput(), trklet::TripletEngine::addOutput(), trklet::FitTrack::addOutput(), trklet::TrackletEngineDisplaced::addOutput(), trklet::InputRouter::addOutput(), trklet::PurgeDuplicate::addOutput(), trklet::TrackletCalculator::addOutput(), trklet::MatchCalculator::addOutput(), trklet::TrackletCalculatorDisplaced::addOutput(), trklet::MatchProcessor::addOutput(), trklet::TrackletProcessor::addOutput(), trklet::VMRouterCM::addOutput(), trklet::VMRouter::addOutput(), trklet::TrackletCalculatorBase::barrelSeeding(), trklet::TrackletCalculatorDisplaced::DDLSeeding(), trklet::TrackletCalculatorBase::diskSeeding(), trklet::MatchEngine::execute(), trklet::TripletEngine::execute(), trklet::TrackletEngineDisplaced::execute(), trklet::PurgeDuplicate::execute(), trklet::MatchCalculator::execute(), trklet::FitTrack::execute(), getName(), initLayerDisk(), initLayerDisksandISeed(), trklet::TrackletCalculatorDisplaced::LLDSeeding(), trklet::TrackletCalculatorDisplaced::LLLSeeding(), trklet::MatchProcessor::matchCalculator(), trklet::TrackletCalculatorBase::overlapSeeding(), trklet::TripletEngine::readTables(), trklet::TrackletEngineDisplaced::readTables(), trklet::TrackletCalculator::TrackletCalculator(), trklet::TrackletProcessor::TrackletProcessor(), trklet::TripletEngine::TripletEngine(), and trklet::TripletEngine::writeTables().

◆ settings_

Settings const& trklet::ProcessBase::settings_
protected

Definition at line 40 of file ProcessBase.h.

Referenced by trklet::TrackletCalculatorDisplaced::addDiskProj(), trklet::TrackletCalculatorBase::addDiskProj(), trklet::ProjectionRouter::addInput(), trklet::MatchEngine::addInput(), trklet::TripletEngine::addInput(), trklet::TrackletEngine::addInput(), trklet::FitTrack::addInput(), trklet::TrackletEngineDisplaced::addInput(), trklet::PurgeDuplicate::addInput(), trklet::InputRouter::addInput(), trklet::TrackletCalculator::addInput(), trklet::MatchCalculator::addInput(), trklet::TrackletCalculatorDisplaced::addInput(), trklet::MatchProcessor::addInput(), trklet::TrackletProcessor::addInput(), trklet::VMRouterCM::addInput(), trklet::VMRouter::addInput(), trklet::TrackletCalculatorDisplaced::addLayerProj(), trklet::TrackletCalculatorBase::addLayerProj(), trklet::ProjectionRouter::addOutput(), trklet::MatchEngine::addOutput(), trklet::TripletEngine::addOutput(), trklet::FitTrack::addOutput(), trklet::TrackletEngine::addOutput(), trklet::TrackletEngineDisplaced::addOutput(), trklet::PurgeDuplicate::addOutput(), trklet::InputRouter::addOutput(), trklet::TrackletCalculator::addOutput(), trklet::MatchCalculator::addOutput(), trklet::TrackletCalculatorDisplaced::addOutput(), trklet::MatchProcessor::addOutput(), trklet::TrackletProcessor::addOutput(), trklet::VMRouterCM::addOutput(), trklet::VMRouter::addOutput(), trklet::TrackletCalculatorDisplaced::addProjection(), trklet::TrackletCalculatorBase::addProjection(), trklet::TrackletCalculatorDisplaced::addProjectionDisk(), trklet::TrackletCalculatorBase::addProjectionDisk(), trklet::TrackletCalculatorDisplaced::approxproj(), trklet::TrackletCalculatorDisplaced::approxprojdisk(), trklet::TrackletCalculatorDisplaced::approxtracklet(), trklet::TrackletCalculatorBase::barrelSeeding(), trklet::TrackletCalculatorDisplaced::DDLSeeding(), trklet::TrackletCalculatorBase::diskSeeding(), trklet::TrackletCalculatorDisplaced::exactproj(), trklet::TrackletCalculatorDisplaced::exactprojdisk(), trklet::TrackletCalculatorBase::exacttracklet(), trklet::TrackletCalculatorDisplaced::exacttracklet(), trklet::TrackletCalculatorBase::exacttrackletdisk(), trklet::TrackletCalculatorBase::exacttrackletOverlap(), trklet::ProjectionRouter::execute(), trklet::MatchEngine::execute(), trklet::TrackletEngine::execute(), trklet::TripletEngine::execute(), trklet::InputRouter::execute(), trklet::TrackletEngineDisplaced::execute(), trklet::PurgeDuplicate::execute(), trklet::TrackletCalculator::execute(), trklet::TrackletCalculatorDisplaced::execute(), trklet::MatchCalculator::execute(), trklet::MatchProcessor::execute(), trklet::TrackletProcessor::execute(), trklet::FitTrack::execute(), trklet::VMRouterCM::execute(), trklet::VMRouter::execute(), trklet::TrackletCalculatorBase::goodTrackPars(), trklet::TrackletCalculatorBase::inSector(), trklet::TrackletCalculatorDisplaced::LLDSeeding(), trklet::TrackletCalculatorDisplaced::LLLSeeding(), trklet::MatchCalculator::MatchCalculator(), trklet::MatchProcessor::matchCalculator(), trklet::MatchProcessor::MatchProcessor(), trklet::FitTrack::orderedMatches(), trklet::TrackletCalculatorBase::overlapSeeding(), trklet::ProjectionRouter::ProjectionRouter(), trklet::TripletEngine::readTables(), trklet::TrackletEngineDisplaced::readTables(), trklet::TrackletEngine::setVMPhiBin(), trklet::FitTrack::trackFitChisq(), trklet::TrackletCalculator::TrackletCalculator(), trklet::TrackletCalculatorDisplaced::TrackletCalculatorDisplaced(), trklet::TrackletEngineDisplaced::TrackletEngineDisplaced(), trklet::TrackletProcessor::TrackletProcessor(), trklet::TripletEngine::TripletEngine(), trklet::VMRouter::VMRouter(), trklet::VMRouterCM::VMRouterCM(), trklet::TrackletCalculator::writeInvTable(), and trklet::TripletEngine::~TripletEngine().

PixelRegions::L3
Definition: PixelRegionContainers.h:32
PixelRegions::L1
Definition: PixelRegionContainers.h:32
funct::D1
Divides< A, C > D1
Definition: Factorize.h:136
PixelRegions::L2
Definition: PixelRegionContainers.h:32
trklet::L2L3
Definition: Settings.h:49
funct::D2
Divides< B, C > D2
Definition: Factorize.h:137
pos
Definition: PixelAliasList.h:18
trklet::L5L6
Definition: Settings.h:49
trklet::ProcessBase::settings_
Settings const & settings_
Definition: ProcessBase.h:40
trklet::L3L4
Definition: Settings.h:49
newFWLiteAna.found
found
Definition: newFWLiteAna.py:118
trklet::D3
Definition: Settings.h:50
trklet::L6
Definition: Settings.h:50
trklet::L1D1
Definition: Settings.h:49
trklet::N_LAYER
constexpr int N_LAYER
Definition: Settings.h:21
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
trklet::ProcessBase::initLayerDisk
void initLayerDisk(unsigned int pos, int &layer, int &disk)
Definition: ProcessBase.cc:33
trklet::L2D1
Definition: Settings.h:49
trklet::L1L2
Definition: Settings.h:49
PixelRegions::L4
Definition: PixelRegionContainers.h:32
trklet::D1D2
Definition: Settings.h:49
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
trklet::D3D4
Definition: Settings.h:49
Exception
Definition: hltDiff.cc:245
trklet::ProcessBase::getName
std::string const & getName() const
Definition: ProcessBase.h:22
trklet::ProcessBase::name_
std::string name_
Definition: ProcessBase.h:38
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
cms::Exception
Definition: Exception.h:70
trklet::L5
Definition: Settings.h:50
trklet::ProcessBase::globals_
Globals * globals_
Definition: ProcessBase.h:41
hfnoseParametersInitialization_cfi.name2
name2
Definition: hfnoseParametersInitialization_cfi.py:8
trklet::D4
Definition: Settings.h:50