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