/[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.4 by pam-fi, Tue Oct 27 10:24:02 2009 UTC revision 1.6 by pam-fi, Tue Feb 16 13:33:12 2010 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        Finalize();
38      return;      return;
39    }    }
40    if (firstEvent < 0 || lastEvent > events->GetEntries() - 1) {    if (firstEvent < 0 || lastEvent > events->GetEntries() - 1) {
41        Finalize();
42      return;      return;
43    }    }
44    
   // Prepare the counters for the new analysis  
   Setup(events);  
   
45    // Apply the cuts    // Apply the cuts
46    for (ULong_t iev = firstEvent; iev < lastEvent + 1; iev++) {    for (ULong_t iev = firstEvent; iev < lastEvent + 1; iev++) {
47      events->GetEntry(iev);      events->GetEntry(iev);
# Line 70  PamCut& PamCut::operator=(const PamCut & Line 72  PamCut& PamCut::operator=(const PamCut &
72  /* ************************ *  /* ************************ *
73   *     PAMCUTCOLLECTION   *     PAMCUTCOLLECTION
74   * ************************ */   * ************************ */
75  PamCutCollection::~PamCutCollection(){  PamCutCollection::~PamCutCollection() {
76    
77    if (_owns){    if (_owns) {
78      for (unsigned int i = 0; i < _cuts.size(); i++)      for (unsigned int i = 0; i < _cuts.size(); i++)
79        if (_cuts[i] != NULL){        if (_cuts[i] != NULL) {
80          delete _cuts[i];          delete _cuts[i];
81          _cuts[i] = NULL;          _cuts[i] = NULL;
82        }        }
83    }    }
84  }  }
85    
   
86  void PamCutCollection::AddCut(PamCut *cut) {  void PamCutCollection::AddCut(PamCut *cut) {
87    _cuts.push_back(cut);    _cuts.push_back(cut);
88  }  }
# Line 136  PamCut *PamCutCollection::GetCut(unsigne Line 137  PamCut *PamCutCollection::GetCut(unsigne
137  PamCut *PamCutCollection::GetCut(const char *cutName) {  PamCut *PamCutCollection::GetCut(const char *cutName) {
138    if (_cuts.size() == 0)    if (_cuts.size() == 0)
139      return NULL;      return NULL;
140    for (unsigned int i = 0; i < _cuts.size(); i++){    for (unsigned int i = 0; i < _cuts.size(); i++) {
141      if (strcmp(_cuts[i]->GetName(), cutName) == 0)      if (strcmp(_cuts[i]->GetName(), cutName) == 0)
142        return _cuts[i];        return _cuts[i];
143    }    }

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

  ViewVC Help
Powered by ViewVC 1.1.23