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

#include <LauMergeDataFiles.hh>

Public Member Functions

 LauMergeDataFiles (const TString &fileName1, const TString &fileName2, const TString &treeName)
 Constructor. More...
 
virtual ~LauMergeDataFiles ()
 Destructor. More...
 
void process (const TString &fileName)
 Do the merge. More...
 

Protected Types

typedef std::map< TString,
Double_t > 
LeafDoubleMap
 Type to relate leaf names with their double-precision value. More...
 
typedef std::map< TString, Int_t > LeafIntegerMap
 Type to relate leaf names with their integer value. More...
 
typedef std::map< Int_t,
std::pair< Int_t, Int_t > > 
ExptsMap
 Type to hold for each experiment the first and last entry numbers in a tree. More...
 

Protected Member Functions

void openInputFiles ()
 Open the specified input files and check that the trees can be read. More...
 
void setupInputTrees ()
 Read the structure of the input trees, create appropriate storage and set the branch addresses. More...
 
void setupOutputTree ()
 Create the structure of the output tree. More...
 
void findExperiments (TTree *tree, ExptsMap &exptsMap)
 Determine the experiments stored a given tree. More...
 
Bool_t checkExperimentMaps () const
 Check that the experiments in each tree match. More...
 
void readExperiment (TTree *tree, const ExptsMap::const_iterator &exptsMap, Int_t offset)
 Read the entries for a given experiment from the given tree and store in the output tree. More...
 
void writeFile ()
 Write the output file. More...
 

Private Attributes

TString fileName1_
 Name of file 1. More...
 
TString fileName2_
 Name of file 2. More...
 
TString treeName_
 Name of the tree. More...
 
TFile * inputFile1_
 Input file 1. More...
 
TFile * inputFile2_
 Input file 2. More...
 
TTree * inputTree1_
 Input tree 1. More...
 
TTree * inputTree2_
 Input tree 2. More...
 
TFile * outputFile_
 Output file. More...
 
TTree * outputTree_
 Output tree. More...
 
Int_t iExpt_
 Storage for the experiment index variable. More...
 
Int_t iEvtWithinExpt_
 Storage for the event-within-experiment index variable. More...
 
LeafDoubleMap doubleVars_
 Storage for double-precision leaves. More...
 
LeafIntegerMap integerVars_
 Storage for integer leaves. More...
 
ExptsMap tree1Expts_
 Experiment -> first and last tree entry for tree 1. More...
 
ExptsMap tree2Expts_
 Experiment -> first and last tree entry for tree 2. More...
 

Detailed Description

Definition at line 43 of file LauMergeDataFiles.hh.

Member Typedef Documentation

typedef std::map< Int_t,std::pair<Int_t,Int_t> > LauMergeDataFiles::ExptsMap
protected

Type to hold for each experiment the first and last entry numbers in a tree.

Definition at line 69 of file LauMergeDataFiles.hh.

typedef std::map<TString,Double_t> LauMergeDataFiles::LeafDoubleMap
protected

Type to relate leaf names with their double-precision value.

Definition at line 65 of file LauMergeDataFiles.hh.

typedef std::map<TString,Int_t> LauMergeDataFiles::LeafIntegerMap
protected

Type to relate leaf names with their integer value.

Definition at line 67 of file LauMergeDataFiles.hh.

Constructor & Destructor Documentation

LauMergeDataFiles::LauMergeDataFiles ( const TString &  fileName1,
const TString &  fileName2,
const TString &  treeName 
)

Constructor.

Parameters
[in]fileName1name of first file to be merged
[in]fileName2name of second file to be merged
[in]treeNamename of the tree to read from the input files

Definition at line 37 of file LauMergeDataFiles.cc.

LauMergeDataFiles::~LauMergeDataFiles ( )
virtual

Destructor.

Definition at line 50 of file LauMergeDataFiles.cc.

Member Function Documentation

Bool_t LauMergeDataFiles::checkExperimentMaps ( ) const
protected

Check that the experiments in each tree match.

Definition at line 241 of file LauMergeDataFiles.cc.

void LauMergeDataFiles::findExperiments ( TTree *  tree,
ExptsMap exptsMap 
)
protected

Determine the experiments stored a given tree.

Definition at line 211 of file LauMergeDataFiles.cc.

void LauMergeDataFiles::openInputFiles ( )
protected

Open the specified input files and check that the trees can be read.

Definition at line 68 of file LauMergeDataFiles.cc.

void LauMergeDataFiles::process ( const TString &  fileName)

Do the merge.

Parameters
[in]fileNamename of file to which to write the merged tree

Definition at line 170 of file LauMergeDataFiles.cc.

void LauMergeDataFiles::readExperiment ( TTree *  tree,
const ExptsMap::const_iterator &  exptsMap,
Int_t  offset 
)
protected

Read the entries for a given experiment from the given tree and store in the output tree.

Definition at line 265 of file LauMergeDataFiles.cc.

void LauMergeDataFiles::setupInputTrees ( )
protected

Read the structure of the input trees, create appropriate storage and set the branch addresses.

Definition at line 94 of file LauMergeDataFiles.cc.

void LauMergeDataFiles::setupOutputTree ( )
protected

Create the structure of the output tree.

Definition at line 144 of file LauMergeDataFiles.cc.

void LauMergeDataFiles::writeFile ( )
protected

Write the output file.

Definition at line 282 of file LauMergeDataFiles.cc.

Member Data Documentation

LeafDoubleMap LauMergeDataFiles::doubleVars_
private

Storage for double-precision leaves.

Definition at line 116 of file LauMergeDataFiles.hh.

TString LauMergeDataFiles::fileName1_
private

Name of file 1.

Definition at line 88 of file LauMergeDataFiles.hh.

TString LauMergeDataFiles::fileName2_
private

Name of file 2.

Definition at line 90 of file LauMergeDataFiles.hh.

Int_t LauMergeDataFiles::iEvtWithinExpt_
private

Storage for the event-within-experiment index variable.

Definition at line 113 of file LauMergeDataFiles.hh.

Int_t LauMergeDataFiles::iExpt_
private

Storage for the experiment index variable.

Definition at line 111 of file LauMergeDataFiles.hh.

TFile* LauMergeDataFiles::inputFile1_
private

Input file 1.

Definition at line 95 of file LauMergeDataFiles.hh.

TFile* LauMergeDataFiles::inputFile2_
private

Input file 2.

Definition at line 97 of file LauMergeDataFiles.hh.

TTree* LauMergeDataFiles::inputTree1_
private

Input tree 1.

Definition at line 100 of file LauMergeDataFiles.hh.

TTree* LauMergeDataFiles::inputTree2_
private

Input tree 2.

Definition at line 102 of file LauMergeDataFiles.hh.

LeafIntegerMap LauMergeDataFiles::integerVars_
private

Storage for integer leaves.

Definition at line 118 of file LauMergeDataFiles.hh.

TFile* LauMergeDataFiles::outputFile_
private

Output file.

Definition at line 105 of file LauMergeDataFiles.hh.

TTree* LauMergeDataFiles::outputTree_
private

Output tree.

Definition at line 107 of file LauMergeDataFiles.hh.

ExptsMap LauMergeDataFiles::tree1Expts_
private

Experiment -> first and last tree entry for tree 1.

Definition at line 121 of file LauMergeDataFiles.hh.

ExptsMap LauMergeDataFiles::tree2Expts_
private

Experiment -> first and last tree entry for tree 2.

Definition at line 123 of file LauMergeDataFiles.hh.

TString LauMergeDataFiles::treeName_
private

Name of the tree.

Definition at line 92 of file LauMergeDataFiles.hh.


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