1 |
pam-fi |
1.1 |
/* |
2 |
|
|
* TofDedxVsBetaHistoAction.h |
3 |
|
|
* |
4 |
|
|
* Created on: 25-giu-2009 |
5 |
|
|
* Author: Nicola Mori |
6 |
|
|
*/ |
7 |
|
|
|
8 |
|
|
/*! @file TofDedxVsBetaHistoAction.h The TofDedxVsBetaHistoAction class declaration file. */ |
9 |
|
|
|
10 |
|
|
#ifndef TOFDEDXVSBETAHISTOACTION_H_ |
11 |
|
|
#define TOFDEDXVSBETAHISTOACTION_H_ |
12 |
|
|
|
13 |
|
|
#include "../CollectionAction/CollectionAction.h" |
14 |
|
|
#include <TH2F.h> |
15 |
|
|
|
16 |
|
|
/*! @brief An action that fills a TOF dE/dx Vs beta histogram. */ |
17 |
|
|
class TofDedxVsBetaHistoAction: public CollectionAction { |
18 |
|
|
public: |
19 |
|
|
|
20 |
|
|
/*! @brief Constructor. |
21 |
|
|
* * |
22 |
|
|
* @param actionName The action's name. |
23 |
|
|
* @param outFileName The output file name. |
24 |
|
|
* @param layer The layer from which dE/dx is measured. See #TOFLAYERS. If combinations like |
25 |
|
|
* S11+S12 are used, the mean dE/dx will be used. |
26 |
|
|
* @param mode The mode of ROOT file creation (see documentation of TFile constructor |
27 |
|
|
* in ROOT's reference guide). |
28 |
|
|
* @param minDedx The lower limit for dE/dx axis (in MIP). |
29 |
|
|
* @param maxDedx The upper limit for dE/dx axis (in MIP). |
30 |
|
|
* @param nBinsDedx The number of dE/dx bins. |
31 |
|
|
* @param minBeta The lower limit for beta axis. |
32 |
|
|
* @param maxBeta The upper limit for beta axis. |
33 |
|
|
* @param nBinsBeta The number of beta bins. |
34 |
|
|
*/ |
35 |
|
|
TofDedxVsBetaHistoAction(const char *actionName, TString outFileName, unsigned int layers, TString mode = "UPDATE", |
36 |
|
|
float minDedx = 0., float maxDedx = 50., unsigned int nBinsDedx = 100, float minBeta = 0., float maxBeta = 2., |
37 |
|
|
unsigned int nBinsBeta = 100); |
38 |
|
|
|
39 |
|
|
/*! @brief Destructor. */ |
40 |
|
|
~TofDedxVsBetaHistoAction() { |
41 |
|
|
} |
42 |
|
|
|
43 |
|
|
/*! @brief Fills histogram with the selected event. |
44 |
|
|
* |
45 |
|
|
* @param event The selected event. |
46 |
|
|
*/ |
47 |
|
|
void OnGood(PamLevel2 *event); |
48 |
|
|
|
49 |
|
|
/*! @brief Writes the histogram to the output ROOT file.*/ |
50 |
|
|
void Finalize(); |
51 |
|
|
|
52 |
|
|
/*! Returns the number of bad events. |
53 |
|
|
* |
54 |
|
|
* Bad events are those events for which no valid dE/dx information (dE/dx > 0 && dE/dx < 4090) |
55 |
|
|
* can be found for any layer. |
56 |
|
|
*/ |
57 |
|
|
unsigned int GetNBadEvents() { |
58 |
|
|
return _badEvents; |
59 |
|
|
} |
60 |
|
|
private: |
61 |
|
|
|
62 |
|
|
TString _outFileName; |
63 |
|
|
unsigned int _layers; |
64 |
|
|
unsigned int _nLayers; |
65 |
|
|
unsigned int _badEvents; |
66 |
|
|
TH2F _histo; |
67 |
|
|
TString _mode; |
68 |
|
|
|
69 |
|
|
}; |
70 |
|
|
#endif /* TOFDEDXVSBETAHISTOACTION_H_ */ |