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"
22 ClassImp(AliITSTriggerConditions)
24 //__________________________________________________________________________________
25 AliITSTriggerConditions::AliITSTriggerConditions() :
29 fGlobalDescription("n/a"),
31 fInputConditionsVersion(0),
32 fParametersVersion(0),
35 fAlgoList(TObjArray(10))
37 // default constructor
38 fAlgoList.SetOwner(kTRUE);
40 //__________________________________________________________________________________
41 AliITSTriggerConditions::AliITSTriggerConditions(const AliITSTriggerConditions& cond) :
43 fRunNumber(cond.fRunNumber),
44 fFirmWareVersion(cond.fFirmWareVersion),
45 fGlobalDescription(cond.fGlobalDescription),
46 fVersionRegister(cond.fVersionRegister),
47 fInputConditionsVersion(cond.fInputConditionsVersion),
48 fParametersVersion(cond.fParametersVersion),
49 fInActiveChips(cond.fInActiveChips),
50 fNumAlgo(cond.fNumAlgo),
51 fAlgoList(cond.fAlgoList)
54 fAlgoList.SetOwner(kTRUE);
56 //__________________________________________________________________________________
57 AliITSTriggerConditions::~AliITSTriggerConditions()
62 //______________________________________________________________________
63 AliITSTriggerConditions& AliITSTriggerConditions::operator=(const AliITSTriggerConditions& cond) {
64 // assignment operator
66 fRunNumber = cond.fRunNumber;
67 fFirmWareVersion = cond.fFirmWareVersion;
68 fGlobalDescription = cond.fGlobalDescription;
69 fVersionRegister = cond.fVersionRegister;
70 fInputConditionsVersion = cond.fInputConditionsVersion;
71 fParametersVersion = cond.fParametersVersion;
72 fInActiveChips = cond.fInActiveChips;
73 fNumAlgo = cond.fNumAlgo;
74 fAlgoList = cond.fAlgoList;
78 //__________________________________________________________________________________
79 void AliITSTriggerConditions::DumpAll() const {
80 // Dumps all conditions data. This is as it is shown in PVSS, whereas the content of
81 // the txt file they are read from has a swap in the chip numbering
84 printf("RUN_NUMBER = %d\n",fRunNumber);
85 printf("PROCESSING_FIRMWARE_VERSION = %d\n",fFirmWareVersion);
86 printf("GLOBAL_DESCRIPTION = %s\n",fGlobalDescription.Data());
87 printf("VERSION_REGISTER_VALUE = %d\n",fVersionRegister);
88 printf("INPUT_CONDITIONS_VERSION = %d\n",fInputConditionsVersion);
89 printf("PARAMETERS_VERSION = %d\n",fParametersVersion);
92 printf("[Outputs]\n");
93 for (UInt_t i=0; i<fNumAlgo; i++) {
94 printf("%d = '%s', '%s'\n", GetAlgoIDI(i), GetAlgoLabelI(i), GetAlgoDescriptionI(i));
98 printf("[Output_parameters]\n");
99 for (UInt_t i=0; i<fNumAlgo; i++) {
100 printf("%d =", GetAlgoIDI(i));
101 for (Short_t p=0; p<GetNumAlgoParamI(i); p++) {
102 printf(" '%s', %d;", GetAlgoParamNameII(i,p), GetAlgoParamValueII(i,p));
108 printf("[Active_chips]\n");
109 for (UInt_t eq=0; eq<20; eq++) {
110 for (UInt_t hs=0; hs<6; hs++) {
111 UInt_t nActiveOnHs = 0;
112 TString inactiveStr = "";
113 for (UInt_t chip=0; chip<10; chip++) {
114 Bool_t isChipActive = IsChipActive(eq,hs,chip);
115 inactiveStr.Append(Form("%d",isChipActive));
116 nActiveOnHs+=isChipActive;
118 if (nActiveOnHs<10) {
119 printf("%d,%c,%d=%s\n", eq%10, eq<10 ? 'A' : 'C', hs, inactiveStr.Data());
125 //__________________________________________________________________________________
126 void AliITSTriggerConditions::ResetAll() {
127 // clear all data, and put default values
130 fGlobalDescription="n/a";
132 fInputConditionsVersion=0;
133 fParametersVersion=0;
134 ResetInActiveChips();
137 //__________________________________________________________________________________
138 void AliITSTriggerConditions::ClearAlgorithms() {
139 // clears the list of algorithms
143 //__________________________________________________________________________________
144 void AliITSTriggerConditions::ClearAlgoParamsI(UShort_t aIndex) {
145 // clears the list of parameters for algorithm with index aIndex
146 if (aIndex>=fNumAlgo) {
147 Error("AliITSTriggerConditions::ClearAlgoParamsI", "index %d out of range", aIndex);
150 ((AliITSTriggerAlgorithmConditions*)fAlgoList.At(aIndex))->ClearParams();
152 //__________________________________________________________________________________
153 void AliITSTriggerConditions::ClearAlgoParamsL(const Char_t* aLabel) {
154 // clears the list of parameters for algorithm with label aLabel
155 UShort_t findIndex=fNumAlgo;
156 for (UInt_t i=0; i<fNumAlgo; i++) {
157 if (strcmp(((AliITSTriggerAlgorithmConditions*)fAlgoList.At(i))->GetLabel(),aLabel) == 0) {
162 if (findIndex==fNumAlgo) {
163 Error("AliITSTriggerConditions::ClearAlgoParamsL", "label %s not found", aLabel);
165 ((AliITSTriggerAlgorithmConditions*)fAlgoList.At(findIndex))->ClearParams();
167 //__________________________________________________________________________________
168 void AliITSTriggerConditions::AddAlgo(UShort_t id, const Char_t* aLabel, const Char_t* aDescr) {
169 // adds a new algorithm with id 'id', label aLabel, and description aDescr
170 // if the id or label is already used in the list of algorithms, the old entry will be over-written
171 UShort_t findIndex=fNumAlgo;
172 for (UInt_t i=0; i<fNumAlgo; i++) {
173 if (strcmp(((AliITSTriggerAlgorithmConditions*)fAlgoList.At(i))->GetLabel(), aLabel) == 0 ||
174 ((AliITSTriggerAlgorithmConditions*)fAlgoList.At(i))->GetID() == id ) {
179 if (findIndex<fNumAlgo) {
180 delete fAlgoList.At(findIndex);
181 fAlgoList.AddAt(new AliITSTriggerAlgorithmConditions(id,aLabel,aDescr),findIndex);
184 fAlgoList.AddAtAndExpand(new AliITSTriggerAlgorithmConditions(id,aLabel,aDescr),fNumAlgo);
188 //__________________________________________________________________________________
189 void AliITSTriggerConditions::AddAlgoParam(UShort_t id, const Char_t* name, Int_t value) {
190 // adds a new parameter with name 'name' and value 'value', for the algorithm with id 'id'
191 UShort_t findIndex=fNumAlgo;
192 for (UInt_t i=0; i<fNumAlgo; i++) {
193 if (((AliITSTriggerAlgorithmConditions*)fAlgoList.At(i))->GetID() == id) {
198 if (findIndex==fNumAlgo) {
199 Error("AliITSTriggerConditions::AddAlgoParam", "id %d not found", id);
202 ((AliITSTriggerAlgorithmConditions*)fAlgoList.At(findIndex))->AddParam(name, value);
204 //__________________________________________________________________________________
205 Short_t AliITSTriggerConditions::GetAlgoIndexL(const Char_t* aLabel) const {
206 // returns the index for the algorithm with label aLabel
207 UShort_t findIndex=fNumAlgo;
208 for (UInt_t i=0; i<fNumAlgo; i++) {
209 if (strcmp(((AliITSTriggerAlgorithmConditions*)fAlgoList.At(i))->GetLabel(), aLabel) == 0) {
214 if (findIndex==fNumAlgo) {
215 Error("AliITSTriggerConditions::GetAlgoIndexL", "label %s not found", aLabel);
220 //__________________________________________________________________________________
221 Short_t AliITSTriggerConditions::GetAlgoIDI(UShort_t aIndex) const {
222 // returns the ID for the algorithm with index aIndex (in real life, could be 1-10)
223 if (aIndex>=fNumAlgo) {
224 Error("AliITSTriggerConditions::GetAlgoIDI", "index %d out of range", aIndex);
227 return ((AliITSTriggerAlgorithmConditions*)fAlgoList.At(aIndex))->GetID();
229 //__________________________________________________________________________________
230 const Char_t* AliITSTriggerConditions::GetAlgoLabelI(UShort_t aIndex) const {
231 // returns the label for the algorithm with index aIndex
232 if (aIndex>=fNumAlgo) {
233 Error("AliITSTriggerConditions::GetAlgoLabelI", "index %d out of range", aIndex);
236 return ((AliITSTriggerAlgorithmConditions*)fAlgoList.At(aIndex))->GetLabel();
238 //__________________________________________________________________________________
239 const Char_t* AliITSTriggerConditions::GetAlgoDescriptionI(UShort_t aIndex) const {
240 // returns the description for the algorithm with index aIndex
241 if (aIndex>=fNumAlgo) {
242 Error("AliITSTriggerConditions::GetAlgoDescriptionI", "index %d out of range", aIndex);
245 return ((AliITSTriggerAlgorithmConditions*)fAlgoList.At(aIndex))->GetDescription();
247 //__________________________________________________________________________________
248 Short_t AliITSTriggerConditions::GetNumAlgoParamI(UShort_t aIndex) const {
249 // returns the number of parameters, corresponding to the algorithm with index aIndex
250 if (aIndex>=fNumAlgo) {
251 Error("AliITSTriggerConditions::GetNumAlgoParamI", "index %d out of range", aIndex);
254 return ((AliITSTriggerAlgorithmConditions*)fAlgoList.At(aIndex))->GetNumParam();
256 //__________________________________________________________________________________
257 const Char_t* AliITSTriggerConditions::GetAlgoParamNameII(UShort_t aIndex, UShort_t pIndex) const {
258 // returns the parameter name for the parameter with index pIndex, corresponding to the algorithm with index aIndex
259 if (aIndex>=fNumAlgo) {
260 Error("AliITSTriggerConditions::GetAlgoParamNameII", "index %d out of range", aIndex);
263 return ((AliITSTriggerAlgorithmConditions*)fAlgoList.At(aIndex))->GetParamNameI(pIndex);
265 //__________________________________________________________________________________
266 Int_t AliITSTriggerConditions::GetAlgoParamValueII(UShort_t aIndex, UShort_t pIndex) const {
267 // returns the parameter value for the parameter with index pIndex, corresponding to the algorithm with index aIndex
268 if (aIndex>=fNumAlgo) {
269 Error("AliITSTriggerConditions::GetAlgoParamValueII", "index %d out of range", aIndex);
272 return ((AliITSTriggerAlgorithmConditions*)fAlgoList.At(aIndex))->GetParamValueI(pIndex);
274 //__________________________________________________________________________________
275 Int_t AliITSTriggerConditions::GetAlgoParamValueIN(UShort_t aIndex, const Char_t* pName) const {
276 // returns parameter value for the parameter named pName, corresponding to the algorithm with index aIndex
277 if (aIndex>=fNumAlgo) {
278 Error("AliITSTriggerConditions::GetAlgoParamValueIN", "index %d out of range", aIndex);
281 return ((AliITSTriggerAlgorithmConditions*)fAlgoList.At(aIndex))->GetParamValueN(pName);
283 //__________________________________________________________________________________
284 Short_t AliITSTriggerConditions::GetNumAlgoParamL(const Char_t* aLabel) const {
285 // returns the number of parameters, corresponding to the algorithm with label aLabel
286 UShort_t findIndex=fNumAlgo;
287 for (UInt_t i=0; i<fNumAlgo; i++) {
288 if (strcmp(((AliITSTriggerAlgorithmConditions*)fAlgoList.At(i))->GetLabel(), aLabel) == 0) {
293 if (findIndex==fNumAlgo) {
294 Error("AliITSTriggerConditions::GetNumAlgoParamL", "label %s not found", aLabel);
297 return ((AliITSTriggerAlgorithmConditions*)fAlgoList.At(findIndex))->GetNumParam();
299 //__________________________________________________________________________________
300 const Char_t* AliITSTriggerConditions::GetAlgoParamNameLI(const Char_t* aLabel, UShort_t pIndex) const {
301 // returns parameter name for the parameter with index pIndex, corresponding to the algorithm with label aLabel
302 UShort_t findIndex=fNumAlgo;
303 for (UInt_t i=0; i<fNumAlgo; i++) {
304 if (strcmp(((AliITSTriggerAlgorithmConditions*)fAlgoList.At(i))->GetLabel(), aLabel) == 0) {
309 if (findIndex==fNumAlgo) {
310 Error("AliITSTriggerConditions::GetAlgoParamNameLI", "label %s not found", aLabel);
313 return ((AliITSTriggerAlgorithmConditions*)fAlgoList.At(findIndex))->GetParamNameI(pIndex);
315 //__________________________________________________________________________________
316 Int_t AliITSTriggerConditions::GetAlgoParamValueLI(const Char_t* aLabel, UShort_t pIndex) const {
317 // returns parameter value for the parameter with index pIndex, corresponding to the algorithm with label aLabel
318 UShort_t findIndex=fNumAlgo;
319 for (UInt_t i=0; i<fNumAlgo; i++) {
320 if (strcmp(((AliITSTriggerAlgorithmConditions*)fAlgoList.At(i))->GetLabel(), aLabel) == 0) {
325 if (findIndex==fNumAlgo) {
326 Error("AliITSTriggerConditions::GetAlgoParamValueLI", "label %s not found", aLabel);
329 return ((AliITSTriggerAlgorithmConditions*)fAlgoList.At(findIndex))->GetParamValueI(pIndex);
331 //__________________________________________________________________________________
332 Int_t AliITSTriggerConditions::GetAlgoParamValueLN(const Char_t* aLabel, const Char_t* pName) const {
333 // returns parameter value for the parameter named pName, corresponding to the algorithm with label aLabel
334 UShort_t findIndex=fNumAlgo;
335 for (UInt_t i=0; i<fNumAlgo; i++) {
336 if (strcmp(((AliITSTriggerAlgorithmConditions*)fAlgoList.At(i))->GetLabel(), aLabel) == 0) {
341 if (findIndex==fNumAlgo) {
342 Error("AliITSTriggerConditions::GetAlgoParamValueLN", "label %s not found", aLabel);
345 return ((AliITSTriggerAlgorithmConditions*)fAlgoList.At(findIndex))->GetParamValueN(pName);
347 //__________________________________________________________________________________
348 UInt_t AliITSTriggerConditions::GetChipKey(Int_t eq, Int_t hs, Int_t chip) const {
349 // translates eq,hs,chip numbers into one integer key (0-1199)
350 if (eq<0 || eq>=20 || hs<0 || hs>=6 || chip<0 || chip>=10) {
351 Error("AliITSTriggerConditions::GetChipKey", "eq,hs,chip = %d,%d,%d out of range",eq,hs,chip);
354 return eq*60 + hs*10 + chip;
356 //__________________________________________________________________________________
357 void AliITSTriggerConditions::GetChipFromKey(UInt_t key, Int_t& eq, Int_t& hs, Int_t& chip) const {
358 // translates a chip key back into eq,hs,chip numbers
360 Error("AliITSTriggerConditions::GetChipFromKey", "key = %d out of range", key);
367 //__________________________________________________________________________________
368 Bool_t AliITSTriggerConditions::GetNextInActiveChip(Int_t& eq, Int_t& hs, Int_t& chip) const {
369 // Returns true if an in-active chip was found (start looking after the bit number
370 // corresponding to the input parameters eq,hs,chip).
371 // If either of eq,hs,chip < 0 , start from beginning of TBits array.
372 // See example of usage in AliITSDetTypeRec::RemoveFastOrFiredInActive.
374 if (eq<0 || hs<0 || chip<0) searchIndex = 0;
375 else searchIndex = GetChipKey(eq, hs, chip) + 1;
376 UInt_t nextIndex = fInActiveChips.FirstSetBit(searchIndex);
377 if (nextIndex==1200) return kFALSE;
378 GetChipFromKey(nextIndex, eq, hs, chip);
381 //__________________________________________________________________________________
382 void AliITSTriggerConditions::DumpInActiveChips() const {
383 // Prints a list of all inactive chips
386 while (startBit<1200) {
387 startBit = fInActiveChips.FirstSetBit(startBit);
391 GetChipFromKey(startBit,eq,hs,chip);
392 printf("%3d: %d,%d,%d\n",occ,eq,hs,chip);
397 //__________________________________________________________________________________
398 void AliITSTriggerConditions::ReadFromTextFile(const Char_t* fileName) {
399 // Reads conditions from text file (file format is used online by PIT system)
403 const Int_t maxS = 500;
404 enum headers {HEAD, OUTPUT, PARAM, ACTIVECHIP};
407 file.open(fileName, ifstream::in);
409 Error("AliITSTriggerConditions::ReadFromTextFile","No file (%s) present.",fileName);
413 Int_t headType = -1; // no header read from start
419 file.getline(cline,maxS);
422 // *** remove comments from line
423 Int_t skipPos = line.First('#');
425 line.Remove(skipPos,maxS);
428 // *** check what type of information the line has (header or not...)
429 Int_t brackPos1 = line.First('[');
430 Int_t brackPos2 = line.First(']');
431 if (brackPos1==0 && brackPos2-1>brackPos1) {
432 // *** parse header line (header has to come first on the line)
433 TString headword = line(brackPos1+1,brackPos2-1-brackPos1);
434 if (headword.CompareTo("Header", TString::kIgnoreCase) == 0) headType = HEAD;
435 else if (headword.CompareTo("Outputs", TString::kIgnoreCase) == 0) headType = OUTPUT;
436 else if (headword.CompareTo("Output_parameters",TString::kIgnoreCase) == 0) headType = PARAM;
437 else if (headword.CompareTo("Active_chips", TString::kIgnoreCase) == 0) headType = ACTIVECHIP;
440 // *** parse non-header line
443 if (headType==HEAD) {
444 TString descrWord, valueWord;
445 if (! SplitStringIn2(line,descrWord,valueWord,'=')) continue;
446 descrWord.ReplaceAll(" ","");
447 valueWord.Remove(TString::kBoth,' ');
449 if (descrWord.CompareTo("RUN_NUMBER",TString::kIgnoreCase) == 0 && valueWord.IsDigit()) {
450 SetRunNumber(valueWord.Atoi());
452 else if (descrWord.CompareTo("PROCESSING_FIRMWARE_VERSION",TString::kIgnoreCase) == 0 && valueWord.IsDigit()) {
453 SetFirmWareVersion(valueWord.Atoi());
455 else if (descrWord.CompareTo("GLOBAL_DESCRIPTION",TString::kIgnoreCase) == 0) {
456 SetGlobalDescription(valueWord.Data());
458 else if (descrWord.CompareTo("VERSION_REGISTER_VALUE",TString::kIgnoreCase) == 0 && valueWord.IsDigit()) {
459 SetVersionRegister(valueWord.Atoi());
461 else if (descrWord.CompareTo("INPUT_CONDITIONS_VERSION",TString::kIgnoreCase) == 0 && valueWord.IsDigit()) {
462 SetInputConditionsVersion(valueWord.Atoi());
464 else if (descrWord.CompareTo("PARAMETERS_VERSION",TString::kIgnoreCase) == 0 && valueWord.IsDigit()) {
465 SetParametersVersion(valueWord.Atoi());
469 else if (headType==OUTPUT) {
470 TString idWord, labelWord, descrWord, restWord;
471 if (! SplitStringIn2(line,idWord,restWord,'=')) continue;
472 if (! idWord.IsDigit()) continue;
473 if (! SplitStringIn2(restWord,labelWord,descrWord,',')) continue;
474 labelWord = GetStringBetween(labelWord,'\'','\'');
475 descrWord = GetStringBetween(descrWord,'\'','\'');
476 if (labelWord.Length()==0 || descrWord.Length()==0) continue;
477 // printf("id: %d , label '%s' , descr '%s'\n", idWord.Atoi(),labelWord.Data(),descrWord.Data());
478 AddAlgo(idWord.Atoi(),labelWord.Data(),descrWord.Data());
481 else if (headType==PARAM) {
482 TString idWord, restWord;
483 if (! SplitStringIn2(line,idWord,restWord,'=')) continue;
484 if (! idWord.IsDigit()) continue;
485 while (restWord.Length()>0) {
486 TString parWord, nameWord, valWord;
487 SplitStringIn2(restWord,parWord,restWord,';');
488 if (! SplitStringIn2(parWord,nameWord,valWord,',')) break;
489 nameWord = GetStringBetween(nameWord,'\'','\'');
490 if (nameWord.Length()==0 || valWord.Length()==0 || ! valWord.IsDigit()) break;
491 // printf("id %d , param %s , value %d\n",idWord.Atoi(),nameWord.Data(),valWord.Atoi());
492 AddAlgoParam(idWord.Atoi(),nameWord.Data(),valWord.Atoi());
496 if (headType==ACTIVECHIP) {
497 TString eqWord, sideWord, hsWord, chipWord, restWord;
498 if (! SplitStringIn2(line,eqWord,restWord,',')) continue;
499 if (! eqWord.IsDigit()) continue;
500 UInt_t eq = eqWord.Atoi();
501 if (eq>=20) continue;
502 if (! SplitStringIn2(restWord,sideWord,restWord,',')) continue;
503 sideWord.ReplaceAll(" ","");
504 if (sideWord.CompareTo("A",TString::kIgnoreCase) == 0) {}
505 else if (sideWord.CompareTo("C",TString::kIgnoreCase) == 0) eq+=10;
507 if (! SplitStringIn2(restWord,hsWord,chipWord,'=')) continue;
508 if (! hsWord.IsDigit()) continue;
509 UInt_t hs = hsWord.Atoi();
511 chipWord.ReplaceAll(" ","");
512 if (chipWord.Length()!=10) continue;
513 for (UInt_t chip=0; chip<10; chip++) {
514 if (chipWord[9-chip]=='0') {
515 // printf("Chip %d,%d,%d inactive\n",eq,hs,chip);
516 SetInActiveChip(eq,hs,chip);
525 //__________________________________________________________________________________
526 Bool_t AliITSTriggerConditions::SplitStringIn2(TString orig, TString& word1, TString& word2, Char_t sep) {
527 // splits a string in two parts (one before separator character and one after)
528 Int_t sepPos = orig.First(sep);
529 if (sepPos<0) sepPos = orig.Length();
530 word1 = orig(0,sepPos);
531 word2 = orig(sepPos+1,orig.Length());
532 return (word1.Length()>0 && word2.Length()>0);
534 //__________________________________________________________________________________
535 TString AliITSTriggerConditions::GetStringBetween(TString orig, Char_t sep1, Char_t sep2) {
536 // returns string between separator character 1 and separator character 2
537 Int_t pos1 = orig.First(sep1);
538 if (pos1<0) return "";
539 TString ret = orig(pos1+1,orig.Length());
540 Int_t pos2 = ret.First(sep2);
541 if (pos2<0) return "";
545 //__________________________________________________________________________________
546 Bool_t AliITSTriggerConditions::IsEqualTo(AliITSTriggerConditions *cond) const {
547 // checks if this object contains the same information as the input cond object
548 if (fRunNumber != cond->GetRunNumber()) return kFALSE;
549 if (fFirmWareVersion != cond->GetFirmWareVersion()) return kFALSE;
550 if (fGlobalDescription.CompareTo(cond->GetGlobalDescription()) !=0) return kFALSE;
551 if (fVersionRegister != cond->GetVersionRegister()) return kFALSE;
552 if (fInputConditionsVersion != cond->GetInputConditionsVersion()) return kFALSE;
553 if (fParametersVersion != cond->GetParametersVersion()) return kFALSE;
555 for (UInt_t eq=0; eq<20; eq++) {
556 for (UInt_t hs=0; hs<6; hs++) {
557 for (UInt_t chip=0; chip<10; chip++) {
558 if (IsChipActive(eq,hs,chip) != cond->IsChipActive(eq,hs,chip)) return kFALSE;
563 if (fNumAlgo != cond->GetNumAlgo()) return kFALSE;
564 for (Short_t alg1=0; alg1<fNumAlgo; alg1++) {
565 Short_t alg2 = cond->GetAlgoIndexL(GetAlgoLabelI(alg1));
566 if (alg2<0) return kFALSE;
567 if (GetAlgoIDI(alg1) != cond->GetAlgoIDI(alg2)) return kFALSE;
568 if (strcmp(GetAlgoDescriptionI(alg1), cond->GetAlgoDescriptionI(alg2)) != 0) return kFALSE;
569 if (GetNumAlgoParamI(alg1) != cond->GetNumAlgoParamI(alg2)) return kFALSE;
570 for (Short_t par1=0; par1<GetNumAlgoParamI(alg1); par1++) {
571 const Char_t* paramName = GetAlgoParamNameII(alg1,par1);
572 if (GetAlgoParamValueIN(alg1,paramName) != cond->GetAlgoParamValueIN(alg2,paramName)) return kFALSE;
578 //__________________________________________________________________________________
579 void AliITSTriggerConditions::PrintAsInPIT() const {
581 // Prints conditions data
583 printf("[Header]\n");
584 printf("RUN_NUMBER = %d\n",fRunNumber);
585 printf("PROCESSING_FIRMWARE_VERSION = %d\n",fFirmWareVersion);
586 printf("GLOBAL_DESCRIPTION = %s\n",fGlobalDescription.Data());
587 printf("VERSION_REGISTER_VALUE = %d\n",fVersionRegister);
588 printf("INPUT_CONDITIONS_VERSION = %d\n",fInputConditionsVersion);
589 printf("PARAMETERS_VERSION = %d\n",fParametersVersion);
592 printf("[Outputs]\n");
593 for (UInt_t i=0; i<fNumAlgo; i++) {
594 printf("%d = '%s', '%s'\n", GetAlgoIDI(i), GetAlgoLabelI(i), GetAlgoDescriptionI(i));
598 printf("[Output_parameters]\n");
599 for (UInt_t i=0; i<fNumAlgo; i++) {
600 printf("%d =", GetAlgoIDI(i));
601 for (Short_t p=0; p<GetNumAlgoParamI(i); p++) {
602 printf(" '%s', %d;", GetAlgoParamNameII(i,p), GetAlgoParamValueII(i,p));
608 printf("[Active_chips]\n");
609 for (UInt_t eq=0; eq<20; eq++) {
610 for (UInt_t hs=0; hs<6; hs++) {
611 UInt_t nActiveOnHs = 0;
612 TString inactiveStr = "";
613 for (UInt_t chip=0; chip<10; chip++) {
614 Bool_t isChipActive = IsChipActive(eq,hs,9-chip);
615 inactiveStr.Append(Form("%d",isChipActive));
616 nActiveOnHs+=isChipActive;
618 if (nActiveOnHs<10) {
619 printf("%d,%c,%d=%s\n", eq%10, eq<10 ? 'A' : 'C', hs, inactiveStr.Data());