X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=MUON%2FAliMUONReconstructor.cxx;h=561c78ad9d767f83dfd4c47ed55ccc4f1b5dc035;hb=239bac74f1a2bf0e25a22f2fe4a37858ebf813bb;hp=10fba9c87c114746c704f1482e49bfc8ebf1f1ad;hpb=00977a6468bfca3d4224aedba4338cc94949d179;p=u%2Fmrichter%2FAliRoot.git diff --git a/MUON/AliMUONReconstructor.cxx b/MUON/AliMUONReconstructor.cxx index 10fba9c87c1..561c78ad9d7 100644 --- a/MUON/AliMUONReconstructor.cxx +++ b/MUON/AliMUONReconstructor.cxx @@ -100,6 +100,8 @@ #include "AliMUONVClusterFinder.h" #include "AliMUONVClusterServer.h" #include "AliMUONVTrackStore.h" +#include "AliMUONTriggerElectronics.h" +#include "AliMUONTriggerUtilities.h" #include "AliMpArea.h" #include "AliMpCDB.h" @@ -132,20 +134,30 @@ fDigitStore(0x0), fTriggerCircuit(0x0), fCalibrationData(0x0), fDigitCalibrator(0x0), -fClusterServer(0x0), fTriggerStore(0x0), fTrackStore(0x0), -fClusterStore(0x0) +fClusterStore(0x0), +fTriggerProcessor(0x0), +fTriggerUtilities(0x0), +fClusterServers(), +fTrackers() { /// normal ctor AliDebug(1,""); + + // Unload mapping objects + // if they have been loaded from the obsolete OCDB mapping objects + + if ( AliMpDDLStore::Instance(false) ) { + AliCDBManager::Instance()->UnloadFromCache("MUON/Calib/DDLStore"); + delete AliMpDDLStore::Instance(); + } - // Unload and delete old mapping - AliCDBManager::Instance()->UnloadFromCache("MUON/Calib/Mapping"); - AliCDBManager::Instance()->UnloadFromCache("MUON/Calib/DDLStore"); - delete AliMpDDLStore::Instance(); - delete AliMpSegmentation::Instance(); + if ( AliMpSegmentation::Instance(false) ) { + AliCDBManager::Instance()->UnloadFromCache("MUON/Calib/Mapping"); + delete AliMpSegmentation::Instance(); + } // Load mapping if ( ! AliMpCDB::LoadDDLStore() ) { @@ -154,7 +166,9 @@ fClusterStore(0x0) // Load geometry data fTransformer->LoadGeometryData(); - + + fClusterServers.SetOwner(kTRUE); + fTrackers.SetOwner(kTRUE); } //_____________________________________________________________________________ @@ -164,19 +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; } //_____________________________________________________________________________ @@ -266,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); + } } //_____________________________________________________________________________ @@ -285,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 @@ -292,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); } @@ -391,36 +448,42 @@ 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; } //_____________________________________________________________________________ void -AliMUONReconstructor::CreateCalibrator() const +AliMUONReconstructor::CreateCalibrationData() const { /// Create the calibrator - AliCodeTimerAuto("",0) + AliCodeTimerAuto("",0); Int_t runNumber = AliCDBManager::Instance()->GetRun(); - AliInfo("Calibration will occur."); - fCalibrationData = new AliMUONCalibrationData(runNumber); if ( !fCalibrationData->IsValid() ) { @@ -441,7 +504,7 @@ AliMUONReconstructor::CreateCalibrator() const const AliRunInfo* runInfo = GetRunInfo(); if (!runInfo) { - AliError("Could not get runinfo ?") + AliError("Could not get runinfo ?"); } else { @@ -476,7 +539,21 @@ AliMUONReconstructor::CreateCalibrator() const } } } - +} + +//_____________________________________________________________________________ +void +AliMUONReconstructor::CreateCalibrator() const +{ + /// Create the calibrator + + AliCodeTimerAuto("",0); + + if ( ! fCalibrationData ) + CreateCalibrationData(); + + AliInfo("Calibration will occur."); + TString opt(GetOption()); opt.ToUpper(); @@ -485,9 +562,24 @@ AliMUONReconstructor::CreateCalibrator() const AliWarning("NOSTATUSMAP is obsolete"); } - TString calibMode = GetRecoParam()->GetCalibrationMode(); + fDigitCalibrator = new AliMUONDigitCalibrator(*fCalibrationData,GetRecoParam()); +} + +//_____________________________________________________________________________ +void +AliMUONReconstructor::ResponseRemovingChambers(AliMUONVTriggerStore* triggerStore) const +{ + /// Update trigger information with informatins obtained after + /// re-calculation of trigger response + AliCodeTimerAuto("",0); + + if ( ! fCalibrationData ) + CreateCalibrationData(); - fDigitCalibrator = new AliMUONDigitCalibrator(*fCalibrationData,GetRecoParam(),calibMode.Data()); + if ( ! fTriggerProcessor ) + fTriggerProcessor = new AliMUONTriggerElectronics(fCalibrationData); + + fTriggerProcessor->ResponseRemovingChambers(*triggerStore); } //_____________________________________________________________________________ @@ -528,21 +620,22 @@ 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 } if ( triggerStore ) { + ResponseRemovingChambers(triggerStore); ok = triggerStore->Connect(clustersTree,alone); if (!ok) { @@ -557,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); } } @@ -594,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