laura is hosted by Hepforge, IPPP Durham
Laura++  v1r1p1
A maximum likelihood fitting package for performing Dalitz-plot analysis.

Class to store the input fit variables. More...

#include <LauFitDataTree.hh>

Public Member Functions

 LauFitDataTree (const TString &rootFileName, const TString &rootTreeName)
 Constructor. More...
 
virtual ~LauFitDataTree ()
 Destructor. More...
 
const TString & fileName () const
 Retrieve the file name. More...
 
const TString & treeName () const
 Retrieve the tree name. More...
 
Bool_t findBranches ()
 Find all of the branches in the tree. More...
 
void readAllData ()
 Read all events from the tree. More...
 
void readExperimentData (UInt_t iExpt)
 Read events only for the given experiment. More...
 
void appendFakePoints (const std::vector< Double_t > &xCoords, const std::vector< Double_t > &yCoords)
 Add fake events to the data. More...
 
UInt_t nBranches () const
 Obtain the number of branches in the tree. More...
 
UInt_t nTreeEvents () const
 Retrieve the number of events in the tree. More...
 
UInt_t nEvents () const
 Retrieve the number of events. More...
 
UInt_t nFakeEvents () const
 Retrieve the number of fake events. More...
 
UInt_t nTotalEvents () const
 Retrieve the total number of events. More...
 
Bool_t haveBranch (const TString &name) const
 Check if the named branch is stored. More...
 
const LauFitDatagetData (UInt_t iEvt) const
 Retrieve the data for a given event. More...
 
void disableAllBranches () const
 Disable all branches. More...
 
void enableAllBranches () const
 Enable all branches. More...
 
void enableBranch (const TString &name) const
 Enable the named branch. More...
 
void disableBranch (const TString &name) const
 Disable the named branch. More...
 

Protected Member Functions

void openFileAndTree ()
 Open the file and tree. More...
 
void loadData ()
 Load events from the tree. More...
 

Private Types

typedef std::map< TString, UInt_t > LauNameIndexMap
 The type used to map the leaf names to the vector indices. More...
 
typedef std::vector< Double_t > LauEventData
 The type used to contain the data for each event. More...
 
typedef std::vector< TLeaf * > LauLeafList
 The type used to hold the leaves. More...
 

Private Attributes

TString rootFileName_
 The name of the file containing the data. More...
 
TString rootTreeName_
 The name of the tree ocntaining the data. More...
 
TFile * rootFile_
 The file containing the data. More...
 
TTree * rootTree_
 The tree containing the data. More...
 
TEventList * eventList_
 A list of the events in the current experiment. More...
 
LauNameIndexMap leafNames_
 Stores the mapping from the leaf names to the vector indices. More...
 
LauEventData eventData_
 Stores the current event. More...
 
LauFitData eventDataOut_
 Stores the current event (for external use) More...
 
LauLeafList leaves_
 The leaf objects. More...
 
std::vector< LauEventDatatreeEvents_
 The events read from the tree. More...
 
std::vector< LauEventDatafakeEvents_
 The fake events, which are not from the tree. More...
 

Detailed Description

Class to store the input fit variables.

Events are loaded from a tree and fake events may be added manually.

Definition at line 37 of file LauFitDataTree.hh.

Member Typedef Documentation

typedef std::vector<Double_t> LauFitDataTree::LauEventData
private

The type used to contain the data for each event.

Definition at line 163 of file LauFitDataTree.hh.

typedef std::vector<TLeaf*> LauFitDataTree::LauLeafList
private

The type used to hold the leaves.

Definition at line 166 of file LauFitDataTree.hh.

typedef std::map<TString,UInt_t> LauFitDataTree::LauNameIndexMap
private

The type used to map the leaf names to the vector indices.

Definition at line 160 of file LauFitDataTree.hh.

Constructor & Destructor Documentation

LauFitDataTree::LauFitDataTree ( const TString &  rootFileName,
const TString &  rootTreeName 
)

Constructor.

Parameters
[in]rootFileNamethe name of the file containing the data
[in]rootTreeNamethe name of the tree containing the data

Definition at line 29 of file LauFitDataTree.cc.

LauFitDataTree::~LauFitDataTree ( )
virtual

Destructor.

Definition at line 41 of file LauFitDataTree.cc.

Member Function Documentation

void LauFitDataTree::appendFakePoints ( const std::vector< Double_t > &  xCoords,
const std::vector< Double_t > &  yCoords 
)

Add fake events to the data.

Used, for example, for storing the information on the histogram bin centres for calculating the DP smearing of mis-reconstructed events, see, for example, LauSimpleFitModel::splitSignalComponent and LauScfMap

Parameters
[in]xCoordsthe values of m13 squared for the fake events
[in]yCoordsthe values of m23 squared for the fake events

Definition at line 182 of file LauFitDataTree.cc.

void LauFitDataTree::disableAllBranches ( ) const

Disable all branches.

Definition at line 243 of file LauFitDataTree.cc.

void LauFitDataTree::disableBranch ( const TString &  name) const

Disable the named branch.

Parameters
[in]namethe name of the branch

Definition at line 258 of file LauFitDataTree.cc.

void LauFitDataTree::enableAllBranches ( ) const

Enable all branches.

Definition at line 248 of file LauFitDataTree.cc.

void LauFitDataTree::enableBranch ( const TString &  name) const

Enable the named branch.

Parameters
[in]namethe name of the branch

Definition at line 253 of file LauFitDataTree.cc.

const TString& LauFitDataTree::fileName ( ) const
inline

Retrieve the file name.

Returns
the file name

Definition at line 54 of file LauFitDataTree.hh.

Bool_t LauFitDataTree::findBranches ( )

Find all of the branches in the tree.

Returns
true if sucessful, otherwise returns false and prints an error message

Definition at line 78 of file LauFitDataTree.cc.

const LauFitData & LauFitDataTree::getData ( UInt_t  iEvt) const

Retrieve the data for a given event.

Parameters
[in]iEvtthe index of the event
Returns
the event data

Definition at line 312 of file LauFitDataTree.cc.

Bool_t LauFitDataTree::haveBranch ( const TString &  name) const

Check if the named branch is stored.

Parameters
[in]namethe name of the branch
Returns
true if the branch is stored, otherwise return false

Definition at line 237 of file LauFitDataTree.cc.

void LauFitDataTree::loadData ( )
protected

Load events from the tree.

If an event list is present, load only those events, otherwise load all events

Definition at line 263 of file LauFitDataTree.cc.

UInt_t LauFitDataTree::nBranches ( ) const

Obtain the number of branches in the tree.

Returns
the number of branches

Definition at line 170 of file LauFitDataTree.cc.

UInt_t LauFitDataTree::nEvents ( ) const
inline

Retrieve the number of events.

Returns
the number of events in the current experiment if one is selected, otherwise the total number of events in the tree

Definition at line 102 of file LauFitDataTree.hh.

UInt_t LauFitDataTree::nFakeEvents ( ) const
inline

Retrieve the number of fake events.

Returns
the number of fake events

Definition at line 108 of file LauFitDataTree.hh.

UInt_t LauFitDataTree::nTotalEvents ( ) const
inline

Retrieve the total number of events.

Returns
the total number of events

Definition at line 114 of file LauFitDataTree.hh.

UInt_t LauFitDataTree::nTreeEvents ( ) const
inline

Retrieve the number of events in the tree.

Returns
the number of events in the tree

Definition at line 96 of file LauFitDataTree.hh.

void LauFitDataTree::openFileAndTree ( )
protected

Open the file and tree.

Definition at line 50 of file LauFitDataTree.cc.

void LauFitDataTree::readAllData ( )

Read all events from the tree.

Definition at line 306 of file LauFitDataTree.cc.

void LauFitDataTree::readExperimentData ( UInt_t  iExpt)

Read events only for the given experiment.

Parameters
[in]iExptthe experiment to read

Definition at line 144 of file LauFitDataTree.cc.

const TString& LauFitDataTree::treeName ( ) const
inline

Retrieve the tree name.

Returns
the tree name

Definition at line 60 of file LauFitDataTree.hh.

Member Data Documentation

LauEventData LauFitDataTree::eventData_
mutableprivate

Stores the current event.

Definition at line 187 of file LauFitDataTree.hh.

LauFitData LauFitDataTree::eventDataOut_
mutableprivate

Stores the current event (for external use)

Definition at line 190 of file LauFitDataTree.hh.

TEventList* LauFitDataTree::eventList_
private

A list of the events in the current experiment.

Definition at line 181 of file LauFitDataTree.hh.

std::vector<LauEventData> LauFitDataTree::fakeEvents_
private

The fake events, which are not from the tree.

Definition at line 199 of file LauFitDataTree.hh.

LauNameIndexMap LauFitDataTree::leafNames_
private

Stores the mapping from the leaf names to the vector indices.

Definition at line 184 of file LauFitDataTree.hh.

LauLeafList LauFitDataTree::leaves_
private

The leaf objects.

Definition at line 193 of file LauFitDataTree.hh.

TFile* LauFitDataTree::rootFile_
private

The file containing the data.

Definition at line 175 of file LauFitDataTree.hh.

TString LauFitDataTree::rootFileName_
private

The name of the file containing the data.

Definition at line 169 of file LauFitDataTree.hh.

TTree* LauFitDataTree::rootTree_
private

The tree containing the data.

Definition at line 178 of file LauFitDataTree.hh.

TString LauFitDataTree::rootTreeName_
private

The name of the tree ocntaining the data.

Definition at line 172 of file LauFitDataTree.hh.

std::vector<LauEventData> LauFitDataTree::treeEvents_
private

The events read from the tree.

Definition at line 196 of file LauFitDataTree.hh.


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