Version where the process for HLT and vdrift on DAQ are off(Raphaelle)
[u/mrichter/AliRoot.git] / TRD / AliTRDEntriesInfo.cxx
CommitLineData
e526983e 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: AliTRDEntriesInfo.cxx 27946 2008-08-13 15:26:24Z cblume $ */
17
18///////////////////////////////////////////////////////////////////////////////
19// //
20// Calibration base class for a single ROC //
21// Contains one UShort_t value per pad //
22// However, values are set and get as float, there are stored internally as //
23// (UShort_t) value * 10000 //
24// //
25///////////////////////////////////////////////////////////////////////////////
26
e526983e 27#include "AliTRDEntriesInfo.h"
e526983e 28
29ClassImp(AliTRDEntriesInfo)
30
31//_____________________________________________________________________________
32AliTRDEntriesInfo::AliTRDEntriesInfo()
33 :AliTRDUshortInfo()
34{
35 //
36 // Default constructor
37 //
38
39}
40//_____________________________________________________________________________
41AliTRDEntriesInfo::AliTRDEntriesInfo(Int_t n)
42 :AliTRDUshortInfo(n)
43{
44 //
45 // Constructor that initializes a given size
46 //
47
48}
49//_____________________________________________________________________________
50AliTRDEntriesInfo::AliTRDEntriesInfo(const AliTRDEntriesInfo &c)
51 :AliTRDUshortInfo(c)
52{
53 //
54 // AliTRDEntriesInfo copy constructor
55 //
56
57}
58//_____________________________________________________________________________
59AliTRDEntriesInfo::~AliTRDEntriesInfo()
60{
61 //
62 // AliTRDEntriesInfo destructor
63 //
64
65
66}
67//_____________________________________________________________________________
68AliTRDEntriesInfo &AliTRDEntriesInfo::operator=(const AliTRDEntriesInfo &c)
69{
70 //
71 // Assignment operator
72 //
73
74 if (this != &c) ((AliTRDEntriesInfo &) c).Copy(*this);
75 return *this;
76
77}
78//___________________________________________________________________________________
2c919856 79Int_t AliTRDEntriesInfo::GetSum() const
e526983e 80{
81 //
82 // Calculate the sum of entries
83 //
84
85 Int_t total = 0;
86
87 for(Int_t k = 0; k < fSize; k++){
88 total += fData[k];
89 }
90
91
92 return total;
93
94}
95//____________________________________________________________________________________________
96Bool_t AliTRDEntriesInfo::TestAdd(const AliTRDEntriesInfo * info)
97{
98 //
99 // add values
100 //
101 for (Int_t idata = 0; idata< fSize; idata++){
102 if((At(idata)+info->At(idata)) > 65535) return kFALSE;
103 }
104 return kTRUE;
105}
106//____________________________________________________________________________________________
107void AliTRDEntriesInfo::Add(const AliTRDEntriesInfo * info)
108{
109 //
110 // add values
111 //
112 for (Int_t idata = 0; idata< fSize; idata++){
113 fData[idata] += info->At(idata);
114 }
115}
116//____________________________________________________________________________________________
117void AliTRDEntriesInfo::AddIf(const AliTRDEntriesInfo * info)
118{
119 //
120 // add values
121 //
122 for (Int_t idata = 0; idata< fSize; idata++){
123 if(((fData[idata]+info->At(idata)) <= 65535) && ((fData[idata]+info->At(idata)) >= 0)) fData[idata] += info->At(idata);
124 }
125}