LCFIVertex  0.7.2
Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
NeuralNetTrainerProcessor Class Reference

Trains neural networks to be used for jet flavour tagging. More...

#include <NeuralNetTrainer.h>

Inheritance diagram for NeuralNetTrainerProcessor:
Inheritance graph
[legend]
Collaboration diagram for NeuralNetTrainerProcessor:
Collaboration graph
[legend]

Public Member Functions

virtual Processor * newProcessor ()
 
virtual void init ()
 
virtual void processRunHeader (LCRunHeader *pRun)
 
virtual void processEvent (LCEvent *pEvent)
 
virtual void end ()
 

Protected Member Functions

void _displayCollectionNames (lcio::LCEvent *pEvent)
 
void _trainNet (nnet::BackPropagationCGAlgorithm &pBackPropCGAlgo, nnet::NeuralNetDataSet &dataSet)
 
bool _passesCuts (lcio::LCEvent *pEvent)
 

Protected Attributes

std::string _JetCollectionName
 
std::string _FlavourTagInputsCollectionName
 
std::string _TrueJetFlavourCollectionName
 
int _serialiseAsXML
 
nnet::NeuralNet::SerialisationMode _outputFormat
 
std::map< std::string,
std::string > 
_filename
 
std::map< std::string, bool > _trainThisNet
 
std::map< std::string,
nnet::NeuralNetDataSet * > 
_dataSet
 
std::map< std::string, int > _numSignal
 
std::map< std::string, int > _numBackground
 
std::vector< std::string > _listOfSelectedNetNames
 
std::map< std::string,
unsigned int > 
_IndexOf
 
int _nRun
 
int _nEvent
 
int _nAcceptedEvents
 

Static Protected Attributes

static const int C_JET =4
 
static const int B_JET =5
 

Detailed Description

Trains neural networks to be used for jet flavour tagging.

Trains flavour tagging networks using the BackPropagationCGAlgorithm (see the Neural Net Package page) with 500 epochs. The networks are trained on the following data:
If only 1 vertex is found (i.e. only the interaction point)

\[tanh\left( \frac{D0Significance1}{100} \right)\]

\[tanh\left( \frac{D0Significance2}{100} \right)\]

\[tanh\left( \frac{Z0Significance1}{100} \right)\]

\[tanh\left( \frac{Z0Significance2}{100} \right)\]

\[JointProbRPhi\]

\[JointProbZ\]

\[tanh\left( \frac{3\times Momentum1}{E} \right)\]

\[tanh\left( \frac{3\times Momentum2}{E} \right)\]

If 2 or more vertices are found

\[tanh\left( \frac{DecayLengthSignificance}{6\times E} \right)\]

\[tanh\left( \frac{DecayLength}{10} \right)\]

\[tanh\left( \frac{PTCorrectedMass}{5} \right)\]

\[tanh\left( \frac{RawMomentum}{E} \right)\]

\[JointProbRPhi\]

\[JointProbZ\]

\[tanh\left( \frac{NumTracksInVertices}{10} \right)\]

\[SecondaryVertexProbability\]

Where E is the jet energy, everything else is the data calculated by FlavourTagInputsProcessor.
Note that the processor applies it's own hard coded cuts. These are documented under the full description of NeuralNetTrainerProcessor::_passesCuts().

Input

Output

Trained neural networks to the filenames supplied, in the format requested. The LCIO file is not modified at all.

Parameters
JetCollectionNameName of the ReconstructedParticle collection that represents jets.
FlavourTagInputsCollectionName of the LCFloatVec collection that holds the flavour tag inputs.
TrueJetFlavourCollectionName of the LCIntVec Collection that contains the true jet flavours.
Filename-b_net-1vtxOutput filename for the trained 1 vertex b-tag net.
Filename-c_net-1vtxOutput filename for the trained 1 vertex c-tag net.
Filename-bc_net-1vtxOutput filename for the trained 1 vertex c-tag (with only b background) net.
Filename-b_net-2vtxOutput filename for the trained 2 vertex b-tag net.
Filename-c_net-2vtxOutput filename for the trained 2 vertex c-tag net.
Filename-bc_net-2vtxOutput filename for the trained 2 vertex c-tag (with only b background) net.
Filename-b_net-3plusvtxOutput filename for the trained 3 or more vertices b-tag net.
Filename-c_net-3plusvtxOutput filename for the trained 3 or more vertices c-tag net.
Filename-bc_net-3plusvtxOutput filename for the trained 3 or more vertices c-tag (with only b background) net.
Author
Mark Grimes (mark..nosp@m.grim.nosp@m.es@br.nosp@m.isto.nosp@m.l.ac..nosp@m.uk)

Definition at line 71 of file NeuralNetTrainer.h.

Member Function Documentation

void NeuralNetTrainerProcessor::_displayCollectionNames ( lcio::LCEvent *  pEvent)
protected

Displays all of the available collections in the file.

Definition at line 533 of file NeuralNetTrainer.cc.

bool NeuralNetTrainerProcessor::_passesCuts ( lcio::LCEvent *  pEvent)
protected

All the code for the cuts should be put in here; returns false if the event fails any of the cuts.

Currently selects jets for which the jet polar angle theta is -0.866<= cos(theta) <=0.866.

Definition at line 377 of file NeuralNetTrainer.cc.

void NeuralNetTrainerProcessor::_trainNet ( nnet::BackPropagationCGAlgorithm pBackPropCGAlgo,
nnet::NeuralNetDataSet dataSet 
)
protected

The training code, split off to make the code a bit more manageable

Definition at line 494 of file NeuralNetTrainer.cc.

Member Data Documentation

std::map<std::string,nnet::NeuralNetDataSet*> NeuralNetTrainerProcessor::_dataSet
protected

Map of the data sets for each of the selected nets

Definition at line 97 of file NeuralNetTrainer.h.

std::map<std::string,std::string> NeuralNetTrainerProcessor::_filename
protected

A map of the output filenames for the trained net. All of these maps use strings of the form "c_net-2vtx", "bc_net-3vtx" etcetera as the key

Definition at line 94 of file NeuralNetTrainer.h.

std::map<std::string,unsigned int> NeuralNetTrainerProcessor::_IndexOf
protected

Holds the positions of the inputs, so that, for example, you can get the position of D0Significance1 in the inputs LCFloatVec just with _IndexOf["D0Significance1"]

Definition at line 108 of file NeuralNetTrainer.h.

std::vector<std::string> NeuralNetTrainerProcessor::_listOfSelectedNetNames
protected

A list of the nets that have been selected for training, in the form of the strings used in the map keys above.

Definition at line 104 of file NeuralNetTrainer.h.

int NeuralNetTrainerProcessor::_nAcceptedEvents
protected

The number of events that have passed the cuts so far.

Definition at line 113 of file NeuralNetTrainer.h.

int NeuralNetTrainerProcessor::_nEvent
protected

The event number.

Definition at line 112 of file NeuralNetTrainer.h.

int NeuralNetTrainerProcessor::_nRun
protected

The run number.

Definition at line 111 of file NeuralNetTrainer.h.

std::map<std::string,int> NeuralNetTrainerProcessor::_numBackground
protected

Dito for the number of backgrounds.

Definition at line 100 of file NeuralNetTrainer.h.

std::map<std::string,int> NeuralNetTrainerProcessor::_numSignal
protected

Map of the number of signal events for each net. Not really used for anything, just printed as info when the net starts training.

Definition at line 98 of file NeuralNetTrainer.h.

std::map<std::string,bool> NeuralNetTrainerProcessor::_trainThisNet
protected

Map containing true or false depending on whether this net has been selected for training (if the user supplies an output filename in the steering file).

Definition at line 95 of file NeuralNetTrainer.h.

const int NeuralNetTrainerProcessor::B_JET =5
staticprotected

Ditto.

Definition at line 117 of file NeuralNetTrainer.h.

const int NeuralNetTrainerProcessor::C_JET =4
staticprotected

Just a useful constant for testing true jet flavour.

Definition at line 116 of file NeuralNetTrainer.h.


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