cac2eb58 |
1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * |
3 | * * |
4 | * Author: The ALICE Off-line Project. * |
5 | * Contributors are mentioned in the code where appropriate. * |
6 | * * |
7 | * Permission to use, copy, modify and distribute this software and its * |
8 | * documentation strictly for non-commercial purposes is hereby granted * |
9 | * without fee, provided that the above copyright notice appears in all * |
10 | * copies and that both the copyright notice and this permission notice * |
11 | * appear in the supporting documentation. The authors make no claims * |
12 | * about the suitability of this software for any purpose. It is * |
13 | * provided "as is" without express or implied warranty. * |
14 | **************************************************************************/ |
cac2eb58 |
15 | /* $Id$ */ |
16 | |
3d1463c8 |
17 | //----------------------------------------------------------------------------- |
22899106 |
18 | /// \class AliMUONReconstructor |
19 | /// |
20 | /// Implementation of AliReconstructor for MUON subsystem. |
21 | /// |
96ebe67e |
22 | /// The clustering mode and the associated parameters can be changed by using |
23 | /// AliMUONRecoParam *muonRecoParam = AliMUONRecoParam::GetLow(High)FluxParam(); |
24 | /// muonRecoParam->Set...(); // see methods in AliMUONRecoParam.h for details |
15d30ed4 |
25 | /// AliRecoParam::Instance()->RegisterRecoParam(muonRecoParam); |
22899106 |
26 | /// |
96ebe67e |
27 | /// Valid modes are : |
22899106 |
28 | /// |
29 | /// SIMPLEFIT : use the AliMUONClusterFinderSimpleFit clusterizer |
30 | /// |
96ebe67e |
31 | /// SIMPLEFITV3 : SIMPLEFIT with preclustering=PRECLUSTERV3 |
32 | /// |
33 | /// MLEM : use AliMUONClusterFinderMLEM and AliMUONPreClusterFinder for preclustering (default) |
34 | /// MLEMV2 : MLEM with preclustering=PRECLUSTERV2 |
93d7b017 |
35 | /// MLEMV3 : MLEM with preclustering=PRECLUSTERV3 |
36 | /// |
22899106 |
37 | /// PRECLUSTER : use only AliMUONPreClusterFinder. Only for debug as |
38 | /// the produced clusters do not have a position, hence the tracking will not |
39 | /// work |
93d7b017 |
40 | /// PRECLUSTERV2 : another version of the preclustering |
41 | /// PRECLUSTERV3 : yet another version of the preclustering |
22899106 |
42 | /// |
43 | /// COG : use AliMUONClusterFinderCOG clusterizer. Not really a production |
44 | /// option either, as center-of-gravity is generally not a good estimate |
45 | /// of the cluster position... |
46 | /// |
47 | /// NOCLUSTERING : bypass completely the clustering stage |
48 | /// |
96ebe67e |
49 | /// ------ |
22899106 |
50 | /// |
96ebe67e |
51 | /// The behavior of the MUON reconstruction can also be changed, besides |
52 | /// the usual methods found in AliReconstruction (e.g. to disable tracking) |
53 | /// by using AliReconstruction::SetOption("MUON",options) |
54 | /// where options should be a space separated string. |
55 | /// |
56 | /// Valid options are : |
57 | /// |
58 | /// SAVEDIGITS : if you want to save in the TreeD the *calibrated* digits |
59 | /// that are used for the clustering |
22899106 |
60 | /// |
93d7b017 |
61 | /// DIGITSTOREV1 : use the V1 implementation of the digitstore |
62 | /// DIGITSTOREV2R : use the V2R implementation of the digitstore |
63 | /// |
96ebe67e |
64 | /// NOLOCALRECONSTRUCTION : for debug, to disable local reconstruction (and hence |
65 | /// "recover" old behavior) |
66 | /// |
67 | /// TRIGGERDISABLE : disable the treatment of MUON trigger |
68 | /// |
e3a2b9c9 |
69 | /// USEFASTDECODER : makes the digit maker class use the high performance decoder |
70 | /// AliMUONTrackerDDLDecoder instead of AliMUONPayloadTracker. |
71 | /// |
22899106 |
72 | /// \author Laurent Aphecetche, Subatech |
3d1463c8 |
73 | //----------------------------------------------------------------------------- |
30178c30 |
74 | |
cf464691 |
75 | #include "AliMUONReconstructor.h" |
b2d7df0b |
76 | |
b2d7df0b |
77 | #include "AliMUONCalibrationData.h" |
22899106 |
78 | #include "AliMUONClusterFinderCOG.h" |
79 | #include "AliMUONClusterFinderMLEM.h" |
80 | #include "AliMUONClusterFinderSimpleFit.h" |
22899106 |
81 | #include "AliMUONConstants.h" |
b2d7df0b |
82 | #include "AliMUONDigitCalibrator.h" |
2cf44ef3 |
83 | #include "AliMUONDigitMaker.h" |
22899106 |
84 | #include "AliMUONDigitStoreV1.h" |
93d7b017 |
85 | #include "AliMUONDigitStoreV2R.h" |
22899106 |
86 | #include "AliMUONGeometryTransformer.h" |
87 | #include "AliMUONPreClusterFinder.h" |
93d7b017 |
88 | #include "AliMUONPreClusterFinderV2.h" |
89 | #include "AliMUONPreClusterFinderV3.h" |
c5ce806f |
90 | #include "AliMUONRecoParam.h" |
91 | #include "AliMUONSimpleClusterServer.h" |
196471e9 |
92 | #include "AliMUONTracker.h" |
e1a10d41 |
93 | #include "AliMUONTriggerCircuit.h" |
96fdfe9a |
94 | #include "AliMUONTriggerCrateStore.h" |
22899106 |
95 | #include "AliMUONTriggerStoreV1.h" |
96 | #include "AliMUONVClusterFinder.h" |
c5ce806f |
97 | #include "AliMUONVClusterServer.h" |
98 | #include "AliMUONVTrackStore.h" |
99 | |
100 | #include "AliMpArea.h" |
88544f7e |
101 | #include "AliMpCDB.h" |
c5ce806f |
102 | #include "AliMpConstants.h" |
103 | |
15d30ed4 |
104 | #include "AliRecoParam.h" |
cf464691 |
105 | #include "AliRawReader.h" |
c5ce806f |
106 | #include "AliCDBManager.h" |
93d7b017 |
107 | #include "AliCodeTimer.h" |
c5ce806f |
108 | #include "AliLog.h" |
109 | |
22899106 |
110 | #include <Riostream.h> |
15d30ed4 |
111 | #include <TObjArray.h> |
22899106 |
112 | #include <TClonesArray.h> |
113 | #include <TString.h> |
114 | #include <TTree.h> |
2060b217 |
115 | |
9265505b |
116 | /// \cond CLASSIMP |
cac2eb58 |
117 | ClassImp(AliMUONReconstructor) |
22899106 |
118 | /// \endcond |
b2d7df0b |
119 | |
3304fa09 |
120 | AliMUONRecoParam* AliMUONReconstructor::fgRecoParam = 0x0; // reconstruction parameters |
121 | |
cac2eb58 |
122 | //_____________________________________________________________________________ |
22899106 |
123 | AliMUONReconstructor::AliMUONReconstructor() : |
124 | AliReconstructor(), |
125 | fCrateManager(0x0), |
126 | fDigitMaker(0x0), |
ef4cb4f1 |
127 | fTransformer(new AliMUONGeometryTransformer()), |
22899106 |
128 | fDigitStore(0x0), |
129 | fTriggerCircuit(0x0), |
130 | fCalibrationData(0x0), |
131 | fDigitCalibrator(0x0), |
c5ce806f |
132 | fClusterServer(0x0), |
22899106 |
133 | fTriggerStore(0x0), |
683cb6c5 |
134 | fTrackStore(0x0) |
8789635b |
135 | { |
22899106 |
136 | /// normal ctor |
88544f7e |
137 | |
88544f7e |
138 | // Load mapping |
a55f49a0 |
139 | if ( ! AliMpCDB::LoadDDLStore() ) { |
88544f7e |
140 | AliFatal("Could not access mapping from OCDB !"); |
141 | } |
142 | |
a55f49a0 |
143 | // Load geometry data |
144 | fTransformer->LoadGeometryData(); |
88544f7e |
145 | |
22899106 |
146 | } |
d19b6003 |
147 | |
22899106 |
148 | //_____________________________________________________________________________ |
149 | AliMUONReconstructor::~AliMUONReconstructor() |
150 | { |
151 | /// dtor |
152 | delete fDigitMaker; |
153 | delete fDigitStore; |
154 | delete fTransformer; |
155 | delete fCrateManager; |
156 | delete fTriggerCircuit; |
157 | delete fCalibrationData; |
158 | delete fDigitCalibrator; |
c5ce806f |
159 | delete fClusterServer; |
22899106 |
160 | delete fTriggerStore; |
161 | delete fTrackStore; |
22899106 |
162 | } |
96fdfe9a |
163 | |
3304fa09 |
164 | //_____________________________________________________________________________ |
15d30ed4 |
165 | const AliMUONRecoParam* AliMUONReconstructor::GetRecoParam() |
3304fa09 |
166 | { |
15d30ed4 |
167 | /// get reconstruction parameters |
3304fa09 |
168 | |
15d30ed4 |
169 | if (!fgRecoParam) { |
170 | |
171 | // get reconstruction parameters from AliRecoParam if any |
172 | TObjArray *recoParams = AliRecoParam::Instance()->GetRecoParam("MUON"); |
173 | |
174 | if (recoParams) { |
175 | |
176 | fgRecoParam = (AliMUONRecoParam*) recoParams->Last(); |
177 | |
178 | } else { |
179 | |
180 | // initialize reconstruction parameters if not already done |
181 | cout<<"W-AliMUONReconstructor::GetRecoParam: Reconstruction parameters not initialized - Use default one"<<endl; |
182 | fgRecoParam = AliMUONRecoParam::GetLowFluxParam(); |
183 | AliRecoParam::Instance()->RegisterRecoParam(fgRecoParam); |
184 | |
185 | } |
186 | |
3304fa09 |
187 | } |
188 | |
15d30ed4 |
189 | return fgRecoParam; |
3304fa09 |
190 | } |
191 | |
22899106 |
192 | //_____________________________________________________________________________ |
193 | void |
194 | AliMUONReconstructor::Calibrate(AliMUONVDigitStore& digitStore) const |
195 | { |
196 | /// Calibrate the digitStore |
197 | if (!fDigitCalibrator) |
198 | { |
199 | CreateCalibrator(); |
200 | } |
93d7b017 |
201 | AliCodeTimerAuto(Form("%s::Calibrate(AliMUONVDigitStore*)",fDigitCalibrator->ClassName())) |
22899106 |
202 | fDigitCalibrator->Calibrate(digitStore); |
203 | } |
96fdfe9a |
204 | |
22899106 |
205 | //_____________________________________________________________________________ |
206 | void |
207 | AliMUONReconstructor::ConvertDigits(AliRawReader* rawReader, |
208 | AliMUONVDigitStore* digitStore, |
209 | AliMUONVTriggerStore* triggerStore) const |
210 | { |
211 | /// Convert raw data into digit and trigger stores |
212 | CreateDigitMaker(); |
93d7b017 |
213 | |
214 | AliCodeTimerStart(Form("%s::Raw2Digits(AliRawReader*,AliMUONVDigitStore*,AliMUONVTriggerStore*)", |
215 | fDigitMaker->ClassName())) |
22899106 |
216 | fDigitMaker->Raw2Digits(rawReader,digitStore,triggerStore); |
93d7b017 |
217 | AliCodeTimerStop(Form("%s::Raw2Digits(AliRawReader*,AliMUONVDigitStore*,AliMUONVTriggerStore*)", |
218 | fDigitMaker->ClassName())) |
22899106 |
219 | Calibrate(*digitStore); |
cac2eb58 |
220 | } |
b2d7df0b |
221 | |
222 | //_____________________________________________________________________________ |
22899106 |
223 | void |
224 | AliMUONReconstructor::ConvertDigits(AliRawReader* rawReader, TTree* digitsTree) const |
b2d7df0b |
225 | { |
22899106 |
226 | /// convert raw data into a digit tree |
2060b217 |
227 | AliCodeTimerAuto("") |
22899106 |
228 | |
229 | Bool_t alone = ( TriggerStore() == 0 ); |
b2d7df0b |
230 | |
22899106 |
231 | Bool_t ok = DigitStore()->Connect(*digitsTree,alone); |
232 | if ( TriggerStore() ) |
b476b122 |
233 | { |
22899106 |
234 | ok = ok && TriggerStore()->Connect(*digitsTree,kFALSE); |
b476b122 |
235 | } |
ee103e97 |
236 | |
22899106 |
237 | if (!ok) |
238 | { |
239 | AliError("Could not make branches on TreeD"); |
240 | } |
241 | else |
242 | { |
243 | ConvertDigits(rawReader,DigitStore(),TriggerStore()); |
2060b217 |
244 | AliCodeTimerStart("Fill digits") |
22899106 |
245 | digitsTree->Fill(); |
2060b217 |
246 | AliCodeTimerStop("Fill digits") |
22899106 |
247 | DigitStore()->Clear(); |
248 | } |
249 | } |
250 | |
251 | //_____________________________________________________________________________ |
252 | AliMUONTriggerCrateStore* |
253 | AliMUONReconstructor::CrateManager() const |
254 | { |
255 | /// Return (and create if necessary) the trigger crate store |
256 | if (fCrateManager) return fCrateManager; |
257 | fCrateManager = new AliMUONTriggerCrateStore; |
258 | fCrateManager->ReadFromFile(); |
259 | return fCrateManager; |
260 | } |
261 | |
262 | //_____________________________________________________________________________ |
263 | void |
264 | AliMUONReconstructor::CreateDigitMaker() const |
265 | { |
266 | /// Create (and create if necessary) the digit maker |
267 | if (fDigitMaker) return; |
268 | |
93d7b017 |
269 | AliCodeTimerAuto("") |
22899106 |
270 | |
e3a2b9c9 |
271 | TString option = GetOption(); |
272 | Bool_t enableErrorLogging = kTRUE; |
273 | Bool_t useFastDecoder = kFALSE; |
e3ce3989 |
274 | if (option.Contains("USEFASTDECODER")) |
e3a2b9c9 |
275 | { |
276 | useFastDecoder = kTRUE; |
277 | } |
278 | fDigitMaker = new AliMUONDigitMaker(enableErrorLogging, useFastDecoder); |
22899106 |
279 | } |
280 | |
281 | //_____________________________________________________________________________ |
282 | void |
283 | AliMUONReconstructor::CreateTriggerCircuit() const |
284 | { |
285 | /// Return (and create if necessary) the trigger circuit object |
286 | if (fTriggerCircuit) return; |
287 | |
93d7b017 |
288 | AliCodeTimerAuto("") |
22899106 |
289 | |
32ab62c9 |
290 | fTriggerCircuit = new AliMUONTriggerCircuit(fTransformer); |
22899106 |
291 | |
32ab62c9 |
292 | } |
8c0b5e70 |
293 | |
22899106 |
294 | //_____________________________________________________________________________ |
295 | AliTracker* |
d76c31f4 |
296 | AliMUONReconstructor::CreateTracker() const |
22899106 |
297 | { |
298 | /// Create the MUONTracker object |
ee103e97 |
299 | |
22899106 |
300 | CreateTriggerCircuit(); |
301 | CreateDigitMaker(); |
c5ce806f |
302 | CreateClusterServer(); |
303 | |
304 | if (!fClusterServer) |
305 | { |
306 | AliError("ClusterServer is NULL ! Cannot create tracker"); |
307 | return 0x0; |
308 | } |
22899106 |
309 | |
c5ce806f |
310 | fClusterServer->UseDigitStore(*(DigitStore())); |
311 | |
312 | AliMUONTracker* tracker = new AliMUONTracker(*fClusterServer, |
313 | fDigitMaker, |
314 | fTransformer, |
683cb6c5 |
315 | fTriggerCircuit); |
22899106 |
316 | |
317 | return tracker; |
b2d7df0b |
318 | } |
319 | |
f9247068 |
320 | //_____________________________________________________________________________ |
c5ce806f |
321 | AliMUONVClusterFinder* |
322 | AliMUONReconstructor::CreateClusterFinder(const char* clusterFinderType) const |
f9247068 |
323 | { |
c5ce806f |
324 | /// Create a given cluster finder instance |
22899106 |
325 | |
93d7b017 |
326 | AliCodeTimerAuto("") |
06ca6d7b |
327 | |
f9247068 |
328 | AliMUONVClusterFinder* clusterFinder(0x0); |
329 | |
c5ce806f |
330 | TString opt(clusterFinderType); |
f9247068 |
331 | opt.ToUpper(); |
332 | |
93d7b017 |
333 | if ( strstr(opt,"PRECLUSTERV2") ) |
334 | { |
335 | clusterFinder = new AliMUONPreClusterFinderV2; |
336 | } |
337 | else if ( strstr(opt,"PRECLUSTERV3") ) |
338 | { |
339 | clusterFinder = new AliMUONPreClusterFinderV3; |
340 | } |
341 | else if ( strstr(opt,"PRECLUSTER") ) |
f9247068 |
342 | { |
343 | clusterFinder = new AliMUONPreClusterFinder; |
344 | } |
345 | else if ( strstr(opt,"COG") ) |
346 | { |
93d7b017 |
347 | clusterFinder = new AliMUONClusterFinderCOG(new AliMUONPreClusterFinder); |
f9247068 |
348 | } |
93d7b017 |
349 | else if ( strstr(opt,"SIMPLEFITV3") ) |
350 | { |
351 | clusterFinder = new AliMUONClusterFinderSimpleFit(new AliMUONClusterFinderCOG(new AliMUONPreClusterFinderV3)); |
352 | } |
f9247068 |
353 | else if ( strstr(opt,"SIMPLEFIT") ) |
354 | { |
93d7b017 |
355 | clusterFinder = new AliMUONClusterFinderSimpleFit(new AliMUONClusterFinderCOG(new AliMUONPreClusterFinder)); |
f9247068 |
356 | } |
357 | else if ( strstr(opt,"MLEM:DRAW") ) |
358 | { |
93d7b017 |
359 | clusterFinder = new AliMUONClusterFinderMLEM(kTRUE,new AliMUONPreClusterFinder); |
f9247068 |
360 | } |
93d7b017 |
361 | else if ( strstr(opt,"MLEMV3") ) |
362 | { |
363 | clusterFinder = new AliMUONClusterFinderMLEM(kFALSE,new AliMUONPreClusterFinderV3); |
364 | } |
365 | else if ( strstr(opt,"MLEMV2") ) |
366 | { |
367 | clusterFinder = new AliMUONClusterFinderMLEM(kFALSE,new AliMUONPreClusterFinderV2); |
368 | } |
f9247068 |
369 | else if ( strstr(opt,"MLEM") ) |
370 | { |
93d7b017 |
371 | clusterFinder = new AliMUONClusterFinderMLEM(kFALSE,new AliMUONPreClusterFinder); |
f9247068 |
372 | } |
22899106 |
373 | else |
374 | { |
3304fa09 |
375 | AliError(Form("clustering mode \"%s\" does not exist",opt.Data())); |
c5ce806f |
376 | return 0x0; |
22899106 |
377 | } |
f9247068 |
378 | |
c5ce806f |
379 | return clusterFinder; |
380 | } |
381 | |
382 | //_____________________________________________________________________________ |
383 | void |
384 | AliMUONReconstructor::CreateClusterServer() const |
385 | { |
386 | /// Create cluster server |
387 | |
388 | if ( fClusterServer ) return; |
389 | |
390 | AliCodeTimerAuto("") |
391 | |
392 | AliDebug(1,""); |
393 | |
15d30ed4 |
394 | AliMUONVClusterFinder* clusterFinder = CreateClusterFinder(GetRecoParam()->GetClusteringMode()); |
c5ce806f |
395 | |
396 | if ( !clusterFinder ) return; |
397 | |
3304fa09 |
398 | AliInfo(Form("Will use %s for clusterizing",clusterFinder->ClassName())); |
f9247068 |
399 | |
c5ce806f |
400 | fClusterServer = new AliMUONSimpleClusterServer(*clusterFinder,*fTransformer); |
f9247068 |
401 | } |
402 | |
cac2eb58 |
403 | //_____________________________________________________________________________ |
22899106 |
404 | void |
405 | AliMUONReconstructor::CreateCalibrator() const |
cac2eb58 |
406 | { |
22899106 |
407 | /// Create the calibrator |
2457f726 |
408 | |
93d7b017 |
409 | AliCodeTimerAuto("") |
3bc8b580 |
410 | |
22899106 |
411 | Int_t runNumber = AliCDBManager::Instance()->GetRun(); |
3bc8b580 |
412 | |
22899106 |
413 | AliInfo("Calibration will occur."); |
414 | |
415 | fCalibrationData = new AliMUONCalibrationData(runNumber); |
416 | if ( !fCalibrationData->IsValid() ) |
417 | { |
418 | AliError("Could not retrieve calibrations !"); |
419 | delete fCalibrationData; |
420 | fCalibrationData = 0x0; |
421 | return; |
422 | } |
423 | |
424 | // Check that we get all the calibrations we'll need |
425 | if ( !fCalibrationData->Pedestals() || |
426 | !fCalibrationData->Gains() || |
427 | !fCalibrationData->HV() ) |
428 | { |
429 | AliFatal("Could not access all required calibration data"); |
9ffe3ef4 |
430 | } |
cc87ebcd |
431 | |
22899106 |
432 | TString opt(GetOption()); |
433 | opt.ToUpper(); |
b2d7df0b |
434 | |
22899106 |
435 | if ( strstr(opt,"NOSTATUSMAP") ) |
436 | { |
22f7c9ba |
437 | AliWarning("NOSTATUSMAP is obsolete"); |
22899106 |
438 | } |
22f7c9ba |
439 | |
440 | fDigitCalibrator = new AliMUONDigitCalibrator(*fCalibrationData); |
22899106 |
441 | } |
9c4b1ee7 |
442 | |
22899106 |
443 | //_____________________________________________________________________________ |
444 | AliMUONVDigitStore* |
445 | AliMUONReconstructor::DigitStore() const |
446 | { |
447 | /// Return (and create if necessary) the digit container |
448 | if (!fDigitStore) |
449 | { |
93d7b017 |
450 | TString sopt(GetOption()); |
451 | sopt.ToUpper(); |
452 | |
453 | AliInfo(Form("Options=%s",sopt.Data())); |
454 | |
455 | if ( sopt.Contains("DIGITSTOREV1") ) |
456 | { |
457 | fDigitStore = AliMUONVDigitStore::Create("AliMUONDigitStoreV1"); |
458 | } |
459 | else if ( sopt.Contains("DIGITSTOREV2R") ) |
460 | { |
461 | fDigitStore = AliMUONVDigitStore::Create("AliMUONDigitStoreV2R"); |
462 | } |
463 | else if ( sopt.Contains("DIGITSTOREV2S") ) |
464 | { |
465 | fDigitStore = AliMUONVDigitStore::Create("AliMUONDigitStoreV2S"); |
466 | } |
467 | |
468 | if (!fDigitStore) fDigitStore = AliMUONVDigitStore::Create("AliMUONDigitStoreV2R"); |
469 | |
470 | AliInfo(Form("Will use %s to store digits during reconstruction",fDigitStore->ClassName())); |
22899106 |
471 | } |
472 | return fDigitStore; |
473 | } |
94f6fba9 |
474 | |
22899106 |
475 | //_____________________________________________________________________________ |
476 | void |
477 | AliMUONReconstructor::FillTreeR(AliMUONVTriggerStore* triggerStore, |
22899106 |
478 | TTree& clustersTree) const |
479 | { |
480 | /// Write the trigger and cluster information into TreeR |
481 | |
93d7b017 |
482 | AliCodeTimerAuto("") |
cc87ebcd |
483 | |
22899106 |
484 | AliDebug(1,""); |
485 | |
486 | Bool_t ok(kFALSE); |
487 | if ( triggerStore ) |
488 | { |
c5ce806f |
489 | ok = triggerStore->Connect(clustersTree,kTRUE); |
22899106 |
490 | if (!ok) |
b2d7df0b |
491 | { |
22899106 |
492 | AliError("Could not create triggerStore branches in TreeR"); |
cc87ebcd |
493 | } |
cac2eb58 |
494 | } |
22899106 |
495 | |
22899106 |
496 | if (ok) // at least one type of branches created successfully |
497 | { |
498 | clustersTree.Fill(); |
499 | } |
cac2eb58 |
500 | } |
cf464691 |
501 | |
502 | //_____________________________________________________________________________ |
22899106 |
503 | Bool_t |
504 | AliMUONReconstructor::HasDigitConversion() const |
cf464691 |
505 | { |
22899106 |
506 | /// We *do* have digit conversion, but we might advertise it only |
507 | /// if we want to save the digits. |
508 | |
509 | TString opt(GetOption()); |
510 | opt.ToUpper(); |
511 | if ( opt.Contains("SAVEDIGITS" ) && !opt.Contains("NOLOCALRECONSTRUCTION") ) |
512 | { |
513 | return kTRUE; |
514 | } |
515 | else |
516 | { |
517 | return kFALSE; |
518 | } |
519 | } |
f9247068 |
520 | |
22899106 |
521 | //_____________________________________________________________________________ |
522 | void |
523 | AliMUONReconstructor::Reconstruct(AliRawReader* rawReader, TTree* clustersTree) const |
524 | { |
525 | /// This method is called by AliReconstruction if HasLocalReconstruction()==kTRUE AND |
526 | /// HasDigitConversion()==kFALSE |
8cde4af5 |
527 | |
22899106 |
528 | if ( !clustersTree ) |
529 | { |
530 | AliError("clustersTree is 0x0 !"); |
531 | return; |
532 | } |
b2d7df0b |
533 | |
93d7b017 |
534 | ConvertDigits(rawReader,DigitStore(),TriggerStore()); |
c5ce806f |
535 | |
536 | FillTreeR(TriggerStore(),*clustersTree); |
22899106 |
537 | } |
64b056bc |
538 | |
196471e9 |
539 | //_____________________________________________________________________________ |
22899106 |
540 | void |
541 | AliMUONReconstructor::Reconstruct(TTree* digitsTree, TTree* clustersTree) const |
a2da7817 |
542 | { |
22899106 |
543 | /// This method is called by AliReconstruction if HasLocalReconstruction()==kTRUE |
544 | /// AND HasDigitConversion()==kTRUE |
545 | |
2060b217 |
546 | AliCodeTimerAuto("") |
93d7b017 |
547 | |
22899106 |
548 | AliDebug(1,""); |
549 | |
550 | if (!digitsTree || !clustersTree) |
551 | { |
552 | AliError(Form("Tree is null : digitsTree=%p clustersTree=%p", |
553 | digitsTree,clustersTree)); |
554 | return; |
555 | } |
d19b6003 |
556 | |
22899106 |
557 | if (!fDigitStore) |
558 | { |
559 | fDigitStore = AliMUONVDigitStore::Create(*digitsTree); |
560 | if (!fDigitStore) |
561 | { |
562 | AliError(Form("Could not get DigitStore from %s",digitsTree->GetName())); |
563 | } |
564 | else |
565 | { |
566 | AliInfo(Form("Created %s from %s",fDigitStore->ClassName(),digitsTree->GetName())); |
567 | } |
568 | } |
569 | if (!fTriggerStore) |
570 | { |
571 | fTriggerStore = AliMUONVTriggerStore::Create(*digitsTree); |
572 | if (!fTriggerStore) |
573 | { |
574 | AliError(Form("Could not get TriggerStore from %s",digitsTree->GetName())); |
575 | } |
576 | else |
577 | { |
578 | AliInfo(Form("Created %s from %s",fTriggerStore->ClassName(),digitsTree->GetName())); |
579 | } |
580 | } |
581 | |
582 | if (!fTriggerStore && !fDigitStore) |
583 | { |
584 | AliError("No store at all. Nothing to do."); |
585 | return; |
586 | } |
587 | |
588 | // insure we start with empty stores |
589 | if ( fDigitStore ) |
590 | { |
591 | fDigitStore->Clear(); |
592 | Bool_t alone = ( fTriggerStore ? kFALSE : kTRUE ); |
593 | Bool_t ok = fDigitStore->Connect(*digitsTree,alone); |
594 | if (!ok) |
595 | { |
596 | AliError("Could not connect digitStore to digitsTree"); |
597 | return; |
598 | } |
599 | } |
600 | if ( fTriggerStore ) |
601 | { |
602 | fTriggerStore->Clear(); |
603 | Bool_t alone = ( fDigitStore ? kFALSE : kTRUE ); |
604 | Bool_t ok = fTriggerStore->Connect(*digitsTree,alone); |
605 | if (!ok) |
606 | { |
607 | AliError("Could not connect triggerStore to digitsTree"); |
608 | return; |
609 | } |
610 | } |
611 | |
612 | digitsTree->GetEvent(0); |
613 | |
614 | if ( fDigitStore ) |
615 | { |
e729a0c8 |
616 | // Insure we got calibrated digits (if we reconstruct from pure simulated, |
617 | // i.e. w/o going through raw data, this will be the case) |
618 | TIter next(fDigitStore->CreateIterator()); |
619 | AliMUONVDigit* digit = static_cast<AliMUONVDigit*>(next()); |
620 | if (!digit->IsCalibrated()) |
621 | { |
622 | Calibrate(*fDigitStore); |
623 | } |
22899106 |
624 | } |
625 | |
c5ce806f |
626 | FillTreeR(fTriggerStore,*clustersTree); |
cac2eb58 |
627 | } |
196471e9 |
628 | |
629 | //_____________________________________________________________________________ |
22899106 |
630 | AliMUONVTriggerStore* |
631 | AliMUONReconstructor::TriggerStore() const |
196471e9 |
632 | { |
22899106 |
633 | /// Return (and create if necessary and allowed) the trigger container |
634 | TString sopt(GetOption()); |
635 | sopt.ToUpper(); |
636 | |
637 | if (sopt.Contains("TRIGGERDISABLE")) |
638 | { |
639 | delete fTriggerStore; |
640 | fTriggerStore = 0x0; |
641 | } |
642 | else |
643 | { |
644 | if (!fTriggerStore) |
645 | { |
646 | fTriggerStore = new AliMUONTriggerStoreV1; |
647 | } |
648 | } |
649 | return fTriggerStore; |
196471e9 |
650 | } |