#include "AliAnalysisManager.h"
#include "AliAnalysisTaskMuonQA.h"
#include "AliCounterCollection.h"
+#include "AliPhysicsSelection.h"
+#include "AliTriggerAnalysis.h"
// PWG includes
#include "AliAnalysisMuonUtility.h"
fTrackCounters->AddRubric("pt", "low/high/any");
fTrackCounters->AddRubric("acc", "in/out");
fTrackCounters->AddRubric("tagTrack", "beamGas/good");
+ fTrackCounters->AddRubric("t0pileup", "yes/no");
+ fTrackCounters->AddRubric("bgID", "yes/no");
+ fTrackCounters->AddRubric("spdpileup", "yes/no");
fTrackCounters->Init();
+
// initialize event counters
fEventCounters = new AliCounterCollection("eventCounters");
fEventCounters->AddRubric("selected", "yes/no");
fEventCounters->AddRubric("triggerRO", "good/bad");
fEventCounters->AddRubric("v0mult", "low/int/high/any");
+ fEventCounters->AddRubric("t0pileup", "yes/no");
+ fEventCounters->AddRubric("spdpileup", "yes/no");
+ fEventCounters->AddRubric("bgID", "yes/no");
fEventCounters->Init();
// Post data at least once per task to ensure data synchronisation (required for merging)
void AliAnalysisTaskMuonQA::UserExec(Option_t *)
{
/// Called for each event
-
+
AliESDEvent* fESD = dynamic_cast<AliESDEvent*>(InputEvent());
if (!fESD) {
Printf("ERROR: fESD not available");
return;
}
-
+
+ //Flag for T0Pileup, SPDPileup and bgID (SPD cluster vs tracket)
+ Bool_t t0PileUp = kFALSE, spdPileUp = kFALSE, bgID = kFALSE;
+ spdPileUp = fESD->IsPileupFromSPDInMultBins();
+ AliPhysicsSelection *physicsSelection = (AliPhysicsSelection*)((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->GetEventSelection();
+ AliTriggerAnalysis * triggerAnalysis = (AliTriggerAnalysis*)physicsSelection->GetTriggerAnalysis();
+ if ( physicsSelection && triggerAnalysis ) {
+ t0PileUp = triggerAnalysis->EvaluateTrigger(fESD, (AliTriggerAnalysis::Trigger) (AliTriggerAnalysis::kOfflineFlag | AliTriggerAnalysis::kT0Pileup));
+ bgID = triggerAnalysis->EvaluateTrigger(fESD, (AliTriggerAnalysis::Trigger) (AliTriggerAnalysis::kSPDClsVsTrkBG | AliTriggerAnalysis::kOfflineFlag));
+ }
+
UInt_t geomAccMask = ( AliMuonTrackCuts::kMuEta | AliMuonTrackCuts::kMuThetaAbs );
// check physics selection
UInt_t triggerWord = (fInputHandler) ? fInputHandler->IsEventSelected() : 0;
Bool_t isPhysicsSelected = (triggerWord != 0);
TString selected = isPhysicsSelected ? "selected:yes" : "selected:no";
+ selected += t0PileUp ? "/t0pileup:yes" : "/t0pileup:no";
+ selected += bgID ? "/bgID:yes" : "/bgID:no";
+ selected += spdPileUp ? "/spdpileup:yes" : "/spdpileup:no";
// fill muon trigger cases
for ( Int_t idx=0; idx<fMuonTrigIndex.GetSize(); idx++ ) {
TH1* hBNoPS[centBinMax][kNMaxTriggers];
TH1* hBWithPS[centBinMax][kNMaxTriggers];
+ TH1* hBWithPST0Flag[centBinMax][kNMaxTriggers];
+ TH1* hBWithPST0SPDFlag[centBinMax][kNMaxTriggers];
TH1* hB[centBinMax][kNMaxTriggers]={};
TH1* hTriggerB[centBinMax][kNMaxTriggers], *hTrackerB[centBinMax][kNMaxTriggers], *hMatchedB[centBinMax][kNMaxTriggers], *hAllTracksB[centBinMax][kNMaxTriggers], *hMatchedLowPtB[centBinMax][kNMaxTriggers], *hMatchedHighPtB[centBinMax][kNMaxTriggers];
TH1* hMatchedLowPtBNoPS[centBinMax][kNMaxTriggers], *hMatchedHighPtBNoPS[centBinMax][kNMaxTriggers];
histoName = histoNameBase;
histoName += "BWithPS";
hBWithPS[centBin][i] = (TH1*) ProcessHisto(eventCounters, "run", selection, histoName, "", "Trigger content w/ Phys. Sel.", colorInd->At(i));
+ // Histo trigger with Phys. Sel. and T0 pile up not flagged
+ selection = selectionCent; selection += Form("trigger:%s/%s/selected:yes/t0pileup:no", triggerName.Data(), selectRuns.Data());
+ histoName = histoNameBase;
+ histoName += "BWithPST0Flag";
+ hBWithPST0Flag[centBin][i] = (TH1*) ProcessHisto(eventCounters, "run", selection, histoName, "", "Trigger content w/ Phys. Sel. and no pile up from T0 flag", colorInd->At(i));
+ // Histo trigger with Phys. Sel. and T0 + SPD pile up not flagged
+ selection = selectionCent; selection += Form("trigger:%s/%s/selected:yes/t0pileup:no/spdpileup:no", triggerName.Data(), selectRuns.Data());
+ histoName = histoNameBase;
+ histoName += "BWithPST0SPDFlag";
+ hBWithPST0SPDFlag[centBin][i] = (TH1*) ProcessHisto(eventCounters, "run", selection, histoName, "", "Trigger content w/ Phys. Sel. and no pile up from T0 and SPD flag", colorInd->At(i));
// Histo trigger : Phys. Sel. is selected or not depending on the macro arguments
selection = selectionCent; selection += Form("trigger:%s/%s/%s", triggerName.Data(), selectRuns.Data(), select.Data());
histoName = histoNameBase;
Int_t NumOfBNoPS[centBinMax][kNMaxTriggers];
Int_t NumOfBWithPS[centBinMax][kNMaxTriggers];
+ Int_t NumOfBWithPST0Flag[centBinMax][kNMaxTriggers];
+ Int_t NumOfBWithPST0SPDFlag[centBinMax][kNMaxTriggers];
Int_t NumOfACNoPS[centBinMax][kNMaxTriggers];
Int_t NumOfENoPS[centBinMax][kNMaxTriggers];
Int_t NumOfACWithPS[centBinMax][kNMaxTriggers];
for(Int_t i = 0; i < triggersB->GetEntriesFast(); i++){
NumOfBNoPS[centBin][i] = hBNoPS[centBin][i]->Integral();
NumOfBWithPS[centBin][i] = hBWithPS[centBin][i]->Integral();
+ NumOfBWithPST0Flag[centBin][i] = hBWithPST0Flag[centBin][i]->Integral();
+ NumOfBWithPST0SPDFlag[centBin][i] = hBWithPST0Flag[centBin][i]->Integral();
NumOfACNoPS[centBin][i] = hACNoPS[centBin][i]->Integral();
NumOfENoPS[centBin][i] = hENoPS[centBin][i]->Integral();
NumOfACWithPS[centBin][i] = hACWithPS[centBin][i]->Integral();
cPhysSelCut->Write();
rootFileOut->cd();
+ cout<<"//==================================================================================="<<endl;
+ cout<<"// new canvas with effect from T0 pile-up flag for each trigger and background trigger "<<endl;
+ cout<<"//==================================================================================="<<endl;
+
+ TCanvas *cPhysSelCutT0Flag = 0x0;
+ cPhysSelCutT0Flag = ProcessCanvasPhysSelCut(triggersB, triggersAC, triggersE, hBWithPS[centBin], hACNoPS[centBin], hENoPS[centBin], hBWithPST0Flag[centBin], "PhysSelCutOnCollTriggerT0Flag", colorInd,isHeavyIon);
+ cPhysSelCutT0Flag->Draw();
+ cPhysSelCutT0Flag->Print(OutFileNamePDF.Data());
+ dirGlobal->cd();
+ cPhysSelCutT0Flag->Write();
+ rootFileOut->cd();
+
+
+ cout<<"//==================================================================================="<<endl;
+ cout<<"// new canvas with effect from T0 + SPD pile-up flag for each trigger and background trigger "<<endl;
+ cout<<"//==================================================================================="<<endl;
+
+ TCanvas *cPhysSelCutT0SPDFlag = 0x0;
+ cPhysSelCutT0SPDFlag = ProcessCanvasPhysSelCut(triggersB, triggersAC, triggersE, hBWithPS[centBin], hACNoPS[centBin], hENoPS[centBin], hBWithPST0SPDFlag[centBin], "PhysSelCutOnCollTriggerT0Flag", colorInd,isHeavyIon);
+ cPhysSelCutT0SPDFlag->Draw();
+ cPhysSelCutT0SPDFlag->Print(OutFileNamePDF.Data());
+ dirGlobal->cd();
+ cPhysSelCutT0SPDFlag->Write();
+ rootFileOut->cd();
+
+
+
cout<<"//==================================================================================="<<endl;
cout<<"// new canvas with effect from physics selection for each trigger and centrality bin (only in PbPb) "<<endl;
cout<<"//==================================================================================="<<endl;
}
}
-
- //return;
-
+ //temporary
+ // return;
+
//--------------------------------------------- //
// monitor quantities run per run //
isAlienFile = 1;
alienBaseDir.ReplaceAll("alien://","");
}
+
cout<<"============================================================"<<endl;
cout<< "Monitoring quantities run per run: loop over "<<runs->GetEntriesFast()<<" runs."<<endl;
cout<<" directory = "<<alienBaseDir.Data()<<endl;