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

Find Clusters on a strip sensor in two dimensions. More...

#include <PndSdsStripAdvClusterFinder.h>

Inheritance diagram for PndSdsStripAdvClusterFinder:
PndSdsStripClusterer

Public Member Functions

 PndSdsStripAdvClusterFinder (Int_t DigiType)
 
 PndSdsStripAdvClusterFinder (Int_t DigiType, Int_t NrofmissedChannels, Int_t NrofmissedTimestamps)
 
 ~PndSdsStripAdvClusterFinder ()
 
std::vector< PndSdsClusterStrip * > SearchClusters ()
 
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

void ClusterIterator (Int_t newCh, Int_t newFrameID, std::map< Int_t, std::map< Int_t, std::vector< Int_t > > > &hitmap, std::vector< Int_t > &onecluster)
 
 ClassDef (PndSdsStripAdvClusterFinder, 1)
 

Private Attributes

Int_t fNmCh
 maximum of missing channels More...
 
Int_t fNmTS
 maximum of missing time More...
 

Detailed Description

Find Clusters on a strip sensor in two dimensions.

PndSdsStripAdvClusterFinder.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
L.Ackermann

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

Search for clusters in channel and trigger timestamp dimension. It is possible to set a whole e.g. defect strip.

Author
Lars Ackermann
Hans-Georg Zaunick
Ralf Kliemt
Date
11.03.2009

Definition at line 38 of file PndSdsStripAdvClusterFinder.h.

Constructor & Destructor Documentation

PndSdsStripAdvClusterFinder::PndSdsStripAdvClusterFinder ( Int_t  DigiType)

default constructor

Definition at line 15 of file PndSdsStripAdvClusterFinder.cxx.

16 : PndSdsStripClusterer(DigiType),
17  fNmCh(2),
18  fNmTS(0)
19 {}
PndSdsStripClusterer(Int_t DigiType)
Int_t fNmCh
maximum of missing channels
Int_t fNmTS
maximum of missing time
PndSdsStripAdvClusterFinder::PndSdsStripAdvClusterFinder ( Int_t  DigiType,
Int_t  NrofmissedChannels,
Int_t  NrofmissedTimestamps 
)

main constructor Set number of maximum missing channels or time to get the cluster

Parameters
NrofmissedChannelsmaximum of missing channels
NrofmissedTimestampsmaximum of missing time

Definition at line 21 of file PndSdsStripAdvClusterFinder.cxx.

22 : PndSdsStripClusterer(DigiType),
23  fNmCh(NrofmissedChannels+1),
24  fNmTS(NrofmissedTimestamp)
25 {}
PndSdsStripClusterer(Int_t DigiType)
Int_t fNmCh
maximum of missing channels
Int_t fNmTS
maximum of missing time
PndSdsStripAdvClusterFinder::~PndSdsStripAdvClusterFinder ( )

Destructor

Definition at line 27 of file PndSdsStripAdvClusterFinder.cxx.

28 {
29 }

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

Definition at line 39 of file PndSdsStripClusterer.h.

References PndSdsStripClusterer::fSortedDigis.

39 {fSortedDigis.clear();}
void PndSdsStripAdvClusterFinder::ClusterIterator ( Int_t  newCh,
Int_t  newFrameID,
std::map< Int_t, std::map< Int_t, std::vector< Int_t > > > &  hitmap,
std::vector< Int_t > &  onecluster 
)
private

iterates through the hitlist and find clusters. It will stop when reaching the end of hitlist or the maximum of channels or time is reached so that this cluster has no more entries

Parameters
newChthe current channel to search for
newFrameIDthe current time to search for
hitmapthe hitlist where the first element in the vector is negative for already identified hits the second member of the vector knows the hitID
oneclusterlist of hitIDs belonging to this cluster
Returns
void

Definition at line 84 of file PndSdsStripAdvClusterFinder.cxx.

References fNmCh, and fNmTS.

Referenced by SearchClusters().

86 {
87  if (hitmap.find(newCh) == hitmap.end()) return; // end of hitmap reached (channel)
88  if (hitmap[newCh].find(newFrameID) == hitmap[newCh].end()) return; // end of hitmap reached (frame)
89  if (hitmap[newCh][newFrameID][1]==-1) return; // already identified
90  hitmap[newCh][newFrameID][1]=-1; // now identified
91  onecluster.push_back(hitmap[newCh][newFrameID][0]); // to clusterlist
92 
93  for(Int_t channel=(newCh-fNmCh); channel!=(newCh+fNmCh); ++channel)
94  {
95  for(Int_t frame=(newFrameID-fNmTS);frame!=(newFrameID+fNmTS);++frame)
96  {
97  ClusterIterator(channel,frame,hitmap,onecluster);
98  }
99  }
100  return;
101 }
void ClusterIterator(Int_t newCh, Int_t newFrameID, std::map< Int_t, std::map< Int_t, std::vector< Int_t > > > &hitmap, std::vector< Int_t > &onecluster)
Int_t fNmCh
maximum of missing channels
Int_t fNmTS
maximum of missing time
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 > PndSdsStripAdvClusterFinder::SearchClusters ( )
virtual

calculate clusters in the two dimensional way

Returns
vector of clusters

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

Implements PndSdsStripClusterer.

Definition at line 32 of file PndSdsStripAdvClusterFinder.cxx.

References PndSdsStripClusterer::AddCluster(), ClusterIterator(), PndSdsStripClusterer::fBotclusters, PndSdsStripClusterer::fClusters, PndSdsStripClusterer::fSortedDigis, PndSdsStripClusterer::fTopclusters, map, and ts.

33 {
36  fClusters.clear();
37  fTopclusters.clear();
38  fBotclusters.clear();
39  std::vector< Int_t > onecluster;
40  Indexpair::iterator tempStrip;
41  //fSortedDigis[sensor][side][stripnr]=digiindex
42  std::cout<<"beim Cluster"<<std::endl;
43  for (Fullmap::iterator itSensors = fSortedDigis.begin(); itSensors != fSortedDigis.end(); ++itSensors)
44  { // iterate over sensor
45  for (std::map<SensorSide,Indextriple>::iterator itSide = (itSensors->second).begin();
46  itSide != (itSensors->second).end(); ++itSide)
47  { // iterate over sensor side
48  //CH TS ID,Used
49  std::map<Int_t, std::map<Int_t,std::vector<Int_t> > > hitmap;
50  for (Indextriple::iterator itTime = (itSide->second).begin(); itTime != (itSide->second).end();
51  ++itTime)
52  { // iterate over timestamp
53  for (Indexpair::iterator itStrip = (itTime->second).begin(); itStrip!= (itTime->second).end();
54  ++itStrip)
55  { // iterate over channel
56  hitmap[itStrip->first][itTime->first][0]=itStrip->second; // ID store
57  hitmap[itStrip->first][itTime->first][1]=1; // used store
58  }
59  }//loop time
60 
61  // loop over channels in hitmap
62  for (std::map<Int_t, std::map<Int_t,std::vector<Int_t> > >::const_iterator ch = hitmap.begin();
63  ch!=hitmap.end(); ++ch)
64  {
65  // loop over all frames in hitmap in this channel
66  for (std::map<Int_t,std::vector<Int_t> >::const_iterator ts = ch->second.begin(); ts!=ch->second.end(); ++ts)
67  {
68  // std::vector< Int_t > onecluster;
69  ClusterIterator(ch->first,ts->first,hitmap,onecluster); // new Cluster from ch and ts
70  if (onecluster.size()>0)
71  {
72  // std::cout<<" -W- PndSdsStripAdvClusterFinder::SearchClusters(): cluster hangover? "<<onecluster.size()<<std::endl;
73  AddCluster(onecluster,itSide->first);
74  onecluster.clear();
75  }
76  } // iter time
77  } // iter channel
78  }// end loop it Side
79  }// end loop sensor
80  return fClusters;
81 }
std::vector< PndSdsClusterStrip * > fClusters
void ClusterIterator(Int_t newCh, Int_t newFrameID, std::map< Int_t, std::map< Int_t, std::vector< Int_t > > > &hitmap, std::vector< Int_t > &onecluster)
PndTransMap * map
Definition: sim_emc_apd.C:99
std::vector< Int_t > fTopclusters
std::vector< Int_t > fBotclusters
void AddCluster(const std::vector< Int_t > &onecluster, SensorSide side)
PndPidEmcAssociatorTask * ts
void PndSdsStripClusterer::SetDigiType ( Int_t  digiType)
inlineinherited

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 PndSdsStripAdvClusterFinder::fNmCh
private

maximum of missing channels

Definition at line 77 of file PndSdsStripAdvClusterFinder.h.

Referenced by ClusterIterator().

Int_t PndSdsStripAdvClusterFinder::fNmTS
private

maximum of missing time

Definition at line 80 of file PndSdsStripAdvClusterFinder.h.

Referenced by ClusterIterator().

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

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