FairRoot/PandaRoot
PndSdsStripClusterer.cxx
Go to the documentation of this file.
1 // -------------------------------------------------------------------------
2 // ----- PndSdsStripClusterer source file -----
3 // ----- Converted 27.11.2007 from R.Jaekel by R.Kliemt -----
4 // -------------------------------------------------------------------------
5 
6 #include "PndSdsStripClusterer.h"
7 
8 // includes for sort algorithms
9 #include <algorithm>
10 #include <functional>
11 #include <vector>
12 #include "TMath.h"
13 #include "math.h"
14 // enum SensorSide { kTOP, kBOTTOM };
15 
16 
18 : fSortedDigis(),
19  fTopclusters(),
20  fBotclusters(),
21  fLeftDigis(),
22  fClusters(),
23  fDigiType(-1)
24 {
25  SetDigiType(DigiType);
26 }
27 
29 {
30 }
31 
32 //------------------------------------------------------------------------------
33 //------------------------------------------------------------------------------
34 //------------------------------------------------------------------------------
35 
37 {
38  fSortedDigis.clear();
39  fClusters.clear();
40  fTopclusters.clear();
41  fBotclusters.clear();
42  fLeftDigis.clear();
43 }
44 
45 void PndSdsStripClusterer::AddDigi(Int_t sensorID, SensorSide side, Int_t , Int_t strip, Int_t iDigi) //timestamp //[R.K.03/2017] unused variable(s)
46 {
47  fSortedDigis[sensorID][side][1][strip] = iDigi;
48  //[R.K.30.3.'12] Defunc timestamp binning as it comes in ns precision.
49  //TODO: invent soemthing better with timestamp!
50  // fSortedDigis[sensorID][side][timestamp][strip] = iDigi;
51 }
52 
53 //------------------------------------------------------------------------------
55 {
56  if(0<=i && (Int_t)fClusters.size() < i)
57  return fClusters[i];
58  else{
59  Fatal("GetCluster","fClusters out of bounds i=%i at size=%zu",i,fClusters.size());
60  }
61  return NULL;
62 }
63 //------------------------------------------------------------------------------
65 {
66  if(0<=i && (Int_t)fTopclusters.size() < i)
67  return GetCluster(fTopclusters[i]);
68  else{
69  Fatal("GetTopCluster","fTopclusters out of bounds i=%i at size=%zu",i,fTopclusters.size());
70  }
71  return NULL;
72 }
73 //------------------------------------------------------------------------------
75 {
76  if(0<=i && (Int_t)fBotclusters.size() < i)
77  return GetCluster(fBotclusters[i]);
78  else {
79  Fatal("GetBotCluster","fBotclusters out of bounds i=%i at size=%zu",i,fBotclusters.size());
80  }
81  return NULL;
82 }
83 
84 
85 //------------------------------------------------------------------------------
86 void PndSdsStripClusterer::AddCluster(const std::vector< Int_t >& onecluster,SensorSide side)
87 {
88  Int_t clindex = fClusters.size();
89  if(side == kBOTTOM)
90  {
91  fBotclusters.push_back(clindex);
92  // Info("PndSdsStripClusterer::AddCluster","Adding Cluster number %i to the bottom list.",clindex);
93  } else if(side == kTOP)
94  {
95  fTopclusters.push_back(clindex);
96  // Info("AddCluster","Adding Cluster number %i to the top list.",clindex);
97  }
98  PndSdsClusterStrip* cl = new PndSdsClusterStrip(fDigiType, onecluster);
99  cl->SetSensorSide(side);
100  fClusters.push_back(cl);
101 }
102 
103 
105 
106 
107 
std::vector< PndSdsClusterStrip * > fClusters
Int_t i
Definition: run_full.C:25
ClassImp(PndSdsStripClusterer)
std::vector< Int_t > fLeftDigis
PndSdsStripClusterer(Int_t DigiType)
std::vector< Int_t > fTopclusters
std::vector< Int_t > fBotclusters
PndSdsClusterStrip * GetTopCluster(Int_t i)
void AddDigi(Int_t sensorID, SensorSide side, Int_t timestamp, Int_t strip, Int_t iDigi)
SensorSide
PndSdsClusterStrip * GetCluster(Int_t i)
PndSdsClusterStrip * GetBotCluster(Int_t i)
void SetSensorSide(SensorSide s)
void AddCluster(const std::vector< Int_t > &onecluster, SensorSide side)
void SetDigiType(Int_t digiType)