]>
Commit | Line | Data |
---|---|---|
e7f67d47 | 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 | // | |
a62207f1 | 9 | // AliTracker::PropagateTrackToBxByBz() |
10 | // AliExternalTrackParam::PropagateToBxByBz() | |
e7f67d47 | 11 | // |
12 | // | |
13 | // Available test components: | |
14 | // | |
a62207f1 | 15 | // AliPerformanceRes (propagation TPCin(ref) -> DCA(particle) by using AliTracker::PropagateTrackToBxByBz() and comparison at DCA) |
e7f67d47 | 16 | // AliPerformanceResTCPInner (propagation TPCout(ref) -> TPCin(ref) and comparison at TPCin) |
a62207f1 | 17 | // AliPerformanceResTPCOuter (propagation TPCin(ref) -> TPCout(ref) by using AliExternalTrackParam::PropagateToBxByBz() and comparison at TPCout) |
e7f67d47 | 18 | // |
19 | ||
20 | /* | |
21 | //1. Run locally e.g. | |
22 | ||
23 | gROOT->LoadMacro("$ALICE_ROOT/PWG1/macros/LoadMyLibs.C"); | |
24 | ||
25 | gROOT->LoadMacro("$ALICE_ROOT/PWG0/CreateESDChain.C"); | |
a62207f1 | 26 | TChain* chain = CreateESDChain("list_flatP_JB.txt", 500, 0); |
e7f67d47 | 27 | chain->Lookup(); |
28 | ||
29 | // Geometry (need for the track propagation through material) | |
a62207f1 | 30 | //AliGeomManager::LoadGeometry("/lustre/alice/jacek/sim/HEADJB/flatPt_uniB/0/geometry.root"); |
e7f67d47 | 31 | |
32 | // set magnetic field | |
4642ac4b | 33 | TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 1., 1., AliMagF::k5kG)); |
e7f67d47 | 34 | |
35 | gROOT->LoadMacro("$ALICE_ROOT/PWG1/macros/RunPerformanceTaskMC.C"); | |
36 | RunPerformanceTaskMC(chain, kTRUE, kFALSE, kFALSE, 0); | |
37 | ||
38 | //2. Run on PROOF Lite e.g. | |
39 | ||
40 | TProof::Open(""); | |
41 | ||
42 | gROOT->LoadMacro("$ALICE_ROOT/PWG1/macros/ProofEnableAliRoot.C"); | |
a62207f1 | 43 | ProofEnableAliRoot("/d/alice11/jacek/alice/x86_64/AliRoot/trunkJB"); |
e7f67d47 | 44 | |
45 | gROOT->LoadMacro("$ALICE_ROOT/PWG0/CreateESDChain.C"); | |
a62207f1 | 46 | TChain* chain = CreateESDChain("list_flatP_JB.txt", 400, 0); |
e7f67d47 | 47 | chain->Lookup(); |
48 | ||
e7f67d47 | 49 | // set magnetic field |
a62207f1 | 50 | // the best is to create macro MagField.C with the line: |
4642ac4b | 51 | // TGeoGlobalMagField::Instance()->SetField(new AliMagF("Maps","Maps", 1., 1., AliMagF::k5kG)); |
a62207f1 | 52 | gProof->Exec("gROOT->Macro(\"MagField.C\")"); |
e7f67d47 | 53 | |
54 | gROOT->LoadMacro("$ALICE_ROOT/PWG1/macros/RunPerformanceTaskMC.C"); | |
a62207f1 | 55 | RunPerformanceTaskMC(chain, kTRUE, kTRUE, kTRUE,0); |
e7f67d47 | 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"); | |
a62207f1 | 61 | //proofmgr->SetROOTVersion("523-04"); |
e7f67d47 | 62 | TProof * proof = proofmgr->CreateSession(); |
63 | proof->SetParameter("PROOF_MaxSlavesPerNode", (Long_t)10000); | |
64 | ||
65 | gROOT->LoadMacro("$ALICE_ROOT/PWG1/macros/ProofEnableAliRoot.C"); | |
66 | ProofEnableAliRoot("/u/jacek/alice/AliRoot/HEADJB/"); | |
67 | ||
68 | gROOT->LoadMacro("$ALICE_ROOT/PWG0/CreateESDChain.C"); | |
a62207f1 | 69 | TChain* chain = CreateESDChain("flat_JB.txt", 50, 0); |
e7f67d47 | 70 | chain->Lookup(); |
71 | ||
72 | // Geometry (need for the track propagation through material) | |
a62207f1 | 73 | //AliGeomManager::LoadGeometry("/lustre/alice/local/TRDdata/SIM/P-Flat/TRUNK/test/RUN0/geometry.root"); |
e7f67d47 | 74 | |
75 | // set magnetic field | |
4642ac4b | 76 | gProof->Exec("gROOT->ProcessLine(\"TGeoGlobalMagField::Instance()->SetField(new AliMagF(\"Maps\",\"Maps\", 1., 1., AliMagF::k5kG))\")"); |
e7f67d47 | 77 | |
78 | gROOT->LoadMacro("$ALICE_ROOT/PWG1/macros/RunPerformanceTaskMC.C"); | |
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 | //_____________________________________________________________________________ | |
a62207f1 | 98 | void RunPerformanceTaskMC(TChain *chain, Bool_t bUseMCInfo=kTRUE, Bool_t bUseESDfriend=kTRUE, Bool_t bProof=kTRUE, Int_t debugStreamLevel=0) |
e7f67d47 | 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); | |
a62207f1 | 117 | pRecInfoCuts->SetPtRange(0.15,1.e10); |
e7f67d47 | 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); | |
a62207f1 | 153 | //pCompMC3->SetStreamLevel(debugStreamLevel); |
e7f67d47 | 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); | |
a62207f1 | 161 | //pCompMC4->SetStreamLevel(debugStreamLevel); |
e7f67d47 | 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 | |
a62207f1 | 171 | AliPerformanceTask *task = new AliPerformanceTask("PerformanceMC","TPC Performance"); |
172 | task->SetUseMCInfo(bUseMCInfo); | |
173 | task->SetUseESDfriend(bUseESDfriend); | |
174 | task->AddPerformanceObject( pCompMC0 ); | |
e7f67d47 | 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; | |
a62207f1 | 183 | if(bUseESDfriend) esdH->SetActiveBranches("ESDfriend"); |
e7f67d47 | 184 | mgr->SetInputEventHandler(esdH); |
185 | ||
186 | if(bUseMCInfo) { | |
187 | // Enable MC event handler | |
188 | AliMCEventHandler* handler = new AliMCEventHandler; | |
e7f67d47 | 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 |