/[PAMELA software]/PamCut/PamCutBase/PamCutBase.h
ViewVC logotype

Diff of /PamCut/PamCutBase/PamCutBase.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by pam-fi, Wed Jun 17 12:58:00 2009 UTC revision 1.6 by pam-fi, Thu Mar 18 14:41:13 2010 UTC
# Line 22  using namespace std; Line 22  using namespace std;
22  class PamCut {  class PamCut {
23  public:  public:
24    
25    /*! @brief Constructor. */    /*! @brief Constructor.
26       *  @param cutName The cut's name.
27       */
28    PamCut(const char *cutName) :    PamCut(const char *cutName) :
29      _cutName(cutName), _nEv(0), _nGood(0) {      _cutName(cutName), _nEv(0), _nGood(0) {
30    }    }
# Line 105  public: Line 107  public:
107      return _nGood;      return _nGood;
108    }    }
109    
110      /*! @brief Returns the index of currently processed event.
111        *
112        * This method returns the index of the currently processed event inside a #Process()
113        * invocation. It has no meaning when read outside #Process().
114        *
115        * @return The index of the currently processed event.
116        */
117      ULong_t GetCurrentEvent(){
118        return _currEv;
119      }
120    
121    /*! @brief The pre-analysis task definition.    /*! @brief The pre-analysis task definition.
122     *     *
123     * This method is automatically called by Process() before the event selection;     * This method is automatically called by Process() before the event selection;
# Line 152  public: Line 165  public:
165  private:  private:
166    
167    const char *_cutName;    const char *_cutName;
168      ULong_t _currEv;
169    
170  protected:  protected:
171    
# Line 172  class PamCutCollection: public PamCut { Line 186  class PamCutCollection: public PamCut {
186  public:  public:
187    
188    /*! @brief Constructor.    /*! @brief Constructor.
189       * The collection can own the cuts, according to the value of the "owns" parameter.
190       * If set to true, the collection will take in charge the duty of destroying cuts and
191       * freeing their memory; users then should not set owns to true and explicitly call
192       * delete for the cuts in the collection. If instead owns is set to false, no destruction
193       * is performed by the collection; in this case, the user should issue the eventual
194       * delete calls.
195     *     *
196     * @param collectionName The collection's name.     * @param collectionName The collection's name.
197       * @param owns If true, the collection will own the cuts, ie., it will
198       *             destroy them in its destructor.
199     */     */
200    PamCutCollection(const char *collectionName) :    PamCutCollection(const char *collectionName, bool owns = true) :
201      PamCut(collectionName) {      PamCut(collectionName), _owns(owns) {
202    }    }
203    
204    /*! @brief Destructor. */    /*! @brief Destructor. */
205    ~PamCutCollection() {    ~PamCutCollection();
   }  
206    
207    /*! @brief Adds a cut to the cut collection    /*! @brief Adds a cut to the cut collection
208     *  This routine adds a cut to the collection. These are stored in a vector in the same order     *  This routine adds a cut to the collection. These are stored in a vector in the same order
209     *  they are inserted (the first cut would be element 0, the second cut element 1 and so on).     *  they are inserted (the first cut would be element 0, the second cut element 1 and so on).
210     *  All the references to a "cut number" or "cut index" will refer to this numbering scheme.     *  All the references to a "cut number" or "cut index" will refer to this numbering scheme.
211     *     *
212     * @param cut The PamCut-derived object to add to the collection.     * @param cut The pointer to a PamCut-derived object to add to the collection.
213     */     */
214    void AddCut(PamCut &cut);    void AddCut(PamCut *cut);
215    
216    /*! @brief The basic selection.    /*! @brief The basic selection.
217     *     *
# Line 271  protected: Line 292  protected:
292    /*! @brief A vector containing pointers to PamCut objects */    /*! @brief A vector containing pointers to PamCut objects */
293    std::vector<PamCut*> _cuts;    std::vector<PamCut*> _cuts;
294    
295      /*! @brief A flag signaling if the collection owns the cuts (ie., if the collection
296       *         will destroy the cuts.
297       */
298      bool _owns;
299  };  };
300    
301  #endif /* PAMCUTBASE_H_ */  #endif /* PAMCUTBASE_H_ */

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.6

  ViewVC Help
Powered by ViewVC 1.1.23