};
//_____________________________________________________________________________
-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
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
}
//_____________________________________________________________________________
-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();
gROOT->ForceStyle();
}
+//_____________________________________________________________________________
+Bool_t IsRunNum ( TString stringToken )
+{
+ return ( stringToken.IsDigit() && stringToken.Length()>=6 && stringToken.Length()<=9 );
+}
+
//_____________________________________________________________________________
void SetRunAxisRange ( TAxis* axis )
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;
}
array->SetOwner();
auxString = array->Last()->GetName();
auxString.ReplaceAll(".root","");
- runNum = auxString.Atoi();
+ if ( IsRunNum(auxString) ) runNum = auxString.Atoi();
delete array;
}
/// 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;
{
#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
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