CMS 3D CMS Logo

MemoryBase.h
Go to the documentation of this file.
1 #ifndef L1Trigger_TrackFindingTracklet_interface_MemoryBase_h
2 #define L1Trigger_TrackFindingTracklet_interface_MemoryBase_h
3 
5 
6 #include <fstream>
7 #include <sstream>
8 #include <cassert>
9 #include <bitset>
10 
11 namespace trklet {
12 
13  class MemoryBase {
14  public:
15  MemoryBase(std::string name, Settings const& settings);
16 
17  virtual ~MemoryBase() = default;
18 
19  std::string const& getName() const { return name_; }
20  std::string getLastPartOfName() const { return name_.substr(name_.find_last_of('_') + 1); }
21 
22  virtual void clean() = 0;
23 
24  //method sets the layer and disk based on the name. pos is the position in the memory name where the layer or disk is specified
25  void initLayerDisk(unsigned int pos, int& layer, int& disk);
26 
27  unsigned int initLayerDisk(unsigned int pos);
28 
29  // Based on memory name check if this memory is used for special seeding:
30  // overlap is layer-disk seeding
31  // extra is the L2L3 seeding
32  // extended is the seeding for displaced tracks
33  void initSpecialSeeding(unsigned int pos, bool& overlap, bool& extra, bool& extended);
34 
35  //Used for a hack below due to MAC OS case sensitiviy problem for files
36  void findAndReplaceAll(std::string& data, std::string toSearch, std::string replaceStr);
37 
38  void openFile(bool first, std::string dirName, std::string filebase);
39 
40  static size_t find_nth(const std::string& haystack, size_t pos, const std::string& needle, size_t nth);
41 
42  protected:
44  unsigned int iSector_;
45 
46  std::ofstream out_;
47  int bx_;
48  int event_;
49 
51  };
52 }; // namespace trklet
53 #endif
Settings.h
trklet::MemoryBase::settings_
Settings const & settings_
Definition: MemoryBase.h:50
trklet::MemoryBase::find_nth
static size_t find_nth(const std::string &haystack, size_t pos, const std::string &needle, size_t nth)
Definition: MemoryBase.cc:103
pos
Definition: PixelAliasList.h:18
trklet::MemoryBase::findAndReplaceAll
void findAndReplaceAll(std::string &data, std::string toSearch, std::string replaceStr)
Definition: MemoryBase.cc:61
trklet::Settings
Definition: Settings.h:52
trklet::MemoryBase::event_
int event_
Definition: MemoryBase.h:48
trklet::MemoryBase::out_
std::ofstream out_
Definition: MemoryBase.h:46
trklet::MemoryBase::initLayerDisk
void initLayerDisk(unsigned int pos, int &layer, int &disk)
Definition: MemoryBase.cc:19
trklet::MemoryBase::bx_
int bx_
Definition: MemoryBase.h:47
trklet::MemoryBase::getName
std::string const & getName() const
Definition: MemoryBase.h:19
trklet::MemoryBase::openFile
void openFile(bool first, std::string dirName, std::string filebase)
Definition: MemoryBase.cc:74
trklet::MemoryBase::getLastPartOfName
std::string getLastPartOfName() const
Definition: MemoryBase.h:20
first
auto first
Definition: CAHitNtupletGeneratorKernelsImpl.h:125
trklet::MemoryBase::clean
virtual void clean()=0
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
trklet::MemoryBase::name_
std::string name_
Definition: MemoryBase.h:43
trklet::MemoryBase
Definition: MemoryBase.h:13
trklet::MemoryBase::~MemoryBase
virtual ~MemoryBase()=default
muon::overlap
bool overlap(const reco::Muon &muon1, const reco::Muon &muon2, double pullX=1.0, double pullY=1.0, bool checkAdjacentChambers=false)
Definition: MuonSelectors.cc:791
trklet
Definition: AllInnerStubsMemory.h:10
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
trklet::MemoryBase::MemoryBase
MemoryBase(std::string name, Settings const &settings)
Definition: MemoryBase.cc:13
TrackerOfflineValidation_Dqm_cff.dirName
dirName
Definition: TrackerOfflineValidation_Dqm_cff.py:55
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
trklet::MemoryBase::initSpecialSeeding
void initSpecialSeeding(unsigned int pos, bool &overlap, bool &extra, bool &extended)
Definition: MemoryBase.cc:42
trklet::MemoryBase::iSector_
unsigned int iSector_
Definition: MemoryBase.h:44