laura is hosted by Hepforge, IPPP Durham
Laura++  3.6.0
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.
 
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.
 
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.
 
void enableAllBranches () const
 Enable all branches.
 
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.
 
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.
 
typedef std::vector< Double_t > LauEventData
 The type used to contain the data for each event.
 
typedef std::vector< TLeaf * > LauLeafList
 The type used to hold the leaves.
 

Private Member Functions

 LauFitDataTree (const LauFitDataTree &rhs)
 Copy constructor (not implemented)
 
LauFitDataTreeoperator= (const LauFitDataTree &rhs)
 Copy assignment operator (not implemented)
 

Private Attributes

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

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 50 of file LauFitDataTree.hh.

Constructor & Destructor Documentation

◆ LauFitDataTree()

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 40 of file LauFitDataTree.cc.

Member Function Documentation

◆ appendFakePoints()

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 234 of file LauFitDataTree.cc.

◆ disableBranch()

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

Disable the named branch.

Parameters
[in]namethe name of the branch

Definition at line 316 of file LauFitDataTree.cc.

◆ enableBranch()

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

Enable the named branch.

Parameters
[in]namethe name of the branch

Definition at line 309 of file LauFitDataTree.cc.

◆ fileName()

const TString& LauFitDataTree::fileName ( ) const
inline

Retrieve the file name.

Returns
the file name

Definition at line 67 of file LauFitDataTree.hh.

◆ findBranches()

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 95 of file LauFitDataTree.cc.

◆ getData()

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 376 of file LauFitDataTree.cc.

◆ haveBranch()

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 293 of file LauFitDataTree.cc.

◆ loadData()

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 323 of file LauFitDataTree.cc.

◆ nBranches()

UInt_t LauFitDataTree::nBranches ( ) const

Obtain the number of branches in the tree.

Returns
the number of branches

Definition at line 222 of file LauFitDataTree.cc.

◆ nEvents()

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 119 of file LauFitDataTree.hh.

◆ nFakeEvents()

UInt_t LauFitDataTree::nFakeEvents ( ) const
inline

Retrieve the number of fake events.

Returns
the number of fake events

Definition at line 128 of file LauFitDataTree.hh.

◆ nTotalEvents()

UInt_t LauFitDataTree::nTotalEvents ( ) const
inline

Retrieve the total number of events.

Returns
the total number of events

Definition at line 134 of file LauFitDataTree.hh.

◆ nTreeEvents()

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 110 of file LauFitDataTree.hh.

◆ readExperimentData()

void LauFitDataTree::readExperimentData ( UInt_t  iExpt)

Read events only for the given experiment.

Parameters
[in]iExptthe experiment to read

Definition at line 169 of file LauFitDataTree.cc.

◆ treeName()

const TString& LauFitDataTree::treeName ( ) const
inline

Retrieve the tree name.

Returns
the tree name

Definition at line 73 of file LauFitDataTree.hh.


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