1 ////////////////////////////////////////////////////////////////////////////////////
2 // Author: Henrik Tydesjo //
4 // Implementation of conditions data from Pixel Trigger (PIT) //
6 // The information is propagated from pixel trigger system to DCS file exchange //
7 // server (text file format). The ReadFromTextFile method will populate this //
8 // object with the values from the text file. Via a Preprocessor, this object //
9 // can be stored in OCDB. //
11 // One can also manually create conditions data that may be interesting for //
14 ////////////////////////////////////////////////////////////////////////////////////
16 #include "AliITSTriggerConditions.h"
17 #include "AliITSTriggerAlgorithmConditions.h"
21 ClassImp(AliITSTriggerConditions)
23 //__________________________________________________________________________________
24 AliITSTriggerConditions::AliITSTriggerConditions() :
28 fGlobalDescription("n/a"),
30 fInputConditionsVersion(0),
31 fParametersVersion(0),
34 fAlgoList(TObjArray(10))
36 // default constructor
37 fAlgoList.SetOwner(kTRUE);
39 //__________________________________________________________________________________
40 AliITSTriggerConditions::AliITSTriggerConditions(const AliITSTriggerConditions& cond) :
42 fRunNumber(cond.fRunNumber),
43 fFirmWareVersion(cond.fFirmWareVersion),
44 fGlobalDescription(cond.fGlobalDescription),
45 fVersionRegister(cond.fVersionRegister),
46 fInputConditionsVersion(cond.fInputConditionsVersion),
47 fParametersVersion(cond.fParametersVersion),
48 fInActiveChips(cond.fInActiveChips),
49 fNumAlgo(cond.fNumAlgo),
50 fAlgoList(cond.fAlgoList)
53 fAlgoList.SetOwner(kTRUE);
55 //__________________________________________________________________________________
56 AliITSTriggerConditions::~AliITSTriggerConditions()
61 //______________________________________________________________________
62 AliITSTriggerConditions& AliITSTriggerConditions::operator=(const AliITSTriggerConditions& cond) {
63 // assignment operator
65 fRunNumber = cond.fRunNumber;
66 fFirmWareVersion = cond.fFirmWareVersion;
67 fGlobalDescription = cond.fGlobalDescription;
68 fVersionRegister = cond.fVersionRegister;
69 fInputConditionsVersion = cond.fInputConditionsVersion;
70 fParametersVersion = cond.fParametersVersion;
71 fInActiveChips = cond.fInActiveChips;
72 fNumAlgo = cond.fNumAlgo;
73 fAlgoList = cond.fAlgoList;
77 //__________________________________________________________________________________
78 void AliITSTriggerConditions::DumpAll() const {
79 // Dumps all conditions data. This is as it is shown in PVSS, whereas the content of
80 // the txt file they are read from has a swap in the chip numbering
83 printf("RUN_NUMBER = %d\n",fRunNumber);
84 printf("PROCESSING_FIRMWARE_VERSION = %d\n",fFirmWareVersion);
85 printf("GLOBAL_DESCRIPTION = %s\n",fGlobalDescription.Data());
86 printf("VERSION_REGISTER_VALUE = %d\n",fVersionRegister);
87 printf("INPUT_CONDITIONS_VERSION = %d\n",fInputConditionsVersion);
88 printf("PARAMETERS_VERSION = %d\n",fParametersVersion);
91 printf("[Outputs]\n");
92 for (UInt_t i=0; i<fNumAlgo; i++) {
93 printf("%d = '%s', '%s'\n", GetAlgoIDI(i), GetAlgoLabelI(i), GetAlgoDescriptionI(i));
97 printf("[Output_parameters]\n");
98 for (UInt_t i=0; i<fNumAlgo; i++) {
99 printf("%d =", GetAlgoIDI(i));
100 for (Short_t p=0; p<GetNumAlgoParamI(i); p++) {
101 printf(" '%s', %d;", GetAlgoParamNameII(i,p), GetAlgoParamValueII(i,p));
107 printf("[Active_chips]\n");
108 for (UInt_t eq=0; eq<20; eq++) {
109 for (UInt_t hs=0; hs<6; hs++) {
110 UInt_t nActiveOnHs = 0;
111 TString inactiveStr = "";
112 for (UInt_t chip=0; chip<10; chip++) {
113 Bool_t isChipActive = IsChipActive(eq,hs,chip);
114 inactiveStr.Append(Form("%d",isChipActive));
115 nActiveOnHs+=isChipActive;
117 if (nActiveOnHs<10) {
118 printf("%d,%c,%d=%s\n", eq%10, eq<10 ? 'A' : 'C', hs, inactiveStr.Data());
124 //__________________________________________________________________________________
125 void AliITSTriggerConditions::ResetAll() {
126 // clear all data, and put default values
129 fGlobalDescription="n/a";
131 fInputConditionsVersion=0;
132 fParametersVersion=0;
133 ResetInActiveChips();
136 //__________________________________________________________________________________
137 void AliITSTriggerConditions::ClearAlgorithms() {
138 // clears the list of algorithms
142 //__________________________________________________________________________________
143 void AliITSTriggerConditions::ClearAlgoParamsI(UShort_t aIndex) {
144 // clears the list of parameters for algorithm with index aIndex
145 if (aIndex>=fNumAlgo) {
146 Error("AliITSTriggerConditions::ClearAlgoParamsI", "index %d out of range", aIndex);
149 ((AliITSTriggerAlgorithmConditions*)fAlgoList.At(aIndex))->ClearParams();
151 //__________________________________________________________________________________
152 void AliITSTriggerConditions::ClearAlgoParamsL(const Char_t* aLabel) {
153 // clears the list of parameters for algorithm with label aLabel
154 UShort_t findIndex=fNumAlgo;
155 for (UInt_t i=0; i<fNumAlgo; i++) {
156 if (strcmp(((AliITSTriggerAlgorithmConditions*)fAlgoList.At(i))->GetLabel(),aLabel) == 0) {
161 if (findIndex==fNumAlgo) {
162 Error("AliITSTriggerConditions::ClearAlgoParamsL", "label %s not found", aLabel);
164 ((AliITSTriggerAlgorithmConditions*)fAlgoList.At(findIndex))->ClearParams();
166 //__________________________________________________________________________________
167 void AliITSTriggerConditions::AddAlgo(UShort_t id, const Char_t* aLabel, const Char_t* aDescr) {
168 // adds a new algorithm with id 'id', label aLabel, and description aDescr
169 // if the id or label is already used in the list of algorithms, the old entry will be over-written
170 UShort_t findIndex=fNumAlgo;
171 for (UInt_t i=0; i<fNumAlgo; i++) {
172 if (strcmp(((AliITSTriggerAlgorithmConditions*)fAlgoList.At(i))->GetLabel(), aLabel) == 0 ||
173 ((AliITSTriggerAlgorithmConditions*)fAlgoList.At(i))->GetID() == id ) {
178 if (findIndex<fNumAlgo) {
179 delete fAlgoList.At(findIndex);
180 fAlgoList.AddAt(new AliITSTriggerAlgorithmConditions(id,aLabel,aDescr),findIndex);
183 fAlgoList.AddAtAndExpand(new AliITSTriggerAlgorithmConditions(id,aLabel,aDescr),fNumAlgo);
187 //__________________________________________________________________________________
188 void AliITSTriggerConditions::AddAlgoParam(UShort_t id, const Char_t* name, Int_t value) {
189 // adds a new parameter with name 'name' and value 'value', for the algorithm with id 'id'
190 UShort_t findIndex=fNumAlgo;
191 for (UInt_t i=0; i<fNumAlgo; i++) {
192 if (((AliITSTriggerAlgorithmConditions*)fAlgoList.At(i))->GetID() == id) {
197 if (findIndex==fNumAlgo) {
198 Error("AliITSTriggerConditions::AddAlgoParam", "id %d not found", id);
201 ((AliITSTriggerAlgorithmConditions*)fAlgoList.At(findIndex))->AddParam(name, value);
203 //__________________________________________________________________________________
204 Short_t AliITSTriggerConditions::GetAlgoIndexL(const Char_t* aLabel) const {
205 // returns the index for the algorithm with label aLabel
206 UShort_t findIndex=fNumAlgo;
207 for (UInt_t i=0; i<fNumAlgo; i++) {
208 if (strcmp(((AliITSTriggerAlgorithmConditions*)fAlgoList.At(i))->GetLabel(), aLabel) == 0) {
213 if (findIndex==fNumAlgo) {
214 Error("AliITSTriggerConditions::GetAlgoIndexL", "label %s not found", aLabel);
219 //__________________________________________________________________________________
220 Short_t AliITSTriggerConditions::GetAlgoIDI(UShort_t aIndex) const {
221 // returns the ID for the algorithm with index aIndex (in real life, could be 1-10)
222 if (aIndex>=fNumAlgo) {
223 Error("AliITSTriggerConditions::GetAlgoIDI", "index %d out of range", aIndex);
226 return ((AliITSTriggerAlgorithmConditions*)fAlgoList.At(aIndex))->GetID();
228 //__________________________________________________________________________________
229 const Char_t* AliITSTriggerConditions::GetAlgoLabelI(UShort_t aIndex) const {
230 // returns the label for the algorithm with index aIndex
231 if (aIndex>=fNumAlgo) {
232 Error("AliITSTriggerConditions::GetAlgoLabelI", "index %d out of range", aIndex);
235 return ((AliITSTriggerAlgorithmConditions*)fAlgoList.At(aIndex))->GetLabel();
237 //__________________________________________________________________________________
238 const Char_t* AliITSTriggerConditions::GetAlgoDescriptionI(UShort_t aIndex) const {
239 // returns the description for the algorithm with index aIndex
240 if (aIndex>=fNumAlgo) {
241 Error("AliITSTriggerConditions::GetAlgoDescriptionI", "index %d out of range", aIndex);
244 return ((AliITSTriggerAlgorithmConditions*)fAlgoList.At(aIndex))->GetDescription();
246 //__________________________________________________________________________________
247 Short_t AliITSTriggerConditions::GetNumAlgoParamI(UShort_t aIndex) const {
248 // returns the number of parameters, corresponding to the algorithm with index aIndex
249 if (aIndex>=fNumAlgo) {
250 Error("AliITSTriggerConditions::GetNumAlgoParamI", "index %d out of range", aIndex);
253 return ((AliITSTriggerAlgorithmConditions*)fAlgoList.At(aIndex))->GetNumParam();
255 //__________________________________________________________________________________
256 const Char_t* AliITSTriggerConditions::GetAlgoParamNameII(UShort_t aIndex, UShort_t pIndex) const {
257 // returns the parameter name for the parameter with index pIndex, corresponding to the algorithm with index aIndex
258 if (aIndex>=fNumAlgo) {
259 Error("AliITSTriggerConditions::GetAlgoParamNameII", "index %d out of range", aIndex);
262 return ((AliITSTriggerAlgorithmConditions*)fAlgoList.At(aIndex))->GetParamNameI(pIndex);
264 //__________________________________________________________________________________
265 Int_t AliITSTriggerConditions::GetAlgoParamValueII(UShort_t aIndex, UShort_t pIndex) const {
266 // returns the parameter value for the parameter with index pIndex, corresponding to the algorithm with index aIndex
267 if (aIndex>=fNumAlgo) {
268 Error("AliITSTriggerConditions::GetAlgoParamValueII", "index %d out of range", aIndex);
271 return ((AliITSTriggerAlgorithmConditions*)fAlgoList.At(aIndex))->GetParamValueI(pIndex);
273 //__________________________________________________________________________________
274 Int_t AliITSTriggerConditions::GetAlgoParamValueIN(UShort_t aIndex, const Char_t* pName) const {
275 // returns parameter value for the parameter named pName, corresponding to the algorithm with index aIndex
276 if (aIndex>=fNumAlgo) {
277 Error("AliITSTriggerConditions::GetAlgoParamValueIN", "index %d out of range", aIndex);
280 return ((AliITSTriggerAlgorithmConditions*)fAlgoList.At(aIndex))->GetParamValueN(pName);
282 //__________________________________________________________________________________
283 Short_t AliITSTriggerConditions::GetNumAlgoParamL(const Char_t* aLabel) const {
284 // returns the number of parameters, corresponding to the algorithm with label aLabel
285 UShort_t findIndex=fNumAlgo;
286 for (UInt_t i=0; i<fNumAlgo; i++) {
287 if (strcmp(((AliITSTriggerAlgorithmConditions*)fAlgoList.At(i))->GetLabel(), aLabel) == 0) {
292 if (findIndex==fNumAlgo) {
293 Error("AliITSTriggerConditions::GetNumAlgoParamL", "label %s not found", aLabel);
296 return ((AliITSTriggerAlgorithmConditions*)fAlgoList.At(findIndex))->GetNumParam();
298 //__________________________________________________________________________________
299 const Char_t* AliITSTriggerConditions::GetAlgoParamNameLI(const Char_t* aLabel, UShort_t pIndex) const {
300 // returns parameter name for the parameter with index pIndex, corresponding to the algorithm with label aLabel
301 UShort_t findIndex=fNumAlgo;
302 for (UInt_t i=0; i<fNumAlgo; i++) {
303 if (strcmp(((AliITSTriggerAlgorithmConditions*)fAlgoList.At(i))->GetLabel(), aLabel) == 0) {
308 if (findIndex==fNumAlgo) {
309 Error("AliITSTriggerConditions::GetAlgoParamNameLI", "label %s not found", aLabel);
312 return ((AliITSTriggerAlgorithmConditions*)fAlgoList.At(findIndex))->GetParamNameI(pIndex);
314 //__________________________________________________________________________________
315 Int_t AliITSTriggerConditions::GetAlgoParamValueLI(const Char_t* aLabel, UShort_t pIndex) const {
316 // returns parameter value for the parameter with index pIndex, corresponding to the algorithm with label aLabel
317 UShort_t findIndex=fNumAlgo;
318 for (UInt_t i=0; i<fNumAlgo; i++) {
319 if (strcmp(((AliITSTriggerAlgorithmConditions*)fAlgoList.At(i))->GetLabel(), aLabel) == 0) {
324 if (findIndex==fNumAlgo) {
325 Error("AliITSTriggerConditions::GetAlgoParamValueLI", "label %s not found", aLabel);
328 return ((AliITSTriggerAlgorithmConditions*)fAlgoList.At(findIndex))->GetParamValueI(pIndex);
330 //__________________________________________________________________________________
331 Int_t AliITSTriggerConditions::GetAlgoParamValueLN(const Char_t* aLabel, const Char_t* pName) const {
332 // returns parameter value for the parameter named pName, corresponding to the algorithm with label aLabel
333 UShort_t findIndex=fNumAlgo;
334 for (UInt_t i=0; i<fNumAlgo; i++) {
335 if (strcmp(((AliITSTriggerAlgorithmConditions*)fAlgoList.At(i))->GetLabel(), aLabel) == 0) {
340 if (findIndex==fNumAlgo) {
341 Error("AliITSTriggerConditions::GetAlgoParamValueLN", "label %s not found", aLabel);
344 return ((AliITSTriggerAlgorithmConditions*)fAlgoList.At(findIndex))->GetParamValueN(pName);
346 //__________________________________________________________________________________
347 UInt_t AliITSTriggerConditions::GetChipKey(Int_t eq, Int_t hs, Int_t chip) const {
348 // translates eq,hs,chip numbers into one integer key (0-1199)
349 if (eq<0 || eq>=20 || hs<0 || hs>=6 || chip<0 || chip>=10) {
350 Error("AliITSTriggerConditions::GetChipKey", "eq,hs,chip = %d,%d,%d out of range",eq,hs,chip);
353 return eq*60 + hs*10 + chip;
355 //__________________________________________________________________________________
356 void AliITSTriggerConditions::GetChipFromKey(UInt_t key, Int_t& eq, Int_t& hs, Int_t& chip) const {
357 // translates a chip key back into eq,hs,chip numbers
359 Error("AliITSTriggerConditions::GetChipFromKey", "key = %d out of range", key);
366 //__________________________________________________________________________________
367 Bool_t AliITSTriggerConditions::GetNextInActiveChip(Int_t& eq, Int_t& hs, Int_t& chip) const {
368 // Returns true if an in-active chip was found (start looking after the bit number
369 // corresponding to the input parameters eq,hs,chip).
370 // If either of eq,hs,chip < 0 , start from beginning of TBits array.
371 // See example of usage in AliITSDetTypeRec::RemoveFastOrFiredInActive.
373 if (eq<0 || hs<0 || chip<0) searchIndex = 0;
374 else searchIndex = GetChipKey(eq, hs, chip) + 1;
375 UInt_t nextIndex = fInActiveChips.FirstSetBit(searchIndex);
376 if (nextIndex==1200) return kFALSE;
377 GetChipFromKey(nextIndex, eq, hs, chip);
380 //__________________________________________________________________________________
381 void AliITSTriggerConditions::DumpInActiveChips() const {
382 // Prints a list of all inactive chips
385 while (startBit<1200) {
386 startBit = fInActiveChips.FirstSetBit(startBit);
390 GetChipFromKey(startBit,eq,hs,chip);
391 printf("%3d: %d,%d,%d\n",occ,eq,hs,chip);
396 //__________________________________________________________________________________
397 void AliITSTriggerConditions::ReadFromTextFile(const Char_t* fileName) {
398 // Reads conditions from text file (file format is used online by PIT system)
402 const Int_t maxS = 500;
403 enum headers {HEAD, OUTPUT, PARAM, ACTIVECHIP};
406 file.open(fileName, ifstream::in);
408 Error("AliITSTriggerConditions::ReadFromTextFile","No file (%s) present.",fileName);
412 Int_t headType = -1; // no header read from start
418 file.getline(cline,maxS);
421 // *** remove comments from line
422 Int_t skipPos = line.First('#');
424 line.Remove(skipPos,maxS);
427 // *** check what type of information the line has (header or not...)
428 Int_t brackPos1 = line.First('[');
429 Int_t brackPos2 = line.First(']');
430 if (brackPos1==0 && brackPos2-1>brackPos1) {
431 // *** parse header line (header has to come first on the line)
432 TString headword = line(brackPos1+1,brackPos2-1-brackPos1);
433 if (headword.CompareTo("Header", TString::kIgnoreCase) == 0) headType = HEAD;
434 else if (headword.CompareTo("Outputs", TString::kIgnoreCase) == 0) headType = OUTPUT;
435 else if (headword.CompareTo("Output_parameters",TString::kIgnoreCase) == 0) headType = PARAM;
436 else if (headword.CompareTo("Active_chips", TString::kIgnoreCase) == 0) headType = ACTIVECHIP;
439 // *** parse non-header line
442 if (headType==HEAD) {
443 TString descrWord, valueWord;
444 if (! SplitStringIn2(line,descrWord,valueWord,'=')) continue;
445 descrWord.ReplaceAll(" ","");
446 valueWord.Remove(TString::kBoth,' ');
448 if (descrWord.CompareTo("RUN_NUMBER",TString::kIgnoreCase) == 0 && valueWord.IsDigit()) {
449 SetRunNumber(valueWord.Atoi());
451 else if (descrWord.CompareTo("PROCESSING_FIRMWARE_VERSION",TString::kIgnoreCase) == 0 && valueWord.IsDigit()) {
452 SetFirmWareVersion(valueWord.Atoi());
454 else if (descrWord.CompareTo("GLOBAL_DESCRIPTION",TString::kIgnoreCase) == 0) {
455 SetGlobalDescription(valueWord.Data());
457 else if (descrWord.CompareTo("VERSION_REGISTER_VALUE",TString::kIgnoreCase) == 0 && valueWord.IsDigit()) {
458 SetVersionRegister(valueWord.Atoi());
460 else if (descrWord.CompareTo("INPUT_CONDITIONS_VERSION",TString::kIgnoreCase) == 0 && valueWord.IsDigit()) {
461 SetInputConditionsVersion(valueWord.Atoi());
463 else if (descrWord.CompareTo("PARAMETERS_VERSION",TString::kIgnoreCase) == 0 && valueWord.IsDigit()) {
464 SetParametersVersion(valueWord.Atoi());
468 else if (headType==OUTPUT) {
469 TString idWord, labelWord, descrWord, restWord;
470 if (! SplitStringIn2(line,idWord,restWord,'=')) continue;
471 if (! idWord.IsDigit()) continue;
472 if (! SplitStringIn2(restWord,labelWord,descrWord,',')) continue;
473 labelWord = GetStringBetween(labelWord,'\'','\'');
474 descrWord = GetStringBetween(descrWord,'\'','\'');
475 if (labelWord.Length()==0 || descrWord.Length()==0) continue;
476 // printf("id: %d , label '%s' , descr '%s'\n", idWord.Atoi(),labelWord.Data(),descrWord.Data());
477 AddAlgo(idWord.Atoi(),labelWord.Data(),descrWord.Data());
480 else if (headType==PARAM) {
481 TString idWord, restWord;
482 if (! SplitStringIn2(line,idWord,restWord,'=')) continue;
483 if (! idWord.IsDigit()) continue;
484 while (restWord.Length()>0) {
485 TString parWord, nameWord, valWord;
486 SplitStringIn2(restWord,parWord,restWord,';');
487 if (! SplitStringIn2(parWord,nameWord,valWord,',')) break;
488 nameWord = GetStringBetween(nameWord,'\'','\'');
489 if (nameWord.Length()==0 || valWord.Length()==0 || ! valWord.IsDigit()) break;
490 // printf("id %d , param %s , value %d\n",idWord.Atoi(),nameWord.Data(),valWord.Atoi());
491 AddAlgoParam(idWord.Atoi(),nameWord.Data(),valWord.Atoi());
495 if (headType==ACTIVECHIP) {
496 TString eqWord, sideWord, hsWord, chipWord, restWord;
497 if (! SplitStringIn2(line,eqWord,restWord,',')) continue;
498 if (! eqWord.IsDigit()) continue;
499 UInt_t eq = eqWord.Atoi();
500 if (eq>=20) continue;
501 if (! SplitStringIn2(restWord,sideWord,restWord,',')) continue;
502 sideWord.ReplaceAll(" ","");
503 if (sideWord.CompareTo("A",TString::kIgnoreCase) == 0) {}
504 else if (sideWord.CompareTo("C",TString::kIgnoreCase) == 0) eq+=10;
506 if (! SplitStringIn2(restWord,hsWord,chipWord,'=')) continue;
507 if (! hsWord.IsDigit()) continue;
508 UInt_t hs = hsWord.Atoi();
510 chipWord.ReplaceAll(" ","");
511 if (chipWord.Length()!=10) continue;
512 for (UInt_t chip=0; chip<10; chip++) {
513 if (chipWord[9-chip]=='0') {
514 // printf("Chip %d,%d,%d inactive\n",eq,hs,chip);
515 SetInActiveChip(eq,hs,chip);
524 //__________________________________________________________________________________
525 Bool_t AliITSTriggerConditions::SplitStringIn2(TString orig, TString& word1, TString& word2, Char_t sep) {
526 // splits a string in two parts (one before separator character and one after)
527 Int_t sepPos = orig.First(sep);
528 if (sepPos<0) sepPos = orig.Length();
529 word1 = orig(0,sepPos);
530 word2 = orig(sepPos+1,orig.Length());
531 return (word1.Length()>0 && word2.Length()>0);
533 //__________________________________________________________________________________
534 TString AliITSTriggerConditions::GetStringBetween(TString orig, Char_t sep1, Char_t sep2) {
535 // returns string between separator character 1 and separator character 2
536 Int_t pos1 = orig.First(sep1);
537 if (pos1<0) return "";
538 TString ret = orig(pos1+1,orig.Length());
539 Int_t pos2 = ret.First(sep2);
540 if (pos2<0) return "";
544 //__________________________________________________________________________________
545 Bool_t AliITSTriggerConditions::IsEqualTo(AliITSTriggerConditions *cond) const {
546 // checks if this object contains the same information as the input cond object
547 if (fRunNumber != cond->GetRunNumber()) return kFALSE;
548 if (fFirmWareVersion != cond->GetFirmWareVersion()) return kFALSE;
549 if (fGlobalDescription.CompareTo(cond->GetGlobalDescription()) !=0) return kFALSE;
550 if (fVersionRegister != cond->GetVersionRegister()) return kFALSE;
551 if (fInputConditionsVersion != cond->GetInputConditionsVersion()) return kFALSE;
552 if (fParametersVersion != cond->GetParametersVersion()) return kFALSE;
554 for (UInt_t eq=0; eq<20; eq++) {
555 for (UInt_t hs=0; hs<6; hs++) {
556 for (UInt_t chip=0; chip<10; chip++) {
557 if (IsChipActive(eq,hs,chip) != cond->IsChipActive(eq,hs,chip)) return kFALSE;
562 if (fNumAlgo != cond->GetNumAlgo()) return kFALSE;
563 for (Short_t alg1=0; alg1<fNumAlgo; alg1++) {
564 Short_t alg2 = cond->GetAlgoIndexL(GetAlgoLabelI(alg1));
565 if (alg2<0) return kFALSE;
566 if (GetAlgoIDI(alg1) != cond->GetAlgoIDI(alg2)) return kFALSE;
567 if (strcmp(GetAlgoDescriptionI(alg1), cond->GetAlgoDescriptionI(alg2)) != 0) return kFALSE;
568 if (GetNumAlgoParamI(alg1) != cond->GetNumAlgoParamI(alg2)) return kFALSE;
569 for (Short_t par1=0; par1<GetNumAlgoParamI(alg1); par1++) {
570 const Char_t* paramName = GetAlgoParamNameII(alg1,par1);
571 if (GetAlgoParamValueIN(alg1,paramName) != cond->GetAlgoParamValueIN(alg2,paramName)) return kFALSE;
577 //__________________________________________________________________________________
578 void AliITSTriggerConditions::PrintAsInPIT() const {
580 // Prints conditions data
582 printf("[Header]\n");
583 printf("RUN_NUMBER = %d\n",fRunNumber);
584 printf("PROCESSING_FIRMWARE_VERSION = %d\n",fFirmWareVersion);
585 printf("GLOBAL_DESCRIPTION = %s\n",fGlobalDescription.Data());
586 printf("VERSION_REGISTER_VALUE = %d\n",fVersionRegister);
587 printf("INPUT_CONDITIONS_VERSION = %d\n",fInputConditionsVersion);
588 printf("PARAMETERS_VERSION = %d\n",fParametersVersion);
591 printf("[Outputs]\n");
592 for (UInt_t i=0; i<fNumAlgo; i++) {
593 printf("%d = '%s', '%s'\n", GetAlgoIDI(i), GetAlgoLabelI(i), GetAlgoDescriptionI(i));
597 printf("[Output_parameters]\n");
598 for (UInt_t i=0; i<fNumAlgo; i++) {
599 printf("%d =", GetAlgoIDI(i));
600 for (Short_t p=0; p<GetNumAlgoParamI(i); p++) {
601 printf(" '%s', %d;", GetAlgoParamNameII(i,p), GetAlgoParamValueII(i,p));
607 printf("[Active_chips]\n");
608 for (UInt_t eq=0; eq<20; eq++) {
609 for (UInt_t hs=0; hs<6; hs++) {
610 UInt_t nActiveOnHs = 0;
611 TString inactiveStr = "";
612 for (UInt_t chip=0; chip<10; chip++) {
613 Bool_t isChipActive = IsChipActive(eq,hs,9-chip);
614 inactiveStr.Append(Form("%d",isChipActive));
615 nActiveOnHs+=isChipActive;
617 if (nActiveOnHs<10) {
618 printf("%d,%c,%d=%s\n", eq%10, eq<10 ? 'A' : 'C', hs, inactiveStr.Data());