]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TRD/AliTRDdigitsParam.cxx
Changed default values of cuts
[u/mrichter/AliRoot.git] / TRD / AliTRDdigitsParam.cxx
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: AliTRDdigitsParam.cxx 34070 2009-08-04 15:34:53Z cblume $ */
17
18 ///////////////////////////////////////////////////////////////////////////////
19 //                                                                           //
20 // Class containing parameters for digits                                    //
21 //                                                                           //
22 ///////////////////////////////////////////////////////////////////////////////
23
24 #include "AliLog.h"
25
26 #include "AliTRDdigitsParam.h"
27 #include "AliTRDcalibDB.h"
28
29 ClassImp(AliTRDdigitsParam)
30
31 //_____________________________________________________________________________
32 AliTRDdigitsParam::AliTRDdigitsParam()
33   :TObject()
34   ,fCheckOCDB(kTRUE)
35   ,fNTimeBins(0)
36   ,fADCbaseline(0)
37 {
38   //
39   // Default constructor
40   //
41
42   for (Int_t i = 0; i < 540; i++) {
43     fPretriggerPhase[i] = 0;
44   }
45
46 }
47
48 //_____________________________________________________________________________
49 AliTRDdigitsParam::~AliTRDdigitsParam() 
50 {
51   //
52   // Destructor
53   //
54
55 }
56
57 //_____________________________________________________________________________
58 AliTRDdigitsParam::AliTRDdigitsParam(const AliTRDdigitsParam &p)
59   :TObject(p)
60   ,fCheckOCDB(p.fCheckOCDB)
61   ,fNTimeBins(p.fNTimeBins)
62   ,fADCbaseline(p.fADCbaseline)
63 {
64   //
65   // Copy constructor
66   //
67
68   for (Int_t i = 0; i < 540; i++) {
69     fPretriggerPhase[i] = p.fPretriggerPhase[i];
70   }
71
72 }
73
74 //_____________________________________________________________________________
75 AliTRDdigitsParam &AliTRDdigitsParam::operator=(const AliTRDdigitsParam &p)
76 {
77   //
78   // Assignment operator
79   //
80
81   if (this != &p) {
82     ((AliTRDdigitsParam &) p).Copy(*this);
83   }
84
85   return *this;
86
87 }
88
89 //_____________________________________________________________________________
90 void AliTRDdigitsParam::Copy(TObject &p) const
91 {
92   //
93   // Copy function
94   //
95   
96   AliTRDdigitsParam *target = dynamic_cast<AliTRDdigitsParam*> (&p);
97   if (!target) {
98     return;
99   }  
100
101   target->fCheckOCDB   = fCheckOCDB;
102   target->fNTimeBins   = fNTimeBins;
103   target->fADCbaseline = fADCbaseline;
104
105   for (Int_t i = 0; i < 540; i++) {
106     target->fPretriggerPhase[i] = fPretriggerPhase[i];
107   }
108
109 }
110
111 //_____________________________________________________________________________
112 Bool_t AliTRDdigitsParam::SetNTimeBins(Int_t ntb)
113 {
114   //
115   // Sets the number of time bins
116   // Per default an automatic consistency check with the corresponding
117   // OCDB entry is performed. This check can be disabled by setting
118   // SetCheckOCDB(kFALSE)
119   //
120
121   fNTimeBins = ntb;
122
123   if (fCheckOCDB) {
124     Int_t nTimeBinsOCDB = AliTRDcalibDB::Instance()->GetNumberOfTimeBins();
125     if (fNTimeBins == nTimeBinsOCDB) {
126       return kTRUE;
127     }
128     else {
129       AliWarning(Form("Number of timebins does not match OCDB value (%d, %d)"
130                      ,fNTimeBins,nTimeBinsOCDB));
131       return kFALSE;
132     }
133   }
134   else {
135     return kTRUE;
136   }
137
138 }