#include "hrichIPUmap.h"
#include "hades.h"
#include "hcategory.h"
#include "hiterator.h"
#include "hruntimedb.h"
#include "hevent.h"
#include "triggerinfodef.h"
#include "hruntimedb.h"
#include "hrichgeometrypar.h"
#include "hrichhitIPU.h"
#include "hmessagemgr.h"
HRichIPUMap::HRichIPUMap(void)
{
pRich= NULL;
iterRich=NULL;
}
HRichIPUMap::HRichIPUMap(const Text_t *name,const Text_t *title)
: HReconstructor(name, title)
{
pRich= NULL;
iterRich=NULL;
}
HRichIPUMap::~HRichIPUMap(void)
{
if (pRich)
{
delete pRich;
pRich= NULL;
}
if (iterRich)
{
delete iterRich;
iterRich=NULL;
}
}
Bool_t HRichIPUMap::init(void)
{
SEPERATOR_msg("-",60);
INFO_msg(10,HMessageMgr::DET_TRIGGER,"INIT of HRichIPUMap()");
HRuntimeDb *rtdb = gHades->getRuntimeDb();
pRich=gHades->getCurrentEvent()->getCategory(catHardRichHit);
if (!pRich)
{
return kFALSE;
}
iterRich = (HIterator*)pRich->MakeIterator("native");
if(rtdb)
{
HRichGeometryPar *pGeomPar = (HRichGeometryPar*)rtdb->getContainer("RichGeometryParameters");
setGeomPar(pGeomPar);
if (pGeomPar == NULL)
{
ERROR_msg(HMessageMgr::DET_TRIGGER,"RICH geometry parameters not found!");
return kFALSE;
}
}
SEPERATOR_msg("-",60);
return kTRUE;
}
Int_t HRichIPUMap::execute(void)
{
HRichHitIPU *pMURich=NULL;
Int_t yRichHitIPU, xRichHitIPU, nSec;
iterRich->Reset();
while ((pMURich = (HRichHitIPU *)iterRich->Next()) != 0)
{
nSec = pMURich->getSector();
yRichHitIPU = pMURich->getY();
xRichHitIPU = pMURich->getX();
pMURich->setX(yRichHitIPU);
pMURich->setY(xRichHitIPU);
HRichPad * pad = ((HRichGeometryPar*)fpGeomPar)->getPadsPar()->getPad(pMURich->getX(),pMURich->getY());
pMURich->setPhi(pad->getPhi(nSec));
pMURich->setTheta(pad->getTheta());
}
return 0;
}
Bool_t HRichIPUMap::finalize(void)
{
return kTRUE;
}
ClassImp(HRichIPUMap)
Last change: Sat May 22 13:09:12 2010
Last generated: 2010-05-22 13:09
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.