CbmRoot
Loading...
Searching...
No Matches
CbmTrdSetTracksPidLike Class Reference

#include <CbmTrdSetTracksPidLike.h>

Inheritance diagram for CbmTrdSetTracksPidLike:
[legend]
Collaboration diagram for CbmTrdSetTracksPidLike:
[legend]

Public Member Functions

 CbmTrdSetTracksPidLike ()
 
 CbmTrdSetTracksPidLike (const char *name, const char *title="FairTask")
 
virtual ~CbmTrdSetTracksPidLike ()
 
virtual InitStatus Init ()
 
virtual void Exec (Option_t *opt)
 
virtual void Finish ()
 
virtual void SetParContainers ()
 
Int_t GetNofTracks () const
 
void SetInputFileName (const char *file)
 
void SetUseMCInfo (Bool_t use=kTRUE)
 
void SetUseMomDependence (Bool_t use=kTRUE)
 

Private Types

enum  EParticleType {
  kElectron = 0 , kPion = 1 , kKaon = 2 , kProton = 3 ,
  kMuon = 4
}
 

Private Member Functions

CbmTrdSetTracksPidLikeoperator= (const CbmTrdSetTracksPidLike &)
 
 CbmTrdSetTracksPidLike (const CbmTrdSetTracksPidLike &)
 
Bool_t ReadData ()
 
Double_t GetProbability (Int_t iType, Double_t mom, Double_t dedx) const
 
 ClassDef (CbmTrdSetTracksPidLike, 2)
 

Private Attributes

TString fFileName = ""
 
Bool_t fMCinput = kFALSE
 
Bool_t fMomDep = kTRUE
 
TClonesArray * fTrackArray = nullptr
 
TClonesArray * fTrdHitArray = nullptr
 
TClonesArray * fglobalTrackArray = nullptr
 
TObjArray * fHistdEdx = nullptr
 
Int_t fNofTracks = 0
 
CbmTrdParSetGasfGasPar = nullptr
 

Static Private Attributes

static const Int_t fgkNParts = 5
 

Detailed Description

Definition at line 35 of file CbmTrdSetTracksPidLike.h.

Member Enumeration Documentation

◆ EParticleType

Enumerator
kElectron 
kPion 
kKaon 
kProton 
kMuon 

Definition at line 94 of file CbmTrdSetTracksPidLike.h.

Constructor & Destructor Documentation

◆ CbmTrdSetTracksPidLike() [1/3]

CbmTrdSetTracksPidLike::CbmTrdSetTracksPidLike ( )

Default constructor

Definition at line 34 of file CbmTrdSetTracksPidLike.cxx.

◆ CbmTrdSetTracksPidLike() [2/3]

CbmTrdSetTracksPidLike::CbmTrdSetTracksPidLike ( const char * name,
const char * title = "FairTask" )

Standard constructor

Parameters
nameName of class
titleTask title

Definition at line 39 of file CbmTrdSetTracksPidLike.cxx.

◆ ~CbmTrdSetTracksPidLike()

CbmTrdSetTracksPidLike::~CbmTrdSetTracksPidLike ( )
virtual

Destructor

Definition at line 44 of file CbmTrdSetTracksPidLike.cxx.

◆ CbmTrdSetTracksPidLike() [3/3]

CbmTrdSetTracksPidLike::CbmTrdSetTracksPidLike ( const CbmTrdSetTracksPidLike & )
private

Member Function Documentation

◆ ClassDef()

CbmTrdSetTracksPidLike::ClassDef ( CbmTrdSetTracksPidLike ,
2  )
private

◆ Exec()

void CbmTrdSetTracksPidLike::Exec ( Option_t * opt)
virtual

Task execution

loop over global tracks

get trd track

only trd tracks with mimimum 1 reconstructed point

Get the momentum from the first trd station

loop over all hits

calculate denominator for reasonable probabilities

normalize to 1

fill track values

Definition at line 285 of file CbmTrdSetTracksPidLike.cxx.

References fgkNParts, fglobalTrackArray, fNofTracks, fTrackArray, fTrdHitArray, CbmTrdHit::GetELoss(), CbmTrack::GetHitIndex(), CbmTrack::GetNofHits(), CbmTrack::GetParamFirst(), CbmTrack::GetParamLast(), GetProbability(), CbmGlobalTrack::GetTrdTrackIndex(), kElectron, kKaon, kMuon, kPion, kProton, CbmTrdTrack::SetELoss(), CbmTrdTrack::SetPidLikeEL(), CbmTrdTrack::SetPidLikeKA(), CbmTrdTrack::SetPidLikeMU(), CbmTrdTrack::SetPidLikePI(), and CbmTrdTrack::SetPidLikePR().

◆ Finish()

void CbmTrdSetTracksPidLike::Finish ( )
virtual

Finish at the end of each event

Definition at line 453 of file CbmTrdSetTracksPidLike.cxx.

◆ GetNofTracks()

Int_t CbmTrdSetTracksPidLike::GetNofTracks ( ) const
inline

Accessors

Definition at line 70 of file CbmTrdSetTracksPidLike.h.

References fNofTracks.

◆ GetProbability()

Double_t CbmTrdSetTracksPidLike::GetProbability ( Int_t iType,
Double_t mom,
Double_t dedx ) const
private

Calculate probability for particle (with momentum) and dEdx

check for undefined dedx (dedx = -1. is sometimes passed in)

useless protection

histogram has TRD momentum at inner point vs. dedx sinal [keV]

check for entries/ non-empty histograms

check for overlow

use bin width of last bin (correct in case of logarithmic, arbitrary binnning)

find bin depending on overflow in X,Y

interpolate empty bins or overflow bins

Definition at line 386 of file CbmTrdSetTracksPidLike.cxx.

References fgkNParts, and fHistdEdx.

Referenced by Exec().

◆ Init()

InitStatus CbmTrdSetTracksPidLike::Init ( )
virtual

Initialisation at beginning of each event

input array

Definition at line 237 of file CbmTrdSetTracksPidLike.cxx.

References Error, fgkNParts, fglobalTrackArray, fHistdEdx, fTrackArray, fTrdHitArray, and ReadData().

◆ operator=()

CbmTrdSetTracksPidLike & CbmTrdSetTracksPidLike::operator= ( const CbmTrdSetTracksPidLike & )
private

◆ ReadData()

Bool_t CbmTrdSetTracksPidLike::ReadData ( )
private

Read the histograms from file

Save old global file and folder pointer to avoid messing with FairRoot

mc pid method

data driven method

Restore old global file and folder pointer to avoid messing with FairRoot

clean up

Definition at line 56 of file CbmTrdSetTracksPidLike.cxx.

References fFileName, fGasPar, fHistdEdx, fMCinput, fMomDep, kElectron, kKaon, kMuon, kPion, kProton, CbmTrdParSetGas::putParams(), x, and y.

Referenced by Init().

◆ SetInputFileName()

void CbmTrdSetTracksPidLike::SetInputFileName ( const char * file)
inline

Setters

Definition at line 73 of file CbmTrdSetTracksPidLike.h.

References fFileName.

◆ SetParContainers()

void CbmTrdSetTracksPidLike::SetParContainers ( )
virtual

SetParContainers

Definition at line 48 of file CbmTrdSetTracksPidLike.cxx.

References fGasPar.

◆ SetUseMCInfo()

void CbmTrdSetTracksPidLike::SetUseMCInfo ( Bool_t use = kTRUE)
inline

◆ SetUseMomDependence()

void CbmTrdSetTracksPidLike::SetUseMomDependence ( Bool_t use = kTRUE)
inline

Member Data Documentation

◆ fFileName

TString CbmTrdSetTracksPidLike::fFileName = ""
private

Definition at line 81 of file CbmTrdSetTracksPidLike.h.

Referenced by ReadData(), and SetInputFileName().

◆ fGasPar

CbmTrdParSetGas* CbmTrdSetTracksPidLike::fGasPar = nullptr
private

Definition at line 91 of file CbmTrdSetTracksPidLike.h.

Referenced by ReadData(), and SetParContainers().

◆ fgkNParts

const Int_t CbmTrdSetTracksPidLike::fgkNParts = 5
staticprivate

Definition at line 93 of file CbmTrdSetTracksPidLike.h.

Referenced by Exec(), GetProbability(), and Init().

◆ fglobalTrackArray

TClonesArray* CbmTrdSetTracksPidLike::fglobalTrackArray = nullptr
private

Input array of TRD Hits

Definition at line 86 of file CbmTrdSetTracksPidLike.h.

Referenced by Exec(), and Init().

◆ fHistdEdx

TObjArray* CbmTrdSetTracksPidLike::fHistdEdx = nullptr
private

Input array of global tracks

Definition at line 88 of file CbmTrdSetTracksPidLike.h.

Referenced by GetProbability(), Init(), and ReadData().

◆ fMCinput

Bool_t CbmTrdSetTracksPidLike::fMCinput = kFALSE
private

Definition at line 82 of file CbmTrdSetTracksPidLike.h.

Referenced by ReadData(), and SetUseMCInfo().

◆ fMomDep

Bool_t CbmTrdSetTracksPidLike::fMomDep = kTRUE
private

Definition at line 83 of file CbmTrdSetTracksPidLike.h.

Referenced by ReadData(), and SetUseMomDependence().

◆ fNofTracks

Int_t CbmTrdSetTracksPidLike::fNofTracks = 0
private

Definition at line 89 of file CbmTrdSetTracksPidLike.h.

Referenced by Exec(), and GetNofTracks().

◆ fTrackArray

TClonesArray* CbmTrdSetTracksPidLike::fTrackArray = nullptr
private

Definition at line 84 of file CbmTrdSetTracksPidLike.h.

Referenced by Exec(), and Init().

◆ fTrdHitArray

TClonesArray* CbmTrdSetTracksPidLike::fTrdHitArray = nullptr
private

Input array of TRD tracks

Definition at line 85 of file CbmTrdSetTracksPidLike.h.

Referenced by Exec(), and Init().


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