]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGGA/EMCALTasks/macros/AddTaskEMCALIsoPhoton.C
including a parameter to set the trigger bit option
[u/mrichter/AliRoot.git] / PWGGA / EMCALTasks / macros / AddTaskEMCALIsoPhoton.C
1
2
3 AliAnalysisTaskEMCALIsoPhoton *AddTaskEMCALIsoPhoton(
4                                                      TString period = "LHC11d",
5                                                      TString trigbitname = "kEMC7"
6                                                      )
7 {
8   // Get the pointer to the existing analysis manager via the static access method.
9   //==============================================================================
10   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
11   if (!mgr) {
12     ::Error("AddTaskEMCALIsoPhoton", "No analysis manager to connect to.");
13     return NULL;
14   }  
15   
16   // Create the task and configure it.
17   //===========================================================================
18   AliAnalysisTaskEMCALIsoPhoton* ana = new  AliAnalysisTaskEMCALIsoPhoton("");
19   
20   ana->SelectCollisionCandidates( AliVEvent::kEMC1 | AliVEvent::kMB | AliVEvent::kEMC7 | AliVEvent::kINT7);
21   
22   Bool_t isMC = (mgr->GetMCtruthEventHandler() != NULL);
23
24   //ana->SetClusThreshold(clusTh);
25   
26   ana->SetTrainMode(kTRUE);
27   ana->SetTriggerBit(trigbitname);
28   // ana->SetMcMode(isMC);
29   
30   AliESDtrackCuts *cutsp = new AliESDtrackCuts;
31   cutsp->SetMinNClustersTPC(70);
32   cutsp->SetMinRatioCrossedRowsOverFindableClustersTPC(0.8);
33   cutsp->SetMaxChi2PerClusterTPC(4);
34   cutsp->SetRequireTPCRefit(kTRUE);
35   cutsp->SetAcceptKinkDaughters(kFALSE);
36   cutsp->SetMaxDCAToVertexZ(3.2);
37   cutsp->SetMaxDCAToVertexXY(2.4);
38   cutsp->SetDCAToVertex2D(kTRUE);
39   cutsp->SetPtRange(0.2);
40   cutsp->SetEtaRange(-1.0,1.0);
41   ana->SetPrimTrackCuts(cutsp);
42   ana->SetPeriod(period.Data());
43   if(period.Contains("11"))
44     ana->SetGeoName("EMCAL_COMPLETEV1");
45   else
46     ana->SetGeoName("EMCAL_FIRSTYEARV1");
47
48   
49   mgr->AddTask(ana);
50   
51   // Create ONLY the output containers for the data produced by the task.
52   // Get and connect other common input/output containers via the manager as below
53   //==============================================================================
54   AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("histosEMCALIsoPhoton", 
55                                                             TList::Class(),AliAnalysisManager::kOutputContainer,
56                                                             Form("%s", AliAnalysisManager::GetCommonFileName()));
57   
58   mgr->ConnectInput  (ana, 0, mgr->GetCommonInputContainer());
59   mgr->ConnectOutput (ana, 1, coutput1 );
60    
61   return ana;
62 }