TENDER becomes Tender, removing .so
[u/mrichter/AliRoot.git] / PWGDQ / dielectron / TakuAlberica / single / get_dedx.C
1 void get_dedx(void){
2
3   gSystem->SetIncludePath("-I. -I$ROOTSYS/include -I$ALICE_ROOT -I$ALICE_ROOT/build/include -I$ALICE_ROOT/include -I$ALICE_ROOT/ITS -I$ALICE_ROOT/TPC -I$ALICE_ROOT/CONTAINERS -I$ALICE_ROOT/STEER -I$ALICE_ROOT/TRD -I$ALICE_ROOT/macros -I$ALICE_ROOT/ANALYSIS -I$ALICE_ROOT/PWG2/FLOW/AliFlowCommon -I$ALICE_ROOT/PWG2/FLOW/AliFlowTasks -I$ALICE_ROOT/PWG3/dielectron/ -g");
4
5   gSystem->Load("libCore");// no
6   gSystem->Load("libTree");
7   gSystem->Load("libGeom");
8   gSystem->Load("libVMC");
9   gSystem->Load("libXMLIO");// no
10   gSystem->Load("libPhysics");
11   gSystem->Load("libXMLParser");
12   gSystem->Load("libProof");
13   gSystem->Load("libMinuit");
14
15   gSystem->Load("libSTEERBase");
16   gSystem->Load("libCDB");
17   gSystem->Load("libRAWDatabase");
18   gSystem->Load("libRAWDatarec");
19   gSystem->Load("libESD");
20   gSystem->Load("libAOD");
21   gSystem->Load("libSTEER");
22   gSystem->Load("libANALYSIS");
23   gSystem->Load("libANALYSISalice");
24   gSystem->Load("libTOFbase");
25   gSystem->Load("libTOFrec");
26   gSystem->Load("libT0base");
27   gSystem->Load("libT0rec");
28   gSystem->Load("libPWG2flowCommon");
29   gSystem->Load("libPWG2flowTasks");
30
31   gSystem->Load("libTender");
32   gSystem->Load("libTenderSupplies");
33
34
35
36   gSystem->Load("libCORRFW.so");
37   gSystem->Load("libPWG3base.so");
38   gSystem->Load("libPWG3dielectron.so");
39   gSystem->Load("libPWG3hfe.so");
40
41
42   TChain *chain = new TChain("esdTree");
43   for(int i=1; i!=4; ++i)
44     chain->Add( Form("/home/gunji/softwares/dielectron/data/esd137549035/%d0/AliESDs.root",i) );
45
46   AliAnalysisManager *mgr = new AliAnalysisManager("DielectronAnalysisManager");
47   AliESDInputHandler *esdH = new AliESDInputHandler();
48   mgr->SetInputEventHandler(esdH);
49   gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPhysicsSelection.C");
50   AddTaskPhysicsSelection(kFALSE);
51   gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskCentrality.C");
52   AliCentralitySelectionTask *taskCentrality =AddTaskCentrality();
53   //  taskCentrality->SetPass(2);
54
55   /*  gROOT->LoadMacro("AliDielectronDebugTreeTaku.cxx++");
56   gROOT->LoadMacro("AliDielectronHistosTaku.cxx++");
57   gROOT->LoadMacro("AliDielectronTaku.cxx++");
58   gROOT->LoadMacro("AliAnalysisTaskMultiDielectronNewTaku.cxx++");
59   */
60
61   gSystem->Load("./AliDielectronHistosTaku_cxx.so");
62   gSystem->Load("./AliDielectronDebugTreeTaku_cxx.so");
63   gSystem->Load("./AliDielectronTaku_cxx.so");
64
65
66   float mom[5][200];
67   float dedx[5][200];
68
69
70
71   /*
72   AliAnalysisManager *man=AliAnalysisManager::GetAnalysisManager();
73   AliInputEventHandler* inputHandler = (AliInputEventHandler*) (man->GetInputEventHandler());
74   Bool_t isESD=man->GetInputEventHandler()->IsA()==AliESDInputHandler::Class();
75
76   if ( inputHandler->GetPIDResponse() ){
77     AliDielectronVarManager::SetPIDResponse( inputHandler->GetPIDResponse() );
78   } else {
79     if (isESD){
80       if (!AliDielectronVarManager::GetESDpid()){
81         if (AliDielectronMC::Instance()->HasMC()) {
82           AliDielectronVarManager::InitESDpid();
83         } else {
84           cout<<" set pid as 1"<<endl;
85           AliDielectronVarManager::InitESDpid(1);
86         }
87       }
88     }
89   }
90
91   AliPIDResponse * f= (AliPIDResponse*) AliDielectronVarManager::GetESDpid() ;
92   AliTPCPIDResponse *ff = (AliTPCPIDResponse*)f->GetTPCResponse();
93
94   for (Int_t j=0; j<AliPID::kSPECIES; j++) {
95     //AliPID::EParticleType type=AliPID::EParticleType(j);
96     for(int ii=0;ii<100;ii++){
97       float p = 0.05+0.1*ii;
98       //Double_t bethe=fTPCResponse.GetExpectedSignal(mom,type); 
99       Double_t bethe=ff->GetExpectedSignal(p,j); 
100       mom[j][ii] = p;
101       dedx[j][ii] = bethe;
102
103       //cout<<j<<" "<<p<<" "<<bethe<<endl;
104     }
105   }
106   */
107
108   Double_t fAlephParam[5]={2.11543/57,
109                            20.3394,
110                            1.0411e-12,
111                            2.25543,
112                            3.18663
113   };
114
115   /*
116   Double_t fAlephParam[5]={2.11543/122,
117                            42.3394,
118                            2.0411e-22,
119                            2.25543,
120                            6.89
121   };
122   */
123
124   AliESDpid *fESDpid = new AliESDpid();
125   fESDpid->GetTPCResponse().SetBetheBlochParameters(fAlephParam[0],
126                                                     fAlephParam[1],
127                                                     fAlephParam[2],
128                                                     fAlephParam[3],
129                                                     fAlephParam[4]);
130
131
132   AliTPCPIDResponse *ff = (AliTPCPIDResponse*)fESDpid->GetTPCResponse();
133
134   for (Int_t j=0; j<AliPID::kSPECIES; j++) {                                                                                           
135     for(int ii=0;ii<200;ii++){                                                                                                                                                     
136       float p = 0.025+0.05*ii;                                                                                                                                                   
137       Double_t bethe=ff->GetExpectedSignal(p,j);                                                                                                                                   
138       mom[j][ii] = p;                                                                                                                                                               
139       dedx[j][ii] = bethe;                                                                                                                                                          
140       cout<<j<<" "<<p<<" "<<bethe<<endl;
141     }                                                                                                                                                                              
142   }                   
143
144
145   TGraph *g[5];
146   char name[100];
147   for(int i=0;i<5;i++){
148     g[i] = new TGraph(200, mom[i], dedx[i]);
149     sprintf(name,"g%d",i);
150     g[i]->SetName(name);    
151     g[i]->SetLineColor(i+2);
152   }
153   /*
154   TFile *fin=new TFile("ana/tmp.root");
155   fin->cd();
156   hdedx_pt->SetAxisRange(0,4);
157   hdedx_pt->Draw();
158   g[0]->Draw("pc");
159   g[2]->Draw("pc");
160   g[3]->Draw("pc");
161   g[4]->Draw("pc");
162   */
163   TFile *fout = new TFile("dedx.root","recreate");
164   fout->cd();
165   for(int i=0;i<5;i++){
166     g[i]->Write();
167   }
168   
169
170
171 }
172
173
174
175