]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Do not ask for physics selection in MC QA trending
authordstocco <diego.stocco@cern.ch>
Sun, 16 Nov 2014 18:34:04 +0000 (19:34 +0100)
committerlaphecet <laurent.aphecetche@subatech.in2p3.fr>
Mon, 17 Nov 2014 17:14:17 +0000 (18:14 +0100)
PWGPP/MUON/lite/MakeTrend.C
PWGPP/MUON/lite/trigEffQA.C
PWGPP/QA/detectorQAscripts/MU.sh

index cf5df7d3bad944442ce84c33d22bb1f230287c1f..9d29a1f00c4fcde6bfc0a68f29f31ff078a65d2c 100644 (file)
@@ -64,7 +64,7 @@ enum {
 };
 
 //_____________________________________________________________________________
-void terminateQA ( TString outfilename = "QAresults.root", UInt_t force = 0, UInt_t mask = (trackQA|trigQA) )
+void terminateQA ( TString outfilename = "QAresults.root", Bool_t isMC = kFALSE, UInt_t force = 0, UInt_t mask = (trackQA|trigQA) )
 {
   //
   // Load common libraries
@@ -104,12 +104,15 @@ void terminateQA ( TString outfilename = "QAresults.root", UInt_t force = 0, UIn
 
   if ( mask & trigQA ) {
     gROOT->LoadMacro("$ALICE_ROOT/PWGPP/macros/AddTaskMTRchamberEfficiency.C");
-    AliAnalysisTaskTrigChEff* trigChEffTask = AddTaskMTRchamberEfficiency(kFALSE);
-    trigChEffTask->SetTerminateOptions("PhysSelPass","ANY","-5_105",Form("FORCEBATCH %s?PhysSelPass?ANY?-5_105?NoSelMatchAptFromTrg",trigOutName));
+    AliAnalysisTaskTrigChEff* trigChEffTask = AddTaskMTRchamberEfficiency(isMC);
+    TString physSelName = "PhysSelPass";
+    if ( isMC ) physSelName += ",PhysSelReject";
+    trigChEffTask->SetTerminateOptions(physSelName,"ANY","-5_105",Form("FORCEBATCH NoSelMatchApt FromTrg %s?%s?ANY?-5_105?NoSelMatchAptFromTrg",trigOutName.Data(),physSelName.Data()));
   }
   if ( mask & trackQA ) {
     gROOT->LoadMacro("$ALICE_ROOT/PWGPP/PilotTrain/AddTaskMuonQA.C");
-    AliAnalysisTaskMuonQA* muonQATask = AddTaskMuonQA();
+    Bool_t selectPhysics = ( isMC ) ? kFALSE : kTRUE;
+    AliAnalysisTaskMuonQA* muonQATask = AddTaskMuonQA(selectPhysics);
   }
 
 #endif
@@ -298,14 +301,14 @@ void AddTrigVars ( TString filename, TList &parList )
 }
 
 //_____________________________________________________________________________
-void MakeTrend ( const char* qaFile, Int_t runNumber, UInt_t force = trigQA, UInt_t mask = (trackQA|trigQA) )
+void MakeTrend ( const char* qaFile, Int_t runNumber, Bool_t isMC = kFALSE, UInt_t force = trigQA, UInt_t mask = (trackQA|trigQA) )
 {
   Bool_t isOk = GetQAInfo(qaFile);
   if ( ! isOk ) return;
 
   TString inFilename = GetBaseName(qaFile);
 
-  terminateQA(inFilename,force,mask);
+  terminateQA(inFilename,isMC,force,mask);
 
   TList parList;
   parList.SetOwner();
index 0d51e68eeb21f72452505ececa73097cbf97c235..45eca37bc8de181f7b499141f6178be15a368dab 100644 (file)
@@ -67,6 +67,12 @@ void SetMyStyle()
   gROOT->ForceStyle();
 }
 
+//_____________________________________________________________________________
+Bool_t IsRunNum ( TString stringToken )
+{
+  return ( stringToken.IsDigit() && stringToken.Length()>=6 && stringToken.Length()<=9 );
+}
+
 
 //_____________________________________________________________________________
 void SetRunAxisRange ( TAxis* axis )
@@ -90,7 +96,7 @@ Int_t GetRunNumber(TString filePath)
   Int_t runNum = -1;
   for ( Int_t ientry=0; ientry<array->GetEntries(); ientry++ ) {
     auxString = array->At(ientry)->GetName();
-    if ( auxString.IsDigit() && auxString.Length()>=6 && auxString.Length()<=9 ) {
+    if ( IsRunNum(auxString) ) {
       runNum = auxString.Atoi();
       break;
     }
@@ -102,7 +108,7 @@ Int_t GetRunNumber(TString filePath)
     array->SetOwner();
     auxString = array->Last()->GetName();
     auxString.ReplaceAll(".root","");
-    runNum = auxString.Atoi();
+    if ( IsRunNum(auxString) ) runNum = auxString.Atoi();
     delete array;
   }
   
@@ -118,17 +124,29 @@ Bool_t ChangeFilenames ( TObjArray &fileNameArray )
   /// it is not that good for QA since we are dependent on the tracker status.
   /// In recent versions, the task also calculates the efficiency from all trigger tracks
   /// (including ghosts). Analyse this output instead.
+  TString newBaseName = "trigChEff_ANY_Apt_allTrig.root";
   for ( Int_t ifile=0; ifile<fileNameArray.GetEntries(); ifile++ ) {
     TObjString* currObjString = static_cast<TObjString*>(fileNameArray.At(ifile));
     TString currFile = currObjString->GetString();
-    TString dirName = gSystem->DirName(currFile.Data());
-    TString fileName = gSystem->BaseName(currFile.Data());
-    Int_t runNum = GetRunNumber(fileName);
-    TString newFilename = Form("%s/terminateRuns/%i/trigChEff_ANY_Apt_allTrig.root",dirName.Data(),runNum);
+    TString baseName = gSystem->BaseName(currFile.Data());
+    // In the old scripts, the run number is in the QA filename
+    Int_t runNum = GetRunNumber(baseName);
+    TString newFilename = "";
+    if ( runNum < 0 ) {
+      // New central script: the re-created trigger output is in the same directory
+      newFilename = currFile;
+      newFilename.ReplaceAll(baseName.Data(),newBaseName.Data());
+    }
+    else {
+      // Old script. The re-creaated trigger output is in terminateRuns
+      TString dirName = gSystem->DirName(currFile.Data());
+      newFilename = Form("%s/terminateRuns/%i/%s",dirName.Data(),runNum,newBaseName.Data());
+    }
     if ( gSystem->AccessPathName(newFilename.Data()) ) {
       printf("New output not found. Use the standard efficiency instead\n");
       return kFALSE;
     }
+    else printf("Using re-built output in %s\n",newBaseName.Data());
     currObjString->SetString(newFilename);
   }
   return kTRUE;
index 4a7a69c494b0541c05a133118536812d7761c033..9ec8a61aff220c28110664620cd984093df5a88c 100755 (executable)
@@ -10,13 +10,17 @@ runLevelQA()
 {
   #full path of QAresults.root is provided
   local qaFile=$1
+  local isMC=0
+  if [ "$dataType" = "sim" ]; then
+    isMC=1
+  fi
 
   # This is used only to extract the muon information
   ln -s $ALICE_ROOT/PWGPP/MUON/lite/LoadLibsForMuonQA.C
   ln -s $ALICE_ROOT/PWGPP/MUON/lite/MakeTrend.C
   aliroot -b -l <<EOF
 .x LoadLibsForMuonQA.C+("maketrend")
-.x MakeTrend.C("${qaFile}",${runNumber})
+.x MakeTrend.C("${qaFile}",${runNumber},$isMC)
 .q
 EOF
   rm LoadLibsForMuonQA.C
@@ -91,10 +95,15 @@ periodLevelQA()
     fi
   done
 
+  local usePhysicsSelection=1
+  if [ "$dataType" = "sim" ]; then
+    usePhysicsSelection=0
+  fi
+
   ln -s $ALICE_ROOT/PWGPP/MUON/lite/PlotMuonQA.C
 aliroot -b <<EOF
 .x LoadLibsForMuonQA.C+("tracktrend");
-.x PlotMuonQA.C+(".","${fileList}",${triggerList},kTRUE,"muon_tracker","${mergedQAname}");
+.x PlotMuonQA.C+(".","${fileList}",${triggerList},${usePhysicsSelection},"muon_tracker","${mergedQAname}");
 .q
 EOF
   rm PlotMuonQA.C