#include "htriggersetup.h"
#include "hparamlist.h"
#include "hpario.h"
#include "hdetpario.h"
#include "hmessagemgr.h"
#include "hades.h"
HTriggerSetup::HTriggerSetup(const Char_t* name, const Char_t* title, const Char_t* context)
: HParCond(name,title,context)
{
richIpuMap = new TArrayI(7);
clear();
}
HTriggerSetup::~HTriggerSetup(void)
{
if(richIpuMap)
{
delete richIpuMap;
}
}
Bool_t HTriggerSetup::check(void)
{
for(Int_t i=0;i<richIpuMap->GetSize();i++)
{
if(richIpuMap->GetArray()[i] == (Char_t)-1)
{
return kFALSE;
}
}
if(richRowOffset == 0) return kFALSE;
if(richRingFinderVersion == -1) return kFALSE;
if(muDileptons == -99) return kFALSE;
if(muLeptons == -99) return kFALSE;
if(muMaxLeptons == -99) return kFALSE;
if(muRichHits == -99) return kFALSE;
if(muRichTotalHits == -99) return kFALSE;
if(muMetaHits == -99) return kFALSE;
if(muDataFormat == -99) return kFALSE;
return kTRUE;
}
void HTriggerSetup::clear(void)
{
richIpuMap->Reset(-1);
richRowOffset = 0;
richRingFinderVersion = -1;
muDileptons = -99;
muLeptons = -99;
muMaxLeptons = -99;
muRichHits = -99;
muRichTotalHits = -99;
muMetaHits = -99;
muDataFormat = -99;
}
void HTriggerSetup::printParam(void)
{
SEPERATOR_msg("=",60);
INFO_msg(10,HMessageMgr::DET_TRIGGER,"Mapping of IPU address to sector");
for(Int_t i=0;i<7;i++)
{
gHades->getMsg()->info(10,HMessageMgr::DET_TRIGGER,GetName(),"%s%i%s %i","sector[",i,"]: ",richIpuMap->At(i));
}
gHades->getMsg()->info(10,HMessageMgr::DET_TRIGGER,GetName(),"%s %i","Row offset: ",richRowOffset);
gHades->getMsg()->info(10,HMessageMgr::DET_TRIGGER,GetName(),"%s %i","Ring finder version: ",richRingFinderVersion);
SEPERATOR_msg("-",60);
INFO_msg(10,HMessageMgr::DET_TRIGGER,"Matchingunit cuts:");
gHades->getMsg()->info(10,HMessageMgr::DET_TRIGGER,GetName(),"%s %i","Dileptons : ",muDileptons);
gHades->getMsg()->info(10,HMessageMgr::DET_TRIGGER,GetName(),"%s %i","Leptons : ",muLeptons);
gHades->getMsg()->info(10,HMessageMgr::DET_TRIGGER,GetName(),"%s %i","max. Leptons : ",muMaxLeptons);
gHades->getMsg()->info(10,HMessageMgr::DET_TRIGGER,GetName(),"%s %i","RICH hits/sec. : ",muRichHits);
gHades->getMsg()->info(10,HMessageMgr::DET_TRIGGER,GetName(),"%s %i","RICH hits(tot.): ",muRichTotalHits);
gHades->getMsg()->info(10,HMessageMgr::DET_TRIGGER,GetName(),"%s %i","META hits : ",muMetaHits);
gHades->getMsg()->info(10,HMessageMgr::DET_TRIGGER,GetName(),"%s %i","MU data foramt : ",muDataFormat);
SEPERATOR_msg("=",60);
}
void HTriggerSetup::putParams(HParamList *l)
{
if (!l) return;
l->add("triggerRichIpuMap",*richIpuMap);
l->add("triggerRichRowOffset",richRowOffset);
l->add("triggerRichRignFinderVersion",richRingFinderVersion);
l->add("muDileptons",muDileptons);
l->add("muleptons",muLeptons);
l->add("muMaxLeptons",muMaxLeptons);
l->add("muRichHits",muRichHits);
l->add("muRichTotalHits",muRichTotalHits);
l->add("muMetaHits",muMetaHits);
l->add("muDataFormat", muDataFormat);
}
Bool_t HTriggerSetup::getParams(HParamList *l)
{
if (!l) return kFALSE;
if (!(l->fill("triggerRichIpuMap",richIpuMap))) return kFALSE;
if (!(l->fill("triggerRichRowOffset",&richRowOffset))) return kFALSE;
if (!(l->fill("triggerRichRignFinderVersion",&richRingFinderVersion))) return kFALSE;
if (!(l->fill("muDileptons",&muDileptons))) return kFALSE;
if (!(l->fill("muLeptons",&muLeptons))) return kFALSE;
if (!(l->fill("muMaxLeptons",&muMaxLeptons))) return kFALSE;
if (!(l->fill("muRichHits",&muRichHits))) return kFALSE;
if (!(l->fill("muRichTotalHits",&muRichTotalHits))) return kFALSE;
if (!(l->fill("muMetaHits",&muMetaHits))) return kFALSE;
if (!(l->fill("muDataFormat",&muDataFormat))) return kFALSE;
return kTRUE;
}
Bool_t HTriggerSetup::init(HParIo *inp, Int_t *set)
{
HDetParIo* input=inp->getDetParIo("HCondParIo");
if (input) return (input->init(this,set));
return kFALSE;
}
Int_t HTriggerSetup::write(HParIo* output)
{
HDetParIo* out=output->getDetParIo("HCondParIo");
if (out) return out->write(this);
return -1;
}
ClassImp(HTriggerSetup)
Last change: Sat May 22 13:17:21 2010
Last generated: 2010-05-22 13:17
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.