50 |
Finalize(); |
Finalize(); |
51 |
|
|
52 |
} |
} |
53 |
void PamCut::Setup(PamLevel2 *events){ |
void PamCut::Setup(PamLevel2 *events) { |
54 |
_nEv = _nGood = 0; |
_nEv = _nGood = 0; |
55 |
} |
} |
56 |
|
|
62 |
_cutName = newName; |
_cutName = newName; |
63 |
} |
} |
64 |
|
|
65 |
PamCut& PamCut::operator=(const PamCut &rightValue){ |
PamCut& PamCut::operator=(const PamCut &rightValue) { |
66 |
_cutName = rightValue._cutName; |
_cutName = rightValue._cutName; |
67 |
return *this; |
return *this; |
68 |
} |
} |
69 |
|
|
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 |
|
|
85 |
void PamCutCollection::AddCut(PamCut &cut) { |
void PamCutCollection::AddCut(PamCut *cut) { |
86 |
_cuts.push_back(&cut); |
_cuts.push_back(cut); |
87 |
} |
} |
88 |
|
|
89 |
int PamCutCollection::Check(PamLevel2 *event) { |
int PamCutCollection::Check(PamLevel2 *event) { |
133 |
return _cuts[iCut]; |
return _cuts[iCut]; |
134 |
} |
} |
135 |
|
|
136 |
|
PamCut *PamCutCollection::GetCut(const char *cutName) { |
137 |
|
if (_cuts.size() == 0) |
138 |
|
return NULL; |
139 |
|
for (unsigned int i = 0; i < _cuts.size(); i++){ |
140 |
|
if (strcmp(_cuts[i]->GetName(), cutName) == 0) |
141 |
|
return _cuts[i]; |
142 |
|
} |
143 |
|
|
144 |
|
return NULL; |
145 |
|
} |
146 |
|
|
147 |
unsigned int PamCutCollection::GetSize() { |
unsigned int PamCutCollection::GetSize() { |
148 |
return (unsigned int) _cuts.size(); |
return (unsigned int) _cuts.size(); |
149 |
|
|
156 |
return *this; |
return *this; |
157 |
} |
} |
158 |
|
|
159 |
|
void PamCutCollection::Setup(PamLevel2 *events) { |
|
void PamCutCollection::Setup(PamLevel2 *events){ |
|
160 |
|
|
161 |
PamCut::Setup(events); |
PamCut::Setup(events); |
162 |
|
|
163 |
for (unsigned int i = 0; i < GetSize(); i++){ |
for (unsigned int i = 0; i < GetSize(); i++) { |
164 |
_cuts[i]->Setup(events); |
_cuts[i]->Setup(events); |
165 |
} |
} |
166 |
} |
} |
167 |
|
|
168 |
void PamCutCollection::Finalize(){ |
void PamCutCollection::Finalize() { |
169 |
|
|
170 |
// PamCut::Finalize() is currently void, but in future it could contain something, so it's good to place a call here. |
// PamCut::Finalize() is currently void, but in future it could contain something, so it's good to place a call here. |
171 |
PamCut::Finalize(); |
PamCut::Finalize(); |
172 |
|
|
173 |
for (unsigned int i = 0; i < GetSize(); i++){ |
for (unsigned int i = 0; i < GetSize(); i++) { |
174 |
_cuts[i]->Finalize(); |
_cuts[i]->Finalize(); |
175 |
} |
} |
176 |
} |
} |