#include "hpidcontfact.h"
#include "hruntimedb.h"
#include "hpidtrackfillerpar.h"
#include "hpidreconstructorpar.h"
#include "hpidalgmomvsbetapar.h"
#include "hpidalgringpropertiespar.h"
#include "hpidalgmdcelosspar.h"
#include "hpidalgshowerpar.h"
#include "hpidalgstandcutspar.h"
#include "hpidalghardcutspar.h"
ClassImp(HPidContFact)
static HPidContFact gHPidContFact;
HPidContFact::HPidContFact(void)
{
fName = "PidContFact";
fTitle = "Factory for parameter containers in libPid";
setAllContainers();
HRuntimeDb::instance()->addContFactory(this);
}
void HPidContFact::setAllContainers(void)
{
HContainer* pPidReconstructorPar =
new HContainer(PIDRECONSTRUCTORPAR_NAME,
PIDRECONSTRUCTORPAR_TITLE,
PIDRECONSTRUCTORPAR_CONTEXT);
setContexts(pPidReconstructorPar,PIDALGMOMVSBETAPAR_CONTEXT);
containers->Add(pPidReconstructorPar);
containers->Add( new HContainer(HPIDTRACKFILLERPAR_NAME,
HPIDTRACKFILLERPAR_TITLE,
HPIDTRACKFILLERPAR_CONTEXT));
HContainer* pAlgMomVsBetaPar =
new HContainer(PIDALGMOMVSBETAPAR_NAME,
PIDALGMOMVSBETAPAR_TITLE,
PIDALGMOMVSBETAPAR_CONTEXT);
setContexts(pAlgMomVsBetaPar,PIDALGMOMVSBETAPAR_CONTEXT);
containers->Add(pAlgMomVsBetaPar);
HContainer* pAlgRichPar=
new HContainer(PIDALGRINGPROPERTIESPAR_NAME,
PIDALGRINGPROPERTIESPAR_TITLE,
PIDALGRINGPROPERTIESPAR_CONTEXT);
setContexts(pAlgRichPar,PIDALGRINGPROPERTIESPAR_CONTEXT);
containers->Add(pAlgRichPar);
HContainer* pAlgMdcPar=
new HContainer(PIDALGMDCELOSSPAR_NAME,
PIDALGMDCELOSSPAR_TITLE,
PIDALGMDCELOSSPAR_CONTEXT);
setContexts(pAlgMdcPar,PIDALGMDCELOSSPAR_CONTEXT);
containers->Add(pAlgMdcPar);
HContainer* pAlgShowerPar =
new HContainer(PIDALGSHOWERPAR_NAME,
PIDALGSHOWERPAR_TITLE,
PIDALGSHOWERPAR_CONTEXT);
setContexts(pAlgShowerPar,PIDALGSHOWERPAR_CONTEXT);
containers->Add(pAlgShowerPar);
HContainer *pAlgStandCuts =
new HContainer(PIDALGSTANDCUTSPAR_NAME,
PIDALGSTANDCUTSPAR_TITLE,
PIDALGSTANDCUTSPAR_CONTEXT);
setContexts(pAlgStandCuts,PIDALGSTANDCUTSPAR_CONTEXT);
containers->Add(pAlgStandCuts);
HContainer *cm = new HContainer("PidAlgHardCutsPar",
"2dim parameters",
"PidAlgHardCutsProduction");
containers->Add(cm);
}
#warning Find out the calling-sequence of createContainer - this must come from HRuntimeDB
HParSet* HPidContFact::createContainer(HContainer* c)
{
const Char_t* name = c->GetName();
if(strcmp(name, HPIDTRACKFILLERPAR_NAME) == 0)
{
return new HPidTrackFillerPar(c->getConcatName().Data(),
c->GetTitle(), c->getContext());
}
if(strcmp(name, PIDRECONSTRUCTORPAR_NAME) == 0)
{
return new HPidReconstructorPar(c->getConcatName().Data(),
c->GetTitle(), c->getContext());
}
if(strcmp(name, PIDALGMOMVSBETAPAR_NAME) == 0)
{
return new HPidAlgMomVsBetaPar(c->getConcatName().Data(),
c->GetTitle(), c->getContext());
}
if(strcmp(name, PIDALGRINGPROPERTIESPAR_NAME) == 0)
{
return new HPidAlgRingPropertiesPar(c->getConcatName().Data(),
c->GetTitle(), c->getContext());
}
if(strcmp(name, PIDALGMDCELOSSPAR_NAME) == 0)
{
return new HPidAlgMdcElossPar(c->getConcatName().Data(),
c->GetTitle(), c->getContext());
}
if(strcmp(name, PIDALGSHOWERPAR_NAME) == 0) {
return new HPidAlgShowerPar(c->getConcatName().Data(),
c->GetTitle(), c->getContext());
}
if(strcmp(name, PIDALGSTANDCUTSPAR_NAME) == 0)
{
return new HPidAlgStandCutsPar(c->getConcatName().Data(),
c->GetTitle(), c->getContext());
}
if(strcmp(name, "PidAlgHardCutsPar") == 0)
{
return new HPidAlgHardCutsPar(c->getConcatName().Data(),
c->GetTitle(), c->getContext());
}
if(strcmp(name, "PidAlgMdcElossPar") == 0)
{
return new HPidAlgMdcElossPar(c->getConcatName().Data(),
c->GetTitle(), c->getContext());
}
return NULL;
}
void HPidContFact::setContexts(HContainer *pCont,const Char_t* pDefContName){
Char_t cBuff[250];
snprintf(cBuff,sizeof(cBuff),"%s%s",pDefContName,"KICK");
pCont->addContext(cBuff);
snprintf(cBuff,sizeof(cBuff),"%s%s",pDefContName,"KICK123");
pCont->addContext(cBuff);
snprintf(cBuff,sizeof(cBuff),"%s%s",pDefContName,"SPLINE");
pCont->addContext(cBuff);
snprintf(cBuff,sizeof(cBuff),"%s%s",pDefContName,"RUNGEKUTTA");
pCont->addContext(cBuff);
snprintf(cBuff,sizeof(cBuff),"%s%s",pDefContName,"REFT");
pCont->addContext(cBuff);
}
Last change: Sat May 22 13:07:00 2010
Last generated: 2010-05-22 13:07
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.