| 1 |
/* |
| 2 |
* EffRigCollection.h |
| 3 |
* |
| 4 |
* Created on: 12/ago/2009 |
| 5 |
* Author: Nicola Mori |
| 6 |
*/ |
| 7 |
|
| 8 |
/*! @file EffRigCollection.h The EffRigCollection class definition file. */ |
| 9 |
|
| 10 |
#ifndef EFFRIGCOLLECTION_H_ |
| 11 |
#define EFFRIGCOLLECTION_H_ |
| 12 |
|
| 13 |
#include "../EffCollection/EffCollection.h" |
| 14 |
|
| 15 |
/*! @brief A rigidity-binned efficiency collection |
| 16 |
* |
| 17 |
* This class inherits from #EffCollection: it has selection and detector4 cuts and actions, and it |
| 18 |
* computes and saves the integrated detector efficiency. Plus, it will compute and save the efficiency |
| 19 |
* for each rigidity bin given to the constructor. The output consists of text files and a ROOT file |
| 20 |
* with the efficiency graph. |
| 21 |
* |
| 22 |
* NOTE: to divide the events in rigidity bins, a physical track is required from which the |
| 23 |
* rigidity can be calculated. It is MANDATORY to add a #TrkPhSinCut object to the selection |
| 24 |
* cuts, to avoid problems when computing rigidity (it will be done if the event survives the |
| 25 |
* selection cuts, so a #TrkPhSinCut in selection cuts will ensure a physical track being present |
| 26 |
* at the moment of rigidity computation). |
| 27 |
* |
| 28 |
*/ |
| 29 |
class EffRigCollection: public EffCollection { |
| 30 |
|
| 31 |
public: |
| 32 |
|
| 33 |
/*! @brief Constructor. |
| 34 |
* |
| 35 |
* @param collectionName The collection's name. The graph in the ROOT output will have the same name, so be |
| 36 |
* careful to name the collection respecting the C++ rules for the names of the variables |
| 37 |
* (eg. don't use - in the name) otherwise the graph will be unusable. |
| 38 |
* @param outFileBase The output file base name. It will produce the same file as the parent class #EffCollection |
| 39 |
* with the total efficiency, plus a similar file (named outFileBase + collection's name + "-rig.txt") |
| 40 |
* with a row for each rigidity bin. At the beginning of each row there will be two additional columns |
| 41 |
* with the edges of the bin. Additionally, a ROOT file (outFileBase + collection's name +"-rig.root") |
| 42 |
* will be produced, containing the efficiency graph. |
| 43 |
* @param rigBinsFile The file with the rigidity bins. |
| 44 |
* @param errMethod The method to use for error computation. Possible values are defined in #EffCollection_ErrMethod. |
| 45 |
* @param owns If true, the collection will own the cuts and the actions, ie., it will |
| 46 |
* destroy them in its destructor. |
| 47 |
*/ |
| 48 |
EffRigCollection(const char *collectionName, TString outFileBase = "", TString rigBinsFile = "", int errMethod = |
| 49 |
EFFERR_ROOT, bool owns = true); |
| 50 |
|
| 51 |
/*! @brief Destructor. */ |
| 52 |
~EffRigCollection() { |
| 53 |
|
| 54 |
} |
| 55 |
|
| 56 |
/*! @brief Applies the selection and detector cuts to the current event. |
| 57 |
* |
| 58 |
* @param event The event to analyze. |
| 59 |
* @return CUTOK if the event survives all the selection and detector cuts. |
| 60 |
*/ |
| 61 |
int ApplyCut(PamLevel2 *event); |
| 62 |
|
| 63 |
/*! @brief The post analysis task. |
| 64 |
* |
| 65 |
*/ |
| 66 |
void Finalize(); |
| 67 |
|
| 68 |
private: |
| 69 |
|
| 70 |
vector<float> _bins; |
| 71 |
vector<unsigned int> _selVector; |
| 72 |
vector<unsigned int> _detVector; |
| 73 |
|
| 74 |
unsigned int _outUp, _outDown; |
| 75 |
|
| 76 |
}; |
| 77 |
|
| 78 |
#endif /* EFFRIGCOLLECTION_H_ */ |