]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGGA/EMCALTasks/macros/AddTaskEMCALIsoPhoton.C
cov fix + some extra features on matrices import
[u/mrichter/AliRoot.git] / PWGGA / EMCALTasks / macros / AddTaskEMCALIsoPhoton.C
1
2
3 AliAnalysisTaskEMCALIsoPhoton *AddTaskEMCALIsoPhoton(
4                                                      TString period = "LHC11d",
5                                                      TString trigbitname = "kEMC7",
6                                                      TString pathstrsel = "/"
7                                                      )
8 {
9   // Get the pointer to the existing analysis manager via the static access method.
10   //==============================================================================
11   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
12   if (!mgr) {
13     ::Error("AddTaskEMCALIsoPhoton", "No analysis manager to connect to.");
14     return NULL;
15   }  
16   
17   // Create the task and configure it.
18   //===========================================================================
19   AliAnalysisTaskEMCALIsoPhoton* ana = new  AliAnalysisTaskEMCALIsoPhoton("");
20   
21   Bool_t isMC = (mgr->GetMCtruthEventHandler() != NULL);
22
23   if(!isMC)
24     ana->SelectCollisionCandidates( AliVEvent::kEMC1 | AliVEvent::kMB | AliVEvent::kEMC7 | AliVEvent::kINT7);
25   
26   //ana->SetClusThreshold(clusTh);
27   
28   ana->SetTrainMode(kTRUE);
29   ana->SetTriggerBit(trigbitname);
30   ana->SetMcMode(isMC);
31   ana->SetPathStringSelect(pathstrsel.Data());
32   AliESDtrackCuts *cutsp = new AliESDtrackCuts;
33   cutsp->SetMinNClustersTPC(70);
34   cutsp->SetMinRatioCrossedRowsOverFindableClustersTPC(0.8);
35   cutsp->SetMaxChi2PerClusterTPC(4);
36   cutsp->SetRequireTPCRefit(kTRUE);
37   cutsp->SetAcceptKinkDaughters(kFALSE);
38   cutsp->SetMaxDCAToVertexZ(3.2);
39   cutsp->SetMaxDCAToVertexXY(2.4);
40   cutsp->SetDCAToVertex2D(kTRUE);
41   cutsp->SetPtRange(0.2);
42   cutsp->SetEtaRange(-1.0,1.0);
43   ana->SetPrimTrackCuts(cutsp);
44   ana->SetPeriod(period.Data());
45   if(period.Contains("11")){
46     ana->SetGeoName("EMCAL_COMPLETEV1");
47     //ana->SetImportGeometryFromFile(kTRUE,"$ALICE_ROOT/OADB/EMCAL/geometry_2011.root");
48   }
49   else{
50     if(period.Contains("12")){
51       if(isMC){
52         ana->SetGeoName("EMCAL_COMPLETEV1");
53         //ana->SetImportGeometryFromFile(kTRUE,"$ALICE_ROOT/OADB/EMCAL/geometry_2011.root");
54       }
55       else{
56         ana->SetGeoName("EMCAL_COMPLETE12SMV1");
57         //ana->SetImportGeometryFromFile(kTRUE,"$ALICE_ROOT/OADB/EMCAL/geometry_2012.root");
58       }
59     }
60     else{
61     ana->SetGeoName("EMCAL_FIRSTYEARV1");
62     //ana->SetImportGeometryFromFile(kTRUE,"$ALICE_ROOT/OADB/EMCAL/geometry_2010.root");
63     }
64   }
65   
66   mgr->AddTask(ana);
67   TString containername = "histosEMCALIsoPhoton";
68   if(pathstrsel != "/"){
69     TString dirpth = (TSubString)pathstrsel.operator()(1,1);
70     containername += dirpth;
71   }
72   
73   // Create ONLY the output containers for the data produced by the task.
74   // Get and connect other common input/output containers via the manager as below
75   //==============================================================================
76   AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(containername.Data(), 
77                                                             TList::Class(),AliAnalysisManager::kOutputContainer,
78                                                             Form("%s", AliAnalysisManager::GetCommonFileName()));
79   
80   mgr->ConnectInput  (ana, 0, mgr->GetCommonInputContainer());
81   mgr->ConnectOutput (ana, 1, coutput1 );
82    
83   return ana;
84 }