PamCut: FluxHistoAction Class Reference

# FluxHistoAction Class Reference

An action that fills a flux histogram. More...

`#include <FluxHistoAction.h>`

Inheritance diagram for FluxHistoAction:

List of all members.

## Public Member Functions
| FluxHistoAction (const char *actionName, TString outFileBase, TString rigBinsFile)
| Constructor.
| ~FluxHistoAction ()
| Destructor.
void | OnGood (PamLevel2 *event)
| Fills histogram with the selected event.
void | Finalize ()
| Writes the histogram to the output files (ASCII and ROOT).
## Private Attributes
TString | _outFileBase
vector< float > | _bins
TH1I | _rootHisto
vector< uint64_t > | _textHisto

## Detailed Description

An action that fills a flux histogram.

This action reads a rigidity binning from a file and fills a flux histogram (text and ROOT format). Currently, it fills an event-count histogram: in future implementations, it could also read live time, efficiency and geometrical factor from external files and fill a true flux histogram.

Definition at line 24 of file FluxHistoAction.h.

## Constructor & Destructor Documentation

FluxHistoAction::FluxHistoAction | ( | const char * | actionName,
|  | TString | outFileBase,
|  | TString | rigBinsFile |
| ) |  |  |

Constructor.

outFileBase is the base name for output file: Finalize will add .txt for ASCII output and .root for ROOT output. outFileBase has to contain the path (otherwise, files will be saved in the current directory). The file containing the rigidity bins must be a text file. It must contain both the lower and upper limits of the rigidity axis, so that if it contains N values it defines a set of N-1 bins.

Parameters:

  | actionName | The action's name.
  | outFileBase | The output file base name.
  | rigBinsFile | The file containing the rigidity bins

Definition at line 12 of file FluxHistoAction.cpp.

References _bins, _rootHisto, and _textHisto.

FluxHistoAction::~FluxHistoAction | ( |  | ) | `[inline]`

Destructor.

Definition at line 43 of file FluxHistoAction.h.

## Member Function Documentation

void FluxHistoAction::Finalize | ( |  | ) | `[virtual]`

Writes the histogram to the output files (ASCII and ROOT).

The output consists of a text file and of a ROOT file where the 1-dimensional rigidity histogram (TH1F) is saved. The format of the text output is: (lower bin limit) (upper bin limit) (# of events).

Implements CollectionAction.

Definition at line 79 of file FluxHistoAction.cpp.

References _bins, _outFileBase, _rootHisto, _textHisto, and CollectionAction::GetName().

void FluxHistoAction::OnGood | ( | PamLevel2 * | event | ) | `[virtual]`

Fills histogram with the selected event.

Parameters:

  | event | The selected event.

Implements CollectionAction.

Definition at line 50 of file FluxHistoAction.cpp.

References _bins, _rootHisto, and _textHisto.

## Member Data Documentation

vector<float> FluxHistoAction::_bins`[private]`

Definition at line 62 of file FluxHistoAction.h.

Referenced by Finalize(), FluxHistoAction(), and OnGood().

TString FluxHistoAction::_outFileBase`[private]`

Definition at line 61 of file FluxHistoAction.h.

Referenced by Finalize().

TH1I FluxHistoAction::_rootHisto`[private]`

Definition at line 63 of file FluxHistoAction.h.

Referenced by Finalize(), FluxHistoAction(), and OnGood().

vector<uint64_t> FluxHistoAction::_textHisto`[private]`

Definition at line 64 of file FluxHistoAction.h.

Referenced by Finalize(), FluxHistoAction(), and OnGood().

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

- CollectionActions/FluxHistoAction/FluxHistoAction.h
- CollectionActions/FluxHistoAction/FluxHistoAction.cpp