Skip to content

Create Training Data

dglazier edited this page Jun 11, 2020 · 6 revisions

Lets call my example FinalState class Pi2 for e- p pi+ pi-

Lets suppose I have already completed my Pi2.cpp class definition.

Now I need to create my configured analysis object (CANO), this is done in a ROOT script that then gets passed to chanser_root. i.e.

  chanser_root Pi2:Pi2.cpp CreateTrainingData.C

CreateTrainingData.C might look like :

Create my FinalState class object and select the Electron:Proton:Pip:Pim topology. I could add more topologies and then perform the training on each one seperately

auto FS = Pi2::Make("NONE","ALL");
FS->AddTopology("Electron:Proton:Pip:Pim");

I do not need a seperate ROOT or hipo output for this only particle data so I don't need the line FS->UseOutputRootTree();

New I define what variables I would like to use for the training. In principle this can be different for each particle species, but here I will just use one ParticleData class which I made following instructions for making my own ParticleData class, called MVAParticleData. In general you will want to experiment with this. In my class for example I change region from discrete values to a float as classifier training does not like discrete variables. My particle data, data members are,

 Float_t P=0;
 Float_t Theta=0;
 Float_t DeltaE=0;
 Float_t DeltaTime=0;
 Float_t EFrac=0;
 Float_t HTCC=0;
 Float_t Region=-1;

Now to create these output trees I use a ParticleDataManager and register it as a post Kine action.

ParticleDataManager pdm{"particle",1};
pdm.SetParticleOut(new MVAParticleOutEvent);
FS->RegisterPostKinAction(pdm);

Note the arguements {"particle",1} create a tree called particle and the 1 means the FinalState branches will be added. This allows me to use these to cut on to define signal and background events but I must remember to Ignore these in the training variables

Now here I am going to use mixed sample training by cutting on exclusive events for signal, but I may have wanted to use simulated events as signal. In this case I would include the TruthMatch action class which creates a branch, Truth, which flags when the correct combitorial event has been reconstructed.