committing on behalf of Silvia... new macros for HFE analysis on the train (Markus
[u/mrichter/AliRoot.git] / PWG3 / hfe / macros / ConfigHFEtest.C
CommitLineData
d3338371 1AliAnalysisTaskHFE *ConfigHFEtest(Bool_t useMC){
2 //
3 // HFE standard task configuration
4 //
5
6 AliHFEcuts *hfecuts = new AliHFEcuts("hfeCutsTest","HFE Standard Cuts with slight variation");
7 hfecuts->CreateStandardCuts();
8 hfecuts->SetMinNClustersTPC(100);
9 hfecuts->SetCutITSpixel(AliHFEextraCuts::kFirst);
10 hfecuts->SetCheckITSLayerStatus(kFALSE);
11 hfecuts->SetSigmaToVertex(10);
12 hfecuts->SetQAOn();
13 //hfecuts->SetMinNTrackletsTRD(5);
14
15 AliAnalysisTaskHFE *task = new AliAnalysisTaskHFE("HFEanalysis1");
16 task->SetHFECuts(hfecuts);
17
18 // Define Variables
19 AliHFEvarManager *vm = task->GetVarManager();
20 vm->AddVariable("pt");
21 vm->AddVariable("eta");
22 vm->AddVariable("phi");
23 vm->AddVariable("charge");
24 vm->AddVariable("source");
25
26 if(!useMC){
27 TF1 *hBackground = new TF1("hadronicBackgroundFunction", "[0]+[1]*TMath::Erf([2]*x+[3])", 0, 20);
28 hBackground->SetParameter(0, 8.19639e-02);
29 hBackground->SetParameter(1, 7.66857e-02);
30 hBackground->SetParameter(2, 8.74797e-01);
31 hBackground->SetParameter(3, -2.69972e+00);
32
33 task->SetBackGroundFactorsFunction(hBackground);
34 }
35
36 // Define PID
37 AliHFEpid *pid = task->GetPID();
38 if(useMC) pid->SetHasMCData(kTRUE);
39 pid->AddDetector("TOF", 0);
40 pid->AddDetector("TPC", 1);
41 pid->ConfigureTPCrejection();
42
43 // QA
44 task->SetQAOn(AliAnalysisTaskHFE::kPIDqa);
45 task->SetQAOn(AliAnalysisTaskHFE::kMCqa);
46 task->SwitchOnPlugin(AliAnalysisTaskHFE::kIsElecBackGround);
47 task->SwitchOnPlugin(AliAnalysisTaskHFE::kSecVtx);
48
49 printf("*************************************\n");
50 printf("Configuring standard Task:\n");
51 task->Print();
52 pid->PrintStatus();
53 printf("*************************************\n");
54 return task;
55}