// $Id: hrichevtfiltersim.cc,v 1.5 2009-07-15 11:39:22 halo Exp $ // Last update by Thomas Eberl: 02/09/25 17:34:31 // using namespace std; #include "hrichevtfiltersim.h" #include "hlinearcategory.h" #include "hevent.h" #include "hspectrometer.h" #include "hdetector.h" #include "hrichdetector.h" #include "hcategory.h" #include "hiterator.h" #include "hades.h" #include "richdef.h" #include "hmdcdef.h" #include "hmdcseg.h" #include "hhitmatchsim.h" #include "hhitmatchheadersim.h" #include #include ClassImp(HRichEvtFilterSim) HRichEvtFilterSim::HRichEvtFilterSim(const Text_t *name,const Text_t *title) : HReconstructor(name,title) { } HRichEvtFilterSim::HRichEvtFilterSim() { } HRichEvtFilterSim::~HRichEvtFilterSim(void) { } Bool_t HRichEvtFilterSim::init() { if (gHades) { HEvent *event=gHades->getCurrentEvent(); HRuntimeDb *rtdb=gHades->getRuntimeDb(); HSpectrometer *spec=gHades->getSetup(); if (event && rtdb) { HDetector *mdc = spec->getDetector("Mdc"); if (mdc) { // MDC fMdcSeg=event->getCategory(catMdcSeg); if (!fMdcSeg) { Error("init","No MDC segment category defined"); return kFALSE; } else fMdcSegIter=(HIterator *)fMdcSeg->MakeIterator(); } HDetector *rich = spec->getDetector("Rich"); if (rich) { //Has the user set up a RICH? // RICH HIT container pHitRichCat=gHades->getCurrentEvent()->getCategory(catRichHit); // if (!pHitRichCat) { // pHitRichCat=rich->buildCategory(catRichHit); // if (!pHitRichCat) return kFALSE; // else gHades->getCurrentEvent() // ->addCategory(catRichHit, pHitRichCat, "Rich"); // } if (!pHitRichCat) Error("HRichEvtFilterSim","init():no Rich Hit cat"); fRichIter = (HIterator*) pHitRichCat->MakeIterator(); // //Setup output pHitMatchCat=event->getCategory(catMatchHit); if (!pHitMatchCat) { pHitMatchCat=rich->buildCategory(catMatchHit); if (!pHitMatchCat) { Error("init","No HIT MATCH category defined"); return kFALSE; } else event->addCategory(catMatchHit, pHitMatchCat, "Rich"); } pIterMatchHit = (HIterator*)getHitMatchCat()->MakeIterator("native"); pHitMatchHeaderCat=event->getCategory(catMatchHitHeader); pIterMatchHitHeader = (HIterator*)getHitMatchHeaderCat() ->MakeIterator("native"); } } } resetCounters(); return kTRUE; } Bool_t HRichEvtFilterSim::finalize() { cout<<"Number of rejected evts: "<