#pragma implementation
using namespace std;
#include <iostream> 
#include <iomanip>
#include "hshowermodulegeom.h"
ClassImp(HShowerModuleGeom)
HShowerModuleGeom::HShowerModuleGeom() {
  reset();
} 
HShowerModuleGeom::~HShowerModuleGeom() {
  reset();
} 
void HShowerModuleGeom::reset()
{
  m_nModuleID = -1;
  m_pFrame = NULL;
  m_pWires = NULL;
  m_pPads = NULL;
}
Bool_t HShowerModuleGeom::initAscii(HParHadAsciiFileIo* pHadAsciiFile) {
  Bool_t status = kTRUE;
  if (!pHadAsciiFile)
     return kFALSE;
  Char_t buf[80];
  Float_t matrixRot[9];
  Float_t transVect[3];
  try {
     HAsciiKey* pHAscii = pHadAsciiFile->GetKeyAscii();
     HAsciiKey &mydata = *pHAscii;
     mydata.ReadFloat((Float_t*)matrixRot, "Rotation Matrix");
     sprintf(buf, "Center Module %d", m_nModuleID);
     mydata.ReadFloat((Float_t*)transVect, buf);
 
     transform.setRotMatrix(matrixRot);
     transform.setTransVector(transVect);
  }
  catch (Bool_t ret) {
    status = ret;
  }
  return status;
}
Bool_t HShowerModuleGeom::writeAscii(HParHadAsciiFileIo* pHadAsciiFileIo) {
  Bool_t status = kTRUE;
  if (!pHadAsciiFileIo)
     return kFALSE;
  Char_t buf[80];
  Float_t transVect[3];
  try { 
     HAsciiKey* pHAscii = pHadAsciiFileIo->GetKeyAscii();
     HAsciiKey &mydata = *pHAscii;
     transVect[0]=transform.getTransVector().getX();
     transVect[1]=transform.getTransVector().getY();
     transVect[2]=transform.getTransVector().getZ();
     sprintf(buf, "Center Module %d", m_nModuleID);
     mydata.WriteFloat(buf, 3, (Float_t*)transVect);
  }
  catch (Bool_t ret) {
    status = ret;
  }
  return status;
}
void HShowerModuleGeom::Streamer(TBuffer &R__b)
{
   
   if (R__b.IsReading()) {
      Version_t R__v = R__b.ReadVersion(); if (R__v) { }
      HParSet::Streamer(R__b);
      transform.Streamer(R__b);
      R__b >> m_nModuleID;
   } else {
      R__b.WriteVersion(HShowerModuleGeom::IsA());
      HParSet::Streamer(R__b);
      transform.Streamer(R__b);
      R__b << m_nModuleID;
      m_pFrame = NULL;   
      m_pWires = NULL;   
      m_pPads = NULL;    
                         
   }
}
void HShowerModuleGeom::transformModule(HGeomTransform& t) {
  transform.transTo(t);
}
void HShowerModuleGeom::transformVector(HGeomTransform& t) {
 HGeomVector v;
 HGeomVector vT;
 v = transform.getTransVector();
 vT = t.transFrom(v);
 transform.setTransVector(vT);
}
Last change: Sat May 22 13:13:51 2010
Last generated: 2010-05-22 13:13
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.