]>
Commit | Line | Data |
---|---|---|
78c8a9b8 | 1 | // Macro to run TPC MC performance |
2 | // | |
3 | // The basic tracking functionality is tested | |
4 | // by using MC track references (exact points). | |
5 | // | |
6 | // Track references are propagate in B-field and | |
7 | // material by using: | |
8 | // | |
9 | // AliTracker::PropagateTrackToBxByBz() | |
10 | // AliExternalTrackParam::PropagateToBxByBz() | |
11 | // | |
12 | // | |
13 | // Available test components: | |
14 | // | |
15 | // AliPerformanceRes (propagation TPCin(ref) -> DCA(particle) by using AliTracker::PropagateTrackToBxByBz() and comparison at DCA) | |
16 | // AliPerformanceResTCPInner (propagation TPCout(ref) -> TPCin(ref) and comparison at TPCin) | |
17 | // AliPerformanceResTPCOuter (propagation TPCin(ref) -> TPCout(ref) by using AliExternalTrackParam::PropagateToBxByBz() and comparison at TPCout) | |
18 | // | |
19 | ||
20 | /* | |
21 | //1. Run locally e.g. | |
22 | ||
2bfe5463 | 23 | gROOT->LoadMacro("$ALICE_ROOT/PWGPP/TPC/macros/LoadMyLibs.C"); |
78c8a9b8 | 24 | |
25 | gROOT->LoadMacro("$ALICE_ROOT/PWG0/CreateESDChain.C"); | |
26 | TChain* chain = CreateESDChain("list_flatP_JB.txt", 500, 0); | |
27 | chain->Lookup(); | |
28 | ||
29 | // Geometry (need for the track propagation through material) | |
30 | //AliGeomManager::LoadGeometry("/lustre/alice/jacek/sim/HEADJB/flatPt_uniB/0/geometry.root"); | |
31 | ||
32 | // set magnetic field | |
33 | TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 1., 1., AliMagF::k5kG)); | |
34 | ||
2bfe5463 | 35 | gROOT->LoadMacro("$ALICE_ROOT/PWGPP/macros/RunPerformanceTaskMC.C"); |
78c8a9b8 | 36 | RunPerformanceTaskMC(chain, kTRUE, kFALSE, kFALSE, 0); |
37 | ||
38 | //2. Run on PROOF Lite e.g. | |
39 | ||
40 | TProof::Open(""); | |
41 | ||
2bfe5463 | 42 | gROOT->LoadMacro("$ALICE_ROOT/PWGPP/TPC/macros/ProofEnableAliRoot.C"); |
78c8a9b8 | 43 | ProofEnableAliRoot("/d/alice11/jacek/alice/x86_64/AliRoot/trunkJB"); |
44 | ||
45 | gROOT->LoadMacro("$ALICE_ROOT/PWG0/CreateESDChain.C"); | |
46 | TChain* chain = CreateESDChain("list_flatP_JB.txt", 400, 0); | |
47 | chain->Lookup(); | |
48 | ||
49 | // set magnetic field | |
50 | // the best is to create macro MagField.C with the line: | |
51 | // TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 1., 1., AliMagF::k5kG)); | |
52 | gProof->Exec("gROOT->Macro(\"MagField.C\")"); | |
53 | ||
2bfe5463 | 54 | gROOT->LoadMacro("$ALICE_ROOT/PWGPP/TPC/macros/RunPerformanceTaskMC.C"); |
78c8a9b8 | 55 | RunPerformanceTaskMC(chain, kTRUE, kTRUE, kTRUE,0); |
56 | ||
57 | //3. Run only on static PROOF at GSI e.g. | |
58 | ||
59 | TProof::Reset("jacek@lxgrid5.gsi.de"); | |
60 | TProofMgr * proofmgr = TProof::Mgr("jacek@lxgrid5.gsi.de"); | |
61 | //proofmgr->SetROOTVersion("523-04"); | |
62 | TProof * proof = proofmgr->CreateSession(); | |
63 | proof->SetParameter("PROOF_MaxSlavesPerNode", (Long_t)10000); | |
64 | ||
2bfe5463 | 65 | gROOT->LoadMacro("$ALICE_ROOT/PWGPP/macros/ProofEnableAliRoot.C"); |
78c8a9b8 | 66 | ProofEnableAliRoot("/u/jacek/alice/AliRoot/HEADJB/"); |
67 | ||
68 | gROOT->LoadMacro("$ALICE_ROOT/PWG0/CreateESDChain.C"); | |
69 | TChain* chain = CreateESDChain("flat_JB.txt", 50, 0); | |
70 | chain->Lookup(); | |
71 | ||
72 | // Geometry (need for the track propagation through material) | |
73 | //AliGeomManager::LoadGeometry("/lustre/alice/local/TRDdata/SIM/P-Flat/TRUNK/test/RUN0/geometry.root"); | |
74 | ||
75 | // set magnetic field | |
76 | gProof->Exec("gROOT->ProcessLine(\"TGeoGlobalMagField::Instance()->SetField(new AliMagF(\"Maps\",\"Maps\", 1., 1., AliMagF::k5kG))\")"); | |
77 | ||
2bfe5463 | 78 | gROOT->LoadMacro("$ALICE_ROOT/PWGPP/TPC/macros/RunPerformanceTaskMC.C"); |
78c8a9b8 | 79 | RunPerformanceTaskMC(chain, kTRUE, kTRUE, kTRUE); |
80 | ||
81 | //4. Make final spectra and store them in the | |
82 | // output folder and generate control pictures e.g. | |
83 | ||
84 | TFile f("TPC.Performance.root"); | |
85 | AliPerformanceRes * compObjRes = (AliPerformanceRes*)coutput->FindObject("AliPerformanceResTPCInner"); | |
86 | compObjRes->Analyse(); | |
87 | compObjRes->GetAnalysisFolder()->ls("*"); | |
88 | compObjRes->PrintHisto(kTRUE,"PerformanceResTPCInnerQA.ps"); | |
89 | TFile fout("AnalysedResTPCInner.root","recreate"); | |
90 | compObjRes->GetAnalysisFolder()->Write(); | |
91 | fout.Close(); | |
92 | f.Close(); | |
93 | ||
94 | ||
95 | */ | |
96 | ||
97 | //_____________________________________________________________________________ | |
98 | void RunPerformanceTaskMC(TChain *chain, Bool_t bUseMCInfo=kTRUE, Bool_t bUseESDfriend=kTRUE, Bool_t bProof=kTRUE, Int_t debugStreamLevel=0) | |
99 | { | |
100 | if(!chain) | |
101 | { | |
102 | AliDebug(AliLog::kError, "ERROR: No input chain available"); | |
103 | return; | |
104 | } | |
105 | ||
106 | // | |
107 | // Create global cuts objects | |
108 | // | |
109 | ||
110 | // Create ESD track reconstruction cuts | |
111 | AliRecInfoCuts *pRecInfoCuts = new AliRecInfoCuts(); | |
112 | if(pRecInfoCuts) { | |
113 | pRecInfoCuts->SetMaxDCAToVertexXY(3.0); | |
114 | pRecInfoCuts->SetMaxDCAToVertexZ(3.0); | |
115 | pRecInfoCuts->SetMinNClustersTPC(50); | |
116 | pRecInfoCuts->SetMinNClustersITS(2); | |
117 | pRecInfoCuts->SetPtRange(0.15,1.e10); | |
118 | pRecInfoCuts->SetHistogramsOn(kFALSE); | |
119 | } else { | |
120 | AliDebug(AliLog::kError, "ERROR: Cannot create AliRecInfoCuts object"); | |
121 | } | |
122 | ||
123 | // Create MC track reconstruction cuts | |
124 | AliMCInfoCuts *pMCInfoCuts = new AliMCInfoCuts(); | |
125 | if(pMCInfoCuts) { | |
126 | pMCInfoCuts->SetMinTrackLength(70); | |
127 | } else { | |
128 | AliDebug(AliLog::kError, "ERROR: Cannot AliMCInfoCuts object"); | |
129 | } | |
130 | ||
131 | // | |
132 | // Create performance objects and set cuts | |
133 | // | |
134 | const Int_t kTPC = 0; const Int_t kTPCITS = 1; const Int_t kConstrained = 2; const Int_t kTPCInner = 3; const Int_t kTPCOuter = 4; | |
135 | ||
136 | // | |
137 | // MC | |
138 | // | |
139 | AliPerformanceMC *pCompMC0 = new AliPerformanceMC("AliPerformanceMC","AliPerformanceMC",kTPC,kFALSE); | |
140 | if(!pCompMC0) { | |
141 | AliDebug(AliLog::kError, "ERROR: Cannot create AliPerformanceMC object"); | |
142 | } | |
143 | pCompMC0->SetAliRecInfoCuts(pRecInfoCuts); | |
144 | pCompMC0->SetAliMCInfoCuts(pMCInfoCuts); | |
145 | //pCompMC0->SetStreamLevel(debugStreamLevel); | |
146 | ||
147 | AliPerformanceMC *pCompMC3 = new AliPerformanceMC("AliPerformanceMCTPCInner","AliPerformanceMCTPCInner",kTPCInner,kFALSE); | |
148 | if(!pCompMC3) { | |
149 | AliDebug(AliLog::kError, "ERROR: Cannot create AliPerformanceMCInnerTPC object"); | |
150 | } | |
151 | pCompMC3->SetAliRecInfoCuts(pRecInfoCuts); | |
152 | pCompMC3->SetAliMCInfoCuts(pMCInfoCuts); | |
153 | //pCompMC3->SetStreamLevel(debugStreamLevel); | |
154 | ||
155 | AliPerformanceMC *pCompMC4 = new AliPerformanceMC("AliPerformanceMCTPCOuter","AliPerformanceMCTPCOuter",kTPCOuter,kFALSE); | |
156 | if(!pCompMC4) { | |
157 | AliDebug(AliLog::kError, "ERROR: Cannot create AliPerformanceMCTPCOuter object"); | |
158 | } | |
159 | pCompMC4->SetAliRecInfoCuts(pRecInfoCuts); | |
160 | pCompMC4->SetAliMCInfoCuts(pMCInfoCuts); | |
161 | //pCompMC4->SetStreamLevel(debugStreamLevel); | |
162 | ||
163 | ||
164 | // Swtich off all AliInfo (too much output!!!) | |
165 | AliLog::SetGlobalLogLevel(AliLog::kError); | |
166 | ||
167 | // Create the analysis manager | |
168 | AliAnalysisManager *mgr = new AliAnalysisManager; | |
169 | ||
170 | // Create task | |
171 | AliPerformanceTask *task = new AliPerformanceTask("PerformanceMC","TPC Performance"); | |
172 | task->SetUseMCInfo(bUseMCInfo); | |
173 | task->SetUseESDfriend(bUseESDfriend); | |
174 | task->AddPerformanceObject( pCompMC0 ); | |
175 | task->AddPerformanceObject( pCompMC3 ); | |
176 | task->AddPerformanceObject( pCompMC4 ); | |
177 | ||
178 | // Add task | |
179 | mgr->AddTask(task); | |
180 | ||
181 | // Add ESD handler | |
182 | AliESDInputHandler* esdH = new AliESDInputHandler; | |
183 | if(bUseESDfriend) esdH->SetActiveBranches("ESDfriend"); | |
184 | mgr->SetInputEventHandler(esdH); | |
185 | ||
186 | if(bUseMCInfo) { | |
187 | // Enable MC event handler | |
188 | AliMCEventHandler* handler = new AliMCEventHandler; | |
189 | handler->SetReadTR(kTRUE); | |
190 | mgr->SetMCtruthEventHandler(handler); | |
191 | } | |
192 | ||
193 | // Create containers for input | |
194 | //AliAnalysisDataContainer *cinput = mgr->CreateContainer("cchain", TChain::Class(), AliAnalysisManager::kInputContainer); | |
195 | AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer(); | |
196 | mgr->ConnectInput(task, 0, cinput); | |
197 | ||
198 | // Create containers for output | |
199 | AliAnalysisDataContainer *coutput = mgr->CreateContainer("coutput", TList::Class(), AliAnalysisManager::kOutputContainer, Form("TPC.%s.root", task->GetName())); | |
200 | mgr->ConnectOutput(task, 0, coutput); | |
201 | ||
202 | // Enable debug printouts | |
203 | mgr->SetDebugLevel(0); | |
204 | ||
205 | if (!mgr->InitAnalysis()) | |
206 | return; | |
207 | ||
208 | mgr->PrintStatus(); | |
209 | ||
210 | if(bProof) mgr->StartAnalysis("proof",chain); | |
211 | else mgr->StartAnalysis("local",chain); | |
212 | } | |
213 |