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$ */

////////////////////////////////////////////////////////////////////////////
//                                                                        //
// This class perform operation on DCS Sensor                             //
// The configuration of each sensor is included inside this class         //
// Use the methode GetList to get all the configuration                   //
//                                                                        //
// Author:                                                                //
//   W. Monange   (w.monange@gsi.de)                                      //
//                                                                        //
////////////////////////////////////////////////////////////////////////////

#include <TObjArray.h>
#include <TClonesArray.h>

#include "AliTRDSensorArray.h"
#include "AliTRDSensor.h"

ClassImp(AliTRDSensorArray)

//_____________________________________________________________________________
AliTRDSensorArray::AliTRDSensorArray() 
  :AliDCSSensorArray()
  ,fAmanda("")
  ,fStoreName("")					
{
  //
  // Default constructor
  //
	
}

//_____________________________________________________________________________
AliTRDSensorArray::AliTRDSensorArray(const char *amanda 
				   , const char *storeName
				   , Float_t /*diffCut*/
				   , TClonesArray * const trdSensor) 
  :AliDCSSensorArray()
  ,fAmanda(amanda)
  ,fStoreName(storeName)				
{
  //
  // Constructor set fMinGraph to 0, fValCut to 0, fDiffCut to 0
  //

	fSensors 	= trdSensor;
	fMinGraph 	= 0;
	fValCut		= -1;
	fDiffCut	= -1;
	Int_t entries = fSensors->GetEntriesFast();
	if(entries > 1){
	  for(Int_t k = 0; k < entries; k++){
	    TString name (Form(amanda, k));
	    //printf("name is %s of %d\n",(const char*)name,k);
	    ((AliDCSSensor *) fSensors->UncheckedAt(k))->SetStringID(name);
	  }
	}
	else{
	  TString name (amanda);
	  //printf("name is %s\n",(const char*)name);
	  ((AliDCSSensor *) fSensors->UncheckedAt(0))->SetStringID(name);
	}

}

//_____________________________________________________________________________
AliTRDSensorArray::AliTRDSensorArray(const AliTRDSensorArray & source) 
  :AliDCSSensorArray(source)
  ,fAmanda(source.fAmanda)
  ,fStoreName(source.fStoreName)				
{
  //
  // Copy constructor
  //

	fSensors 	= source.fSensors;
	fMinGraph	= 0;
	fValCut		= -1;
	fDiffCut	= -1;

}
	
//_____________________________________________________________________________
AliTRDSensorArray::~AliTRDSensorArray()
{
  //
  // Destructor
  //
	
}

//_____________________________________________________________________________		
AliTRDSensorArray &AliTRDSensorArray::operator=(const AliTRDSensorArray &source)
{
  //
  // Assignment operator
  //

	if (&source == this) return *this;
	new (this) AliTRDSensorArray (source);
  
	return *this;  
}

//_____________________________________________________________________________
TObjArray *AliTRDSensorArray::GetList() 
{
  //
  // Return TObjArray with a list of AliTRDSensorArray corresponding to each
  // group of sensor 
  //
	
	TObjArray * list = new TObjArray (20);
	list->SetOwner (kTRUE);
	AliTRDSensorArray * aH = 0x0;
	
	// generic list of sensors
	TClonesArray listSensor540 ("AliTRDSensor", 540);	
	TClonesArray listSensor2   ("AliTRDSensor", 2); 
	TClonesArray listSensor1   ("AliTRDSensor", 1); 
	listSensor540.SetOwner (kTRUE);
	listSensor2.SetOwner (kTRUE);
	listSensor1.SetOwner (kTRUE);
	for (Int_t i = 0; i < 540; i++) {
		new(listSensor540[i]) AliTRDSensor (i, 0, 0, 0);
	}
	for (Int_t i = 0; i < 2; i++)
		new(listSensor2[i]) AliTRDSensor (i, 0, 0, 0);
	new(listSensor1[0]) AliTRDSensor (0, 0, 0, 0);
	
	
	// now create and populate   
	aH = new AliTRDSensorArray ("trd_chamberStatus%03d", "trd_chamberStatus", 
				    0.5, (TClonesArray*)listSensor540.Clone ());
	list->Add (aH);
	
	aH = new AliTRDSensorArray ("trd_goofieHv", 			"trd_goofieHv",  
				    -1, (TClonesArray*)listSensor1.Clone ());
	list->Add (aH);
	aH = new AliTRDSensorArray ("trd_goofiePeakPos%02d",	"trd_goofiePeakPos",   
				    -1, (TClonesArray*)listSensor2.Clone ());
	list->Add (aH);
	aH = new AliTRDSensorArray ("trd_goofiePeakArea%02d","trd_goofiePeakArea",   
				    -1, (TClonesArray*)listSensor2.Clone ());
	list->Add (aH);
	aH = new AliTRDSensorArray ("trd_goofieTemp%02d", 	"trd_goofieTemp",  
				    -1, (TClonesArray*)listSensor2.Clone ());
	list->Add (aH);
	aH = new AliTRDSensorArray ("trd_goofiePressure", 	"trd_goofiePressure",  
				    -1, (TClonesArray*)listSensor1.Clone ());
	list->Add (aH);
	aH = new AliTRDSensorArray ("trd_goofieVelocity", 	"trd_goofieVelocity",  
				    -1, (TClonesArray*)listSensor1.Clone ());
	list->Add (aH);
	aH = new AliTRDSensorArray ("trd_goofieGain%02d", 	"trd_goofieGain",  
				    -1, (TClonesArray*)listSensor2.Clone ());
	list->Add (aH);
	aH = new AliTRDSensorArray ("trd_goofieCO2", 		"trd_goofieCO2",  
				    -1, (TClonesArray*)listSensor1.Clone ());
	list->Add (aH);
	aH = new AliTRDSensorArray ("trd_goofieN2", 			"trd_goofieN2", 
				    -1, (TClonesArray*)listSensor1.Clone ());
	list->Add (aH);
	aH = new AliTRDSensorArray ("trd_gasO2", 			"trd_gasO2",  
				    -1, (TClonesArray*)listSensor1.Clone ());
	list->Add (aH);
	aH = new AliTRDSensorArray ("trd_gasH2O", 			"trd_gasH2O",  
				    -1, (TClonesArray*)listSensor1.Clone ());
	list->Add (aH);
	aH = new AliTRDSensorArray ("trd_gasCO2", 			"trd_gasCO2",  
				    -1, (TClonesArray*)listSensor1.Clone ());
	list->Add (aH);
	aH = new AliTRDSensorArray ("trd_gasOverpressure", 	"trd_gasOverpressure",  
				    -1, (TClonesArray*)listSensor1.Clone ());
	list->Add (aH);
	aH = new AliTRDSensorArray ("trd_envTemp%03d", 		"trd_envTemp",  
				    -1, (TClonesArray*)listSensor540.Clone ());
	list->Add (aH);
	aH = new AliTRDSensorArray ("trd_hvAnodeImon%03d", 	"trd_hvAnodeImon",	 
				    -1, (TClonesArray*)listSensor540.Clone ());
	list->Add (aH);
	aH = new AliTRDSensorArray ("trd_hvDriftImon%03d", 	"trd_hvDriftImon",  
				    -1, (TClonesArray*)listSensor540.Clone ());
	list->Add (aH);
	aH = new AliTRDSensorArray ("trd_hvAnodeUmon%03d",	"trd_hvAnodeUmon",  
				    -1, (TClonesArray*)listSensor540.Clone ());
	list->Add (aH);
	aH = new AliTRDSensorArray ("trd_hvDriftUmon%03d", 	"trd_hvDriftUmon",  
				    -1, (TClonesArray*)listSensor540.Clone ());
	list->Add (aH);
	                          
	return list;
}

//_____________________________________________________________________________
TMap* AliTRDSensorArray::ExtractDCS(TMap *dcsMap)
{
  //
  // Return Tmap with TGraph inside corresponding to values in dcsMap
  //

	return AliDCSSensorArray::ExtractDCS(dcsMap);
}

//_____________________________________________________________________________
void AliTRDSensorArray::SetGraph(TMap *map)
{
  //
  // Assign list of TGraph to the current instance
  //

	AliDCSSensorArray::SetGraph(map);
}

//_____________________________________________________________________________
Int_t AliTRDSensorArray::GetNGraph() const
{
  //
  // Return the number of TGraph
  //

	Int_t nGraph = 0;
	Int_t nsensors = fSensors->GetEntries();
	
	for (Int_t isensor = 0; isensor < nsensors; isensor++) {
		AliDCSSensor *entry = (AliDCSSensor*)fSensors->At(isensor);
		if (entry->GetGraph () != 0x0)
			nGraph ++;
	} 
	return nGraph;
}


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