]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TRD/TRDbase/AliTRDCalDCSv2.cxx
TRD module
[u/mrichter/AliRoot.git] / TRD / TRDbase / AliTRDCalDCSv2.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: AliTRDCalDCSv2.cxx 18952 2007-06-08 11:36:12Z cblume $ */
17
18 ///////////////////////////////////////////////////////////////////////////////
19 //                                                                           //
20 //  TRD calibration class v2 for TRD DCS parameters                             //
21 //                                                                           //
22 ///////////////////////////////////////////////////////////////////////////////
23
24 #include "AliTRDCalDCSv2.h"
25 #include "AliTRDCalDCSFEEv2.h"
26 #include "AliTRDCalDCSGTU.h"
27
28 ClassImp(AliTRDCalDCSv2)
29   
30 //_____________________________________________________________________________
31 AliTRDCalDCSv2::AliTRDCalDCSv2()
32   :TNamed()
33   ,fGNumberOfTimeBins(-1)
34   ,fGConfigTag(-1)
35   ,fGSingleHitThres(-1)
36   ,fGThreePadClustThres(-1)
37   ,fGSelNoZS(-1)
38   ,fGTCFilterWeight(-1)
39   ,fGTCFilterShortDecPar(-1)
40   ,fGTCFilterLongDecPar(-1)
41   ,fGFastStatNoise(-1)
42   ,fGConfigVersion(0)
43   ,fGConfigName(0)
44   ,fGFilterType(0)
45   ,fGReadoutParam(0)
46   ,fGTestPattern(0)
47   ,fGTrackletMode(0)
48   ,fGTrackletDef(0)
49   ,fGTriggerSetup(0)
50   ,fGAddOptions(0)
51   ,fRunType("")
52   ,fStartTime(0)
53   ,fEndTime(0)
54   ,fFEEArr(new TObjArray(540))
55   ,fPTRArr(new TObjArray(6))
56   ,fGTUObj(new AliTRDCalDCSGTU())
57 {
58   //
59   // AliTRDCalDCSv2 default constructor
60   //
61 }
62
63 //_____________________________________________________________________________
64 AliTRDCalDCSv2::AliTRDCalDCSv2(const Text_t *name, const Text_t *title)
65   :TNamed(name,title)
66   ,fGNumberOfTimeBins(-1)
67   ,fGConfigTag(-1)
68   ,fGSingleHitThres(-1)
69   ,fGThreePadClustThres(-1)
70   ,fGSelNoZS(-1)
71   ,fGTCFilterWeight(-1)
72   ,fGTCFilterShortDecPar(-1)
73   ,fGTCFilterLongDecPar(-1)
74   ,fGFastStatNoise(-1)
75   ,fGConfigVersion(0)
76   ,fGConfigName(0)
77   ,fGFilterType(0)
78   ,fGReadoutParam(0)
79   ,fGTestPattern(0)
80   ,fGTrackletMode(0)
81   ,fGTrackletDef(0)
82   ,fGTriggerSetup(0)
83   ,fGAddOptions(0)
84   ,fRunType("")
85   ,fStartTime(0)
86   ,fEndTime(0)
87   ,fFEEArr(new TObjArray(540))
88   ,fPTRArr(new TObjArray(6))
89   ,fGTUObj(new AliTRDCalDCSGTU())
90 {
91   //
92   // AliTRDCalDCSv2 constructor
93   //
94 }
95
96 //_____________________________________________________________________________
97 AliTRDCalDCSv2::AliTRDCalDCSv2(const AliTRDCalDCSv2 &cd)
98   :TNamed(cd)
99   ,fGNumberOfTimeBins(-1)
100   ,fGConfigTag(-1)
101   ,fGSingleHitThres(-1)
102   ,fGThreePadClustThres(-1)
103   ,fGSelNoZS(-1)
104   ,fGTCFilterWeight(-1)
105   ,fGTCFilterShortDecPar(-1)
106   ,fGTCFilterLongDecPar(-1)
107   ,fGFastStatNoise(-1)
108   ,fGConfigVersion(0)
109   ,fGConfigName(0)
110   ,fGFilterType(0)
111   ,fGReadoutParam(0)
112   ,fGTestPattern(0)
113   ,fGTrackletMode(0)
114   ,fGTrackletDef(0)
115   ,fGTriggerSetup(0)
116   ,fGAddOptions(0)
117   ,fRunType("")
118   ,fStartTime(0)
119   ,fEndTime(0)
120   ,fFEEArr(new TObjArray(540))
121   ,fPTRArr(new TObjArray(6))
122   ,fGTUObj(new AliTRDCalDCSGTU())
123 {
124   //
125   // AliTRDCalDCSv2 copy constructor
126   //
127 }
128
129 //_____________________________________________________________________________
130 AliTRDCalDCSv2 &AliTRDCalDCSv2::operator=(const AliTRDCalDCSv2 &cd)
131 {
132   //
133   // Assignment operator
134   //
135   if (&cd == this) return *this;
136
137   new (this) AliTRDCalDCSv2(cd);
138   return *this;
139 }
140
141 //_____________________________________________________________________________
142 void AliTRDCalDCSv2::EvaluateGlobalParameters()
143 {
144   //
145   // Do an evaluation of all global parameters
146   //
147
148   for(Int_t i=0; i<540; i++) {
149     AliTRDCalDCSFEEv2 *iDCSFEEObj;
150     iDCSFEEObj = GetCalDCSFEEObj(i);
151     if(iDCSFEEObj != NULL) {
152       if(iDCSFEEObj->GetStatusBit() == 0) {
153         // first, set the parameters of the first good ROC as global
154         fGNumberOfTimeBins    = iDCSFEEObj->GetNumberOfTimeBins();
155         fGConfigTag           = iDCSFEEObj->GetConfigTag();
156         fGSingleHitThres      = iDCSFEEObj->GetSingleHitThres();
157         fGThreePadClustThres  = iDCSFEEObj->GetThreePadClustThres();
158         fGSelNoZS             = iDCSFEEObj->GetSelectiveNoZS();
159         fGTCFilterWeight      = iDCSFEEObj->GetTCFilterWeight();
160         fGTCFilterShortDecPar = iDCSFEEObj->GetTCFilterShortDecPar();
161         fGTCFilterLongDecPar  = iDCSFEEObj->GetTCFilterLongDecPar();
162         fGFastStatNoise       = iDCSFEEObj->GetFastStatNoise();
163         fGConfigVersion       = iDCSFEEObj->GetConfigVersion();
164         fGConfigName          = iDCSFEEObj->GetConfigName();
165         fGFilterType          = iDCSFEEObj->GetFilterType();
166         fGReadoutParam        = iDCSFEEObj->GetReadoutParam();
167         fGTestPattern         = iDCSFEEObj->GetTestPattern();
168         fGTrackletMode        = iDCSFEEObj->GetTrackletMode();
169         fGTrackletDef         = iDCSFEEObj->GetTrackletDef();
170         fGTriggerSetup        = iDCSFEEObj->GetTriggerSetup();
171         fGAddOptions          = iDCSFEEObj->GetAddOptions();
172         break;
173       }
174     }
175   }
176
177   for(Int_t i=0; i<540; i++) {
178     AliTRDCalDCSFEEv2 *iDCSFEEObj;
179     iDCSFEEObj = GetCalDCSFEEObj(i);
180     if(iDCSFEEObj != NULL) {
181       if(iDCSFEEObj->GetStatusBit() == 0) {
182         // second, if any of the other good chambers differ, set the global value to -1/""
183         if(fGNumberOfTimeBins    != iDCSFEEObj->GetNumberOfTimeBins())    fGNumberOfTimeBins    = -2;
184         if(fGConfigTag           != iDCSFEEObj->GetConfigTag())           fGConfigTag           = -2;
185         if(fGSingleHitThres      != iDCSFEEObj->GetSingleHitThres())      fGSingleHitThres      = -2;
186         if(fGThreePadClustThres  != iDCSFEEObj->GetThreePadClustThres())  fGThreePadClustThres  = -2;
187         if(fGSelNoZS             != iDCSFEEObj->GetSelectiveNoZS())       fGSelNoZS             = -2;
188         if(fGTCFilterWeight      != iDCSFEEObj->GetTCFilterWeight())      fGTCFilterWeight      = -2;
189         if(fGTCFilterShortDecPar != iDCSFEEObj->GetTCFilterShortDecPar()) fGTCFilterShortDecPar = -2;
190         if(fGTCFilterLongDecPar  != iDCSFEEObj->GetTCFilterLongDecPar())  fGTCFilterLongDecPar  = -2;
191         if(fGFastStatNoise       != iDCSFEEObj->GetFastStatNoise())       fGFastStatNoise       = -2;
192         if(fGConfigVersion       != iDCSFEEObj->GetConfigVersion())       fGConfigVersion       = "mixed";
193         if(fGConfigName          != iDCSFEEObj->GetConfigName())          fGConfigName          = "mixed";
194         if(fGFilterType          != iDCSFEEObj->GetFilterType())          fGFilterType          = "mixed";
195         if(fGReadoutParam        != iDCSFEEObj->GetReadoutParam())        fGReadoutParam        = "mixed";
196         if(fGTestPattern         != iDCSFEEObj->GetTestPattern())         fGTestPattern         = "mixed";
197         if(fGTrackletMode        != iDCSFEEObj->GetTrackletMode())        fGTrackletMode        = "mixed";
198         if(fGTrackletDef         != iDCSFEEObj->GetTrackletDef())         fGTrackletDef         = "mixed";
199         if(fGTriggerSetup        != iDCSFEEObj->GetTriggerSetup())        fGTriggerSetup        = "mixed";
200         if(fGAddOptions          != iDCSFEEObj->GetAddOptions())          fGAddOptions          = "mixed";
201       }
202     }
203   }
204 }
205
206