]>
Commit | Line | Data |
---|---|---|
c84dbedf | 1 | //DEFINITION OF A FEW CONSTANTS |
2 | //---------------------------------------------------- | |
3 | ||
4 | /* $Id$ */ | |
5 | ||
6 | AliAnalysisTaskDStarCorrelations *AddTaskDStarCorrelations(Bool_t runOnPbPb,Bool_t theMCon, Bool_t mixing, Int_t trackselect =1, Int_t usedispl =0, TString DCutObjName = "DStartoKpipiCuts_corr.root", TString TrackCutObjNamePrefix = "") | |
7 | { | |
8 | ||
9 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
10 | if (!mgr) { | |
11 | ::Error(" AliAnalysisTaskDStarCorrelations", "No analysis manager to connect to."); | |
12 | return NULL; | |
13 | } | |
14 | ||
15 | TFile* filecuts=new TFile(DCutObjName.Data()); | |
16 | if(!filecuts->IsOpen()){ | |
17 | cout<<"Input file not found: exit"<<endl; | |
18 | return; | |
19 | } | |
20 | ||
21 | TString TrackCutObjName = "AssocPartCuts"; | |
22 | TrackCutObjName += TrackCutObjNamePrefix; | |
23 | TrackCutObjName += ".root"; | |
24 | ||
25 | TFile* filecuts2=new TFile(TrackCutObjName.Data()); | |
26 | if(!filecuts2->IsOpen()){ | |
27 | cout<<"Input file2 not found: exit"<<endl; | |
28 | return; | |
29 | } | |
30 | ||
31 | AliRDHFCutsDStartoKpipi* RDHFDStartoKpipi=new AliRDHFCutsDStartoKpipi(); | |
32 | RDHFDStartoKpipi = (AliRDHFCutsDStartoKpipi*)filecuts->Get("DStartoKpipiCuts"); | |
33 | RDHFDStartoKpipi->SetName("DStartoKpipiCuts"); | |
34 | ||
35 | ||
36 | AliHFAssociatedTrackCuts* corrCuts=new AliHFAssociatedTrackCuts(); | |
37 | corrCuts = (AliHFAssociatedTrackCuts*)filecuts2->Get("AssociatedCuts"); | |
38 | corrCuts->SetName("AssociatedCuts"); | |
39 | corrCuts->PrintAll(); | |
40 | ||
41 | // mm let's see if everything is ok | |
42 | if(!RDHFDStartoKpipi){ | |
43 | cout<<"Specific AliRDHFCuts not found"<<endl; | |
44 | return; | |
45 | } | |
46 | ||
47 | //CREATE THE TASK | |
48 | printf("CREATE TASK \n"); | |
49 | // create the task | |
50 | AliAnalysisTaskDStarCorrelations *task = new AliAnalysisTaskDStarCorrelations(" AliAnalysisTaskDStarCorrelations",RDHFDStartoKpipi,corrCuts); | |
51 | ||
52 | // Setters | |
53 | ||
54 | task->SetMonteCarlo(theMCon); | |
55 | task->SetUseMixing(mixing); | |
56 | task->SetCorrelator(trackselect) ; | |
57 | task->SetUseDisplacement(usedispl); | |
58 | task->SetRunPbPb(runOnPbPb); | |
59 | //task->SetDebugLevel(0); | |
60 | ||
61 | ||
62 | if(trackselect == 1) Info(" AliAnalysisTaskDStarCorrelations","Correlating D* with charged hadrons \n"); | |
63 | else if(trackselect == 2) Info(" AliAnalysisTaskDStarCorrelations","Correlating D* with charged kaons \n"); | |
64 | else if(trackselect == 3) Info(" AliAnalysisTaskDStarCorrelations","Correlating D* with reconstructed K0s \n"); | |
65 | else Fatal(" AliAnalysisTaskDStarCorrelations","Nothing to correlate with!"); | |
66 | if(mixing) Info (" AliAnalysisTaskDStarCorrelations","Event Mixing Analysis\n"); | |
67 | if(!mixing) Info (" AliAnalysisTaskDStarCorrelations","Single Event Analysis \n"); | |
68 | ||
69 | // Create and connect containers for input/output | |
70 | //TString dcavalue = " "; | |
71 | if(!theMCon) TString contname = "Data"; | |
72 | if(theMCon) TString contname = "MonteCarlo"; | |
73 | if(trackselect ==1) TString particle = "Hadron"; | |
74 | if(trackselect ==2) TString particle = "Kaon"; | |
75 | if(trackselect ==3) TString particle = "KZero"; | |
76 | ||
77 | TString cutname = "cuts" ; | |
78 | TString cutname2 = "hadroncuts" ; | |
79 | TString outputfile = AliAnalysisManager::GetCommonFileName(); | |
80 | TString counter = "NormCounter"; | |
81 | outputfile += ":PWGHF_D2H_"; | |
82 | if(!mixing) { | |
83 | outputfile += "SE"; | |
84 | contname += "SE"; | |
85 | cutname += "SE"; | |
86 | cutname2 += "SE"; | |
87 | counter+= "SE"; | |
88 | } | |
89 | if(mixing){ | |
90 | outputfile += "ME"; | |
91 | contname += "ME"; | |
92 | cutname += "ME"; | |
93 | cutname2 += "ME"; | |
94 | counter+= "ME"; | |
95 | } | |
96 | outputfile += "Dphi_DStar"; | |
97 | outputfile += particle; | |
98 | cutname += particle; | |
99 | cutname2 += particle; | |
100 | contname += particle; | |
101 | counter+= particle; | |
102 | ||
103 | outputfile += TrackCutObjNamePrefix; | |
104 | cutname += TrackCutObjNamePrefix; | |
105 | cutname2 += TrackCutObjNamePrefix; | |
106 | contname += TrackCutObjNamePrefix; | |
107 | counter+= TrackCutObjNamePrefix; | |
108 | ||
109 | ||
110 | ||
111 | cout << "Contname = " << contname << endl; | |
112 | mgr->AddTask(task); | |
113 | // ------ input data ------ | |
114 | AliAnalysisDataContainer *cinput0 = mgr->GetCommonInputContainer(); | |
115 | ||
116 | // ----- output data ----- | |
117 | ||
118 | // output TH1I for event counting | |
119 | AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(contname, TList::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data()); | |
120 | AliAnalysisDataContainer *coutput2 = mgr->CreateContainer(cutname,AliRDHFCutsDStartoKpipi::Class(),AliAnalysisManager::kOutputContainer, outputfile.Data()); //cuts | |
121 | AliAnalysisDataContainer *coutputDstarNorm = mgr->CreateContainer(counter,AliNormalizationCounter::Class(),AliAnalysisManager::kOutputContainer, outputfile.Data()); | |
122 | AliAnalysisDataContainer *coutput4 = mgr->CreateContainer(cutname2,AliHFAssociatedTrackCuts::Class(),AliAnalysisManager::kOutputContainer, outputfile.Data()); //cuts | |
123 | ||
124 | mgr->ConnectInput(task,0,mgr->GetCommonInputContainer()); | |
125 | mgr->ConnectOutput(task,1,coutput1); | |
126 | mgr->ConnectOutput(task,2,coutput2); | |
127 | mgr->ConnectOutput(task,3,coutputDstarNorm); | |
128 | mgr->ConnectOutput(task,4,coutput4); | |
129 | ||
130 | return task ; | |
131 | ||
132 | } | |
133 |