ROOT logo
//*-- AUTHOR : Ilse Koenig
//*-- Createded : 10/03/2000
//*--Changed: F. Krizek  26/08/2005
//Modified by M.Golubeva 08.10.2005
//Modified by M.Golubeva 01.11.2006

//_HADES_CLASS_DESCRIPTION 
//////////////////////////////////////////////////////////////////////////////
// HWallGeomPar
//
// Container class for the basic Wall geometry parameters
//
//////////////////////////////////////////////////////////////////////////////

using namespace std;
#include "hwallgeompar.h"
#include "hgeomcompositevolume.h"
#include "hpario.h"
#include "hdetpario.h"
#include <iostream> 
#include <iomanip>

ClassImp(HWallGeomPar)

HWallGeomPar::HWallGeomPar(const Char_t* name,const Char_t* title,
                               const Char_t* context)
            : HDetGeomPar(name,title,context,"Wall") {
  // constructor calling the base class constructor with the detector name
}

Bool_t HWallGeomPar::init(HParIo* inp,Int_t* set) {
  // intitializes the container from an input
  HDetParIo* input=inp->getDetParIo("HWallParIo");
  if (input) return (input->init(this,set));
  return kFALSE;
}

Int_t HWallGeomPar::write(HParIo* output) {
  // writes the container to an output
  HDetParIo* out=output->getDetParIo("HWallParIo");
  if (out) return out->write(this);
  return -1;
}

Int_t HWallGeomPar::getCompNum(const TString& name) {
  // returns the cell index retrieved from the component name W00Xxxx
  Int_t length = name.Length();
  switch (length) {
    case 5:
      return ((Int_t)(name[4]-'0')-1);
      break;
    case 6:
      return ((Int_t)(name[4]-'0')*10+(Int_t)(name[5]-'0')-1);
      break;
    case 7:
      return ((Int_t)(name[4]-'0')*100+(Int_t)(name[5]-'0')*10+(Int_t)(name[6]-'0')-1);
      break;
    }
  return(-1);
}

TString HWallGeomPar::getCellName(const Int_t c) {
// returns cell name W00Xxxx retrieved from the cell index c
// c -> from 0 to 383; xxx -> from 1 to 385

  Int_t precision = 0;
  Int_t decimal, sign;
  Int_t c1=c+1;
  
  TString baseName1="W001";
  TString baseName2="W002";
  TString baseName3="W003";
  TString buffer;
  TString cellName; // cell name W00Xxxx
  
  buffer = fcvt ((Double_t)c1, precision, &decimal, &sign);
  
  //if(c<160) cellName=baseName1+buffer;
  //if(c>159&&c<248) cellName=baseName2+buffer;
  //if(c>250&&c<345) cellName=baseName3+buffer;// ATTENTION! THE UPPER LIMIT

  if(c<144) cellName=baseName1+buffer;
  if(c>143&&c<208) cellName=baseName2+buffer;
  if(c>209&&c<302) cellName=baseName3+buffer;// ATTENTION! THE UPPER LIMIT
  //cout<<cellName <<endl;

  return cellName;

}
 hwallgeompar.cc:1
 hwallgeompar.cc:2
 hwallgeompar.cc:3
 hwallgeompar.cc:4
 hwallgeompar.cc:5
 hwallgeompar.cc:6
 hwallgeompar.cc:7
 hwallgeompar.cc:8
 hwallgeompar.cc:9
 hwallgeompar.cc:10
 hwallgeompar.cc:11
 hwallgeompar.cc:12
 hwallgeompar.cc:13
 hwallgeompar.cc:14
 hwallgeompar.cc:15
 hwallgeompar.cc:16
 hwallgeompar.cc:17
 hwallgeompar.cc:18
 hwallgeompar.cc:19
 hwallgeompar.cc:20
 hwallgeompar.cc:21
 hwallgeompar.cc:22
 hwallgeompar.cc:23
 hwallgeompar.cc:24
 hwallgeompar.cc:25
 hwallgeompar.cc:26
 hwallgeompar.cc:27
 hwallgeompar.cc:28
 hwallgeompar.cc:29
 hwallgeompar.cc:30
 hwallgeompar.cc:31
 hwallgeompar.cc:32
 hwallgeompar.cc:33
 hwallgeompar.cc:34
 hwallgeompar.cc:35
 hwallgeompar.cc:36
 hwallgeompar.cc:37
 hwallgeompar.cc:38
 hwallgeompar.cc:39
 hwallgeompar.cc:40
 hwallgeompar.cc:41
 hwallgeompar.cc:42
 hwallgeompar.cc:43
 hwallgeompar.cc:44
 hwallgeompar.cc:45
 hwallgeompar.cc:46
 hwallgeompar.cc:47
 hwallgeompar.cc:48
 hwallgeompar.cc:49
 hwallgeompar.cc:50
 hwallgeompar.cc:51
 hwallgeompar.cc:52
 hwallgeompar.cc:53
 hwallgeompar.cc:54
 hwallgeompar.cc:55
 hwallgeompar.cc:56
 hwallgeompar.cc:57
 hwallgeompar.cc:58
 hwallgeompar.cc:59
 hwallgeompar.cc:60
 hwallgeompar.cc:61
 hwallgeompar.cc:62
 hwallgeompar.cc:63
 hwallgeompar.cc:64
 hwallgeompar.cc:65
 hwallgeompar.cc:66
 hwallgeompar.cc:67
 hwallgeompar.cc:68
 hwallgeompar.cc:69
 hwallgeompar.cc:70
 hwallgeompar.cc:71
 hwallgeompar.cc:72
 hwallgeompar.cc:73
 hwallgeompar.cc:74
 hwallgeompar.cc:75
 hwallgeompar.cc:76
 hwallgeompar.cc:77
 hwallgeompar.cc:78
 hwallgeompar.cc:79
 hwallgeompar.cc:80
 hwallgeompar.cc:81
 hwallgeompar.cc:82
 hwallgeompar.cc:83
 hwallgeompar.cc:84
 hwallgeompar.cc:85
 hwallgeompar.cc:86
 hwallgeompar.cc:87
 hwallgeompar.cc:88
 hwallgeompar.cc:89