ROOT logo
#include "htofcalibrater.h"

#include "hcategory.h"
#include "hlocation.h"
#include  "htofraw.h"
#include "htofcal.h"
#include "hdebug.h"
#include "hades.h"
#include "hiterator.h"
#include "htofcalpar.h"
#include "tofdef.h"
#include "hruntimedb.h"
#include "hspectrometer.h"
#include "hdetector.h"
#include "hevent.h"

//_HADES_CLASS_DESCRIPTION 
////////////////////////////////////////////////////////////////////////
//HTofCalibrater  (not operational !!!)
//
// adapted from /u/halo/packages/abase/new by Manuel Sanchez (17/06/98)
////////////////////////////////////////////////////////////////////////

ClassImp(HTofCalibrater)

void HTofCalibrater::initParContainer() {
  fCalPar=(HTofCalPar *)gHades->getRuntimeDb()->getContainer("TofCalPar");
}

Bool_t HTofCalibrater::init(void) {
  fRawCat=gHades->getCurrentEvent()->getCategory(catTofRaw);
  if (!fRawCat) {
    fRawCat=gHades->getSetup()->getDetector("Tof")->buildCategory(catTofRaw);
    if (!fRawCat) return kFALSE;
    else gHades->getCurrentEvent()->addCategory(catTofRaw,fRawCat,"Tof");
  }
  fCalCat=gHades->getCurrentEvent()->getCategory(catTofCal);
  if (!fCalCat) {
    fCalCat=gHades->getSetup()->getDetector("Tof")->buildCategory(catTofCal);
    if (!fCalCat) return kFALSE;
    else gHades->getCurrentEvent()->addCategory(catTofCal,fCalCat,"Tof");
  }
  fIter=(HIterator *)fRawCat->MakeIterator();
  fLoc.set(3,0,0,0);
  fActive=kTRUE;
  initParContainer();
  return kTRUE;
}

HTofCalibrater::HTofCalibrater(void) {
  fCalPar=NULL;
  fRawCat=fCalCat=NULL;
  fIter=NULL;
}

HTofCalibrater::HTofCalibrater(const Text_t *name,const Text_t *title) :
  HReconstructor(name,title)
{
  fCalPar=NULL;
  fRawCat=fCalCat=NULL;
  fIter=NULL;  
}


HTofCalibrater::~HTofCalibrater(void) {
  if (fCalPar) delete fCalPar;
}

HTofCalibrater &HTofCalibrater::operator=(HTofCalibrater &c) {
  fCalPar=c.fCalPar;
  fRawCat=c.fRawCat;
  fCalCat=c.fCalCat;
  return c;
}

Int_t HTofCalibrater::execute(void) {  // not operational !!
#if DEBUG_LEVEL>2
  gDebuger->enterFunc("TofCalibrater::execute");
  gDebuger->message("Raw cat points to %p",fRawCat);
#endif
  /*
  HTofRaw *raw = NULL;
  HTofCal *cal = NULL;
  HTofCalParCell *cell = NULL;
  fIter->Reset();
  while ( (raw=(HTofRaw *)fIter->Next()) != NULL) {
    fLoc[0] = raw->getSector();
    fLoc[1] = raw->getModule();
    fLoc[2] = raw->getCell();
    cal=(HTofCal *)fCalCat->getSlot(fLoc);
    if (cal != NULL) {
      cal = new(cal) HTofCal;
      cal->setNHit(raw->getNHit());
      if (raw->getNHit()>0) {
	cell=fCalPar->getCell(fLoc);
	cal->setTimeRight(raw->getRightTime()*
			  cell->getSlopeTimeRight()+
			  cell->getOffsetTimeRight());
	cal->setChargeRight(raw->getRightCharge()*
			    cell->getSlopeChargeRight()+
			    cell->getOffsetChargeRight());
	if (raw->getNHit()>1) {
	  cal->setTimeLeft(raw->getLeftTime()*
			   cell->getSlopeTimeLeft()+
			   cell->getOffsetTimeLeft());
	  cal->setChargeLeft(raw->getLeftCharge()*
			     cell->getSlopeChargeLeft()+
			     cell->getOffsetChargeLeft());
	  cal->setSector(raw->getSector());
	  cal->setModule(raw->getModule());
	  cal->setCell(raw->getCell());
	}
      }
    }
  }
#if DEBUG_LEVEL>2 
  gDebuger->leaveFunc("HTofCalibrater::execute");
#endif
  */
  return 0;
}
      

 htofcalibrater.cc:1
 htofcalibrater.cc:2
 htofcalibrater.cc:3
 htofcalibrater.cc:4
 htofcalibrater.cc:5
 htofcalibrater.cc:6
 htofcalibrater.cc:7
 htofcalibrater.cc:8
 htofcalibrater.cc:9
 htofcalibrater.cc:10
 htofcalibrater.cc:11
 htofcalibrater.cc:12
 htofcalibrater.cc:13
 htofcalibrater.cc:14
 htofcalibrater.cc:15
 htofcalibrater.cc:16
 htofcalibrater.cc:17
 htofcalibrater.cc:18
 htofcalibrater.cc:19
 htofcalibrater.cc:20
 htofcalibrater.cc:21
 htofcalibrater.cc:22
 htofcalibrater.cc:23
 htofcalibrater.cc:24
 htofcalibrater.cc:25
 htofcalibrater.cc:26
 htofcalibrater.cc:27
 htofcalibrater.cc:28
 htofcalibrater.cc:29
 htofcalibrater.cc:30
 htofcalibrater.cc:31
 htofcalibrater.cc:32
 htofcalibrater.cc:33
 htofcalibrater.cc:34
 htofcalibrater.cc:35
 htofcalibrater.cc:36
 htofcalibrater.cc:37
 htofcalibrater.cc:38
 htofcalibrater.cc:39
 htofcalibrater.cc:40
 htofcalibrater.cc:41
 htofcalibrater.cc:42
 htofcalibrater.cc:43
 htofcalibrater.cc:44
 htofcalibrater.cc:45
 htofcalibrater.cc:46
 htofcalibrater.cc:47
 htofcalibrater.cc:48
 htofcalibrater.cc:49
 htofcalibrater.cc:50
 htofcalibrater.cc:51
 htofcalibrater.cc:52
 htofcalibrater.cc:53
 htofcalibrater.cc:54
 htofcalibrater.cc:55
 htofcalibrater.cc:56
 htofcalibrater.cc:57
 htofcalibrater.cc:58
 htofcalibrater.cc:59
 htofcalibrater.cc:60
 htofcalibrater.cc:61
 htofcalibrater.cc:62
 htofcalibrater.cc:63
 htofcalibrater.cc:64
 htofcalibrater.cc:65
 htofcalibrater.cc:66
 htofcalibrater.cc:67
 htofcalibrater.cc:68
 htofcalibrater.cc:69
 htofcalibrater.cc:70
 htofcalibrater.cc:71
 htofcalibrater.cc:72
 htofcalibrater.cc:73
 htofcalibrater.cc:74
 htofcalibrater.cc:75
 htofcalibrater.cc:76
 htofcalibrater.cc:77
 htofcalibrater.cc:78
 htofcalibrater.cc:79
 htofcalibrater.cc:80
 htofcalibrater.cc:81
 htofcalibrater.cc:82
 htofcalibrater.cc:83
 htofcalibrater.cc:84
 htofcalibrater.cc:85
 htofcalibrater.cc:86
 htofcalibrater.cc:87
 htofcalibrater.cc:88
 htofcalibrater.cc:89
 htofcalibrater.cc:90
 htofcalibrater.cc:91
 htofcalibrater.cc:92
 htofcalibrater.cc:93
 htofcalibrater.cc:94
 htofcalibrater.cc:95
 htofcalibrater.cc:96
 htofcalibrater.cc:97
 htofcalibrater.cc:98
 htofcalibrater.cc:99
 htofcalibrater.cc:100
 htofcalibrater.cc:101
 htofcalibrater.cc:102
 htofcalibrater.cc:103
 htofcalibrater.cc:104
 htofcalibrater.cc:105
 htofcalibrater.cc:106
 htofcalibrater.cc:107
 htofcalibrater.cc:108
 htofcalibrater.cc:109
 htofcalibrater.cc:110
 htofcalibrater.cc:111
 htofcalibrater.cc:112
 htofcalibrater.cc:113
 htofcalibrater.cc:114
 htofcalibrater.cc:115
 htofcalibrater.cc:116
 htofcalibrater.cc:117
 htofcalibrater.cc:118
 htofcalibrater.cc:119
 htofcalibrater.cc:120
 htofcalibrater.cc:121
 htofcalibrater.cc:122
 htofcalibrater.cc:123