THaOutput Defines the tree and histogram output for THaAnalyzer. This class reads a file 'output.def' (an example is in /examples) to define which global variables, including arrays, and formulas (THaFormula's), and histograms go to the ROOT output. author: R. Michaels Sept 2002
THaOutput() | |
virtual | ~THaOutput() |
static TClass* | Class() |
virtual Int_t | End() |
virtual TTree* | GetTree() const |
virtual Int_t | Init(const char* filename = "output.def") |
virtual TClass* | IsA() const |
virtual Int_t | ProcEpics(THaEvData* ev, THaEpicsEvtHandler* han) |
virtual Int_t | Process() |
static void | SetVerbosity(Int_t level) |
virtual void | ShowMembers(TMemberInspector&) |
virtual void | Streamer(TBuffer&) |
void | StreamerNVirtual(TBuffer& ClassDef_StreamerNVirtual_b) |
virtual Bool_t | TreeDefined() const |
virtual Int_t | Attach() |
virtual Int_t | BuildBlock(const string& blockn) |
void | BuildList(const vector<std::string>& vdata) |
virtual Int_t | ChkHistTitle(Int_t key, const string& sline) |
string | CleanEpicsName(const string& var) const |
virtual void | ErrFile(Int_t iden, const string& sline) const |
virtual Int_t | FindKey(const string& key) const |
virtual Int_t | LoadFile(const char* filename) |
void | Print() const |
vector<std::string> | reQuote(const vector<std::string>& input) const |
virtual string | StripBracket(const string& var) const |
vector<std::string> | fArrayNames | |
vector<THaVar*> | fArrays | |
vector<std::string> | fCutdef | |
vector<std::string> | fCutnames | |
vector<THaVform*> | fCuts | |
vector<THaEpicsKey*> | fEpicsKey | |
TTree* | fEpicsTree | |
Double_t* | fEpicsVar | |
vector<std::string> | fFormdef | |
vector<std::string> | fFormnames | |
vector<THaVform*> | fFormulas | |
vector<THaVhist*> | fHistos | |
bool | fInit | |
Int_t | fNvar | |
vector<THaOdata*> | fOdata | |
TTree* | fTree | |
vector<std::string> | fVNames | |
Double_t* | fVar | |
vector<THaVar*> | fVariables | |
vector<std::string> | fVarnames | |
static const Int_t | fgNocut | |
static Int_t | fgVerbose | |
static const Int_t | kNbout |
Initialize output system. Required before anything can happen. Only re-attach to variables and re-compile cuts and formulas upon re-initialization (eg: continuing analysis with another file)
Build list of EPICS variables and SCALER variables to add to output.
Get the pointers for the global variables Also, sets the size of the fVariables and fArrays vectors according to the size of the related names array
Process the EPICS data, this fills the trees.
Return integer flag corresponding to
case-insensitive keyword "key" if it exists
If the string contains "[anything]", we strip
it away. In practice this should not be fatal
because your variable will still show up in the tree.
Specialist private function needed by EPICs line parser: The problem is that the line was split by white space, so a line like "'RF On'=42" must be repackaged into one string, i.e. "'RF" and "On'=42" put back together.
To clean up EPICS variable names that contain
bad characters like ":" and arithmetic operations
that confuse TTree::Draw().
Replace all 'badchar' with 'goodchar'
Print error messages about the output definition file.
Printout the definitions. Amount printed depends on verbosity level, set with SetVerbosity().
Parse the string that defines the histogram. The title must be enclosed in single quotes (e.g. 'my title'). Ret value 'result' means: -1 == error, 1 == everything ok.
From the block name, identify and save a specific grouping of global variables by adding them to the fVarnames list. For efficiency, at the end of building the list we should ensure that variables are listed only once. Eventually, we can have some specially named blocks, but for now we simply will use pattern matching, such that block L.* would save all variables from the left spectrometer.