]>
Commit | Line | Data |
---|---|---|
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 | ||
27 | #include <iostream> | |
28 | #include <fstream> | |
29 | #include <string> | |
30 | #include <TStyle.h> | |
31 | ||
32 | #include "AliTRDEntriesInfo.h" | |
33 | #include "TMath.h" | |
34 | #include "AliMathBase.h" | |
35 | #include "TLinearFitter.h" | |
36 | #include "TArrayI.h" | |
37 | #include "TH2F.h" | |
38 | #include "TH1F.h" | |
39 | #include "TArrayF.h" | |
40 | #include "TGraph2D.h" | |
41 | #include "TGraphDelaunay.h" | |
42 | #include "TList.h" | |
43 | ||
44 | #include "AliTRDCommonParam.h" | |
45 | #include "AliTRDpadPlane.h" | |
46 | #include "AliLog.h" | |
47 | ||
48 | ClassImp(AliTRDEntriesInfo) | |
49 | ||
50 | //_____________________________________________________________________________ | |
51 | AliTRDEntriesInfo::AliTRDEntriesInfo() | |
52 | :AliTRDUshortInfo() | |
53 | { | |
54 | // | |
55 | // Default constructor | |
56 | // | |
57 | ||
58 | } | |
59 | //_____________________________________________________________________________ | |
60 | AliTRDEntriesInfo::AliTRDEntriesInfo(Int_t n) | |
61 | :AliTRDUshortInfo(n) | |
62 | { | |
63 | // | |
64 | // Constructor that initializes a given size | |
65 | // | |
66 | ||
67 | } | |
68 | //_____________________________________________________________________________ | |
69 | AliTRDEntriesInfo::AliTRDEntriesInfo(const AliTRDEntriesInfo &c) | |
70 | :AliTRDUshortInfo(c) | |
71 | { | |
72 | // | |
73 | // AliTRDEntriesInfo copy constructor | |
74 | // | |
75 | ||
76 | } | |
77 | //_____________________________________________________________________________ | |
78 | AliTRDEntriesInfo::~AliTRDEntriesInfo() | |
79 | { | |
80 | // | |
81 | // AliTRDEntriesInfo destructor | |
82 | // | |
83 | ||
84 | ||
85 | } | |
86 | //_____________________________________________________________________________ | |
87 | AliTRDEntriesInfo &AliTRDEntriesInfo::operator=(const AliTRDEntriesInfo &c) | |
88 | { | |
89 | // | |
90 | // Assignment operator | |
91 | // | |
92 | ||
93 | if (this != &c) ((AliTRDEntriesInfo &) c).Copy(*this); | |
94 | return *this; | |
95 | ||
96 | } | |
97 | //___________________________________________________________________________________ | |
98 | Int_t AliTRDEntriesInfo::GetSum() | |
99 | { | |
100 | // | |
101 | // Calculate the sum of entries | |
102 | // | |
103 | ||
104 | Int_t total = 0; | |
105 | ||
106 | for(Int_t k = 0; k < fSize; k++){ | |
107 | total += fData[k]; | |
108 | } | |
109 | ||
110 | ||
111 | return total; | |
112 | ||
113 | } | |
114 | //____________________________________________________________________________________________ | |
115 | Bool_t AliTRDEntriesInfo::TestAdd(const AliTRDEntriesInfo * info) | |
116 | { | |
117 | // | |
118 | // add values | |
119 | // | |
120 | for (Int_t idata = 0; idata< fSize; idata++){ | |
121 | if((At(idata)+info->At(idata)) > 65535) return kFALSE; | |
122 | } | |
123 | return kTRUE; | |
124 | } | |
125 | //____________________________________________________________________________________________ | |
126 | void AliTRDEntriesInfo::Add(const AliTRDEntriesInfo * info) | |
127 | { | |
128 | // | |
129 | // add values | |
130 | // | |
131 | for (Int_t idata = 0; idata< fSize; idata++){ | |
132 | fData[idata] += info->At(idata); | |
133 | } | |
134 | } | |
135 | //____________________________________________________________________________________________ | |
136 | void AliTRDEntriesInfo::AddIf(const AliTRDEntriesInfo * info) | |
137 | { | |
138 | // | |
139 | // add values | |
140 | // | |
141 | for (Int_t idata = 0; idata< fSize; idata++){ | |
142 | if(((fData[idata]+info->At(idata)) <= 65535) && ((fData[idata]+info->At(idata)) >= 0)) fData[idata] += info->At(idata); | |
143 | } | |
144 | } |