#include "muDilepEmulationExp.h"
#include "hdebug.h"
#include "hades.h"
#include "hcategory.h"
#include "hiterator.h"
#include "hruntimedb.h"
#include "hspectrometer.h"
#include "hevent.h"
#include "heventheader.h"
#include "hmatchurich.h"
#include "hmatchutof.h"
#include "hmatchushower.h"
#include "hmuEmuleptonsExp.h"
#include "hmuleptons.h"
#include "hmatrixcatiter.h"
#include "triggerinfodef.h"
#include "htriggerdetector.h"
#include "hlocation.h"
#include "hgeomvector.h"
#include "htriggerparmudilep.h"
#include "hmessagemgr.h"
HMUDilepEmulationExp::HMUDilepEmulationExp(void)
{
reset();
}
HMUDilepEmulationExp::HMUDilepEmulationExp(const Text_t *name,const Text_t *title)
: HMUDilepEmulation(name, title)
{
reset();
}
HMUDilepEmulationExp::~HMUDilepEmulationExp(void)
{
if(pEmuDiLeptons)
{
delete pEmuDiLeptons;
pEmuDiLeptons=NULL;
}
nEmuDiLeptons=0;
ptlHMULeptons=NULL;
ptlHMUEMUDiLeptons=NULL;
if (iterHMULeptons) delete iterHMULeptons;
iterHMULeptons=NULL;
if (iterHMULeptons2) delete iterHMULeptons2;
iterHMULeptons2=NULL;
}
Bool_t HMUDilepEmulationExp::init()
{
HSpectrometer *spec = gHades->getSetup();
HRuntimeDb *rtdb = gHades->getRuntimeDb();
HTriggerDetector * pTrigDet = (HTriggerDetector*)gHades->getSetup()->getDetector("Trigger");
if (pTrigDet)
{
if(!initParContainer(spec,rtdb))
{
return kFALSE;
}
}
INFO_msg(10,HMessageMgr::DET_TRIGGER,"dilep parameters initialized");
if((ptlHMULeptons=gHades->getCurrentEvent()->getCategory(catMUEMULeptons))==NULL) return kFALSE;
iterHMULeptons = (HIterator*)ptlHMULeptons->MakeIterator("native");
INFO_msg(10,HMessageMgr::DET_TRIGGER,"emuleptons input initialized");
ptlHMUEMUDiLeptons=gHades->getCurrentEvent()->getCategory(catMUEMUDiLeptons);
if(!ptlHMUEMUDiLeptons)
{
ptlHMUEMUDiLeptons=pTrigDet->buildCategory(catMUEMUDiLeptons);
if (!ptlHMUEMUDiLeptons)
{
return kFALSE;
}
else
{
gHades->getCurrentEvent()->addCategory(catMUEMUDiLeptons, ptlHMUEMUDiLeptons, "EmuDiLeptons");
}
}
INFO_msg(10,HMessageMgr::DET_TRIGGER,"dilep output initialized");
return kTRUE;
}
void HMUDilepEmulationExp::prepareInput()
{
HMUEMULeptonsExp *pLeptons =NULL;
iterHMULeptons->Reset();
while (( pLeptons = (HMUEMULeptonsExp *)iterHMULeptons->Next()) != 0)
{
if(nLep>599)
{
Error("prepareInput()","number of leptons >= size of array in event %i sequence number %i !",
gHades->getEventCounter(),
gHades->getCurrentEvent()->getHeader()->getEventSeqNumber());
break;
}
if (pLeptons->getMom()>0)
{
thetaRich[nLep]=pLeptons->getThetaRich();
phiRich[nLep]=pLeptons->getPhiRich();
mom[nLep]=pLeptons->getMom();
flag[nLep]=pLeptons->getFlag();
nLep++;
}
}
}
Bool_t HMUDilepEmulationExp::finalize()
{
return kTRUE;
}
ClassImp(HMUDilepEmulationExp)
Last change: Sat May 22 12:59:10 2010
Last generated: 2010-05-22 12:59
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.