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

#include <PndLmdSimplePixelClusterFinder.h>

Inheritance diagram for PndLmdSimplePixelClusterFinder:
PndSdsSimplePixelClusterFinder PndSdsPixelClusterFinder

Public Member Functions

 PndLmdSimplePixelClusterFinder (Int_t verbose=0)
 
std::vector< std::vector< Int_t > > GetClusters (std::vector< PndSdsDigiPixel > hits)
 
virtual void SetMaxCols (Int_t col)
 
virtual void SetMaxRows (Int_t row)
 
virtual void SetRadius (Double_t rad)
 
void Print ()
 
void Print (std::vector< PndSdsDigiPixel > hits)
 
void PrintResult (std::vector< std::vector< Int_t > > clusters)
 
void SetVerbose (Int_t level)
 
 ClassDef (PndSdsPixelClusterFinder, 2)
 

Public Attributes

std::vector< PndSdsDigiPixelfHits
 
Int_t fVerbose
 
PndSdsChargeConversionfChargeConverter
 

Protected Attributes

Int_t fcols
 
Int_t frows
 
Double_t fradius
 

Detailed Description

PndLmdSimplePixelClusterFinder.h Simple cluster finder for pixel detectors.

It takes the first hit in the DigiArray and moves it into a new cluster. Then it looks through the remaining hits in the DigiArray if there are hits which are in the area around the first hit and moves them into the cluster. The radius is given by the first parameter. Then it takes the new hits in the cluster and looks if there are other hits which are in the range of these hits and moves them into the cluster, too. This process is repeated until no hits around the cluster are found The the first hit of the remaining DigiHits is taken to create a new hit and the cluster search process is started again.

Definition at line 18 of file PndLmdSimplePixelClusterFinder.h.

Constructor & Destructor Documentation

PndLmdSimplePixelClusterFinder::PndLmdSimplePixelClusterFinder ( Int_t  verbose = 0)

Definition at line 8 of file PndLmdSimplePixelClusterFinder.cxx.

References PndSdsPixelClusterFinder::fChargeConverter, PndSdsSimplePixelClusterFinder::fcols, PndSdsSimplePixelClusterFinder::fradius, PndSdsSimplePixelClusterFinder::frows, PndSdsPixelClusterFinder::fVerbose, PndSdsPixelDigiPar::GetChargeConvMethod(), PndSdsTotDigiPar::GetChargingTime(), PndSdsTotDigiPar::GetClockFrequency(), PndSdsPixelDigiPar::GetClustRadius(), PndSdsTotDigiPar::GetConstCurrent(), PndSdsPixelDigiPar::GetFECols(), PndSdsPixelDigiPar::GetFERows(), PndSdsPixelDigiPar::GetNoise(), PndSdsPixelDigiPar::GetThreshold(), rtdb, and verbose.

10  fVerbose = verbose;
11  FairRun* ana = FairRun::Instance();
12  FairRuntimeDb* rtdb = ana->GetRuntimeDb();
13  PndSdsPixelDigiPar* fDigiPar =
14  (PndSdsPixelDigiPar*)(rtdb->getContainer("LMDPixelDigiPar"));
15  PndSdsTotDigiPar* fTotDigiPar =
16  (PndSdsTotDigiPar*)(rtdb->getContainer("LMDPixelTotDigiPar"));
17  if (fDigiPar->GetChargeConvMethod() == 0) {
18  if (fVerbose > 0)
19  std::cout
20  << "Info in <PndLmdSimplePixelClusterFinder>: ideal charge conversion"
21  << std::endl;
23  } else if (fDigiPar->GetChargeConvMethod() == 1) {
24  if (fVerbose > 0)
25  std::cout
26  << "Info in <PndLmdSimplePixelClusterFinder>: TOT charge conversion"
27  << std::endl;
29  fTotDigiPar->GetChargingTime(), fTotDigiPar->GetConstCurrent(),
30  fDigiPar->GetThreshold(), fTotDigiPar->GetClockFrequency(), fVerbose);
31  } else {
32  std::cout << "Error in <PndLmdSimplePixelClusterFinder>: charge conversion "
33  "method not defined, use ideal converter..."
34  << std::endl;
36  }
37  fcols = fDigiPar->GetFECols();
38  frows = fDigiPar->GetFERows();
39  fradius = fDigiPar->GetClustRadius();
40 };
Double_t GetClustRadius() const
Int_t GetChargeConvMethod() const
#define verbose
Charge Digitization Parameter Class for SDS.
Double_t GetConstCurrent() const
Double_t GetNoise() const
Double_t GetClockFrequency() const
PndSdsChargeConversion * fChargeConverter
Int_t GetFERows() const
Int_t GetFECols() const
FairRuntimeDb * rtdb
Definition: hit_dirc.C:66
Double_t GetChargingTime() const
Double_t GetThreshold() const
Digitization Parameter Class for SDS-Pixel part.

Member Function Documentation

PndSdsPixelClusterFinder::ClassDef ( PndSdsPixelClusterFinder  ,
 
)
inherited
std::vector< std::vector< Int_t > > PndSdsSimplePixelClusterFinder::GetClusters ( std::vector< PndSdsDigiPixel hits)
virtualinherited

Main method which searches for the clusters. It returns a matrix of ints where a column corresponds to a cluster and an integer to a hit in the DigiArray

Implements PndSdsPixelClusterFinder.

Definition at line 6 of file PndSdsSimplePixelClusterFinder.cxx.

References PndSdsChargeConversion::DigiValueToCharge(), PndSdsPixelClusterFinder::fChargeConverter, PndSdsPixelClusterFinder::fHits, PndSdsPixelClusterFinder::fVerbose, hits, i, PndSdsSimplePixelClusterFinder::IsInRange(), PndSdsSimplePixelClusterFinder::MoveHit(), PndSdsPixelClusterFinder::PrintResult(), and push_back().

7 {
8  fHits = hits;
9 // if (fVerbose > 1) Print();
10  std::vector<Int_t> posHits;
11  for (UInt_t i = 0; i < fHits.size(); i++) posHits.push_back(i);
12  std::vector< std::vector< Int_t> > result;
13  Int_t sizeTempHits = posHits.size();
14  //Int_t actHit = 0;
15  while (sizeTempHits != 0){
16  std::vector<Int_t> tempInt;
17  if (fChargeConverter->DigiValueToCharge(fHits[posHits[0]]) == 0){
18  MoveHit(&posHits,0);
19  sizeTempHits = posHits.size();
20  }
21  else {
22  tempInt.push_back(MoveHit(&posHits,0));
23  result.push_back(tempInt);
24  Int_t sizeResultI = (result.end()-1)->size(); // size of last vector in array
25  for (Int_t i = 0; i < sizeResultI; i++){
26  sizeTempHits = posHits.size();
27  for (Int_t j = 0; j < sizeTempHits; j++){
28  if (fChargeConverter->DigiValueToCharge(fHits[posHits[j]]) == 0){
29  MoveHit(&posHits,j);
30  if (fVerbose > 1)
31  std::cout << "Charge too low!" << std::endl;
32  j--;
33  }
34  else{
35  if (fHits[(*(result.end()-1))[i]].GetSensorID() == fHits[posHits[j]].GetSensorID()){
36  if (IsInRange(fHits[(*(result.end()-1))[i]], fHits[posHits[j]])) {
37  (result.end()-1)->push_back(MoveHit(&posHits,j));
38  j--;
39  if (fVerbose > 1)
40  std::cout << "Hit added to cluster: " << result.size()-1 << std::endl;
41  }
42  }
43 
44  }
45  sizeTempHits = posHits.size();
46  }
47  sizeResultI = (result.end()-1)->size();
48  }
49  }
50  }
51  if (fVerbose > 1) PrintResult(result);
52  return result;
53 }
void PrintResult(std::vector< std::vector< Int_t > > clusters)
Int_t i
Definition: run_full.C:25
labels push_back("electron")
bool IsInRange(PndSdsDigiPixel hit1, PndSdsDigiPixel hit2) const
virtual Double_t DigiValueToCharge(Double_t digi)=0
Converts a given digitized charge into charge in electrons.
PndSdsChargeConversion * fChargeConverter
std::vector< PndSdsDigiPixel > fHits
Int_t MoveHit(std::vector< Int_t > *hitVector, Int_t index) const
CbmHit * hits[nHits]
Definition: RiemannTest.C:19
void PndSdsPixelClusterFinder::Print ( )
inherited
void PndSdsPixelClusterFinder::Print ( std::vector< PndSdsDigiPixel hits)
inherited

Definition at line 12 of file PndSdsPixelClusterFinder.cxx.

References i.

13 {
14  std::cout << "--------------" << std::endl;
15  for (UInt_t i = 0; i < hits.size(); i++){
16  std::cout << hits[i] << std::endl;
17  }
18 }
Int_t i
Definition: run_full.C:25
CbmHit * hits[nHits]
Definition: RiemannTest.C:19
void PndSdsPixelClusterFinder::PrintResult ( std::vector< std::vector< Int_t > >  clusters)
inherited

Definition at line 25 of file PndSdsPixelClusterFinder.cxx.

References PndSdsPixelClusterFinder::fHits, i, and PndSdsPixelClusterFinder::Print().

Referenced by PndSdsIdealPixelClusterFinder::GetClusters(), and PndSdsSimplePixelClusterFinder::GetClusters().

26 {
27  for (UInt_t i = 0; i < clusters.size(); i++){
28  std::cout << "PndSdsPixelClusterFinder::PrintResult(): Cluster " << i << ": " << std::endl;
29  for (UInt_t j = 0; j < clusters[i].size();j++)
30  fHits[clusters[i][j]].Print();
31  }
32 }
Int_t i
Definition: run_full.C:25
std::vector< PndSdsDigiPixel > fHits
virtual void PndSdsSimplePixelClusterFinder::SetMaxCols ( Int_t  col)
inlinevirtualinherited
virtual void PndSdsSimplePixelClusterFinder::SetMaxRows ( Int_t  row)
inlinevirtualinherited
virtual void PndSdsSimplePixelClusterFinder::SetRadius ( Double_t  rad)
inlinevirtualinherited
void PndSdsPixelClusterFinder::SetVerbose ( Int_t  level)
inlineinherited

Member Data Documentation

PndSdsChargeConversion* PndSdsPixelClusterFinder::fChargeConverter
inherited
Int_t PndSdsSimplePixelClusterFinder::fcols
protectedinherited
std::vector<PndSdsDigiPixel> PndSdsPixelClusterFinder::fHits
inherited
Double_t PndSdsSimplePixelClusterFinder::fradius
protectedinherited
Int_t PndSdsSimplePixelClusterFinder::frows
protectedinherited
Int_t PndSdsPixelClusterFinder::fVerbose
inherited

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