44 #include "StEventScavenger.h"
45 #include "StEventTypes.h"
47 bool StEventScavenger::removeEventSummary(
StEvent* evt)
49 if (evt && evt->summary()) {
50 evt->summary()->makeZombie();
57 bool StEventScavenger::removeL3Trigger(
StEvent* evt)
59 if (evt && evt->l3Trigger()) {
60 evt->l3Trigger()->makeZombie();
67 bool StEventScavenger::removeV0Vertices(
StEvent* evt)
69 if (!evt)
return false;
70 StSPtrVecV0Vertex &vec = evt->v0Vertices();
71 for (
unsigned int i=0; i<vec.size(); i++)
76 bool StEventScavenger::removeXiVertices(
StEvent* evt)
78 if (!evt)
return false;
79 StSPtrVecXiVertex &vec = evt->xiVertices();
80 for (
unsigned int i=0; i<vec.size(); i++)
85 bool StEventScavenger::removeKinkVertices(
StEvent* evt)
87 if (!evt)
return false;
88 StSPtrVecKinkVertex &vec = evt->kinkVertices();
89 for (
unsigned int i=0; i<vec.size(); i++)
94 bool StEventScavenger::removeCalibrationVertices(
StEvent* evt)
96 if (!evt)
return false;
97 for (
unsigned int i=0; i<evt->numberOfCalibrationVertices(); i++)
98 evt->calibrationVertex(i)->makeZombie();
102 bool StEventScavenger::removeTpcHitCollection(
StEvent* evt)
104 if (evt && evt->tpcHitCollection()) {
106 for (
unsigned int n=0; n<theHits->numberOfSectors(); n++)
107 for (
unsigned int m=0; m<theHits->sector(n)->numberOfPadrows(); m++)
108 for (
unsigned int h=0; h<theHits->sector(n)->padrow(m)->hits().size(); h++)
109 theHits->sector(n)->padrow(m)->hits()[h]->makeZombie();
110 theHits->makeZombie();
117 bool StEventScavenger::removeTpcHitsNotOnTracks(
StEvent* evt)
119 if (evt && evt->tpcHitCollection()) {
122 for (
unsigned int n=0; n<theHits->numberOfSectors(); n++)
123 for (
unsigned int m=0; m<theHits->sector(n)->numberOfPadrows(); m++)
124 for (
unsigned int h=0; h<theHits->sector(n)->padrow(m)->hits().size(); h++)
125 if (theHits->sector(n)->padrow(m)->hits()[h]->trackReferenceCount() == 0)
126 theHits->sector(n)->padrow(m)->hits()[h]->makeZombie();
128 StSPtrVecTrackNode& nodes = evt->trackNodes();
129 for (
unsigned int i = 0; i < nodes.size(); i++) {
131 for (
unsigned int j = 0; j < node->entries(); j++) {
132 if (node->track(j)->isZombie()) {
136 StPtrVecHit& hitList = info->hits();
137 for (
unsigned int k = 0; k < hitList.size(); k++)
138 if (hitList[k]->detector() == kTpcId) hitList[k]->makeZombie();
149 bool StEventScavenger::removeFtpcHitCollection(
StEvent* evt)
151 if (evt && evt->ftpcHitCollection()) {
153 for (
unsigned int n=0; n<theHits->numberOfPlanes(); n++)
154 for (
unsigned int m=0; m<theHits->plane(n)->numberOfSectors(); m++)
155 for (
unsigned int h=0; h<theHits->plane(n)->sector(m)->hits().size(); h++)
156 theHits->plane(n)->sector(m)->hits()[h]->makeZombie();
157 theHits->makeZombie();
164 bool StEventScavenger::removeSvtHitCollection(
StEvent* evt)
166 if (evt && evt->svtHitCollection()) {
168 for (
unsigned int n=0; n<theHits->numberOfBarrels(); n++)
169 for (
unsigned int m=0; m<theHits->barrel(n)->numberOfLadders(); m++)
170 for (
unsigned int k=0; k<theHits->barrel(n)->ladder(k)->numberOfWafers(); k++)
171 for (
unsigned int h=0; h<theHits->barrel(n)->ladder(m)->wafer(k)->hits().size(); h++)
172 theHits->barrel(n)->ladder(m)->wafer(k)->hits()[h]->makeZombie();
173 theHits->makeZombie();
180 bool StEventScavenger::removeSsdHitCollection(
StEvent* evt)
182 if (evt && evt->ssdHitCollection()) {
184 for (
unsigned int m=0; m<theHits->numberOfLadders(); m++)
185 for (
unsigned int k=0; k<theHits->ladder(k)->numberOfWafers(); k++)
186 for (
unsigned int h=0; h<theHits->ladder(m)->wafer(k)->hits().size(); h++)
187 theHits->ladder(m)->wafer(k)->hits()[h]->makeZombie();
188 theHits->makeZombie();
195 bool StEventScavenger::removeEmcCollection(
StEvent* evt)
197 if (evt && evt->emcCollection()) {
198 evt->emcCollection()->makeZombie();
205 bool StEventScavenger::removeRichCollection(
StEvent* evt)
207 if (evt && evt->richCollection()) {
208 evt->richCollection()->makeZombie();
215 bool StEventScavenger::removeTriggerDetectorCollection(
StEvent* evt)
217 if (evt && evt->triggerDetectorCollection()) {
218 evt->triggerDetectorCollection()->makeZombie();
225 bool StEventScavenger::removeFpdCollection(
StEvent* evt)
227 if (evt && evt->fpdCollection()) {
228 evt->fpdCollection()->makeZombie();
235 bool StEventScavenger::removeTofCollection(
StEvent* evt)
237 if (evt && evt->tofCollection()) {
238 evt->tofCollection()->makeZombie();
245 bool StEventScavenger::removeHltEvent(
StEvent* evt)
247 if (evt && evt->hltEvent()) {
248 evt->hltEvent()->makeZombie();
255 bool StEventScavenger::remove(
StTrack* track)
257 if (!track)
return false;
269 unsigned int nTimesUsed = 0;
270 unsigned int nZombies = 0;
274 for (i=0; i<node->entries(); i++) {
275 someTrack = node->track(i);
276 if (someTrack->isZombie()) nZombies++;
277 if (someTrack != track && !someTrack->isZombie() &&
278 someTrack->detectorInfo() == info) nTimesUsed++;
280 if (node->entries() == nZombies) node->makeZombie();
282 if (info && nTimesUsed < 1) info->makeZombie();