Implementing processing of QA thresholds from DQM FXS.
authorzampolli <zampolli@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 21 Feb 2012 17:09:03 +0000 (17:09 +0000)
committerzampolli <zampolli@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 21 Feb 2012 17:09:03 +0000 (17:09 +0000)
The new OCDB entry will be in /GRP/Calib/QAThresholds.
In case of any problem with any detector, no action will be taken (the detector will be skipped).
The loop is done over all the detectors, since there is no way to check which detector had its agent(s) running.

19 files changed:
GRP/ShuttleInput/run168322_ACO_DQM_QAThreshold.root [new file with mode: 0644]
GRP/ShuttleInput/run168322_EMC_DQM_QAThreshold.root [new file with mode: 0644]
GRP/ShuttleInput/run168322_FMD_DQM_QAThreshold.root [new file with mode: 0644]
GRP/ShuttleInput/run168322_HMP_DQM_QAThreshold.root [new file with mode: 0644]
GRP/ShuttleInput/run168322_MCH_DQM_QAThreshold.root [new file with mode: 0644]
GRP/ShuttleInput/run168322_MTR_DQM_QAThreshold.root [new file with mode: 0644]
GRP/ShuttleInput/run168322_PHS_DQM_QAThreshold.root [new file with mode: 0644]
GRP/ShuttleInput/run168322_PMD_DQM_QAThreshold.root [new file with mode: 0644]
GRP/ShuttleInput/run168322_SDD_DQM_QAThreshold.root [new file with mode: 0644]
GRP/ShuttleInput/run168322_SPD_DQM_QAThreshold.root [new file with mode: 0644]
GRP/ShuttleInput/run168322_SSD_DQM_QAThreshold.root [new file with mode: 0644]
GRP/ShuttleInput/run168322_T00_DQM_QAThreshold.root [new file with mode: 0644]
GRP/ShuttleInput/run168322_TOF_DQM_QAThreshold.root [new file with mode: 0644]
GRP/ShuttleInput/run168322_TPC_DQM_QAThreshold.root [new file with mode: 0644]
GRP/ShuttleInput/run168322_TRD_DQM_QAThreshold.root [new file with mode: 0644]
GRP/ShuttleInput/run168322_V00_DQM_QAThreshold.root [new file with mode: 0644]
GRP/ShuttleInput/run168322_ZDC_DQM_QAThreshold.root [new file with mode: 0644]
GRP/TestGRPPreprocessor.C
STEER/STEER/AliGRPPreprocessor.cxx

diff --git a/GRP/ShuttleInput/run168322_ACO_DQM_QAThreshold.root b/GRP/ShuttleInput/run168322_ACO_DQM_QAThreshold.root
new file mode 100644 (file)
index 0000000..78f25f9
Binary files /dev/null and b/GRP/ShuttleInput/run168322_ACO_DQM_QAThreshold.root differ
diff --git a/GRP/ShuttleInput/run168322_EMC_DQM_QAThreshold.root b/GRP/ShuttleInput/run168322_EMC_DQM_QAThreshold.root
new file mode 100644 (file)
index 0000000..54ab1a7
Binary files /dev/null and b/GRP/ShuttleInput/run168322_EMC_DQM_QAThreshold.root differ
diff --git a/GRP/ShuttleInput/run168322_FMD_DQM_QAThreshold.root b/GRP/ShuttleInput/run168322_FMD_DQM_QAThreshold.root
new file mode 100644 (file)
index 0000000..4a553b1
Binary files /dev/null and b/GRP/ShuttleInput/run168322_FMD_DQM_QAThreshold.root differ
diff --git a/GRP/ShuttleInput/run168322_HMP_DQM_QAThreshold.root b/GRP/ShuttleInput/run168322_HMP_DQM_QAThreshold.root
new file mode 100644 (file)
index 0000000..cfc68f6
Binary files /dev/null and b/GRP/ShuttleInput/run168322_HMP_DQM_QAThreshold.root differ
diff --git a/GRP/ShuttleInput/run168322_MCH_DQM_QAThreshold.root b/GRP/ShuttleInput/run168322_MCH_DQM_QAThreshold.root
new file mode 100644 (file)
index 0000000..f6a7335
Binary files /dev/null and b/GRP/ShuttleInput/run168322_MCH_DQM_QAThreshold.root differ
diff --git a/GRP/ShuttleInput/run168322_MTR_DQM_QAThreshold.root b/GRP/ShuttleInput/run168322_MTR_DQM_QAThreshold.root
new file mode 100644 (file)
index 0000000..6fd7ffa
Binary files /dev/null and b/GRP/ShuttleInput/run168322_MTR_DQM_QAThreshold.root differ
diff --git a/GRP/ShuttleInput/run168322_PHS_DQM_QAThreshold.root b/GRP/ShuttleInput/run168322_PHS_DQM_QAThreshold.root
new file mode 100644 (file)
index 0000000..c51ebc6
Binary files /dev/null and b/GRP/ShuttleInput/run168322_PHS_DQM_QAThreshold.root differ
diff --git a/GRP/ShuttleInput/run168322_PMD_DQM_QAThreshold.root b/GRP/ShuttleInput/run168322_PMD_DQM_QAThreshold.root
new file mode 100644 (file)
index 0000000..f033eaf
Binary files /dev/null and b/GRP/ShuttleInput/run168322_PMD_DQM_QAThreshold.root differ
diff --git a/GRP/ShuttleInput/run168322_SDD_DQM_QAThreshold.root b/GRP/ShuttleInput/run168322_SDD_DQM_QAThreshold.root
new file mode 100644 (file)
index 0000000..b1c372d
Binary files /dev/null and b/GRP/ShuttleInput/run168322_SDD_DQM_QAThreshold.root differ
diff --git a/GRP/ShuttleInput/run168322_SPD_DQM_QAThreshold.root b/GRP/ShuttleInput/run168322_SPD_DQM_QAThreshold.root
new file mode 100644 (file)
index 0000000..79419d4
Binary files /dev/null and b/GRP/ShuttleInput/run168322_SPD_DQM_QAThreshold.root differ
diff --git a/GRP/ShuttleInput/run168322_SSD_DQM_QAThreshold.root b/GRP/ShuttleInput/run168322_SSD_DQM_QAThreshold.root
new file mode 100644 (file)
index 0000000..682a871
Binary files /dev/null and b/GRP/ShuttleInput/run168322_SSD_DQM_QAThreshold.root differ
diff --git a/GRP/ShuttleInput/run168322_T00_DQM_QAThreshold.root b/GRP/ShuttleInput/run168322_T00_DQM_QAThreshold.root
new file mode 100644 (file)
index 0000000..403531f
Binary files /dev/null and b/GRP/ShuttleInput/run168322_T00_DQM_QAThreshold.root differ
diff --git a/GRP/ShuttleInput/run168322_TOF_DQM_QAThreshold.root b/GRP/ShuttleInput/run168322_TOF_DQM_QAThreshold.root
new file mode 100644 (file)
index 0000000..82fc8bb
Binary files /dev/null and b/GRP/ShuttleInput/run168322_TOF_DQM_QAThreshold.root differ
diff --git a/GRP/ShuttleInput/run168322_TPC_DQM_QAThreshold.root b/GRP/ShuttleInput/run168322_TPC_DQM_QAThreshold.root
new file mode 100644 (file)
index 0000000..da968c0
Binary files /dev/null and b/GRP/ShuttleInput/run168322_TPC_DQM_QAThreshold.root differ
diff --git a/GRP/ShuttleInput/run168322_TRD_DQM_QAThreshold.root b/GRP/ShuttleInput/run168322_TRD_DQM_QAThreshold.root
new file mode 100644 (file)
index 0000000..513e527
Binary files /dev/null and b/GRP/ShuttleInput/run168322_TRD_DQM_QAThreshold.root differ
diff --git a/GRP/ShuttleInput/run168322_V00_DQM_QAThreshold.root b/GRP/ShuttleInput/run168322_V00_DQM_QAThreshold.root
new file mode 100644 (file)
index 0000000..a31aa1c
Binary files /dev/null and b/GRP/ShuttleInput/run168322_V00_DQM_QAThreshold.root differ
diff --git a/GRP/ShuttleInput/run168322_ZDC_DQM_QAThreshold.root b/GRP/ShuttleInput/run168322_ZDC_DQM_QAThreshold.root
new file mode 100644 (file)
index 0000000..96c3476
Binary files /dev/null and b/GRP/ShuttleInput/run168322_ZDC_DQM_QAThreshold.root differ
index ab384a5..591e057 100644 (file)
@@ -82,6 +82,9 @@ void TestGRPPreprocessor(const char* runtype="PHYSICS", TString partition="ALICE
          shuttle->AddInputFile(AliShuttleInterface::kDAQ, "GRP", "Period_LHC09c_TPC.Seq_0.tag.root", "GDC45", "$ALICE_ROOT/GRP/ShuttleInput/run000080740_GRP_gdc-aldaqpc045_Period_LHC09c.Seq_0.tag.root");
          shuttle->AddInputFile(AliShuttleInterface::kDAQ, "SPD", "VertexDiamond", "gdc-GLOBAL-01", "$ALICE_ROOT/GRP/ShuttleInput/run000104892_SPD_mon-DA-SPD-0_VertexDiamond");
          shuttle->AddInputFile(AliShuttleInterface::kDCS, "GRP", "LHCData", "", "$ALICE_ROOT/GRP/ShuttleInput/testRun_GRP_run_number_testRun_data.txt");
+         shuttle->AddInputFile(AliShuttleInterface::kDQM, "GRP", "TriggerClassesAndHistosToClone", "DQM", "$ALICE_ROOT/GRP/ShuttleInput/run000158496_GRP_DQM_TriggerClassesAndHistosToClone");
+         shuttle->AddInputFile(AliShuttleInterface::kDQM, "ACO", "QAThresholds", "DQM", "$ALICE_ROOT/GRP/ShuttleInput/run168322_ACO_DQM_QAThreshold.root");
+         shuttle->AddInputFile(AliShuttleInterface::kDQM, "TPC", "QAThresholds", "DQM", "$ALICE_ROOT/GRP/ShuttleInput/run168322_ACO_DQM_QAThreshold.root");
           
          /*
          // for example:
index c399c6e..81b6126 100644 (file)
@@ -53,6 +53,7 @@
 #include "AliDCSArray.h"
 #include "AliDAQ.h"
 #include "AliLTUConfig.h"
+#include "AliQAThresholds.h"
 
 class AliLog;
 class AliDCSValue;
@@ -1335,8 +1336,10 @@ UInt_t AliGRPPreprocessor::ProcessDqmFxs()
        // Processing DQM fxs information
        //
 
+       // TriggerClassesAndHistosToClone
        TList* list = GetFileSources(kDQM, "TriggerClassesAndHistosToClone");
        Bool_t storeResult = kTRUE;
+       Bool_t storeResultQAThr = kTRUE;
        if (list !=0x0 && list->GetEntries()!=0){
                AliInfo("The following sources produced files with the id TriggerClassesAndHistosToClone for GRP");
                list->Print();
@@ -1369,7 +1372,86 @@ UInt_t AliGRPPreprocessor::ProcessDqmFxs()
        }
        
        if (list) delete list;
-       
+
+       // QAThresholds
+       TObjArray* qaThrArray = new TObjArray();
+       for (Int_t idet = 0; idet < AliDAQ::kNDetectors; idet++){
+               TString detName = AliDAQ::OnlineName(idet);
+               if (detName == "TRI" || detName == "HLT" || detName == "TST") continue;   // skipping TRI, HLT, TST since they do not produce QAThresholds
+               AliDebug(2, Form("Processing QAThreshold for detector %s",detName.Data())); 
+               TList* listQAThr = GetForeignFileSources(detName.Data(), kDQM, "QAThresholds");
+               if (listQAThr !=0x0){
+                       if (listQAThr->GetEntries() > 1){
+                               AliError(Form("More than one sources found for QAThresholds from detector %s, skipping",detName.Data()));
+                               continue;
+                       }
+                       else if (listQAThr->GetEntries()==1){
+                               AliInfo(Form("The following source produced files with the id QAThresholds for GRP, coming from detector %s:",detName.Data()));
+                               listQAThr->Print();
+                               TObjString * str = dynamic_cast<TObjString*> (listQAThr->At(0)); 
+                               if (!str){
+                                       AliError(Form("Expecting a TObjString in the list for detector %s, but something else was found.",detName.Data()));
+                                       delete listQAThr;
+                                       continue;
+                               }
+                               AliInfo(Form("found source %s", str->String().Data()));
+                               TString fileNameRun = GetForeignFile(detName.Data(), kDQM, "QAThresholds", str->GetName());
+                               if (fileNameRun.Length()>0){
+                                       AliInfo(Form("Got the file %s", fileNameRun.Data()));
+                                       TFile dqmFile(fileNameRun.Data(),"READ");
+                                       if (dqmFile.IsOpen()) {
+                                               AliQAThresholds* qaThr = dynamic_cast<AliQAThresholds*>(dqmFile.Get("AliQAThresholds"));
+                                               if (qaThr){
+                                                       Int_t qaThrId = qaThr->GetDetectorId();
+                                                       if (qaThrId != idet){
+                                                               AliError(Form("Expecting QA threshold for detector %s, but found that for detector %s, skipping",detName.Data(), AliDAQ::OnlineName(qaThrId)));
+                                                               delete listQAThr;
+                                                               continue;
+                                                       }
+                                                       else{
+                                                               qaThrArray->AddAtAndExpand(qaThr, qaThrId);
+                                                               delete listQAThr;
+                                                       }
+                                               }
+                                               else {
+                                                       AliError(Form("No QAThresholds object found in the file for detector %s, skipping",detName.Data()));
+                                                       delete listQAThr;
+                                                       continue;
+                                               }
+                                       }                             
+                                       else {
+                                               AliError(Form("Can't open QAThreshold file for detector %s, skipping",detName.Data()));
+                                               delete listQAThr;
+                                               continue;                                       
+                                       }
+                               }
+                               else{
+                                       AliWarning(Form("No file found for DQM QAThreshold for detector %s, skipping",detName.Data()));
+                                       delete listQAThr;
+                                       continue;
+                               }
+                       }
+                       else {
+                               AliError(Form("No sources found for QAThresholds from detector %s, skipping",detName.Data()));
+                               delete listQAThr;
+                               continue;
+                       }
+               }
+               else {
+                       AliWarning(Form("No list found for DQM QAThreshold for detector %s, skipping",detName.Data()));
+                       continue;
+               }
+       }
+       if (qaThrArray->GetEntries() > 0){
+               AliCDBMetaData md;
+               md.SetResponsible("Barthélémy von Haller");
+               md.SetComment("QA Threshold TObjArray");                                        
+               storeResultQAThr = Store("Calib", "QAThresholds", qaThrArray, &md, 0, kTRUE); 
+       }
+       else{
+               Printf("No valid QAThresholds entries found, storing nothing in the OCDB");
+       }
+
        //      return storeResult;
        return kTRUE;  // temporary!!
 }