- else dataCluster->Fill("RC");
-
- // trigger branch
- dataCluster->MakeBranch("TC");
- dataCluster->SetTreeAddress("TC");
- recoCluster->Trigger2Trigger();
- dataCluster->Fill("TC");
-
- //AZ loader->WriteRecPoints("OVERWRITE");
-
- //---------------------------- Track & TriggerTrack ---------------------
- if (!loader->TreeT()) loader->MakeTracksContainer();
-
- // trigger branch
- dataEvent->MakeBranch("RL"); //trigger track
- dataEvent->SetTreeAddress("RL");
- recoEvent->EventReconstructTrigger();
- dataEvent->Fill("RL");
-
- // tracking branch
- dataEvent->MakeBranch("RT"); //track
- dataEvent->SetTreeAddress("RT");
- recoEvent->EventReconstruct();
- dataEvent->Fill("RT");
-
- loader->WriteTracks("OVERWRITE");
-
- if (recoEvent->GetTrackMethod() == 3) {
- // Combined cluster / track
- ((AliMUONClusterFinderAZ*) recModel)->SetReco(1);
- dataCluster->MakeBranch("RC");
- dataCluster->SetTreeAddress("RC");
- AliMUONEventRecoCombi::Instance()->FillRecP(dataCluster, recoEvent);
- dataCluster->Fill("RC");
+
+ fTrackers.AddAtAndExpand(tracker,es);
+ }
+
+
+ return tracker;
+}
+
+//_____________________________________________________________________________
+AliMUONVClusterFinder*
+AliMUONReconstructor::CreateClusterFinder(const char* clusterFinderType)
+{
+ /// Create a given cluster finder instance
+
+ AliCodeTimerAutoGeneral("",0)
+
+ AliMUONVClusterFinder* clusterFinder(0x0);
+
+ TString opt(clusterFinderType);
+ opt.ToUpper();
+
+ if ( strstr(opt,"PRECLUSTERV2") )
+ {
+ clusterFinder = new AliMUONPreClusterFinderV2;
+ }
+ else if ( strstr(opt,"PRECLUSTERV3") )
+ {
+ clusterFinder = new AliMUONPreClusterFinderV3;
+ }
+ else if ( strstr(opt,"PRECLUSTER") )
+ {
+ clusterFinder = new AliMUONPreClusterFinder;
+ }
+ else if ( strstr(opt,"PEAKCOG") )
+ {
+ clusterFinder = new AliMUONClusterFinderPeakCOG(kFALSE,new AliMUONPreClusterFinder);
+ }
+ else if ( strstr(opt,"PEAKFIT") )
+ {
+ clusterFinder = new AliMUONClusterFinderPeakFit(kFALSE,new AliMUONPreClusterFinder);
+ }
+ else if ( strstr(opt,"COG") )
+ {
+ clusterFinder = new AliMUONClusterFinderCOG(new AliMUONPreClusterFinder);
+ }
+ else if ( strstr(opt,"SIMPLEFITV3") )
+ {
+ clusterFinder = new AliMUONClusterFinderSimpleFit(new AliMUONClusterFinderCOG(new AliMUONPreClusterFinderV3));
+ }
+ else if ( strstr(opt,"SIMPLEFIT") )
+ {
+ clusterFinder = new AliMUONClusterFinderSimpleFit(new AliMUONClusterFinderCOG(new AliMUONPreClusterFinder));
+ }
+ else if ( strstr(opt,"MLEM:DRAW") )
+ {
+ clusterFinder = new AliMUONClusterFinderMLEM(kTRUE,new AliMUONPreClusterFinder);
+ }
+ else if ( strstr(opt,"MLEMV3") )
+ {
+ clusterFinder = new AliMUONClusterFinderMLEM(kFALSE,new AliMUONPreClusterFinderV3);
+ }
+ else if ( strstr(opt,"MLEMV2") )
+ {
+ clusterFinder = new AliMUONClusterFinderMLEM(kFALSE,new AliMUONPreClusterFinderV2);
+ }
+ else if ( strstr(opt,"MLEM") )
+ {
+ clusterFinder = new AliMUONClusterFinderMLEM(kFALSE,new AliMUONPreClusterFinder);
+ }
+ else
+ {
+ AliErrorClass(Form("clustering mode \"%s\" does not exist",opt.Data()));
+ return 0x0;
+ }
+
+ return clusterFinder;
+}
+
+//_____________________________________________________________________________
+AliMUONVClusterServer*
+AliMUONReconstructor::CreateClusterServer(const AliMUONRecoParam& rp) const
+{
+ /// Create cluster server
+
+ AliCodeTimerAuto("",0);
+
+ AliMUONVClusterServer* clusterServer = static_cast<AliMUONVClusterServer*>(fClusterServers.At(rp.GetEventSpecie()));
+
+ if (!clusterServer )
+ {
+ AliMUONVClusterFinder* clusterFinder = CreateClusterFinder(rp.GetClusteringMode());
+
+ if ( !clusterFinder ) return 0x0;
+
+ clusterServer = new AliMUONSimpleClusterServer(clusterFinder,*fTransformer);
+
+ AliInfo(Form("Created AliMUONSimpleClusterServer (%p) for specie %d with clustering = %s (following requesting clustering mode %s)",
+ clusterServer,rp.GetEventSpecie(),clusterFinder->ClassName(),rp.GetClusteringMode()));
+
+ fClusterServers.AddAtAndExpand(clusterServer,rp.GetEventSpecie());
+ }
+
+ return clusterServer;
+}
+
+//_____________________________________________________________________________
+void
+AliMUONReconstructor::CreateCalibrationData() const
+{
+ /// Create the calibrator
+
+ AliCodeTimerAuto("",0);
+
+ Int_t runNumber = AliCDBManager::Instance()->GetRun();
+
+ fCalibrationData = new AliMUONCalibrationData(runNumber);
+ if ( !fCalibrationData->IsValid() )
+ {
+ AliError("Could not retrieve calibrations !");
+ delete fCalibrationData;
+ fCalibrationData = 0x0;
+ return;
+ }
+
+ // It is now time to check whether we have everything to proceed.
+ // What we need depends on whether both tracker and trigger
+ // are in the readout chain, and what specific "bad channel policy"
+ // we use
+
+ Bool_t kTracker(kFALSE);
+ Bool_t kTrigger(kFALSE);
+
+ const AliRunInfo* runInfo = GetRunInfo();
+ if (!runInfo)
+ {
+ AliError("Could not get runinfo ?");
+ }
+ else
+ {
+ TString detectors(runInfo->GetActiveDetectors());
+ if (detectors.Contains("MUONTRK")) kTracker=kTRUE;
+ if (detectors.Contains("MUONTRG")) kTrigger=kTRUE;
+ }
+
+ AliInfo(Form("Run with MUON TRIGGER : %s and MUON TRACKER : %s",
+ kTrigger ? "YES":"NO" ,
+ kTracker ? "YES":"NO"));
+
+ if ( kTracker )
+ {
+ // Check that we get all the calibrations we'll need
+ if ( !fCalibrationData->Pedestals() ||
+ !fCalibrationData->Gains() )
+ {
+ AliFatal(Form("Could not access all required calibration data (PED %p GAIN %p)",
+ fCalibrationData->Pedestals(),fCalibrationData->Gains()));