//*--Author : B. Spruck // //_HADES_CLASS_DESCRIPTION ///////////////////////////////////////////////////////////// // // HHodoHitFFiber // // Simple Hodo hitfinder for proton beam 2006. // This code is for fiber detector // Used is hodo detector module usemod (changeable by user) // "old" pion start/veto or diamond should use other code // // This code has to do some nasty things: // Define what ONE hit is (overlapping fibers, crosstalk) // This should depend on position AND time of the hits // only one hit in a time window ... not done yet! // time window should be in oracle ... not done yet, well RefTimeHit but...! // Note: // In May06 we use ONLY 32 channels of 96, and this is hardcoded! // For pions another reconstructor is needed anyhow... // ///////////////////////////////////////////////////////////// using namespace std; #include "hhodohitffiber.h" #include "hhododetector.h" #include "hododef.h" #include "hhodocal.h" #include "hiterator.h" #include "hcategory.h" #include "hdebug.h" #include "hades.h" #include "heventheader.h" #include "hevent.h" #include "hhodorefhitpar.h" #include "hspectrometer.h" #include "hdetector.h" #include "hruntimedb.h" #include "hhodohit.h" #include "hlocation.h" #include "TMath.h" #include #include HHodoHitFFiber::HHodoHitFFiber(void) { clear(); } HHodoHitFFiber::HHodoHitFFiber(const Text_t *name,const Text_t *title) : HReconstructor(name,title) { clear(); } HHodoHitFFiber::~HHodoHitFFiber(void) { if (pIterCal) delete pIterCal; } Bool_t HHodoHitFFiber::init(void) { HHodoDetector *hodo; hodo=(HHodoDetector *)gHades->getSetup()->getDetector("Hodo"); if(!hodo){ Error("init","No Hodo Det. found."); return kFALSE; } // Categories pCalCat=hodo->buildCategory(catHodoCal); if (!pCalCat) return kFALSE; pHitCat=hodo->buildCategory(catHodoHit); if (!pHitCat) return kFALSE; // Iterators pIterCal=(HIterator *)pCalCat->MakeIterator(); // RefHit should not be needed if the TRB Time windows are set correctly // But as Long_t as these windows are far to open, this cut is very useful(?) refhit=(HHodoRefHitPar*)gHades->getRuntimeDb()->getContainer("HodoRefHitPar"); if (!refhit){ Error("init","No HodoRefHit Parameters"); return kFALSE; } loc.set(2,0,0); fActive=kTRUE; return kTRUE; } Bool_t HHodoHitFFiber::find_hit(void) { // How to check for several clusters? // What about clusters with different/same time? // Now do some "kind of" hit detection Bool_t foundone; foundone=false; for(Int_t ii=0; ii3 return(false); } if( iiReset(); while ((pCal=(HHodoCal *)pIterCal->Next())!=0) { Int_t m;// Number of Cal Times per channel // only use module "usemod" for fiber startdetector if(pCal->getModule()!=usemod) continue; m=pCal->getNHits(); if(m<=0) continue;// No Hits -> forget it Int_t nStrip; Float_t fTime=-1000000.0; nStrip = pCal->getStrip(); // Spikes should have been killed by hodocalibrator // We just taker the first hit here... later change this to check the right time window for(Int_t i=0; igetTime(i+1); // getTof(); if( lower>=upper || (t>lower && t=0 && nStripgetNewSlot(loc); if(pHit){ pHit = new (pHit) HHodoHit; pHit->setModule(usemod); pHit->setStrip(hitStrip); pHit->setTime(hitTime); // pHit->setHodoMult(nHodoMult); pHit->setFlag(kTRUE); } } // always return a success or the other hitfinders (and other tasks) will not run return EXIT_SUCCESS; } Bool_t HHodoHitFFiber::finalize(void) { return kTRUE; } void HHodoHitFFiber::clear(void) { pCalCat=0; pHitCat=0; pIterCal=0; } ClassImp(HHodoHitFFiber)