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::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, unsigned int iSector)
 
virtual ~ProcessBase ()=default
 

Protected Attributes

Globalsglobals_
 
unsigned int iSector_
 
std::string name_
 
double phimax_
 
double phimin_
 
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,
unsigned int  iSector 
)

Definition at line 14 of file ProcessBase.cc.

15  : name_(name), settings_(settings), globals_(global) {
16  iSector_ = iSector;
17  double dphi = 2 * M_PI / N_SECTOR;
18  double dphiHG = 0.5 * settings_.dphisectorHG() - M_PI / N_SECTOR;
19  phimin_ = iSector_ * dphi - dphiHG;
20  phimax_ = phimin_ + dphi + 2 * dphiHG;
21  phimin_ -= M_PI / N_SECTOR;
22  phimax_ -= M_PI / N_SECTOR;
23  if (phimin_ > M_PI) {
24  phimin_ -= 2 * M_PI;
25  phimax_ -= 2 * M_PI;
26  }
27 }

References trklet::Settings::dphisectorHG(), iSector_, M_PI, trklet::N_SECTOR, phimax_, phimin_, and settings_.

◆ ~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 131 of file ProcessBase.cc.

131  {
132  std::size_t pos = name.find('_');
133  std::string name1 = name.substr(pos + 1);
134  pos = name1.find('_');
135  std::string name2 = name1.substr(0, pos);
136 
137  unordered_map<string, unsigned int> seedmap = {
138  {"L1L2", 0}, {"L2L3", 1}, {"L3L4", 2}, {"L5L6", 3}, {"D1D2", 4}, {"D3D4", 5}, {"L1D1", 6},
139  {"L2D1", 7}, {"L1L2XX", 0}, {"L2L3XX", 1}, {"L3L4XX", 2}, {"L5L6XX", 3}, {"D1D2XX", 4}, {"D3D4XX", 5},
140  {"L1D1XX", 6}, {"L2D1XX", 7}, {"L3L4L2", 8}, {"L5L6L4", 9}, {"L2L3D1", 10}, {"D1D2L2", 11}};
141  auto found = seedmap.find(name2);
142  if (found != seedmap.end())
143  return found->second;
144 
145  throw cms::Exception("LogicError") << __FILE__ << " " << __LINE__ << " " << getName() << " name name1 name2 " << name
146  << " - " << name1 << " - " << name2;
147  return 0;
148 }

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::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::MatchEngine::execute(), trklet::ProjectionRouter::execute(), trklet::TrackletEngine::execute(), trklet::TripletEngine::execute(), trklet::TrackletEngineDisplaced::execute(), trklet::MatchCalculator::execute(), trklet::TrackletCalculator::execute(), trklet::TrackletCalculatorDisplaced::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(), trklet::FitTrack::trackFitChisq(), trklet::TrackletProcessor::TrackletProcessor(), trklet::VMRouter::VMRouter(), trklet::VMRouterCM::VMRouterCM(), trklet::TrackletEngine::writeTETable(), and trklet::TrackletProcessor::writeTETable().

◆ initLayerDisk() [1/3]

unsigned int ProcessBase::initLayerDisk ( unsigned int  pos)

Definition at line 66 of file ProcessBase.cc.

66  {
67  int layer, disk;
68  initLayerDisk(pos, layer, disk);
69 
70  if (disk > 0)
71  return N_DISK + disk;
72  return layer - 1;
73 }

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

◆ initLayerDisk() [2/3]

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

Definition at line 45 of file ProcessBase.cc.

45  {
46  string subname = name_.substr(pos, 2);
47  layer = 0;
48  disk = 0;
49  if (subname.substr(0, 1) == "L")
50  layer = stoi(subname.substr(1, 1));
51  else if (subname.substr(0, 1) == "D")
52  disk = stoi(subname.substr(1, 1));
53  else
54  throw cms::Exception("BadConfig") << __FILE__ << " " << __LINE__ << " " << name_ << " subname = " << subname << " "
55  << layer << " " << disk;
56 }

References Exception, phase1PixelTopology::layer, and name_.

Referenced by initLayerDisk(), trklet::MatchCalculator::MatchCalculator(), 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 58 of file ProcessBase.cc.

58  {
59  initLayerDisk(pos, layer, disk);
60 
61  layerdisk = layer - 1;
62  if (disk > 0)
63  layerdisk = N_DISK + disk;
64 }

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

◆ initLayerDisksandISeed()

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

Definition at line 75 of file ProcessBase.cc.

75  {
76  layerdisk1 = 99;
77  layerdisk2 = 99;
78 
79  if (name_.substr(0, 3) == "TE_") {
80  if (name_[3] == 'L') {
81  layerdisk1 = name_[4] - '1';
82  } else if (name_[3] == 'D') {
83  layerdisk1 = 6 + name_[4] - '1';
84  }
85  if (name_[11] == 'L') {
86  layerdisk2 = name_[12] - '1';
87  } else if (name_[11] == 'D') {
88  layerdisk2 = 6 + name_[12] - '1';
89  } else if (name_[12] == 'L') {
90  layerdisk2 = name_[13] - '1';
91  } else if (name_[12] == 'D') {
92  layerdisk2 = 6 + name_[13] - '1';
93  }
94  }
95 
96  if ((name_.substr(0, 3) == "TC_") || (name_.substr(0, 3) == "TP_")) {
97  if (name_[3] == 'L') {
98  layerdisk1 = name_[4] - '1';
99  } else if (name_[3] == 'D') {
100  layerdisk1 = 6 + name_[4] - '1';
101  }
102  if (name_[5] == 'L') {
103  layerdisk2 = name_[6] - '1';
104  } else if (name_[5] == 'D') {
105  layerdisk2 = 6 + name_[6] - '1';
106  }
107  }
108 
109  if (layerdisk1 == 0 && layerdisk2 == 1)
110  iSeed = 0;
111  else if (layerdisk1 == 1 && layerdisk2 == 2)
112  iSeed = 1;
113  else if (layerdisk1 == 2 && layerdisk2 == 3)
114  iSeed = 2;
115  else if (layerdisk1 == 4 && layerdisk2 == 5)
116  iSeed = 3;
117  else if (layerdisk1 == 6 && layerdisk2 == 7)
118  iSeed = 4;
119  else if (layerdisk1 == 8 && layerdisk2 == 9)
120  iSeed = 5;
121  else if (layerdisk1 == 0 && layerdisk2 == 6)
122  iSeed = 6;
123  else if (layerdisk1 == 1 && layerdisk2 == 6)
124  iSeed = 7;
125  else {
126  throw cms::Exception("LogicError") << __FILE__ << " " << __LINE__ << " layerdisk1 " << layerdisk1 << " layerdisk2 "
127  << layerdisk2;
128  }
129 }

References Exception, 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 29 of file ProcessBase.cc.

29  {
30  if (power == 2)
31  return 1;
32  if (power == 4)
33  return 2;
34  if (power == 8)
35  return 3;
36  if (power == 16)
37  return 4;
38  if (power == 32)
39  return 5;
40 
41  throw cms::Exception("LogicError") << __FILE__ << " " << __LINE__ << "nbits: power = " << power;
42  return 0;
43 }

References Exception.

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

Member Data Documentation

◆ globals_

Globals* trklet::ProcessBase::globals_
protected

◆ iSector_

unsigned int trklet::ProcessBase::iSector_
protected

◆ name_

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

Definition at line 38 of file ProcessBase.h.

Referenced by trklet::MatchEngine::addInput(), trklet::ProjectionRouter::addInput(), trklet::TrackletEngine::addInput(), trklet::TripletEngine::addInput(), trklet::FitTrack::addInput(), trklet::TrackletEngineDisplaced::addInput(), trklet::PurgeDuplicate::addInput(), trklet::TrackletCalculator::addInput(), trklet::MatchCalculator::addInput(), trklet::TrackletCalculatorDisplaced::addInput(), trklet::MatchProcessor::addInput(), trklet::TrackletProcessor::addInput(), trklet::VMRouterCM::addInput(), trklet::VMRouter::addInput(), trklet::MatchEngine::addOutput(), trklet::ProjectionRouter::addOutput(), trklet::TrackletEngine::addOutput(), trklet::TripletEngine::addOutput(), trklet::FitTrack::addOutput(), trklet::TrackletEngineDisplaced::addOutput(), trklet::PurgeDuplicate::addOutput(), trklet::MatchCalculator::addOutput(), trklet::TrackletCalculator::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().

◆ phimax_

double trklet::ProcessBase::phimax_
protected

◆ phimin_

double trklet::ProcessBase::phimin_
protected

◆ settings_

Settings const& trklet::ProcessBase::settings_
protected

Definition at line 44 of file ProcessBase.h.

Referenced by trklet::TrackletCalculatorDisplaced::addDiskProj(), trklet::TrackletCalculatorBase::addDiskProj(), trklet::MatchEngine::addInput(), trklet::ProjectionRouter::addInput(), trklet::TrackletEngine::addInput(), trklet::TripletEngine::addInput(), trklet::FitTrack::addInput(), trklet::TrackletEngineDisplaced::addInput(), trklet::PurgeDuplicate::addInput(), trklet::MatchCalculator::addInput(), trklet::TrackletCalculator::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::TrackletEngine::addOutput(), trklet::FitTrack::addOutput(), trklet::TripletEngine::addOutput(), trklet::TrackletEngineDisplaced::addOutput(), trklet::PurgeDuplicate::addOutput(), trklet::MatchCalculator::addOutput(), trklet::TrackletCalculator::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::TrackletProcessor::buildLUT(), 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::TrackletEngineDisplaced::execute(), trklet::PurgeDuplicate::execute(), trklet::MatchCalculator::execute(), trklet::TrackletCalculator::execute(), trklet::TrackletCalculatorDisplaced::execute(), trklet::MatchProcessor::execute(), trklet::TrackletProcessor::execute(), trklet::VMRouterCM::execute(), trklet::FitTrack::execute(), trklet::VMRouter::execute(), trklet::TrackletCalculatorBase::goodTrackPars(), trklet::TrackletCalculatorBase::inSector(), trklet::TrackletCalculatorDisplaced::LLDSeeding(), trklet::TrackletCalculatorDisplaced::LLLSeeding(), trklet::MatchCalculator::MatchCalculator(), trklet::MatchProcessor::matchCalculator(), trklet::MatchEngine::MatchEngine(), trklet::MatchProcessor::MatchProcessor(), trklet::FitTrack::orderedMatches(), trklet::TrackletCalculatorBase::overlapSeeding(), ProcessBase(), 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(), trklet::TrackletEngine::writeTETable(), and trklet::TripletEngine::~TripletEngine().

pos
Definition: PixelAliasList.h:18
trklet::N_SECTOR
constexpr unsigned int N_SECTOR
Definition: Settings.h:17
trklet::N_DISK
constexpr int N_DISK
Definition: Settings.h:20
trklet::ProcessBase::settings_
Settings const & settings_
Definition: ProcessBase.h:44
newFWLiteAna.found
found
Definition: newFWLiteAna.py:118
trklet::Settings::dphisectorHG
double dphisectorHG() const
Definition: Settings.h:251
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:45
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
M_PI
#define M_PI
Definition: BXVectorInputProducer.cc: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
trklet::ProcessBase::iSector_
unsigned int iSector_
Definition: ProcessBase.h:39
cms::Exception
Definition: Exception.h:70
trklet::ProcessBase::phimin_
double phimin_
Definition: ProcessBase.h:41
trklet::ProcessBase::globals_
Globals * globals_
Definition: ProcessBase.h:45
hfnoseParametersInitialization_cfi.name2
name2
Definition: hfnoseParametersInitialization_cfi.py:8
trklet::ProcessBase::phimax_
double phimax_
Definition: ProcessBase.h:42