source: JEM-EUSO/esaf_cc_at_lal/packages/common/root/src/EAnglePixelMap.cc @ 114

Last change on this file since 114 was 114, checked in by moretto, 11 years ago

actual version of ESAF at CCin2p3

File size: 2.9 KB
Line 
1// ESAF : Euso Simulation and Analysis Framework
2// $Id: EAnglePixelMap.cc 2498 2006-02-22 12:57:29Z thea $
3// Author: A.Thea
4
5/*****************************************************************************
6 * ESAF: Euso Simulation and Analysis Framework                              *
7 *                                                                           *
8 *  Id: EAnglePixelMap                                                       *
9 *  Package: SimuEvent                                                       *
10 *  Coordinator: Alessandro.Thea                                             *
11 *                                                                           *
12 *****************************************************************************/
13
14#include "EAnglePixelMap.hh"
15
16ClassImp(EAnglePixelMap)
17
18//_____________________________________________________________________________
19EAnglePixelMap::EAnglePixelMap() {
20    //
21    // Constructor
22    //
23
24    fThetaFOV       = 0;
25    fSigmaThetaFOV  = 0;
26    fPhiFOV         = 0;
27    fSigmaPhiFOV    = 0;
28    Clear();
29}
30
31//_____________________________________________________________________________
32EAnglePixelMap::EAnglePixelMap( Int_t n ) {
33    //
34    // Constructor
35    //
36
37    Clear();
38}
39
40//_____________________________________________________________________________
41EAnglePixelMap::EAnglePixelMap( const EAnglePixelMap& other ) : TObject() {
42    //
43    // Copy constructor
44
45    other.Copy( *this );
46}
47
48//_____________________________________________________________________________
49EAnglePixelMap::~EAnglePixelMap() {
50    // dtor
51}
52
53//_____________________________________________________________________________
54void EAnglePixelMap::Clear( Option_t* opt) {
55    // initialize
56
57    fNumPixels      = 0;
58
59    if ( fThetaFOV )      delete [] fThetaFOV;
60    if ( fSigmaThetaFOV ) delete [] fSigmaThetaFOV;
61    if ( fPhiFOV )        delete [] fPhiFOV;
62    if ( fSigmaPhiFOV )   delete [] fSigmaPhiFOV;
63   
64    fThetaFOV       = 0;
65    fSigmaThetaFOV  = 0;
66    fPhiFOV         = 0;
67    fSigmaPhiFOV    = 0;
68
69}
70
71//_____________________________________________________________________________
72void EAnglePixelMap::Copy( TObject& other ) const {
73    // copy
74
75    TObject::Copy(other);
76
77    ((EAnglePixelMap&)other).Resize( GetNumPixels() );
78
79    for ( Int_t i(0); i < GetNumPixels(); i++ ) {
80        ((EAnglePixelMap&)other).fThetaFOV[i]      = fThetaFOV[i];
81        ((EAnglePixelMap&)other).fSigmaThetaFOV[i] = fSigmaThetaFOV[i];
82        ((EAnglePixelMap&)other).fPhiFOV[i]        = fPhiFOV[i];
83        ((EAnglePixelMap&)other).fSigmaPhiFOV[i]   = fSigmaPhiFOV[i];
84    }
85}
86
87//_____________________________________________________________________________
88Int_t EAnglePixelMap::Resize( Int_t n ) {
89    // resize the map to n
90
91    Clear();
92    fNumPixels = n;
93
94    fThetaFOV      = new Float_t[n];
95    fSigmaThetaFOV = new Float_t[n];
96    fPhiFOV        = new Float_t[n];
97    fSigmaPhiFOV   = new Float_t[n];
98
99    return n;   
100}
101
Note: See TracBrowser for help on using the repository browser.