From 7e88424f201cac746e949f2b58a4b2ce9c1cfcb6 Mon Sep 17 00:00:00 2001 From: cvetan Date: Tue, 22 Jul 2008 21:57:44 +0000 Subject: [PATCH] Major commit related to steering of the reco parameters: AliDAQ and trigger classes updated. Reading and usage of the GRP emtry almost completely revised. Significant changes in AliReconstruction. Update AliDetectorRecoParam and AliRecoParam classes. A lot of changes in the detector's code implied by the changes in STEER. test/gun/rec.C and test/gun/recraw/rec.C macros updated as an example how to steer properly the reconstruction till the reco-param creation macros and prepared and the corresponding CDB entries are put in place. Please report any problems and possibly submit bug reports to savannah. --- EVE/EveDet/AliEveTRDData.cxx | 12 +- GRP/UpdateCDBGRPEntry.C | 6 +- GRP/UpdateCDBGRPEntryMC.C | 4 +- HLT/PHOS/AliHLTPHOSClusterizer.cxx | 10 +- HLT/PHOS/AliHLTPHOSClusterizer.h | 4 +- .../AliHLTTPCOfflineTrackerComponent.cxx | 3 +- HLT/TRD/AliHLTTRDClusterizerComponent.cxx | 2 +- HLT/TRD/AliHLTTRDTrackerComponent.cxx | 2 +- HLT/TRD/AliHLTTRDTrackerV1Component.cxx | 2 +- ITS/AliITSDetTypeRec.cxx | 14 - ITS/AliITSReconstructor.cxx | 8 - ITS/AliITSReconstructor.h | 6 +- MUON/AliMUONReconstructor.cxx | 18 - MUON/AliMUONReconstructor.h | 10 +- PHOS/AliPHOS.cxx | 38 +- PHOS/AliPHOSClusterizerv1.cxx | 27 +- PHOS/AliPHOSClusterizerv1.h | 3 +- PHOS/AliPHOSQADataMaker.cxx | 2 +- PHOS/AliPHOSQADataMakerRec.cxx | 6 +- PHOS/AliPHOSRawDigiProducer.cxx | 62 +++- PHOS/AliPHOSRawDigiProducer.h | 8 +- PHOS/AliPHOSRecoParam.cxx | 109 ++++-- PHOS/AliPHOSRecoParam.h | 89 +++-- PHOS/AliPHOSReconstructor.cxx | 38 +- PHOS/AliPHOSReconstructor.h | 28 +- PHOS/PHOSbaseLinkDef.h | 3 - PHOS/libPHOSbase.pkg | 5 +- RAW/AliDAQ.cxx | 138 ++++++- RAW/AliDAQ.h | 13 +- STEER/AliCentralTrigger.cxx | 82 ++-- STEER/AliCentralTrigger.h | 13 +- STEER/AliDetectorRecoParam.cxx | 8 +- STEER/AliDetectorRecoParam.h | 12 +- STEER/AliEventInfo.cxx | 48 +-- STEER/AliEventInfo.h | 50 ++- STEER/AliQAChecker.cxx | 42 ++- STEER/AliQAChecker.h | 10 +- STEER/AliRecoParam.cxx | 117 ++++-- STEER/AliRecoParam.h | 41 +- STEER/AliReconstruction.cxx | 350 +++++++++++++++--- STEER/AliReconstruction.h | 23 +- STEER/AliReconstructor.cxx | 33 ++ STEER/AliReconstructor.h | 8 +- STEER/AliRunInfo.cxx | 91 +++++ STEER/AliRunInfo.h | 57 +++ STEER/AliSimulation.cxx | 2 +- STEER/AliTriggerInput.cxx | 26 +- STEER/AliTriggerInput.h | 3 +- STEER/STEERLinkDef.h | 1 + STEER/libSTEER.pkg | 2 +- TPC/AliTPCReconstructor.cxx | 28 -- TPC/AliTPCReconstructor.h | 10 +- TPC/AliTPCcalibDB.cxx | 24 -- TPC/AliTPCcalibDB.h | 3 - TRD/AliTRDReconstructor.cxx | 3 - TRD/AliTRDReconstructor.h | 13 +- TRD/AliTRDchamberTimeBin.cxx | 16 +- TRD/AliTRDclusterizer.cxx | 43 +-- TRD/AliTRDpidESD.cxx | 2 +- TRD/AliTRDrecoParam.h | 4 +- TRD/AliTRDseedV1.cxx | 22 +- TRD/AliTRDtrackV1.cxx | 2 +- TRD/AliTRDtracker.cxx | 18 +- TRD/AliTRDtrackerV1.cxx | 80 ++-- TRD/AliTRDtrackingChamber.cxx | 8 +- test/gun/rec.C | 5 + test/gun/recraw/rec.C | 12 +- 67 files changed, 1251 insertions(+), 731 deletions(-) create mode 100644 STEER/AliRunInfo.cxx create mode 100644 STEER/AliRunInfo.h diff --git a/EVE/EveDet/AliEveTRDData.cxx b/EVE/EveDet/AliEveTRDData.cxx index 2ba6e7c9eea..5ad58249939 100644 --- a/EVE/EveDet/AliEveTRDData.cxx +++ b/EVE/EveDet/AliEveTRDData.cxx @@ -351,17 +351,17 @@ void AliEveTRDTrack::ProcessData() AliTRDtrackV1 *track = (AliTRDtrackV1*)GetUserData(); AliInfo(Form("Clusters[%d]", track->GetNumberOfClusters())); - AliTRDrecoParam *rec = 0x0; - if(!(rec = AliTRDReconstructor::RecoParam())){ + const AliTRDrecoParam *rec = 0x0; + if(!(rec = AliTRDReconstructor::GetRecoParam())){ AliWarning("TRD reco param missing."); return; } - rec->SetPIDMethod(AliTRDrecoParam::kLQPID); + // rec->SetPIDMethod(AliTRDrecoParam::kLQPID); track->CookPID(); printf("PIDLQ : "); for(int is=0; isGetPID(is)); printf("\n"); - rec->SetPIDMethod(AliTRDrecoParam::kNNPID); - track->CookPID(); - printf("PIDNN : "); for(int is=0; isGetPID(is)); printf("\n"); + // rec->SetPIDMethod(AliTRDrecoParam::kNNPID); + // track->CookPID(); + // printf("PIDNN : "); for(int is=0; isGetPID(is)); printf("\n"); } diff --git a/GRP/UpdateCDBGRPEntry.C b/GRP/UpdateCDBGRPEntry.C index f59471b49e3..1cd290c2eb3 100644 --- a/GRP/UpdateCDBGRPEntry.C +++ b/GRP/UpdateCDBGRPEntry.C @@ -53,9 +53,9 @@ TMap *GetGRPList(const char* system) { map->Add(new TObjString("fAliceBeamEnergy"),new TObjString("14000")); else map->Add(new TObjString("fAliceBeamEnergy"),new TObjString("5500")); map->Add(new TObjString("fAliceBeamType"),new TObjString(system)); - map->Add(new TObjString("fNumberOfDetectors"),new TObjString("15")); - map->Add(new TObjString("fDetectorMask"),new TObjString("1048575")); - map->Add(new TObjString("fLHCPeriod"),new TObjString("LHC07a")); + map->Add(new TObjString("fNumberOfDetectors"),new TObjString("21")); + map->Add(new TObjString("fDetectorMask"),new TObjString("1074790399")); + map->Add(new TObjString("fLHCPeriod"),new TObjString("LHC08c")); //DCS map->Add(new TObjString("fLHCState"),new TObjString("test")); diff --git a/GRP/UpdateCDBGRPEntryMC.C b/GRP/UpdateCDBGRPEntryMC.C index d53a17e153b..9e66496a0c8 100644 --- a/GRP/UpdateCDBGRPEntryMC.C +++ b/GRP/UpdateCDBGRPEntryMC.C @@ -170,8 +170,8 @@ TMap *GetGRPList() { map->Add(new TObjString("fAliceBeamEnergy"),new TObjString(ParseConfig("fAliceBeamEnergy"))); map->Add(new TObjString("fAliceBeamType"),new TObjString(system)); map->Add(new TObjString("fNumberOfDetectors"),new TObjString(ParseConfig("fNumberOfDetectors"))); - map->Add(new TObjString("fDetectorMask"),new TObjString("1048575")); - map->Add(new TObjString("fLHCPeriod"),new TObjString("LHC07a")); + map->Add(new TObjString("fDetectorMask"),new TObjString("1074790399")); + map->Add(new TObjString("fLHCPeriod"),new TObjString("LHC08c")); //DCS map->Add(new TObjString("fLHCState"),new TObjString("0")); diff --git a/HLT/PHOS/AliHLTPHOSClusterizer.cxx b/HLT/PHOS/AliHLTPHOSClusterizer.cxx index 22e861cc7c2..a0ea8356211 100644 --- a/HLT/PHOS/AliHLTPHOSClusterizer.cxx +++ b/HLT/PHOS/AliHLTPHOSClusterizer.cxx @@ -36,7 +36,7 @@ #include "TClonesArray.h" #include "AliPHOSGeometry.h" #include "AliPHOSDigit.h" -#include "AliPHOSRecoParamEmc.h" +#include "AliPHOSRecoParam.h" ClassImp(AliHLTPHOSClusterizer); @@ -80,12 +80,12 @@ AliHLTPHOSClusterizer::SetRecPointContainer(AliHLTPHOSRecPointContainerStruct* r } void -AliHLTPHOSClusterizer::SetRecoParameters(AliPHOSRecoParamEmc* params) +AliHLTPHOSClusterizer::SetRecoParameters(AliPHOSRecoParam* params) { //see header file for documentation - fEmcClusteringThreshold = params->GetClusteringThreshold(); - fEmcMinEnergyThreshold = params->GetMinE(); - fLogWeight = params->GetLogWeight(); + fEmcClusteringThreshold = params->GetEMCClusteringThreshold(); + fEmcMinEnergyThreshold = params->GetEMCMinE(); + fLogWeight = params->GetEMCLogWeight(); } void diff --git a/HLT/PHOS/AliHLTPHOSClusterizer.h b/HLT/PHOS/AliHLTPHOSClusterizer.h index 0c15ba8006d..9036c2baa5d 100644 --- a/HLT/PHOS/AliHLTPHOSClusterizer.h +++ b/HLT/PHOS/AliHLTPHOSClusterizer.h @@ -45,7 +45,7 @@ class TClonesArray; class AliPHOSDigit; -class AliPHOSRecoParamEmc; +class AliPHOSRecoParam; /** * @class AliHLTPHOSClusterizer @@ -102,7 +102,7 @@ public: /** Set reco parameters */ - void SetRecoParameters(AliPHOSRecoParamEmc* recoPars); + void SetRecoParameters(AliPHOSRecoParam* recoPars); /** Set emc clustering threshold */ void SetEmcClusteringThreshold(Float_t threshold) { fEmcClusteringThreshold = threshold; } diff --git a/HLT/TPCLib/offline/AliHLTTPCOfflineTrackerComponent.cxx b/HLT/TPCLib/offline/AliHLTTPCOfflineTrackerComponent.cxx index e1c6731ecd2..befd5b88fe8 100644 --- a/HLT/TPCLib/offline/AliHLTTPCOfflineTrackerComponent.cxx +++ b/HLT/TPCLib/offline/AliHLTTPCOfflineTrackerComponent.cxx @@ -153,7 +153,8 @@ int AliHLTTPCOfflineTrackerComponent::DoInit( int argc, const char** argv ) //AliTPCRecoParam * tpcRecoParam = AliTPCRecoParam::GetLowFluxParam(); AliTPCRecoParam * tpcRecoParam = AliTPCRecoParam::GetHLTParam(); if(tpcRecoParam) { - AliTPCReconstructor::SetRecoParam(tpcRecoParam); + AliTPCReconstructor tpcReconstructor; + tpcReconstructor.SetRecoParam(tpcRecoParam); } // TPC geometry parameters diff --git a/HLT/TRD/AliHLTTRDClusterizerComponent.cxx b/HLT/TRD/AliHLTTRDClusterizerComponent.cxx index 8b19d860476..c349d81421f 100644 --- a/HLT/TRD/AliHLTTRDClusterizerComponent.cxx +++ b/HLT/TRD/AliHLTTRDClusterizerComponent.cxx @@ -248,7 +248,7 @@ int AliHLTTRDClusterizerComponent::DoInit( int argc, const char** argv ) return -1; } - AliTRDReconstructor::SetRecoParam(fRecoParam); + AliTRDReconstructor reconstructor; reconstructor.SetRecoParam(fRecoParam); // init the raw data type to be used... // the switch here will become obsolete as soon as the data structures is fixed diff --git a/HLT/TRD/AliHLTTRDTrackerComponent.cxx b/HLT/TRD/AliHLTTRDTrackerComponent.cxx index 978ccacd42b..5955d0c9071 100644 --- a/HLT/TRD/AliHLTTRDTrackerComponent.cxx +++ b/HLT/TRD/AliHLTTRDTrackerComponent.cxx @@ -191,7 +191,7 @@ int AliHLTTRDTrackerComponent::DoInit( int argc, const char** argv ) AliTRDrecoParam *fPars = AliTRDrecoParam::GetLowFluxParam(); fPars->SetSeeding(kTRUE); fPars->SetStreamLevel(0); - AliTRDReconstructor::SetRecoParam(fPars); + AliTRDReconstructor reconstructor; reconstructor.SetRecoParam(fPars); fTracker = new AliTRDtracker(fGeometryFile); //fTracker = new AliTRDtracker(fGeometryFile); } diff --git a/HLT/TRD/AliHLTTRDTrackerV1Component.cxx b/HLT/TRD/AliHLTTRDTrackerV1Component.cxx index 435d456e7bd..819934b161a 100644 --- a/HLT/TRD/AliHLTTRDTrackerV1Component.cxx +++ b/HLT/TRD/AliHLTTRDTrackerV1Component.cxx @@ -311,7 +311,7 @@ int AliHLTTRDTrackerV1Component::DoInit( int argc, const char** argv ) // no debug stream -> no debug files! on HLT fRecoParam->SetStreamLevel(0); - AliTRDReconstructor::SetRecoParam(fRecoParam); + AliTRDReconstructor reconstructor; reconstructor.SetRecoParam(fRecoParam); // geometry: // for some unknown at this point reason (30th of April 2008) diff --git a/ITS/AliITSDetTypeRec.cxx b/ITS/AliITSDetTypeRec.cxx index e217bdbd921..898e943ebf8 100644 --- a/ITS/AliITSDetTypeRec.cxx +++ b/ITS/AliITSDetTypeRec.cxx @@ -453,8 +453,6 @@ Bool_t AliITSDetTypeRec::GetCalibration() { AliCDBEntry *entryPedestalSSD = AliCDBManager::Instance()->Get("ITS/Calib/PedestalSSD"); AliCDBEntry *entryGainSSD = AliCDBManager::Instance()->Get("ITS/Calib/GainSSD"); AliCDBEntry *entryBadChannelsSSD = AliCDBManager::Instance()->Get("ITS/Calib/BadChannelsSSD"); - // Entry for the AliITSRecoParam object - AliCDBEntry *entryRP = AliCDBManager::Instance()->Get("ITS/Calib/RecoParam/"); AliCDBEntry *entry2SPD = AliCDBManager::Instance()->Get("ITS/Calib/RespSPD"); AliCDBEntry *entry2SDD = AliCDBManager::Instance()->Get("ITS/Calib/RespSDD"); AliCDBEntry *entry2SSD = AliCDBManager::Instance()->Get("ITS/Calib/RespSSD"); @@ -528,18 +526,6 @@ Bool_t AliITSDetTypeRec::GetCalibration() { if(!cacheStatus)entry2SSD->SetObject(NULL); entry2SSD->SetOwner(kTRUE); - if(!AliITSReconstructor::GetRecoParam()){ - if(!entryRP) AliFatal("Calibration object (RecoParam) retrieval from OCDB failed! Hint: as an alternative you can set it in your reconstruction macro "); - AliITSRecoParam *rp = (AliITSRecoParam*)entryRP->GetObject(); - if(!cacheStatus)entryRP->SetObject(NULL); - entryRP->SetOwner(kTRUE); - AliITSReconstructor::SetRecoParam(rp); - } - else { - AliWarning("AliITSRecoParam object has been already set in AliITSReconstructor. The OCDB instance will not be used\n"); - } - - // DB entries are deleted. In this way metadeta objects are deleted as well if(!cacheStatus){ delete entrySPD; diff --git a/ITS/AliITSReconstructor.cxx b/ITS/AliITSReconstructor.cxx index 0f864661a39..0d839490a5e 100644 --- a/ITS/AliITSReconstructor.cxx +++ b/ITS/AliITSReconstructor.cxx @@ -44,7 +44,6 @@ ClassImp(AliITSReconstructor) -AliITSRecoParam *AliITSReconstructor::fgRecoParam =0; // reconstruction parameters //___________________________________________________________________________ AliITSReconstructor::AliITSReconstructor() : AliReconstructor(), @@ -57,7 +56,6 @@ fDetTypeRec(0) AliITSReconstructor::~AliITSReconstructor(){ // destructor delete fItsPID; - // if(!fgRecoParam) delete fgRecoParam; if(fDetTypeRec) delete fDetTypeRec; } //______________________________________________________________________ @@ -96,12 +94,6 @@ void AliITSReconstructor::Init() { fDetTypeRec->SetITSgeom(geom); fDetTypeRec->SetDefaults(); - if(fgRecoParam) { - fgRecoParam->PrintParameters(); - } else { - AliWarning("AliITSRecoParam has not been set"); - } - return; } diff --git a/ITS/AliITSReconstructor.h b/ITS/AliITSReconstructor.h index 551b77401d1..88674818189 100644 --- a/ITS/AliITSReconstructor.h +++ b/ITS/AliITSReconstructor.h @@ -39,16 +39,14 @@ public: AliESDEvent* esd) const {FillESD((TTree*)NULL, clustersTree, esd);} - static void SetRecoParam(AliITSRecoParam * param){ fgRecoParam = param;} - static const AliITSRecoParam* GetRecoParam(){ return fgRecoParam;} + static const AliITSRecoParam* GetRecoParam() { return dynamic_cast(AliReconstructor::GetRecoParam(0)); } private: //data - static AliITSRecoParam *fgRecoParam; // reconstruction parameters AliITSpidESD *fItsPID; // Pid for ITS AliITSDetTypeRec *fDetTypeRec; // reconstructor - ClassDef(AliITSReconstructor, 5) // class for the ITS reconstruction + ClassDef(AliITSReconstructor, 6) // class for the ITS reconstruction }; #endif diff --git a/MUON/AliMUONReconstructor.cxx b/MUON/AliMUONReconstructor.cxx index 0948e4fe1e3..a26a8f89bf5 100644 --- a/MUON/AliMUONReconstructor.cxx +++ b/MUON/AliMUONReconstructor.cxx @@ -100,7 +100,6 @@ #include "AliMUONPreClusterFinder.h" #include "AliMUONPreClusterFinderV2.h" #include "AliMUONPreClusterFinderV3.h" -#include "AliMUONRecoParam.h" #include "AliMUONSimpleClusterServer.h" #include "AliMUONTracker.h" #include "AliMUONTriggerCircuit.h" @@ -113,7 +112,6 @@ #include "AliMpCDB.h" #include "AliMpConstants.h" -#include "AliRecoParam.h" #include "AliRawReader.h" #include "AliCDBManager.h" #include "AliCodeTimer.h" @@ -129,8 +127,6 @@ ClassImp(AliMUONReconstructor) /// \endcond -AliMUONRecoParam* AliMUONReconstructor::fgRecoParam = 0x0; // reconstruction parameters - //_____________________________________________________________________________ AliMUONReconstructor::AliMUONReconstructor() : AliReconstructor(), @@ -173,20 +169,6 @@ AliMUONReconstructor::~AliMUONReconstructor() delete fClusterStore; } -//_____________________________________________________________________________ -const AliMUONRecoParam* AliMUONReconstructor::GetRecoParam() -{ - /// get reconstruction parameters - - // initialize reconstruction parameters if not already done - if (!fgRecoParam) { - cout<<"W-AliMUONReconstructor::GetRecoParam: Reconstruction parameters not initialized - Use default one"<(AliReconstructor::GetRecoParam(7)); } static AliMUONVClusterFinder* CreateClusterFinder(const char* clusterFinderType); @@ -86,9 +88,7 @@ private: mutable AliMUONVTrackStore* fTrackStore; //!< Track container mutable AliMUONVClusterStore* fClusterStore; //!< cluster store (when not in combined tracking mode) - static AliMUONRecoParam* fgRecoParam; //!< parameters used to tune the MUON reconstruction - - ClassDef(AliMUONReconstructor,7) // Implementation of AliReconstructor + ClassDef(AliMUONReconstructor,8) // Implementation of AliReconstructor }; #endif diff --git a/PHOS/AliPHOS.cxx b/PHOS/AliPHOS.cxx index b6aa2ba5077..7825d45c944 100644 --- a/PHOS/AliPHOS.cxx +++ b/PHOS/AliPHOS.cxx @@ -96,9 +96,8 @@ class TFile; #include "AliPHOSRawDecoder.h" #include "AliPHOSRawDigiProducer.h" #include "AliPHOSQAChecker.h" -#include "AliPHOSRecoParamEmc.h" +#include "AliPHOSRecoParam.h" #include "AliPHOSSimParam.h" -#include "AliPHOSCpvRawWrite.h" ClassImp(AliPHOS) @@ -442,7 +441,7 @@ void AliPHOS::Digits2Raw() } // get mapping from OCDB - const TObjArray* maps = AliPHOSRecoParamEmc::GetMappings(); + const TObjArray* maps = AliPHOSRecoParam::GetMappings(); if(!maps) AliFatal("Cannot retrieve ALTRO mappings!!"); // some digitization constants @@ -473,15 +472,6 @@ void AliPHOS::Digits2Raw() Float_t eMax=-333; //!!!for debug!!! - TObjArray *cpvDigitsAll = new TObjArray(); - TClonesArray *cpvDigitsModule; - Int_t *nCPVdigits = new Int_t[geom->GetNModules()]; - Int_t module; - for (module=0; moduleGetNModules(); module++) { - cpvDigitsAll->Add(new TClonesArray("AliPHOSDigit",100)); - nCPVdigits[module] = 0; - } - // loop over digits (assume ordered digits) for (Int_t iDigit = 0; iDigit < digits->GetEntries(); iDigit++) { AliPHOSDigit* digit = dynamic_cast(digits->At(iDigit)) ; @@ -489,19 +479,13 @@ void AliPHOS::Digits2Raw() // Skip small energy below treshold if (digit->GetEnergy() < kThreshold) continue; + // Skip CPV digits + if (digit->GetId() > geom->GetNModules() * geom->GetNCristalsInModule()) + continue; Int_t relId[4]; geom->AbsToRelNumbering(digit->GetId(), relId); - module = relId[0]; - - // Fill TObjArray of TClonesArray's with CPV digits per module - if (digit->GetId() > geom->GetNModules() * geom->GetNCristalsInModule()) { - cpvDigitsModule = (TClonesArray*)cpvDigitsAll->At(module-1); - new((*cpvDigitsModule)[nCPVdigits[module-1]++]) - AliPHOSDigit(-1,digit->GetId(),digit->GetAmp(),digit->GetTime()); - continue; - } - + Int_t module = relId[0]; // Begin FIXME if (relId[1] != 0) @@ -595,16 +579,6 @@ void AliPHOS::Digits2Raw() modMax,colMax,rowMax,eMax)); delete pulse; - - for (module=0; moduleGetNModules(); module++) { - AliDebug(2,Form("Number of CPV digits in module %d: %d/%d", - module, - ((TClonesArray*)cpvDigitsAll->At(module))->GetEntriesFast(), - nCPVdigits[module])); - } - AliPHOSCpvRawWrite *cpvRaw = new AliPHOSCpvRawWrite(); - cpvRaw->WriteRaw(cpvDigitsAll); - delete cpvRaw; loader->UnloadDigits(); } diff --git a/PHOS/AliPHOSClusterizerv1.cxx b/PHOS/AliPHOSClusterizerv1.cxx index 4450e4d56be..33098168647 100644 --- a/PHOS/AliPHOSClusterizerv1.cxx +++ b/PHOS/AliPHOSClusterizerv1.cxx @@ -202,7 +202,6 @@ AliPHOSClusterizerv1::AliPHOSClusterizerv1() : { // default ctor (to be used mainly by Streamer) - InitParameters() ; fDefaultInit = kTRUE ; } @@ -218,7 +217,6 @@ AliPHOSClusterizerv1::AliPHOSClusterizerv1(AliPHOSGeometry *geom) : { // ctor with the indication of the file where header Tree and digits Tree are stored - InitParameters() ; Init() ; fDefaultInit = kFALSE ; } @@ -383,25 +381,22 @@ void AliPHOSClusterizerv1::InitParameters() fNumberOfCpvClusters = 0 ; fNumberOfEmcClusters = 0 ; - const AliPHOSRecoParam* parEmc = AliPHOSReconstructor::GetRecoParamEmc(); - if(!parEmc) AliFatal("Reconstruction parameters for EMC not set!"); + const AliPHOSRecoParam* recoParam = AliPHOSReconstructor::GetRecoParam(); + if(!recoParam) AliFatal("Reconstruction parameters are not set!"); - const AliPHOSRecoParam* parCpv = AliPHOSReconstructor::GetRecoParamCpv(); - if(!parCpv) AliFatal("Reconstruction parameters for CPV not set!"); - - fCpvClusteringThreshold = parCpv->GetClusteringThreshold(); - fEmcClusteringThreshold = parEmc->GetClusteringThreshold(); + fCpvClusteringThreshold = recoParam->GetEMCClusteringThreshold(); + fEmcClusteringThreshold = recoParam->GetCPVClusteringThreshold(); - fEmcLocMaxCut = parEmc->GetLocalMaxCut(); - fCpvLocMaxCut = parCpv->GetLocalMaxCut(); + fEmcLocMaxCut = recoParam->GetEMCLocalMaxCut(); + fCpvLocMaxCut = recoParam->GetCPVLocalMaxCut(); - fW0 = parEmc->GetLogWeight(); - fW0CPV = parCpv->GetLogWeight(); + fW0 = recoParam->GetEMCLogWeight(); + fW0CPV = recoParam->GetCPVLogWeight(); fEmcTimeGate = 1.e-6 ; - fEcoreRadius = parEmc->GetEcoreRadius(); + fEcoreRadius = recoParam->GetEMCEcoreRadius(); - fToUnfold = parEmc->ToUnfold() ; + fToUnfold = recoParam->EMCToUnfold() ; fWrite = kTRUE ; } @@ -489,7 +484,7 @@ void AliPHOSClusterizerv1::WriteRecPoints() Int_t index ; //Evaluate position, dispersion and other RecPoint properties.. Int_t nEmc = fEMCRecPoints->GetEntriesFast(); - Float_t emcMinE= AliPHOSReconstructor::GetRecoParamEmc()->GetMinE(); //Minimal digit energy + Float_t emcMinE= AliPHOSReconstructor::GetRecoParam()->GetEMCMinE(); //Minimal digit energy TVector3 fakeVtx(0.,0.,0.) ; for(index = 0; index < nEmc; index++){ AliPHOSEmcRecPoint * rp = diff --git a/PHOS/AliPHOSClusterizerv1.h b/PHOS/AliPHOSClusterizerv1.h index 49c9fa46a5b..1f9748a3aa2 100644 --- a/PHOS/AliPHOSClusterizerv1.h +++ b/PHOS/AliPHOSClusterizerv1.h @@ -75,6 +75,8 @@ public: AliPHOSClusterizerv1() ; AliPHOSClusterizerv1(AliPHOSGeometry *geom); virtual ~AliPHOSClusterizerv1() ; + + void InitParameters() ; virtual Int_t AreNeighbours(AliPHOSDigit * d1, AliPHOSDigit * d2)const ; // Checks if digits are in neighbour cells @@ -130,7 +132,6 @@ private: Bool_t FindFit(AliPHOSEmcRecPoint * emcRP, AliPHOSDigit ** MaxAt, Float_t * maxAtEnergy, Int_t NPar, Float_t * FitParametres) const; //Used in UnfoldClusters, calls TMinuit void Init() ; - void InitParameters() ; virtual void MakeUnfolding() ; void UnfoldCluster(AliPHOSEmcRecPoint * iniEmc,Int_t Nmax, diff --git a/PHOS/AliPHOSQADataMaker.cxx b/PHOS/AliPHOSQADataMaker.cxx index 7794d7f29c7..640eb1d6899 100644 --- a/PHOS/AliPHOSQADataMaker.cxx +++ b/PHOS/AliPHOSQADataMaker.cxx @@ -315,7 +315,7 @@ void AliPHOSQADataMaker::MakeRaws(AliRawReader* rawReader) const Int_t modMax = 5 ; rawReader->Reset() ; AliPHOSRawDecoder decoder(rawReader); - decoder.SubtractPedestals(AliPHOSReconstructor::GetRecoParamEmc()->SubtractPedestals()); + decoder.SubtractPedestals(AliPHOSReconstructor::GetRecoParam()->EMCSubtractPedestals()); Int_t count = 0 ; while (decoder.NextDigit()) { Int_t module = decoder.GetModule() ; diff --git a/PHOS/AliPHOSQADataMakerRec.cxx b/PHOS/AliPHOSQADataMakerRec.cxx index 5dff7f133d1..fb8d97835dc 100644 --- a/PHOS/AliPHOSQADataMakerRec.cxx +++ b/PHOS/AliPHOSQADataMakerRec.cxx @@ -227,14 +227,14 @@ void AliPHOSQADataMakerRec::MakeRaws(AliRawReader* rawReader) //Fill prepared histograms with Raw digit properties rawReader->Reset() ; AliPHOSRawDecoder * decoder ; - if(strcmp(AliPHOSReconstructor::GetRecoParamEmc()->DecoderVersion(),"v1")==0) + if(strcmp(AliPHOSReconstructor::GetRecoParam()->EMCDecoderVersion(),"v1")==0) decoder=new AliPHOSRawDecoderv1(rawReader); else - if(strcmp(AliPHOSReconstructor::GetRecoParamEmc()->DecoderVersion(),"v2")==0) + if(strcmp(AliPHOSReconstructor::GetRecoParam()->EMCDecoderVersion(),"v2")==0) decoder=new AliPHOSRawDecoderv2(rawReader); else decoder=new AliPHOSRawDecoder(rawReader); - decoder->SubtractPedestals(AliPHOSReconstructor::GetRecoParamEmc()->SubtractPedestals()); + decoder->SubtractPedestals(AliPHOSReconstructor::GetRecoParam()->EMCSubtractPedestals()); Double_t lgEtot=0. ; Double_t hgEtot=0. ; Int_t lgNtot=0 ; diff --git a/PHOS/AliPHOSRawDigiProducer.cxx b/PHOS/AliPHOSRawDigiProducer.cxx index 89116f07784..88dba285e13 100644 --- a/PHOS/AliPHOSRawDigiProducer.cxx +++ b/PHOS/AliPHOSRawDigiProducer.cxx @@ -47,22 +47,35 @@ ClassImp(AliPHOSRawDigiProducer) AliPHOSCalibData * AliPHOSRawDigiProducer::fgCalibData = 0 ; //-------------------------------------------------------------------------------------- -AliPHOSRawDigiProducer::AliPHOSRawDigiProducer():TObject(), - fEmcMinE(0.),fCpvMinE(0.),fSampleQualityCut(1.), - fEmcCrystals(0),fGeom(0),fPulseGenerator(0){ - +AliPHOSRawDigiProducer::AliPHOSRawDigiProducer(): + TObject(), + fEmcMinE(0.), + fCpvMinE(0.), + fSampleQualityCut(1.), + fEmcCrystals(0), + fGeom(0), + fPulseGenerator(0) +{ + // Default constructor } //-------------------------------------------------------------------------------------- -AliPHOSRawDigiProducer::AliPHOSRawDigiProducer(const AliPHOSRecoParam* parEmc, const AliPHOSRecoParam* parCpv):TObject(), - fEmcMinE(0.),fCpvMinE(0.),fSampleQualityCut(1.),fEmcCrystals(0),fGeom(0),fPulseGenerator(0){ +AliPHOSRawDigiProducer::AliPHOSRawDigiProducer(const AliPHOSRecoParam* recoParam): + TObject(), + fEmcMinE(0.), + fCpvMinE(0.), + fSampleQualityCut(1.), + fEmcCrystals(0), + fGeom(0), + fPulseGenerator(0) +{ + // Constructor takes paramerters from recoParam - if(!parEmc) AliFatal("Reconstruction parameters for EMC not set!"); - if(!parCpv) AliFatal("Reconstruction parameters for CPV not set!"); + if(!recoParam) AliFatal("Reconstruction parameters are not set!"); - fEmcMinE = parEmc->GetMinE(); - fCpvMinE = parCpv->GetMinE(); + fEmcMinE = recoParam->GetEMCMinE(); + fCpvMinE = recoParam->GetCPVMinE(); - fSampleQualityCut = parEmc->GetSampleQualityCut() ; + fSampleQualityCut = recoParam->GetEMCSampleQualityCut() ; fGeom=AliPHOSGeometry::GetInstance() ; if(!fGeom) fGeom = AliPHOSGeometry::GetInstance("IHEP"); @@ -74,8 +87,16 @@ AliPHOSRawDigiProducer::AliPHOSRawDigiProducer(const AliPHOSRecoParam* parEmc, c GetCalibrationParameters() ; } //-------------------------------------------------------------------------------------- -AliPHOSRawDigiProducer::AliPHOSRawDigiProducer(const AliPHOSRawDigiProducer &dp):TObject(), - fEmcMinE(0.),fCpvMinE(0.),fSampleQualityCut(1.),fEmcCrystals(0),fGeom(0),fPulseGenerator(0){ +AliPHOSRawDigiProducer::AliPHOSRawDigiProducer(const AliPHOSRawDigiProducer &dp): + TObject(), + fEmcMinE(0.), + fCpvMinE(0.), + fSampleQualityCut(1.), + fEmcCrystals(0), + fGeom(0), + fPulseGenerator(0) +{ + // Copy constructor fEmcMinE = dp.fEmcMinE ; fCpvMinE = dp.fCpvMinE ; @@ -84,7 +105,10 @@ AliPHOSRawDigiProducer::AliPHOSRawDigiProducer(const AliPHOSRawDigiProducer &dp) fGeom = dp.fGeom ; } //-------------------------------------------------------------------------------------- -AliPHOSRawDigiProducer& AliPHOSRawDigiProducer::operator= (const AliPHOSRawDigiProducer &dp){ +AliPHOSRawDigiProducer& AliPHOSRawDigiProducer::operator= (const AliPHOSRawDigiProducer &dp) +{ + // Assign operator + if(&dp == this) return *this; fEmcMinE = dp.fEmcMinE ; @@ -97,9 +121,11 @@ AliPHOSRawDigiProducer& AliPHOSRawDigiProducer::operator= (const AliPHOSRawDigiP return *this; } //-------------------------------------------------------------------------------------- -AliPHOSRawDigiProducer::~AliPHOSRawDigiProducer(){ - if(fPulseGenerator) delete fPulseGenerator ; - fPulseGenerator=0 ; +AliPHOSRawDigiProducer::~AliPHOSRawDigiProducer() +{ + // Desctructor + if(fPulseGenerator) delete fPulseGenerator ; + fPulseGenerator=0 ; } //-------------------------------------------------------------------------------------- void AliPHOSRawDigiProducer::MakeDigits(TClonesArray *digits, AliPHOSRawDecoder* decoder) @@ -125,7 +151,7 @@ void AliPHOSRawDigiProducer::MakeDigits(TClonesArray *digits, AliPHOSRawDecoder* if(energy<=baseLine) //in ADC channels continue ; - //remove digits with bas shape. Decoder should calculate quality so that + //remove digits with bad shape. Decoder should calculate quality so that //in default case quality [0,1], while larger values of quality mean somehow //corrupted samples, 999 means obviously corrupted sample. //It is difficult to fit samples with overflow (even setting cut on overflow values) diff --git a/PHOS/AliPHOSRawDigiProducer.h b/PHOS/AliPHOSRawDigiProducer.h index 004afce2116..58aaf2f65f2 100644 --- a/PHOS/AliPHOSRawDigiProducer.h +++ b/PHOS/AliPHOSRawDigiProducer.h @@ -21,7 +21,7 @@ class AliPHOSRawDigiProducer: public TObject { public: AliPHOSRawDigiProducer() ; - AliPHOSRawDigiProducer(const AliPHOSRecoParam* parEmc, const AliPHOSRecoParam* parCpv) ; + AliPHOSRawDigiProducer(const AliPHOSRecoParam* recoParam) ; AliPHOSRawDigiProducer(const AliPHOSRawDigiProducer &dp); AliPHOSRawDigiProducer& operator= (const AliPHOSRawDigiProducer &dp); @@ -45,10 +45,10 @@ private: Float_t fCpvMinE ; // minimum energy of digit to be included into cluster Float_t fSampleQualityCut; // Cut on sample shapes: 0: no samples; 1: default parameterization; 999: accept even obviously bad - Int_t fEmcCrystals ; // number of EMC crystalls + Int_t fEmcCrystals ; // number of EMC crystals AliPHOSGeometry * fGeom ; //! PHOS geometry - static AliPHOSCalibData * fgCalibData ; //! Calibration database if aval. - AliPHOSPulseGenerator * fPulseGenerator ; //! Class with pulse parameters + static AliPHOSCalibData * fgCalibData ; //! Calibration database if avalable + AliPHOSPulseGenerator * fPulseGenerator ; //! Class with pulse shape parameters ClassDef(AliPHOSRawDigiProducer,2) }; diff --git a/PHOS/AliPHOSRecoParam.cxx b/PHOS/AliPHOSRecoParam.cxx index 1811e0c4a47..9b5aed093d1 100644 --- a/PHOS/AliPHOSRecoParam.cxx +++ b/PHOS/AliPHOSRecoParam.cxx @@ -20,23 +20,32 @@ // Author: Boris Polichtchouk. // --- AliRoot header files --- +#include "AliCDBManager.h" +#include "AliCDBEntry.h" #include "AliPHOSRecoParam.h" ClassImp(AliPHOSRecoParam) +TObjArray* AliPHOSRecoParam::fgkMaps =0; //ALTRO mappings + //----------------------------------------------------------------------------- AliPHOSRecoParam::AliPHOSRecoParam() : AliDetectorRecoParam(), - fClusteringThreshold(9999), - fLocMaxCut(9999), - fMinE(9999), - fW0(9999), - fSampleQualityCut(1.), - fEcoreRadius(3.), - fEcore2ESD(kFALSE), - fSubtractPedestals(kTRUE), - fUnfold(kTRUE), - fDecoderVersion("") + fEMCClusteringThreshold(0.2), + fEMCLocMaxCut(0.03), + fEMCMinE(0.01), + fEMCW0(4.5), + fEMCSampleQualityCut(1.), + fEMCEcoreRadius(3.), + fEMCEcore2ESD(kFALSE), + fEMCSubtractPedestals(kTRUE), + fEMCUnfold(kTRUE), + fEMCDecoderVersion(""), + fCPVClusteringThreshold(0.0), + fCPVLocMaxCut(0.03), + fCPVMinE(0.0), + fCPVW0(4.0), + fCPVUnfold(kTRUE) { //Default constructor. } @@ -44,16 +53,21 @@ AliPHOSRecoParam::AliPHOSRecoParam() : //----------------------------------------------------------------------------- AliPHOSRecoParam::AliPHOSRecoParam(const AliPHOSRecoParam& ): AliDetectorRecoParam(), - fClusteringThreshold(9999), - fLocMaxCut(9999), - fMinE(9999), - fW0(9999), - fSampleQualityCut(1.), - fEcoreRadius(3.), - fEcore2ESD(kFALSE), - fSubtractPedestals(kTRUE), - fUnfold(kTRUE), - fDecoderVersion("") + fEMCClusteringThreshold(0.2), + fEMCLocMaxCut(0.03), + fEMCMinE(0.01), + fEMCW0(4.5), + fEMCSampleQualityCut(1.), + fEMCEcoreRadius(3.), + fEMCEcore2ESD(kFALSE), + fEMCSubtractPedestals(kTRUE), + fEMCUnfold(kTRUE), + fEMCDecoderVersion(""), + fCPVClusteringThreshold(0.0), + fCPVLocMaxCut(0.03), + fCPVMinE(0.0), + fCPVW0(4.0), + fCPVUnfold(kTRUE) { //Copy constructor. } @@ -64,16 +78,53 @@ AliPHOSRecoParam& AliPHOSRecoParam::operator = (const AliPHOSRecoParam& recoPara //Assignment operator. if(this != &recoParam) { - fClusteringThreshold = recoParam.fClusteringThreshold; - fLocMaxCut = recoParam.fLocMaxCut; - fMinE = recoParam.fMinE; - fW0 = recoParam.fW0; - fSampleQualityCut = recoParam.fSampleQualityCut ; - fEcoreRadius = recoParam.fEcoreRadius ; - fSubtractPedestals = recoParam.fSubtractPedestals; - fUnfold = recoParam.fUnfold; - fDecoderVersion = recoParam.fDecoderVersion ; + fEMCClusteringThreshold = recoParam.fEMCClusteringThreshold; + fEMCLocMaxCut = recoParam.fEMCLocMaxCut; + fEMCMinE = recoParam.fEMCMinE; + fEMCW0 = recoParam.fEMCW0; + fEMCSampleQualityCut = recoParam.fEMCSampleQualityCut; + fEMCEcoreRadius = recoParam.fEMCEcoreRadius; + fEMCEcore2ESD = recoParam.fEMCEcore2ESD; + fEMCSubtractPedestals = recoParam.fEMCSubtractPedestals; + fEMCUnfold = recoParam.fEMCUnfold; + fEMCDecoderVersion = recoParam.fEMCDecoderVersion; + fCPVClusteringThreshold = recoParam.fCPVClusteringThreshold; + fCPVLocMaxCut = recoParam.fCPVLocMaxCut; + fCPVMinE = recoParam.fCPVMinE; + fCPVW0 = recoParam.fCPVW0; + fCPVUnfold = recoParam.fCPVUnfold; } return *this; } + +//----------------------------------------------------------------------------- +AliPHOSRecoParam* AliPHOSRecoParam::GetDefaultParameters() +{ + //Default parameters for the reconstruction + + AliPHOSRecoParam* params = new AliPHOSRecoParam(); + return params; +} + +//----------------------------------------------------------------------------- +const TObjArray* AliPHOSRecoParam::GetMappings() +{ + //Returns array of AliAltroMappings for RCU0..RCU3. + //If not found, read it from OCDB. + + //Quick check as follows: + // root [0] AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT"); + // root [1] AliCDBManager::Instance()->SetRun(1); + // root [2] TObjArray* maps = AliPHOSRecoParam::GetMappings(); + // root [3] maps->Print(); + + if(fgkMaps) return fgkMaps; + + AliCDBEntry* entry = AliCDBManager::Instance()->Get("PHOS/Calib/Mapping"); + if(entry) + fgkMaps = (TObjArray*)entry->GetObject(); + + return fgkMaps; + +} diff --git a/PHOS/AliPHOSRecoParam.h b/PHOS/AliPHOSRecoParam.h index e4a31e7eff3..96c7a740a65 100644 --- a/PHOS/AliPHOSRecoParam.h +++ b/PHOS/AliPHOSRecoParam.h @@ -19,42 +19,65 @@ public: AliPHOSRecoParam& operator = (const AliPHOSRecoParam& recoParam); virtual ~AliPHOSRecoParam() {} - Float_t GetClusteringThreshold() const { return fClusteringThreshold; } - Float_t GetLocalMaxCut() const { return fLocMaxCut; } - Float_t GetMinE() const { return fMinE; } - Float_t GetLogWeight() const { return fW0; } - Float_t GetSampleQualityCut() const { return fSampleQualityCut; } - Float_t GetEcoreRadius() const { return fEcoreRadius; } - Bool_t Ecore2ESD() const { return fEcore2ESD; } - Bool_t SubtractPedestals() const { return fSubtractPedestals; } - Bool_t ToUnfold() const { return fUnfold; } - const char* DecoderVersion() const { return fDecoderVersion.Data();} - - void SetClusteringThreshold(Float_t cluth) { fClusteringThreshold=cluth; } - void SetLocalMaxCut(Float_t cut) { fLocMaxCut =cut; } - void SetMinE(Float_t minE) { fMinE =minE; } - void SetLogWeight(Float_t w) { fW0 =w; } - void SetSampleQualityCut(Float_t qu) { fSampleQualityCut =qu; } - void SetEcoreRadius(Float_t rCore) { fEcoreRadius =rCore; } - void SetEcore2ESD(Bool_t ecore) { fEcore2ESD =ecore; } - void SetSubtractPedestals(Bool_t subtract) { fSubtractPedestals =subtract;} - void SetDecoderVersion(const char* version="v1"){fDecoderVersion =version ;} - void SetUnfolding(Bool_t toUnfold=kFALSE) {fUnfold =toUnfold;} + Float_t GetEMCClusteringThreshold() const { return fEMCClusteringThreshold; } + Float_t GetEMCLocalMaxCut() const { return fEMCLocMaxCut; } + Float_t GetEMCMinE() const { return fEMCMinE; } + Float_t GetEMCLogWeight() const { return fEMCW0; } + Float_t GetEMCSampleQualityCut() const { return fEMCSampleQualityCut; } + Float_t GetEMCEcoreRadius() const { return fEMCEcoreRadius; } + Bool_t EMCEcore2ESD() const { return fEMCEcore2ESD; } + Bool_t EMCSubtractPedestals() const { return fEMCSubtractPedestals; } + Bool_t EMCToUnfold() const { return fEMCUnfold; } + const char* EMCDecoderVersion() const { return fEMCDecoderVersion.Data();} + + Float_t GetCPVClusteringThreshold() const { return fCPVClusteringThreshold; } + Float_t GetCPVLocalMaxCut() const { return fCPVLocMaxCut; } + Float_t GetCPVMinE() const { return fCPVMinE; } + Float_t GetCPVLogWeight() const { return fCPVW0; } + Bool_t CPVToUnfold() const { return fCPVUnfold; } + + void SetEMCClusteringThreshold(Float_t cluth) { fEMCClusteringThreshold=cluth; } + void SetEMCLocalMaxCut(Float_t cut) { fEMCLocMaxCut =cut; } + void SetEMCMinE(Float_t minE) { fEMCMinE =minE; } + void SetEMCLogWeight(Float_t w) { fEMCW0 =w; } + void SetEMCSampleQualityCut(Float_t qu) { fEMCSampleQualityCut =qu; } + void SetEMCEcoreRadius(Float_t rCore) { fEMCEcoreRadius =rCore; } + void SetEMCEcore2ESD(Bool_t ecore) { fEMCEcore2ESD =ecore; } + void SetEMCSubtractPedestals(Bool_t subtract) { fEMCSubtractPedestals =subtract;} + void SetEMCDecoderVersion(const char* version="v1"){ fEMCDecoderVersion =version ;} + void SetEMCUnfolding(Bool_t toUnfold=kFALSE) { fEMCUnfold =toUnfold;} + + void SetCPVClusteringThreshold(Float_t cluth) { fCPVClusteringThreshold=cluth; } + void SetCPVLocalMaxCut(Float_t cut) { fCPVLocMaxCut =cut; } + void SetCPVMinE(Float_t minE) { fCPVMinE =minE; } + void SetCPVLogWeight(Float_t w) { fCPVW0 =w; } + void SetCPVUnfolding(Bool_t toUnfold=kFALSE) { fCPVUnfold =toUnfold;} + + static AliPHOSRecoParam* GetDefaultParameters(); + static const TObjArray* GetMappings(); protected: - Float_t fClusteringThreshold; // Min.digit energy to start a new cluster, in GeV - Float_t fLocMaxCut; // Min.energy difference between two local maxima, in GeV - Float_t fMinE; // Min.E in the digits list associated with rec.point, in GeV - Float_t fW0; // Log.weight to evaluate a local coordinate of rec.point - Float_t fSampleQualityCut; // Cut on pusle shape fit quality - Float_t fEcoreRadius; // Radius within which the core energy is calculated, in cm - Bool_t fEcore2ESD; // true if Ecore is stored in ESD instead of Etot - Bool_t fSubtractPedestals; // true if pedestal should be subtracted (in non-ZS) - Bool_t fUnfold; // true if overlapped clusters should be unfolded - TString fDecoderVersion ; // AliPHOSRawDecoder version - - ClassDef(AliPHOSRecoParam,5) + Float_t fEMCClusteringThreshold; // EMC: Min.digit energy to start a new cluster, in GeV + Float_t fEMCLocMaxCut; // EMC: Min.energy difference between two local maxima, in GeV + Float_t fEMCMinE; // EMC: Min.E in the digits list associated with rec.point, in GeV + Float_t fEMCW0; // EMC: Log.weight to evaluate a local coordinate of rec.point + Float_t fEMCSampleQualityCut; // EMC: Cut on pulse shape fit quality + Float_t fEMCEcoreRadius; // EMC: Radius within which the core energy is calculated, in cm + Bool_t fEMCEcore2ESD; // EMC: true if Ecore is stored in ESD instead of Etot + Bool_t fEMCSubtractPedestals; // EMC: true if pedestal should be subtracted (in non-ZS) + Bool_t fEMCUnfold; // EMC: true if overlapped clusters should be unfolded + TString fEMCDecoderVersion ; // EMC: AliPHOSRawDecoder version + + Float_t fCPVClusteringThreshold; // CPV: Min.digit energy to start a new cluster, in GeV + Float_t fCPVLocMaxCut; // CPV: Min.energy difference between two local maxima, in GeV + Float_t fCPVMinE; // CPV: Min.E in the digits list associated with rec.point, in GeV + Float_t fCPVW0; // CPV: Log.weight to evaluate a local coordinate of rec.point + Bool_t fCPVUnfold; // CPV: true if overlapped clusters should be unfolded + + static TObjArray* fgkMaps; // ALTRO mappings for RCU0..RCU3 + + ClassDef(AliPHOSRecoParam,6) }; #endif diff --git a/PHOS/AliPHOSReconstructor.cxx b/PHOS/AliPHOSReconstructor.cxx index 8792cebcb52..d799773288c 100644 --- a/PHOS/AliPHOSReconstructor.cxx +++ b/PHOS/AliPHOSReconstructor.cxx @@ -37,11 +37,10 @@ #include "AliPHOSPIDv1.h" #include "AliPHOSTracker.h" #include "AliRawReader.h" +#include "AliCDBEntry.h" +#include "AliCDBManager.h" #include "AliPHOSTrigger.h" #include "AliPHOSGeometry.h" -#include "AliPHOSRecoParam.h" -#include "AliPHOSRecoParamEmc.h" -#include "AliPHOSRecoParamCpv.h" #include "AliPHOSDigit.h" #include "AliPHOSTrackSegment.h" #include "AliPHOSEmcRecPoint.h" @@ -55,8 +54,6 @@ ClassImp(AliPHOSReconstructor) Bool_t AliPHOSReconstructor::fgDebug = kFALSE ; -AliPHOSRecoParam* AliPHOSReconstructor::fgkRecoParamEmc =0; // EMC rec. parameters -AliPHOSRecoParam* AliPHOSReconstructor::fgkRecoParamCpv =0; // CPV rec. parameters TClonesArray* AliPHOSReconstructor::fgDigitsArray = 0; // Array of PHOS digits TObjArray* AliPHOSReconstructor::fgEMCRecPoints = 0; // Array of EMC rec.points @@ -65,17 +62,6 @@ AliPHOSReconstructor::AliPHOSReconstructor() : fGeom(NULL),fClusterizer(NULL),fTSM(NULL),fPID(NULL) { // ctor - - if (!fgkRecoParamEmc) { - AliWarning("The Reconstruction parameters for EMC nonitialized - Used default one"); - fgkRecoParamEmc = AliPHOSRecoParamEmc::GetEmcDefaultParameters(); - } - - if (!fgkRecoParamCpv) { - AliWarning("The Reconstruction parameters for CPV nonitialized - Used default one"); - fgkRecoParamCpv = AliPHOSRecoParamCpv::GetCpvDefaultParameters(); - } - fGeom = AliPHOSGeometry::GetInstance("IHEP",""); fClusterizer = new AliPHOSClusterizerv1 (fGeom); fTSM = new AliPHOSTrackSegmentMakerv1(fGeom); @@ -104,6 +90,7 @@ void AliPHOSReconstructor::Reconstruct(TTree* digitsTree, TTree* clustersTree) c // segment maker needs access to the AliESDEvent object to retrieve the tracks reconstructed by // the global tracking. + fClusterizer->InitParameters(); fClusterizer->SetInput(digitsTree); fClusterizer->SetOutput(clustersTree); if ( Debug() ) @@ -289,7 +276,7 @@ void AliPHOSReconstructor::FillESD(TTree* digitsTree, TTree* clustersTree, Int_t *primList = emcRP->GetPrimaries(primMult); Float_t energy; - if (fgkRecoParamEmc->Ecore2ESD()) + if (GetRecoParam()->EMCEcore2ESD()) energy = emcRP->GetCoreEnergy(); else energy = rp->Energy(); @@ -354,7 +341,7 @@ void AliPHOSReconstructor::ConvertDigits(AliRawReader* rawReader, TTree* digits AliPHOSRawDecoder * dc ; - const TObjArray* maps = AliPHOSRecoParamEmc::GetMappings(); + const TObjArray* maps = AliPHOSRecoParam::GetMappings(); if(!maps) AliFatal("Cannot retrieve ALTRO mappings!!"); AliAltroMapping *mapping[4]; @@ -362,22 +349,21 @@ void AliPHOSReconstructor::ConvertDigits(AliRawReader* rawReader, TTree* digits mapping[i] = (AliAltroMapping*)maps->At(i); } - if(strcmp(fgkRecoParamEmc->DecoderVersion(),"v1")==0) + if (strcmp(GetRecoParam()->EMCDecoderVersion(),"v1")==0) dc=new AliPHOSRawDecoderv1(rawReader,mapping); - else - if(strcmp(fgkRecoParamEmc->DecoderVersion(),"v2")==0) - dc=new AliPHOSRawDecoderv2(rawReader,mapping); - else - dc=new AliPHOSRawDecoder(rawReader,mapping); + else if (strcmp(GetRecoParam()->EMCDecoderVersion(),"v2")==0) + dc=new AliPHOSRawDecoderv2(rawReader,mapping); + else + dc=new AliPHOSRawDecoder(rawReader,mapping); - dc->SubtractPedestals(fgkRecoParamEmc->SubtractPedestals()); + dc->SubtractPedestals(GetRecoParam()->EMCSubtractPedestals()); TClonesArray *digits = new TClonesArray("AliPHOSDigit",1); digits->SetName("DIGITS"); Int_t bufsize = 32000; digitsTree->Branch("PHOS", &digits, bufsize); - AliPHOSRawDigiProducer pr(fgkRecoParamEmc,fgkRecoParamCpv); + AliPHOSRawDigiProducer pr(GetRecoParam()); pr.MakeDigits(digits,dc); delete dc ; diff --git a/PHOS/AliPHOSReconstructor.h b/PHOS/AliPHOSReconstructor.h index b239d83bdda..278c96dcd33 100644 --- a/PHOS/AliPHOSReconstructor.h +++ b/PHOS/AliPHOSReconstructor.h @@ -47,8 +47,9 @@ #include #include "AliReconstructor.h" -#include "AliPHOSRecoParamEmc.h" -#include "AliPHOSRecoParamCpv.h" +#include "AliPHOSRecoParam.h" +// #include "AliPHOSRecoParamEmc.h" +// #include "AliPHOSRecoParamCpv.h" class AliPHOSDigitizer ; class AliPHOSClusterizer ; class AliPHOSClusterizerv1 ; @@ -101,29 +102,12 @@ public: return *this ; } - static void SetRecoParamEmc(AliPHOSRecoParam * param){ fgkRecoParamEmc = param;} - static void SetRecoParamCpv(AliPHOSRecoParam * param){ fgkRecoParamCpv = param;} - - static const AliPHOSRecoParam* GetRecoParamEmc(){ - if (!fgkRecoParamEmc) { - cerr<<"The Reconstruction parameters for EMC nonitialized - Used default one"<(AliReconstructor::GetRecoParam(4)); } private: static Bool_t fgDebug ; //! verbosity controller - static AliPHOSRecoParam *fgkRecoParamEmc; // reconstruction parameters for EMC - static AliPHOSRecoParam *fgkRecoParamCpv; // reconstruction parameters for EMC AliPHOSGeometry *fGeom; // pointer to the PHOS geometry AliPHOSClusterizerv1 *fClusterizer; //! PHOS clusterizer AliPHOSTrackSegmentMaker *fTSM; //! PHOS TrackSegmentMaker @@ -131,7 +115,7 @@ private: static TClonesArray *fgDigitsArray; //! Array of PHOS digits static TObjArray *fgEMCRecPoints; //! Array of EMC rec.points - ClassDef(AliPHOSReconstructor,7) // PHOS Reconstruction class + ClassDef(AliPHOSReconstructor,8) // PHOS Reconstruction class }; diff --git a/PHOS/PHOSbaseLinkDef.h b/PHOS/PHOSbaseLinkDef.h index 69a180b2430..adb437f27d3 100644 --- a/PHOS/PHOSbaseLinkDef.h +++ b/PHOS/PHOSbaseLinkDef.h @@ -42,13 +42,10 @@ #pragma link C++ class AliPHOSTrackSegment+; #pragma link C++ class AliPHOSRecoParam+; -#pragma link C++ class AliPHOSRecoParamEmc+; -#pragma link C++ class AliPHOSRecoParamCpv+; #pragma link C++ class AliPHOSSimParam+; #pragma link C++ class AliPHOSConTableDB+; #pragma link C++ class AliPHOSImpact+; #pragma link C++ class AliPHOSTrigger+; -#pragma link C++ class AliPHOSCpvRawWrite+; #endif diff --git a/PHOS/libPHOSbase.pkg b/PHOS/libPHOSbase.pkg index cfe25a1cba3..6b0a6d07faa 100644 --- a/PHOS/libPHOSbase.pkg +++ b/PHOS/libPHOSbase.pkg @@ -29,12 +29,9 @@ SRCS = \ AliPHOSEmcRecPoint.cxx \ AliPHOSCpvRecPoint.cxx AliPHOSTrackSegment.cxx \ AliPHOSRecoParam.cxx \ - AliPHOSRecoParamEmc.cxx \ - AliPHOSRecoParamCpv.cxx \ AliPHOSImpact.cxx \ AliPHOSTrigger.cxx \ - AliPHOSSimParam.cxx \ - AliPHOSCpvRawWrite.cxx + AliPHOSSimParam.cxx HDRS:= $(SRCS:.cxx=.h) diff --git a/RAW/AliDAQ.cxx b/RAW/AliDAQ.cxx index d27feb9e340..a82473a06fd 100644 --- a/RAW/AliDAQ.cxx +++ b/RAW/AliDAQ.cxx @@ -115,6 +115,54 @@ Float_t AliDAQ::fgkNumberOfLdcs[AliDAQ::kNDetectors] = { 5 }; +const char* AliDAQ::fgkOfflineModuleName[AliDAQ::kNDetectors] = { + "ITS", + "ITS", + "ITS", + "TPC", + "TRD", + "TOF", + "HMPID", + "PHOS", + "CPV", + "PMD", + "MUON", + "MUON", + "FMD", + "T0", + "VZERO", + "ZDC", + "ACORDE", + "CTP", + "EMCAL", + "", + "HLT" +}; + +const char* AliDAQ::fgkOnlineName[AliDAQ::kNDetectors] = { + "SPD", + "SDD", + "SSD", + "TPC", + "TRD", + "TOF", + "HMP", + "PHS", + "CPV", + "PMD", + "MCH", + "MTR", + "FMD", + "T00", + "V00", + "ZDC", + "ACO", + "TRI", + "EMC", + "TST", + "HLT" +}; + AliDAQ::AliDAQ(const AliDAQ& source) : TObject(source) { @@ -342,20 +390,21 @@ void AliDAQ::PrintConfig() { // Print the DAQ configuration // for all the detectors - printf("====================================================================\n" - "| ALICE Data Acquisition Configuration |\n" - "====================================================================\n" - "| Detector ID | Detector Name | DDL Offset | # of DDLs | # of LDCs |\n" - "====================================================================\n"); + printf("===================================================================================================\n" + "| ALICE Data Acquisition Configuration |\n" + "===================================================================================================\n" + "| Detector ID | Detector Name | DDL Offset | # of DDLs | # of LDCs | Online Name | AliRoot Module |\n" + "===================================================================================================\n"); for(Int_t iDet = 0; iDet < kNDetectors; iDet++) { - printf("|%11d |%13s |%10d |%9d |%9.1f |\n", - iDet,DetectorName(iDet),DdlIDOffset(iDet),NumberOfDdls(iDet),NumberOfLdcs(iDet)); + printf("|%11d |%13s |%10d |%9d |%9.1f |%11s |%14s |\n", + iDet,DetectorName(iDet),DdlIDOffset(iDet),NumberOfDdls(iDet),NumberOfLdcs(iDet), + OnlineName(iDet),OfflineModuleName(iDet)); } - printf("====================================================================\n"); + printf("===================================================================================================\n"); } -const char *AliDAQ::ListOfTriggeredDetectors(Int_t detectorPattern) +const char *AliDAQ::ListOfTriggeredDetectors(UInt_t detectorPattern) { // Returns a string with the list of // active detectors. The input is the @@ -377,3 +426,74 @@ const char *AliDAQ::ListOfTriggeredDetectors(Int_t detectorPattern) return detList.Data(); } +UInt_t AliDAQ::DetectorPattern(const char *detectorList) +{ + // Returns a 32-bit word containing the + // the detector pattern corresponding to a given + // list of detectors + UInt_t pattern = 0; + TString detList = detectorList; + for(Int_t iDet = 0; iDet < (kNDetectors-1); iDet++) { + TString det = fgkDetectorName[iDet]; + if((detList.CompareTo(det) == 0) || + detList.BeginsWith(det) || + detList.EndsWith(det) || + detList.Contains( " "+det+" " )) pattern |= (1 << iDet) ; + } + + // HLT + TString hltDet = fgkDetectorName[kNDetectors-1]; + if((detList.CompareTo(hltDet) == 0) || + detList.BeginsWith(hltDet) || + detList.EndsWith(hltDet) || + detList.Contains( " "+hltDet+" " )) pattern |= (1 << kHLTId) ; + + return pattern; +} + +const char *AliDAQ::OfflineModuleName(const char *detectorName) +{ + // Returns the name of the offline module + // for a given detector (online naming convention) + Int_t detectorID = DetectorID(detectorName); + if (detectorID < 0) + return ""; + + return OfflineModuleName(detectorID); +} + +const char *AliDAQ::OfflineModuleName(Int_t detectorID) +{ + // Returns the name of the offline module + // for a given detector (online naming convention) + if (detectorID < 0 || detectorID >= kNDetectors) { + AliErrorClass(Form("Invalid detector index: %d (%d -> %d) !",detectorID,0,kNDetectors-1)); + return ""; + } + + return fgkOfflineModuleName[detectorID]; +} + +const char *AliDAQ::OnlineName(const char *detectorName) +{ + // Returns the name of the online detector name (3 characters) + // for a given detector + Int_t detectorID = DetectorID(detectorName); + if (detectorID < 0) + return ""; + + return OnlineName(detectorID); +} + +const char *AliDAQ::OnlineName(Int_t detectorID) +{ + // Returns the name of the online detector name (3 characters) + // for a given detector + if (detectorID < 0 || detectorID >= kNDetectors) { + AliErrorClass(Form("Invalid detector index: %d (%d -> %d) !",detectorID,0,kNDetectors-1)); + return ""; + } + + return fgkOnlineName[detectorID]; +} + diff --git a/RAW/AliDAQ.h b/RAW/AliDAQ.h index ca9e98bc8a5..1cc0dbd874a 100644 --- a/RAW/AliDAQ.h +++ b/RAW/AliDAQ.h @@ -58,7 +58,14 @@ class AliDAQ: public TObject { static void PrintConfig(); - static const char *ListOfTriggeredDetectors(Int_t detectorPattern); + static const char *ListOfTriggeredDetectors(UInt_t detectorPattern); + static UInt_t DetectorPattern(const char *detectorList); + + static const char *OfflineModuleName(const char *detectorName); + static const char *OfflineModuleName(Int_t detectorID); + + static const char *OnlineName(const char *detectorName); + static const char *OnlineName(Int_t detectorID); enum { kNDetectors = 21, // Number of detectors @@ -70,8 +77,10 @@ class AliDAQ: public TObject { static const char *fgkDetectorName[kNDetectors]; // Detector names static Int_t fgkNumberOfDdls[kNDetectors]; // Number of DDLs per detector static Float_t fgkNumberOfLdcs[kNDetectors]; // Number of LDCs per detector (not fixed - used only for the raw data simulation) + static const char* fgkOfflineModuleName[kNDetectors]; // Names of the offline modules corresponding to the detectors + static const char* fgkOnlineName[kNDetectors]; // Online (DAQ/ECS) detector names - ClassDef(AliDAQ, 2) // ALICE DAQ Configuration class + ClassDef(AliDAQ, 3) // ALICE DAQ Configuration class }; #endif diff --git a/STEER/AliCentralTrigger.cxx b/STEER/AliCentralTrigger.cxx index 5e005e455a8..8aa76fd61a2 100644 --- a/STEER/AliCentralTrigger.cxx +++ b/STEER/AliCentralTrigger.cxx @@ -127,7 +127,7 @@ void AliCentralTrigger::MakeBranch( TString name, TTree * tree ) TBranch* branch = tree->GetBranch( name ); if( branch == 0x0 ) { AliDebug( 1, "Creating new branch" ); - branch = tree->Branch( name, &(this->fClassMask), "fClassMask/l" ); + branch = tree->Branch( name, &(this->fClassMask), "fClassMask/l:fClusterMask/i" ); branch->SetAutoDelete( kFALSE ); } else { @@ -160,7 +160,7 @@ Bool_t AliCentralTrigger::LoadConfiguration( TString & config ) } else { // Load one and only one trigger descriptor from CDB - AliInfo( "GETTING TRIGGER DESCRIPTORS FROM CDB!!!" ); + AliInfo( "Getting trigger configuration from OCDB!" ); AliCDBPath path( "GRP", "CTP", "Config" ); @@ -299,6 +299,8 @@ ULong64_t AliCentralTrigger::TriggerClasses() { // Check trigger conditions and create the trigger class // and trigger cluster masks + fClassMask = 0; + fClusterMask = 0; if (fConfiguration) { const TObjArray& classesArray = fConfiguration->GetClasses(); Int_t nclasses = classesArray.GetEntriesFast(); @@ -306,8 +308,10 @@ ULong64_t AliCentralTrigger::TriggerClasses() AliTriggerClass* trclass = (AliTriggerClass*)classesArray.At( j ); trclass->Trigger( fConfiguration->GetInputs(), fConfiguration->GetFunctions() ); fClassMask |= trclass->GetValue(); - if (trclass->GetStatus()) - fClusterMask |= (trclass->GetCluster())->GetClusterMask(); + if (trclass->GetStatus()) { + AliTriggerCluster *trclust = trclass->GetCluster(); + fClusterMask |= AliDAQ::DetectorPattern(trclust->GetDetectorsInCluster()); + } } } return fClassMask; @@ -379,58 +383,44 @@ Bool_t AliCentralTrigger::IsSelected( TString detName, TString& detectors ) cons } //_____________________________________________________________________________ -TString AliCentralTrigger::GetTriggeredDetectors() const +Bool_t AliCentralTrigger::CheckTriggeredDetectors() const { // Check the trigger mask, finds which trigger classes // have been fired, load the corresponding trigger clusters and // finally makes a list of the detectors that have been readout - // for each particular event + // for each particular event. This list is then compared to the + // one stored in fClusterMask. Return value: + // true = two lists are equal + // false = two lists are not equal meaning wrong trigger config + // is loaded. if (!fConfiguration) { - AliError("The trigger confiration has not yet been loaded!"); - return ""; - } - - // Now loop over the trigger classes - const TObjArray& classesArray = fConfiguration->GetClasses(); - Int_t nclasses = classesArray.GetEntriesFast(); - UChar_t clustMask = 0; - for( Int_t j=0; jGetMask() & fClassMask) { // class was fired - AliTriggerCluster *clust = trclass->GetCluster(); - clustMask |= clust->GetClusterMask(); - } + AliError("The trigger confiration has not yet been loaded! Cross-check is not possible!"); + return kFALSE; } + else { - // Compare the stored cluster mask with the one - // that we get from trigger classes - // To be enables after we store the cluster mask in the trigger tree - // if (clustMask != fClusterMask) - // AliError(Form("Wrong cluster mask from trigger classes (%x), expecting (%x)!",(UInt_t)clustMask,(UInt_t)fClusterMask)); - - // Now loop over clusters and produce the string - // with the triggered detectors - TString trigDets; - const TObjArray& clustArray = fConfiguration->GetClusters(); - Int_t nclust = clustArray.GetEntriesFast(); - for( Int_t i=0; iGetClusterMask()) { // the cluster was fired - TString detStr = clust->GetDetectorsInCluster(); - TObjArray* det = detStr.Tokenize(" "); - Int_t ndet = det->GetEntriesFast(); - for( Int_t j=0; jAt(j))->String(); - if((trigDets.CompareTo(detj) == 0) || - trigDets.BeginsWith(detj) || - trigDets.EndsWith(detj) || - trigDets.Contains( " "+detj+" " )) continue; - trigDets.Append( " " ); - trigDets.Append( detj ); + // Make a cross-check so that to exclude wrong trigger configuration used + // Loop over the trigger classes + UInt_t clusterMask = 0; + const TObjArray& classesArray = fConfiguration->GetClasses(); + Int_t nclasses = classesArray.GetEntriesFast(); + for( Int_t j=0; jGetMask() & fClassMask) { // class was fired + AliTriggerCluster *trclust = trclass->GetCluster(); + clusterMask |= AliDAQ::DetectorPattern(trclust->GetDetectorsInCluster()); } } + // Compare the stored cluster mask with the one + // that we get from trigger classes + // To be enables after we store the cluster mask in the trigger tree + if (clusterMask != fClusterMask) { + AliError(Form("Wrong cluster mask from trigger classes (%x), expecting (%x)! Loaded trigger configuration is possibly wrong!", + (UInt_t)clusterMask,(UInt_t)fClusterMask)); + return kFALSE; + } } - return trigDets; + return kTRUE; } diff --git a/STEER/AliCentralTrigger.h b/STEER/AliCentralTrigger.h index 351d69d00fa..bd08f573eeb 100644 --- a/STEER/AliCentralTrigger.h +++ b/STEER/AliCentralTrigger.h @@ -45,14 +45,19 @@ public: // Getters TString GetDetectors(); ULong64_t GetClassMask() const { return fClassMask; } - UChar_t GetClusterMask() const { return fClusterMask; } + UInt_t GetClusterMask() const { return fClusterMask; } AliTriggerConfiguration* GetConfiguration() { return fConfiguration; } TObjArray* GetFiredClasses() const; void Print( const Option_t* opt ="" ) const; - TString GetTriggeredDetectors() const; + Bool_t CheckTriggeredDetectors() const; + + // Setters to be used in case raw data when the trigger information + // is read from the event header + void SetClassMask(ULong64_t mask) { fClassMask = mask; } + void SetClusterMask(UInt_t mask) { fClusterMask = mask; } protected: ULong64_t fClassMask; // UID ( bitwise OR of conditions mask ) - UChar_t fClusterMask; // UID ( bitwise OR of clusters mask ) + UInt_t fClusterMask; // UID ( bitwise OR of clusters mask - detector pattern) AliTriggerConfiguration* fConfiguration; // Trigger Configuration used private: @@ -62,7 +67,7 @@ private: AliCentralTrigger( const AliCentralTrigger& ctp ); // Implemented AliCentralTrigger& operator=( const AliCentralTrigger& ctp ); // Not implemented - ClassDef( AliCentralTrigger, 3 ) // class for running the Central Trigger Processor + ClassDef( AliCentralTrigger, 5 ) // class for running the Central Trigger Processor }; diff --git a/STEER/AliDetectorRecoParam.cxx b/STEER/AliDetectorRecoParam.cxx index 3acfae6d8db..a64fe79e87c 100644 --- a/STEER/AliDetectorRecoParam.cxx +++ b/STEER/AliDetectorRecoParam.cxx @@ -20,7 +20,8 @@ // Base Class for detector Reconstruction Parameters // // // // -// AliDetectorRecoParam are identified according name +// AliDetectorRecoParam are identified according fEventSpecie - event specie(s) +// for which the object is valid. // The owner of the AliDetectorRecoParam is the AliRecoParam // More than one RecoParam per recon can be registered. // @@ -35,7 +36,8 @@ ClassImp(AliDetectorRecoParam) AliDetectorRecoParam::AliDetectorRecoParam(): - TNamed() + TNamed(), + fEventSpecie(0) { // // default constructor @@ -44,7 +46,7 @@ AliDetectorRecoParam::AliDetectorRecoParam(): AliDetectorRecoParam::~AliDetectorRecoParam(){ // - // default destructor + // destructor // } diff --git a/STEER/AliDetectorRecoParam.h b/STEER/AliDetectorRecoParam.h index 1ac3fb2d22c..67df07a527a 100644 --- a/STEER/AliDetectorRecoParam.h +++ b/STEER/AliDetectorRecoParam.h @@ -12,6 +12,8 @@ #include "TNamed.h" +#include "AliRecoParam.h" + class AliDetectorRecoParam : public TNamed { @@ -20,10 +22,16 @@ class AliDetectorRecoParam : public TNamed virtual ~AliDetectorRecoParam(); void Print(Option_t */*option*/) const {Dump();} -protected: + Int_t GetEventSpecie() const { return fEventSpecie; } + void SetEventSpecie(Int_t specie) { fEventSpecie = specie; } + void SetAsDefault() { fEventSpecie |= AliRecoParam::kDefault; } + Bool_t IsDefault() const { return (fEventSpecie & AliRecoParam::kDefault); } + +private: + Int_t fEventSpecie; // Event specie for which the reco-param object is valid - ClassDef(AliDetectorRecoParam, 2) + ClassDef(AliDetectorRecoParam, 3) }; diff --git a/STEER/AliEventInfo.cxx b/STEER/AliEventInfo.cxx index ab183f4838a..6f2417722d6 100644 --- a/STEER/AliEventInfo.cxx +++ b/STEER/AliEventInfo.cxx @@ -15,11 +15,13 @@ ////////////////////////////////////////////////////////////////////////////// // Class AliEventInfo // -// Container class for all the information related to LHCstate, run and // -// event types, trigger mask and trigger clusters. // -// It is used in order to provide the detector's AliRecoParam objects with// -// the necessary information so that they can decide which instance of // -// AliDetectorRecoParam to use in reconstruction one particular event. // +// Container class for all the information related to // +// event type, trigger mask and trigger clusters. // +// It is used together with AliRunInfo in order to provide the detector's // +// AliRecoParam object with // +// the necessary information so that it can decide which instance of // +// AliDetectorRecoParam objects to use in reconstruction one particular // +// event. // // // // cvetan.cheshkov@cern.ch 12/06/2008 // ////////////////////////////////////////////////////////////////////////////// @@ -31,10 +33,6 @@ ClassImp(AliEventInfo) //______________________________________________________________________________ AliEventInfo::AliEventInfo(): TObject(), - fLHCState("UNKNOWN"), - fBeamType("UNKNOWN"), - fRunType("UNKNOWN"), - fActiveDetectors(""), fEventType(0), fTriggerClasses(""), fTriggerMask(0), @@ -46,17 +44,17 @@ AliEventInfo::AliEventInfo(): } //______________________________________________________________________________ -AliEventInfo::AliEventInfo(const char *lhcState, const char *beamType, const char *runType, const char *activeDetectors): +AliEventInfo::AliEventInfo(UInt_t evType, + const char *classes, + ULong64_t mask, + const char *cluster, + const char *decision): TObject(), - fLHCState(lhcState), - fBeamType(beamType), - fRunType(runType), - fActiveDetectors(activeDetectors), - fEventType(0), - fTriggerClasses(""), - fTriggerMask(0), - fTriggerCluster(""), - fHLTDecision("") + fEventType(evType), + fTriggerClasses(classes), + fTriggerMask(mask), + fTriggerCluster(cluster), + fHLTDecision(decision) { // constructor // ... @@ -65,10 +63,6 @@ AliEventInfo::AliEventInfo(const char *lhcState, const char *beamType, const cha //______________________________________________________________________________ AliEventInfo::AliEventInfo(const AliEventInfo &evInfo): TObject(evInfo), - fLHCState(evInfo.fLHCState), - fBeamType(evInfo.fBeamType), - fRunType(evInfo.fRunType), - fActiveDetectors(evInfo.fActiveDetectors), fEventType(evInfo.fEventType), fTriggerClasses(evInfo.fTriggerClasses), fTriggerMask(evInfo.fTriggerMask), @@ -87,10 +81,6 @@ AliEventInfo &AliEventInfo::operator =(const AliEventInfo& evInfo) if(this==&evInfo) return *this; ((TObject *)this)->operator=(evInfo); - fLHCState = evInfo.fLHCState; - fBeamType = evInfo.fBeamType; - fRunType = evInfo.fRunType; - fActiveDetectors = evInfo.fActiveDetectors; fEventType = evInfo.fEventType; fTriggerClasses = evInfo.fTriggerClasses; fTriggerMask = evInfo.fTriggerMask; @@ -105,10 +95,6 @@ void AliEventInfo::Reset() { // Reset the contents // ... -// fLHCState = "UNKNOWN"; -// fRunType = "UNKNOWN"; -// fBeamType = "UNKNOWN"; -// fActiveDetectors = ""; fEventType = 0; fTriggerClasses = ""; fTriggerMask = 0; diff --git a/STEER/AliEventInfo.h b/STEER/AliEventInfo.h index eba158f2f57..5ce4f1ab489 100644 --- a/STEER/AliEventInfo.h +++ b/STEER/AliEventInfo.h @@ -5,11 +5,13 @@ ////////////////////////////////////////////////////////////////////////////// // Class AliEventInfo // -// Container class for all the information related to LHCstate, run and // -// event types, trigger mask and trigger clusters. // -// It is used in order to provide the detector's AliRecoParam objects with// -// the necessary information so that they can decide which instance of // -// AliDetectorRecoParam to use in reconstruction one particular event. // +// Container class for all the information related to // +// event type, trigger mask and trigger clusters. // +// It is used together with AliRunInfo in order to provide the detector's // +// AliRecoParam object with // +// the necessary information so that it can decide which instance of // +// AliDetectorRecoParam objects to use in reconstruction one particular // +// event. // // // // cvetan.cheshkov@cern.ch 12/06/2008 // ////////////////////////////////////////////////////////////////////////////// @@ -21,47 +23,41 @@ class AliEventInfo : public TObject { public: AliEventInfo(); - AliEventInfo(const char *lhcState, - const char *beamType, - const char *runType, - const char *activeDetectors); + AliEventInfo(UInt_t evType, + const char *classes, + ULong64_t mask, + const char *cluster, + const char *decision); virtual ~AliEventInfo() {} void SetEventType(UInt_t evType) { fEventType = evType; } - void SetTriggerClasses(const char *classes) { fTriggerClasses.SetString(classes); } + void SetTriggerClasses(const char *classes) { fTriggerClasses = classes; } void SetTriggerMask(ULong64_t mask) { fTriggerMask = mask; } - void SetTriggerCluster(const char *cluster) { fTriggerCluster.SetString(cluster); } - void SetHLTDecision(const char *decision) { fHLTDecision.SetString(decision); } + void SetTriggerCluster(const char *cluster) { fTriggerCluster = cluster; } + void SetHLTDecision(const char *decision) { fHLTDecision = decision; } virtual void Print(Option_t */*option=""*/) const { Dump(); } - const char *GetLHCState() const { return fLHCState.GetString().Data(); } - const char *GetBeamType() const { return fBeamType.GetString().Data(); } - const char *GetRunType() const { return fRunType.GetString().Data(); } - const char *GetActiveDetectors() const { return fActiveDetectors.GetString().Data(); } UInt_t GetEventType() const { return fEventType; } - const char *GetTriggerClasses() const { return fTriggerClasses.GetString().Data(); } + const char *GetTriggerClasses() const { return fTriggerClasses.Data(); } ULong64_t GetTriggerMask() const { return fTriggerMask; } - const char *GetTriggerCluster() const { return fTriggerCluster.GetString().Data(); } - const char *GetHLTDecision() const { return fHLTDecision.GetString().Data(); } + const char *GetTriggerCluster() const { return fTriggerCluster.Data(); } + const char *GetHLTDecision() const { return fHLTDecision.Data(); } AliEventInfo(const AliEventInfo &evInfo); AliEventInfo& operator= (const AliEventInfo& evInfo); void Reset(); + private: - TObjString fLHCState; // state of the machine as provided by DCS and DAQ log-book (per run) - TObjString fBeamType; // beam type for Alice - TObjString fRunType; // run type accoring to ECS (per run) - TObjString fActiveDetectors;// list of active detectors (per run) UInt_t fEventType; // event type as defined by DAQ (start_of_*,calibration,physics etc) (per event) - TObjString fTriggerClasses; // list of fired trigger classes (per event) + TString fTriggerClasses; // list of fired trigger classes (per event) ULong64_t fTriggerMask; // trigger mask as received from DAQ or CTP raw-data payload (per event) - TObjString fTriggerCluster; // list of detectors that have been read out (per event) - TObjString fHLTDecision; // string describing the HLT decision (per event) + TString fTriggerCluster; // list of detectors that have been read out (per event) + TString fHLTDecision; // string describing the HLT decision (per event) - ClassDef(AliEventInfo,2) // Event info class + ClassDef(AliEventInfo,3) // Event info class }; #endif diff --git a/STEER/AliQAChecker.cxx b/STEER/AliQAChecker.cxx index c93a07e435b..9f16b838dc2 100644 --- a/STEER/AliQAChecker.cxx +++ b/STEER/AliQAChecker.cxx @@ -24,7 +24,7 @@ #include "AliCDBEntry.h" #include "AliCDBManager.h" #include "AliCDBStorage.h" -#include "AliEventInfo.h" +#include "AliRunInfo.h" #include "AliLog.h" #include "AliModule.h" #include "AliQA.h" @@ -48,8 +48,8 @@ ClassImp(AliQAChecker) AliQAChecker::AliQAChecker(const char* name, const char* title) : TNamed(name, title), fDataFile(0x0), - fEventInfo(0x0), - fEventInfoOwner(kFALSE), + fRunInfo(0x0), + fRunInfoOwner(kFALSE), fRefFile(0x0), fFoundDetectors(".") { @@ -62,8 +62,8 @@ AliQAChecker::AliQAChecker(const char* name, const char* title) : AliQAChecker::AliQAChecker(const AliQAChecker& qac) : TNamed(qac), fDataFile(qac.fDataFile), - fEventInfo(qac.fEventInfo), - fEventInfoOwner(kFALSE), + fRunInfo(qac.fRunInfo), + fRunInfoOwner(kFALSE), fRefFile(qac.fRefFile), fFoundDetectors(qac.fFoundDetectors) { @@ -87,8 +87,8 @@ AliQAChecker& AliQAChecker::operator = (const AliQAChecker& qac) AliQAChecker::~AliQAChecker() { // clean up - if (fEventInfo) - delete fEventInfo ; + if (fRunInfo) + delete fRunInfo ; delete [] fCheckers ; AliQA::Close() ; } @@ -162,10 +162,10 @@ void AliQAChecker::GetRefSubDir(const char * det, const char * task, TDirectory } else if (refStorage.Contains(AliQA::GetLabLocalOCDB()) || refStorage.Contains(AliQA::GetLabAliEnOCDB())) { AliCDBManager* man = AliCDBManager::Instance() ; if ( strcmp(AliQA::GetRefDataDirName(), "") == 0 ) { // the name of the last level of the directory is not set (RUNTYPE) - // Get it from EventInfo - if (!fEventInfo) // not yet set, get the info from GRP - LoadEventInfoFromGRP() ; - AliQA::SetQARefDataDirName(fEventInfo->GetRunType()) ; + // Get it from RunInfo + if (!fRunInfo) // not yet set, get the info from GRP + LoadRunInfoFromGRP() ; + AliQA::SetQARefDataDirName(fRunInfo->GetRunType()) ; } if ( ! man->GetLock() ) { man->SetDefaultStorage(AliQA::GetQARefStorage()) ; @@ -192,7 +192,7 @@ AliQAChecker * AliQAChecker::Instance() } //_____________________________________________________________________________ -void AliQAChecker::LoadEventInfoFromGRP() +void AliQAChecker::LoadRunInfoFromGRP() { AliCDBManager* man = AliCDBManager::Instance() ; AliCDBEntry* entry = man->Get(AliQA::GetGRPPath().Data()); @@ -212,6 +212,11 @@ void AliQAChecker::LoadEventInfoFromGRP() if (!beamType) { AliWarning(Form("%s entry: missing value for the LHC state ! Using UNKNOWN", AliQA::GetGRPPath().Data())); } + TObjString *beamEnergyStr= + dynamic_cast(data->GetValue("fAliceBeamEnergy")); + if (!beamEnergyStr) { + AliWarning(Form("%s entry: missing value for the beam energy ! Using 0", AliQA::GetGRPPath().Data())); + } TObjString *runType= dynamic_cast(data->GetValue("fRunType")); if (!runType) { @@ -219,13 +224,14 @@ void AliQAChecker::LoadEventInfoFromGRP() TObjString *activeDetectors= dynamic_cast(data->GetValue("fDetectorMask")); if (!activeDetectors) { - AliWarning(Form("%s entry: missing value for the detector mask ! Using ALL", AliQA::GetGRPPath().Data())); + AliWarning(Form("%s entry: missing value for the detector mask ! Using 1074790399", AliQA::GetGRPPath().Data())); } - fEventInfo = new AliEventInfo(lhcState ? lhcState->GetString().Data() : "UNKNOWN", - beamType ? beamType->GetString().Data() : "UNKNOWN", - runType ? runType->GetString().Data() : "UNKNOWN", - activeDetectors ? activeDetectors->GetString().Data() : "ALL"); - fEventInfoOwner = kTRUE ; + fRunInfo = new AliRunInfo(lhcState ? lhcState->GetString().Data() : "UNKNOWN", + beamType ? beamType->GetString().Data() : "UNKNOWN", + beamEnergyStr ? beamEnergyStr->GetString().Atof() : 0, + runType ? runType->GetString().Data() : "UNKNOWN", + activeDetectors ? activeDetectors->GetString().Atoi() : 1074790399); + fRunInfoOwner = kTRUE ; } //_____________________________________________________________________________ diff --git a/STEER/AliQAChecker.h b/STEER/AliQAChecker.h index 7dbb64933b3..dfa9351bb8d 100644 --- a/STEER/AliQAChecker.h +++ b/STEER/AliQAChecker.h @@ -19,7 +19,7 @@ #include "AliQA.h" class AliCDBEntry ; -class AliEventInfo ; +class AliRunInfo ; class AliQACheckerBase ; class AliQAChecker: public TNamed { @@ -40,16 +40,16 @@ public: virtual Bool_t Run(const char * fileName = NULL) ; virtual Bool_t Run(AliQA::DETECTORINDEX_t det, AliQA::TASKINDEX_t task, TObjArray * list); - void SetEventInfo(AliEventInfo * ei) {fEventInfo = ei;} + void SetRunInfo(AliRunInfo * ei) {fRunInfo = ei;} private: - void LoadEventInfoFromGRP() ; + void LoadRunInfoFromGRP() ; static AliQAChecker *fgQAChecker ; // pointer to the instance of the singleton TFile * fDataFile ; //! Data file to check - AliEventInfo * fEventInfo ; //! Event info object - Bool_t fEventInfoOwner; //! owns fEventInfo or not + AliRunInfo * fRunInfo ; //! Event info object + Bool_t fRunInfoOwner; //! owns fRunInfo or not TFile * fRefFile ; //! Reference Data file TString fFoundDetectors ; //! detectors for which the Quality assurance could be done AliQACheckerBase * fCheckers[AliQA::kNDET] ; //! list of detectors checkers diff --git a/STEER/AliRecoParam.cxx b/STEER/AliRecoParam.cxx index ad5838b2c05..1dc9e3f2b53 100644 --- a/STEER/AliRecoParam.cxx +++ b/STEER/AliRecoParam.cxx @@ -31,32 +31,32 @@ #include "AliLog.h" #include "AliRecoParam.h" - ClassImp(AliRecoParam) AliRecoParam::AliRecoParam(): - TNamed("",""), - fRecoParamArray(0) -{ - // Default constructor - // ... -} - -AliRecoParam::AliRecoParam(const char *detector): - TNamed(detector,detector), - fRecoParamArray(0) + TObject(), + fEventSpecie(kDefault) { // Default constructor // ... + for(Int_t iDet = 0; iDet < kNDetectors; iDet++) + fDetRecoParams[iDet] = NULL; + for(Int_t iSpecie = 0; iSpecie < kNSpecies; iSpecie++) { + for(Int_t iDet = 0; iDet < kNDetectors; iDet++) { + fDetRecoParamsIndex[iSpecie][iDet] = -1; + } + } } AliRecoParam::~AliRecoParam(){ // Destructor // ... // Delete the array with the reco-param objects - if (fRecoParamArray){ - fRecoParamArray->Delete(); - delete fRecoParamArray; + for(Int_t iDet = 0; iDet < kNDetectors; iDet++) { + if (fDetRecoParams[iDet]){ + fDetRecoParams[iDet]->Delete(); + delete fDetRecoParams[iDet]; + } } } @@ -64,30 +64,81 @@ void AliRecoParam::Print(Option_t *option) const { // // Print reconstruction setup // - printf("AliRecoParam object for %s\n",GetName()); - if (!fRecoParamArray) return; - Int_t nparam = fRecoParamArray->GetEntriesFast(); - for (Int_t iparam=0; iparamAt(iparam); - if (!param) continue; - param->Print(option); + for(Int_t iDet = 0; iDet < kNDetectors; iDet++) { + if (fDetRecoParams[iDet]){ + printf("AliDetectorRecoParam objects for detector %d\n",iDet); + Int_t nparam = fDetRecoParams[iDet]->GetEntriesFast(); + for (Int_t iparam=0; iparamAt(iparam); + if (!param) continue; + param->Print(option); + } + } + else { + printf("No AliDetectorRecoParam objects specified for detector %d\n",iDet); + } } } -AliDetectorRecoParam *AliRecoParam::GetRecoParam(const AliEventInfo &/*evInfo*/) const { - // To be implemented by the detectors - // Here we return the last AliDetectorRecoParam!! - if (!fRecoParamArray) return NULL; - if (fRecoParamArray->GetEntriesFast() != 1) - AliWarning(Form("Method not implemented by the detector %s, using the last AliDetectorRecoParam !",GetName())); +void AliRecoParam::SetEventSpecie(const AliRunInfo */*runInfo*/, const AliEventInfo &/*evInfo*/) +{ + // To be implemented + // Here we return always kDefault!! + fEventSpecie = kDefault; +} + +const AliDetectorRecoParam *AliRecoParam::GetDetRecoParam(Int_t iDet) const +{ + // Return AliDetectorRecoParam object for a given detector + // according to the event specie provided as an argument + if (!fDetRecoParams[iDet]) return NULL; + if (fDetRecoParams[iDet]->GetEntries() == 0) return NULL; + + for(Int_t iBit = 0; iBit < kNSpecies; iBit++) { + if (fEventSpecie & (1 << iBit)) { + if (fDetRecoParamsIndex[iBit][iDet] >= 0) + return (AliDetectorRecoParam *)fDetRecoParams[iDet]->At(fDetRecoParamsIndex[iBit][iDet]); + else + return (AliDetectorRecoParam *)fDetRecoParams[iDet]->At(fDetRecoParamsIndex[0][iDet]); + } + } - return (AliDetectorRecoParam *)fRecoParamArray->Last(); + // Default one + AliError(Form("Invalid event specie: %d!",fEventSpecie)); + return (AliDetectorRecoParam *)fDetRecoParams[iDet]->At(fDetRecoParamsIndex[0][iDet]); } -void AliRecoParam::AddRecoParam(AliDetectorRecoParam* param){ +void AliRecoParam::AddDetRecoParam(Int_t iDet, AliDetectorRecoParam* param) +{ // Add an instance of reco params object into - // the fRecoParamArray - // - if (!fRecoParamArray) fRecoParamArray = new TObjArray; - fRecoParamArray->AddLast(param); + // the fDetRecoParams for detector iDet + // Updates the fDetRecoParams index + if (!fDetRecoParams[iDet]) fDetRecoParams[iDet] = new TObjArray; + fDetRecoParams[iDet]->AddLast(param); + Int_t index = fDetRecoParams[iDet]->GetLast(); + + // Index + Int_t specie = param->GetEventSpecie(); + for(Int_t iBit = 0; iBit < kNSpecies; iBit++) { + if (specie & (1 << iBit)) { + fDetRecoParamsIndex[iBit][iDet] = index; + } + } +} + +Bool_t AliRecoParam::AddDetRecoParamArray(Int_t iDet, TObjArray* parArray) +{ + // Add an array of reconstruction parameter objects + // for a given detector + // Basic check on the consistency of the array + Bool_t defaultFound = kFALSE; + for(Int_t i = 0; i < parArray->GetEntriesFast(); i++) { + AliDetectorRecoParam *par = (AliDetectorRecoParam*)parArray->At(i); + if (!par) continue; + if (par->IsDefault()) defaultFound = kTRUE; + } + + fDetRecoParams[iDet] = parArray; + + return defaultFound; } diff --git a/STEER/AliRecoParam.h b/STEER/AliRecoParam.h index 7ab4142b962..d5dd6e96e99 100644 --- a/STEER/AliRecoParam.h +++ b/STEER/AliRecoParam.h @@ -5,40 +5,55 @@ /////////////////////////////////////////////////////////////////////////////// // // -// Base Class for Detector reconstruction parameters // +// Steering Class for reconstruction parameters // // Revision: cvetan.cheshkov@cern.ch 12/06/2008 // -// Its structure has been revised and it is interfaced to AliEventInfo. // +// Its structure has been revised and it is interfaced to AliRunInfo and // +// AliEventInfo. // // // /////////////////////////////////////////////////////////////////////////////// -#include "TNamed.h" +#include "TObject.h" + class AliDetectorRecoParam; +class AliRunInfo; class AliEventInfo; -class AliRecoParam : public TNamed +class AliRecoParam : public TObject { public: AliRecoParam(); - AliRecoParam(const char *detector); virtual ~AliRecoParam(); // - virtual void Print(Option_t *option="") const; - TObjArray *GetAllRecoParams() const { return fRecoParamArray; } - virtual AliDetectorRecoParam *GetRecoParam(const AliEventInfo &/*evInfo*/) const; - void AddRecoParam(AliDetectorRecoParam* param); - -protected: + enum { + kNSpecies = 5, // number of event species + kNDetectors = 15 // number of detectors + }; + enum EventSpecie_t {kDefault = 1, + kLowMult = 2, + kHighMult = 4, + kCosmic = 8, + kCalib = 16}; - TObjArray *fRecoParamArray; //array with reconstruction-parameter objects + virtual void Print(Option_t *option="") const; + const TObjArray *GetDetRecoParamArray(Int_t iDet) const { return fDetRecoParams[iDet]; } + void SetEventSpecie(const AliRunInfo*/*runInfo*/, const AliEventInfo &/*evInfo*/); + EventSpecie_t GetEventSpecie() const { return fEventSpecie; } + const AliDetectorRecoParam *GetDetRecoParam(Int_t iDet) const; + void AddDetRecoParam(Int_t iDet, AliDetectorRecoParam* param); + Bool_t AddDetRecoParamArray(Int_t iDet, TObjArray* parArray); private: AliRecoParam(const AliRecoParam&); // Not implemented AliRecoParam& operator=(const AliRecoParam&); // Not implemented - ClassDef(AliRecoParam, 2) + Int_t fDetRecoParamsIndex[kNSpecies][kNDetectors]; //!index to fDetRecoParams arrays + TObjArray *fDetRecoParams[kNDetectors]; //!array with reconstruction-parameter objects for all detectors + EventSpecie_t fEventSpecie; //!current event specie + + ClassDef(AliRecoParam, 3) }; diff --git a/STEER/AliReconstruction.cxx b/STEER/AliReconstruction.cxx index 6f4462e4025..5bf42d43bb7 100644 --- a/STEER/AliReconstruction.cxx +++ b/STEER/AliReconstruction.cxx @@ -190,6 +190,12 @@ #include "AliMagWrapCheb.h" +#include "AliDetectorRecoParam.h" +#include "AliRunInfo.h" +#include "AliEventInfo.h" + +#include "AliDAQ.h" + ClassImp(AliReconstruction) @@ -237,11 +243,15 @@ AliReconstruction::AliReconstruction(const char* gAliceFilename, fLoadAlignData("ALL"), fESDPar(""), fUseHLTData(), + fRunInfo(NULL), + fEventInfo(), fRunLoader(NULL), fRawReader(NULL), fParentRawReader(NULL), + fRecoParam(), + fVertexer(NULL), fDiamondProfile(NULL), fDiamondProfileTPC(NULL), @@ -329,11 +339,15 @@ AliReconstruction::AliReconstruction(const AliReconstruction& rec) : fLoadAlignData(rec.fLoadAlignData), fESDPar(rec.fESDPar), fUseHLTData(rec.fUseHLTData), + fRunInfo(NULL), + fEventInfo(), fRunLoader(NULL), fRawReader(NULL), fParentRawReader(NULL), + fRecoParam(), + fVertexer(NULL), fDiamondProfile(NULL), fDiamondProfileTPC(NULL), @@ -647,6 +661,21 @@ void AliReconstruction::SetOption(const char* detector, const char* option) fOptions.Add(new TNamed(detector, option)); } +//_____________________________________________________________________________ +void AliReconstruction::SetRecoParam(const char* detector, AliDetectorRecoParam *par) +{ + // Set custom reconstruction parameters for a given detector + // Single set of parameters for all the events + for (Int_t iDet = 0; iDet < fgkNDetectors; iDet++) { + if(!strcmp(detector, fgkDetectorName[iDet])) { + par->SetAsDefault(); + fRecoParam.AddDetRecoParam(iDet,par); + break; + } + } + +} + //_____________________________________________________________________________ Bool_t AliReconstruction::SetFieldMap(Float_t l3Current, Float_t diCurrent, Float_t factor, const char *path) { //------------------------------------------------ @@ -726,6 +755,55 @@ Bool_t AliReconstruction::InitGRP() { return kFALSE; } + TObjString *lhcState= + dynamic_cast(fGRPData->GetValue("fLHCState")); + if (!lhcState) { + AliError("GRP/GRP/Data entry: missing value for the LHC state ! Using UNKNOWN"); + } + + TObjString *beamType= + dynamic_cast(fGRPData->GetValue("fAliceBeamType")); + if (!beamType) { + AliError("GRP/GRP/Data entry: missing value for the beam type ! Using UNKNOWN"); + } + + TObjString *beamEnergyStr= + dynamic_cast(fGRPData->GetValue("fAliceBeamEnergy")); + if (!beamEnergyStr) { + AliError("GRP/GRP/Data entry: missing value for the beam energy ! Using 0"); + } + + TObjString *runType= + dynamic_cast(fGRPData->GetValue("fRunType")); + if (!runType) { + AliError("GRP/GRP/Data entry: missing value for the run type ! Using UNKNOWN"); + } + + TObjString *activeDetectors= + dynamic_cast(fGRPData->GetValue("fDetectorMask")); + if (!activeDetectors) { + AliError("GRP/GRP/Data entry: missing value for the detector mask ! Using 1074790399"); + } + + fRunInfo = new AliRunInfo(lhcState ? lhcState->GetString().Data() : "UNKNOWN", + beamType ? beamType->GetString().Data() : "UNKNOWN", + beamEnergyStr ? beamEnergyStr->GetString().Atof() : 0, + runType ? runType->GetString().Data() : "UNKNOWN", + activeDetectors ? activeDetectors->GetString().Atoi() : 1074790399); + + // Process the list of active detectors + if (activeDetectors && activeDetectors->GetString().IsDigit()) { + UInt_t detMask = activeDetectors->GetString().Atoi(); + fRunLocalReconstruction = MatchDetectorList(fRunLocalReconstruction,detMask); + fRunTracking = MatchDetectorList(fRunTracking,detMask); + fFillESD = MatchDetectorList(fFillESD,detMask); + } + + AliInfo("==================================================================================="); + AliInfo(Form("Running local reconstruction for detectors: %s",fRunLocalReconstruction.Data())); + AliInfo(Form("Running tracking for detectors: %s",fRunTracking.Data())); + AliInfo(Form("Filling ESD for detectors: %s",fFillESD.Data())); + AliInfo("==================================================================================="); //*** Dealing with the magnetic field map if (AliTracker::GetFieldMap()) { @@ -888,6 +966,14 @@ Bool_t AliReconstruction::InitRun(const char* input) if (!InitGRP()) return kFALSE; + // Read the reconstruction parameters from OCDB + if (!InitRecoParams()) { + if (fStopOnError) { + CleanUp(); + return kFALSE; + } + } + AliSysInfo::AddStamp("ReadRecoParam"); ftVertexer = new AliVertexerTracks(AliTracker::GetBz()); if(fDiamondProfile && fMeanVertexConstraint) ftVertexer->SetVtxStart(fDiamondProfile); @@ -1057,6 +1143,10 @@ Bool_t AliReconstruction::RunEvent(Int_t iEvent) AliInfo(Form("processing event %d", iEvent)); + // Fill Event-info object + GetEventInfo(); + fRecoParam.SetEventSpecie(fRunInfo,fEventInfo); + //Start of cycle for the in-loop QA if (fInLoopQA) { if (fRunQA) { @@ -1374,6 +1464,12 @@ Bool_t AliReconstruction::RunEvent(Int_t iEvent) } } + fEventInfo.Reset(); + for (Int_t iDet = 0; iDet < fgkNDetectors; iDet++) { + if (fReconstructor[iDet]) + fReconstructor[iDet]->SetRecoParam(NULL); + } + return kTRUE; } @@ -2043,66 +2139,27 @@ Bool_t AliReconstruction::FillTriggerESD(AliESDEvent*& esd) AliInfo("Filling trigger information into the ESD"); - AliCentralTrigger *aCTP = NULL; - if (fRawReader) { AliCTPRawStream input(fRawReader); if (!input.Next()) { - AliWarning("No valid CTP (trigger) DDL raw data is found ! The trigger mask will be taken from the event header, trigger cluster mask will be empty !"); - ULong64_t mask = (((ULong64_t)fRawReader->GetTriggerPattern()[1]) << 32) + - fRawReader->GetTriggerPattern()[0]; - esd->SetTriggerMask(mask); - esd->SetTriggerCluster(0); - } - else { - esd->SetTriggerMask(input.GetClassMask()); - esd->SetTriggerCluster(input.GetClusterMask()); - } - - aCTP = new AliCentralTrigger(); - TString configstr(""); - if (!aCTP->LoadConfiguration(configstr)) { // Load CTP config from OCDB - AliError("No trigger configuration found in OCDB! The trigger classes information will no be stored in ESD!"); - delete aCTP; - return kFALSE; - } - } - else { - AliRunLoader *runloader = AliRunLoader::GetRunLoader(); - if (runloader) { - if (!runloader->LoadTrigger()) { - aCTP = runloader->GetTrigger(); - esd->SetTriggerMask(aCTP->GetClassMask()); - esd->SetTriggerCluster(aCTP->GetClusterMask()); - } - else { - AliWarning("No trigger can be loaded! The trigger information is not stored in the ESD !"); - return kFALSE; - } + AliWarning("No valid CTP (trigger) DDL raw data is found ! The trigger info is taken from the event header!"); } else { - AliError("No run loader is available! The trigger information is not stored in the ESD !"); - return kFALSE; + if (esd->GetTriggerMask() != input.GetClassMask()) + AliError(Form("Invalid trigger pattern found in CTP raw-data: %llx %llx", + input.GetClassMask(),esd->GetTriggerMask())); + if (esd->GetOrbitNumber() != input.GetOrbitID()) + AliError(Form("Invalid orbit id found in CTP raw-data: %x %x", + input.GetOrbitID(),esd->GetOrbitNumber())); + if (esd->GetBunchCrossNumber() != input.GetBCID()) + AliError(Form("Invalid bunch-crossing id found in CTP raw-data: %x %x", + input.GetBCID(),esd->GetBunchCrossNumber())); } - } - - // Now fill the trigger class names into AliESDRun object - AliTriggerConfiguration *config = aCTP->GetConfiguration(); - if (!config) { - AliError("No trigger configuration has been found! The trigger classes information will not be stored in ESD!"); - if (fRawReader) delete aCTP; - return kFALSE; - } - const TObjArray& classesArray = config->GetClasses(); - Int_t nclasses = classesArray.GetEntriesFast(); - for( Int_t j=0; jGetMask()); - esd->SetTriggerClass(trclass->GetName(),trindex); + // Here one has to add the filling of trigger inputs and + // interaction records + // ... } - - if (fRawReader) delete aCTP; return kTRUE; } @@ -2229,7 +2286,13 @@ AliReconstructor* AliReconstruction::GetReconstructor(Int_t iDet) { // get the reconstructor object and the loader for a detector - if (fReconstructor[iDet]) return fReconstructor[iDet]; + if (fReconstructor[iDet]) { + if (fRecoParam.GetDetRecoParamArray(iDet) && !AliReconstructor::GetRecoParam(iDet)) { + const AliDetectorRecoParam *par = fRecoParam.GetDetRecoParam(iDet); + fReconstructor[iDet]->SetRecoParam(par); + } + return fReconstructor[iDet]; + } // load the reconstructor object TPluginManager* pluginManager = gROOT->GetPluginManager(); @@ -2305,6 +2368,10 @@ AliReconstructor* AliReconstruction::GetReconstructor(Int_t iDet) } } + if (fRecoParam.GetDetRecoParamArray(iDet) && !AliReconstructor::GetRecoParam(iDet)) { + const AliDetectorRecoParam *par = fRecoParam.GetDetRecoParam(iDet); + reconstructor->SetRecoParam(par); + } return reconstructor; } @@ -2370,6 +2437,9 @@ void AliReconstruction::CleanUp(TFile* file, TFile* fileOld) delete fTracker[iDet]; fTracker[iDet] = NULL; } + if (fRunInfo) delete fRunInfo; + fRunInfo = NULL; + delete fVertexer; fVertexer = NULL; @@ -2802,4 +2872,176 @@ Bool_t AliReconstruction::SetRunQA(TString detAndAction) return kTRUE; } - +//_____________________________________________________________________________ +Bool_t AliReconstruction::InitRecoParams() +{ + // The method accesses OCDB and retrieves all + // the available reco-param objects from there. + + Bool_t isOK = kTRUE; + + for (Int_t iDet = 0; iDet < fgkNDetectors; iDet++) { + + if (fRecoParam.GetDetRecoParamArray(iDet)) { + AliInfo(Form("Using custom reconstruction parameters for detector %s",fgkDetectorName[iDet])); + continue; + } + + AliDebug(1, Form("Loading RecoParam objects for detector: %s",fgkDetectorName[iDet])); + + AliCDBPath path(fgkDetectorName[iDet],"Calib","RecoParam"); + AliCDBEntry *entry=AliCDBManager::Instance()->Get(path.GetPath()); + if(!entry){ + AliWarning(Form("Couldn't find RecoParam entry in OCDB for detector %s",fgkDetectorName[iDet])); + isOK = kFALSE; + } + else { + TObject *recoParamObj = entry->GetObject(); + if (dynamic_cast(recoParamObj)) { + // The detector has a normal TobjArray of AliDetectorRecoParam objects + // Registering them in AliRecoParam + fRecoParam.AddDetRecoParamArray(iDet,dynamic_cast(recoParamObj)); + } + else if (dynamic_cast(recoParamObj)) { + // The detector has only onse set of reco parameters + // Registering it in AliRecoParam + AliInfo(Form("Single set of reco parameters found for detector %s",fgkDetectorName[iDet])); + dynamic_cast(recoParamObj)->SetAsDefault(); + fRecoParam.AddDetRecoParam(iDet,dynamic_cast(recoParamObj)); + } + else { + AliError(Form("No valid RecoParam object found in the OCDB for detector %s",fgkDetectorName[iDet])); + isOK = kFALSE; + } + entry->SetOwner(0); + } + } + + return isOK; +} + +//_____________________________________________________________________________ +Bool_t AliReconstruction::GetEventInfo() +{ + // Fill the event info object + // ... + AliCodeTimerAuto("") + + AliCentralTrigger *aCTP = NULL; + if (fRawReader) { + fEventInfo.SetEventType(fRawReader->GetType()); + + ULong64_t mask = fRawReader->GetClassMask(); + fEventInfo.SetTriggerMask(mask); + UInt_t clmask = fRawReader->GetDetectorPattern()[0]; + fEventInfo.SetTriggerCluster(AliDAQ::ListOfTriggeredDetectors(clmask)); + + aCTP = new AliCentralTrigger(); + TString configstr(""); + if (!aCTP->LoadConfiguration(configstr)) { // Load CTP config from OCDB + AliError("No trigger configuration found in OCDB! The trigger configuration information will not be used!"); + delete aCTP; + return kFALSE; + } + aCTP->SetClassMask(mask); + aCTP->SetClusterMask(clmask); + } + else { + fEventInfo.SetEventType(AliRawEventHeaderBase::kPhysicsEvent); + + if (fRunLoader && (!fRunLoader->LoadTrigger())) { + aCTP = fRunLoader->GetTrigger(); + fEventInfo.SetTriggerMask(aCTP->GetClassMask()); + fEventInfo.SetTriggerCluster(AliDAQ::ListOfTriggeredDetectors(aCTP->GetClusterMask())); + } + else { + AliWarning("No trigger can be loaded! The trigger information will not be used!"); + return kFALSE; + } + } + + AliTriggerConfiguration *config = aCTP->GetConfiguration(); + if (!config) { + AliError("No trigger configuration has been found! The trigger configuration information will not be used!"); + if (fRawReader) delete aCTP; + return kFALSE; + } + + TString trclasses; + ULong64_t trmask = fEventInfo.GetTriggerMask(); + const TObjArray& classesArray = config->GetClasses(); + Int_t nclasses = classesArray.GetEntriesFast(); + for( Int_t iclass=0; iclass < nclasses; iclass++ ) { + AliTriggerClass* trclass = (AliTriggerClass*)classesArray.At(iclass); + if (trclass) { + Int_t trindex = (Int_t)TMath::Log2(trclass->GetMask()); + fesd->SetTriggerClass(trclass->GetName(),trindex); + if (trmask & (1 << trindex)) { + trclasses += " "; + trclasses += trclass->GetName(); + trclasses += " "; + } + } + } + fEventInfo.SetTriggerClasses(trclasses); + + if (!aCTP->CheckTriggeredDetectors()) { + if (fRawReader) delete aCTP; + return kFALSE; + } + + if (fRawReader) delete aCTP; + + // We have to fill also the HLT decision here!! + // ... + + return kTRUE; +} + +const char *AliReconstruction::MatchDetectorList(const char *detectorList, UInt_t detectorMask) +{ + // Match the detector list found in the rec.C or the default 'ALL' + // to the list found in the GRP (stored there by the shuttle PP which + // gets the information from ECS) + static TString resultList; + TString detList = detectorList; + + resultList = ""; + + for(Int_t iDet = 0; iDet < (AliDAQ::kNDetectors-1); iDet++) { + if ((detectorMask >> iDet) & 0x1) { + TString det = AliDAQ::OfflineModuleName(iDet); + if ((detList.CompareTo("ALL") == 0) || + detList.BeginsWith("ALL ") || + detList.EndsWith(" ALL") || + detList.Contains(" ALL ") || + (detList.CompareTo(det) == 0) || + detList.BeginsWith(det) || + detList.EndsWith(det) || + detList.Contains( " "+det+" " )) { + if (!resultList.EndsWith(det + " ")) { + resultList += det; + resultList += " "; + } + } + } + } + + // HLT + if ((detectorMask >> AliDAQ::kHLTId) & 0x1) { + TString hltDet = AliDAQ::OfflineModuleName(AliDAQ::kNDetectors-1); + if ((detList.CompareTo("ALL") == 0) || + detList.BeginsWith("ALL ") || + detList.EndsWith(" ALL") || + detList.Contains(" ALL ") || + (detList.CompareTo(hltDet) == 0) || + detList.BeginsWith(hltDet) || + detList.EndsWith(hltDet) || + detList.Contains( " "+hltDet+" " )) { + resultList += hltDet; + } + } + + return resultList.Data(); + +} diff --git a/STEER/AliReconstruction.h b/STEER/AliReconstruction.h index 2fb8bb8cc73..90785d6043c 100644 --- a/STEER/AliReconstruction.h +++ b/STEER/AliReconstruction.h @@ -37,6 +37,11 @@ class TTree; class TList; class AliQADataMakerSteer; class TMap; +class AliRecoParam; +class AliDetectorRecoParam; +class AliRunInfo; +#include "AliEventInfo.h" +#include "AliRecoParam.h" class AliReconstruction: public TNamed { public: @@ -54,6 +59,7 @@ public: void SetNumberOfEventsPerFile(UInt_t nEvents) {fNumberOfEventsPerFile = nEvents;}; void SetOption(const char* detector, const char* option); + void SetRecoParam(const char* detector, AliDetectorRecoParam *par); void SetRunLocalReconstruction(const char* detectors) { fRunLocalReconstruction = detectors;}; @@ -139,6 +145,11 @@ public: // Plane Efficiency Evaluation void SetRunPlaneEff(Bool_t flag=kFALSE) {fRunPlaneEff = flag;} + enum { + fgkNDetectors = 15 // number of detectors + }; + static Int_t GetDetIndex(const char * detector); + private: AliReconstruction(const AliReconstruction& rec); AliReconstruction& operator = (const AliReconstruction& rec); @@ -173,7 +184,6 @@ private: void FillRawDataErrorLog(Int_t iEvent, AliESDEvent* esd); //Quality Assurance - Int_t GetDetIndex(const char * detector); const Int_t GetQACycles(const char * detector) { return fQACycles[GetDetIndex(detector)] ; } void CheckQA() ; @@ -184,6 +194,11 @@ private: Bool_t InitAliEVE(); void RunAliEVE(); + Bool_t InitRecoParams(); // init the array with the reconstruciton parameters + Bool_t GetEventInfo(); // fill the event info inside the event loop + + const char *MatchDetectorList(const char *detectorList, UInt_t detectorMask); + //*** Magnetic field map settings ******************* Bool_t fUniformField; // uniform field tracking flag AliMagF *fForcedFieldMap; // independent, not GRP, field map @@ -224,14 +239,16 @@ private: TString fLoadAlignData; // Load alignment data from CDB for these detectors TString fESDPar; // String where the esd.par is stored, will be attached to the tree TString fUseHLTData; // Detectors for which the HLT data is used as input + AliRunInfo* fRunInfo; // an object which contains essential global conditions information + AliEventInfo fEventInfo; // an object which contains essential event information AliRunLoader* fRunLoader; //! current run loader object AliRawReader* fRawReader; //! current raw data reader AliRawReader* fParentRawReader; //! parent raw data reader in case of AliRawReaderHLT - static const Int_t fgkNDetectors = 15; //! number of detectors static const char* fgkDetectorName[fgkNDetectors]; //! names of detectors AliReconstructor* fReconstructor[fgkNDetectors]; //! array of reconstructor objects + AliRecoParam fRecoParam; //! container for the reco-param objects for detectors AliLoader* fLoader[fgkNDetectors]; //! detector loaders AliVertexer* fVertexer; //! vertexer for ITS AliTracker* fTracker[fgkNDetectors]; //! trackers @@ -275,7 +292,7 @@ private: Bool_t fIsNewRunLoader; // galice.root created from scratch (real raw data case) Bool_t fRunAliEVE; // Run AliEVE or not - ClassDef(AliReconstruction, 24) // class for running the reconstruction + ClassDef(AliReconstruction, 25) // class for running the reconstruction }; #endif diff --git a/STEER/AliReconstructor.cxx b/STEER/AliReconstructor.cxx index a003f2ea044..677cc3b369c 100644 --- a/STEER/AliReconstructor.cxx +++ b/STEER/AliReconstructor.cxx @@ -36,11 +36,13 @@ #include "AliLog.h" #include "AliReconstructor.h" +#include #include ClassImp(AliReconstructor) +const AliDetectorRecoParam* AliReconstructor::fgRecoParam[AliReconstruction::fgkNDetectors] = {NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}; //_____________________________________________________________________________ void AliReconstructor::ConvertDigits(AliRawReader* /*rawReader*/, @@ -100,3 +102,34 @@ const char* AliReconstructor::GetDetectorName() const detName.Remove(detName.Index("Reconstructor")); return detName.Data(); } + +//_____________________________________________________________________________ +void AliReconstructor::SetRecoParam(const AliDetectorRecoParam *par) +{ + // To be implemented by the detectors. + // As soon as we manage to remove the static members + // and method in the detector reconstructors, we will + // implemented this method in the base class and remove + // the detectors implementations. + Int_t iDet = AliReconstruction::GetDetIndex(GetDetectorName()); + + if (iDet >= 0) + fgRecoParam[iDet] = par; + else + AliError(Form("Invalid detector index for (%s)",GetDetectorName())); + + return; +} + +//_____________________________________________________________________________ +const AliDetectorRecoParam* AliReconstructor::GetRecoParam(Int_t iDet) +{ + // Get the current reconstruciton parameters + // for a given detector + if (iDet >= 0 && iDet < AliReconstruction::fgkNDetectors) + return fgRecoParam[iDet]; + else { + AliErrorClass(Form("Invalid detector index (%d)",iDet)); + return NULL; + } +} diff --git a/STEER/AliReconstructor.h b/STEER/AliReconstructor.h index 518f8051506..51cf40aa1d7 100644 --- a/STEER/AliReconstructor.h +++ b/STEER/AliReconstructor.h @@ -19,7 +19,9 @@ class AliRawReader; class AliVertexer; class AliTracker; class AliESDEvent; +class AliDetectorRecoParam; +#include "AliReconstruction.h" class AliReconstructor: public TObject { public: @@ -49,8 +51,12 @@ public: void SetOption(Option_t* option) {fOption = option;}; virtual Option_t* GetOption() const {return fOption.Data();}; + void SetRecoParam(const AliDetectorRecoParam *par); + static const AliDetectorRecoParam* GetRecoParam(Int_t iDet); + private: - TString fOption; //! option for reconstruction + TString fOption; //! option for reconstruction + static const AliDetectorRecoParam* fgRecoParam[AliReconstruction::fgkNDetectors]; //! event reconstruction parameters for all detectors ClassDef(AliReconstructor, 0) // base class for reconstruction algorithms }; diff --git a/STEER/AliRunInfo.cxx b/STEER/AliRunInfo.cxx new file mode 100644 index 00000000000..d7bed176e1a --- /dev/null +++ b/STEER/AliRunInfo.cxx @@ -0,0 +1,91 @@ +/************************************************************************** + * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * + * * + * Author: The ALICE Off-line Project. * + * Contributors are mentioned in the code where appropriate. * + * * + * Permission to use, copy, modify and distribute this software and its * + * documentation strictly for non-commercial purposes is hereby granted * + * without fee, provided that the above copyright notice appears in all * + * copies and that both the copyright notice and this permission notice * + * appear in the supporting documentation. The authors make no claims * + * about the suitability of this software for any purpose. It is * + * provided "as is" without express or implied warranty. * + **************************************************************************/ + +////////////////////////////////////////////////////////////////////////////// +// Class AliRunInfo // +// Container class for all the information related to LHCstate, run type, // +// active detectors, beam energy etc. // +// It is used together with the AliEventInfo in order to provide // +// the AliRecoParam object with // +// the necessary information so that it can decide which instance of // +// AliDetectorRecoParam objects to use in reconstruction one particular // +// event. // +// // +// cvetan.cheshkov@cern.ch 12/06/2008 // +////////////////////////////////////////////////////////////////////////////// + +#include "AliRunInfo.h" + +ClassImp(AliRunInfo) + +//______________________________________________________________________________ +AliRunInfo::AliRunInfo(): + TObject(), + fLHCState("UNKNOWN"), + fBeamType("UNKNOWN"), + fBeamEnergy(0), + fRunType("UNKNOWN"), + fActiveDetectors(0) +{ + // default constructor + // ... +} + +//______________________________________________________________________________ +AliRunInfo::AliRunInfo(const char *lhcState, + const char *beamType, + Float_t beamEnergy, + const char *runType, + UInt_t activeDetectors): + TObject(), + fLHCState(lhcState), + fBeamType(beamType), + fBeamEnergy(beamEnergy), + fRunType(runType), + fActiveDetectors(activeDetectors) +{ + // constructor + // ... +} + +//______________________________________________________________________________ +AliRunInfo::AliRunInfo(const AliRunInfo &evInfo): + TObject(evInfo), + fLHCState(evInfo.fLHCState), + fBeamType(evInfo.fBeamType), + fBeamEnergy(evInfo.fBeamEnergy), + fRunType(evInfo.fRunType), + fActiveDetectors(evInfo.fActiveDetectors) +{ + // Copy constructor + // ... +} + +//_____________________________________________________________________________ +AliRunInfo &AliRunInfo::operator =(const AliRunInfo& evInfo) +{ + // assignment operator + // ... + if(this==&evInfo) return *this; + ((TObject *)this)->operator=(evInfo); + + fLHCState = evInfo.fLHCState; + fBeamType = evInfo.fBeamType; + fBeamEnergy = evInfo.fBeamEnergy; + fRunType = evInfo.fRunType; + fActiveDetectors = evInfo.fActiveDetectors; + + return *this; +} diff --git a/STEER/AliRunInfo.h b/STEER/AliRunInfo.h new file mode 100644 index 00000000000..db7b349c7ea --- /dev/null +++ b/STEER/AliRunInfo.h @@ -0,0 +1,57 @@ +#ifndef ALIRUNINFO_H +#define ALIRUNINFO_H +/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * + * See cxx source for full Copyright notice */ + +////////////////////////////////////////////////////////////////////////////// +// Class AliRunInfo // +// Container class for all the information related to LHCstate, run type, // +// active detectors, beam energy etc. // +// It is used together with the AliEventInfo in order to provide // +// the AliRecoParam object with // +// the necessary information so that it can decide which instance of // +// AliDetectorRecoParam objects to use in reconstruction one particular // +// event. // +// // +// cvetan.cheshkov@cern.ch 12/06/2008 // +////////////////////////////////////////////////////////////////////////////// + +#include +#include + +#include "AliDAQ.h" + +class AliRunInfo : public TObject { + + public: + AliRunInfo(); + AliRunInfo(const char *lhcState, + const char *beamType, + Float_t beamEnergy, + const char *runType, + UInt_t activeDetectors); + virtual ~AliRunInfo() {} + + virtual void Print(Option_t */*option=""*/) const { Dump(); } + + const char *GetLHCState() const { return fLHCState.Data(); } + const char *GetBeamType() const { return fBeamType.Data(); } + const char *GetRunType() const { return fRunType.Data(); } + UInt_t GetDetectorMask() const { return fActiveDetectors; } + const char *GetActiveDetectors() const { return AliDAQ::ListOfTriggeredDetectors(fActiveDetectors); } + + AliRunInfo(const AliRunInfo &evInfo); + AliRunInfo& operator= (const AliRunInfo& evInfo); + + private: + + TString fLHCState; // state of the machine as provided by DCS and DAQ log-book (per run) + TString fBeamType; // beam type for Alice + Float_t fBeamEnergy; // beam energy (in GeV) + TString fRunType; // run type accoring to ECS (per run) + UInt_t fActiveDetectors;// list of active detectors (per run) + + ClassDef(AliRunInfo,1) // Run info class +}; + +#endif diff --git a/STEER/AliSimulation.cxx b/STEER/AliSimulation.cxx index 6ae6a146c08..0887a7bb363 100644 --- a/STEER/AliSimulation.cxx +++ b/STEER/AliSimulation.cxx @@ -1313,7 +1313,7 @@ Bool_t AliSimulation::ConvertRawFilesToDate(const char* dateFileName, if (!runLoader->LoadTrigger()) { AliCentralTrigger *aCTP = runLoader->GetTrigger(); if (aCTP->GetClassMask() == 0) continue; - detClust = aCTP->GetTriggeredDetectors(); + detClust = AliDAQ::ListOfTriggeredDetectors(aCTP->GetClusterMask()); AliInfo(Form("List of detectors to be read out: %s",detClust.Data())); } diff --git a/STEER/AliTriggerInput.cxx b/STEER/AliTriggerInput.cxx index 14110c58b41..8ce6e9fa6ee 100644 --- a/STEER/AliTriggerInput.cxx +++ b/STEER/AliTriggerInput.cxx @@ -69,30 +69,6 @@ const char* AliTriggerInput::fgkCTPDetectorName[AliDAQ::kNDetectors] = { "HLT" }; -const char* AliTriggerInput::fgkOfflineModuleName[AliDAQ::kNDetectors] = { - "ITS", - "ITS", - "ITS", - "TPC", - "TRD", - "TOF", - "HMPID", - "PHOS", - "CPV", - "PMD", - "MUON", - "MUON", - "FMD", - "T0", - "VZERO", - "ZDC", - "ACORDE", - "CTP", - "EMCAL", - "", - "HLT" -}; - //_____________________________________________________________________________ AliTriggerInput::AliTriggerInput( TString name, TString det, UChar_t level, Int_t signature, Char_t number ): TNamed( name.Data(), det.Data() ), @@ -153,7 +129,7 @@ TString AliTriggerInput::GetModule() const // Get the detector module name (in AliRoot simulation sense) TString name = ""; if (fDetectorId >= 0 && fDetectorId < AliDAQ::kNDetectors) - name = fgkOfflineModuleName[(Int_t)fDetectorId]; + name = AliDAQ::OfflineModuleName((Int_t)fDetectorId); else AliError(Form("Invalid detector Id (%d)",(Int_t)fDetectorId)); diff --git a/STEER/AliTriggerInput.h b/STEER/AliTriggerInput.h index 6d83a243c74..7bb4508a8e6 100644 --- a/STEER/AliTriggerInput.h +++ b/STEER/AliTriggerInput.h @@ -76,7 +76,6 @@ public: static Bool_t fgkIsTriggerDetector[AliDAQ::kNDetectors]; // List of trigger detectors static const char* fgkCTPDetectorName[AliDAQ::kNDetectors]; - static const char* fgkOfflineModuleName[AliDAQ::kNDetectors]; protected: ULong64_t fMask; // Trigger ID mask (1 bit) ULong64_t fValue; // Trigger Signal (0 = false, > 1 = true = fMask ) @@ -86,7 +85,7 @@ protected: Bool_t fIsActive; // Is trigger input active (during simulation) // void fDectParameterTable; //-> link to detector parameter table???? - ClassDef( AliTriggerInput, 3 ) // Define a Trigger Input + ClassDef( AliTriggerInput, 4 ) // Define a Trigger Input }; diff --git a/STEER/STEERLinkDef.h b/STEER/STEERLinkDef.h index eb2949aeeab..5cc83ca9746 100644 --- a/STEER/STEERLinkDef.h +++ b/STEER/STEERLinkDef.h @@ -145,6 +145,7 @@ #pragma link C++ class AliTriggerRunScalers+; #pragma link C++ class AliGRPPreprocessor+; +#pragma link C++ class AliRunInfo+; #pragma link C++ class AliEventInfo+; #pragma link C++ class AliRelAlignerKalman+; diff --git a/STEER/libSTEER.pkg b/STEER/libSTEER.pkg index 3aaf3193b90..8a646c71135 100644 --- a/STEER/libSTEER.pkg +++ b/STEER/libSTEER.pkg @@ -62,7 +62,7 @@ AliRecoParam.cxx \ AliDetectorRecoParam.cxx \ AliPlaneEff.cxx \ AliTriggerRunScalers.cxx AliGRPPreprocessor.cxx \ -AliEventInfo.cxx \ +AliRunInfo.cxx AliEventInfo.cxx \ AliRelAlignerKalman.cxx diff --git a/TPC/AliTPCReconstructor.cxx b/TPC/AliTPCReconstructor.cxx index 3f2b51e3719..737fa82539f 100644 --- a/TPC/AliTPCReconstructor.cxx +++ b/TPC/AliTPCReconstructor.cxx @@ -36,7 +36,6 @@ ClassImp(AliTPCReconstructor) -AliTPCRecoParam * AliTPCReconstructor::fgkRecoParam =0; // reconstruction parameters Int_t AliTPCReconstructor::fgStreamLevel = 0; // stream (debug) level @@ -61,7 +60,6 @@ fClusterer(NULL) //_____________________________________________________________________________ AliTPCReconstructor::~AliTPCReconstructor() { - if (fgkRecoParam) delete fgkRecoParam; if (fClusterer) delete fClusterer; } @@ -118,29 +116,3 @@ AliTPCParam* AliTPCReconstructor::GetTPCParam() const return param; } - - - - -const AliTPCRecoParam* AliTPCReconstructor::GetRecoParam(){ - // - // Get reconstruction parameters - // - - if (!fgkRecoParam) { - // - // 1. try to get reco parameters from OCDB - // - fgkRecoParam = AliTPCcalibDB::Instance()->GetRecoParam(0); - //Info("","Reconstruction parameters from OCDB used"); - // - // 2. If not initialized take default - // - if (!fgkRecoParam){ - fgkRecoParam = AliTPCRecoParam::GetHighFluxParam(); - //Error("","Default reconstruction parameters used"); - } - } - - return fgkRecoParam; -} diff --git a/TPC/AliTPCReconstructor.h b/TPC/AliTPCReconstructor.h index c1b25d58adc..56870f04deb 100644 --- a/TPC/AliTPCReconstructor.h +++ b/TPC/AliTPCReconstructor.h @@ -27,19 +27,17 @@ public: AliESDEvent* esd) const {FillESD((TTree*)NULL,(TTree*)NULL,esd);} - static void SetRecoParam(AliTPCRecoParam * param) { fgkRecoParam = param;} - static const AliTPCRecoParam* GetRecoParam(); + static const AliTPCRecoParam* GetRecoParam() { return dynamic_cast(AliReconstructor::GetRecoParam(1)); } // - static Double_t GetCtgRange() { return fgkRecoParam->GetCtgRange();} - static Double_t GetMaxSnpTracker(){ return fgkRecoParam->GetMaxSnpTracker();} - static Double_t GetMaxSnpTrack() { return fgkRecoParam->GetMaxSnpTrack();} + static Double_t GetCtgRange() { return GetRecoParam()->GetCtgRange();} + static Double_t GetMaxSnpTracker(){ return GetRecoParam()->GetMaxSnpTracker();} + static Double_t GetMaxSnpTrack() { return GetRecoParam()->GetMaxSnpTrack();} static Int_t StreamLevel() { return fgStreamLevel;} static void SetStreamLevel(Int_t level) { fgStreamLevel = level;} private: AliTPCParam* GetTPCParam() const; - static AliTPCRecoParam * fgkRecoParam; // reconstruction parameters static Int_t fgStreamLevel; // flag for streaming - for TPC reconstruction AliTPCclustererMI* fClusterer; // TPC clusterer diff --git a/TPC/AliTPCcalibDB.cxx b/TPC/AliTPCcalibDB.cxx index 79685edf222..02898d2ee50 100644 --- a/TPC/AliTPCcalibDB.cxx +++ b/TPC/AliTPCcalibDB.cxx @@ -165,7 +165,6 @@ AliTPCcalibDB::AliTPCcalibDB(): fPedestals(0), fTemperature(0), fMapping(0), - fRecoParamArray(0), fParam(0), fClusterParam(0) { @@ -187,7 +186,6 @@ AliTPCcalibDB::AliTPCcalibDB(const AliTPCcalibDB& ): fPedestals(0), fTemperature(0), fMapping(0), - fRecoParamArray(0), fParam(0), fClusterParam(0) @@ -300,14 +298,6 @@ void AliTPCcalibDB::Update(){ fTemperature = (AliTPCSensorTempArray*)entry->GetObject(); } - - entry = GetCDBEntry("TPC/Calib/RecoParam"); - if (entry){ - entry->SetOwner(kTRUE); - fRecoParamArray = (TObjArray*)(entry->GetObject()); - } - - entry = GetCDBEntry("TPC/Calib/Parameters"); if (entry){ //if (fPadNoise) delete fPadNoise; @@ -655,17 +645,3 @@ void AliTPCcalibDB::MakeTree(const char * fileName, TObjArray * array, const cha delete[] mapNames; } } - - -AliTPCRecoParam * AliTPCcalibDB::GetRecoParam(Int_t */*eventtype*/){ - // - // - // - if (!fRecoParamArray){ - return 0; // back compatible sollution - }; - - AliTPCRecoParam * param = (AliTPCRecoParam*)fRecoParamArray->At(0); - return param; - -} diff --git a/TPC/AliTPCcalibDB.h b/TPC/AliTPCcalibDB.h index 1592fbc7489..590bc9f4796 100644 --- a/TPC/AliTPCcalibDB.h +++ b/TPC/AliTPCcalibDB.h @@ -20,7 +20,6 @@ class AliCDBEntry; class AliTPCParam; class AliTPCAltroMapping; class AliTPCClusterParam; -class AliTPCRecoParam; //class AliCDBStorage; class AliTPCcalibDB : public TObject @@ -42,7 +41,6 @@ class AliTPCcalibDB : public TObject AliTPCParam* GetParameters(){return fParam;} AliTPCAltroMapping ** GetMapping(){ return fMapping;} AliTPCClusterParam *GetClusterParam(){ return fClusterParam;} - AliTPCRecoParam * GetRecoParam(Int_t *eventtype); // static void CreateObjectList(const Char_t *filename, TObjArray *calibObjects); static void MakeTree(const char * fileName, TObjArray * array, const char * mapFileName = 0, AliTPCCalPad* outlierPad = 0, Float_t ltmFraction = 0.9); @@ -64,7 +62,6 @@ protected: AliTPCCalPad* fPedestals; // Pedestal calibration entry AliTPCSensorTempArray* fTemperature; // Temperature calibration entry AliTPCAltroMapping **fMapping; // Altro mapping - TObjArray * fRecoParamArray; // reconstruction parameters // // AliTPCParam * fParam; // TPC parameters diff --git a/TRD/AliTRDReconstructor.cxx b/TRD/AliTRDReconstructor.cxx index fb506015059..d08cd08fd6e 100644 --- a/TRD/AliTRDReconstructor.cxx +++ b/TRD/AliTRDReconstructor.cxx @@ -41,11 +41,8 @@ ClassImp(AliTRDReconstructor) -AliTRDrecoParam* AliTRDReconstructor::fgRecoParam = 0x0; - //_____________________________________________________________________________ AliTRDReconstructor::~AliTRDReconstructor() { - if(fgRecoParam) delete fgRecoParam; } diff --git a/TRD/AliTRDReconstructor.h b/TRD/AliTRDReconstructor.h index b887ecf4e9d..62219be3e1c 100644 --- a/TRD/AliTRDReconstructor.h +++ b/TRD/AliTRDReconstructor.h @@ -14,7 +14,10 @@ #include "AliReconstructor.h" class AliRawReader; -class AliTRDrecoParam; + +#include "AliDetectorRecoParam.h" +#include "AliTRDrecoParam.h" + class AliTRDReconstructor: public AliReconstructor { @@ -31,7 +34,6 @@ class AliTRDReconstructor: public AliReconstructor virtual void Reconstruct(AliRawReader *rawReader, TTree *clusterTree) const; virtual void Reconstruct(TTree *digitsTree, TTree *clusterTree) const; - static AliTRDrecoParam *RecoParam() { return fgRecoParam; } virtual AliTracker *CreateTracker() const; virtual void FillESD(AliRawReader */*rawReader*/, TTree *clusterTree, AliESDEvent *esd) const @@ -40,12 +42,7 @@ class AliTRDReconstructor: public AliReconstructor , esd); } virtual void FillESD(TTree *digitsTree, TTree *clusterTree, AliESDEvent *esd) const; - static void SetRecoParam(AliTRDrecoParam *reco) { fgRecoParam = reco; } - - - private: - - static AliTRDrecoParam *fgRecoParam; // Reconstruction parameters + static const AliTRDrecoParam* GetRecoParam() { return dynamic_cast(AliReconstructor::GetRecoParam(2)); } ClassDef(AliTRDReconstructor,0) // Class for the TRD reconstruction diff --git a/TRD/AliTRDchamberTimeBin.cxx b/TRD/AliTRDchamberTimeBin.cxx index 2a02ae4ba79..506d3948f91 100644 --- a/TRD/AliTRDchamberTimeBin.cxx +++ b/TRD/AliTRDchamberTimeBin.cxx @@ -337,7 +337,7 @@ void AliTRDchamberTimeBin::BuildIndices(Int_t iter) fX += cl->GetX(); // Debug Streaming - if(AliTRDtrackerV1::DebugStreamer() && AliTRDReconstructor::RecoParam()->GetStreamLevel() >= 3){ + if(AliTRDtrackerV1::DebugStreamer() && AliTRDReconstructor::GetRecoParam()->GetStreamLevel() >= 3){ TTreeSRedirector &cstream = *AliTRDtrackerV1::DebugStreamer(); cstream << "BuildIndices" << "Plane=" << fPlane @@ -556,7 +556,7 @@ void AliTRDchamberTimeBin::BuildCond(AliTRDcluster *cl, Double_t *cond, UChar_t //End_Html // - if(!AliTRDReconstructor::RecoParam()){ + if(!AliTRDReconstructor::GetRecoParam()){ AliError("Reconstruction parameters not initialized."); return; } @@ -564,13 +564,13 @@ void AliTRDchamberTimeBin::BuildCond(AliTRDcluster *cl, Double_t *cond, UChar_t if(Layer == 0){ cond[0] = cl->GetY(); // center: y-Direction cond[1] = cl->GetZ(); // center: z-Direction - cond[2] = AliTRDReconstructor::RecoParam()->GetMaxPhi() * (cl->GetX() - GetX()) + 1.0; // deviation: y-Direction - cond[3] = AliTRDReconstructor::RecoParam()->GetMaxTheta() * (cl->GetX() - GetX()) + 1.0; // deviation: z-Direction + cond[2] = AliTRDReconstructor::GetRecoParam()->GetMaxPhi() * (cl->GetX() - GetX()) + 1.0; // deviation: y-Direction + cond[3] = AliTRDReconstructor::GetRecoParam()->GetMaxTheta() * (cl->GetX() - GetX()) + 1.0; // deviation: z-Direction } else { cond[0] = cl->GetY() + phi * (GetX() - cl->GetX()); cond[1] = cl->GetZ() + theta * (GetX() - cl->GetX()); - cond[2] = AliTRDReconstructor::RecoParam()->GetRoad0y() + phi; - cond[3] = AliTRDReconstructor::RecoParam()->GetRoad0z(); + cond[2] = AliTRDReconstructor::GetRecoParam()->GetRoad0y() + phi; + cond[3] = AliTRDReconstructor::GetRecoParam()->GetRoad0z(); } } @@ -647,8 +647,8 @@ AliTRDcluster *AliTRDchamberTimeBin::GetNearestCluster(Double_t *cond) // successfull) by the help of the method FindNearestCluster - Double_t maxroad = AliTRDReconstructor::RecoParam()->GetRoad2y(); - Double_t maxroadz = AliTRDReconstructor::RecoParam()->GetRoad2z(); + Double_t maxroad = AliTRDReconstructor::GetRecoParam()->GetRoad2y(); + Double_t maxroadz = AliTRDReconstructor::GetRecoParam()->GetRoad2z(); Int_t index = SearchNearestCluster(cond[0],cond[1],maxroad,maxroadz); AliTRDcluster *returnCluster = 0x0; diff --git a/TRD/AliTRDclusterizer.cxx b/TRD/AliTRDclusterizer.cxx index 908ea241064..ee30446036c 100644 --- a/TRD/AliTRDclusterizer.cxx +++ b/TRD/AliTRDclusterizer.cxx @@ -85,15 +85,6 @@ AliTRDclusterizer::AliTRDclusterizer() fRawVersion = AliTRDfeeParam::Instance()->GetRAWversion(); - // retrive reco params - AliTRDrecoParam *rec = 0x0; - if (!(rec = AliTRDReconstructor::RecoParam())){ - if(!(rec = trd->GetRecoParam(0))){ - AliInfo("Using default RecoParams = LowFluxParam."); - rec = AliTRDrecoParam::GetLowFluxParam(); - } - AliTRDReconstructor::SetRecoParam(rec); - } } @@ -123,16 +114,6 @@ AliTRDclusterizer::AliTRDclusterizer(const Text_t *name, const Text_t *title) AliFatal("Could not get calibration object"); } - // retrive reco params - AliTRDrecoParam *rec = 0x0; - if (!(rec = AliTRDReconstructor::RecoParam())){ - if(!(rec = trd->GetRecoParam(0))){ - AliInfo("Using default RecoParams = LowFluxParam."); - rec = AliTRDrecoParam::GetLowFluxParam(); - } - AliTRDReconstructor::SetRecoParam(rec); - } - fDigitsManager->CreateArrays(); fRawVersion = AliTRDfeeParam::Instance()->GetRAWversion(); @@ -314,7 +295,7 @@ Bool_t AliTRDclusterizer::OpenOutput(TTree *clusterTree) // tracklet writing - if (AliTRDReconstructor::RecoParam()->IsTrackletWriteEnabled()){ + if (AliTRDReconstructor::GetRecoParam()->IsTrackletWriteEnabled()){ TString evfoldname = AliConfig::GetDefaultEventFolderName(); fRunLoader = AliRunLoader::GetRunLoader(evfoldname); @@ -666,7 +647,7 @@ Bool_t AliTRDclusterizer::Raw2ClustersChamber(AliRawReader *rawReader) fDigitsManager->SetUseDictionaries(fAddLabels); // tracklet container for raw tracklet writing - if (!fTrackletContainer && AliTRDReconstructor::RecoParam()->IsTrackletWriteEnabled()) + if (!fTrackletContainer && AliTRDReconstructor::GetRecoParam()->IsTrackletWriteEnabled()) { fTrackletContainer = new UInt_t *[2]; for (Int_t i=0; i<2 ;i++){ @@ -696,11 +677,11 @@ Bool_t AliTRDclusterizer::Raw2ClustersChamber(AliRawReader *rawReader) fDigitsManager->RemoveDictionaries(det); fDigitsManager->ClearIndexes(det); - if (!AliTRDReconstructor::RecoParam()-> IsTrackletWriteEnabled()) continue; + if (!AliTRDReconstructor::GetRecoParam()-> IsTrackletWriteEnabled()) continue; if (*(fTrackletContainer[0]) > 0 || *(fTrackletContainer[1]) > 0) WriteTracklets(det); // if there is tracklet words in this det } - if (AliTRDReconstructor::RecoParam()->IsTrackletWriteEnabled()){ + if (AliTRDReconstructor::GetRecoParam()->IsTrackletWriteEnabled()){ delete [] fTrackletContainer; fTrackletContainer = NULL; } @@ -771,21 +752,21 @@ Bool_t AliTRDclusterizer::MakeClusters(Int_t det) // There is no ADC threshold anymore, and simParam should not be used in clusterizer. KO Float_t adcThreshold = 0; - if (!AliTRDReconstructor::RecoParam()) + if (!AliTRDReconstructor::GetRecoParam()) { AliError("RecoParam does not exist\n"); return kFALSE; } // Threshold value for the maximum - Float_t maxThresh = AliTRDReconstructor::RecoParam()->GetClusMaxThresh(); + Float_t maxThresh = AliTRDReconstructor::GetRecoParam()->GetClusMaxThresh(); // Threshold value for the digit signal - Float_t sigThresh = AliTRDReconstructor::RecoParam()->GetClusSigThresh(); + Float_t sigThresh = AliTRDReconstructor::GetRecoParam()->GetClusSigThresh(); // Threshold value for the maximum ( cut noise) - Float_t minMaxCutSigma = AliTRDReconstructor::RecoParam()->GetMinMaxCutSigma(); + Float_t minMaxCutSigma = AliTRDReconstructor::GetRecoParam()->GetMinMaxCutSigma(); // Threshold value for the sum pad ( cut noise) - Float_t minLeftRightCutSigma = AliTRDReconstructor::RecoParam()->GetMinLeftRightCutSigma(); + Float_t minLeftRightCutSigma = AliTRDReconstructor::GetRecoParam()->GetMinLeftRightCutSigma(); // Iteration limit for unfolding procedure const Float_t kEpsilon = 0.01; @@ -1001,7 +982,7 @@ Bool_t AliTRDclusterizer::MakeClusters(Int_t det) // The position of the cluster in COL direction relative to the center pad (pad units) Double_t clusterPosCol = 0.0; - if (AliTRDReconstructor::RecoParam()->IsLUT()) { + if (AliTRDReconstructor::GetRecoParam()->IsLUT()) { // Calculate the position of the cluster by using the // lookup table method clusterPosCol = LUTposition(ilayer,clusterSignal[2] @@ -1318,9 +1299,9 @@ void AliTRDclusterizer::TailCancelation(AliTRDdataArrayDigits *digitsIn { // Apply the tail cancelation via the digital filter // (only for non-coorupted pads) - if (AliTRDReconstructor::RecoParam()->IsTailCancelation()) + if (AliTRDReconstructor::GetRecoParam()->IsTailCancelation()) { - DeConvExp(inADC,outADC,nTimeTotal,AliTRDReconstructor::RecoParam()->GetTCnexp()); + DeConvExp(inADC,outADC,nTimeTotal,AliTRDReconstructor::GetRecoParam()->GetTCnexp()); } } diff --git a/TRD/AliTRDpidESD.cxx b/TRD/AliTRDpidESD.cxx index e607b106688..1268d120fc3 100644 --- a/TRD/AliTRDpidESD.cxx +++ b/TRD/AliTRDpidESD.cxx @@ -134,7 +134,7 @@ Int_t AliTRDpidESD::MakePID(AliESDEvent *event) return -1; } - AliTRDrecoParam *rec = AliTRDReconstructor::RecoParam(); + const AliTRDrecoParam *rec = AliTRDReconstructor::GetRecoParam(); if (!rec) { AliErrorGeneral("AliTRDpidESD::MakePID()", "No TRD reco param."); return 0x0; diff --git a/TRD/AliTRDrecoParam.h b/TRD/AliTRDrecoParam.h index 7b25ba955fa..c1096e1040b 100644 --- a/TRD/AliTRDrecoParam.h +++ b/TRD/AliTRDrecoParam.h @@ -44,7 +44,7 @@ public: Double_t GetRoad2z() const { return fkRoad2z; } Double_t GetTrackLikelihood() const { return fkTrackLikelihood; } Int_t GetStreamLevel() const { return fkStreamLevel; } - inline void GetSysCovMatrix(Double_t *sys); + inline void GetSysCovMatrix(Double_t *sys) const; Double_t GetMinMaxCutSigma() const { return fMinMaxCutSigma; }; Double_t GetMinLeftRightCutSigma() const { return fMinLeftRightCutSigma; }; Double_t GetClusMaxThresh() const { return fClusMaxThresh; }; @@ -141,7 +141,7 @@ private: }; //___________________________________________________ -inline void AliTRDrecoParam::GetSysCovMatrix(Double_t *sys) +inline void AliTRDrecoParam::GetSysCovMatrix(Double_t *sys) const { if(!sys) return; memcpy(sys, fSysCovMatrix, 5*sizeof(Double_t)); diff --git a/TRD/AliTRDseedV1.cxx b/TRD/AliTRDseedV1.cxx index f8de9628a6a..6ab0fec10d4 100644 --- a/TRD/AliTRDseedV1.cxx +++ b/TRD/AliTRDseedV1.cxx @@ -221,7 +221,7 @@ void AliTRDseedV1::CookdEdx(Int_t nslices) nclusters[slice]++; } // End of loop over clusters - if(AliTRDReconstructor::RecoParam()->GetPIDMethod() == AliTRDrecoParam::kLQPID){ + if(AliTRDReconstructor::GetRecoParam()->GetPIDMethod() == AliTRDrecoParam::kLQPID){ // calculate mean charge per slice (only LQ PID) for(int is=0; isGetPIDMethod(), pd->IsA()->GetName())); + //AliInfo(Form("Method[%d] : %s", AliTRDReconstructor::GetRecoParam()->GetPIDMethod(), pd->IsA()->GetName())); // calculate tracklet length TO DO Float_t length = (AliTRDgeometry::AmThick() + AliTRDgeometry::DrThick()); @@ -355,13 +355,13 @@ Bool_t AliTRDseedV1::AttachClustersIter(AliTRDtrackingChamber *chamber, Float_t // debug level 7 // - if(!AliTRDReconstructor::RecoParam()){ + if(!AliTRDReconstructor::GetRecoParam()){ AliError("Seed can not be used without a valid RecoParam."); return kFALSE; } AliTRDchamberTimeBin *layer = 0x0; - if(AliTRDReconstructor::RecoParam()->GetStreamLevel()>=7 && c){ + if(AliTRDReconstructor::GetRecoParam()->GetStreamLevel()>=7 && c){ TClonesArray clusters("AliTRDcluster", 24); clusters.SetOwner(kTRUE); AliTRDcluster *cc = 0x0; @@ -389,7 +389,7 @@ Bool_t AliTRDseedV1::AttachClustersIter(AliTRDtrackingChamber *chamber, Float_t } Float_t tquality; - Double_t kroady = AliTRDReconstructor::RecoParam()->GetRoad1y(); + Double_t kroady = AliTRDReconstructor::GetRecoParam()->GetRoad1y(); Double_t kroadz = fPadLength * .5 + 1.; // initialize configuration parameters @@ -429,7 +429,7 @@ Bool_t AliTRDseedV1::AttachClustersIter(AliTRDtrackingChamber *chamber, Float_t fZ[iTime] = cl->GetZ(); ncl++; } - if(AliTRDReconstructor::RecoParam()->GetStreamLevel()>=7) AliInfo(Form("iter = %d ncl [%d] = %d", iter, fPlane, ncl)); + if(AliTRDReconstructor::GetRecoParam()->GetStreamLevel()>=7) AliInfo(Form("iter = %d ncl [%d] = %d", iter, fPlane, ncl)); if(ncl>1){ // calculate length of the time bin (calibration aware) @@ -470,7 +470,7 @@ Bool_t AliTRDseedV1::AttachClustersIter(AliTRDtrackingChamber *chamber, Float_t AliTRDseed::Update(); } - if(AliTRDReconstructor::RecoParam()->GetStreamLevel()>=7) AliInfo(Form("iter = %d nclFit [%d] = %d", iter, fPlane, fN2)); + if(AliTRDReconstructor::GetRecoParam()->GetStreamLevel()>=7) AliInfo(Form("iter = %d nclFit [%d] = %d", iter, fPlane, fN2)); if(IsOK()){ tquality = GetQuality(kZcorr); @@ -506,7 +506,7 @@ Bool_t AliTRDseedV1::AttachClusters(AliTRDtrackingChamber *chamber // 6. fit tracklet // - if(!AliTRDReconstructor::RecoParam()){ + if(!AliTRDReconstructor::GetRecoParam()){ AliError("Seed can not be used without a valid RecoParam."); return kFALSE; } @@ -514,7 +514,7 @@ Bool_t AliTRDseedV1::AttachClusters(AliTRDtrackingChamber *chamber const Int_t kClusterCandidates = 2 * knTimebins; //define roads - Double_t kroady = AliTRDReconstructor::RecoParam()->GetRoad1y(); + Double_t kroady = AliTRDReconstructor::GetRecoParam()->GetRoad1y(); Double_t kroadz = fPadLength * 1.5 + 1.; // correction to y for the tilting angle Float_t zcorr = kZcorr ? fTilt * (fZProb - fZref[0]) : 0.; @@ -606,7 +606,7 @@ Bool_t AliTRDseedV1::AttachClusters(AliTRDtrackingChamber *chamber } // number of minimum numbers of clusters expected for the tracklet - Int_t kClmin = Int_t(AliTRDReconstructor::RecoParam()->GetFindableClusters()*AliTRDtrackerV1::GetNTimeBins()); + Int_t kClmin = Int_t(AliTRDReconstructor::GetRecoParam()->GetFindableClusters()*AliTRDtrackerV1::GetNTimeBins()); if (fN2 < kClmin){ AliWarning(Form("Not enough clusters to fit the tracklet %d [%d].", fN2, kClmin)); fN2 = 0; diff --git a/TRD/AliTRDtrackV1.cxx b/TRD/AliTRDtrackV1.cxx index 6eba051aa3e..124b67a1cdf 100644 --- a/TRD/AliTRDtrackV1.cxx +++ b/TRD/AliTRDtrackV1.cxx @@ -605,7 +605,7 @@ Bool_t AliTRDtrackV1::Update(AliTRDseedV1 *trklt, Double_t chisq) // insert systematic uncertainties calibration and misalignment Double_t sys[15]; - AliTRDReconstructor::RecoParam()->GetSysCovMatrix(sys); + AliTRDReconstructor::GetRecoParam()->GetSysCovMatrix(sys); cov[0] += (sys[0]*sys[0]); cov[2] += (sys[1]*sys[1]); diff --git a/TRD/AliTRDtracker.cxx b/TRD/AliTRDtracker.cxx index 3d9461f2306..e0d644c42b4 100644 --- a/TRD/AliTRDtracker.cxx +++ b/TRD/AliTRDtracker.cxx @@ -418,7 +418,7 @@ Int_t AliTRDtracker::PropagateBack(AliESDEvent *event) Int_t nSeed = event->GetNumberOfTracks(); if(!nSeed){ // run stand alone tracking - if (AliTRDReconstructor::RecoParam()->IsSeeding()) Clusters2Tracks(event); + if (AliTRDReconstructor::GetRecoParam()->IsSeeding()) Clusters2Tracks(event); return 0; } @@ -526,7 +526,7 @@ Int_t AliTRDtracker::PropagateBack(AliESDEvent *event) // Debug part of tracking TTreeSRedirector &cstream = *fDebugStreamer; Int_t eventNrInFile = event->GetEventNumberInFile(); // This is most likely NOT the event number you'd like to use. It has nothing to do with the 'real' event number. - if (AliTRDReconstructor::RecoParam()->GetStreamLevel() > 0) { + if (AliTRDReconstructor::GetRecoParam()->GetStreamLevel() > 0) { if (track->GetBackupTrack()) { cstream << "Tracks" << "EventNrInFile=" << eventNrInFile @@ -774,7 +774,7 @@ Int_t AliTRDtracker::RefitInward(AliESDEvent *event) // Add TRD track to ESDfriendTrack - maybe this tracks are // not useful for post-processing - TODO make decision - if (AliTRDReconstructor::RecoParam()->GetStreamLevel() > 0) { + if (AliTRDReconstructor::GetRecoParam()->GetStreamLevel() > 0) { seed->AddCalibObject(new AliTRDtrack(*pt2/*, kTRUE*/)); } delete pt2; @@ -782,7 +782,7 @@ Int_t AliTRDtracker::RefitInward(AliESDEvent *event) } // Add TRD track to ESDfriendTrack - if (AliTRDReconstructor::RecoParam()->GetStreamLevel() > 0) { + if (AliTRDReconstructor::GetRecoParam()->GetStreamLevel() > 0) { seed->AddCalibObject(new AliTRDtrack(*pt/*, kTRUE*/)); } delete pt; @@ -1560,7 +1560,7 @@ Int_t AliTRDtracker::Clusters2Tracks(AliESDEvent *esd) isFake = kTRUE; } - if (AliTRDReconstructor::RecoParam()->GetStreamLevel() > 0) { + if (AliTRDReconstructor::GetRecoParam()->GetStreamLevel() > 0) { if ((!isFake) || ((icl3%10) == 0)) { // Debugging print TTreeSRedirector &cstream = *fDebugStreamer; cstream << "Seeds0" @@ -2198,7 +2198,7 @@ Int_t AliTRDtracker::Clusters2Tracks(AliESDEvent *esd) if (1 || (!isFake)) { Float_t zvertex = GetZ(); TTreeSRedirector &cstream = *fDebugStreamer; - if (AliTRDReconstructor::RecoParam()->GetStreamLevel() > 0) { + if (AliTRDReconstructor::GetRecoParam()->GetStreamLevel() > 0) { cstream << "Seeds1" << "isFake=" << isFake << "Vertex=" << zvertex @@ -2419,7 +2419,7 @@ Int_t AliTRDtracker::Clusters2Tracks(AliESDEvent *esd) esdtrack.UpdateTrackParams(track,AliESDtrack::kTRDout); esdtrack.SetLabel(label); esd->AddTrack(&esdtrack); - if (AliTRDReconstructor::RecoParam()->GetStreamLevel() > 0) { + if (AliTRDReconstructor::GetRecoParam()->GetStreamLevel() > 0) { cstream << "Tracks" << "EventNrInFile=" << eventNrInFile << "ESD.=" << &esdtrack @@ -2429,7 +2429,7 @@ Int_t AliTRDtracker::Clusters2Tracks(AliESDEvent *esd) } } - if (AliTRDReconstructor::RecoParam()->GetStreamLevel() > 0) { + if (AliTRDReconstructor::GetRecoParam()->GetStreamLevel() > 0) { cstream << "Seeds2" << "Iter=" << jter << "Track.=" << track @@ -3662,7 +3662,7 @@ Int_t AliTRDtracker::FindClusters(Int_t sector, Int_t t0, Int_t t1 TGraph graphy(t1-t0,x,yt); TGraph graphz(t1-t0,x,zt); - if (AliTRDReconstructor::RecoParam()->GetStreamLevel() > 0) { + if (AliTRDReconstructor::GetRecoParam()->GetStreamLevel() > 0) { cstream << "tracklet" << "track.=" << track // Track parameters << "tany=" << tany // Tangent of the local track angle diff --git a/TRD/AliTRDtrackerV1.cxx b/TRD/AliTRDtrackerV1.cxx index 53e3188d005..019c00c4798 100644 --- a/TRD/AliTRDtrackerV1.cxx +++ b/TRD/AliTRDtrackerV1.cxx @@ -100,23 +100,11 @@ AliTRDtrackerV1::AliTRDtrackerV1() for (Int_t isector = 0; isector < AliTRDgeometry::kNsector; isector++) new(&fTrSec[isector]) AliTRDtrackingSector(fGeom, isector); - // retrive reco params - AliTRDrecoParam *rec = 0x0; - if (!(rec = AliTRDReconstructor::RecoParam())){ - if(!(rec = trd->GetRecoParam(0))){ - AliInfo("Using default RecoParams = LowFluxParam."); - rec = AliTRDrecoParam::GetLowFluxParam(); - } - AliTRDReconstructor::SetRecoParam(rec); - } - for(Int_t isl =0; islGetStreamLevel() > 1){ - TDirectory *savedir = gDirectory; - fgDebugStreamer = new TTreeSRedirector("TRD.TrackerDebug.root"); - savedir->cd(); - } + TDirectory *savedir = gDirectory; + fgDebugStreamer = new TTreeSRedirector("TRD.TrackerDebug.root"); + savedir->cd(); } //____________________________________________________________________ @@ -155,8 +143,8 @@ Int_t AliTRDtrackerV1::Clusters2Tracks(AliESDEvent *esd) // See AliTRDtrackerV1::Clusters2TracksSM() for details. // - if(!AliTRDReconstructor::RecoParam()){ - AliError("Reconstruction configuration not initialized. Call first AliTRDReconstructor::SetRecoParam()."); + if(!AliTRDReconstructor::GetRecoParam()){ + AliError("Reconstruction configuration not initialized."); return 0; } @@ -316,7 +304,7 @@ Int_t AliTRDtrackerV1::PropagateBack(AliESDEvent *event) track.UpdateESDtrack(seed); // Add TRD track to ESDfriendTrack - if (AliTRDReconstructor::RecoParam()->GetStreamLevel() > 0 /*&& quality TODO*/){ + if (AliTRDReconstructor::GetRecoParam()->GetStreamLevel() > 0 /*&& quality TODO*/){ AliTRDtrackV1 *calibTrack = new AliTRDtrackV1(track); calibTrack->SetOwner(); seed->AddCalibObject(calibTrack); @@ -423,7 +411,7 @@ Int_t AliTRDtrackerV1::PropagateBack(AliESDEvent *event) AliInfo(Form("Number of back propagated TRD tracks: %d", found)); // run stand alone tracking - if (AliTRDReconstructor::RecoParam()->IsSeeding()) Clusters2Tracks(event); + if (AliTRDReconstructor::GetRecoParam()->IsSeeding()) Clusters2Tracks(event); return 0; } @@ -559,7 +547,7 @@ Int_t AliTRDtrackerV1::FollowProlongation(AliTRDtrackV1 &t) } } - if(AliTRDReconstructor::RecoParam()->GetStreamLevel() > 1){ + if(AliTRDReconstructor::GetRecoParam()->GetStreamLevel() > 1){ Int_t index; for(int iplane=0; iplane<6; iplane++){ AliTRDseedV1 *tracklet = GetTracklet(&t, iplane, index); @@ -637,7 +625,7 @@ Int_t AliTRDtrackerV1::FollowBackProlongation(AliTRDtrackV1 &t) if(!(chamber = fTrSec[sector].GetChamber(stack, ilayer))) continue; - if(chamber->GetNClusters() < fgNTimeBins*AliTRDReconstructor::RecoParam()->GetFindableClusters()) continue; + if(chamber->GetNClusters() < fgNTimeBins*AliTRDReconstructor::GetRecoParam()->GetFindableClusters()) continue; x = chamber->GetX(); @@ -653,7 +641,7 @@ Int_t AliTRDtrackerV1::FollowBackProlongation(AliTRDtrackV1 &t) if(!tracklet.AttachClustersIter(chamber, 1000.)) continue; tracklet.Init(&t); - if(tracklet.GetN() < fgNTimeBins * AliTRDReconstructor::RecoParam()->GetFindableClusters()) continue; + if(tracklet.GetN() < fgNTimeBins * AliTRDReconstructor::GetRecoParam()->GetFindableClusters()) continue; break; } @@ -729,7 +717,7 @@ Int_t AliTRDtrackerV1::FollowBackProlongation(AliTRDtrackV1 &t) } // end layers loop - if(AliTRDReconstructor::RecoParam()->GetStreamLevel() > 1){ + if(AliTRDReconstructor::GetRecoParam()->GetStreamLevel() > 1){ TTreeSRedirector &cstreamer = *fgDebugStreamer; Int_t eventNumber = AliTRDtrackerDebug::GetEventNumber(); //AliTRDtrackV1 *debugTrack = new AliTRDtrackV1(t); @@ -883,7 +871,7 @@ Float_t AliTRDtrackerV1::FitTiltedRiemanConstraint(AliTRDseedV1 *tracklets, Doub for(Int_t ip = 0; ip < AliTRDtrackerV1::kNPlanes; ip++) tracklets[ip].SetCC(curvature); - if(AliTRDReconstructor::RecoParam()->GetStreamLevel() >= 5){ + if(AliTRDReconstructor::GetRecoParam()->GetStreamLevel() >= 5){ //Linear Model on z-direction Double_t xref = CalculateReferenceX(tracklets); // Relative to the middle of the stack Double_t slope = fitter->GetParameter(2); @@ -1055,7 +1043,7 @@ Float_t AliTRDtrackerV1::FitTiltedRieman(AliTRDseedV1 *tracklets, Bool_t sigErro tracklets[iLayer].SetChi2(chi2track); } - if(AliTRDReconstructor::RecoParam()->GetStreamLevel() >=5){ + if(AliTRDReconstructor::GetRecoParam()->GetStreamLevel() >=5){ TTreeSRedirector &cstreamer = *fgDebugStreamer; Int_t eventNumber = AliTRDtrackerDebug::GetEventNumber(); Int_t candidateNumber = AliTRDtrackerDebug::GetCandidateNumber(); @@ -1287,7 +1275,7 @@ Double_t AliTRDtrackerV1::FitRiemanTilt(AliTRDtrackV1 *track, AliTRDseedV1 *trac } } - if(AliTRDReconstructor::RecoParam()->GetStreamLevel() >=5){ + if(AliTRDReconstructor::GetRecoParam()->GetStreamLevel() >=5){ TTreeSRedirector &cstreamer = *fgDebugStreamer; Int_t eventNumber = AliTRDtrackerDebug::GetEventNumber(); Int_t candidateNumber = AliTRDtrackerDebug::GetCandidateNumber(); @@ -1631,7 +1619,7 @@ Int_t AliTRDtrackerV1::Clusters2TracksSM(Int_t sector, AliESDEvent *esd) nChambers = 0; for(int ilayer=0; ilayerGetNClusters() < fgNTimeBins * AliTRDReconstructor::RecoParam()->GetFindableClusters()) continue; + if(chamber->GetNClusters() < fgNTimeBins * AliTRDReconstructor::GetRecoParam()->GetFindableClusters()) continue; nChambers++; //AliInfo(Form("sector %d stack %d layer %d clusters %d", sector, istack, ilayer, chamber->GetNClusters())); } @@ -1689,7 +1677,7 @@ Int_t AliTRDtrackerV1::Clusters2TracksStack(AliTRDtrackingChamber **stack, TClon // Build initial seeding configurations Double_t quality = BuildSeedingConfigs(stack, configs); - if(AliTRDReconstructor::RecoParam()->GetStreamLevel() > 1){ + if(AliTRDReconstructor::GetRecoParam()->GetStreamLevel() > 1){ AliInfo(Form("Plane config %d %d %d Quality %f" , configs[0], configs[1], configs[2], quality)); } @@ -1708,7 +1696,7 @@ Int_t AliTRDtrackerV1::Clusters2TracksStack(AliTRDtrackingChamber **stack, TClon ntracks = MakeSeeds(stack, &sseed[6*ntracks], pars); if(ntracks == kMaxTracksStack) break; } - if(AliTRDReconstructor::RecoParam()->GetStreamLevel() > 1) AliInfo(Form("Candidate TRD tracks %d in iteration %d.", ntracks, fSieveSeeding)); + if(AliTRDReconstructor::GetRecoParam()->GetStreamLevel() > 1) AliInfo(Form("Candidate TRD tracks %d in iteration %d.", ntracks, fSieveSeeding)); if(!ntracks) break; @@ -1872,7 +1860,7 @@ Int_t AliTRDtrackerV1::Clusters2TracksStack(AliTRDtrackingChamber **stack, TClon Int_t ich = 0; while(!(chamber = stack[ich])) ich++; trackParams[6] = fGeom->GetSector(chamber->GetDetector());/* *alpha+shift; // Supermodule*/ - if(AliTRDReconstructor::RecoParam()->GetStreamLevel() > 1){ + if(AliTRDReconstructor::GetRecoParam()->GetStreamLevel() > 1){ AliInfo(Form("Track %d [%d] nlayers %d trackQuality = %e nused %d, yref = %3.3f", itrack, trackIndex, nlayers, fTrackQuality[trackIndex], nused, trackParams[1])); Int_t nclusters = 0; @@ -1931,7 +1919,7 @@ Int_t AliTRDtrackerV1::Clusters2TracksStack(AliTRDtrackingChamber **stack, TClon esdTrack.SetLabel(track->GetLabel()); track->UpdateESDtrack(&esdTrack); // write ESD-friends if neccessary - if (AliTRDReconstructor::RecoParam()->GetStreamLevel() > 0){ + if (AliTRDReconstructor::GetRecoParam()->GetStreamLevel() > 0){ AliTRDtrackV1 *calibTrack = new AliTRDtrackV1(*track); calibTrack->SetOwner(); esdTrack.AddCalibObject(calibTrack); @@ -1951,14 +1939,14 @@ Int_t AliTRDtrackerV1::Clusters2TracksStack(AliTRDtrackingChamber **stack, TClon // Rebuild plane configurations and indices taking only unused clusters into account quality = BuildSeedingConfigs(stack, configs); - if(quality < 1.E-7) break; //AliTRDReconstructor::RecoParam()->GetPlaneQualityThreshold()) break; + if(quality < 1.E-7) break; //AliTRDReconstructor::GetRecoParam()->GetPlaneQualityThreshold()) break; for(Int_t ip = 0; ip < kNPlanes; ip++){ if(!(chamber = stack[ip])) continue; chamber->Build(fGeom);//Indices(fSieveSeeding); } - if(AliTRDReconstructor::RecoParam()->GetStreamLevel() > 1){ + if(AliTRDReconstructor::GetRecoParam()->GetStreamLevel() > 1){ AliInfo(Form("Sieve level %d Plane config %d %d %d Quality %f", fSieveSeeding, configs[0], configs[1], configs[2], quality)); } } while(fSieveSeeding<10); // end stack clusters sieve @@ -2103,7 +2091,7 @@ Int_t AliTRDtrackerV1::MakeSeeds(AliTRDtrackingChamber **stack, AliTRDseedV1 *ss padlength[iplane] = pp->GetLengthIPad(); } - if(AliTRDReconstructor::RecoParam()->GetStreamLevel() > 1){ + if(AliTRDReconstructor::GetRecoParam()->GetStreamLevel() > 1){ AliInfo(Form("Making seeds Stack[%d] Config[%d] Tracks[%d]...", istack, config, ntracks)); } @@ -2164,7 +2152,7 @@ Int_t AliTRDtrackerV1::MakeSeeds(AliTRDtrackingChamber **stack, AliTRDseedV1 *ss } Bool_t isFake = kFALSE; - if(AliTRDReconstructor::RecoParam()->GetStreamLevel() >= 2){ + if(AliTRDReconstructor::GetRecoParam()->GetStreamLevel() >= 2){ if (c[0]->GetLabel(0) != c[3]->GetLabel(0)) isFake = kTRUE; if (c[1]->GetLabel(0) != c[3]->GetLabel(0)) isFake = kTRUE; if (c[2]->GetLabel(0) != c[3]->GetLabel(0)) isFake = kTRUE; @@ -2208,12 +2196,12 @@ Int_t AliTRDtrackerV1::MakeSeeds(AliTRDtrackingChamber **stack, AliTRDseedV1 *ss <<"\n"; } - if(chi2[0] > AliTRDReconstructor::RecoParam()->GetChi2Z()/*7./(3. - sLayer)*//*iter*/){ + if(chi2[0] > AliTRDReconstructor::GetRecoParam()->GetChi2Z()/*7./(3. - sLayer)*//*iter*/){ //AliInfo(Form("Failed chi2 filter on chi2Z [%f].", chi2[0])); AliTRDtrackerDebug::SetCandidateNumber(AliTRDtrackerDebug::GetCandidateNumber() + 1); continue; } - if(chi2[1] > AliTRDReconstructor::RecoParam()->GetChi2Y()/*1./(3. - sLayer)*//*iter*/){ + if(chi2[1] > AliTRDReconstructor::GetRecoParam()->GetChi2Y()/*1./(3. - sLayer)*//*iter*/){ //AliInfo(Form("Failed chi2 filter on chi2Y [%f].", chi2[1])); AliTRDtrackerDebug::SetCandidateNumber(AliTRDtrackerDebug::GetCandidateNumber() + 1); continue; @@ -2244,7 +2232,7 @@ Int_t AliTRDtrackerV1::MakeSeeds(AliTRDtrackingChamber **stack, AliTRDseedV1 *ss //chi2[1] = GetChi2ZTest(&cseed[0]); Double_t like = CookLikelihood(&cseed[0], planes, chi2); // to be checked - if (TMath::Log(1.E-9 + like) < AliTRDReconstructor::RecoParam()->GetTrackLikelihood()){ + if (TMath::Log(1.E-9 + like) < AliTRDReconstructor::GetRecoParam()->GetTrackLikelihood()){ //AliInfo(Form("Failed likelihood %f[%e].", TMath::Log(1.E-9 + like), like)); AliTRDtrackerDebug::SetCandidateNumber(AliTRDtrackerDebug::GetCandidateNumber() + 1); continue; @@ -2282,7 +2270,7 @@ Int_t AliTRDtrackerV1::MakeSeeds(AliTRDtrackingChamber **stack, AliTRDseedV1 *ss // AliInfo("Extrapolation done."); // Debug Stream containing all the 6 tracklets - if(AliTRDReconstructor::RecoParam()->GetStreamLevel() >= 2){ + if(AliTRDReconstructor::GetRecoParam()->GetStreamLevel() >= 2){ TTreeSRedirector &cstreamer = *fgDebugStreamer; TLinearFitter *tiltedRieman = GetTiltedRiemanFitter(); Int_t eventNumber = AliTRDtrackerDebug::GetEventNumber(); @@ -2314,7 +2302,7 @@ Int_t AliTRDtrackerV1::MakeSeeds(AliTRDtrackingChamber **stack, AliTRDseedV1 *ss // do the final track fitting (Once with vertex constraint and once without vertex constraint) Double_t chi2Vals[3]; chi2Vals[0] = FitTiltedRieman(&cseed[0], kFALSE); - if(AliTRDReconstructor::RecoParam()->IsVertexConstrained()) + if(AliTRDReconstructor::GetRecoParam()->IsVertexConstrained()) chi2Vals[1] = FitTiltedRiemanConstraint(&cseed[0], GetZ()); // Do Vertex Constrained fit if desired else chi2Vals[1] = 1.; @@ -2349,7 +2337,7 @@ Int_t AliTRDtrackerV1::MakeSeeds(AliTRDtrackingChamber **stack, AliTRDseedV1 *ss cseed[iLayer].SetChi2Z(chi2[1]); } - if(AliTRDReconstructor::RecoParam()->GetStreamLevel() >= 2){ + if(AliTRDReconstructor::GetRecoParam()->GetStreamLevel() >= 2){ TTreeSRedirector &cstreamer = *fgDebugStreamer; Int_t eventNumber = AliTRDtrackerDebug::GetEventNumber(); Int_t candidateNumber = AliTRDtrackerDebug::GetCandidateNumber(); @@ -2496,7 +2484,7 @@ Int_t AliTRDtrackerV1::ImproveSeedQuality(AliTRDtrackingChamber **stack, AliTRDs } chi2 = FitTiltedRieman(bseed, kTRUE); - if(AliTRDReconstructor::RecoParam()->GetStreamLevel() >= 7){ + if(AliTRDReconstructor::GetRecoParam()->GetStreamLevel() >= 7){ Int_t eventNumber = AliTRDtrackerDebug::GetEventNumber(); Int_t candidateNumber = AliTRDtrackerDebug::GetCandidateNumber(); TLinearFitter *tiltedRieman = GetTiltedRiemanFitter(); @@ -2549,13 +2537,13 @@ Double_t AliTRDtrackerV1::CalculateTrackLikelihood(AliTRDseedV1 *tracklets, Doub sumdaf /= Float_t (nLayers - 2.0); Double_t likeChi2Z = TMath::Exp(-chi2[2] * 0.14); // Chi2Z - Double_t likeChi2TC = (AliTRDReconstructor::RecoParam()->IsVertexConstrained()) ? + Double_t likeChi2TC = (AliTRDReconstructor::GetRecoParam()->IsVertexConstrained()) ? TMath::Exp(-chi2[1] * 0.677) : 1; // Constrained Tilted Riemann Double_t likeChi2TR = TMath::Exp(-chi2[0] * 0.78); // Non-constrained Tilted Riemann Double_t likeAF = TMath::Exp(-sumdaf * 3.23); Double_t trackLikelihood = likeChi2Z * likeChi2TR * likeAF; - if(AliTRDReconstructor::RecoParam()->GetStreamLevel() >= 2){ + if(AliTRDReconstructor::GetRecoParam()->GetStreamLevel() >= 2){ Int_t eventNumber = AliTRDtrackerDebug::GetEventNumber(); Int_t candidateNumber = AliTRDtrackerDebug::GetCandidateNumber(); TTreeSRedirector &cstreamer = *fgDebugStreamer; @@ -2602,7 +2590,7 @@ Double_t AliTRDtrackerV1::CookLikelihood(AliTRDseedV1 *cseed, Int_t planes[4] // // ratio of the total number of clusters/track which are expected to be found by the tracker. - Float_t fgFindable = AliTRDReconstructor::RecoParam()->GetFindableClusters(); + Float_t fgFindable = AliTRDReconstructor::GetRecoParam()->GetFindableClusters(); Int_t nclusters = 0; @@ -2622,7 +2610,7 @@ Double_t AliTRDtrackerV1::CookLikelihood(AliTRDseedV1 *cseed, Int_t planes[4] Double_t like = likea * likechi2y * likechi2z * likeN; // AliInfo(Form("sumda(%f) chi2[0](%f) chi2[1](%f) likea(%f) likechi2y(%f) likechi2z(%f) nclusters(%d) likeN(%f)", sumda, chi2[0], chi2[1], likea, likechi2y, likechi2z, nclusters, likeN)); - if(AliTRDReconstructor::RecoParam()->GetStreamLevel() >= 2){ + if(AliTRDReconstructor::GetRecoParam()->GetStreamLevel() >= 2){ Int_t eventNumber = AliTRDtrackerDebug::GetEventNumber(); Int_t candidateNumber = AliTRDtrackerDebug::GetCandidateNumber(); // The Debug Stream contains the seed diff --git a/TRD/AliTRDtrackingChamber.cxx b/TRD/AliTRDtrackingChamber.cxx index d06b2a7d9b4..8fbd891af17 100644 --- a/TRD/AliTRDtrackingChamber.cxx +++ b/TRD/AliTRDtrackingChamber.cxx @@ -166,8 +166,8 @@ Bool_t AliTRDtrackingChamber::GetSeedingLayer(AliTRDchamberTimeBin *&fakeLayer, const Int_t kMaxRows = 16; const Int_t kMaxCols = 144; const Int_t kMaxPads = 2304; - Int_t timeBinMin = AliTRDReconstructor::RecoParam()->GetNumberOfPresamples(); - Int_t timeBinMax = AliTRDReconstructor::RecoParam()->GetNumberOfPostsamples(); + Int_t timeBinMin = AliTRDReconstructor::GetRecoParam()->GetNumberOfPresamples(); + Int_t timeBinMax = AliTRDReconstructor::GetRecoParam()->GetNumberOfPostsamples(); // Get the geometrical data of the chamber Int_t layer = geo->GetLayer(fDetector); @@ -243,7 +243,7 @@ Bool_t AliTRDtrackingChamber::GetSeedingLayer(AliTRDchamberTimeBin *&fakeLayer, TMath::Sort(nPads, hvals, indices); // bins storing a 0 should not matter // Set Threshold Int_t maximum = hvals[indices[0]]; // best - Int_t threshold = Int_t(maximum * AliTRDReconstructor::RecoParam()->GetFindableClusters()); + Int_t threshold = Int_t(maximum * AliTRDReconstructor::GetRecoParam()->GetFindableClusters()); Int_t col, row, lower, lower1, upper, upper1; for(Int_t ib = 0; ib < nPads; ib++){ if(nCandidates >= AliTRDtrackerV1::kMaxTracksStack){ @@ -331,7 +331,7 @@ Bool_t AliTRDtrackingChamber::GetSeedingLayer(AliTRDchamberTimeBin *&fakeLayer, fakeLayer->BuildIndices(); //fakeLayer->PrintClusters(); - if(AliTRDReconstructor::RecoParam()->GetStreamLevel() >= 3){ + if(AliTRDReconstructor::GetRecoParam()->GetStreamLevel() >= 3){ //TMatrixD hist(nRows, nCols); //for(Int_t i = 0; i < nRows; i++) // for(Int_t j = 0; j < nCols; j++) diff --git a/test/gun/rec.C b/test/gun/rec.C index 8424f604543..2816f9a10e1 100644 --- a/test/gun/rec.C +++ b/test/gun/rec.C @@ -4,6 +4,11 @@ void rec() { reco.SetWriteESDfriend(); reco.SetWriteAlignmentData(); AliTPCReconstructor::SetStreamLevel(1); + // reco.SetRecoParam("ITS",AliITSRecoParam::GetLowFluxParam()); + reco.SetRecoParam("TPC",AliTPCRecoParam::GetLowFluxParam()); + reco.SetRecoParam("TRD",AliTRDrecoParam::GetLowFluxParam()); + reco.SetRecoParam("PHOS",AliPHOSRecoParam::GetDefaultParameters()); + reco.SetRecoParam("MUON",AliMUONRecoParam::GetLowFluxParam()); // AliTPCReconstructor::SetRecoParam(AliTPCRecoParam::GetLowFluxParam()); // reco.SetInput("raw.root"); // reco.SetRunReconstruction("ITS TPC TRD TOF HMPID PHOS EMCAL MUON T0 VZERO FMD PMD ZDC"); diff --git a/test/gun/recraw/rec.C b/test/gun/recraw/rec.C index 82118eeb972..e18853ddb72 100644 --- a/test/gun/recraw/rec.C +++ b/test/gun/recraw/rec.C @@ -10,15 +10,21 @@ void rec() { reco.SetUniformFieldTracking(kFALSE); reco.SetWriteESDfriend(); reco.SetWriteAlignmentData(); - AliTPCRecoParam * tpcRecoParam = AliTPCRecoParam::GetLowFluxParam(); - AliTPCReconstructor::SetRecoParam(tpcRecoParam); // AliTPCReconstructor::SetStreamLevel(1); - + // reco.SetRecoParam("ITS",AliITSRecoParam::GetLowFluxParam()); + reco.SetRecoParam("TPC",AliTPCRecoParam::GetLowFluxParam()); + reco.SetRecoParam("TRD",AliTRDrecoParam::GetLowFluxParam()); + reco.SetRecoParam("PHOS",AliPHOSRecoParam::GetDefaultParameters()); + reco.SetRecoParam("MUON",AliMUONRecoParam::GetLowFluxParam()); + reco.SetRunReconstruction("ITS TPC TRD TOF HMPID PHOS EMCAL MUON FMD PMD ZDC T0 VZERO"); reco.SetInput("raw.root"); reco.SetNumberOfEventsPerFile(-1); // all events in one single file + reco.SetRunQA(":"); + reco.SetRunGlobalQA(kTRUE); + TStopwatch timer; timer.Start(); reco.Run(); -- 2.43.0