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