| 1 |
|
/* |
| 2 |
|
* TofDedxVsRigHistoAction.h |
| 3 |
|
* |
| 4 |
|
* Created on: 22-jul-2011 |
| 5 |
|
* Author: Nicola Mori |
| 6 |
|
*/ |
| 7 |
|
|
| 8 |
|
/*! @file TofDedxVsRigHistoAction.h The TofDedxVsRigHistoAction class declaration file. */ |
| 9 |
|
|
| 10 |
|
#ifndef TOFDEDXVSRIGHISTOACTION_H_ |
| 11 |
|
#define TOFDEDXVSRIGHISTOACTION_H_ |
| 12 |
|
|
| 13 |
|
#include "../Histo2DAction/Histo2DAction.h" |
| 14 |
|
|
| 15 |
|
/*! @brief An action that fills a TOF dE/dx Vs abs(rigidity) histogram. */ |
| 16 |
|
class TofDedxVsRigHistoAction: public Histo2DAction<Int_t> { |
| 17 |
|
public: |
| 18 |
|
|
| 19 |
|
/*! @brief Constructor. |
| 20 |
|
* |
| 21 |
|
* @param actionName The action's name. |
| 22 |
|
* @param layers The layers from which dE/dx is measured. See #TOFLAYERS. If combinations like |
| 23 |
|
* S11+S12 are used, the mean dE/dx will be used. dE/dx are computed using track from tracker. |
| 24 |
|
* @param outFileBase The file base name for the ROOT histogram output (".root" will be appended). |
| 25 |
|
* If "", no ROOT output will be produced. |
| 26 |
|
* @param mode The mode of ROOT file creation (see documentation of TFile constructor |
| 27 |
|
* in ROOT's reference guide). |
| 28 |
|
* @param outRoot If true, an output ROOT file named outFileBase + ".root" will be produced. |
| 29 |
|
* @param outText If true, an output text file named outFileBase + ".txt" will be produced. It will overwrite an |
| 30 |
|
* eventually existing file with the same name. |
| 31 |
|
* @param title The ROOT histogram title. If "", the constructor will create a title based on the layers parameter. |
| 32 |
|
*/ |
| 33 |
|
TofDedxVsRigHistoAction(const char *actionName, unsigned int layers, TString outFileBase = |
| 34 |
|
"", TString mode = "UPDATE", bool outRoot = true, bool outText = true, TString title = ""); |
| 35 |
|
|
| 36 |
|
/*! @brief Destructor. */ |
| 37 |
|
~TofDedxVsRigHistoAction() { |
| 38 |
|
} |
| 39 |
|
|
| 40 |
|
/*! @brief Fills histogram with the selected event. |
| 41 |
|
* |
| 42 |
|
* @param event The selected event. |
| 43 |
|
*/ |
| 44 |
|
void OnGood(PamLevel2 *event); |
| 45 |
|
|
| 46 |
|
/*! @brief Returns the number of bad events. |
| 47 |
|
* |
| 48 |
|
* @return The number of events which were discarded because they contain a bad enrgy measurement |
| 49 |
|
* on at least one of the selected layers. |
| 50 |
|
*/ |
| 51 |
|
unsigned int GetNBadEvents() { |
| 52 |
|
return _badEvents; |
| 53 |
|
} |
| 54 |
|
private: |
| 55 |
|
|
| 56 |
|
unsigned int _layers; |
| 57 |
|
unsigned int _nLayers; |
| 58 |
|
unsigned int _badEvents; |
| 59 |
|
|
| 60 |
|
}; |
| 61 |
|
#endif /* TOFDEDXVSRIGHISTOACTION_H_ */ |