CbmRoot
CbmTrdElectronsTrainAnn Class Reference

#include <CbmTrdElectronsTrainAnn.h>

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

Public Member Functions

 CbmTrdElectronsTrainAnn (int nofTrdLayers)
 Default constructor. More...
 
virtual ~CbmTrdElectronsTrainAnn ()
 Destructor. More...
 
virtual InitStatus Init ()
 Inherited from FairTask. More...
 
virtual void Exec (Option_t *opt)
 Inherited from FairTask. More...
 
virtual void Finish ()
 Inherited from FairTask. More...
 
void Draw (Option_t *="")
 Draw results. More...
 
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. More...
 
void FillElossVectorReal ()
 Fill vector with energy loss information simulated from real data spectra. More...
 
void FillElossHist ()
 Fill histograms with energy loss information. More...
 
void SortElossAndFillHist ()
 Sort energy losses and fill histograms. More...
 
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 54 of file CbmTrdElectronsTrainAnn.h.

Constructor & Destructor Documentation

◆ CbmTrdElectronsTrainAnn() [1/2]

CbmTrdElectronsTrainAnn::CbmTrdElectronsTrainAnn ( int  nofTrdLayers)

Default constructor.

◆ ~CbmTrdElectronsTrainAnn()

CbmTrdElectronsTrainAnn::~CbmTrdElectronsTrainAnn ( )
virtual

Destructor.

Definition at line 144 of file CbmTrdElectronsTrainAnn.cxx.

◆ CbmTrdElectronsTrainAnn() [2/2]

CbmTrdElectronsTrainAnn::CbmTrdElectronsTrainAnn ( const CbmTrdElectronsTrainAnn )
private

Member Function Documentation

◆ ClassDef()

CbmTrdElectronsTrainAnn::ClassDef ( CbmTrdElectronsTrainAnn  ,
 
)
private

◆ CreateAnnString()

string CbmTrdElectronsTrainAnn::CreateAnnString ( )
private

Definition at line 676 of file CbmTrdElectronsTrainAnn.cxx.

References fNofTrdLayers, and i.

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

◆ CreateCumProbOutputHist()

void CbmTrdElectronsTrainAnn::CreateCumProbOutputHist ( )
private

Definition at line 620 of file CbmTrdElectronsTrainAnn.cxx.

References fhCumProbOutput, fhOutput, and i.

Referenced by DoPreTest().

◆ CreateFactory()

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

Definition at line 690 of file CbmTrdElectronsTrainAnn.cxx.

References fNofTrdLayers, fOutputDir, and i.

Referenced by DoTrain().

◆ CreateRocDiagramm()

TGraph * CbmTrdElectronsTrainAnn::CreateRocDiagramm ( )
private

Definition at line 632 of file CbmTrdElectronsTrainAnn.cxx.

References fhCumProbOutput, i, x, and y.

Referenced by Draw().

◆ CreateTmvaReader()

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

Definition at line 711 of file CbmTrdElectronsTrainAnn.cxx.

References fAnnInput, fNofTrdLayers, fReader, and i.

Referenced by DoPreTest(), and DoTest().

◆ CreateTree()

TTree * CbmTrdElectronsTrainAnn::CreateTree ( )
private

Definition at line 661 of file CbmTrdElectronsTrainAnn.cxx.

References fAnnInput, fNofTrdLayers, fXOut, and i.

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 180 of file CbmTrdElectronsTrainAnn.cxx.

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

◆ FillAnnInputHist()

void CbmTrdElectronsTrainAnn::FillAnnInputHist ( Bool_t  isEl)
private

Definition at line 727 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 288 of file CbmTrdElectronsTrainAnn.cxx.

References fEloss, fhEloss, fhMeanEloss, and i.

Referenced by Exec(), and RunBeamData().

◆ FillElossVectorReal()

void CbmTrdElectronsTrainAnn::FillElossVectorReal ( )
private

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

Definition at line 218 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 249 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 650 of file CbmTrdElectronsTrainAnn.cxx.

References fElIdEfficiency, fhCumProbOutput, and i.

Referenced by DoTest().

◆ Finish()

void CbmTrdElectronsTrainAnn::Finish ( )
virtual

Inherited from FairTask.

Definition at line 194 of file CbmTrdElectronsTrainAnn.cxx.

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

Referenced by RunBeamData().

◆ Init()

InitStatus CbmTrdElectronsTrainAnn::Init ( )
virtual

Inherited from FairTask.

Definition at line 146 of file CbmTrdElectronsTrainAnn.cxx.

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

◆ Likelihood()

Double_t CbmTrdElectronsTrainAnn::Likelihood ( )
private

Definition at line 382 of file CbmTrdElectronsTrainAnn.cxx.

References fAnnInput, and fhEloss.

Referenced by Eval().

◆ MeanCut()

Double_t CbmTrdElectronsTrainAnn::MeanCut ( )
private

Definition at line 414 of file CbmTrdElectronsTrainAnn.cxx.

References fAnnInput, fhEloss, fNofTrdLayers, and i.

Referenced by Eval().

◆ Median()

Double_t CbmTrdElectronsTrainAnn::Median ( )
private

Definition at line 400 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 323 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 164 of file CbmTrdElectronsTrainAnn.h.

References fBeamDataElHist.

◆ SetBeamDataFile()

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

Definition at line 158 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 148 of file CbmTrdElectronsTrainAnn.h.

References fIdMethod.

◆ SetIsDoTrain()

void CbmTrdElectronsTrainAnn::SetIsDoTrain ( Bool_t  doTrain)
inline

Definition at line 144 of file CbmTrdElectronsTrainAnn.h.

References fIsDoTrain.

◆ SetNofAnnEpochs()

void CbmTrdElectronsTrainAnn::SetNofAnnEpochs ( Int_t  nofAnnEpochs)
inline

Definition at line 152 of file CbmTrdElectronsTrainAnn.h.

References fNofAnnEpochs.

◆ SetNofTrainSamples()

void CbmTrdElectronsTrainAnn::SetNofTrainSamples ( Int_t  nofTr)
inline

Definition at line 154 of file CbmTrdElectronsTrainAnn.h.

References fNofTrainSamples.

◆ SetOutputDir()

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

Definition at line 150 of file CbmTrdElectronsTrainAnn.h.

References fOutputDir.

◆ SetSigmaError()

void CbmTrdElectronsTrainAnn::SetSigmaError ( Double_t  sigma)
inline

Definition at line 156 of file CbmTrdElectronsTrainAnn.h.

References fSigmaError.

◆ SetTransformType()

void CbmTrdElectronsTrainAnn::SetTransformType ( Int_t  type)
inline

Definition at line 146 of file CbmTrdElectronsTrainAnn.h.

References fTransformType.

◆ SortElossAndFillHist()

void CbmTrdElectronsTrainAnn::SortElossAndFillHist ( )
private

Sort energy losses and fill histograms.

Definition at line 303 of file CbmTrdElectronsTrainAnn.cxx.

References fEloss, fhElossSort, fNofTrdLayers, and v.

Referenced by Exec(), and RunBeamData().

◆ Transform()

void CbmTrdElectronsTrainAnn::Transform ( )
private

Definition at line 333 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 344 of file CbmTrdElectronsTrainAnn.cxx.

References fAnnInput, and i.

Referenced by Transform().

◆ Transform2()

void CbmTrdElectronsTrainAnn::Transform2 ( )
private

Definition at line 359 of file CbmTrdElectronsTrainAnn.cxx.

References fAnnInput, and fhElossSort.

Referenced by Transform().

Member Data Documentation

◆ fAnnInput

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

◆ fBeamDataElHist

std::string CbmTrdElectronsTrainAnn::fBeamDataElHist
private

Definition at line 211 of file CbmTrdElectronsTrainAnn.h.

Referenced by FillElossVectorReal(), and SetBeamDataElHist().

◆ fBeamDataFile

std::string CbmTrdElectronsTrainAnn::fBeamDataFile
private

Definition at line 208 of file CbmTrdElectronsTrainAnn.h.

Referenced by FillElossVectorReal(), and SetBeamDataFile().

◆ fBeamDataPiHist

std::string CbmTrdElectronsTrainAnn::fBeamDataPiHist
private

Definition at line 209 of file CbmTrdElectronsTrainAnn.h.

Referenced by FillElossVectorReal(), and SetBeamDataPiHist().

◆ fElIdEfficiency

double CbmTrdElectronsTrainAnn::fElIdEfficiency
private

Definition at line 226 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 201 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 199 of file CbmTrdElectronsTrainAnn.h.

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

◆ fhInput

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

Definition at line 234 of file CbmTrdElectronsTrainAnn.h.

Referenced by Draw(), and FillAnnInputHist().

◆ fHists

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

Definition at line 186 of file CbmTrdElectronsTrainAnn.h.

Referenced by Finish().

◆ fhMeanEloss

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

Definition at line 193 of file CbmTrdElectronsTrainAnn.h.

Referenced by Draw(), and FillElossHist().

◆ fhOutput

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

Definition at line 230 of file CbmTrdElectronsTrainAnn.h.

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

◆ fhResults

TH1* CbmTrdElectronsTrainAnn::fhResults
private

Definition at line 189 of file CbmTrdElectronsTrainAnn.h.

Referenced by DoTest().

◆ fIdMethod

IdMethod CbmTrdElectronsTrainAnn::fIdMethod
private

Definition at line 223 of file CbmTrdElectronsTrainAnn.h.

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

◆ fIsDoTrain

Bool_t CbmTrdElectronsTrainAnn::fIsDoTrain
private

Definition at line 204 of file CbmTrdElectronsTrainAnn.h.

Referenced by Run(), and SetIsDoTrain().

◆ fMaxEval

Double_t CbmTrdElectronsTrainAnn::fMaxEval
private

Definition at line 218 of file CbmTrdElectronsTrainAnn.h.

Referenced by DoPreTest(), and DoTest().

◆ fMCTracks

TClonesArray* CbmTrdElectronsTrainAnn::fMCTracks
private

Definition at line 174 of file CbmTrdElectronsTrainAnn.h.

Referenced by FillElossVectorSim(), and Init().

◆ fMinEval

Double_t CbmTrdElectronsTrainAnn::fMinEval
private

Definition at line 219 of file CbmTrdElectronsTrainAnn.h.

Referenced by DoPreTest(), and DoTest().

◆ fNN

TMultiLayerPerceptron* CbmTrdElectronsTrainAnn::fNN
private

Definition at line 221 of file CbmTrdElectronsTrainAnn.h.

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

◆ fNofAnnEpochs

Int_t CbmTrdElectronsTrainAnn::fNofAnnEpochs
private

Definition at line 224 of file CbmTrdElectronsTrainAnn.h.

Referenced by DoTrain(), and SetNofAnnEpochs().

◆ fNofTrainSamples

Int_t CbmTrdElectronsTrainAnn::fNofTrainSamples
private

Definition at line 225 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 222 of file CbmTrdElectronsTrainAnn.h.

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

◆ fSigmaError

Double_t CbmTrdElectronsTrainAnn::fSigmaError
private

Definition at line 203 of file CbmTrdElectronsTrainAnn.h.

Referenced by DoPreTest(), and SetSigmaError().

◆ fTransformType

Int_t CbmTrdElectronsTrainAnn::fTransformType
private

Definition at line 205 of file CbmTrdElectronsTrainAnn.h.

Referenced by SetTransformType(), and Transform().

◆ fTrdHits

TClonesArray* CbmTrdElectronsTrainAnn::fTrdHits
private

Definition at line 178 of file CbmTrdElectronsTrainAnn.h.

Referenced by FillElossVectorSim(), and Init().

◆ fTrdPoints

TClonesArray* CbmTrdElectronsTrainAnn::fTrdPoints
private

Definition at line 175 of file CbmTrdElectronsTrainAnn.h.

Referenced by Init().

◆ fTrdTrackMatches

TClonesArray* CbmTrdElectronsTrainAnn::fTrdTrackMatches
private

Definition at line 177 of file CbmTrdElectronsTrainAnn.h.

Referenced by FillElossVectorSim(), and Init().

◆ fTrdTracks

TClonesArray* CbmTrdElectronsTrainAnn::fTrdTracks
private

Definition at line 176 of file CbmTrdElectronsTrainAnn.h.

Referenced by FillElossVectorSim(), and Init().

◆ fXOut

Float_t CbmTrdElectronsTrainAnn::fXOut
private

Definition at line 214 of file CbmTrdElectronsTrainAnn.h.

Referenced by CreateTree(), and DoTrain().


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