X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;ds=sidebyside;f=MUON%2FAliMUONRecoParam.cxx;h=75ab88f24b2263a92ac0639804b8ef35ef4a8824;hb=d20bc070e82f2a74897b3fff05dbcab2b529731e;hp=b9c9fbeb28ee49a5b0c2ea8ce611066d8134529f;hpb=b3d5776767e4241b5cb5f3a9870767739d5ffe9f;p=u%2Fmrichter%2FAliRoot.git diff --git a/MUON/AliMUONRecoParam.cxx b/MUON/AliMUONRecoParam.cxx index b9c9fbeb28e..75ab88f24b2 100644 --- a/MUON/AliMUONRecoParam.cxx +++ b/MUON/AliMUONRecoParam.cxx @@ -31,6 +31,9 @@ #include "AliRecoParam.h" #include "AliLog.h" +#include "AliCDBManager.h" +#include "AliCDBEntry.h" + #include ClassImp(AliMUONRecoParam) @@ -79,7 +82,8 @@ AliMUONRecoParam::AliMUONRecoParam() fClusterChargeCut(2.0), fEventSizeSoftLimit(35.0), fEventSizeHardLimit(45.0), - fTokenLostLimit(0.0) + fTokenLostLimit(0.0), + fTryRecover(kFALSE) { /// Constructor @@ -351,6 +355,8 @@ void AliMUONRecoParam::Print(Option_t *option) const if (IsDefault()) cout<<"\t\t*** Parameters used by default ***"<= %5.2f",ichamber,HVLimit(ichamber)) << endl; + } + cout << Form("%7.2f <= Pedestal mean <= %7.2f",PedMeanLowLimit(),PedMeanHighLimit()) << endl; cout << Form("%7.2f <= Pedestal sigma <= %7.2f",PedSigmaLowLimit(),PedSigmaHighLimit()) << endl; cout << Form("%e <= Gain linear term <= %e",GainA1LowLimit(),GainA1HighLimit()) << endl; @@ -521,22 +530,66 @@ void AliMUONRecoParam::Print(Option_t *option) const ClusterChargeCut(),ClusterChargeCut()*AverageNoisePadCharge()) << endl; cout << Form("Note that LowestPadCharge is then %7.2f fC",LowestPadCharge()) << endl; + if (TryRecover()) + { + cout << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << endl; + cout << "!!! WILL TRY TO RECOVER CORRUPTED RAW DATA !!!" << endl; + cout << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << endl; + } cout<<"\t-----------------------------------------------------"<= 0 && chamberId < 10 ) + { + fHVLimit[chamberId]=value; + } + else + { + AliError(Form("chamberId = %d is not a valid chamberId",chamberId)); + } +} - fHVSt12Limits[0]=1500; - fHVSt12Limits[1]=2000; +//_____________________________________________________________________________ +Double_t AliMUONRecoParam::HVLimit(Int_t chamberId) const +{ + /// Get the HV limit for a given chamber + if ( chamberId >= 0 && chamberId < 10 ) + { + return fHVLimit[chamberId]; + } + AliError(Form("chamberId = %d is not a valid chamberId",chamberId)); - fHVSt345Limits[0]=1500; - fHVSt345Limits[1]=2000; + return 0.0; +} + +//_____________________________________________________________________________ +void +AliMUONRecoParam::SetDefaultLimits() +{ + /// Set the default limits and pad goodness policy + fHVSt12Limits[0]=1500; // kept for backward compatibility only + fHVSt12Limits[1]=2000; // kept for backward compatibility only + fHVSt345Limits[0]=1500; // kept for backward compatibility only + fHVSt345Limits[1]=2000; // kept for backward compatibility only + + SetHVLimit(-1,1590); // this one is the real HV limit used now + fPedMeanLimits[0] = 20; fPedMeanLimits[1] = 1024; @@ -564,7 +617,7 @@ AliMUONRecoParam::SetDefaultLimits() fDEOccupancyLimits[1] = 1.0; fMissingPadFractionLimit = -1; // DEPRECATED - fFractionOfBuspatchOutsideOccupancyLimit = 0.10; // 10 % + fFractionOfBuspatchOutsideOccupancyLimit = 0.05; // 5 % ChargeSigmaCut(4.0); // pad with charge < 4.0 x sigma will be removed (where sigma is the actual noise of that very pad, i.e. not the average) @@ -575,5 +628,196 @@ AliMUONRecoParam::SetDefaultLimits() SetEventSizeLimits(35.0,45.0); SetTokenLostLimit(0.0); + + fTryRecover = kFALSE; +} + + +//----------------------------------------------------------------------- +TObjArray* +AliMUONRecoParam::Create(const char* settings) +{ + /// Create pre-defined recoparam array, according to settings. + /// settings is case-insensitive. + /// + /// Currently defined are : + /// + /// "cosmics" : + /// Cosmic (default) + /// Calibration + /// "ppideal" + /// LowFlux (default) + /// Calibration + /// "ppreal" + /// LowFlux (modified to reconstruct real p-p data) + /// Calibration + /// "pprealsim" + /// LowFlux (modified to reconstruct realistic p-p simulation) + /// Calibration + /// "pbpbreal" + /// HighFlux (modified to reconstruct real Pb-Pb data) + /// Calibration + + AliMUONRecoParam* param(0x0); + + AliRecoParam::EventSpecie_t defaultParam = AliRecoParam::kLowMult; + + TString stype(settings); + stype.ToLower(); + + if ( stype == "cosmics" ) + { + // set parameters for cosmic runs + param = AliMUONRecoParam::GetCosmicParam(); + defaultParam = AliRecoParam::kCosmic; + } + else if ( stype == "ppideal" ) + { + // set default lowFlux parameters + param = AliMUONRecoParam::GetLowFluxParam(); + } + else if ( stype == "ppreal" || stype == "pprealsim" || stype == "pprealnofield" ) + { + // common parameters for p-p data and realistic p-p simu + param = AliMUONRecoParam::GetLowFluxParam(); + param->SaveFullClusterInESD(kTRUE, 100.); + for (Int_t iCh=0; iCh<10; iCh++) + { + param->SetDefaultNonBendingReso(iCh,0.4); + param->SetDefaultBendingReso(iCh,0.4); + } + param->SetSigmaCutForTracking(7.); + param->SetStripCutForTrigger(1.5); + param->SetSigmaCutForTrigger(6.); + param->ImproveTracks(kTRUE, 6.); + param->SetPedMeanLimits(20, 700); + param->SetManuOccupancyLimits(-1.,0.01); + param->SetBuspatchOccupancyLimits(-1.,0.01); + param->SetFractionOfBuspatchOutsideOccupancyLimit(0.05); // 5 % + param->SetEventSizeLimits(45., 65.); + + // specific parameters for p-p data or realistic p-p simu + if ( stype == "ppreal" || stype == "pprealnofield" ) + { + param->SetPadGoodnessMask(0x400BE9B); + } + else + { + param->SetPadGoodnessMask(0x8080); + } + + if ( stype == "pprealnofield" ) + { + param->TryRecover(kTRUE); + } + } + else if ( stype == "pbpbreal" || stype == "pbpbrealsim" ) + { + // common parameters for Pb-Pb data and realistic Pb-Pb simu + param = AliMUONRecoParam::GetHighFluxParam(); + defaultParam = AliRecoParam::kHighMult; + param->SaveFullClusterInESD(kTRUE, 100.); + for (Int_t iCh=0; iCh<10; iCh++) + { + param->SetDefaultNonBendingReso(iCh,0.2); + param->SetDefaultBendingReso(iCh,0.2); + } + param->SetSigmaCutForTracking(5.); + param->SetStripCutForTrigger(1.5); + param->SetSigmaCutForTrigger(4.); + param->ImproveTracks(kTRUE, 4.); + param->SetPedMeanLimits(20, 700); + param->SetManuOccupancyLimits(-1.,0.03); + param->SetBuspatchOccupancyLimits(-1.,0.1); // 10 % (this cut not used for the reco anyway) + param->SetFractionOfBuspatchOutsideOccupancyLimit(0.05); // 5 % + param->SetEventSizeLimits(100., 150.); + + // specific parameters for Pb-Pb data or realistic Pb-Pb simu + if ( stype == "pbpbreal" ) + { + param->SetPadGoodnessMask(0x400BE9B); + } + else + { + param->SetPadGoodnessMask(0x8080); + } + } + else + { + AliErrorClass("Unknown settings !"); + return 0x0; + } + + TObjArray* recoParams = new TObjArray; + + recoParams->AddLast(param); + + // set (dummy) parameters for calibration runs + param = AliMUONRecoParam::GetCalibrationParam(); + recoParams->AddLast(param); + + // set parameters for Pb-Pb runs + // param = AliMUONRecoParam::GetHighFluxParam(); + // recoParams.AddLast(param); + + // identify default parameters (exit if identification failed) + Bool_t defaultIsSet = kFALSE; + TIter next(recoParams); + while ( (param = static_cast(next())) ) + { + if (param->GetEventSpecie() == defaultParam) + { + param->SetAsDefault(); + defaultIsSet = kTRUE; + } + param->Print("FULL"); + } + + if (!defaultIsSet) + { + AliErrorClass("The default reconstruction parameters are not set! Exiting..."); + return 0x0; + } + + return recoParams; } +//______________________________________________________________________________ +void +AliMUONRecoParam::Show(Int_t runNumber, const char* ocdb) +{ + /// Show what we have in the designated OCDB for that run, as far as RecoParams are concerned + + AliCDBManager::Instance()->SetDefaultStorage(ocdb); + AliCDBManager::Instance()->SetRun(runNumber); + + AliCDBEntry* entry = AliCDBManager::Instance()->Get("MUON/Calib/RecoParam"); + + if (!entry) return; + + TObject* o = entry->GetObject(); + + if ( o->IsA() == TObjArray::Class() ) + { + TObjArray* array = static_cast(o); + for ( Int_t i = 0; i <= array->GetLast(); ++i ) + { + AliDetectorRecoParam* p = static_cast(array->At(i)); + cout << Form("array[%d]=%s %s %s",i, + p ? p->ClassName() : "", + p ? AliRecoParam::GetEventSpecieName(AliRecoParam::Convert(p->GetEventSpecie())) :"", + p ? ( p->IsDefault() ? "default" : "") : "" ) << endl; + } + cout << "=========== dumps below ====== " << endl; + + for ( Int_t i = 0; i <= array->GetLast(); ++i ) + { + AliDetectorRecoParam* p = static_cast(array->At(i)); + if ( p ) p->Print(""); + } + } + else + { + o->Print(); + } +}