> For the complete documentation index, see [llms.txt](https://antonio-iuliano1993.gitbook.io/software-notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://antonio-iuliano1993.gitbook.io/software-notes/shipcharm-decay-search/bdt.md).

# BDT

## TMVAClassification\_MC.C&#x20;

(only for training and test of simulation data)&#x20;

Description: This code provides several functions to create input files for the training and test of the BDTs; and a main function to perform the BDTs. List of functions:

&#x20;1\) prepareTMVAtree() --> It requires a vertex\_file with MC information (mp\_motherID, mp\_eventID, charm\_daug, etc...) The file in input is usually called "vtx\_MC\_analysis.root" It provides in output the file "tmva\_input\_vertices.root" that is used as input for the BDT on interaction vertices.&#x20;

2\) prepareTMVAtree2nd() --> It requires a vertex\_file with MC information (mp\_motherID, mp\_eventID, charm\_daug, etc...) and a file with the BDT values evaluated on interaction vertices. The file in input are usually called "vtx\_MC\_analysis.root" and "vtx\_BDT\_data\_evaluated.root" It provides in output the file "tmva\_input\_vertices2nd.root" that is used as input for the BDT on decay vertices.&#x20;

3\) prepareTMVAtreeDS() --> It requires a file where the decay search is already performed. The file in input is usually called "annotated\_data\_result.root". It provides in output the file "tmva\_input\_verticesDS.root" that is used as input for the decay search BDT.&#x20;

4\) TMVAClassification\_MC() --> The script allows to perform the BDT on interaction vertices, decay vertices and the BDT for the decay search. Different cases are possible:&#x20;

* Case 1: BDT on interaction vertices --> Input files like "tmva\_input\_vertices.root".&#x20;
* Case 2: BDT on decay vertices --> 2 Input files like "tmva\_input\_vertices2nd.root" for the signal (charm vertices) and the background (the remaining part).&#x20;
* Case 3: BDT for the decay search --> Input files like "tmva\_input\_verticesDS.root". It provides in output the directories with the datasets with the weigths of the tested network and the "TMVA.root" to check the BDT results and distributions.&#x20;

## TMVAClassification.C&#x20;

(only for data and simulation evaluation)&#x20;

Description: This code provides several functions to create input files for the evaluation of the BDTs; List of functions:&#x20;

1\) prepareTMVAtree() --> It requires a vertex file usually called "vertextree\_test.root" It provides in output the file "tmva\_input\_vertices.root" that is used as input for the BDT evaluation of interaction vertices usually called "vtx\_BDT\_data\_evaluated.root".

&#x20;2\) prepareTMVAtree2nd() --> It requires a vertex\_file and a file with the BDT values evaluated on interaction vertices The file in input are usually called "vertextree\_test.root" and "vtx\_BDT\_data\_evaluated.root" It provides in output the file "tmva\_input\_vertices2nd.root" that is used as input for the BDT evaluation on decay vertices.&#x20;

3\) prepareTMVAtreeDS() --> It requires a file where the decay search is already performed. The file in input is usually called "annotated\_data\_result.root". It provides in output the file "tmva\_input\_verticesDS.root" that is used as input for the decay search BDT evaluation.&#x20;

## TMVAClassificationApplication.C

&#x20;Description: This code performs the evaluation of the BDT for the interaction vertices.&#x20;

It requires in input the file "tmva\_input\_vertices.root" and provides in output the file "vtx\_BDT\_data\_evaluated.root"&#x20;

## TMVAClassificationApplication2nd.C&#x20;

Description: This code performs the evaluation of the BDT for the decay vertices. It requires in input the file "tmva\_input\_vertices2nd.root" and provides in output the file "vtx\_BDT\_data\_evaluated2nd.root"&#x20;

## TMVAClassificationApplicationDS.C&#x20;

Description: This code performs the evaluation of the BDT for the decay search. It requires in input the file "tmva\_input\_verticesDS.root" and provides in output the file "vtx\_BDT\_data\_evaluatedDS.root"

&#x20;Usage:&#x20;

\# input files&#x20;

`root -l .L TMVAClassification_MC.C or (.L TMVAClassification.C)`&#x20;

`prepareTMVAtree()`&#x20;

`prepareTMVAtree2nd()`&#x20;

`prepareTMVAtreeDS()`&#x20;

\# BDTs training and test

&#x20;`root -l ./TMVAClassification_MC.C\(\"BDT,Likelihood\"\)`&#x20;

\# BDT evaluation

&#x20;`root -l TMVAClassificationApplication.C`&#x20;

`root -l TMVAClassificationApplication2nd.C`&#x20;

\# BDT results&#x20;

`root -l TMVA::TMVAGui("TMVA.root")`
