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

#include <PndMvdSimplePixelClusterFinder.h>

Inheritance diagram for PndMvdSimplePixelClusterFinder:
PndSdsSimplePixelClusterFinder PndSdsPixelClusterFinder

Public Member Functions

 PndMvdSimplePixelClusterFinder (TString parName="MVDPixelDigiPar", TString totParName="MVDPixelTotDigiPar", Int_t verbose=0)
 
 PndMvdSimplePixelClusterFinder (PndSdsPixelDigiPar *digiPar, PndSdsTotDigiPar *totPar)
 
 PndMvdSimplePixelClusterFinder (const PndMvdSimplePixelClusterFinder &)=delete
 
PndMvdSimplePixelClusterFinderoperator= (const PndMvdSimplePixelClusterFinder &)=delete
 
void SetParName (TString val)
 
void SetTotParName (TString val)
 
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 Member Functions

void SetParameters ()
 

Protected Attributes

Int_t fcols
 
Int_t frows
 
Double_t fradius
 

Private Attributes

TString fParName
 
TString fTotParName
 
PndSdsPixelDigiParfDigiPar
 
PndSdsTotDigiParfTotDigiPar
 

Detailed Description

PndMvdSimplePixelClusterFinder.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 17 of file PndMvdSimplePixelClusterFinder.h.

Constructor & Destructor Documentation

PndMvdSimplePixelClusterFinder::PndMvdSimplePixelClusterFinder ( TString  parName = "MVDPixelDigiPar",
TString  totParName = "MVDPixelTotDigiPar",
Int_t  verbose = 0 
)

Definition at line 7 of file PndMvdSimplePixelClusterFinder.cxx.

References fDigiPar, fParName, fTotDigiPar, fTotParName, PndSdsPixelClusterFinder::fVerbose, rtdb, SetParameters(), and verbose.

8 fParName(parName),
9 fTotParName(totParName),
10 fDigiPar(NULL),
11 fTotDigiPar(NULL)
12 {
13  fVerbose = verbose;
14  FairRun* ana = FairRun::Instance();
15  FairRuntimeDb* rtdb=ana->GetRuntimeDb();
16  fDigiPar = (PndSdsPixelDigiPar*)(rtdb->getContainer(fParName.Data()));
17  fTotDigiPar = (PndSdsTotDigiPar*)(rtdb->getContainer(fTotParName.Data()));
18  SetParameters();
19 };
#define verbose
Charge Digitization Parameter Class for SDS.
FairRuntimeDb * rtdb
Definition: hit_dirc.C:66
Digitization Parameter Class for SDS-Pixel part.
PndMvdSimplePixelClusterFinder::PndMvdSimplePixelClusterFinder ( PndSdsPixelDigiPar digiPar,
PndSdsTotDigiPar totPar 
)
PndMvdSimplePixelClusterFinder::PndMvdSimplePixelClusterFinder ( const PndMvdSimplePixelClusterFinder )
delete

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
PndMvdSimplePixelClusterFinder& PndMvdSimplePixelClusterFinder::operator= ( const PndMvdSimplePixelClusterFinder )
delete
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
void PndMvdSimplePixelClusterFinder::SetParameters ( )
protected

Definition at line 30 of file PndMvdSimplePixelClusterFinder.cxx.

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

Referenced by PndMvdSimplePixelClusterFinder().

31 {
32  if (fDigiPar->GetChargeConvMethod() == 0)
33  {
34  if (fVerbose > 0) std::cout << "Info in <PndMvdSimplePixelClusterFinder>: ideal charge conversion" << std::endl;
36  } else if (fDigiPar->GetChargeConvMethod() == 1)
37  {
38  if (fVerbose > 0) std::cout << "Info in <PndMvdSimplePixelClusterFinder>: TOT charge conversion" << std::endl;
41  } else
42  {
43  std::cout
44  << "Error in <PndMvdSimplePixelClusterFinder>: charge conversion method not defined, use ideal converter..."
45  << std::endl;
47  }
51 
52  if (fVerbose > 1)
53  std::cout << "PndMvdSimplePixelClusterFinder::SetParameters() Cols/Rows " << fcols << "/" << frows << " Radius: " << fradius << std::endl;
54 }
Double_t GetClustRadius() const
Int_t GetChargeConvMethod() const
Double_t GetConstCurrent() const
Double_t GetNoise() const
Double_t GetClockFrequency() const
PndSdsChargeConversion * fChargeConverter
Int_t GetFERows() const
Int_t GetFECols() const
Double_t GetChargingTime() const
Double_t GetThreshold() const
void PndMvdSimplePixelClusterFinder::SetParName ( TString  val)
inline

Definition at line 24 of file PndMvdSimplePixelClusterFinder.h.

References fParName, and val.

24 {fParName = val;}
Double_t val[nBoxes][nFEBox]
Definition: createCalib.C:11
virtual void PndSdsSimplePixelClusterFinder::SetRadius ( Double_t  rad)
inlinevirtualinherited
void PndMvdSimplePixelClusterFinder::SetTotParName ( TString  val)
inline

Definition at line 25 of file PndMvdSimplePixelClusterFinder.h.

References fTotParName, and val.

25 {fTotParName = val;}
Double_t val[nBoxes][nFEBox]
Definition: createCalib.C:11
void PndSdsPixelClusterFinder::SetVerbose ( Int_t  level)
inlineinherited

Member Data Documentation

PndSdsChargeConversion* PndSdsPixelClusterFinder::fChargeConverter
inherited
Int_t PndSdsSimplePixelClusterFinder::fcols
protectedinherited
PndSdsPixelDigiPar* PndMvdSimplePixelClusterFinder::fDigiPar
private
std::vector<PndSdsDigiPixel> PndSdsPixelClusterFinder::fHits
inherited
TString PndMvdSimplePixelClusterFinder::fParName
private

Definition at line 30 of file PndMvdSimplePixelClusterFinder.h.

Referenced by PndMvdSimplePixelClusterFinder(), and SetParName().

Double_t PndSdsSimplePixelClusterFinder::fradius
protectedinherited
Int_t PndSdsSimplePixelClusterFinder::frows
protectedinherited
PndSdsTotDigiPar* PndMvdSimplePixelClusterFinder::fTotDigiPar
private
TString PndMvdSimplePixelClusterFinder::fTotParName
private
Int_t PndSdsPixelClusterFinder::fVerbose
inherited

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