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