--- PamCut/Collections/EffRigCollection/EffRigCollection.h 2009/08/12 14:18:37 1.1 +++ PamCut/Collections/EffRigCollection/EffRigCollection.h 2011/07/12 17:36:03 1.6 @@ -10,13 +10,12 @@ #ifndef EFFRIGCOLLECTION_H_ #define EFFRIGCOLLECTION_H_ -#include "../EffCollection/EffCollection.h" +#include "../BinnedEffCollection/BinnedEffCollection.h" -/*! @brief A rigidity-binned efficiency collection +/*! @brief A rigidity binned efficiency collection * - * This class inherits from #EffCollection: it has selection and detector4 cuts and actions, and it - * computes and saves the integrated detector efficiency. Plus, it will compute and save the efficiency - * for each rigidity bin given to the constructor. + * This class inherits from #BinnedEffCollection: it only implements the #GetBinValue method + * to return event rigidity with sign. * * NOTE: to divide the events in rigidity bins, a physical track is required from which the * rigidity can be calculated. It is MANDATORY to add a #TrkPhSinCut object to the selection @@ -25,46 +24,39 @@ * at the moment of rigidity computation). * */ -class EffRigCollection: public EffCollection { +class EffRigCollection: public BinnedEffCollection { public: /*! @brief Constructor. * - * @param collectionName The collection's name. + * @param collectionName The collection's name. The graph in the ROOT output will have the same name, so be + * careful to name the collection respecting the C++ rules for the names of the variables + * (eg. don't use - in the name) otherwise the graph will be unusable. * @param outFileBase The output file base name. It will produce the same file as the parent class #EffCollection - * with the total efficiency, plus a similar file (named outFileBase + "-eff-rig.txt" with a - * row for each rigidity bin. + * with the total efficiency, plus a similar file (named outFileBase + collection's name + "-rig.txt") + * with a row for each rigidity bin. At the beginning of each row there will be two additional columns + * with the edges of the bin. Additionally, a ROOT file (outFileBase + collection's name +"-rig.root") + * will be produced, containing the efficiency graph. * @param rigBinsFile The file with the rigidity bins. - * @param absRig If true, the absolute rigidity of the selected events will be considered.. + * @param errMethod The method to use for error computation. Possible values are defined in #EffCollection_ErrMethod. + * @param owns If true, the collection will own the cuts and the actions, ie., it will + * destroy them in its destructor. */ - EffRigCollection(const char *collectionName, TString outFileBase = "", TString rigBinsFile = "", bool absRig = false); + EffRigCollection(const char *collectionName, TString outFileBase = "", TString rigBinsFile = "", int errMethod = + EFFERR_ROOT, bool owns = true); /*! @brief Destructor. */ ~EffRigCollection() { } - /*! @brief Applies the selection and detector cuts to the current event. + /*! @brief The value of binning parameter (rigidity). * - * @param event The event to analyze. - * @return CUTOK if the event survives all the selection and detector cuts. + * @param event The current event. + * @return The rigidity (with sign) of current event. */ - int ApplyCut(PamLevel2 *event); - - /*! @brief The post analysis task. - * - */ - void Finalize(); - -private: - - bool _absRig; - vector _bins; - vector _selVector; - vector _detVector; - - unsigned int _outUp, _outDown; + float GetBinValue(PamLevel2 *event); }; #endif /* EFFRIGCOLLECTION_H_ */