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

Utility class to allow the merging of data files on a expt-by-expt basis. More...

#include <LauMergeDataFiles.hh>

Public Member Functions

 LauMergeDataFiles (const TString &fileName1, const TString &fileName2, const TString &treeName)
 Constructor. More...
 
virtual ~LauMergeDataFiles ()
 Destructor.
 
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.
 
typedef std::map< TString, Int_t > LeafIntegerMap
 Type to relate leaf names with their integer value.
 
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.
 

Protected Member Functions

void openInputFiles ()
 Open the specified input files and check that the trees can be read.
 
void setupInputTrees ()
 Read the structure of the input trees, create appropriate storage and set the branch addresses.
 
void setupOutputTree ()
 Create the structure of the output tree.
 
void findExperiments (TTree *tree, ExptsMap &exptsMap)
 Determine the experiments stored a given tree.
 
Bool_t checkExperimentMaps () const
 Check that the experiments in each tree match.
 
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.
 
void writeFile ()
 Write the output file.
 

Private Attributes

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

Detailed Description

Utility class to allow the merging of data files on a expt-by-expt basis.

The files are merged such that events for expt 0 from tree 1 will be followed by events for expt 0 from tree 2, then expt 1 from tree1, expt 1 from tree 2, etc.

Definition at line 43 of file LauMergeDataFiles.hh.

Constructor & Destructor Documentation

◆ LauMergeDataFiles()

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 38 of file LauMergeDataFiles.cc.

Member Function Documentation

◆ process()

void LauMergeDataFiles::process ( const TString &  fileName)

Do the merge.

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

Definition at line 181 of file LauMergeDataFiles.cc.


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