// 5 : could not get the SOR file from the FXS
// 6 : could not get the EOR file from the FXS
// 7 :
- // 8 : something wrong with the EOR file
- // 9 :
- // 10 : EOR XML is not well-formed
- // 11 :
- // 12 : ERROR in XML SAX validation of EOR: something wrong with the content
+ // 8 : something wrong with the SOR file
+ // 9 : something wrong with the EOR file
+ // 10 : SOR XML is not well-formed
+ // 11 : EOR XML is not well-formed
+ // 12 : ERROR in XML SAX validation: something wrong with the content
// 13 :
// 14 : ERROR while creating calibration objects in the handler
// 15 : error while storing data in the CDB
//
- Log("Processing the DCS config summary file.");
+ Log("Processing the DCS config summary files.");
// get the XML files
Log("Requesting the 2 summaryfiles from the FXS..");
- const char * xmlFileS = GetFile(kDCS,"CONFIGSUMMARYSOR","");
- const char * xmlFile = GetFile(kDCS,"CONFIGSUMMARYEOR","");
+ const char *xmlFileS = GetFile(kDCS,"CONFIGSUMMARYSOR","");
+ const char *xmlFileE = GetFile(kDCS,"CONFIGSUMMARYEOR","");
// for the time being just request BOTH files from the FXS
// THEN it can be created online (otherwise the FXS would be messed up)
// the next step is to actually read BOTH files and store their informations
if (xmlFileS == NULL) {
Log(Form("ERROR: SOR File %s not found!",xmlFileS));
return 5;
- } else {
- Log(Form("SOR File %s found.",xmlFileS));
- }
- if (xmlFile == NULL) {
- Log(Form("ERROR: EOR File %s not found!",xmlFile));
+ } else if (xmlFileE == NULL) {
+ Log(Form("ERROR: EOR File %s not found!",xmlFileE));
return 6;
} else {
- Log(Form("EOR File %s found.",xmlFile));
+ Log(Form("Both Files (%s and %s) found.",xmlFileS,xmlFileE));
}
- // test the file
- std::ifstream fileTest;
- fileTest.open(xmlFile, std::ios_base::binary | std::ios_base::in);
- if (!fileTest.good() || fileTest.eof() || !fileTest.is_open()) {
- Log(Form("ERROR: File %s not valid!",xmlFile));
+ // test the files
+ std::ifstream fileTestS, fileTestE;
+ fileTestS.open(xmlFileS, std::ios_base::binary | std::ios_base::in);
+ fileTestE.open(xmlFileE, std::ios_base::binary | std::ios_base::in);
+ if (!fileTestS.good() || fileTestS.eof() || !fileTestS.is_open()) {
+ Log(Form("ERROR: File %s not valid!",xmlFileS));
return 8;
}
- fileTest.seekg(0, std::ios_base::end);
- if (static_cast<int>(fileTest.tellg()) < 2) {
- Log(Form("ERROR: File %s is empty!",xmlFile));
+ if (!fileTestE.good() || fileTestE.eof() || !fileTestE.is_open()) {
+ Log(Form("ERROR: File %s not valid!",xmlFileE));
+ return 9;
+ }
+ fileTestS.seekg(0, std::ios_base::end);
+ fileTestE.seekg(0, std::ios_base::end);
+ if (static_cast<int>(fileTestS.tellg()) < 2) {
+ Log(Form("ERROR: File %s is empty!",xmlFileS));
return 8;
}
- Log("File is tested valid.");
+ if (static_cast<int>(fileTestE.tellg()) < 2) {
+ Log(Form("ERROR: File %s is empty!",xmlFileE));
+ return 9;
+ }
+ Log("Files are tested valid.");
// make a robust XML validation
TSAXParser testParser;
- if (testParser.ParseFile(xmlFile) < 0 ) {
- Log("ERROR: XML content is not well-formed.");
+ if (testParser.ParseFile(xmlFileS) < 0 ) {
+ Log("ERROR: XML content (SOR) is not well-formed.");
return 10;
- } else {
- Log("XML content is well-formed");
+ } else if (testParser.ParseFile(xmlFileE) < 0 ) {
+ Log("ERROR: XML content (EOR) is not well-formed.");
+ return 11;
}
-
+ Log("XML contents are well-formed.");
+
// create parser and parse
- TSAXParser saxParser;
- AliTRDSaxHandler saxHandler;
- saxParser.ConnectToHandler("AliTRDSaxHandler", &saxHandler);
- saxParser.ParseFile(xmlFile);
+ TSAXParser saxParserS, saxParserE;
+ AliTRDSaxHandler saxHandlerS, saxHandlerE;
+ saxParserS.ConnectToHandler("AliTRDSaxHandler", &saxHandlerS);
+ saxParserS.ParseFile(xmlFileS);
+ saxParserE.ConnectToHandler("AliTRDSaxHandler", &saxHandlerE);
+ saxParserE.ParseFile(xmlFileE);
// report errors if present
- if (saxParser.GetParseCode() == 0) {
- Log("XML file validation OK");
+ if ((saxParserS.GetParseCode() == 0) && (saxParserE.GetParseCode() == 0)) {
+ Log("XML file validation OK.");
} else {
- Log(Form("ERROR in XML file validation. Parsecode: %s", saxParser.GetParseCode()));
+ Log(Form("ERROR in XML file validation. Parsecodes: SOR: %s, EOR: %s", saxParserS.GetParseCode(), saxParserE.GetParseCode()));
return 12;
}
- if (saxHandler.GetHandlerStatus() == 0) {
+ if ((saxHandlerS.GetHandlerStatus() == 0) && (saxHandlerE.GetHandlerStatus() == 0)) {
Log("SAX handler reports no errors.");
} else {
- Log(Form("ERROR while creating calibration objects. Error code: %s", saxHandler.GetHandlerStatus()));
+ Log(Form("ERROR while creating calibration objects. Error codes: SOR: %s, EOR: %s", saxHandlerS.GetHandlerStatus(), saxHandlerE.GetHandlerStatus()));
return 14;
}
// get the calibration object storing the data from the handler
- AliTRDCalDCS* fCalDCSObj = saxHandler.GetCalDCSObj();
- fCalDCSObj->EvaluateGlobalParameters();
+ AliTRDCalDCS* fCalDCSObjSOR = saxHandlerS.GetCalDCSObj();
+ AliTRDCalDCS* fCalDCSObjEOR = saxHandlerE.GetCalDCSObj();
+ fCalDCSObjSOR->EvaluateGlobalParameters();
+ fCalDCSObjEOR->EvaluateGlobalParameters();
+
+ // put both objects in one TObjArray to store them
+ TObjArray* fCalObjArray = new TObjArray(2);
+ fCalObjArray->SetOwner();
+ fCalObjArray->AddAt(fCalDCSObjSOR,0);
+ fCalObjArray->AddAt(fCalDCSObjEOR,1);
// store the DCS calib data in the CDB
AliCDBMetaData metaData1;
metaData1.SetBeamPeriod(0);
metaData1.SetResponsible("Frederick Kramer");
- metaData1.SetComment("DCS configuration data in one AliTRDCalDCS object.");
- if (!Store("Calib", "DCS", fCalDCSObj, &metaData1, 0, kTRUE)) {
+ metaData1.SetComment("DCS configuration data in two AliTRDCalDCS objects in one TObjArray (0:SOR, 1:EOR).");
+ if (!Store("Calib", "DCS", fCalObjArray, &metaData1, 0, kTRUE)) {
Log("problems while storing DCS config data object");
return 15;
} else {
Log("DCS config data object stored.");
}
- Log("Processing of the DCS config summary file DONE.");
+ //delete fCalObjArray;
+ Log("Processing of the DCS config summary file DONE.");
return 0;
}
-//===================================================================================\r
-// This is a macro to analyze TRD/Calib/DCS OCDB objects either\r
-// from the grid for a given run number or from a local object.\r
-// If you want to analyze data from the grid, please don't forget to\r
-// have a valid alien token initialized and the file /tmp/gclient_env_$UID source'd.\r
-//\r
-// Arguments:\r
-// The first argument is the runnumber (this is ignored in case of a local file),\r
-// the second is a string that needs to contain either "grid" or "local". Further\r
-// you can add either verbose or quiet to that string. If you don't, you'll be asked\r
-// for all stuff individually wether you want to see it or not\r
-// the thrid argument is the number of the ROC you (eventually) want to dump its data\r
-// member of.\r
-// The fourth one is the path and name of the local file you might want to look at.\r
-//\r
-// So the simplest way to use this macro is if you want to check the output of a given\r
-// run from the OCDB:\r
-// .x AliTRDcheckConfig(60111)\r
-//\r
-// An example for quickly checking a local file:\r
-// .x AliTRDcheckConfig.C(0, "local quiet", 533, "$ALICE_ROOT/TRD/Calib/DCS/Run0_999999999_v0_s0.root")\r
-//\r
-// Please contact Frederick Kramer in case of problems\r
-//===================================================================================\r
-\r
-\r
-const Int_t nROC = 540;\r
-const Int_t nROB = 8;\r
-const Int_t nMCM = 18;\r
-\r
-\r
-void AliTRDcheckConfig(Int_t runNr=0, TString source="grid", Int_t dumpid=0, char *pathfile="nopathgiven"){\r
-\r
- AliCDBEntry *entry=0;\r
-\r
- // get the source\r
- if(source.Contains("grid")) {\r
- cout << "I : Accessing grid storage for run number " << runNr << endl;\r
- cout << "I : Get CDBManager instance." << endl;\r
- AliCDBManager *man = AliCDBManager::Instance();\r
- cout << "I : SetDefaultStorage." << endl;\r
- man->SetDefaultStorage("alien://folder=/alice/data/2008/LHC08d/OCDB/");\r
- cout << "I : Get OCDB Entry." << endl;\r
- entry = man->Get("TRD/Calib/DCSCONFIG", runNr);\r
- } else if(source.Contains("local")) {\r
- cout << "I : Accessing local storage" << endl;\r
- TFile *f = new TFile(pathfile);\r
- if(f != NULL) {\r
- entry = (AliCDBEntry*) f->Get("AliCDBEntry");\r
- }\r
- else {\r
- cout << "E : Cannot open file" << endl;\r
- return;\r
- }\r
- } else {\r
- cout << "E : Please specify a correct source (grid/local)" << endl;\r
- return;\r
- }\r
-\r
-\r
- Int_t dump[20];\r
- for(Int_t i=0; i<20; i++) dump[i]=0;\r
- if(!source.Contains("quiet") && !source.Contains("verbose")) {\r
- cout << "Q : Do you want to dump the AliCDBEntry? (1/0) ";\r
- cin >> dump[0];\r
- cout << "Q : Do you want to dump the AliTRDCalDCS Object? (1/0) ";\r
- cin >> dump[1];\r
- cout << "Q : Do you want to dump the AliTRDCalDCSFEE Object? (1/0) ";\r
- cin >> dump[2];\r
- if(dump[2] == 1) {\r
- cout << "Q : Which Detector ID? (0..540) ";\r
- cin >> dumpid;\r
- }\r
- cout << "Q : Do you want to get a status bit summary? (1/0) ";\r
- cin >> dump[3];\r
- cout << "Q : Do you want to get a status bit histogram? (1/0) ";\r
- cin >> dump[4];\r
- cout << "Q : Do you want to get a check on data integrity? (1/0) ";\r
- cin >> dump[5];\r
- }\r
- if(source.Contains("verbose")) for(Int_t i=0; i<20; i++) dump[i]=1;\r
-\r
-\r
- // the AliCDBEntry\r
- if(dump[0] > 0) {\r
- cout << endl << "============ Dumping the AliCDBEntry ============" << endl;\r
- entry->Dump();\r
- }\r
-\r
- // the CalDCS object\r
- AliTRDCalDCS *caldcs;\r
- caldcs = (AliTRDCalDCS*) entry->GetObject();\r
- if(dump[1] > 0) {\r
- cout << endl << "============ Dumping the AliTRDCalDCS Object ============" << endl;\r
- caldcs->Dump();\r
- }\r
-\r
- // one CalDCSFEE object\r
- if(dump[2] > 0) {\r
- AliTRDCalDCSFEE *dcsfee;\r
- dcsfee = caldcs->GetCalDCSFEEObj(dumpid);\r
- cout <<endl<< "============ Dumping the AliTRDCalDCSFEE Object Nr. " << dumpid << " ============" << endl;\r
- if (dcsfee != NULL) {\r
- dcsfee->Dump();\r
- }\r
- }\r
-\r
- // fill histograms\r
- TH1F *hStatusBits = new TH1F("hStatusBits", "DCS FEE Status Bits", 10, -.5, 9.5);\r
- hStatusBits->SetFillColor(38);\r
- hStatusBits->GetXaxis()->SetTitle("Status Bit Value");\r
- hStatusBits->GetYaxis()->SetTitle("Occurrence");\r
-\r
- // get a status bit summary\r
- if(dump[3] > 0) {\r
- cout << endl << "============ Status Bit Summary: ============" << endl;\r
- TString bitfivestr = " ROCs with status bit 5. These have been not even responding to any DIM communication attempt. Most probably they just were off.\n DCS IDs: ";\r
- Int_t lengthfive = bitfivestr.Length();\r
- TString bitfourstr = " ROCs with status bit 4! BAD! This might be due to a communication problem between fxsproxy and the feeserver(s) \n DCS IDs: ";\r
- Int_t lengthfour = bitfourstr.Length();\r
- TString bitthreestr = " ROCs with status bit 3!!! VERY BAD! This might be due to a serious communication error between the fxsproxy program and the FEEservers.\n DCS IDs: ";\r
- Int_t lengththree = bitthreestr.Length();\r
- TString bittwostr = " ROCs with status bit 2. These have been in states in which they cannot be read out, e.g. Standby.\n DCS IDs: ";\r
- Int_t lengthtwo = bittwostr.Length();\r
- TString bitonestr = " ROCs with status bit 1! BAD! This means the chamber(s) didn't respont even though is should have been in a good state.\n DCS IDs: ";\r
- Int_t lengthone = bitonestr.Length();\r
-\r
- Int_t nSB1=0, nSB2=0, nSB3=0, nSB4=0, nSB5=0;\r
- for (Int_t i=0; i<540; i++) {\r
- AliTRDCalDCSFEE *idcsfee;\r
- idcsfee = caldcs->GetCalDCSFEEObj(i);\r
- if (idcsfee != NULL) {\r
- Int_t sb = idcsfee->GetStatusBit();\r
- if (sb == 5) { bitfivestr += i; bitfivestr += " "; nSB5++; }\r
- if (sb == 4) { bitfourstr += i; bitfourstr += " "; nSB4++; }\r
- if (sb == 3) { bitthreestr += i; bitthreestr += " "; nSB3++; }\r
- if (sb == 2) { bittwostr += i; bittwostr += " "; nSB2++; }\r
- if (sb == 1) { bitonestr += i; bitonestr += " "; nSB1++; }\r
- hStatusBits->Fill(sb);\r
- }\r
- }\r
-\r
- if (lengthfive < bitfivestr.Length()) cout << nSB5 << bitfivestr.Data() << endl << endl;\r
- else cout << "GOOD: No ROCs with status bit 5" << endl;\r
- if (lengthfour < bitfourstr.Length()) cout << nSB4 << bitfourstr.Data() << endl << endl;\r
- else cout << "GOOD: No ROCs with status bit 4" << endl;\r
- if (lengththree < bitthreestr.Length()) cout << nSB3 << bitthreestr.Data() << endl << endl;\r
- else cout << "GOOD: No ROCs with status bit 3" << endl;\r
- if (lengthtwo < bittwostr.Length()) cout << nSB2 << bittwostr.Data() << endl << endl;\r
- else cout << "GOOD: No ROCs with status bit 2" << endl;\r
- if (lengthone < bitonestr.Length()) cout << nSB1 << bitonestr.Data() << endl << endl;\r
- else cout << "GOOD: No ROCs with status bit 1" << endl;\r
- }\r
-\r
-\r
- // get a status bit histogram\r
- if(dump[4] > 0) {\r
- TCanvas *c1 = new TCanvas("c1");\r
- gPad->SetLogy();\r
- hStatusBits->Draw("HIST");\r
- }\r
-\r
-\r
- // get a check on data integrity\r
- if(dump[5] > 0) {\r
- cout << endl << "============ Data Integrity: ============" << endl;\r
- TH1F *tb = new TH1F("tbs", "", 100000, 0, 100000);\r
- TH1F *ct = new TH1F("cts", "", 100000, 0, 100000);\r
- const Int_t ngsm = nROB * nMCM;\r
-\r
- Int_t gsm_occ[nROC][ngsm][2];\r
- Int_t ni_occ[nROC][ngsm][2];\r
- Int_t ev_occ[nROC][ngsm][2];\r
- Int_t pt_occ[nROC][ngsm][2];\r
-\r
- for (Int_t i=0; i<nROC; i++) {\r
- for (Int_t j=0; j<ngsm; j++) {\r
- gsm_occ[i][j][0] = 0; // values\r
- gsm_occ[i][j][1] = 0; // counter\r
- ni_occ[i][j][0] = 0; // values\r
- ni_occ[i][j][1] = 0; // counter\r
- ev_occ[i][j][0] = 0; // values\r
- ev_occ[i][j][1] = 0; // counter\r
- pt_occ[i][j][0] = 0; // values\r
- pt_occ[i][j][1] = 0; // counter\r
- }\r
- }\r
-\r
- Int_t majGSM[2], majNI[2], majEV[2], majPT[2];\r
- majGSM[0] = 0; // value\r
- majGSM[1] = 0; // count\r
- majNI[0] = 0; // value\r
- majNI[1] = 0; // count\r
- majEV[0] = 0; // value\r
- majEV[1] = 0; // count\r
- majPT[0] = 0; // value\r
- majPT[1] = 0; // count\r
-\r
-\r
- // find the majority states/counters\r
- for (Int_t i=0; i<nROC; i++) {\r
- AliTRDCalDCSFEE *idcsfee;\r
- idcsfee = caldcs->GetCalDCSFEEObj(i);\r
- if (idcsfee != NULL) {\r
- if(idcsfee->GetStatusBit() == 0) {\r
- tb->Fill(idcsfee->GetNumberOfTimeBins()-1);\r
- ct->Fill(idcsfee->GetConfigTag()-1);\r
- for (Int_t j=0; j<nROB; j++) {\r
- for (Int_t k=0; k<nMCM; k++) {\r
- Int_t igsm = idcsfee->GetMCMGlobalState(j, k);\r
- Int_t ini = idcsfee->GetMCMStateNI(j, k);\r
- Int_t iev = idcsfee->GetMCMEventCnt(j, k);\r
- Int_t ipt = idcsfee->GetMCMPtCnt(j, k);\r
- // gsm\r
- for (Int_t l=0; l<nROB*nMCM; l++) {\r
- if (gsm_occ[i][l][1] == 0){\r
- gsm_occ[i][l][1] = 1;\r
- gsm_occ[i][l][0] = igsm;\r
- break;\r
- }\r
- else if (gsm_occ[i][l][0] == igsm) {\r
- gsm_occ[i][l][1]++;\r
- break;\r
- }\r
- }\r
- // ni\r
- for (Int_t l=0; l<nROB*nMCM; l++) {\r
- if (ni_occ[i][l][1] == 0){\r
- ni_occ[i][l][1] = 1;\r
- ni_occ[i][l][0] = ini;\r
- break;\r
- }\r
- else if (ni_occ[i][l][0] == ini) {\r
- ni_occ[i][l][1]++;\r
- break;\r
- }\r
- }\r
- // ev\r
- for (Int_t l=0; l<nROB*nMCM; l++) {\r
- if (ev_occ[i][l][1] == 0){\r
- ev_occ[i][l][1] = 1;\r
- ev_occ[i][l][0] = iev;\r
- break;\r
- }\r
- else if (ev_occ[i][l][0] == iev) {\r
- ev_occ[i][l][1]++;\r
- break;\r
- }\r
- }\r
- // pt\r
- for (Int_t l=0; l<nROB*nMCM; l++) {\r
- if (pt_occ[i][l][1] == 0){\r
- pt_occ[i][l][1] = 1;\r
- pt_occ[i][l][0] = ipt;\r
- break;\r
- }\r
- else if (pt_occ[i][l][0] == ipt) {\r
- pt_occ[i][l][1]++;\r
- break;\r
- }\r
- }\r
- }\r
- }\r
-\r
- for (Int_t j=0; j<ngsm; j++) {\r
- // gsm\r
- if (gsm_occ[i][j][1] > 0) {\r
- if (gsm_occ[i][j][1] > majGSM[1]) {\r
- majGSM[0] = gsm_occ[i][j][0];\r
- majGSM[1] = gsm_occ[i][j][1];\r
- }\r
- }\r
- // ni\r
- if (ni_occ[i][j][1] > 0) {\r
- if (ni_occ[i][j][1] > majNI[1]) {\r
- majNI[0] = ni_occ[i][j][0];\r
- majNI[1] = ni_occ[i][j][1];\r
- }\r
- }\r
- // ev\r
- if (ev_occ[i][j][1] > 0) {\r
- if (ev_occ[i][j][1] > majEV[1]) {\r
- majEV[0] = ev_occ[i][j][0];\r
- majEV[1] = ev_occ[i][j][1];\r
- }\r
- }\r
- // pt\r
- if (pt_occ[i][j][1] > 0) {\r
- if (pt_occ[i][j][1] > majPT[1]) {\r
- majPT[0] = pt_occ[i][j][0];\r
- majPT[1] = pt_occ[i][j][1];\r
- }\r
- } \r
- }\r
- }\r
- }\r
- }\r
-\r
- Int_t maxBinCT = ct->GetMaximumBin();\r
- //cout << "Majority number of configuration tags: " << maxBinCT << endl;\r
- Int_t maxBinTB = tb->GetMaximumBin();\r
- //cout << "Majority number of timebins: " << maxBinTB << endl;\r
- Int_t integrityProblem = 0;\r
-\r
- for (Int_t i=0; i<nROC; i++) {\r
- AliTRDCalDCSFEE *idcsfee;\r
- idcsfee = caldcs->GetCalDCSFEEObj(i);\r
- if (idcsfee != NULL) {\r
- if(idcsfee->GetStatusBit() == 0) {\r
- Int_t ict = idcsfee->GetConfigTag();\r
- if(ict != maxBinCT) {\r
- cout << "ROB " << i << " has the config tag = " << ict \r
- << " what differs from the majority (=" << maxBinCT << ")!" << endl;\r
- integrityProblem++;\r
- }\r
- Int_t itb = idcsfee->GetNumberOfTimeBins();\r
- if(itb != maxBinTB) {\r
- cout << "ROB " << i << " has number of time bins = " << itb \r
- << " what differs from the majority (=" << maxBinTB << ")!" << endl;\r
- integrityProblem++;\r
- }\r
-\r
-\r
- for (Int_t j=0; j<ngsm; j++) {\r
- // gsm\r
- if ((gsm_occ[i][j][1] > 0) && (gsm_occ[i][j][0] != majGSM[0])) {\r
- if (!((gsm_occ[i][j][0] == -1) && ((gsm_occ[i][j][1] == 6) || (gsm_occ[i][j][1] == 40)))) { \r
- printf("ROC %3d %3d inconstistent global rstates found with value %2d\n",\r
- i,gsm_occ[i][j][1],gsm_occ[i][j][0]);\r
- integrityProblem++;\r
- }\r
- }\r
- // ni\r
- if ((ni_occ[i][j][1] > 0) && (ni_occ[i][j][0] != majNI[0])) {\r
- if (!((ni_occ[i][j][0] == -1) && ((ni_occ[i][j][1] == 6) || (ni_occ[i][j][1] == 40)))) { \r
- printf("ROC %3d %3d inconstistent network interface states found with value %2d\n",\r
- i,ni_occ[i][j][1],ni_occ[i][j][0]);\r
- integrityProblem++;\r
- }\r
- }\r
- // ev\r
- if ((ev_occ[i][j][1] > 0) && (ev_occ[i][j][0] != majEV[0])) {\r
- if (!((ev_occ[i][j][0] == -1) && ((ev_occ[i][j][1] == 6) || (ev_occ[i][j][1] == 40)))) { \r
- printf("ROC %3d %3d inconstistent event counters found with value %2d\n",\r
- i,ev_occ[i][j][1],ev_occ[i][j][0]);\r
- integrityProblem++;\r
- }\r
- }\r
- // pt\r
- if ((pt_occ[i][j][1] > 0) && (pt_occ[i][j][0] != majPT[0])) {\r
- if (!((pt_occ[i][j][0] == -1) && ((pt_occ[i][j][1] == 6) || (pt_occ[i][j][1] == 40)))) { \r
- printf("ROC %3d %3d inconstistent pretrigger counters found with value %2d\n",\r
- i,pt_occ[i][j][1],pt_occ[i][j][0]);\r
- integrityProblem++;\r
- }\r
- }\r
-\r
- }\r
- }\r
- }\r
- }\r
-\r
- if(integrityProblem == 0) cout << "No problem with data integrity found." << endl;\r
- else cout << endl << "There were in total " << integrityProblem << " inconsistencies!" << endl;\r
- }\r
-\r
-\r
- cout << endl << "============ Global Configuraton: ============" << endl;\r
- cout<<"Numbers are -1 if not set and -2 if mixed," << endl;\r
- cout<<"strings are empty if not set and 'mixed' if so." << endl << endl;\r
- cout<<"Global number of time bins.........................: "<<caldcs->GetGlobalNumberOfTimeBins() << endl;\r
- cout<<"Global configuration tag...........................: "<<caldcs->GetGlobalConfigTag() << endl;\r
- cout<<"Global single hit threshold........................: "<<caldcs->GetGlobalSingleHitThres() << endl;\r
- cout<<"Global three pad cluster threshold.................: "<<caldcs->GetGlobalThreePadClustThres()<<endl;\r
- cout<<"Global selective ZS (every i'th event).............: "<<caldcs->GetGlobalSelectiveNoZS() << endl;\r
- cout<<"Global tail cancellation filter weight.............: "<<caldcs->GetGlobalTCFilterWeight() << endl;\r
- cout<<"Global tail cancellat. filter short decay parameter: "<<caldcs->GetGlobalTCFilterShortDecPar()<<endl;\r
- cout<<"Global tail cancellation filt. long decay parameter: "<<caldcs->GetGlobalTCFilterLongDecPar()<<endl;\r
- cout<<"Global fast statistics mode?.......................: "<<caldcs->GetGlobalModeFastStatNoise() << endl;\r
- cout<<"Global configuration tag version...................: "<<caldcs->GetGlobalConfigVersion() << endl;\r
- cout<<"Global configuration tag name......................: "<<caldcs->GetGlobalConfigName() << endl;\r
- cout<<"Global filter type.................................: "<<caldcs->GetGlobalFilterType() << endl;\r
- cout<<"Global readout parameter...........................: "<<caldcs->GetGlobalReadoutParam() << endl;\r
- cout<<"Global test pattern................................: "<<caldcs->GetGlobalTestPattern() << endl;\r
- cout<<"Global tracklet mode...............................: "<<caldcs->GetGlobalTrackletMode() << endl;\r
- cout<<"Global tracklet definition.........................: "<<caldcs->GetGlobalTrackletDef() << endl;\r
- cout<<"Global trigger setup...............................: "<<caldcs->GetGlobalTriggerSetup() << endl;\r
- cout<<"Global additional options..........................: "<<caldcs->GetGlobalAddOptions() << endl;\r
-\r
-}\r
+//===================================================================================\r\r
+// This is a macro to analyze TRD/Calib/DCS OCDB objects either\r\r
+// from the grid for a given run number or from a local object.\r\r
+// If you want to analyze data from the grid, please don't forget to\r\r
+// have a valid alien token initialized and the file /tmp/gclient_env_$UID source'd.\r\r
+//\r\r
+// Arguments:\r\r
+// The first argument is the runnumber (this is ignored in case of a local file),\r\r
+// the second is a string that needs to contain either "grid" or "local". Further\r\r
+// you can add either verbose or quiet to that string. If you don't, you'll be asked\r\r
+// for all stuff individually wether you want to see it or not\r\r
+// the thrid argument is the number of the ROC you (eventually) want to dump its data\r\r
+// member of.\r\r
+// The fourth one is the path and name of the local file you might want to look at.\r\r
+//\r\r
+// So the simplest way to use this macro is if you want to check the output of a given\r\r
+// run from the OCDB:\r\r
+// .x AliTRDcheckConfig.C(60111)\r\r
+//\r\r
+// An example for quickly checking a local file:\r\r
+// .x AliTRDcheckConfig.C(0, "local quiet", 533, "$ALICE_ROOT/TRD/Calib/DCS/Run0_999999999_v0_s0.root")\r\r
+//\r\r
+// Please contact Frederick Kramer in case of problems\r\r
+//===================================================================================\r\r
+\r\r
+\r\r
+const Int_t nROC = 540;\r\r
+const Int_t nROB = 8;\r\r
+const Int_t nMCM = 18;\r\r
+const Int_t cArraySize = 1000;\r\r
+\r\r
+\r\r
+\r\r
+void AnalyzeArray(Int_t states[cArraySize], Int_t occur[cArraySize]) {\r\r
+ long long srtIndx[cArraySize] = 0;\r\r
+ \r\r
+ TMath::Sort(cArraySize, occur, srtIndx);\r\r
+\r\r
+ Int_t totalSum = 0, subSum = 0, iIndex = 0;\r\r
+ for (Int_t i=0; i<cArraySize; i++) totalSum += occur[i];\r\r
+ \r\r
+ cout << " The majority ("<< occur[srtIndx[0]] << " of " \r\r
+ << totalSum <<") is: " << states[srtIndx[0]] << endl;\r\r
+ subSum = occur[srtIndx[0]];\r\r
+ while (totalSum != subSum) {\r\r
+ if (++iIndex > 999) {\r\r
+ cout << "E : out of bounds." << endl;\r\r
+ break;\r\r
+ }\r\r
+ Printf(" Next: %7d (%d)", states[srtIndx[iIndex]], occur[srtIndx[iIndex]]);\r\r
+ subSum += occur[srtIndx[iIndex]];\r\r
+ }\r\r
+}\r\r
+\r\r
+\r\r
+\r\r
+void FillItemInArray(Int_t states[cArraySize], Int_t occur[cArraySize], Int_t item) {\r\r
+ for (Int_t iArrPos=0; iArrPos<cArraySize; iArrPos++) {\r\r
+ if (item == -1) break; // value not set\r\r
+ if (states[iArrPos] == item) {\r\r
+ occur[iArrPos]++;\r\r
+ break;\r\r
+ } else if (occur[iArrPos] == 0) {\r\r
+ states[iArrPos] = item;\r\r
+ occur[iArrPos]++;\r\r
+ break;\r\r
+ }\r\r
+ }\r\r
+}\r\r
+\r\r
+\r\r
+\r\r
+void GetMajoritys(AliTRDCalDCS* calDCSObj) {\r\r
+\r\r
+ Int_t gsmStates[cArraySize] = {0}, gsmOccur[cArraySize] = {0};\r\r
+ Int_t nimStates[cArraySize] = {0}, nimOccur[cArraySize] = {0};\r\r
+ Int_t nevStates[cArraySize] = {0}, nevOccur[cArraySize] = {0};\r\r
+ Int_t nptStates[cArraySize] = {0}, nptOccur[cArraySize] = {0};\r\r
+\r\r
+ for (Int_t i=0; i<cArraySize; i++) {\r\r
+ gsmStates[i] = 0;\r\r
+ gsmOccur[i] = 0;\r\r
+ nimStates[i] = 0;\r\r
+ nimOccur[i] = 0;\r\r
+ nevStates[i] = 0;\r\r
+ nevOccur[i] = 0;\r\r
+ nptStates[i] = 0;\r\r
+ nptOccur[i] = 0; \r\r
+ }\r\r
+ \r\r
+ for (Int_t i=0; i<nROC; i++) {\r\r
+ AliTRDCalDCSFEE *idcsfee = calDCSObj->GetCalDCSFEEObj(i);\r\r
+ if ((idcsfee == NULL) || (idcsfee->GetStatusBit() != 0)) continue;\r\r
+ for (Int_t j=0; j<nROB; j++) {\r\r
+ for (Int_t k=0; k<nMCM; k++) {\r\r
+ Int_t igsm = idcsfee->GetMCMGlobalState(j,k);\r\r
+ Int_t inim = idcsfee->GetMCMStateNI(j,k);\r\r
+ Int_t inev = idcsfee->GetMCMEventCnt(j,k);\r\r
+ Int_t inpt = idcsfee->GetMCMPtCnt(j,k);\r\r
+ \r\r
+ FillItemInArray(gsmStates, gsmOccur, igsm); \r\r
+ FillItemInArray(nimStates, nimOccur, inim); \r\r
+ FillItemInArray(nevStates, nevOccur, inev); \r\r
+ FillItemInArray(nptStates, nptOccur, inpt); \r\r
+ }\r\r
+ }\r\r
+ }\r\r
+ \r\r
+ cout << "I : Global MCM state statistics:" << endl;\r\r
+ AnalyzeArray(gsmStates, gsmOccur);\r\r
+ cout << "I : Network interface state statistics:" << endl;\r\r
+ AnalyzeArray(nimStates, nimOccur);\r\r
+ cout << "I : MCM Event counter reading statistics:" << endl;\r\r
+ AnalyzeArray(nevStates, nevOccur);\r\r
+ cout << "I : MCM PreTrigger counter reading statistics:" << endl;\r\r
+ AnalyzeArray(nptStates, nptOccur);\r\r
+ \r\r
+ return;\r\r
+}\r\r
+\r\r
+\r\r
+void AliTRDcheckConfig(Int_t runNr=0, TString source="grid", Int_t dumpid=0, char *pathfile="nopathgiven"){\r\r
+\r\r
+ AliCDBEntry *entry=0;\r\r
+\r\r
+ // get the source\r\r
+ if(source.Contains("grid")) {\r\r
+ cout << "I : Accessing grid storage for run number " << runNr << endl;\r\r
+ cout << "I : Get CDBManager instance." << endl;\r\r
+ AliCDBManager *man = AliCDBManager::Instance();\r\r
+ cout << "I : SetDefaultStorage." << endl;\r\r
+ man->SetDefaultStorage("alien://folder=/alice/data/2008/LHC08d/OCDB/");\r\r
+ cout << "I : Get OCDB Entry." << endl;\r\r
+ entry = man->Get("TRD/Calib/DCSCONFIG", runNr);\r\r
+ } else if(source.Contains("local")) {\r\r
+ cout << "I : Accessing local storage" << endl;\r\r
+ TFile *f = new TFile(pathfile);\r\r
+ if(f != NULL) {\r\r
+ entry = (AliCDBEntry*) f->Get("AliCDBEntry");\r\r
+ }\r\r
+ else {\r\r
+ cout << "E : Cannot open file" << endl;\r\r
+ return;\r\r
+ }\r\r
+ } else {\r\r
+ cout << "E : Please specify a correct source (grid/local)" << endl;\r\r
+ return;\r\r
+ }\r\r
+\r\r
+\r\r
+ Int_t dump[20], contSelect=-1;\r\r
+ for(Int_t i=0; i<20; i++) dump[i]=0;\r\r
+ if(!source.Contains("quiet") && !source.Contains("verbose")) {\r\r
+ cout << "Q : Do you want to dump the AliCDBEntry? (1/0) ";\r\r
+ cin >> dump[0];\r\r
+ cout << "Q : Do you want to dump the AliTRDCalDCS Object? (1/0) ";\r\r
+ cin >> dump[1];\r\r
+ cout << "Q : Do you want to dump the AliTRDCalDCSFEE Object? (1/0) ";\r\r
+ cin >> dump[2];\r\r
+ if(dump[2] == 1) {\r\r
+ cout << "Q : Which Detector ID? (0..540) ";\r\r
+ cin >> dumpid;\r\r
+ }\r\r
+ cout << "Q : Do you want to get a status bit summary? (1/0) ";\r\r
+ cin >> dump[3];\r\r
+ cout << "Q : Do you want to get a status bit histogram? (1/0) ";\r\r
+ cin >> dump[4];\r\r
+ cout << "Q : Do you want to get a check on data integrity? (1/0) ";\r\r
+ cin >> dump[5];\r\r
+ }\r\r
+ if(source.Contains("verbose")) for(Int_t i=0; i<20; i++) dump[i]=1;\r\r
+\r\r
+ // check version\r\r
+ //TObject *objectCDB = (TObject*)entry->GetObject();\r\r
+ TObject *objectCDB = (TObject*)entry->GetObject();\r\r
+ if (objectCDB->IsA()->InheritsFrom("TObjArray")) {\r\r
+ cout << "I : It seems like you are checking a file containing both SOR and EOR informations." << endl;\r\r
+ cout << "Q : Do you want to check SOR (0), EOR (1) or their differences (2)? ";\r\r
+ cin >> contSelect;\r\r
+ TObjArray *objArrayCDB = (TObjArray*)entry->GetObject();\r\r
+ }\r\r
+\r\r
+\r\r
+\r\r
+ // the AliCDBEntry\r\r
+ if(dump[0] > 0) {\r\r
+ cout << endl << "============ Dumping the AliCDBEntry ============" << endl;\r\r
+ entry->Dump();\r\r
+ }\r\r
+\r\r
+ \r\r
+ // the CalDCS object\r\r
+ AliTRDCalDCS *caldcs;\r\r
+ switch(contSelect) {\r\r
+ case -1:\r\r
+ caldcs = (AliTRDCalDCS*) entry->GetObject();\r\r
+ break; \r\r
+ case 0:\r\r
+ caldcs = (AliTRDCalDCS*) objArrayCDB->At(0);\r\r
+ break; \r\r
+ case 1:\r\r
+ caldcs = (AliTRDCalDCS*) objArrayCDB->At(1);\r\r
+ break; \r\r
+ case 2:\r\r
+ cout << "I : Sorry, not implemented yet. Stop." << endl;\r\r
+ return;\r\r
+ break; \r\r
+ default:\r\r
+ cout << "E : Invalid key. Stop." << endl;\r\r
+ return;\r\r
+ }\r\r
+\r\r
+ \r\r
+\r\r
+ if(dump[1] > 0) {\r\r
+ cout << endl << "============ Dumping the AliTRDCalDCS Object ============" << endl;\r\r
+ caldcs->Dump();\r\r
+ }\r\r
+\r\r
+ // one CalDCSFEE object\r\r
+ if(dump[2] > 0) {\r\r
+ AliTRDCalDCSFEE *dcsfee;\r\r
+ dcsfee = caldcs->GetCalDCSFEEObj(dumpid);\r\r
+ cout <<endl<< "============ Dumping the AliTRDCalDCSFEE Object Nr. " << dumpid << " ============" << endl;\r\r
+ if (dcsfee != NULL) {\r\r
+ dcsfee->Dump();\r\r
+ }\r\r
+ }\r\r
+\r\r
+ // fill histograms\r\r
+ TH1F *hStatusBits = new TH1F("hStatusBits", "DCS FEE Status Bits", 10, -.5, 9.5);\r\r
+ hStatusBits->SetFillColor(38);\r\r
+ hStatusBits->GetXaxis()->SetTitle("Status Bit Value");\r\r
+ hStatusBits->GetYaxis()->SetTitle("Occurrence");\r\r
+\r\r
+ // get a status bit summary\r\r
+ if(dump[3] > 0) {\r\r
+ cout << endl << "============ Status Bit Summary: ============" << endl;\r\r
+ TString bitfivestr = " ROCs with status bit 5. These have been not even responding to any DIM communication attempt. Most probably they just were off.\n DCS IDs: ";\r\r
+ Int_t lengthfive = bitfivestr.Length();\r\r
+ TString bitfourstr = " ROCs with status bit 4! BAD! This might be due to a communication problem between fxsproxy and the feeserver(s) \n DCS IDs: ";\r\r
+ Int_t lengthfour = bitfourstr.Length();\r\r
+ TString bitthreestr = " ROCs with status bit 3!!! VERY BAD! This might be due to a serious communication error between the fxsproxy program and the FEEservers.\n DCS IDs: ";\r\r
+ Int_t lengththree = bitthreestr.Length();\r\r
+ TString bittwostr = " ROCs with status bit 2. These have been in states in which they cannot be read out, e.g. Standby.\n DCS IDs: ";\r\r
+ Int_t lengthtwo = bittwostr.Length();\r\r
+ TString bitonestr = " ROCs with status bit 1! BAD! This means the chamber(s) didn't respont even though is should have been in a good state.\n DCS IDs: ";\r\r
+ Int_t lengthone = bitonestr.Length();\r\r
+\r\r
+ Int_t nSB1=0, nSB2=0, nSB3=0, nSB4=0, nSB5=0;\r\r
+ for (Int_t i=0; i<540; i++) {\r\r
+ AliTRDCalDCSFEE *idcsfee;\r\r
+ idcsfee = caldcs->GetCalDCSFEEObj(i);\r\r
+ if (idcsfee != NULL) {\r\r
+ Int_t sb = idcsfee->GetStatusBit();\r\r
+ if (sb == 5) { bitfivestr += i; bitfivestr += " "; nSB5++; }\r\r
+ if (sb == 4) { bitfourstr += i; bitfourstr += " "; nSB4++; }\r\r
+ if (sb == 3) { bitthreestr += i; bitthreestr += " "; nSB3++; }\r\r
+ if (sb == 2) { bittwostr += i; bittwostr += " "; nSB2++; }\r\r
+ if (sb == 1) { bitonestr += i; bitonestr += " "; nSB1++; }\r\r
+ hStatusBits->Fill(sb);\r\r
+ }\r\r
+ }\r\r
+\r\r
+ if (lengthfive < bitfivestr.Length()) cout << nSB5 << bitfivestr.Data() << endl << endl;\r\r
+ else cout << "GOOD: No ROCs with status bit 5" << endl;\r\r
+ if (lengthfour < bitfourstr.Length()) cout << nSB4 << bitfourstr.Data() << endl << endl;\r\r
+ else cout << "GOOD: No ROCs with status bit 4" << endl;\r\r
+ if (lengththree < bitthreestr.Length()) cout << nSB3 << bitthreestr.Data() << endl << endl;\r\r
+ else cout << "GOOD: No ROCs with status bit 3" << endl;\r\r
+ if (lengthtwo < bittwostr.Length()) cout << nSB2 << bittwostr.Data() << endl << endl;\r\r
+ else cout << "GOOD: No ROCs with status bit 2" << endl;\r\r
+ if (lengthone < bitonestr.Length()) cout << nSB1 << bitonestr.Data() << endl << endl;\r\r
+ else cout << "GOOD: No ROCs with status bit 1" << endl;\r\r
+ }\r\r
+\r\r
+\r\r
+ // get a status bit histogram\r\r
+ if(dump[4] > 0) {\r\r
+ TCanvas *c1 = new TCanvas("c1");\r\r
+ gPad->SetLogy();\r\r
+ hStatusBits->Draw("HIST");\r\r
+ }\r\r
+\r\r
+\r\r
+\r\r
+ // get a check on data integrity\r\r
+ if(dump[5] > 0) {\r\r
+ cout << endl << "============ Data Integrity: ============" << endl;\r\r
+ TH1F *tb = new TH1F("tbs", "", 100000, 0, 100000);\r\r
+ TH1F *ct = new TH1F("cts", "", 100000, 0, 100000);\r\r
+ const Int_t ngsm = nROB * nMCM;\r\r
+\r\r
+ Int_t gsm_occ[nROC][ngsm][2];\r\r
+ Int_t ni_occ[nROC][ngsm][2];\r\r
+ Int_t ev_occ[nROC][ngsm][2];\r\r
+ Int_t pt_occ[nROC][ngsm][2];\r\r
+\r\r
+ for (Int_t i=0; i<nROC; i++) {\r\r
+ for (Int_t j=0; j<ngsm; j++) {\r\r
+ gsm_occ[i][j][0] = 0; // values\r\r
+ gsm_occ[i][j][1] = 0; // counter\r\r
+ ni_occ[i][j][0] = 0; // values\r\r
+ ni_occ[i][j][1] = 0; // counter\r\r
+ ev_occ[i][j][0] = 0; // values\r\r
+ ev_occ[i][j][1] = 0; // counter\r\r
+ pt_occ[i][j][0] = 0; // values\r\r
+ pt_occ[i][j][1] = 0; // counter\r\r
+ }\r\r
+ }\r\r
+\r\r
+ Int_t majGSM[2], majNI[2], majEV[2], majPT[2];\r\r
+ majGSM[0] = 0; // value\r\r
+ majGSM[1] = 0; // count\r\r
+ majNI[0] = 0; // value\r\r
+ majNI[1] = 0; // count\r\r
+ majEV[0] = 0; // value\r\r
+ majEV[1] = 0; // count\r\r
+ majPT[0] = 0; // value\r\r
+ majPT[1] = 0; // count\r\r
+\r\r
+\r\r
+ // find the majority states/counters\r\r
+ for (Int_t i=0; i<nROC; i++) {\r\r
+ AliTRDCalDCSFEE *idcsfee;\r\r
+ idcsfee = caldcs->GetCalDCSFEEObj(i);\r\r
+ if (idcsfee != NULL) {\r\r
+ if(idcsfee->GetStatusBit() == 0) {\r\r
+ tb->Fill(idcsfee->GetNumberOfTimeBins()-1);\r\r
+ ct->Fill(idcsfee->GetConfigTag()-1);\r\r
+ for (Int_t j=0; j<nROB; j++) {\r\r
+ for (Int_t k=0; k<nMCM; k++) {\r\r
+ Int_t igsm = idcsfee->GetMCMGlobalState(j, k);\r\r
+ Int_t ini = idcsfee->GetMCMStateNI(j, k);\r\r
+ Int_t iev = idcsfee->GetMCMEventCnt(j, k);\r\r
+ Int_t ipt = idcsfee->GetMCMPtCnt(j, k);\r\r
+ // gsm\r\r
+ for (Int_t l=0; l<nROB*nMCM; l++) {\r\r
+ if (gsm_occ[i][l][1] == 0){\r\r
+ gsm_occ[i][l][1] = 1;\r\r
+ gsm_occ[i][l][0] = igsm;\r\r
+ break;\r\r
+ }\r\r
+ else if (gsm_occ[i][l][0] == igsm) {\r\r
+ gsm_occ[i][l][1]++;\r\r
+ break;\r\r
+ }\r\r
+ }\r\r
+ // ni\r\r
+ for (Int_t l=0; l<nROB*nMCM; l++) {\r\r
+ if (ni_occ[i][l][1] == 0){\r\r
+ ni_occ[i][l][1] = 1;\r\r
+ ni_occ[i][l][0] = ini;\r\r
+ break;\r\r
+ }\r\r
+ else if (ni_occ[i][l][0] == ini) {\r\r
+ ni_occ[i][l][1]++;\r\r
+ break;\r\r
+ }\r\r
+ }\r\r
+ // ev\r\r
+ for (Int_t l=0; l<nROB*nMCM; l++) {\r\r
+ if (ev_occ[i][l][1] == 0){\r\r
+ ev_occ[i][l][1] = 1;\r\r
+ ev_occ[i][l][0] = iev;\r\r
+ break;\r\r
+ }\r\r
+ else if (ev_occ[i][l][0] == iev) {\r\r
+ ev_occ[i][l][1]++;\r\r
+ break;\r\r
+ }\r\r
+ }\r\r
+ // pt\r\r
+ for (Int_t l=0; l<nROB*nMCM; l++) {\r\r
+ if (pt_occ[i][l][1] == 0){\r\r
+ pt_occ[i][l][1] = 1;\r\r
+ pt_occ[i][l][0] = ipt;\r\r
+ break;\r\r
+ }\r\r
+ else if (pt_occ[i][l][0] == ipt) {\r\r
+ pt_occ[i][l][1]++;\r\r
+ break;\r\r
+ }\r\r
+ }\r\r
+ }\r\r
+ }\r\r
+\r\r
+ for (Int_t j=0; j<ngsm; j++) {\r\r
+ // gsm\r\r
+ if (gsm_occ[i][j][1] > 0) {\r\r
+ if (gsm_occ[i][j][1] > majGSM[1]) {\r\r
+ majGSM[0] = gsm_occ[i][j][0];\r\r
+ majGSM[1] = gsm_occ[i][j][1];\r\r
+ }\r\r
+ }\r\r
+ // ni\r\r
+ if (ni_occ[i][j][1] > 0) {\r\r
+ if (ni_occ[i][j][1] > majNI[1]) {\r\r
+ majNI[0] = ni_occ[i][j][0];\r\r
+ majNI[1] = ni_occ[i][j][1];\r\r
+ }\r\r
+ }\r\r
+ // ev\r\r
+ if (ev_occ[i][j][1] > 0) {\r\r
+ if (ev_occ[i][j][1] > majEV[1]) {\r\r
+ majEV[0] = ev_occ[i][j][0];\r\r
+ majEV[1] = ev_occ[i][j][1];\r\r
+ }\r\r
+ }\r\r
+ // pt\r\r
+ if (pt_occ[i][j][1] > 0) {\r\r
+ if (pt_occ[i][j][1] > majPT[1]) {\r\r
+ majPT[0] = pt_occ[i][j][0];\r\r
+ majPT[1] = pt_occ[i][j][1];\r\r
+ }\r\r
+ } \r\r
+ }\r\r
+ }\r\r
+ }\r\r
+ }\r\r
+\r\r
+ Int_t maxBinCT = ct->GetMaximumBin();\r\r
+ //cout << "Majority number of configuration tags: " << maxBinCT << endl;\r\r
+ Int_t maxBinTB = tb->GetMaximumBin();\r\r
+ //cout << "Majority number of timebins: " << maxBinTB << endl;\r\r
+ Int_t integrityProblem = 0;\r\r
+\r\r
+ for (Int_t i=0; i<nROC; i++) {\r\r
+ AliTRDCalDCSFEE *idcsfee;\r\r
+ idcsfee = caldcs->GetCalDCSFEEObj(i);\r\r
+ if (idcsfee != NULL) {\r\r
+ if(idcsfee->GetStatusBit() == 0) {\r\r
+ Int_t ict = idcsfee->GetConfigTag();\r\r
+ if(ict != maxBinCT) {\r\r
+ cout << "ROB " << i << " has the config tag = " << ict \r\r
+ << " what differs from the majority (=" << maxBinCT << ")!" << endl;\r\r
+ integrityProblem++;\r\r
+ }\r\r
+ Int_t itb = idcsfee->GetNumberOfTimeBins();\r\r
+ if(itb != maxBinTB) {\r\r
+ cout << "ROB " << i << " has number of time bins = " << itb \r\r
+ << " what differs from the majority (=" << maxBinTB << ")!" << endl;\r\r
+ integrityProblem++;\r\r
+ }\r\r
+\r\r
+\r\r
+ for (Int_t j=0; j<ngsm; j++) {\r\r
+ // gsm\r\r
+ if ((gsm_occ[i][j][1] > 0) && (gsm_occ[i][j][0] != majGSM[0])) {\r\r
+ if (!((gsm_occ[i][j][0] == -1) && ((gsm_occ[i][j][1] == 6) || (gsm_occ[i][j][1] == 40)))) { \r\r
+ printf("ROC %3d %3d inconstistent global rstates found with value %2d\n",\r\r
+ i,gsm_occ[i][j][1],gsm_occ[i][j][0]);\r\r
+ integrityProblem++;\r\r
+ }\r\r
+ }\r\r
+ // ni\r\r
+ if ((ni_occ[i][j][1] > 0) && (ni_occ[i][j][0] != majNI[0])) {\r\r
+ if (!((ni_occ[i][j][0] == -1) && ((ni_occ[i][j][1] == 6) || (ni_occ[i][j][1] == 40)))) { \r\r
+ printf("ROC %3d %3d inconstistent network interface states found with value %2d\n",\r\r
+ i,ni_occ[i][j][1],ni_occ[i][j][0]);\r\r
+ integrityProblem++;\r\r
+ }\r\r
+ }\r\r
+ // ev\r\r
+ if ((ev_occ[i][j][1] > 0) && (ev_occ[i][j][0] != majEV[0])) {\r\r
+ if (!((ev_occ[i][j][0] == -1) && ((ev_occ[i][j][1] == 6) || (ev_occ[i][j][1] == 40)))) { \r\r
+ printf("ROC %3d %3d inconstistent event counters found with value %2d\n",\r\r
+ i,ev_occ[i][j][1],ev_occ[i][j][0]);\r\r
+ integrityProblem++;\r\r
+ }\r\r
+ }\r\r
+ // pt\r\r
+ if ((pt_occ[i][j][1] > 0) && (pt_occ[i][j][0] != majPT[0])) {\r\r
+ if (!((pt_occ[i][j][0] == -1) && ((pt_occ[i][j][1] == 6) || (pt_occ[i][j][1] == 40)))) { \r\r
+ printf("ROC %3d %3d inconstistent pretrigger counters found with value %2d\n",\r\r
+ i,pt_occ[i][j][1],pt_occ[i][j][0]);\r\r
+ integrityProblem++;\r\r
+ }\r\r
+ }\r\r
+\r\r
+ }\r\r
+ }\r\r
+ }\r\r
+ }\r\r
+\r\r
+ if(integrityProblem == 0) cout << "No problem with data integrity found." << endl;\r\r
+ else cout << endl << "There were in total " << integrityProblem << " inconsistencies!" << endl;\r\r
+ }\r\r
+\r\r
+\r\r
+ cout << endl << "============ Statistics from RSTATE: ============" << endl;\r\r
+ cout<<"I : The majority entry is given as well as all other values," << endl;\r\r
+ cout<<" sorted according to their occurrence." << endl << endl;\r\r
+ GetMajoritys(caldcs);\r\r
+ \r\r
+\r\r
+ cout << endl << "============ Global Configuraton: ============" << endl;\r\r
+ cout<<"I : Numbers are -1 if not set and -2 if mixed," << endl;\r\r
+ cout<<" strings are empty if not set and 'mixed' if so." << endl << endl;\r\r
+ cout<<"Global number of time bins.........................: "<<caldcs->GetGlobalNumberOfTimeBins() << endl;\r\r
+ cout<<"Global configuration tag...........................: "<<caldcs->GetGlobalConfigTag() << endl;\r\r
+ cout<<"Global single hit threshold........................: "<<caldcs->GetGlobalSingleHitThres() << endl;\r\r
+ cout<<"Global three pad cluster threshold.................: "<<caldcs->GetGlobalThreePadClustThres()<<endl;\r\r
+ cout<<"Global selective ZS (every i'th event).............: "<<caldcs->GetGlobalSelectiveNoZS() << endl;\r\r
+ cout<<"Global tail cancellation filter weight.............: "<<caldcs->GetGlobalTCFilterWeight() << endl;\r\r
+ cout<<"Global tail cancellat. filter short decay parameter: "<<caldcs->GetGlobalTCFilterShortDecPar()<<endl;\r\r
+ cout<<"Global tail cancellation filt. long decay parameter: "<<caldcs->GetGlobalTCFilterLongDecPar()<<endl;\r\r
+ cout<<"Global fast statistics mode?.......................: "<<caldcs->GetGlobalModeFastStatNoise() << endl;\r\r
+ cout<<"Global configuration tag version...................: "<<caldcs->GetGlobalConfigVersion() << endl;\r\r
+ cout<<"Global configuration tag name......................: "<<caldcs->GetGlobalConfigName() << endl;\r\r
+ cout<<"Global filter type.................................: "<<caldcs->GetGlobalFilterType() << endl;\r\r
+ cout<<"Global readout parameter...........................: "<<caldcs->GetGlobalReadoutParam() << endl;\r\r
+ cout<<"Global test pattern................................: "<<caldcs->GetGlobalTestPattern() << endl;\r\r
+ cout<<"Global tracklet mode...............................: "<<caldcs->GetGlobalTrackletMode() << endl;\r\r
+ cout<<"Global tracklet definition.........................: "<<caldcs->GetGlobalTrackletDef() << endl;\r\r
+ cout<<"Global trigger setup...............................: "<<caldcs->GetGlobalTriggerSetup() << endl;\r\r
+ cout<<"Global additional options..........................: "<<caldcs->GetGlobalAddOptions() << endl;\r\r
+\r\r
+}\r\r