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

Creates some sample plots from the data calculated by the LCFI vertex package. More...

#include <PlotProcessor.h>

Inheritance diagram for PlotProcessor:
Inheritance graph
[legend]
Collaboration diagram for PlotProcessor:
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)
 
bool _passesEventCuts (lcio::LCEvent *pEvent)
 
bool _passesJetCuts (lcio::ReconstructedParticle *pJet)
 
void _fillPlots (LCEvent *pEvent, unsigned int jet)
 
void _outputDataToFile (std::string filename)
 

Protected Attributes

std::string _JetCollectionName
 
std::vector< std::string > _FlavourTagCollectionNames
 
std::string _TrueJetFlavourColName
 
std::string _OutputFilename
 
std::vector< std::map
< std::string, unsigned int > > 
_IndexOfForEachTag
 
int _nRun
 
histogram_data< double > _jetEnergy
 
std::vector< efficiency_purity
< double > > 
_BTagEfficiencyPurity
 
std::vector< efficiency_purity
< double > > 
_CTagEfficiencyPurity
 
std::vector< efficiency_purity
< double > > 
_BCTagEfficiencyPurity
 
double _jetEMax
 

Static Protected Attributes

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

Detailed Description

Creates some sample plots from the data calculated by the LCFI vertex package.

An example of getting the flavour tag results from the LCIO file and plotting an efficiency purity graph with them. Also plots a graph of jet energies for good measure.
The processor checks the specifed LCFloatVec collections for the flavour tag values "BTag", "CTag" and "BCTag" which are the names that FlavourTagProcessor stores its b tag, c tag and c tag (only b background) values in respectively.
These values are checked against the true jet flavour (from the TrueJetFlavour LCIntVec) and efficiency-purity values calculated for a range of cuts.
The jet energy is taken from the energy of the reconstructed particle used to represent the jet.

Getting Root output

To output to a Root file instead of CSV files the processor has to be compiled with the USEROOT preprocessor flag defined. You could add "#define USEROOT" to the code, or more easily add the line

USERINCLUDES += -D USEROOT

to the userlib.gmk file that is in the Marlin directory. If Marlin is not already set up to use Root then you will also need to add the following lines (this assumes a fully working root installation):

USERINCLUDES += root-config --cflags
USERLIBS += root-config --libs

Input

From the LCIO file, flavour tag variable values of:

"BTag" "CTag" "BCTag"

And

"JetType"

Output

If the USEROOT preprocessor flag was defined when this processor was compiled, then the output will be a root file with the filename specified in the steering file. Otherwise, the efficiency-purity values will be output as comma separated values to the file <filename>+".csv", and the jet energies to <filename>+"-JetEnergies.csv".

Parameters
JetCollectionNameName of the ReconstructedParticle collection that represents jets.
FlavourTagCollectionsNames of the LCFloatVec collections holding the Flavour tags, all tags in this list will be produced in one file for comparison
TrueJetFlavourCollectionLCIntVec that contains the MC Jet flavour (from TrueJetFlavourProcessor)
OutputFilenameThe name of the file that will hold the output.

Definition at line 61 of file PlotProcessor.h.

Member Function Documentation

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

Just prints out the available collections in the LCIO file to standard output.

Definition at line 397 of file PlotProcessor.cc.

void PlotProcessor::_fillPlots ( LCEvent *  pEvent,
unsigned int  jet 
)
protected

Internal function that is just code split off from processEvent() to simplify it - fills the container classes with the data from the file.

Definition at line 219 of file PlotProcessor.cc.

References _BCTagEfficiencyPurity, _BTagEfficiencyPurity, _CTagEfficiencyPurity, _FlavourTagCollectionNames, _TrueJetFlavourColName, B_JET, and C_JET.

void PlotProcessor::_outputDataToFile ( std::string  filename)
protected

Internal function that is just code split off from end() to simplify it - writes the required data from the container classes to the output file.

Definition at line 253 of file PlotProcessor.cc.

References _BCTagEfficiencyPurity, _BTagEfficiencyPurity, _CTagEfficiencyPurity, _FlavourTagCollectionNames, and _jetEnergy.

bool PlotProcessor::_passesEventCuts ( lcio::LCEvent *  pEvent)
protected

A function that contains all the event cuts - returns true if the event passes all of the cuts, false otherwise.

Currently applies no cuts at all

Definition at line 178 of file PlotProcessor.cc.

bool PlotProcessor::_passesJetCuts ( lcio::ReconstructedParticle *  pJet)
protected

A function that contains all the jet cuts - returns true if the event passes all of the cuts, false otherwise.

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

Definition at line 190 of file PlotProcessor.cc.

Member Data Documentation

std::vector<efficiency_purity<double> > PlotProcessor::_BCTagEfficiencyPurity
protected

Custom storage class that holds all the efficiency/purity data for the b tag (only b background) calculated by the FlavourTagProcessor.

Definition at line 86 of file PlotProcessor.h.

Referenced by _fillPlots(), and _outputDataToFile().

std::vector<efficiency_purity<double> > PlotProcessor::_BTagEfficiencyPurity
protected

Custom storage class that holds all the efficiency/purity data for the b tag calculated by the FlavourTagProcessor.

Definition at line 84 of file PlotProcessor.h.

Referenced by _fillPlots(), and _outputDataToFile().

std::vector<efficiency_purity<double> > PlotProcessor::_CTagEfficiencyPurity
protected

Custom storage class that holds all the efficiency/purity data for the b tag calculated by the FlavourTagProcessor.

Definition at line 85 of file PlotProcessor.h.

Referenced by _fillPlots(), and _outputDataToFile().

std::vector<std::string> PlotProcessor::_FlavourTagCollectionNames
protected

The names of the collection of LCFloatVec that are the flavour tags (a set of purity effiency plots will be made for each tag) (comes from the steering file).

Definition at line 76 of file PlotProcessor.h.

Referenced by _fillPlots(), and _outputDataToFile().

std::string PlotProcessor::_JetCollectionName
protected

The name of the collection of ReconstructedParticles that is the jet (comes from the steering file).

Definition at line 75 of file PlotProcessor.h.

double PlotProcessor::_jetEMax
protected

Keeps a record of the highest jet energy - gets printed to standard output at the end as a sanity check.

Definition at line 99 of file PlotProcessor.h.

histogram_data<double> PlotProcessor::_jetEnergy
protected

Custom storage class that holds all of the jet energies.

Definition at line 82 of file PlotProcessor.h.

Referenced by _outputDataToFile().

int PlotProcessor::_nRun
protected

The current run number.

Definition at line 80 of file PlotProcessor.h.

std::string PlotProcessor::_OutputFilename
protected

The filename of the output root file if using root, otherwise the directory and the first part of the filename of the comma seperated value files.

Definition at line 78 of file PlotProcessor.h.

std::string PlotProcessor::_TrueJetFlavourColName
protected

The name of the collection of LCIntVec that is the true jet flavour (comes from the steering file).

Definition at line 77 of file PlotProcessor.h.

Referenced by _fillPlots().

const int PlotProcessor::B_JET =5
staticprotected

Useful constant for the jet flavour

Definition at line 90 of file PlotProcessor.h.

Referenced by _fillPlots().

const int PlotProcessor::C_JET =4
staticprotected

Useful constant for the jet flavour

Definition at line 89 of file PlotProcessor.h.

Referenced by _fillPlots().


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