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