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

#include <CbmTrdElectronsTrainAnn.h>

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

Public Member Functions

 CbmTrdElectronsTrainAnn (int nofTrdLayers)
 Default constructor.
 
virtual ~CbmTrdElectronsTrainAnn ()
 Destructor.
 
virtual InitStatus Init ()
 Inherited from FairTask.
 
virtual void Exec (Option_t *opt)
 Inherited from FairTask.
 
virtual void Finish ()
 Inherited from FairTask.
 
void Draw (Option_t *="")
 Draw results.
 
void SetIsDoTrain (Bool_t doTrain)
 
void SetTransformType (Int_t type)
 
void SetIdMethod (IdMethod idMethod)
 
void SetOutputDir (const std::string &outputDir)
 
void SetNofAnnEpochs (Int_t nofAnnEpochs)
 
void SetNofTrainSamples (Int_t nofTr)
 
void SetSigmaError (Double_t sigma)
 
void SetBeamDataFile (std::string beamDataFile)
 
void SetBeamDataPiHist (std::string beamDataPiHist)
 
void SetBeamDataElHist (std::string beamDataElHist)
 
void RunBeamData ()
 

Private Member Functions

void FillElossVectorSim ()
 Fill vector with energy loss information for simulated data.
 
void FillElossVectorReal ()
 Fill vector with energy loss information simulated from real data spectra.
 
void FillElossHist ()
 Fill histograms with energy loss information.
 
void SortElossAndFillHist ()
 Sort energy losses and fill histograms.
 
void Run ()
 
void DoTrain ()
 
void DoTest ()
 
void DoPreTest ()
 
TTree * CreateTree ()
 
std::string CreateAnnString ()
 
TMVA::Factory * CreateFactory (TTree *simu)
 
TMVA::Reader * CreateTmvaReader ()
 
void Transform ()
 
void Transform1 ()
 
void Transform2 ()
 
Double_t FindOptimalCut ()
 
void CreateCumProbOutputHist ()
 
TGraph * CreateRocDiagramm ()
 
Double_t Likelihood ()
 
Double_t Median ()
 
Double_t MeanCut ()
 
Double_t Eval (Bool_t isEl)
 
void FillAnnInputHist (Bool_t isEl)
 
 CbmTrdElectronsTrainAnn (const CbmTrdElectronsTrainAnn &)
 
CbmTrdElectronsTrainAnnoperator= (const CbmTrdElectronsTrainAnn &)
 
 ClassDef (CbmTrdElectronsTrainAnn, 1)
 

Private Attributes

TClonesArray * fMCTracks
 
TClonesArray * fTrdPoints
 
TClonesArray * fTrdTracks
 
TClonesArray * fTrdTrackMatches
 
TClonesArray * fTrdHits
 
std::vector< std::vector< std::vector< TrdEloss > > > fEloss
 
std::vector< TH1 * > fHists
 
TH1 * fhResults
 
std::vector< TH1 * > fhMeanEloss
 
std::vector< TH1 * > fhEloss
 
std::vector< std::vector< TH1 * > > fhElossSort
 
Int_t fEventNum
 
std::string fOutputDir
 
Double_t fSigmaError
 
Bool_t fIsDoTrain
 
Int_t fTransformType
 
std::string fBeamDataFile
 
std::string fBeamDataPiHist
 
std::string fBeamDataElHist
 
std::vector< Float_t > fAnnInput
 
Float_t fXOut
 
Int_t fNofTrdLayers
 
Double_t fMaxEval
 
Double_t fMinEval
 
TMultiLayerPerceptron * fNN
 
TMVA::Reader * fReader
 
IdMethod fIdMethod
 
Int_t fNofAnnEpochs
 
Int_t fNofTrainSamples
 
double fElIdEfficiency
 
std::vector< TH1 * > fhOutput
 
std::vector< TH1 * > fhCumProbOutput
 
std::vector< std::vector< TH1 * > > fhInput
 

Detailed Description

Definition at line 56 of file CbmTrdElectronsTrainAnn.h.

Constructor & Destructor Documentation

◆ CbmTrdElectronsTrainAnn() [1/2]

CbmTrdElectronsTrainAnn::CbmTrdElectronsTrainAnn ( int nofTrdLayers)

Default constructor.

◆ ~CbmTrdElectronsTrainAnn()

CbmTrdElectronsTrainAnn::~CbmTrdElectronsTrainAnn ( )
virtual

Destructor.

Definition at line 130 of file CbmTrdElectronsTrainAnn.cxx.

◆ CbmTrdElectronsTrainAnn() [2/2]

CbmTrdElectronsTrainAnn::CbmTrdElectronsTrainAnn ( const CbmTrdElectronsTrainAnn & )
private

Member Function Documentation

◆ ClassDef()

CbmTrdElectronsTrainAnn::ClassDef ( CbmTrdElectronsTrainAnn ,
1  )
private

◆ CreateAnnString()

string CbmTrdElectronsTrainAnn::CreateAnnString ( )
private

Definition at line 710 of file CbmTrdElectronsTrainAnn.cxx.

References fNofTrdLayers.

Referenced by DoPreTest(), DoTest(), and DoTrain().

◆ CreateCumProbOutputHist()

void CbmTrdElectronsTrainAnn::CreateCumProbOutputHist ( )
private

Definition at line 649 of file CbmTrdElectronsTrainAnn.cxx.

References fhCumProbOutput, and fhOutput.

Referenced by DoPreTest().

◆ CreateFactory()

TMVA::Factory * CbmTrdElectronsTrainAnn::CreateFactory ( TTree * simu)
private

Definition at line 726 of file CbmTrdElectronsTrainAnn.cxx.

References fNofTrdLayers, and fOutputDir.

Referenced by DoTrain().

◆ CreateRocDiagramm()

TGraph * CbmTrdElectronsTrainAnn::CreateRocDiagramm ( )
private

Definition at line 662 of file CbmTrdElectronsTrainAnn.cxx.

References fhCumProbOutput, x, and y.

Referenced by Draw().

◆ CreateTmvaReader()

TMVA::Reader * CbmTrdElectronsTrainAnn::CreateTmvaReader ( )
private

Definition at line 748 of file CbmTrdElectronsTrainAnn.cxx.

References fAnnInput, fNofTrdLayers, and fReader.

Referenced by DoPreTest(), and DoTest().

◆ CreateTree()

TTree * CbmTrdElectronsTrainAnn::CreateTree ( )
private

Definition at line 693 of file CbmTrdElectronsTrainAnn.cxx.

References fAnnInput, fNofTrdLayers, and fXOut.

Referenced by DoPreTest(), DoTest(), and DoTrain().

◆ DoPreTest()

◆ DoTest()

◆ DoTrain()

void CbmTrdElectronsTrainAnn::DoTrain ( )
private

◆ Draw()

void CbmTrdElectronsTrainAnn::Draw ( Option_t * = "")

◆ Eval()

Double_t CbmTrdElectronsTrainAnn::Eval ( Bool_t isEl)
private

◆ Exec()

void CbmTrdElectronsTrainAnn::Exec ( Option_t * opt)
virtual

Inherited from FairTask.

Definition at line 167 of file CbmTrdElectronsTrainAnn.cxx.

References fEloss, fEventNum, FillElossHist(), FillElossVectorSim(), and SortElossAndFillHist().

◆ FillAnnInputHist()

void CbmTrdElectronsTrainAnn::FillAnnInputHist ( Bool_t isEl)
private

Definition at line 766 of file CbmTrdElectronsTrainAnn.cxx.

References fAnnInput, and fhInput.

Referenced by DoPreTest().

◆ FillElossHist()

void CbmTrdElectronsTrainAnn::FillElossHist ( )
private

Fill histograms with energy loss information.

Definition at line 300 of file CbmTrdElectronsTrainAnn.cxx.

References fEloss, fhEloss, and fhMeanEloss.

Referenced by Exec(), and RunBeamData().

◆ FillElossVectorReal()

void CbmTrdElectronsTrainAnn::FillElossVectorReal ( )
private

Fill vector with energy loss information simulated from real data spectra.

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

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

Definition at line 219 of file CbmTrdElectronsTrainAnn.cxx.

References fBeamDataElHist, fBeamDataFile, fBeamDataPiHist, fEloss, fhEloss, and fNofTrdLayers.

Referenced by RunBeamData().

◆ FillElossVectorSim()

void CbmTrdElectronsTrainAnn::FillElossVectorSim ( )
private

Fill vector with energy loss information for simulated data.

only primary tracks generated by BoxGenerator

Definition at line 263 of file CbmTrdElectronsTrainAnn.cxx.

References fEloss, fMCTracks, fNofTrdLayers, fTrdHits, fTrdTrackMatches, fTrdTracks, CbmTrdHit::GetELoss(), CbmTrack::GetHitIndex(), CbmLink::GetIndex(), CbmMatch::GetMatchedLink(), CbmMCTrack::GetMotherId(), CbmTrack::GetNofHits(), CbmMCTrack::GetPdgCode(), and v.

Referenced by Exec().

◆ FindOptimalCut()

Double_t CbmTrdElectronsTrainAnn::FindOptimalCut ( )
private

Definition at line 681 of file CbmTrdElectronsTrainAnn.cxx.

References fElIdEfficiency, and fhCumProbOutput.

Referenced by DoTest().

◆ Finish()

void CbmTrdElectronsTrainAnn::Finish ( )
virtual

Inherited from FairTask.

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

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

Definition at line 182 of file CbmTrdElectronsTrainAnn.cxx.

References Draw(), fHists, fOutputDir, and Run().

Referenced by RunBeamData().

◆ Init()

InitStatus CbmTrdElectronsTrainAnn::Init ( )
virtual

Inherited from FairTask.

Definition at line 132 of file CbmTrdElectronsTrainAnn.cxx.

References fMCTracks, fTrdHits, fTrdPoints, fTrdTrackMatches, and fTrdTracks.

◆ Likelihood()

Double_t CbmTrdElectronsTrainAnn::Likelihood ( )
private

Definition at line 400 of file CbmTrdElectronsTrainAnn.cxx.

References fAnnInput, and fhEloss.

Referenced by Eval().

◆ MeanCut()

Double_t CbmTrdElectronsTrainAnn::MeanCut ( )
private

Definition at line 433 of file CbmTrdElectronsTrainAnn.cxx.

References fAnnInput, fhEloss, and fNofTrdLayers.

Referenced by Eval().

◆ Median()

Double_t CbmTrdElectronsTrainAnn::Median ( )
private

Definition at line 419 of file CbmTrdElectronsTrainAnn.cxx.

References fAnnInput, fhEloss, and fNofTrdLayers.

Referenced by Eval().

◆ operator=()

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

◆ Run()

void CbmTrdElectronsTrainAnn::Run ( )
private

Definition at line 337 of file CbmTrdElectronsTrainAnn.cxx.

References DoTest(), DoTrain(), fIdMethod, fIsDoTrain, kANN, kBDT, kLIKELIHOOD, kMeanCut, and kMEDIAN.

Referenced by Finish().

◆ RunBeamData()

void CbmTrdElectronsTrainAnn::RunBeamData ( )

◆ SetBeamDataElHist()

void CbmTrdElectronsTrainAnn::SetBeamDataElHist ( std::string beamDataElHist)
inline

Definition at line 162 of file CbmTrdElectronsTrainAnn.h.

References fBeamDataElHist.

◆ SetBeamDataFile()

void CbmTrdElectronsTrainAnn::SetBeamDataFile ( std::string beamDataFile)
inline

Definition at line 160 of file CbmTrdElectronsTrainAnn.h.

References fBeamDataFile.

◆ SetBeamDataPiHist()

void CbmTrdElectronsTrainAnn::SetBeamDataPiHist ( std::string beamDataPiHist)
inline

Definition at line 161 of file CbmTrdElectronsTrainAnn.h.

References fBeamDataPiHist.

◆ SetIdMethod()

void CbmTrdElectronsTrainAnn::SetIdMethod ( IdMethod idMethod)
inline

Definition at line 150 of file CbmTrdElectronsTrainAnn.h.

References fIdMethod.

◆ SetIsDoTrain()

void CbmTrdElectronsTrainAnn::SetIsDoTrain ( Bool_t doTrain)
inline

Definition at line 146 of file CbmTrdElectronsTrainAnn.h.

References fIsDoTrain.

◆ SetNofAnnEpochs()

void CbmTrdElectronsTrainAnn::SetNofAnnEpochs ( Int_t nofAnnEpochs)
inline

Definition at line 154 of file CbmTrdElectronsTrainAnn.h.

References fNofAnnEpochs.

◆ SetNofTrainSamples()

void CbmTrdElectronsTrainAnn::SetNofTrainSamples ( Int_t nofTr)
inline

Definition at line 156 of file CbmTrdElectronsTrainAnn.h.

References fNofTrainSamples.

◆ SetOutputDir()

void CbmTrdElectronsTrainAnn::SetOutputDir ( const std::string & outputDir)
inline

Definition at line 152 of file CbmTrdElectronsTrainAnn.h.

References fOutputDir.

◆ SetSigmaError()

void CbmTrdElectronsTrainAnn::SetSigmaError ( Double_t sigma)
inline

Definition at line 158 of file CbmTrdElectronsTrainAnn.h.

References fSigmaError.

◆ SetTransformType()

void CbmTrdElectronsTrainAnn::SetTransformType ( Int_t type)
inline

Definition at line 148 of file CbmTrdElectronsTrainAnn.h.

References fTransformType.

◆ SortElossAndFillHist()

void CbmTrdElectronsTrainAnn::SortElossAndFillHist ( )
private

Sort energy losses and fill histograms.

Definition at line 316 of file CbmTrdElectronsTrainAnn.cxx.

References fEloss, fhElossSort, fNofTrdLayers, and v.

Referenced by Exec(), and RunBeamData().

◆ Transform()

void CbmTrdElectronsTrainAnn::Transform ( )
private

Definition at line 348 of file CbmTrdElectronsTrainAnn.cxx.

References fIdMethod, fTransformType, kANN, kBDT, Transform1(), and Transform2().

Referenced by DoPreTest(), DoTest(), and DoTrain().

◆ Transform1()

void CbmTrdElectronsTrainAnn::Transform1 ( )
private

Definition at line 361 of file CbmTrdElectronsTrainAnn.cxx.

References fAnnInput.

Referenced by Transform().

◆ Transform2()

void CbmTrdElectronsTrainAnn::Transform2 ( )
private

Definition at line 377 of file CbmTrdElectronsTrainAnn.cxx.

References fAnnInput, fhElossSort, and size().

Referenced by Transform().

Member Data Documentation

◆ fAnnInput

std::vector<Float_t> CbmTrdElectronsTrainAnn::fAnnInput
private

◆ fBeamDataElHist

std::string CbmTrdElectronsTrainAnn::fBeamDataElHist
private

Definition at line 203 of file CbmTrdElectronsTrainAnn.h.

Referenced by FillElossVectorReal(), and SetBeamDataElHist().

◆ fBeamDataFile

std::string CbmTrdElectronsTrainAnn::fBeamDataFile
private

Definition at line 201 of file CbmTrdElectronsTrainAnn.h.

Referenced by FillElossVectorReal(), and SetBeamDataFile().

◆ fBeamDataPiHist

std::string CbmTrdElectronsTrainAnn::fBeamDataPiHist
private

Definition at line 202 of file CbmTrdElectronsTrainAnn.h.

Referenced by FillElossVectorReal(), and SetBeamDataPiHist().

◆ fElIdEfficiency

double CbmTrdElectronsTrainAnn::fElIdEfficiency
private

Definition at line 218 of file CbmTrdElectronsTrainAnn.h.

Referenced by DoTest(), and FindOptimalCut().

◆ fEloss

std::vector<std::vector<std::vector<TrdEloss> > > CbmTrdElectronsTrainAnn::fEloss
private

◆ fEventNum

Int_t CbmTrdElectronsTrainAnn::fEventNum
private

Definition at line 195 of file CbmTrdElectronsTrainAnn.h.

Referenced by Exec().

◆ fhCumProbOutput

std::vector<TH1*> CbmTrdElectronsTrainAnn::fhCumProbOutput
private

◆ fhEloss

std::vector<TH1*> CbmTrdElectronsTrainAnn::fhEloss
private

◆ fhElossSort

std::vector<std::vector<TH1*> > CbmTrdElectronsTrainAnn::fhElossSort
private

Definition at line 193 of file CbmTrdElectronsTrainAnn.h.

Referenced by Draw(), SortElossAndFillHist(), and Transform2().

◆ fhInput

std::vector<std::vector<TH1*> > CbmTrdElectronsTrainAnn::fhInput
private

Definition at line 224 of file CbmTrdElectronsTrainAnn.h.

Referenced by Draw(), and FillAnnInputHist().

◆ fHists

std::vector<TH1*> CbmTrdElectronsTrainAnn::fHists
private

Definition at line 182 of file CbmTrdElectronsTrainAnn.h.

Referenced by Finish().

◆ fhMeanEloss

std::vector<TH1*> CbmTrdElectronsTrainAnn::fhMeanEloss
private

Definition at line 187 of file CbmTrdElectronsTrainAnn.h.

Referenced by Draw(), and FillElossHist().

◆ fhOutput

std::vector<TH1*> CbmTrdElectronsTrainAnn::fhOutput
private

Definition at line 222 of file CbmTrdElectronsTrainAnn.h.

Referenced by CreateCumProbOutputHist(), DoPreTest(), and Draw().

◆ fhResults

TH1* CbmTrdElectronsTrainAnn::fhResults
private

Definition at line 184 of file CbmTrdElectronsTrainAnn.h.

Referenced by DoTest().

◆ fIdMethod

IdMethod CbmTrdElectronsTrainAnn::fIdMethod
private

Definition at line 215 of file CbmTrdElectronsTrainAnn.h.

Referenced by DoPreTest(), DoTest(), DoTrain(), Eval(), Run(), SetIdMethod(), and Transform().

◆ fIsDoTrain

Bool_t CbmTrdElectronsTrainAnn::fIsDoTrain
private

Definition at line 198 of file CbmTrdElectronsTrainAnn.h.

Referenced by Run(), and SetIsDoTrain().

◆ fMaxEval

Double_t CbmTrdElectronsTrainAnn::fMaxEval
private

Definition at line 210 of file CbmTrdElectronsTrainAnn.h.

Referenced by DoPreTest(), and DoTest().

◆ fMCTracks

TClonesArray* CbmTrdElectronsTrainAnn::fMCTracks
private

Definition at line 170 of file CbmTrdElectronsTrainAnn.h.

Referenced by FillElossVectorSim(), and Init().

◆ fMinEval

Double_t CbmTrdElectronsTrainAnn::fMinEval
private

Definition at line 211 of file CbmTrdElectronsTrainAnn.h.

Referenced by DoPreTest(), and DoTest().

◆ fNN

TMultiLayerPerceptron* CbmTrdElectronsTrainAnn::fNN
private

Definition at line 213 of file CbmTrdElectronsTrainAnn.h.

Referenced by DoPreTest(), DoTest(), DoTrain(), and Eval().

◆ fNofAnnEpochs

Int_t CbmTrdElectronsTrainAnn::fNofAnnEpochs
private

Definition at line 216 of file CbmTrdElectronsTrainAnn.h.

Referenced by DoTrain(), and SetNofAnnEpochs().

◆ fNofTrainSamples

Int_t CbmTrdElectronsTrainAnn::fNofTrainSamples
private

Definition at line 217 of file CbmTrdElectronsTrainAnn.h.

Referenced by DoPreTest(), DoTest(), DoTrain(), and SetNofTrainSamples().

◆ fNofTrdLayers

◆ fOutputDir

std::string CbmTrdElectronsTrainAnn::fOutputDir
private

◆ fReader

TMVA::Reader* CbmTrdElectronsTrainAnn::fReader
private

Definition at line 214 of file CbmTrdElectronsTrainAnn.h.

Referenced by CreateTmvaReader(), DoPreTest(), DoTest(), and Eval().

◆ fSigmaError

Double_t CbmTrdElectronsTrainAnn::fSigmaError
private

Definition at line 197 of file CbmTrdElectronsTrainAnn.h.

Referenced by DoPreTest(), and SetSigmaError().

◆ fTransformType

Int_t CbmTrdElectronsTrainAnn::fTransformType
private

Definition at line 199 of file CbmTrdElectronsTrainAnn.h.

Referenced by SetTransformType(), and Transform().

◆ fTrdHits

TClonesArray* CbmTrdElectronsTrainAnn::fTrdHits
private

Definition at line 174 of file CbmTrdElectronsTrainAnn.h.

Referenced by FillElossVectorSim(), and Init().

◆ fTrdPoints

TClonesArray* CbmTrdElectronsTrainAnn::fTrdPoints
private

Definition at line 171 of file CbmTrdElectronsTrainAnn.h.

Referenced by Init().

◆ fTrdTrackMatches

TClonesArray* CbmTrdElectronsTrainAnn::fTrdTrackMatches
private

Definition at line 173 of file CbmTrdElectronsTrainAnn.h.

Referenced by FillElossVectorSim(), and Init().

◆ fTrdTracks

TClonesArray* CbmTrdElectronsTrainAnn::fTrdTracks
private

Definition at line 172 of file CbmTrdElectronsTrainAnn.h.

Referenced by FillElossVectorSim(), and Init().

◆ fXOut

Float_t CbmTrdElectronsTrainAnn::fXOut
private

Definition at line 206 of file CbmTrdElectronsTrainAnn.h.

Referenced by CreateTree(), and DoTrain().


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