| 1 |
/* |
| 2 |
* CaloChi2HistoAction.h |
| 3 |
* |
| 4 |
* Created on: 04/ago/2009 |
| 5 |
* Author: Nicola Mori |
| 6 |
*/ |
| 7 |
|
| 8 |
/*! @file CaloChi2HistoAction.h The CaloChi2HistoAction class declaration file. */ |
| 9 |
|
| 10 |
#ifndef CALOCHI2HISTOACTION_H_ |
| 11 |
#define CALOCHI2HISTOACTION_H_ |
| 12 |
|
| 13 |
#include "../CollectionAction/CollectionAction.h" |
| 14 |
#include "../../CaloAxis2.h" |
| 15 |
#include <TH1F.h> |
| 16 |
#include <TH2F.h> |
| 17 |
|
| 18 |
/*! @brief An action that fills a CALO Chi2 histogram. The value of Chi2 is obtained from CaloAxis objects. */ |
| 19 |
class CaloChi2HistoAction: public CollectionAction { |
| 20 |
public: |
| 21 |
|
| 22 |
/*! @brief Constructor. |
| 23 |
* |
| 24 |
* Note that this action does NOT perform the fit of the CALO track, so the fitting procedure must be already done by the |
| 25 |
* CaloAxis objects pointed by xAxis and yAxis. |
| 26 |
* |
| 27 |
* @param actionName The action's name. |
| 28 |
* @param outFileName The output file name. |
| 29 |
* @param xAxis The X axis CaloAxis object. |
| 30 |
* @param yAxis The Y axis CaloAxis object. |
| 31 |
* @param min The lower limit of the histogram's X axis. |
| 32 |
* @param max The upper limit of the histogram's X axis. |
| 33 |
* @param nBins The number of bins. |
| 34 |
* @param mode The mode of ROOT file creation (see documentation of TFile constructor |
| 35 |
* in ROOT's reference guide). |
| 36 |
*/ |
| 37 |
CaloChi2HistoAction(const char *actionName, TString outFileName, CaloAxis *xAxis, CaloAxis *yAxis, float min = 0., |
| 38 |
float max = 1., unsigned int nBins = 100, TString mode = "UPDATE"); |
| 39 |
|
| 40 |
/*! @brief Destructor. */ |
| 41 |
~CaloChi2HistoAction() { |
| 42 |
} |
| 43 |
|
| 44 |
/*! @brief Fills histogram with the selected event. |
| 45 |
* |
| 46 |
* @param event The selected event. |
| 47 |
*/ |
| 48 |
void OnGood(PamLevel2 *event); |
| 49 |
|
| 50 |
/*! @brief Writes the histogram to the output ROOT file.*/ |
| 51 |
void Finalize(); |
| 52 |
|
| 53 |
private: |
| 54 |
|
| 55 |
TString _outFileName; |
| 56 |
CaloAxis *_xAxis, *_yAxis; |
| 57 |
TString _mode; |
| 58 |
TH1F _xHisto, _yHisto; |
| 59 |
TH2F _xyHisto; |
| 60 |
}; |
| 61 |
#endif /* CALOCHI2HISTOACTION_H_ */ |