//*-- Author : D. Gonzalez-Diaz //*-- Created : 12/06/2006 //*-- Modified: 12/09/2006 by P.Cabanelas //*-- Modified: 12/08/2007 by D.Gonzalez-Diaz using namespace std; #include "hades.h" #include "hruntimedb.h" #include "hspectrometer.h" #include "hrpcdetector.h" #include "hpario.h" #include "hdetpario.h" #include "hrpcgeomcellpar.h" #include #include ClassImp(HRpcGeomCellPar) ClassImp(HRpcGeomCellParSec) ClassImp(HRpcGeomCellParCol) ClassImp(HRpcGeomCellParCell) void HRpcGeomCellParCell::setDefaults(Int_t f) { Length = 0.0; X_left = 0.0; Y_left = 0.0; width = 0.0; widthT = 0.0; thetaL = 0.0; thetaR = 0.0; } void HRpcGeomCellParCell::clear() { Length = 0.0; X_left = 0.0; Y_left = 0.0; width = 0.0; widthT = 0.0; thetaL = 0.0; thetaR = 0.0; } HRpcGeomCellParCol::HRpcGeomCellParCol(Int_t s, Int_t co) { // Constructor creates an array of pointers of type HRpcGeomCellParCell. HRpcDetector* det=(HRpcDetector*)(gHades->getSetup()->getDetector("Rpc")); Int_t ce = det->getMaxCells(); // if (det->getModule(s,m)) { array = new TObjArray(ce); for(Int_t i=0 ; iAddAt(new HRpcGeomCellParCell(),i); //} else array = new TObjArray(0); } HRpcGeomCellParCol::~HRpcGeomCellParCol(void) { // Destructor. if(array) { array->Delete(); delete array; } } HRpcGeomCellParSec::HRpcGeomCellParSec(Int_t s, Int_t co) { // Constructor creates an array of pointers of type HRpcGeomCellParCol array = new TObjArray(co); for(Int_t i=0 ; iAddAt(new HRpcGeomCellParCol(s,i),i); } HRpcGeomCellParSec::~HRpcGeomCellParSec(void) { // Destructor. array->Delete(); delete array; } HRpcGeomCellPar::HRpcGeomCellPar(const Char_t* name,const Char_t* title, const Char_t* context) : HParSet(name,title,context) { // Constructor creates an array of pointers of type HRpcGeomCellParSec. // The container name is set to "RpcGeomCellPar". strcpy(detName,"Rpc"); HRpcDetector* det=(HRpcDetector*)(gHades->getSetup()->getDetector("Rpc")); Int_t s = det->getMaxSectors(); Int_t co = det->getMaxColumns(); array = new TObjArray(s); for (Int_t i=0; iAddAt(new HRpcGeomCellParSec(i,co),i); } HRpcGeomCellPar::~HRpcGeomCellPar(void) { // Destructor. array->Delete(); delete array; } Bool_t HRpcGeomCellPar::init(HParIo* inp,Int_t* set) { // Intitializes the container from an input. // If input not available, default initialization. HDetParIo* input=inp->getDetParIo("HRpcParIo"); if (input) return (input->init(this,set)); return kFALSE; } Int_t HRpcGeomCellPar::write(HParIo* output) { // Writes the container to an output. HDetParIo* out=output->getDetParIo("HRpcParIo"); if (out) return out->write(this); return -1; } void HRpcGeomCellPar::clear() { // Calls method setDefaults(Int_t m) for all HRpcGeomCellParCell objects // in the detector. for(Int_t i0=0;i0