PandaRoot
PndFtsHoughTrackerTask Class Reference

Interface between PandaRoot (data input and output) and PndFtsHoughTrackFinder (implementation of PR algorithm). More...

#include <PndFtsHoughTrackerTask.h>

Inheritance diagram for PndFtsHoughTrackerTask:
PndPersistencyTask PndFtsHoughTrackerTaskQA

Public Types

enum  DebugLevelMultiplicators {
  kHoughSpaces = 2, kAllFoundPeaksTogether = 3, kEachFoundPeakSeparately = 5, kMcTruthPeaksExclusively = 7,
  kMcTruthPeaksProjected = 11, kHitCurvesExclusively = 13, kHitCurvesProjected = 17
}
 

Public Member Functions

 PndFtsHoughTrackerTask (Int_t verbose=0, Bool_t persistence=kTRUE)
 Constructor with flags. Can also be used as standard constructor. More...
 
 ~PndFtsHoughTrackerTask ()
 Destructor. More...
 
virtual void SetParContainers ()
 Loads the parameter container from the runtime database. More...
 
virtual InitStatus Init ()
 Initialization of task at the beginning of a run. More...
 
virtual InitStatus ReInit ()
 ReInitiliazation of task when the runID changes. More...
 
virtual void Exec (Option_t *opt)
 Executed for each event. More...
 
virtual void FinishEvent ()
 When is this executed? After each event? More...
 
virtual void Finish ()
 Writes output to root file, I guess. Called at the end of the run. More...
 
void SetVerbose (Int_t verbose)
 
void SetPersistence (Bool_t val)
 
void SetSaveDebugInfo (Int_t saveDebugInfo)
 
Int_t GetVerbose () const
 
Int_t GetSaveDebugInfo () const
 Returns the verbosity level. More...
 
UInt_t GetEventNr () const
 Returns the save debug flag. More...
 
Int_t GetNFtsHits () const
 Returns the event number. More...
 
const PndFtsHitGetFtsHit (UInt_t hitId) const
 Returns pointer to the hit with index hitId in the FTS hit array. More...
 
Int_t getMcTruthIdForHitId (UInt_t hitId) const
 
const PndFtsTubeGetFtsTube (const PndFtsHit *const myHit) const
 Returns pointer to the FTS tube corresponding to input FTS hit. More...
 
const TVector3 GetFtsHitPosErrors (const PndFtsHit *const ftsHit) const
 Returns the position error (based on FTS straw geometry) for the hit with index hitId in the FTS hit array. More...
 
const TMatrixT< Double_t > GetFtsHitCovMatrix (const PndFtsHit *const ftsHit) const
 Returns the position covariance matrix (based on FTS straw geometry) for the hit with index hitId in the FTS hit array. More...
 
Int_t getFtsBranchId () const
 Returns detector Id of FTS. Try not to use it. More...
 
TClonesArray * getFtsHitArrayPtr () const
 Returns pointer to the hit array in which FTS hits are saved as PndFtsHit. Try not to use it. More...
 
FairField * getMagneticFieldPtr () const
 
- Public Member Functions inherited from PndPersistencyTask
 PndPersistencyTask ()
 
 PndPersistencyTask (const char *name, Int_t iVerbose=1)
 
virtual ~PndPersistencyTask ()
 
void SetPersistency (Bool_t val=kTRUE)
 
Bool_t GetPersistency ()
 

Public Attributes

FairLogger * fLogger
 Returns pointer to the B field. More...
 

Protected Member Functions

void throwError (const TString s) const
 For error reporting. More...
 
void CheckForDuplicateFtsHits ()
 
 PndFtsHoughTrackerTask (const PndFtsHoughTrackerTask &)
 
PndFtsHoughTrackerTask operator= (const PndFtsHoughTrackerTask &)
 
 ClassDef (PndFtsHoughTrackerTask, 1)
 

Protected Attributes

Int_t fFtsBranchId
 Detector Id of FTS. More...
 
TClonesArray * fFtsHitArray
 Input array of PndFtsHit. More...
 
TClonesArray * fFtsMcPoints
 Input array of McPoints. More...
 
PndGeoFtsParfFtsParameters
 Needed for FTS map creator. More...
 
TClonesArray * fFtsTubeArray
 Input array of PndFtsTube (map of FTS tubes). More...
 
FairField * fField
 For B field access. More...
 
TString fTracksArrayName
 Branch name where to store the Track candidates. More...
 
TClonesArray * fTrackCands
 Array of found track candidates in PndTrackCand (for output) More...
 
TClonesArray * fTracks
 Array of found tracks in PndTrack (for output) More...
 
Int_t fSaveDebugInfo
 Debug information will be created if >0. More...
 
UInt_t fEventNr
 Event number for debugging purposes. More...
 

Detailed Description

Interface between PandaRoot (data input and output) and PndFtsHoughTrackFinder (implementation of PR algorithm).

Author
Martin J. Galuska <martin [dot] j [dot] galuska (at) physik [dot] uni (minus) giessen [dot] de>

This task provides functionality / data for the FTS PR classes by passing a pointer to itself as an argument in the object's constructor.

This class was originally modeled after mvd/MvdTracking/PndMvdRiemannTrackFinderTask (among many others)

TODO Make this task work for time-based simulation as well [have a look at PndMvdRiemannTrackFinderTask::FillHitArray()]

Created: 18.06.2013

Definition at line 45 of file PndFtsHoughTrackerTask.h.

Member Enumeration Documentation

◆ DebugLevelMultiplicators

Constructor & Destructor Documentation

◆ PndFtsHoughTrackerTask() [1/2]

PndFtsHoughTrackerTask::PndFtsHoughTrackerTask ( Int_t  verbose = 0,
Bool_t  persistence = kTRUE 
)

Constructor with flags. Can also be used as standard constructor.

Parameters
[in]verboseVerbosity level: 0 least, higher -> more output.
[in]persistencekFALSE does not write track candidates from PR to output root file.
[in]saveDebugInfokTRUE will write internal representation of track(let) candidates to output root file.

Referenced by CheckForDuplicateFtsHits().

◆ ~PndFtsHoughTrackerTask()

PndFtsHoughTrackerTask::~PndFtsHoughTrackerTask ( )

Destructor.

◆ PndFtsHoughTrackerTask() [2/2]

PndFtsHoughTrackerTask::PndFtsHoughTrackerTask ( const PndFtsHoughTrackerTask )
protected

Member Function Documentation

◆ CheckForDuplicateFtsHits()

void PndFtsHoughTrackerTask::CheckForDuplicateFtsHits ( )
inlineprotected

Definition at line 228 of file PndFtsHoughTrackerTask.h.

References ClassDef(), GetEventNr(), GetFtsHit(), GetNFtsHits(), PndFtsHit::GetTubeID(), operator=(), and PndFtsHoughTrackerTask().

229  {
230  for (int iHit1 = 0; iHit1 < GetNFtsHits(); ++iHit1) {
231  const PndFtsHit *const myHit1 = GetFtsHit(iHit1);
232 
233  const Int_t tubeIdHit1 = myHit1->GetTubeID();
234 
235  for (int iHit2 = iHit1 + 1; iHit2 < GetNFtsHits(); ++iHit2) {
236  const PndFtsHit *const myHit2 = GetFtsHit(iHit2);
237 
238  const Int_t tubeIdHit2 = myHit2->GetTubeID();
239 
240  if (tubeIdHit1 == tubeIdHit2)
241  std::cout << "Event " << GetEventNr() << "tubeID1=" << tubeIdHit1 << " tubeID2=" << tubeIdHit2 << ": HitIdx " << iHit1 << " and HitIdx " << iHit2 << " are duplicate!\n";
242  }
243 
244  } // for loop over all hits
245  };
Int_t GetTubeID() const
Definition: PndFtsHit.h:69
const PndFtsHit * GetFtsHit(UInt_t hitId) const
Returns pointer to the hit with index hitId in the FTS hit array.
UInt_t GetEventNr() const
Returns the save debug flag.
Int_t GetNFtsHits() const
Returns the event number.

◆ ClassDef()

PndFtsHoughTrackerTask::ClassDef ( PndFtsHoughTrackerTask  ,
 
)
protected

◆ Exec()

virtual void PndFtsHoughTrackerTask::Exec ( Option_t *  opt)
virtual

Executed for each event.

Parameters
optNot used.

Reimplemented in PndFtsHoughTrackerTaskQA.

◆ Finish()

virtual void PndFtsHoughTrackerTask::Finish ( )
virtual

Writes output to root file, I guess. Called at the end of the run.

Reimplemented in PndFtsHoughTrackerTaskQA.

◆ FinishEvent()

virtual void PndFtsHoughTrackerTask::FinishEvent ( )
virtual

When is this executed? After each event?

Reimplemented in PndFtsHoughTrackerTaskQA.

◆ GetEventNr()

UInt_t PndFtsHoughTrackerTask::GetEventNr ( ) const
inline

Returns the save debug flag.

Definition at line 96 of file PndFtsHoughTrackerTask.h.

References fEventNr.

Referenced by CheckForDuplicateFtsHits(), and PndFtsHoughSpace::Print().

96 { return fEventNr; };
UInt_t fEventNr
Event number for debugging purposes.

◆ getFtsBranchId()

Int_t PndFtsHoughTrackerTask::getFtsBranchId ( ) const
inline

Returns detector Id of FTS. Try not to use it.

See also
GetFtsHit
GetNHits
Returns
Detector Id of FTS.

Definition at line 159 of file PndFtsHoughTrackerTask.h.

References fFtsBranchId.

159 { return fFtsBranchId; };
Int_t fFtsBranchId
Detector Id of FTS.

◆ GetFtsHit()

const PndFtsHit* PndFtsHoughTrackerTask::GetFtsHit ( UInt_t  hitId) const
inline

Returns pointer to the hit with index hitId in the FTS hit array.

Parameters
[in]hitIdIndex (in FTS hit array) of the hit which should be returned.
Returns
Pointer to hit with index hitId in FTS hit array.

Definition at line 109 of file PndFtsHoughTrackerTask.h.

References fFtsHitArray, GetNFtsHits(), and throwError().

Referenced by CheckForDuplicateFtsHits(), getMcTruthIdForHitId(), and PndFtsHoughSpace::Print().

110  {
111  if (hitId >= (UInt_t)GetNFtsHits())
112  throwError("GetFtsHit: hitId is too large.");
113  // TClonesArray *ftsHitArray= (TClonesArray *)FairRootManager::Instance()->GetObject("FTSHit");
114  const PndFtsHit *myHit = (PndFtsHit *)fFtsHitArray->At(hitId);
115  if (0 == myHit)
116  throwError("GetFtsHit was not able to get the hit.");
117  return myHit;
118  };
TClonesArray * fFtsHitArray
Input array of PndFtsHit.
void throwError(const TString s) const
For error reporting.
Int_t GetNFtsHits() const
Returns the event number.

◆ getFtsHitArrayPtr()

TClonesArray* PndFtsHoughTrackerTask::getFtsHitArrayPtr ( ) const
inline

Returns pointer to the hit array in which FTS hits are saved as PndFtsHit. Try not to use it.

See also
GetFtsHit
GetNHits
Returns
Pointer to the hit array in which hits are saved as PndFtsHit.

Definition at line 166 of file PndFtsHoughTrackerTask.h.

References fFtsHitArray.

166 { return fFtsHitArray; };
TClonesArray * fFtsHitArray
Input array of PndFtsHit.

◆ GetFtsHitCovMatrix()

const TMatrixT<Double_t> PndFtsHoughTrackerTask::GetFtsHitCovMatrix ( const PndFtsHit *const  ftsHit) const

Returns the position covariance matrix (based on FTS straw geometry) for the hit with index hitId in the FTS hit array.

Parameters
[in]ftsHitpointer to hit for which the error should be returned.
Returns
Error in cm.

Referenced by GetFtsTube().

◆ GetFtsHitPosErrors()

const TVector3 PndFtsHoughTrackerTask::GetFtsHitPosErrors ( const PndFtsHit *const  ftsHit) const

Returns the position error (based on FTS straw geometry) for the hit with index hitId in the FTS hit array.

Parameters
[in]pointerto hit for which the error should be returned.
Returns
Error in cm.

Referenced by GetFtsTube().

◆ GetFtsTube()

const PndFtsTube* PndFtsHoughTrackerTask::GetFtsTube ( const PndFtsHit *const  myHit) const
inline

Returns pointer to the FTS tube corresponding to input FTS hit.

Parameters
[in]myHitFTS hit for which the tube should be returned.
Returns
Pointer to tube corresponding to myHit.

Definition at line 137 of file PndFtsHoughTrackerTask.h.

References fFtsTubeArray, GetFtsHitCovMatrix(), GetFtsHitPosErrors(), and PndFtsHit::GetTubeID().

Referenced by PndFtsHoughSpace::Print().

138  {
139  Int_t tubeID = myHit->GetTubeID();
140  const PndFtsTube *tube = (PndFtsTube *)fFtsTubeArray->At(tubeID);
141  return tube;
142  }
Int_t GetTubeID() const
Definition: PndFtsHit.h:69
TClonesArray * fFtsTubeArray
Input array of PndFtsTube (map of FTS tubes).

◆ getMagneticFieldPtr()

FairField* PndFtsHoughTrackerTask::getMagneticFieldPtr ( ) const
inline

Definition at line 171 of file PndFtsHoughTrackerTask.h.

References fField, and fLogger.

171 { return fField; };
FairField * fField
For B field access.

◆ getMcTruthIdForHitId()

Int_t PndFtsHoughTrackerTask::getMcTruthIdForHitId ( UInt_t  hitId) const
inline

Definition at line 119 of file PndFtsHoughTrackerTask.h.

References fFtsMcPoints, GetFtsHit(), and throwError().

120  {
121  const PndFtsHit *const ftsHit = GetFtsHit(hitId);
122  Int_t mcPointId = ftsHit->GetRefIndex();
123  if (0 > mcPointId)
124  throwError("getMcTruthIdForHitId: negative mcPointId.");
125  FairMCPoint *myPoint = (FairMCPoint *)(fFtsMcPoints->At(mcPointId));
126  if (0 == myPoint)
127  throwError("getMcTruthIdForHitId: Could not get point belonging to hit.");
128  Int_t mcTrackId = myPoint->GetTrackID();
129  if (mcTrackId < 0)
130  throwError("getMcTruthIdForHitId: negative mcTrackId.");
131  return mcTrackId;
132  }
const PndFtsHit * GetFtsHit(UInt_t hitId) const
Returns pointer to the hit with index hitId in the FTS hit array.
TClonesArray * fFtsMcPoints
Input array of McPoints.
void throwError(const TString s) const
For error reporting.

◆ GetNFtsHits()

Int_t PndFtsHoughTrackerTask::GetNFtsHits ( ) const
inline

Returns the event number.

Returns the number of FTS hits.

Returns
Number of FTS hits.

Definition at line 104 of file PndFtsHoughTrackerTask.h.

References fFtsHitArray.

Referenced by CheckForDuplicateFtsHits(), and GetFtsHit().

104 { return fFtsHitArray->GetEntriesFast(); };
TClonesArray * fFtsHitArray
Input array of PndFtsHit.

◆ GetSaveDebugInfo()

Int_t PndFtsHoughTrackerTask::GetSaveDebugInfo ( ) const
inline

Returns the verbosity level.

Definition at line 95 of file PndFtsHoughTrackerTask.h.

References fSaveDebugInfo.

95 { return fSaveDebugInfo; };
Int_t fSaveDebugInfo
Debug information will be created if >0.

◆ GetVerbose()

Int_t PndFtsHoughTrackerTask::GetVerbose ( ) const
inline

Definition at line 94 of file PndFtsHoughTrackerTask.h.

94 { return fVerbose; };

◆ Init()

virtual InitStatus PndFtsHoughTrackerTask::Init ( )
virtual

Initialization of task at the beginning of a run.

Reimplemented in PndFtsHoughTrackerTaskQA.

◆ operator=()

PndFtsHoughTrackerTask PndFtsHoughTrackerTask::operator= ( const PndFtsHoughTrackerTask )
protected

◆ ReInit()

virtual InitStatus PndFtsHoughTrackerTask::ReInit ( )
virtual

ReInitiliazation of task when the runID changes.

Reimplemented in PndFtsHoughTrackerTaskQA.

◆ SetParContainers()

virtual void PndFtsHoughTrackerTask::SetParContainers ( )
virtual

Loads the parameter container from the runtime database.

◆ SetPersistence()

void PndFtsHoughTrackerTask::SetPersistence ( Bool_t  val)
inline

Definition at line 87 of file PndFtsHoughTrackerTask.h.

References PndPersistencyTask::SetPersistency().

87 { SetPersistency(val); };
void SetPersistency(Bool_t val=kTRUE)

◆ SetSaveDebugInfo()

void PndFtsHoughTrackerTask::SetSaveDebugInfo ( Int_t  saveDebugInfo)
inline

Definition at line 88 of file PndFtsHoughTrackerTask.h.

References fSaveDebugInfo.

88 { fSaveDebugInfo = saveDebugInfo; };
Int_t fSaveDebugInfo
Debug information will be created if >0.

◆ SetVerbose()

void PndFtsHoughTrackerTask::SetVerbose ( Int_t  verbose)
inline

Definition at line 86 of file PndFtsHoughTrackerTask.h.

86 { fVerbose = verbose; };

◆ throwError()

void PndFtsHoughTrackerTask::throwError ( const TString  s) const
inlineprotected

For error reporting.

Definition at line 226 of file PndFtsHoughTrackerTask.h.

Referenced by GetFtsHit(), and getMcTruthIdForHitId().

226 { throw std::runtime_error(s.Data()); };

Member Data Documentation

◆ fEventNr

UInt_t PndFtsHoughTrackerTask::fEventNr
protected

Event number for debugging purposes.

Definition at line 224 of file PndFtsHoughTrackerTask.h.

Referenced by GetEventNr().

◆ fField

FairField* PndFtsHoughTrackerTask::fField
protected

For B field access.

Definition at line 204 of file PndFtsHoughTrackerTask.h.

Referenced by getMagneticFieldPtr().

◆ fFtsBranchId

Int_t PndFtsHoughTrackerTask::fFtsBranchId
protected

Detector Id of FTS.

Definition at line 188 of file PndFtsHoughTrackerTask.h.

Referenced by getFtsBranchId().

◆ fFtsHitArray

TClonesArray* PndFtsHoughTrackerTask::fFtsHitArray
protected

Input array of PndFtsHit.

Definition at line 189 of file PndFtsHoughTrackerTask.h.

Referenced by GetFtsHit(), getFtsHitArrayPtr(), and GetNFtsHits().

◆ fFtsMcPoints

TClonesArray* PndFtsHoughTrackerTask::fFtsMcPoints
protected

Input array of McPoints.

Definition at line 190 of file PndFtsHoughTrackerTask.h.

Referenced by getMcTruthIdForHitId().

◆ fFtsParameters

PndGeoFtsPar* PndFtsHoughTrackerTask::fFtsParameters
protected

Needed for FTS map creator.

I don't really know what that does...

Definition at line 196 of file PndFtsHoughTrackerTask.h.

◆ fFtsTubeArray

TClonesArray* PndFtsHoughTrackerTask::fFtsTubeArray
protected

Input array of PndFtsTube (map of FTS tubes).

Is filled by map creator

Definition at line 201 of file PndFtsHoughTrackerTask.h.

Referenced by GetFtsTube().

◆ fLogger

FairLogger* PndFtsHoughTrackerTask::fLogger

Returns pointer to the B field.

For output handling.

Definition at line 171 of file PndFtsHoughTrackerTask.h.

Referenced by getMagneticFieldPtr().

◆ fSaveDebugInfo

Int_t PndFtsHoughTrackerTask::fSaveDebugInfo
protected

Debug information will be created if >0.

Definition at line 223 of file PndFtsHoughTrackerTask.h.

Referenced by GetSaveDebugInfo(), and SetSaveDebugInfo().

◆ fTrackCands

TClonesArray* PndFtsHoughTrackerTask::fTrackCands
protected

Array of found track candidates in PndTrackCand (for output)

Definition at line 210 of file PndFtsHoughTrackerTask.h.

◆ fTracks

TClonesArray* PndFtsHoughTrackerTask::fTracks
protected

Array of found tracks in PndTrack (for output)

Definition at line 211 of file PndFtsHoughTrackerTask.h.

◆ fTracksArrayName

TString PndFtsHoughTrackerTask::fTracksArrayName
protected

Branch name where to store the Track candidates.

Definition at line 209 of file PndFtsHoughTrackerTask.h.


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