// ESAF : Euso Simulation and Analysis Framework
// $Id: EAnglePixelMap.cc,v 1.4 2005/01/08 20:16:16 thea Exp $
// Alessandro Thea created Jun, 2 2004
#include "EAnglePixelMap.hh"
ClassImp(EAnglePixelMap)
//_____________________________________________________________________________
EAnglePixelMap::EAnglePixelMap() {
// ctor
fThetaFOV = 0;
fSigmaThetaFOV = 0;
fPhiFOV = 0;
fSigmaPhiFOV = 0;
Clear();
}
//_____________________________________________________________________________
EAnglePixelMap::EAnglePixelMap( Int_t n ) {
// ctor
Clear();
}
//_____________________________________________________________________________
EAnglePixelMap::EAnglePixelMap( const EAnglePixelMap& other ) : TObject() {
// copy ctor
other.Copy( *this );
}
//_____________________________________________________________________________
EAnglePixelMap::~EAnglePixelMap() {
// dtor
}
//_____________________________________________________________________________
void EAnglePixelMap::Clear( Option_t* opt) {
// initialize
fNumPixels = 0;
if ( fThetaFOV ) delete [] fThetaFOV;
if ( fSigmaThetaFOV ) delete [] fSigmaThetaFOV;
if ( fPhiFOV ) delete [] fPhiFOV;
if ( fSigmaPhiFOV ) delete [] fSigmaPhiFOV;
fThetaFOV = 0;
fSigmaThetaFOV = 0;
fPhiFOV = 0;
fSigmaPhiFOV = 0;
}
//_____________________________________________________________________________
void EAnglePixelMap::Copy( TObject& other ) const {
// copy
TObject::Copy(other);
((EAnglePixelMap&)other).Resize( GetNumPixels() );
for ( Int_t i(0); i < GetNumPixels(); i++ ) {
((EAnglePixelMap&)other).fThetaFOV[i] = fThetaFOV[i];
((EAnglePixelMap&)other).fSigmaThetaFOV[i] = fSigmaThetaFOV[i];
((EAnglePixelMap&)other).fPhiFOV[i] = fPhiFOV[i];
((EAnglePixelMap&)other).fSigmaPhiFOV[i] = fSigmaPhiFOV[i];
}
}
//_____________________________________________________________________________
Int_t EAnglePixelMap::Resize( Int_t n ) {
// resize the map to n
Clear();
fNumPixels = n;
fThetaFOV = new Float_t[n];
fSigmaThetaFOV = new Float_t[n];
fPhiFOV = new Float_t[n];
fSigmaPhiFOV = new Float_t[n];
return n;
}