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, unsigned int iSector);
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 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::openFile
void openFile(bool first, std::string filebase)
Definition: MemoryBase.cc:72
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:108
pos
Definition: PixelAliasList.h:18
trklet::MemoryBase::findAndReplaceAll
void findAndReplaceAll(std::string &data, std::string toSearch, std::string replaceStr)
Definition: MemoryBase.cc:59
trklet::Settings
Definition: Settings.h:26
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:17
trklet::MemoryBase::bx_
int bx_
Definition: MemoryBase.h:47
dqmdumpme.first
first
Definition: dqmdumpme.py:55
trklet::MemoryBase::getName
std::string const & getName() const
Definition: MemoryBase.h:19
trklet::MemoryBase::getLastPartOfName
std::string getLastPartOfName() const
Definition: MemoryBase.h:20
trklet::MemoryBase::clean
virtual void clean()=0
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
trklet::MemoryBase::name_
std::string name_
Definition: MemoryBase.h:43
trklet::MemoryBase
Definition: MemoryBase.h:13
trklet::MemoryBase::~MemoryBase
virtual ~MemoryBase()=default
goodZToMuMu_cfi.overlap
overlap
Definition: goodZToMuMu_cfi.py:108
trklet
Definition: AllProjectionsMemory.h:9
trklet::MemoryBase::MemoryBase
MemoryBase(std::string name, Settings const &settings, unsigned int iSector)
Definition: MemoryBase.cc:11
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:40
trklet::MemoryBase::iSector_
unsigned int iSector_
Definition: MemoryBase.h:44