1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
16 /* $Id: AliTRDdigitsParam.cxx 34070 2009-08-04 15:34:53Z cblume $ */
18 ///////////////////////////////////////////////////////////////////////////////
20 // Class containing parameters for digits //
22 ///////////////////////////////////////////////////////////////////////////////
26 #include "AliTRDdigitsParam.h"
27 #include "AliTRDcalibDB.h"
29 ClassImp(AliTRDdigitsParam)
31 //_____________________________________________________________________________
32 AliTRDdigitsParam::AliTRDdigitsParam()
39 // Default constructor
42 for (Int_t i = 0; i < 540; i++) {
43 fPretriggerPhase[i] = 0;
48 //_____________________________________________________________________________
49 AliTRDdigitsParam::~AliTRDdigitsParam()
57 //_____________________________________________________________________________
58 AliTRDdigitsParam::AliTRDdigitsParam(const AliTRDdigitsParam &p)
60 ,fCheckOCDB(p.fCheckOCDB)
61 ,fNTimeBins(p.fNTimeBins)
62 ,fADCbaseline(p.fADCbaseline)
68 for (Int_t i = 0; i < 540; i++) {
69 fPretriggerPhase[i] = p.fPretriggerPhase[i];
74 //_____________________________________________________________________________
75 AliTRDdigitsParam &AliTRDdigitsParam::operator=(const AliTRDdigitsParam &p)
78 // Assignment operator
82 ((AliTRDdigitsParam &) p).Copy(*this);
89 //_____________________________________________________________________________
90 void AliTRDdigitsParam::Copy(TObject &p) const
96 AliTRDdigitsParam *target = dynamic_cast<AliTRDdigitsParam*> (&p);
101 target->fCheckOCDB = fCheckOCDB;
102 target->fNTimeBins = fNTimeBins;
103 target->fADCbaseline = fADCbaseline;
105 for (Int_t i = 0; i < 540; i++) {
106 target->fPretriggerPhase[i] = fPretriggerPhase[i];
111 //_____________________________________________________________________________
112 Bool_t AliTRDdigitsParam::SetNTimeBins(Int_t ntb)
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)
124 Int_t nTimeBinsOCDB = AliTRDcalibDB::Instance()->GetNumberOfTimeBins();
125 if (fNTimeBins == nTimeBinsOCDB) {
129 AliWarning(Form("Number of timebins does not match OCDB value (%d, %d)"
130 ,fNTimeBins,nTimeBinsOCDB));