]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TRD/AliTRDCommonParam.cxx
Make use of new method AliRawReader::GetNumberOfEvents() - goinf to the last event...
[u/mrichter/AliRoot.git] / TRD / AliTRDCommonParam.cxx
CommitLineData
3551db50 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
15
16/* $Id$ */
17
18///////////////////////////////////////////////////////////////////////////////
19// //
2745a409 20// Class containing constant common parameters //
3551db50 21// //
2745a409 22// Request an instance with AliTRDCommonParam::Instance() //
3551db50 23// Then request the needed values //
24// //
25///////////////////////////////////////////////////////////////////////////////
26
c965eab1 27#include <TObjArray.h>
28
29#include "AliTracker.h"
5f5f7b5e 30#include "AliRun.h"
3551db50 31
32#include "AliTRDCommonParam.h"
5f5f7b5e 33
3551db50 34ClassImp(AliTRDCommonParam)
35
c965eab1 36AliTRDCommonParam *AliTRDCommonParam::fgInstance = 0;
3551db50 37Bool_t AliTRDCommonParam::fgTerminated = kFALSE;
38
39//_ singleton implementation __________________________________________________
40AliTRDCommonParam* AliTRDCommonParam::Instance()
41{
42 //
43 // Singleton implementation
44 // Returns an instance of this class, it is created if neccessary
45 //
46
c965eab1 47 if (fgTerminated != kFALSE) {
3551db50 48 return 0;
c965eab1 49 }
3551db50 50
c965eab1 51 if (fgInstance == 0) {
3551db50 52 fgInstance = new AliTRDCommonParam();
c965eab1 53 }
54
3551db50 55 return fgInstance;
2745a409 56
3551db50 57}
58
2745a409 59//_____________________________________________________________________________
3551db50 60void AliTRDCommonParam::Terminate()
61{
62 //
63 // Singleton implementation
4806f526 64 // Deletes the instance of this class and sets the terminated flag,
65 // instances cannot be requested anymore
3551db50 66 // This function can be called several times.
67 //
68
69 fgTerminated = kTRUE;
70
c965eab1 71 if (fgInstance != 0) {
3551db50 72 delete fgInstance;
73 fgInstance = 0;
74 }
2745a409 75
3551db50 76}
77
78//_____________________________________________________________________________
79AliTRDCommonParam::AliTRDCommonParam()
2745a409 80 :TObject()
2745a409 81 ,fExBOn(kFALSE)
b43a3e17 82 ,fSamplingFrequency(0.0)
3551db50 83{
84 //
2745a409 85 // Default constructor
3551db50 86 //
87
3551db50 88 Init();
2745a409 89
26db308d 90}
3551db50 91
ba84a3e3 92//_____________________________________________________________________________
93AliTRDCommonParam::AliTRDCommonParam(TRootIoCtor *)
94 :TObject()
95 ,fExBOn(0)
96 ,fSamplingFrequency(0.0)
97{
98 //
99 // IO constructor
100 //
101
102}
103
3551db50 104//_____________________________________________________________________________
105void AliTRDCommonParam::Init()
106{
107 //
2745a409 108 // Initialization
3551db50 109 //
110
111 // E x B effects
b43a3e17 112 fExBOn = kTRUE;
113
114 // Sampling Frequency in MHz
115 fSamplingFrequency = 10.0;
2745a409 116
5f6f5c22 117 for (Int_t i = 0; i < kNsector; i++) {
118 fSMstatus[i] = 1;
119 }
120
3551db50 121}
122
123//_____________________________________________________________________________
124AliTRDCommonParam::~AliTRDCommonParam()
125{
126 //
2745a409 127 // Destructor
3551db50 128 //
129
26db308d 130}
3551db50 131
132//_____________________________________________________________________________
2745a409 133AliTRDCommonParam::AliTRDCommonParam(const AliTRDCommonParam &p)
134 :TObject(p)
2745a409 135 ,fExBOn(p.fExBOn)
b43a3e17 136 ,fSamplingFrequency(p.fSamplingFrequency)
3551db50 137{
138 //
2745a409 139 // Copy constructor
3551db50 140 //
141
3551db50 142}
143
3551db50 144//_____________________________________________________________________________
145AliTRDCommonParam &AliTRDCommonParam::operator=(const AliTRDCommonParam &p)
146{
147 //
148 // Assignment operator
149 //
150
c965eab1 151 if (this != &p) {
152 ((AliTRDCommonParam &) p).Copy(*this);
153 }
154
3551db50 155 return *this;
2745a409 156
3551db50 157}
158
159//_____________________________________________________________________________
160void AliTRDCommonParam::Copy(TObject &p) const
161{
162 //
163 // Copy function
164 //
165
c965eab1 166 AliTRDCommonParam *target = dynamic_cast<AliTRDCommonParam*> (&p);
2745a409 167 if (!target) {
3551db50 168 return;
2745a409 169 }
170
b43a3e17 171 target->fExBOn = fExBOn;
172 target->fSamplingFrequency = fSamplingFrequency;
2745a409 173
3551db50 174}