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

Diff of /PamCut/PamCutBase/PamCutBase.cpp

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

revision 1.3 by pam-fi, Wed Jun 17 12:58:00 2009 UTC revision 1.5 by pam-fi, Wed Dec 2 13:28:53 2009 UTC
# Line 29  int PamCut::ApplyCut(PamLevel2 *event) { Line 29  int PamCut::ApplyCut(PamLevel2 *event) {
29    
30  void PamCut::Process(PamLevel2 *events, ULong_t firstEvent, ULong_t lastEvent) {  void PamCut::Process(PamLevel2 *events, ULong_t firstEvent, ULong_t lastEvent) {
31    
32      // Prepare the collection for the new analysis
33      Setup(events);
34    
35    // Check the range of events to analyze    // Check the range of events to analyze
36    if (firstEvent > lastEvent) {    if (firstEvent > lastEvent) {
37      return;      return;
# Line 37  void PamCut::Process(PamLevel2 *events, Line 40  void PamCut::Process(PamLevel2 *events,
40      return;      return;
41    }    }
42    
   // Prepare the counters for the new analysis  
   Setup(events);  
   
43    // Apply the cuts    // Apply the cuts
44    for (ULong_t iev = firstEvent; iev < lastEvent + 1; iev++) {    for (ULong_t iev = firstEvent; iev < lastEvent + 1; iev++) {
45      events->GetEntry(iev);      events->GetEntry(iev);
# Line 70  PamCut& PamCut::operator=(const PamCut & Line 70  PamCut& PamCut::operator=(const PamCut &
70  /* ************************ *  /* ************************ *
71   *     PAMCUTCOLLECTION   *     PAMCUTCOLLECTION
72   * ************************ */   * ************************ */
73    PamCutCollection::~PamCutCollection() {
74    
75      if (_owns) {
76        for (unsigned int i = 0; i < _cuts.size(); i++)
77          if (_cuts[i] != NULL) {
78            delete _cuts[i];
79            _cuts[i] = NULL;
80          }
81      }
82    }
83    
84  void PamCutCollection::AddCut(PamCut &cut) {  void PamCutCollection::AddCut(PamCut *cut) {
85    _cuts.push_back(&cut);    _cuts.push_back(cut);
86  }  }
87    
88  int PamCutCollection::Check(PamLevel2 *event) {  int PamCutCollection::Check(PamLevel2 *event) {
# Line 125  PamCut *PamCutCollection::GetCut(unsigne Line 135  PamCut *PamCutCollection::GetCut(unsigne
135  PamCut *PamCutCollection::GetCut(const char *cutName) {  PamCut *PamCutCollection::GetCut(const char *cutName) {
136    if (_cuts.size() == 0)    if (_cuts.size() == 0)
137      return NULL;      return NULL;
138    for (unsigned int i = 0; i < _cuts.size(); i++){    for (unsigned int i = 0; i < _cuts.size(); i++) {
139      if (strcmp(_cuts[i]->GetName(), cutName) == 0)      if (strcmp(_cuts[i]->GetName(), cutName) == 0)
140        return _cuts[i];        return _cuts[i];
141    }    }

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.5

  ViewVC Help
Powered by ViewVC 1.1.23