source: JEM-EUSO/esaf_cc_at_lal/packages/common/root/src/EShower.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: 3.0 KB
Line 
1// ESAF : Euso Simulation and Analysis Framework
2// $Id: EShower.cc 2918 2011-06-10 22:22:31Z mabl $
3//  created May, 23 2004
4
5#include "EShower.hh"
6#include "Etypes.hh"
7
8ClassImp(EShower)
9
10EShower* EShower::fgCurrent = NULL;
11
12const Int_t fgDefClonesSize=1000;
13
14//_____________________________________________________________________________
15EShower::EShower() {
16    // ctor
17
18    if ( TClass::IsCallingNew()) {
19        // this is the case of the default constructor called by Streamers and
20        // other internal memory handling methods
21        fSteps = NULL;
22    } else {
23        // standard user defined behavior
24        fSteps = new TClonesArray("EShowerStep",fgDefClonesSize);
25    }
26
27    fCopy                 = kFALSE;
28
29    fNumSteps             = 0;
30    fEnergy               = -kHuge;
31    fTheta                = -kHuge;
32    fPhi                  = -kHuge;
33    fX1                   = -kHuge;
34    fElectrEthres         = -kHuge; 
35    fDirX                 = -kHuge;
36    fDirY                 = -kHuge;
37    fDirZ                 = -kHuge;
38    fInitPosX             = -kHuge;
39    fInitPosY             = -kHuge;
40    fInitPosZ             = -kHuge;
41    fHitGround            = kFALSE;
42
43
44}
45
46//_____________________________________________________________________________
47EShower::EShower( const EShower& other ) : TObject() {
48    // copy ctor
49
50    other.Copy( *this);
51}
52
53//_____________________________________________________________________________
54EShower::~EShower() {
55    // dtor
56
57    if ( fSteps ) {
58        fSteps->Delete();
59        delete fSteps;
60        fSteps = 0;
61    }
62
63    if ( GetCurrent() == this ) SetCurrent( 0 ); 
64}
65
66//_____________________________________________________________________________
67void EShower::Copy( TObject& other ) const { 
68    // copy
69
70    EShower &o = (EShower&)other;
71
72    o.fCopy = kTRUE;
73    o.fEnergy               = fEnergy;
74    o.fTheta                = fTheta;
75    o.fPhi                  = fPhi;
76    o.fX1                   = fX1;
77    o.fElectrEthres         = fElectrEthres;
78    o.fDirX                 = fDirX;
79    o.fDirY                 = fDirY;
80    o.fDirZ                 = fDirZ;
81    o.fInitPosX             = fInitPosX;
82    o.fInitPosY             = fInitPosY;
83    o.fInitPosZ             = fInitPosZ;
84    o.fHitGround            = fHitGround;
85    o.fNumSteps             = fNumSteps;
86
87    o.fSteps = (TClonesArray*)fSteps->Clone();
88}
89
90//_____________________________________________________________________________
91void EShower::Clear( Option_t* ) {
92    // clear this
93
94    if( fSteps )
95        fSteps->Clear("C");
96
97    fNumSteps = 0;
98
99    fElectrEthres         = -kHuge; 
100    fDirX                 = -kHuge;
101    fDirY                 = -kHuge;
102    fDirZ                 = -kHuge;
103    fInitPosX             = -kHuge;
104    fInitPosY             = -kHuge;
105    fInitPosZ             = -kHuge;
106    fHitGround            = kFALSE;
107}
108 
109
110//______________________________________________________________________________
111void EShower::ClearAndShrink( Option_t* opt ) {
112    //
113    //
114    //
115    Clear( opt );
116    if ( fSteps ) fSteps->Expand( fgDefClonesSize );
117
118}
Note: See TracBrowser for help on using the repository browser.