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