Commit d8071d9f authored by Sergey Gorbunov's avatar Sergey Gorbunov Committed by Florian Uhlig
Browse files

give names to L1Vectors for debugging purposes

parent c1eeb83c
......@@ -65,10 +65,12 @@ typedef int index_type;
template<typename T>
class L1Vector : public std::vector<T> {
public:
L1Vector() : std::vector<T>(), fSize(0) {};
L1Vector(const unsigned int n) : std::vector<T>(n), fSize(0) {};
L1Vector(const unsigned int n, const unsigned int value)
: std::vector<T>(n, value), fSize(0) {};
L1Vector(const char* name = "no name") : std::vector<T>(), fSize(0), fName(name) {};
L1Vector(const char* name, const unsigned int n) : std::vector<T>(n), fSize(0), fName(name) {};
L1Vector(const char* name, const unsigned int n, const unsigned int value)
: std::vector<T>(n, value)
, fSize(0)
, fName(name) {};
unsigned int Size() const { return fSize; } // Size() return number
......@@ -106,8 +108,8 @@ public:
#ifdef _OPENMP
#pragma omp critical
#endif
std::vector<T>::resize(index + 1);
std::cout << "Warning: L1Vector autoresize to " << index + 1 << std::endl;
std::vector<T>::resize((index + 1) * 2);
std::cout << "Warning: L1Vector " << fName << " autoresize to " << (index + 1) * 2 << std::endl;
}
if (index >= fSize) fSize = index + 1;
......@@ -119,8 +121,16 @@ public:
return std::vector<T>::operator[](index);
}
const char* getName()
{
std::string s = " L1Vector<";
s += fName + "> ";
return s.data();
}
private:
unsigned int fSize;
std::string fName;
};
#endif // CbmL1Def_h
......@@ -77,15 +77,15 @@ class L1Algo {
public:
// L1Algo(int nThreads=7):
L1Algo(int nThreads = 1, int TypicalSize = 200000)
: n_g1()
, FirstHit()
, LastHit()
, FirstHitIndex()
, LastHitIndex()
, Neighbour()
, TrackChi2()
, vRecoHitsNew()
, vTracksNew()
: n_g1("L1Algo::n_g1")
, FirstHit("L1Algo::FirstHit")
, LastHit("L1Algo::LastHit")
, FirstHitIndex("L1Algo::FirstHitIndex")
, LastHitIndex("L1Algo::LastHitIndex")
, Neighbour("L1Algo::Neighbour")
, TrackChi2("L1Algo::TrackChi2")
, vRecoHitsNew("L1Algo::vRecoHitsNew")
, vTracksNew("L1Algo::vTracksNew")
, NStations(0)
, // number of all detector stations
NMvdStations(0)
......@@ -100,9 +100,9 @@ public:
, vSFlag(0) // information of hits station & using hits in tracks(),
, CATime(0)
, // time of trackfinding
vTracks(40000)
vTracks("L1Algo::vTracks", 40000)
, // reconstructed tracks
vRecoHits(400000)
vRecoHits("L1Algo::vRecoHits", 400000)
, // packed hits of reconstructed tracks
StsHitsStartIndex(nullptr)
, StsHitsStopIndex(nullptr)
......@@ -120,12 +120,12 @@ public:
,
#ifdef _OPENMP
hitToBestTrackF(TypicalSize * 2)
, hitToBestTrackB(TypicalSize * 2)
hitToBestTrackF("L1Algo::hitToBestTrackF", TypicalSize * 2)
, hitToBestTrackB("L1Algo::hitToBestTrackB", TypicalSize * 2)
,
#endif
vStripToTrack(TypicalSize * 2)
, vStripToTrackB(TypicalSize * 2)
vStripToTrack("L1Algo::vStripToTrack", TypicalSize * 4)
, vStripToTrackB("L1Algo::vStripToTrackB", TypicalSize * 4)
,
//sh (),
fNThreads(nThreads)
......
......@@ -32,7 +32,8 @@ struct L1Branch {
, NHits(0)
, chi2(0)
, CandIndex(0)
, StsHits() {
, StsHits("L1Branch::StsHits")
{
// L1Branch():Momentum(0),chi2(0),NHits(0),Lengtha(0),ista(0) , StsHits(){
StsHits.resize(12);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment