| 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. |
| 20 |
* |
| 21 |
* NOTE: to divide the events in rigidity bins, a physical track is required from which the |
| 22 |
* rigidity can be calculated. It is MANDATORY to add a #TrkPhSinCut object to the selection |
| 23 |
* cuts, to avoid problems when computing rigidity (it will be done if the event survives the |
| 24 |
* selection cuts, so a #TrkPhSinCut in selection cuts will ensure a physical track being present |
| 25 |
* at the moment of rigidity computation). |
| 26 |
* |
| 27 |
*/ |
| 28 |
class EffRigCollection: public EffCollection { |
| 29 |
|
| 30 |
public: |
| 31 |
|
| 32 |
/*! @brief Constructor. |
| 33 |
* |
| 34 |
* @param collectionName The collection's name. |
| 35 |
* @param outFileBase The output file base name. It will produce the same file as the parent class #EffCollection |
| 36 |
* with the total efficiency, plus a similar file (named outFileBase + "-eff-rig.txt") with a |
| 37 |
* row for each rigidity bin. |
| 38 |
* @param rigBinsFile The file with the rigidity bins. |
| 39 |
* @param absRig If true, the absolute rigidity of the selected events will be considered.. |
| 40 |
*/ |
| 41 |
EffRigCollection(const char *collectionName, TString outFileBase = "", TString rigBinsFile = "", bool absRig = false); |
| 42 |
|
| 43 |
/*! @brief Destructor. */ |
| 44 |
~EffRigCollection() { |
| 45 |
|
| 46 |
} |
| 47 |
|
| 48 |
/*! @brief Applies the selection and detector cuts to the current event. |
| 49 |
* |
| 50 |
* @param event The event to analyze. |
| 51 |
* @return CUTOK if the event survives all the selection and detector cuts. |
| 52 |
*/ |
| 53 |
int ApplyCut(PamLevel2 *event); |
| 54 |
|
| 55 |
/*! @brief The post analysis task. |
| 56 |
* |
| 57 |
*/ |
| 58 |
void Finalize(); |
| 59 |
|
| 60 |
private: |
| 61 |
|
| 62 |
bool _absRig; |
| 63 |
vector<float> _bins; |
| 64 |
vector<unsigned int> _selVector; |
| 65 |
vector<unsigned int> _detVector; |
| 66 |
|
| 67 |
unsigned int _outUp, _outDown; |
| 68 |
}; |
| 69 |
|
| 70 |
#endif /* EFFRIGCOLLECTION_H_ */ |