ROOT logo
/**************************************************************************
 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
 *                                                                        *
 * Author: The ALICE Off-line Project.                                    *
 * Contributors are mentioned in the code where appropriate.              *
 *                                                                        *
 * Permission to use, copy, modify and distribute this software and its   *
 * documentation strictly for non-commercial purposes is hereby granted   *
 * without fee, provided that the above copyright notice appears in all   *
 * copies and that both the copyright notice and this permission notice   *
 * appear in the supporting documentation. The authors make no claims     *
 * about the suitability of this software for any purpose. It is          *
 * provided "as is" without express or implied warranty.                  *
 **************************************************************************/

/* $Id: AliTRDCalDCS.cxx 18952 2007-06-08 11:36:12Z cblume $ */

///////////////////////////////////////////////////////////////////////////////
//                                                                           //
//  TRD calibration class for TRD DCS parameters                             //
//                                                                           //
///////////////////////////////////////////////////////////////////////////////

#include "AliTRDCalDCS.h"
#include "AliTRDCalDCSFEE.h"
#include "AliTRDCalDCSGTU.h"

ClassImp(AliTRDCalDCS)
  
//_____________________________________________________________________________
AliTRDCalDCS::AliTRDCalDCS()
  :TNamed()
  ,fGNumberOfTimeBins(-1)
  ,fGConfigTag(-1)
  ,fGSingleHitThres(-1)
  ,fGThreePadClustThres(-1)
  ,fGSelNoZS(-1)
  ,fGTCFilterWeight(-1)
  ,fGTCFilterShortDecPar(-1)
  ,fGTCFilterLongDecPar(-1)
  ,fGFastStatNoise(-1)
  ,fGConfigVersion(0)
  ,fGConfigName(0)
  ,fGFilterType(0)
  ,fGReadoutParam(0)
  ,fGTestPattern(0)
  ,fGTrackletMode(0)
  ,fGTrackletDef(0)
  ,fGTriggerSetup(0)
  ,fGAddOptions(0)
  ,fRunType("")
  ,fStartTime(0)
  ,fEndTime(0)
  ,fFEEArr(0)
  ,fPTRArr(0)
  ,fGTUObj(0)
{
  //
  // AliTRDCalDCS default constructor
  //

}

//_____________________________________________________________________________
AliTRDCalDCS::AliTRDCalDCS(const Text_t *name, const Text_t *title)
  :TNamed(name,title)
  ,fGNumberOfTimeBins(-1)
  ,fGConfigTag(-1)
  ,fGSingleHitThres(-1)
  ,fGThreePadClustThres(-1)
  ,fGSelNoZS(-1)
  ,fGTCFilterWeight(-1)
  ,fGTCFilterShortDecPar(-1)
  ,fGTCFilterLongDecPar(-1)
  ,fGFastStatNoise(-1)
  ,fGConfigVersion(0)
  ,fGConfigName(0)
  ,fGFilterType(0)
  ,fGReadoutParam(0)
  ,fGTestPattern(0)
  ,fGTrackletMode(0)
  ,fGTrackletDef(0)
  ,fGTriggerSetup(0)
  ,fGAddOptions(0)
  ,fRunType("")
  ,fStartTime(0)
  ,fEndTime(0)
  ,fFEEArr(new TObjArray(540))
  ,fPTRArr(new TObjArray(6))
  ,fGTUObj(new AliTRDCalDCSGTU())
{
  //
  // AliTRDCalDCS constructor
  //

}

//_____________________________________________________________________________
AliTRDCalDCS::AliTRDCalDCS(const AliTRDCalDCS &cd)
  :TNamed(cd)
  ,fGNumberOfTimeBins(-1)
  ,fGConfigTag(-1)
  ,fGSingleHitThres(-1)
  ,fGThreePadClustThres(-1)
  ,fGSelNoZS(-1)
  ,fGTCFilterWeight(-1)
  ,fGTCFilterShortDecPar(-1)
  ,fGTCFilterLongDecPar(-1)
  ,fGFastStatNoise(-1)
  ,fGConfigVersion(0)
  ,fGConfigName(0)
  ,fGFilterType(0)
  ,fGReadoutParam(0)
  ,fGTestPattern(0)
  ,fGTrackletMode(0)
  ,fGTrackletDef(0)
  ,fGTriggerSetup(0)
  ,fGAddOptions(0)
  ,fRunType("")
  ,fStartTime(0)
  ,fEndTime(0)
  ,fFEEArr(new TObjArray(540))
  ,fPTRArr(new TObjArray(6))
  ,fGTUObj(new AliTRDCalDCSGTU())
{
  //
  // AliTRDCalDCS copy constructor
  //

}

//_____________________________________________________________________________
AliTRDCalDCS &AliTRDCalDCS::operator=(const AliTRDCalDCS &cd)
{
  //
  // Assignment operator
  //
  if (&cd == this) return *this;

  new (this) AliTRDCalDCS(cd);
  return *this;
}

//_____________________________________________________________________________
void AliTRDCalDCS::EvaluateGlobalParameters()
{
  //
  // Do an evaluation of all global parameters
  //

  for(Int_t i=0; i<540; i++) {
    AliTRDCalDCSFEE *iDCSFEEObj;
    iDCSFEEObj = GetCalDCSFEEObj(i);
    if(iDCSFEEObj != NULL) {
      if(iDCSFEEObj->GetStatusBit() == 0) {
	// first, set the parameters of the first good ROC as global
	fGNumberOfTimeBins    = iDCSFEEObj->GetNumberOfTimeBins();
	fGConfigTag           = iDCSFEEObj->GetConfigTag();
	fGSingleHitThres      = iDCSFEEObj->GetSingleHitThres();
	fGThreePadClustThres  = iDCSFEEObj->GetThreePadClustThres();
	fGSelNoZS             = iDCSFEEObj->GetSelectiveNoZS();
	fGTCFilterWeight      = iDCSFEEObj->GetTCFilterWeight();
	fGTCFilterShortDecPar = iDCSFEEObj->GetTCFilterShortDecPar();
	fGTCFilterLongDecPar  = iDCSFEEObj->GetTCFilterLongDecPar();
	fGFastStatNoise       = iDCSFEEObj->GetFastStatNoise();
	fGConfigVersion       = iDCSFEEObj->GetConfigVersion();
	fGConfigName          = iDCSFEEObj->GetConfigName();
	fGFilterType          = iDCSFEEObj->GetFilterType();
	fGReadoutParam        = iDCSFEEObj->GetReadoutParam();
	fGTestPattern         = iDCSFEEObj->GetTestPattern();
	fGTrackletMode        = iDCSFEEObj->GetTrackletMode();
	fGTrackletDef         = iDCSFEEObj->GetTrackletDef();
	fGTriggerSetup        = iDCSFEEObj->GetTriggerSetup();
	fGAddOptions          = iDCSFEEObj->GetAddOptions();
	break;
      }
    }
  }

  for(Int_t i=0; i<540; i++) {
    AliTRDCalDCSFEE *iDCSFEEObj;
    iDCSFEEObj = GetCalDCSFEEObj(i);
    if(iDCSFEEObj != NULL) {
      if(iDCSFEEObj->GetStatusBit() == 0) {
	// second, if any of the other good chambers differ, set the global value to -1/""
	if(fGNumberOfTimeBins    != iDCSFEEObj->GetNumberOfTimeBins())    fGNumberOfTimeBins    = -2;
	if(fGConfigTag           != iDCSFEEObj->GetConfigTag())           fGConfigTag           = -2;
	if(fGSingleHitThres      != iDCSFEEObj->GetSingleHitThres())      fGSingleHitThres      = -2;
	if(fGThreePadClustThres  != iDCSFEEObj->GetThreePadClustThres())  fGThreePadClustThres  = -2;
	if(fGSelNoZS             != iDCSFEEObj->GetSelectiveNoZS())       fGSelNoZS             = -2;
	if(fGTCFilterWeight      != iDCSFEEObj->GetTCFilterWeight())      fGTCFilterWeight      = -2;
	if(fGTCFilterShortDecPar != iDCSFEEObj->GetTCFilterShortDecPar()) fGTCFilterShortDecPar = -2;
	if(fGTCFilterLongDecPar  != iDCSFEEObj->GetTCFilterLongDecPar())  fGTCFilterLongDecPar  = -2;
	if(fGFastStatNoise       != iDCSFEEObj->GetFastStatNoise())       fGFastStatNoise       = -2;
	if(fGConfigVersion       != iDCSFEEObj->GetConfigVersion())       fGConfigVersion       = "mixed";
	if(fGConfigName          != iDCSFEEObj->GetConfigName())          fGConfigName          = "mixed";
	if(fGFilterType          != iDCSFEEObj->GetFilterType())          fGFilterType          = "mixed";
	if(fGReadoutParam        != iDCSFEEObj->GetReadoutParam())        fGReadoutParam        = "mixed";
	if(fGTestPattern         != iDCSFEEObj->GetTestPattern())         fGTestPattern         = "mixed";
	if(fGTrackletMode        != iDCSFEEObj->GetTrackletMode())        fGTrackletMode        = "mixed";
	if(fGTrackletDef         != iDCSFEEObj->GetTrackletDef())         fGTrackletDef         = "mixed";
	if(fGTriggerSetup        != iDCSFEEObj->GetTriggerSetup())        fGTriggerSetup        = "mixed";
	if(fGAddOptions          != iDCSFEEObj->GetAddOptions())          fGAddOptions          = "mixed";
      }
    }
  }
}


 AliTRDCalDCS.cxx:1
 AliTRDCalDCS.cxx:2
 AliTRDCalDCS.cxx:3
 AliTRDCalDCS.cxx:4
 AliTRDCalDCS.cxx:5
 AliTRDCalDCS.cxx:6
 AliTRDCalDCS.cxx:7
 AliTRDCalDCS.cxx:8
 AliTRDCalDCS.cxx:9
 AliTRDCalDCS.cxx:10
 AliTRDCalDCS.cxx:11
 AliTRDCalDCS.cxx:12
 AliTRDCalDCS.cxx:13
 AliTRDCalDCS.cxx:14
 AliTRDCalDCS.cxx:15
 AliTRDCalDCS.cxx:16
 AliTRDCalDCS.cxx:17
 AliTRDCalDCS.cxx:18
 AliTRDCalDCS.cxx:19
 AliTRDCalDCS.cxx:20
 AliTRDCalDCS.cxx:21
 AliTRDCalDCS.cxx:22
 AliTRDCalDCS.cxx:23
 AliTRDCalDCS.cxx:24
 AliTRDCalDCS.cxx:25
 AliTRDCalDCS.cxx:26
 AliTRDCalDCS.cxx:27
 AliTRDCalDCS.cxx:28
 AliTRDCalDCS.cxx:29
 AliTRDCalDCS.cxx:30
 AliTRDCalDCS.cxx:31
 AliTRDCalDCS.cxx:32
 AliTRDCalDCS.cxx:33
 AliTRDCalDCS.cxx:34
 AliTRDCalDCS.cxx:35
 AliTRDCalDCS.cxx:36
 AliTRDCalDCS.cxx:37
 AliTRDCalDCS.cxx:38
 AliTRDCalDCS.cxx:39
 AliTRDCalDCS.cxx:40
 AliTRDCalDCS.cxx:41
 AliTRDCalDCS.cxx:42
 AliTRDCalDCS.cxx:43
 AliTRDCalDCS.cxx:44
 AliTRDCalDCS.cxx:45
 AliTRDCalDCS.cxx:46
 AliTRDCalDCS.cxx:47
 AliTRDCalDCS.cxx:48
 AliTRDCalDCS.cxx:49
 AliTRDCalDCS.cxx:50
 AliTRDCalDCS.cxx:51
 AliTRDCalDCS.cxx:52
 AliTRDCalDCS.cxx:53
 AliTRDCalDCS.cxx:54
 AliTRDCalDCS.cxx:55
 AliTRDCalDCS.cxx:56
 AliTRDCalDCS.cxx:57
 AliTRDCalDCS.cxx:58
 AliTRDCalDCS.cxx:59
 AliTRDCalDCS.cxx:60
 AliTRDCalDCS.cxx:61
 AliTRDCalDCS.cxx:62
 AliTRDCalDCS.cxx:63
 AliTRDCalDCS.cxx:64
 AliTRDCalDCS.cxx:65
 AliTRDCalDCS.cxx:66
 AliTRDCalDCS.cxx:67
 AliTRDCalDCS.cxx:68
 AliTRDCalDCS.cxx:69
 AliTRDCalDCS.cxx:70
 AliTRDCalDCS.cxx:71
 AliTRDCalDCS.cxx:72
 AliTRDCalDCS.cxx:73
 AliTRDCalDCS.cxx:74
 AliTRDCalDCS.cxx:75
 AliTRDCalDCS.cxx:76
 AliTRDCalDCS.cxx:77
 AliTRDCalDCS.cxx:78
 AliTRDCalDCS.cxx:79
 AliTRDCalDCS.cxx:80
 AliTRDCalDCS.cxx:81
 AliTRDCalDCS.cxx:82
 AliTRDCalDCS.cxx:83
 AliTRDCalDCS.cxx:84
 AliTRDCalDCS.cxx:85
 AliTRDCalDCS.cxx:86
 AliTRDCalDCS.cxx:87
 AliTRDCalDCS.cxx:88
 AliTRDCalDCS.cxx:89
 AliTRDCalDCS.cxx:90
 AliTRDCalDCS.cxx:91
 AliTRDCalDCS.cxx:92
 AliTRDCalDCS.cxx:93
 AliTRDCalDCS.cxx:94
 AliTRDCalDCS.cxx:95
 AliTRDCalDCS.cxx:96
 AliTRDCalDCS.cxx:97
 AliTRDCalDCS.cxx:98
 AliTRDCalDCS.cxx:99
 AliTRDCalDCS.cxx:100
 AliTRDCalDCS.cxx:101
 AliTRDCalDCS.cxx:102
 AliTRDCalDCS.cxx:103
 AliTRDCalDCS.cxx:104
 AliTRDCalDCS.cxx:105
 AliTRDCalDCS.cxx:106
 AliTRDCalDCS.cxx:107
 AliTRDCalDCS.cxx:108
 AliTRDCalDCS.cxx:109
 AliTRDCalDCS.cxx:110
 AliTRDCalDCS.cxx:111
 AliTRDCalDCS.cxx:112
 AliTRDCalDCS.cxx:113
 AliTRDCalDCS.cxx:114
 AliTRDCalDCS.cxx:115
 AliTRDCalDCS.cxx:116
 AliTRDCalDCS.cxx:117
 AliTRDCalDCS.cxx:118
 AliTRDCalDCS.cxx:119
 AliTRDCalDCS.cxx:120
 AliTRDCalDCS.cxx:121
 AliTRDCalDCS.cxx:122
 AliTRDCalDCS.cxx:123
 AliTRDCalDCS.cxx:124
 AliTRDCalDCS.cxx:125
 AliTRDCalDCS.cxx:126
 AliTRDCalDCS.cxx:127
 AliTRDCalDCS.cxx:128
 AliTRDCalDCS.cxx:129
 AliTRDCalDCS.cxx:130
 AliTRDCalDCS.cxx:131
 AliTRDCalDCS.cxx:132
 AliTRDCalDCS.cxx:133
 AliTRDCalDCS.cxx:134
 AliTRDCalDCS.cxx:135
 AliTRDCalDCS.cxx:136
 AliTRDCalDCS.cxx:137
 AliTRDCalDCS.cxx:138
 AliTRDCalDCS.cxx:139
 AliTRDCalDCS.cxx:140
 AliTRDCalDCS.cxx:141
 AliTRDCalDCS.cxx:142
 AliTRDCalDCS.cxx:143
 AliTRDCalDCS.cxx:144
 AliTRDCalDCS.cxx:145
 AliTRDCalDCS.cxx:146
 AliTRDCalDCS.cxx:147
 AliTRDCalDCS.cxx:148
 AliTRDCalDCS.cxx:149
 AliTRDCalDCS.cxx:150
 AliTRDCalDCS.cxx:151
 AliTRDCalDCS.cxx:152
 AliTRDCalDCS.cxx:153
 AliTRDCalDCS.cxx:154
 AliTRDCalDCS.cxx:155
 AliTRDCalDCS.cxx:156
 AliTRDCalDCS.cxx:157
 AliTRDCalDCS.cxx:158
 AliTRDCalDCS.cxx:159
 AliTRDCalDCS.cxx:160
 AliTRDCalDCS.cxx:161
 AliTRDCalDCS.cxx:162
 AliTRDCalDCS.cxx:163
 AliTRDCalDCS.cxx:164
 AliTRDCalDCS.cxx:165
 AliTRDCalDCS.cxx:166
 AliTRDCalDCS.cxx:167
 AliTRDCalDCS.cxx:168
 AliTRDCalDCS.cxx:169
 AliTRDCalDCS.cxx:170
 AliTRDCalDCS.cxx:171
 AliTRDCalDCS.cxx:172
 AliTRDCalDCS.cxx:173
 AliTRDCalDCS.cxx:174
 AliTRDCalDCS.cxx:175
 AliTRDCalDCS.cxx:176
 AliTRDCalDCS.cxx:177
 AliTRDCalDCS.cxx:178
 AliTRDCalDCS.cxx:179
 AliTRDCalDCS.cxx:180
 AliTRDCalDCS.cxx:181
 AliTRDCalDCS.cxx:182
 AliTRDCalDCS.cxx:183
 AliTRDCalDCS.cxx:184
 AliTRDCalDCS.cxx:185
 AliTRDCalDCS.cxx:186
 AliTRDCalDCS.cxx:187
 AliTRDCalDCS.cxx:188
 AliTRDCalDCS.cxx:189
 AliTRDCalDCS.cxx:190
 AliTRDCalDCS.cxx:191
 AliTRDCalDCS.cxx:192
 AliTRDCalDCS.cxx:193
 AliTRDCalDCS.cxx:194
 AliTRDCalDCS.cxx:195
 AliTRDCalDCS.cxx:196
 AliTRDCalDCS.cxx:197
 AliTRDCalDCS.cxx:198
 AliTRDCalDCS.cxx:199
 AliTRDCalDCS.cxx:200
 AliTRDCalDCS.cxx:201
 AliTRDCalDCS.cxx:202
 AliTRDCalDCS.cxx:203
 AliTRDCalDCS.cxx:204
 AliTRDCalDCS.cxx:205
 AliTRDCalDCS.cxx:206
 AliTRDCalDCS.cxx:207
 AliTRDCalDCS.cxx:208
 AliTRDCalDCS.cxx:209