FairRoot/PandaRoot
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
PndSdsSimpleStripClusterFinder Class Reference

#include <PndSdsSimpleStripClusterFinder.h>

Inheritance diagram for PndSdsSimpleStripClusterFinder:
PndSdsStripClusterer

Public Member Functions

 PndSdsSimpleStripClusterFinder (Int_t DigiType)
 
 PndSdsSimpleStripClusterFinder (Int_t DigiType, Int_t rad)
 
 ~PndSdsSimpleStripClusterFinder ()
 
std::vector< PndSdsClusterStrip * > SearchClusters ()
 
void SetSearchRadius (Int_t rad=0)
 
void Reinit ()
 
void AddDigi (Int_t sensorID, SensorSide side, Int_t timestamp, Int_t strip, Int_t iDigi)
 
void ClearDigis ()
 
std::vector< PndSdsClusterStrip * > GetClusters () const
 
PndSdsClusterStripGetCluster (Int_t i)
 
PndSdsClusterStripGetTopCluster (Int_t i)
 
PndSdsClusterStripGetBotCluster (Int_t i)
 
std::vector< Int_t > GetTopClusterIDs () const
 
std::vector< Int_t > GetBotClusterIDs () const
 
std::vector< Int_t > GetLeftDigiIDs () const
 
void SetDigiType (Int_t digiType)
 

Protected Member Functions

void AddCluster (const std::vector< Int_t > &onecluster, SensorSide side)
 
 ClassDef (PndSdsStripClusterer, 3)
 

Protected Attributes

Fullmap fSortedDigis
 
std::vector< Int_t > fTopclusters
 
std::vector< Int_t > fBotclusters
 
std::vector< Int_t > fLeftDigis
 
std::vector< PndSdsClusterStrip * > fClusters
 
Int_t fDigiType
 

Private Member Functions

 ClassDef (PndSdsSimpleStripClusterFinder, 1)
 

Private Attributes

Int_t fRadius
 

Detailed Description

PndSdsStripClusterer.h

Author
R.Kliemt r.kli.nosp@m.emt@.nosp@m.physi.nosp@m.k.tu.nosp@m.-dres.nosp@m.den..nosp@m.de

Calculator class to find clusters in one channel dimension for the MVD strip sensors

Definition at line 27 of file PndSdsSimpleStripClusterFinder.h.

Constructor & Destructor Documentation

PndSdsSimpleStripClusterFinder::PndSdsSimpleStripClusterFinder ( Int_t  DigiType)

Definition at line 18 of file PndSdsSimpleStripClusterFinder.cxx.

PndSdsSimpleStripClusterFinder::PndSdsSimpleStripClusterFinder ( Int_t  DigiType,
Int_t  rad 
)

Definition at line 22 of file PndSdsSimpleStripClusterFinder.cxx.

PndSdsSimpleStripClusterFinder::~PndSdsSimpleStripClusterFinder ( )

Definition at line 27 of file PndSdsSimpleStripClusterFinder.cxx.

28 {}

Member Function Documentation

void PndSdsStripClusterer::AddCluster ( const std::vector< Int_t > &  onecluster,
SensorSide  side 
)
protectedinherited

Definition at line 86 of file PndSdsStripClusterer.cxx.

References PndSdsStripClusterer::fBotclusters, PndSdsStripClusterer::fClusters, PndSdsStripClusterer::fDigiType, PndSdsStripClusterer::fTopclusters, kBOTTOM, kTOP, and PndSdsClusterStrip::SetSensorSide().

Referenced by SearchClusters(), and PndSdsStripAdvClusterFinder::SearchClusters().

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 }
std::vector< PndSdsClusterStrip * > fClusters
std::vector< Int_t > fTopclusters
std::vector< Int_t > fBotclusters
void SetSensorSide(SensorSide s)
void PndSdsStripClusterer::AddDigi ( Int_t  sensorID,
SensorSide  side,
Int_t  timestamp,
Int_t  strip,
Int_t  iDigi 
)
inherited

Definition at line 45 of file PndSdsStripClusterer.cxx.

References PndSdsStripClusterer::fSortedDigis.

Referenced by PndSdsStripClusterTask::FillClusterFinders().

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 }
PndSdsSimpleStripClusterFinder::ClassDef ( PndSdsSimpleStripClusterFinder  ,
 
)
private
PndSdsStripClusterer::ClassDef ( PndSdsStripClusterer  ,
 
)
protectedinherited
void PndSdsStripClusterer::ClearDigis ( )
inlineinherited

Definition at line 39 of file PndSdsStripClusterer.h.

References PndSdsStripClusterer::fSortedDigis.

39 {fSortedDigis.clear();}
PndSdsClusterStrip * PndSdsStripClusterer::GetBotCluster ( Int_t  i)
inherited

Definition at line 74 of file PndSdsStripClusterer.cxx.

References PndSdsStripClusterer::fBotclusters, PndSdsStripClusterer::GetCluster(), and i.

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 }
Int_t i
Definition: run_full.C:25
std::vector< Int_t > fBotclusters
PndSdsClusterStrip * GetCluster(Int_t i)
std::vector< Int_t > PndSdsStripClusterer::GetBotClusterIDs ( ) const
inlineinherited

Definition at line 47 of file PndSdsStripClusterer.h.

References PndSdsStripClusterer::fBotclusters.

Referenced by PndLmdStripClusterTask::Exec(), and PndSdsStripClusterTask::Exec().

47 {return fBotclusters;}
std::vector< Int_t > fBotclusters
PndSdsClusterStrip * PndSdsStripClusterer::GetCluster ( Int_t  i)
inherited

Definition at line 54 of file PndSdsStripClusterer.cxx.

References PndSdsStripClusterer::fClusters, and i.

Referenced by PndSdsStripClusterer::GetBotCluster(), and PndSdsStripClusterer::GetTopCluster().

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 }
std::vector< PndSdsClusterStrip * > fClusters
Int_t i
Definition: run_full.C:25
std::vector< PndSdsClusterStrip* > PndSdsStripClusterer::GetClusters ( ) const
inlineinherited

Definition at line 42 of file PndSdsStripClusterer.h.

References PndSdsStripClusterer::fClusters.

42 {return fClusters;}
std::vector< PndSdsClusterStrip * > fClusters
std::vector< Int_t > PndSdsStripClusterer::GetLeftDigiIDs ( ) const
inlineinherited

Definition at line 48 of file PndSdsStripClusterer.h.

References PndSdsStripClusterer::fLeftDigis.

Referenced by PndLmdStripClusterTask::Exec(), and PndSdsStripClusterTask::Exec().

48 {return fLeftDigis;}
std::vector< Int_t > fLeftDigis
PndSdsClusterStrip * PndSdsStripClusterer::GetTopCluster ( Int_t  i)
inherited

Definition at line 64 of file PndSdsStripClusterer.cxx.

References PndSdsStripClusterer::fTopclusters, PndSdsStripClusterer::GetCluster(), and i.

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 }
Int_t i
Definition: run_full.C:25
std::vector< Int_t > fTopclusters
PndSdsClusterStrip * GetCluster(Int_t i)
std::vector< Int_t > PndSdsStripClusterer::GetTopClusterIDs ( ) const
inlineinherited

Definition at line 46 of file PndSdsStripClusterer.h.

References PndSdsStripClusterer::fTopclusters.

Referenced by PndLmdStripClusterTask::Exec(), and PndSdsStripClusterTask::Exec().

46 {return fTopclusters;}
std::vector< Int_t > fTopclusters
void PndSdsStripClusterer::Reinit ( )
inherited

Definition at line 36 of file PndSdsStripClusterer.cxx.

References PndSdsStripClusterer::fBotclusters, PndSdsStripClusterer::fClusters, PndSdsStripClusterer::fLeftDigis, PndSdsStripClusterer::fSortedDigis, and PndSdsStripClusterer::fTopclusters.

37 {
38  fSortedDigis.clear();
39  fClusters.clear();
40  fTopclusters.clear();
41  fBotclusters.clear();
42  fLeftDigis.clear();
43 }
std::vector< PndSdsClusterStrip * > fClusters
std::vector< Int_t > fLeftDigis
std::vector< Int_t > fTopclusters
std::vector< Int_t > fBotclusters
std::vector< PndSdsClusterStrip * > PndSdsSimpleStripClusterFinder::SearchClusters ( )
virtual

--— search for clusters --— Take neighbouring fired strips.

Implements PndSdsStripClusterer.

Definition at line 31 of file PndSdsSimpleStripClusterFinder.cxx.

References PndSdsStripClusterer::AddCluster(), PndSdsStripClusterer::fBotclusters, PndSdsStripClusterer::fClusters, PndSdsStripClusterer::fLeftDigis, fRadius, PndSdsStripClusterer::fSortedDigis, and PndSdsStripClusterer::fTopclusters.

32 {
35  fClusters.clear();
36  fTopclusters.clear();
37  fBotclusters.clear();
38  fLeftDigis.clear();
39  std::vector< Int_t > onecluster;
40  Indexpair::iterator tempStrip;
41  //fSortedDigis[sensor][side][stripnr]=digiindex
42  for (Fullmap::iterator itSensors = fSortedDigis.begin();
43  itSensors != fSortedDigis.end(); ++itSensors) // iterate over sensor
44  {
45  for (std::map<SensorSide,Indextriple>::iterator itSide = (itSensors->second).begin();
46  itSide != (itSensors->second).end(); ++itSide) // iterate over sensor side
47  {
48  // std::cout<<"clsterfinder: ";
49  // if(itSide->first == kTOP) std::cout<<"top"<<std::endl;
50  // else std::cout<<"bottom"<<std::endl;
51  for (Indextriple::iterator itTime = (itSide->second).begin(); itTime != (itSide->second).end(); ++itTime)
52  { // iterate over timestamp
53 
54  // create a flagmap: for each digi (identified by iDigi, the index of the clonesarray) a flag if it is used
55  Indexpair flagmap;
56  for (Indexpair::iterator itStrip = (itTime->second).begin(); itStrip!= (itTime->second).end(); ++itStrip)
57  {flagmap[itStrip->second]=1;} // iterate over channel
58 
59  for (Indexpair::iterator itStrip = (itTime->second).begin();
60  itStrip!= (itTime->second).end();itStrip++)
61  {
62  tempStrip=itStrip;
63  if( !(1==flagmap[itStrip->second]) ) continue;
64  for(Indexpair::iterator itStrip3 = itStrip; itStrip3 != (itTime->second).end(); ++itStrip3)
65  {
66  if( !(1==flagmap[itStrip3->second]) ) continue;
67  if( std::abs(tempStrip->first - itStrip3->first) > fRadius ) continue;
68  onecluster.push_back(itStrip3->second);
69  flagmap[itStrip3->second]=-1;//do not reuse this digi
70  tempStrip=itStrip3;
71  // std::cout<<"add strip "<<itStrip3->first << " from digi "<<itStrip3->second <<std::endl;
72  }
73  AddCluster(onecluster,itSide->first);
74  onecluster.clear();
75  // std::cout<<" --- "<<std::endl;
76  } // end loop itStrip
77 
78  if (onecluster.size()>0)
79  {
80  Warning("SearchClusters","a hangover cluster of %zu digis",onecluster.size());
81  AddCluster(onecluster,itSide->first);
82  onecluster.clear();
83  }
84  for (Indexpair::iterator itflag = flagmap.begin(); itflag!= flagmap.end(); ++itflag)
85  {
86  if (1==itflag->second) fLeftDigis.push_back(itflag->first);
87  }
88  } // end loop itTime
89  }// end loop it Side
90  }// end loop sensor
91  return fClusters;
92 }
std::vector< PndSdsClusterStrip * > fClusters
std::map< Int_t, Int_t > Indexpair
std::vector< Int_t > fLeftDigis
std::vector< Int_t > fTopclusters
std::vector< Int_t > fBotclusters
void AddCluster(const std::vector< Int_t > &onecluster, SensorSide side)
void PndSdsStripClusterer::SetDigiType ( Int_t  digiType)
inlineinherited
void PndSdsSimpleStripClusterFinder::SetSearchRadius ( Int_t  rad = 0)
inline

Definition at line 34 of file PndSdsSimpleStripClusterFinder.h.

References fRadius.

Member Data Documentation

std::vector< Int_t > PndSdsStripClusterer::fBotclusters
protectedinherited
std::vector< PndSdsClusterStrip* > PndSdsStripClusterer::fClusters
protectedinherited
Int_t PndSdsStripClusterer::fDigiType
protectedinherited
std::vector< Int_t > PndSdsStripClusterer::fLeftDigis
protectedinherited
Int_t PndSdsSimpleStripClusterFinder::fRadius
private

Definition at line 34 of file PndSdsSimpleStripClusterFinder.h.

Referenced by SearchClusters(), and SetSearchRadius().

Fullmap PndSdsStripClusterer::fSortedDigis
protectedinherited
std::vector< Int_t > PndSdsStripClusterer::fTopclusters
protectedinherited

The documentation for this class was generated from the following files: