X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=MUON%2FAliMUONReconstructor.cxx;h=561c78ad9d767f83dfd4c47ed55ccc4f1b5dc035;hb=7e7619d198263c3c576858fd0050f0cb1eb8cd0a;hp=1acf4b07b96ded65589ed1788a94ee8b4269c807;hpb=78dfbceda7e8b2daae8cbdf446227941e851cc7d;p=u%2Fmrichter%2FAliRoot.git diff --git a/MUON/AliMUONReconstructor.cxx b/MUON/AliMUONReconstructor.cxx index 1acf4b07b96..561c78ad9d7 100644 --- a/MUON/AliMUONReconstructor.cxx +++ b/MUON/AliMUONReconstructor.cxx @@ -101,6 +101,7 @@ #include "AliMUONVClusterServer.h" #include "AliMUONVTrackStore.h" #include "AliMUONTriggerElectronics.h" +#include "AliMUONTriggerUtilities.h" #include "AliMpArea.h" #include "AliMpCDB.h" @@ -133,11 +134,13 @@ fDigitStore(0x0), fTriggerCircuit(0x0), fCalibrationData(0x0), fDigitCalibrator(0x0), -fClusterServer(0x0), fTriggerStore(0x0), fTrackStore(0x0), fClusterStore(0x0), -fTriggerProcessor(0x0) +fTriggerProcessor(0x0), +fTriggerUtilities(0x0), +fClusterServers(), +fTrackers() { /// normal ctor @@ -163,7 +166,9 @@ fTriggerProcessor(0x0) // Load geometry data fTransformer->LoadGeometryData(); - + + fClusterServers.SetOwner(kTRUE); + fTrackers.SetOwner(kTRUE); } //_____________________________________________________________________________ @@ -173,20 +178,22 @@ AliMUONReconstructor::~AliMUONReconstructor() AliDebug(1,""); + delete fDigitCalibrator; + delete fDigitMaker; delete fDigitStore; delete fTransformer; delete fTriggerCircuit; - delete fDigitCalibrator; - delete fCalibrationData; - delete fClusterServer; delete fTriggerStore; delete fTrackStore; delete fClusterStore; delete fTriggerProcessor; + delete fTriggerUtilities; delete AliMpSegmentation::Instance(false); - delete AliMpDDLStore::Instance(false); + delete AliMpDDLStore::Instance(false); + + delete fCalibrationData; } //_____________________________________________________________________________ @@ -276,10 +283,19 @@ AliMUONReconstructor::CreateDigitMaker() const fDigitMaker = new AliMUONDigitMaker(enableErrorLogging); option.ToUpper(); - if ( option.Contains("SAVEDIGITS" )) - { - fDigitMaker->SetMakeTriggerDigits(kTRUE); - } + + // Always make trigger digits + // (needed when calculating trigger chamber efficiency) + fDigitMaker->SetMakeTriggerDigits(kTRUE); + + if ( GetRecoParam()->TryRecover() ) + { + fDigitMaker->SetTryRecover(kTRUE); + } + else + { + fDigitMaker->SetTryRecover(kFALSE); + } } //_____________________________________________________________________________ @@ -295,6 +311,20 @@ AliMUONReconstructor::CreateTriggerCircuit() const } +//_____________________________________________________________________________ +void +AliMUONReconstructor::CreateTriggerUtilities() const +{ + /// Return (and create if necessary) the trigger utilities object + if ( fTriggerUtilities ) return; + + AliCodeTimerAuto("",0) + + if ( ! fCalibrationData ) CreateCalibrationData(); + + fTriggerUtilities = new AliMUONTriggerUtilities(fCalibrationData); +} + //_____________________________________________________________________________ AliTracker* AliMUONReconstructor::CreateTracker() const @@ -302,28 +332,45 @@ AliMUONReconstructor::CreateTracker() const /// Create the MUONTracker object CreateTriggerCircuit(); - CreateDigitMaker(); - CreateClusterServer(); - - AliMUONTracker* tracker(0x0); + CreateTriggerUtilities(); - if ( ! GetRecoParam()->CombineClusterTrackReco() ) - { - tracker = new AliMUONTracker(GetRecoParam(), - 0x0, - *DigitStore(), - fDigitMaker, - fTransformer, - fTriggerCircuit); - } - else + const AliMUONRecoParam* rp = GetRecoParam(); + + Int_t es = rp->GetEventSpecie(); + + AliTracker* tracker = static_cast(fTrackers.At(es)); + + if (!tracker ) { - tracker = new AliMUONTracker(GetRecoParam(), - fClusterServer, - *DigitStore(), - fDigitMaker, - fTransformer, - fTriggerCircuit); + if ( ! rp->CombineClusterTrackReco() ) + { + tracker = new AliMUONTracker(rp, + 0x0, + *DigitStore(), + fTransformer, + fTriggerCircuit, + fTriggerUtilities); + + AliInfo(Form("Created tracker %p for recoparam of type %s es=%d", + tracker, + AliRecoParam::GetEventSpecieName(AliRecoParam::Convert(rp->GetEventSpecie())),es)); + } + else + { + + tracker = new AliMUONTracker(rp, + CreateClusterServer(*rp), + *DigitStore(), + fTransformer, + fTriggerCircuit, + fTriggerUtilities); + + AliInfo(Form("Created (combined) tracker %p for recoparam of type %s es=%d", + tracker, + AliRecoParam::GetEventSpecieName(AliRecoParam::Convert(rp->GetEventSpecie())),es)); + } + + fTrackers.AddAtAndExpand(tracker,es); } @@ -401,22 +448,30 @@ AliMUONReconstructor::CreateClusterFinder(const char* clusterFinderType) } //_____________________________________________________________________________ -void -AliMUONReconstructor::CreateClusterServer() const +AliMUONVClusterServer* +AliMUONReconstructor::CreateClusterServer(const AliMUONRecoParam& rp) const { /// Create cluster server - if ( fClusterServer ) return; - AliCodeTimerAuto("",0); - - AliMUONVClusterFinder* clusterFinder = CreateClusterFinder(GetRecoParam()->GetClusteringMode()); - if ( !clusterFinder ) return; + AliMUONVClusterServer* clusterServer = static_cast(fClusterServers.At(rp.GetEventSpecie())); - AliInfo(Form("Will use %s for clusterizing",clusterFinder->ClassName())); + 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()); + } - fClusterServer = new AliMUONSimpleClusterServer(clusterFinder,*fTransformer); + return clusterServer; } //_____________________________________________________________________________ @@ -449,7 +504,7 @@ AliMUONReconstructor::CreateCalibrationData() const const AliRunInfo* runInfo = GetRunInfo(); if (!runInfo) { - AliError("Could not get runinfo ?") + AliError("Could not get runinfo ?"); } else { @@ -507,9 +562,7 @@ AliMUONReconstructor::CreateCalibrator() const AliWarning("NOSTATUSMAP is obsolete"); } - TString calibMode = GetRecoParam()->GetCalibrationMode(); - - fDigitCalibrator = new AliMUONDigitCalibrator(*fCalibrationData,GetRecoParam(),calibMode.Data()); + fDigitCalibrator = new AliMUONDigitCalibrator(*fCalibrationData,GetRecoParam()); } //_____________________________________________________________________________ @@ -567,15 +620,15 @@ AliMUONReconstructor::FillTreeR(AliMUONVTriggerStore* triggerStore, TTree& clustersTree) const { /// Write the trigger and cluster information into TreeR - + AliCodeTimerAuto("",0) - AliDebug(1,""); - Bool_t ok(kFALSE); Bool_t alone(kTRUE); // is trigger the only info in TreeR ? - if ( ! GetRecoParam()->CombineClusterTrackReco() ) + const AliMUONRecoParam* rp = GetRecoParam(); + + if ( ! rp->CombineClusterTrackReco() ) { alone = kFALSE; // we'll get both tracker and trigger information in TreeR } @@ -597,23 +650,23 @@ AliMUONReconstructor::FillTreeR(AliMUONVTriggerStore* triggerStore, fClusterStore = new AliMUONClusterStoreV2; } - CreateClusterServer(); + AliMUONVClusterServer* clusterServer = CreateClusterServer(*rp); TIter next(DigitStore()->CreateIterator()); - fClusterServer->UseDigits(next,DigitStore()); + clusterServer->UseDigits(next,DigitStore()); AliMpArea area; - AliDebug(1,Form("Doing full clusterization in local reconstruction using %s ",fClusterServer->ClassName())); + AliDebug(1,Form("Doing full clusterization in local reconstruction using %s ",clusterServer->ClassName())); for ( Int_t i = 0; i < AliMpConstants::NofTrackingChambers(); ++i ) { - if (GetRecoParam()->UseChamber(i)) + if (rp->UseChamber(i)) { - if ( ( i == 6 || i == 7 ) && GetRecoParam()->BypassSt4() ) continue; - if ( ( i == 8 || i == 9 ) && GetRecoParam()->BypassSt5() ) continue; + if ( ( i == 6 || i == 7 ) && rp->BypassSt4() ) continue; + if ( ( i == 8 || i == 9 ) && rp->BypassSt5() ) continue; - fClusterServer->Clusterize(i,*fClusterStore,area,GetRecoParam()); + clusterServer->Clusterize(i,*fClusterStore,area,rp); } } @@ -634,6 +687,14 @@ AliMUONReconstructor::FillTreeR(AliMUONVTriggerStore* triggerStore, if (fClusterStore) fClusterStore->Clear(); } +//_____________________________________________________________________________ +const AliMUONRecoParam* AliMUONReconstructor::GetRecoParam() +{ + /// Get the recoparam from reconstruction + return dynamic_cast(AliReconstructor::GetRecoParam(AliReconstruction::GetDetIndex("MUON"))); +} + + //_____________________________________________________________________________ Bool_t AliMUONReconstructor::HasDigitConversion() const