CbmRoot
L1AlgoInputData.h
Go to the documentation of this file.
1 #ifndef _L1AlgoInputData_h
2 #define _L1AlgoInputData_h
3 
4 #include "CbmL1Def.h"
5 #include "L1Strip.h"
6 #include "L1StsHit.h"
7 
8 #include <fstream>
9 #include <iostream>
10 #include <vector>
11 
12 using std::istream;
13 using std::vector;
14 
16 
17 public:
19  : vStsHits()
20  , vStsStrips()
21  , vStsStripsB()
22  , vStsZPos()
23  , vSFlag()
24  , vSFlagB()
25  // MaxNStations(12)
26 
27  {
28  for (int i = 0; i < MaxNStations + 1; ++i)
29  StsHitsStartIndex[i] = 0;
30  for (int i = 0; i < MaxNStations + 1; ++i)
31  StsHitsStopIndex[i] = 0;
32  }
34 
35  /*
36 const vector< L1StsHit > & GetStsHits() const { return vStsHits; }
37  vector< L1Strip > & GetStsStrips() { return vStsStrips; }
38  vector< L1Strip > & GetStsStripsB() { return vStsStripsB; }
39  vector< fscal > & GetStsZPos() { return vStsZPos; }
40  vector< unsigned char > & GetSFlag() { return vSFlag; }
41  vector< unsigned char > & GetSFlagB() { return vSFlagB; }
42  THitI* GetStsHitsStartIndex() { return StsHitsStartIndex; }
43  THitI* GetStsHitsStopIndex() { return StsHitsStopIndex; }
44 
45 */
46 
47 
48  const vector<L1StsHit>& GetStsHits() const { return vStsHits; }
49  const vector<L1Strip>& GetStsStrips() const { return vStsStrips; }
50  const vector<L1Strip>& GetStsStripsB() const { return vStsStripsB; }
51  const vector<fscal>& GetStsZPos() const { return vStsZPos; }
52  const L1Vector<unsigned char>& GetSFlag() const { return vSFlag; }
53  const L1Vector<unsigned char>& GetSFlagB() const { return vSFlagB; }
54  const THitI* GetStsHitsStartIndex() const { return StsHitsStartIndex; }
55  const THitI* GetStsHitsStopIndex() const { return StsHitsStopIndex; }
56 
57 
58  bool ReadHitsFromFile(const char work_dir[100],
59  const int maxNEvent,
60  const int iVerbose);
61  // void PrintHits();
62 
64  void* operator new(size_t size, void* ptr) {
65  return ::operator new(size, ptr);
66  }
67  void* operator new[](size_t size, void* ptr) {
68  return ::operator new(size, ptr);
69  }
70  void* operator new(size_t size) { return _mm_malloc(size, 16); }
71  void* operator new[](size_t size) { return _mm_malloc(size, 16); }
72  void operator delete(void* ptr, size_t) { _mm_free(ptr); }
73  void operator delete[](void* ptr, size_t) { _mm_free(ptr); }
74 
77 
78 
79  void Clear() {
80 
81  vStsHits.clear();
82  vStsStrips.clear();
83  vStsStripsB.clear();
84  vStsZPos.clear();
85  vSFlag.clear();
86  vSFlagB.clear();
87 
88  {
89  for (int i = 0; i < MaxNStations + 1; ++i)
90  StsHitsStartIndex[i] = 0;
91  for (int i = 0; i < MaxNStations + 1; ++i)
92  StsHitsStopIndex[i] = 0;
93  }
94  }
95 
96 
97  // private:
98  // functionality
99  static istream& eatwhite(istream& is); // skip spaces
101  // data
102  enum { MaxNStations = 25 };
103  vector<L1StsHit>
104  vStsHits; // hits as a combination of front-, backstrips and z-position
105  vector<L1Strip>
106  vStsStrips, // strips positions created from hits. Front strips
107  vStsStripsB; // back strips
108  vector<fscal> vStsZPos; // all possible z-positions of hits
109 
111  vSFlag, // information of hits station & using hits in tracks;
114  StsHitsStopIndex[MaxNStations + 1]; // station-bounders in vStsHits array
115 
117 
118 #endif // #ifndef _L1AlgoInputData_h
L1AlgoInputData::operator=
const L1AlgoInputData & operator=(const L1AlgoInputData &a)
L1AlgoInputData::GetStsHitsStopIndex
const THitI * GetStsHitsStopIndex() const
Definition: L1AlgoInputData.h:55
L1AlgoInputData
Definition: L1AlgoInputData.h:15
i
int i
Definition: L1/vectors/P4_F32vec4.h:25
L1AlgoInputData::GetStsHits
const vector< L1StsHit > & GetStsHits() const
Definition: L1AlgoInputData.h:48
L1AlgoInputData::GetStsStrips
const vector< L1Strip > & GetStsStrips() const
Definition: L1AlgoInputData.h:49
_mm_free
#define _mm_free
Definition: LxCA.cxx:319
L1AlgoInputData::~L1AlgoInputData
~L1AlgoInputData()
Definition: L1AlgoInputData.h:33
L1Strip.h
L1AlgoInputData::vStsHits
vector< L1StsHit > vStsHits
Definition: L1AlgoInputData.h:104
L1Vector< unsigned char >
CbmL1Def.h
L1AlgoInputData::ReadHitsFromFile
bool ReadHitsFromFile(const char work_dir[100], const int maxNEvent, const int iVerbose)
Definition: L1AlgoInputData.cxx:67
THitI
unsigned int THitI
Definition: L1StsHit.h:8
L1AlgoInputData::vSFlag
L1Vector< unsigned char > vSFlag
Definition: L1AlgoInputData.h:111
L1AlgoInputData::L1AlgoInputData
L1AlgoInputData()
Definition: L1AlgoInputData.h:18
L1AlgoInputData::eatwhite
static istream & eatwhite(istream &is)
Definition: L1AlgoInputData.cxx:55
_mm_malloc
#define _mm_malloc(X, Y)
Definition: LxCA.cxx:318
L1AlgoInputData::MaxNStations
@ MaxNStations
Definition: L1AlgoInputData.h:102
L1AlgoInputData::StsHitsStopIndex
THitI StsHitsStopIndex[MaxNStations+1]
Definition: L1AlgoInputData.h:114
L1AlgoInputData::StsHitsStartIndex
THitI StsHitsStartIndex[MaxNStations+1]
Definition: L1AlgoInputData.h:113
L1AlgoInputData::vStsZPos
vector< fscal > vStsZPos
Definition: L1AlgoInputData.h:108
_fvecalignment
class L1AlgoInputData _fvecalignment
L1AlgoInputData::GetSFlag
const L1Vector< unsigned char > & GetSFlag() const
Definition: L1AlgoInputData.h:52
L1StsHit.h
L1AlgoInputData::GetStsStripsB
const vector< L1Strip > & GetStsStripsB() const
Definition: L1AlgoInputData.h:50
L1AlgoInputData::GetStsZPos
const vector< fscal > & GetStsZPos() const
Definition: L1AlgoInputData.h:51
L1AlgoInputData::Clear
void Clear()
Definition: L1AlgoInputData.h:79
L1AlgoInputData::vSFlagB
L1Vector< unsigned char > vSFlagB
Definition: L1AlgoInputData.h:112
L1AlgoInputData::GetStsHitsStartIndex
const THitI * GetStsHitsStartIndex() const
Definition: L1AlgoInputData.h:54
L1AlgoInputData::vStsStrips
vector< L1Strip > vStsStrips
Definition: L1AlgoInputData.h:106
L1AlgoInputData::L1AlgoInputData
L1AlgoInputData(const L1AlgoInputData &a)
L1AlgoInputData::GetSFlagB
const L1Vector< unsigned char > & GetSFlagB() const
Definition: L1AlgoInputData.h:53
L1AlgoInputData::vStsStripsB
vector< L1Strip > vStsStripsB
Definition: L1AlgoInputData.h:107