class HPTools

_HADES_CLASS_DESCRIPTION


 HPTools
 Hydra Processing Tools

            Author: Peter W.Zumbruch
           Contact: P.Zumbruch@gsi.de
           Created: Mar 21, 2002
 Last modification: Oct 08, 2005

 File: $RCSfile: hptools.cc,v $
 Version: $Revision: 1.41 $
 Modified by $Author: wuestenf $ on $Date: 2008-09-23 13:21:45 $

Function Members (Methods)

public:
HPTools()
HPTools(const HPTools&)
~HPTools()
static Int_taddSourceList(HDataSource* source, TString inputFile, TString inDir, Int_t refid = -1)
static TClass*Class()
static voidgeantPidAxis(TH1*, TString axis = "X")
static voidgeantProcessAxis(TH1*, TString axis = "X")
static TStringgetGeantPidNameLatex(Int_t index)
static TStringgetGeantProcessNameLatex(Int_t index)
static TH1F*getPairPidHistogramm(Axis_t min = 0, Axis_t max = 0, Int_t extBins = 0, Double_t extBinning = 1)
static Double_tgetRhoVertex(HGeomVector& vector)
static Int_thadesEventLoop(Int_t nEvents, Int_t startEvt)
static Bool_thadesInit()
virtual TClass*IsA() const
static Int_tmainFileInDirOutDirNevtStar(Int_t argc, Char_t** argv, Int_t (*) (TString outDir, TString inputDir, TString inputFile, Int_t nEvents, Int_t startEvt) function)
static Bool_tmdcDetectorSetup(TString beamtime)
static Bool_tmdcDetectorSetup(const Char_t* beamtime)
static Bool_tmdcDetectorSetup(Int_t (*)[4] mdcMods)
HPTools&operator=(const HPTools&)
static voidplot_pty_PZ(Double_t mass = 139.)
static voidplotGeantAxis(TAxis* axis)
static voidplotGeantProcessAxis(TAxis* axis)
static voidplotPolarSectorGrid()
static voidprintAnalysisFileInfo(Int_t startEvt, TString inputDir, TString outFile, TString outDir)
static voidprintCounter(Int_t eventiter, Int_t nEvents, Float_t stepsize = 0.05)
static voidsetPersistency(Bool_t b, Cat_t* persistentArray, UInt_t nPersistent, UInt_t clean = 0)
static voidsetPersistencyClean(Bool_t b, Cat_t* persistentArray, UInt_t nPersistent)
virtual voidShowMembers(TMemberInspector& insp, char* parent)
virtual voidStreamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& b)
static Bool_tusageFileInDirOutDirNevtStart(const Char_t* name)
static Bool_tusageFileInDirOutDirNevtStart(TString name)
private:
static Double_tptinv(Double_t pt, Double_t theta, Double_t mass)
static Double_tPZf_pty1(Double_t* x, Double_t* par)

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

Int_t addSourceList(HDataSource* source, TString inputFile, TString inDir, Int_t refid = -1)
 expects either a HRootSource (inheritant) or HldFileSource (inheritant) as source
 adds to this given HDataSource source:

   (a) inputFile ends with ".root or .hld": the root/hld inputfile
       to be found in inDir with referenceId refId (default:-1)

   (b) inputFile ends with ".txt": the list of root/hldfiles contained in inputFile
       to be found in inDir with referenceId refId (default:-1)

 if inputFile is not valid exit with exit(EXIT_FAILURE);

 in case of an HRootSource it is check whether a Tree is contained
  (no)  exits with with exit(EXIT_FAILURE);
  (yes) adds all entries together

 return values:
 RootSource: number of Events (default:-1)
 HldSource: (default:-1)

 inputfile example:
 # comment line
 file1.root
 #file2.root
 file3.root
void geantPidAxis(TH1* , TString axis = "X")
 replaces for a given histogramm hist with geant pid numbers on axis
 the numbers by the pid name
void plotGeantAxis(TAxis* axis)
 replaces for a the active histogramm with geant pid numbers on axis
 the numbers by the pid name
void geantProcessAxis(TH1* , TString axis = "X")
 replaces for a given histogramm hist with geant process numbers on axis
 the numbers by the process name
void plotGeantProcessAxis(TAxis* axis)
 replaces for the active histogramm hist with geant process numbers on axis
 the numbers by the process name
void plotPolarSectorGrid()
 plots onto a polar plot a grid corresponding to the HADES orientation
Double_t ptinv(Double_t pt, Double_t theta, Double_t mass)
 function returning the relation of pt to theta for a given mass
Double_t PZf_pty1(Double_t* x, Double_t* par)
void plot_pty_PZ(Double_t mass = 139.)
 plotting grid of constant lab momentum and constant angles for a given mass
 over the active histogramm assuming that it represents a pty distribution
void printAnalysisFileInfo(Int_t startEvt, TString inputDir, TString outFile, TString outDir)
 depending on the startEvt number
 the file information used in my analysis scripts is printed to stdout
 startEvt == -1111: >> "outputName outputFile"
 startEvt == -2222: >> "outputDir outputDirectory"
 startEvt == -3333: >> "inputDir inputDirectory"
 used to get information how the parameters about files are treated and processed before
 running the macro itself completely
Bool_t mdcDetectorSetup(TString beamtime)
 function to add mdc detector to hades detector
 valid beamtime names are:
                           nov01
                           nov02
                           sep03
                           jan04
                           aug04
                           jan05
                           sep05
                           apr06
                           may06
                           apr07
                           oct07
Bool_t mdcDetectorSetup(Int_t (*mdcMods)[4])
 sets mdc Detector setup with the 6*4 matrix given via mdcMods
  i.e. sep03_mdcMods[6][4] = { {1,1,1,1},
                               {1,1,1,1},
 			           {1,1,1,0},
 				   {1,1,1,1},
 				   {1,1,1,1},
 				   {1,1,1,0} };
void printCounter(Int_t eventiter, Int_t nEvents, Float_t stepsize = 0.05)
 print a counter message if eventiter is x = eventiter*stepsize %
 where stepsize is given in percentage
 default stepsize 5% = 0.05
Bool_t hadesInit()
 calls hades::init and checks the output
 if it has failed the hades object is deleted and the function exits with exit_code -1
 returns kFALSE if init has failed
 kTRUE otherwise
Int_t hadesEventLoop(Int_t nEvents, Int_t startEvt)
 calls hades event loop
 generates info output
 returns number of processed events
Bool_t usageFileInDirOutDirNevtStart(const Char_t *name)
 prints the usage for an executable: name
 of the following syntax
    executable inputfile inDir outputDir [number of events [start evt]]

 returns always kTRUE;
Int_t mainFileInDirOutDirNevtStar(Int_t argc, Char_t **argv, Int_t (*function) (TString outDir, TString inputDir, TString inputFile, Int_t nEvents, Int_t startEvt))
 main function part for compiled macros
 the macro function must have the syntax

 Int_t function(TString outDir, TString inputDir, TString inputFile, Int_t nEvents=0, Int_t startEvt=0)
 the function should also contain a call to the function HPTools::printAnalysisFileInfo

 passing this its function pointer (i.e. just its name without anything else)
 together with argc and argv from the main function
 to this function
 delivers you the following behavior

     (suppose the compiled executable's name is executable)

      executable accepts the following usage:

      executable inputfile inDir outputDir [number of events [start evt]]
      in addition if either 'number of events' or 'start evt' is set to
      'OUTPUTNAME', 'OUTPUTDIR', 'INPUTDIR', 'EXECUTABLE' (case insensitive)
      the corresponding information is printed to stdout


 Behaviour

 (0) in any (yet known) case the return value is EXIT_SUCCESS

 (1) passing less than 3 or more than 5 arguments to the function results in a
     call to HPTools::usageFileInDirOutDirNevtStart
     to explain right behavior

 (1a) if called with option -h HPTools::usageFileInDirOutDirNevtStart will be called (help)

 (2) function is called corresponding to aboves definition of executable

 (3) if either 'number of events' or 'start evt' is set to
     'OUTPUTNAME', 'OUTPUTDIR', 'INPUTDIR', 'EXECUTABLE' (case insensitive)
     the corresponding information is printed to stdout
     by calling the function with predefined negative 'start evt' values
     making usage of HPTools::printAnalysisFileInfo

void setPersistency(Bool_t b, Cat_t* persistentArray, UInt_t nPersistent, UInt_t clean = 0)
 sets the persistency for the categories given in persistentArray[nPersistent]
 to value of b
 if clean > 0:
 1. setting the first 'clean' categories' persistency to the inverse of b
 2. sets the categories listet in the array to b
 if not only item 2 is executed
TH1F* getPairPidHistogramm(Axis_t min = 0, Axis_t max = 0, Int_t extBins = 0, Double_t extBinning = 1)
 returns a histogram with a variable binning
 to plot geant pair ids like 8009 14014 ...
 the axis is labeled correspondingly
 min and max set a range
 if extBins is set, extBins with extBinning [default=1] are added
TString getGeantPidNameLatex(Int_t index)
 provides for geant pid index corresponding pid name in latex representation
TString getGeantProcessNameLatex(Int_t index)
 provides for geant process index corresponding process name in latex representation
Bool_t mdcDetectorSetup(TString beamtime)
Double_t getRhoVertex(HGeomVector& vector)
Bool_t usageFileInDirOutDirNevtStart(const Char_t *name)
void setPersistencyClean(Bool_t b, Cat_t* persistentArray, UInt_t nPersistent)
{ setPersistency(b, persistentArray, nPersistent, 1000); }

Last change: Sat May 22 13:06:03 2010
Last generated: 2010-05-22 13:06

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.