]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TRD/AliTRDdigitsParam.cxx
Added possibility to process only charged particles (without smearing and TPC accepta...
[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 {
37   //
38   // Default constructor
39   //
40
41 }
42
43 //_____________________________________________________________________________
44 AliTRDdigitsParam::~AliTRDdigitsParam() 
45 {
46   //
47   // Destructor
48   //
49
50 }
51
52 //_____________________________________________________________________________
53 AliTRDdigitsParam::AliTRDdigitsParam(const AliTRDdigitsParam &p)
54   :TObject(p)
55   ,fCheckOCDB(p.fCheckOCDB)
56   ,fNTimeBins(p.fNTimeBins)
57 {
58   //
59   // Copy constructor
60   //
61
62 }
63
64 //_____________________________________________________________________________
65 AliTRDdigitsParam &AliTRDdigitsParam::operator=(const AliTRDdigitsParam &p)
66 {
67   //
68   // Assignment operator
69   //
70
71   if (this != &p) {
72     ((AliTRDdigitsParam &) p).Copy(*this);
73   }
74
75   return *this;
76
77 }
78
79 //_____________________________________________________________________________
80 void AliTRDdigitsParam::Copy(TObject &p) const
81 {
82   //
83   // Copy function
84   //
85   
86   AliTRDdigitsParam *target = dynamic_cast<AliTRDdigitsParam*> (&p);
87   if (!target) {
88     return;
89   }  
90
91   target->fCheckOCDB = fCheckOCDB;
92   target->fNTimeBins = fNTimeBins;
93
94 }
95
96 //_____________________________________________________________________________
97 Bool_t AliTRDdigitsParam::SetNTimeBins(Int_t ntb)
98 {
99   //
100   // Sets the number of time bins
101   // Per default an automatic consistency check with the corresponding
102   // OCDB entry is performed. This check can be disabled by setting
103   // SetCheckOCDB(kFALSE)
104   //
105
106   fNTimeBins = ntb;
107
108   if (fCheckOCDB) {
109     Int_t nTimeBinsOCDB = AliTRDcalibDB::Instance()->GetNumberOfTimeBins();
110     if (fNTimeBins == nTimeBinsOCDB) {
111       return kTRUE;
112     }
113     else {
114       AliWarning(Form("Number of timebins does not match OCDB value (%d, %d)"
115                      ,fNTimeBins,nTimeBinsOCDB));
116       return kFALSE;
117     }
118   }
119   else {
120     return kTRUE;
121   }
122
123 }