using namespace std;
#include "hhodorefhitpar.h"
#include "hades.h"
#include "hruntimedb.h"
#include "hspectrometer.h"
#include "hhododetector.h"
#include "hpario.h"
#include "hdetpario.h"
#include <iostream>
#include <iomanip>
ClassImp(HHodoRefHitPar)
ClassImp(HHodoRefHitParMod)
HHodoRefHitPar::HHodoRefHitPar(const Char_t* name,const Char_t* title,
const Char_t* context)
: HParSet(name,title,context)
{
strcpy(detName,"Hodo");
HHodoDetector* det = (HHodoDetector*)gHades->getSetup()->getDetector("Hodo");
Int_t nMod=det->getMaxModInSetup();
array = new TObjArray(nMod);
for (Int_t i = 0; i < nMod; i++) {
array->AddAt( new HHodoRefHitParMod,i);
}
}
HHodoRefHitPar::~HHodoRefHitPar()
{
array->Delete();
delete array;
}
Bool_t HHodoRefHitPar::init(HParIo* inp,Int_t* set)
{
HDetParIo* input=inp->getDetParIo("HHodoParIo");
if (input) return (input->init(this,set));
return kFALSE;
}
Int_t HHodoRefHitPar::write(HParIo* output)
{
HDetParIo* out=output->getDetParIo("HHodoParIo");
if (out) return out->write(this);
return -1;
}
void HHodoRefHitPar::clear()
{
for(Int_t i=0;i<getSize();i++) {
(*this)[i].clear();
}
status=kFALSE;
resetInputVersions();
}
void HHodoRefHitPar::printParam()
{
printf("Reference Trigger and Hit parameters for the HODO detector\n");
printf("module trigref.low trigref.high hit.low hit.high\n");
for(Int_t i=0;i<getSize();i++) {
HHodoRefHitParMod& mod=(*this)[i];
printf("%4i%8.0f%8.0f%9.1f%9.1f\n",i,mod.getTrigRefLow(),mod.getTrigRefHigh(),mod.getHitLow(),mod.getHitHigh());
}
}
void HHodoRefHitPar::readline(const Char_t *buf, Int_t *set)
{
Int_t mod;
Float_t f[4]={-1,-1,-1,-1};
sscanf(buf,"%i%f%f%f%f", &mod,&f[0],&f[1],&f[2],&f[3]);
if (!set[mod]) return;
(*this)[mod].fill(f);
set[mod]=999;
}
void HHodoRefHitPar::putAsciiHeader(TString& header)
{
header=
"# Reference Trigger and Hit parameters for the HODO detector\n"
"# Format:\n"
"# module trigref.low trigref.high hit.low hit.high\n";
}
Bool_t HHodoRefHitPar::writeline(Char_t *buf, Int_t m)
{
HHodoRefHitParMod& mod=(*this)[m];
sprintf(buf,"%4i%8.0f%8.0f%9.1f%9.1f\n",
m, mod.getTrigRefLow(),mod.getTrigRefHigh(),mod.getHitLow(),mod.getHitHigh());
return kTRUE;
}
Last change: Sat May 22 12:57:36 2010
Last generated: 2010-05-22 12:57
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.