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