--- PamCut/Collections/EffCollection/EffCollection.h 2009/09/25 15:02:03 1.5 +++ PamCut/Collections/EffCollection/EffCollection.h 2010/01/27 15:59:11 1.8 @@ -12,10 +12,10 @@ #include "../VerboseCollection/VerboseCollection.h" -/*! @enum Flags to select the method of error computation */ -enum EffRigCollection_ErrMethod { - EFFRIG_SERGIO, ///< Flag for Sergio Ricciarini's Fortran routine - EFFRIG_ROOT +/*! @enum EffCollection_ErrMethod to select the method of error computation */ +enum EffCollection_ErrMethod { + EFFERR_SERGIO, ///< Flag for Sergio Ricciarini's Fortran routine + EFFERR_ROOT ///< Flag for ROOT TGraphAsymErrors::BayesDivide() }; @@ -45,13 +45,15 @@ * * @param collectionName The collection's name. * @param outFileBase The output file base name. If "", no file output will be produced; otherwise, - * a file named outFilebase + "-eff.txt" will be produced, containing the number of - * events surviving the detector cuts (1st column), the selection cuts (2nd column), + * a file named outFilebase + collection's name + ".txt" will be produced, containing + * the number of events surviving the detector cuts (1st column), the selection cuts (2nd column), * the efficiency (3rd column), the lower (4th column) and upper (5th column) length * of the efficiency's error bar. - * @param errMethod The method to use for error computation. Possible values are defined in #EffRigCollection_ErrMethod. + * @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. */ - EffCollection(const char *collectionName, TString outFileBase = "", int errMethod = EFFRIG_ROOT); + EffCollection(const char *collectionName, TString outFileBase = "", int errMethod = EFFERR_ROOT, bool owns = true); /*! @brief Destructor. */ ~EffCollection() { @@ -64,7 +66,7 @@ * * @param cut The PamCut-derived object to add to the collection. */ - void AddCut(PamCut &cut) { + void AddCut(PamCut *cut) { AddDetectorCut(cut); } @@ -74,7 +76,7 @@ * selection cut. * @param cut The PamCut-derived object to add to the collection. */ - void AddDetectorCut(PamCut &cut); + void AddDetectorCut(PamCut *cut); /*! @brief Adds a selection cut to the collection. * @@ -82,7 +84,7 @@ * selection cut. * @param cut The PamCut-derived object to add to the collection. */ - void AddSelectionCut(PamCut &cut); + void AddSelectionCut(PamCut *cut); /*! @brief Adds an action to the detector cuts queue. * @@ -90,7 +92,7 @@ * * @param action The CollectionAction-derived object to add to the collection. */ - void AddAction(CollectionAction &action) { + void AddAction(CollectionAction *action) { AddDetectorAction(action); } @@ -101,7 +103,7 @@ * * @param action The CollectionAction-derived object to add to the collection. */ - void AddDetectorAction(CollectionAction &action); + void AddDetectorAction(CollectionAction *action); /*! @brief Adds an action to the selection cuts queue. * @@ -110,13 +112,23 @@ * * @param action The CollectionAction-derived object to add to the collection. */ - void AddSelectionAction(CollectionAction &action); + void AddSelectionAction(CollectionAction *action); /*! @brief Applies the selection and detector cuts to the current event. * * @param event The event to analyze. * @return CUTOK if the event survives all the selection and detector cuts. */ + + /*! @brief The pre-analysis task definition. + * + * This override of the Setup() method sets up the selection and detector cuts and actions + * + * @param events The PamLevel2 pointer to the events that will be analyzed. Used only as parameter for + * VerboseCollection::Setup(). + */ + void Setup(PamLevel2 *events); + int ApplyCut(PamLevel2 *event); /*TODO: redefine GetCut and the other methods to comply with the new selection/detector cuts structure. */