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

#include <PndHypStripClusterBuilder.h>

Public Member Functions

 PndHypStripClusterBuilder ()
 
virtual ~PndHypStripClusterBuilder ()
 
void Reinit ()
 -----------------------------------------------------------------------—/// More...
 
void AddDigi (std::string detname, SensorSide side, Int_t strip, Int_t iPoint)
 
std::vector< PndHypClusterSearchClusters ()
 
std::vector< PndHypClusterGetClusters ()
 
PndHypCluster GetCluster (Int_t i)
 
PndHypCluster GetTopCluster (Int_t i)
 
PndHypCluster GetBotCluster (Int_t i)
 
std::vector< Int_t > GetTopClusterIDs () const
 
std::vector< Int_t > GetBotClusterIDs () const
 

Private Member Functions

void AddCluster (const std::vector< Int_t > &onecluster, SensorSide side)
 --------------------------------------------------------------------——/// More...
 
 ClassDef (PndHypStripClusterBuilder, 3)
 -----------------------------------------------------------------------—/// More...
 

Private Attributes

Fullmap fSortedDigis
 
std::vector< Int_t > fTopclusters
 
std::vector< Int_t > fBotclusters
 
std::vector< PndHypClusterfClusters
 

Detailed Description

Definition at line 29 of file PndHypStripClusterBuilder.h.

Constructor & Destructor Documentation

PndHypStripClusterBuilder::PndHypStripClusterBuilder ( )

Definition at line 15 of file PndHypStripClusterBuilder.cxx.

16 {
17  // dummy
18 }
PndHypStripClusterBuilder::~PndHypStripClusterBuilder ( )
virtual

Definition at line 20 of file PndHypStripClusterBuilder.cxx.

21 {
22 }

Member Function Documentation

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

--------------------------------------------------------------------——///

-----------------------------------------------------------------------—///

Definition at line 119 of file PndHypStripClusterBuilder.cxx.

References fBotclusters, fClusters, fTopclusters, kBOTTOM, kTOP, and PndHypCluster::SetSensorSide().

Referenced by SearchClusters().

120 {
121  Int_t clindex = fClusters.size();
122  if(side == kBOTTOM)
123  {
124  fBotclusters.push_back(clindex);
125  //std::cout<<"Adding bot Cluster number "<<clindex<<" side "<<side<<" to the bottom list."<<std::endl;
126  } else if(side == kTOP)
127  {
128  fTopclusters.push_back(clindex);
129  //std::cout<<"Adding top Cluster number "<<clindex<<" side "<<side<<" to the top list."<<std::endl;
130  }
131  PndHypCluster cl(onecluster);
132  cl.SetSensorSide(side);
133  //std::cout<<"side clus cand "<<cl.GetSensorSide()<<std::endl;
134 
135  fClusters.push_back(cl);
136 }
Class to store the Digis which belong to one cluster This class holds the information which Digi belo...
Definition: PndHypCluster.h:18
std::vector< PndHypCluster > fClusters
void PndHypStripClusterBuilder::AddDigi ( std::string  detname,
SensorSide  side,
Int_t  strip,
Int_t  iPoint 
)

Definition at line 36 of file PndHypStripClusterBuilder.cxx.

References fSortedDigis, and strip.

Referenced by PndHypStripClusterTask::Exec().

37 {
38  fSortedDigis[detName][side][strip] = iPoint;
39  //std::cout<<" det name "<<detName<<" ipoint "<<iPoint<<std::endl;
40 
41 }
int strip
Definition: anaMvdDigi.C:135
PndHypStripClusterBuilder::ClassDef ( PndHypStripClusterBuilder  ,
 
)
private

-----------------------------------------------------------------------—///

PndHypCluster PndHypStripClusterBuilder::GetBotCluster ( Int_t  i)

Definition at line 110 of file PndHypStripClusterBuilder.cxx.

References fBotclusters, fClusters, and i.

111  {
112  if(0<=i && (int)fBotclusters.size() < i)
113  return fClusters[ (fBotclusters[i]) ];
114  return PndHypCluster();
115  }
Class to store the Digis which belong to one cluster This class holds the information which Digi belo...
Definition: PndHypCluster.h:18
Int_t i
Definition: run_full.C:25
std::vector< PndHypCluster > fClusters
std::vector< Int_t > PndHypStripClusterBuilder::GetBotClusterIDs ( ) const
inline

Definition at line 46 of file PndHypStripClusterBuilder.h.

References fBotclusters.

Referenced by PndHypStripClusterTask::Exec().

46 {return fBotclusters;}
PndHypCluster PndHypStripClusterBuilder::GetCluster ( Int_t  i)

Definition at line 98 of file PndHypStripClusterBuilder.cxx.

References fClusters, and i.

99  {
100  if(0<=i && (int)fClusters.size() < i)
101  return fClusters[i];
102  return PndHypCluster();
103  }
Class to store the Digis which belong to one cluster This class holds the information which Digi belo...
Definition: PndHypCluster.h:18
Int_t i
Definition: run_full.C:25
std::vector< PndHypCluster > fClusters
std::vector< PndHypCluster > PndHypStripClusterBuilder::GetClusters ( )
inline

Definition at line 40 of file PndHypStripClusterBuilder.h.

References fClusters.

40 {return fClusters;}
std::vector< PndHypCluster > fClusters
PndHypCluster PndHypStripClusterBuilder::GetTopCluster ( Int_t  i)

Definition at line 104 of file PndHypStripClusterBuilder.cxx.

References fClusters, fTopclusters, and i.

105  {
106  if(0<=i && (int)fTopclusters.size() < i)
107  return fClusters[ (fTopclusters[i]) ];
108  return PndHypCluster();
109  }
Class to store the Digis which belong to one cluster This class holds the information which Digi belo...
Definition: PndHypCluster.h:18
Int_t i
Definition: run_full.C:25
std::vector< PndHypCluster > fClusters
std::vector< Int_t > PndHypStripClusterBuilder::GetTopClusterIDs ( ) const
inline

Definition at line 45 of file PndHypStripClusterBuilder.h.

References fTopclusters.

Referenced by PndHypStripClusterTask::Exec().

45 {return fTopclusters;}
void PndHypStripClusterBuilder::Reinit ( )

-----------------------------------------------------------------------—///

-----------------------------------------------------------------------—/// -----------------------------------------------------------------------—/// -----------------------------------------------------------------------—///

Definition at line 28 of file PndHypStripClusterBuilder.cxx.

References fBotclusters, fClusters, fSortedDigis, and fTopclusters.

29 {
30 fSortedDigis.clear();
31 fClusters.clear();
32 fTopclusters.clear();
33 fBotclusters.clear();
34 }
std::vector< PndHypCluster > fClusters
std::vector< PndHypCluster > PndHypStripClusterBuilder::SearchClusters ( )

--— search for clusters --— Take neighbouring fired strips. use that std::map is a SORTED object

Definition at line 45 of file PndHypStripClusterBuilder.cxx.

References AddCluster(), fBotclusters, fClusters, fSortedDigis, and fTopclusters.

Referenced by PndHypStripClusterTask::Exec().

46 {
50  fClusters.clear();
51  fTopclusters.clear();
52  fBotclusters.clear();
53  std::vector< Int_t > onecluster;
54 
55  for (Fullmap::iterator itSensors = fSortedDigis.begin();
56  itSensors != fSortedDigis.end(); ++itSensors)
57  {
58  //std::cout<< "name "<<itSensors->first<<std::endl;
59  for (std::map<SensorSide,Indexpair>::iterator itSide = (itSensors->second).begin();
60  itSide != (itSensors->second).end(); ++itSide)
61  {
62 
63  Indexpair flagmap;
64  //std::cout<< "side "<<itSensors->second<<std::endl;
65  for (Indexpair::iterator itStrip = (itSide->second).begin();
66  itStrip!= (itSide->second).end(); ++itStrip)
67  {flagmap[itStrip->second]=1;}
68 
69  for (Indexpair::iterator itStrip = (itSide->second).begin();
70  itStrip!= (itSide->second).end(); ++itStrip) {
71  if( !(1==flagmap[itStrip->second]) ) continue;
72  for(Indexpair::iterator itStrip3 = itStrip; itStrip3 != (itSide->second).end(); ++itStrip3)
73  {
74  if( !(1==flagmap[itStrip3->second]) ) continue;
75  if( std::abs(itStrip->first - itStrip3->first) > 1) continue;
76 
77  onecluster.push_back(itStrip3->second);
78  // make a helper to the next element
79  flagmap[itStrip3->second]=-1;//do not reuse this digi
80  itStrip=itStrip3;
81  }
82  AddCluster(onecluster,itSide->first);
83  onecluster.clear();
84  }// end loop itStrip
85 
86  if (onecluster.size()>0)
87  {
88  std::cout<<"mvd strip clusterfinder: cluster hangover? "<<onecluster.size()<<std::endl;
89  AddCluster(onecluster,itSide->first);
90  onecluster.clear();
91  }
92  }// end loop it Side
93  }// end loop sensor
94  return fClusters;
95 }
std::map< Int_t, Int_t > Indexpair
void AddCluster(const std::vector< Int_t > &onecluster, SensorSide side)
--------------------------------------------------------------------——///
std::vector< PndHypCluster > fClusters

Member Data Documentation

std::vector< Int_t > PndHypStripClusterBuilder::fBotclusters
private
std::vector< PndHypCluster > PndHypStripClusterBuilder::fClusters
private
Fullmap PndHypStripClusterBuilder::fSortedDigis
private

Definition at line 55 of file PndHypStripClusterBuilder.h.

Referenced by AddDigi(), Reinit(), and SearchClusters().

std::vector< Int_t > PndHypStripClusterBuilder::fTopclusters
private

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