From 362c9d61708912a81d77cb017e1d05fd1f9486a6 Mon Sep 17 00:00:00 2001 From: cvetan Date: Wed, 28 Jun 2006 11:47:07 +0000 Subject: [PATCH] New detector numbering scheme (common for DAQ/HLT/Offline). All the subdetectors shall use the AliDAQ class for the sim and rec of the raw data. The AliDAQ and raw reader classes now provide all the necessary interfaces to write and select the detector specific raw-data payload. Look into the AliDAQ.h and AliRawReader.h for more details. --- EMCAL/AliEMCAL.cxx | 10 +++---- EMCAL/AliEMCAL.h | 2 -- EMCAL/AliEMCALRawStream.cxx | 2 +- FMD/AliFMDAltroMapping.cxx | 14 ++++----- FMD/AliFMDParameters.h | 3 -- FMD/AliFMDRawReader.cxx | 12 ++++---- FMD/AliFMDRawStream.cxx | 4 +-- FMD/AliFMDRawWriter.cxx | 9 +++--- HLT/misc/AliL3DDLDataFileHandler.cxx | 4 +-- HLT/misc/AliL3DDLTPCRawStream.cxx | 4 +-- ITS/AliITSDDLRawData.cxx | 13 +++++---- ITS/AliITSRawStreamSDD.cxx | 2 +- ITS/AliITSRawStreamSDD.h | 1 - ITS/AliITSRawStreamSPD.cxx | 2 +- ITS/AliITSRawStreamSPD.h | 1 - ITS/AliITSRawStreamSSD.cxx | 2 +- ITS/AliITSRawStreamSSD.h | 1 - ITS/AliITSRawStreamSSDv1.cxx | 1 - MUON/AliMUONRawStreamTracker.cxx | 3 +- MUON/AliMUONRawStreamTrigger.cxx | 3 +- MUON/AliMUONRawWriter.cxx | 18 ++++++------ PHOS/AliPHOS.cxx | 9 +++--- PHOS/AliPHOSRawStream.cxx | 2 +- PMD/AliPMDClusterFinder.cxx | 4 +-- PMD/AliPMDDDLRawData.cxx | 6 ++-- PMD/AliPMDRawStream.cxx | 2 +- RAW/AliAltroRawStream.cxx | 9 ++++++ RAW/AliAltroRawStream.h | 1 + RAW/AliDAQ.cxx | 16 +++++++---- RAW/AliDAQ.h | 4 +-- RAW/AliDAQConfig.h | 33 --------------------- RAW/AliRawReader.cxx | 43 +++++++++++++++++++++------- RAW/AliRawReader.h | 2 ++ RICH/AliRICHDigit.h | 2 +- RICH/AliRICHReconstructor.cxx | 2 +- RICH/AliRICHv1.cxx | 3 +- START/AliSTARTRawData.cxx | 4 +-- START/AliSTARTRawReader.cxx | 2 +- STEER/AliCTPRawData.cxx | 4 +-- STEER/AliCTPRawData.h | 2 -- STEER/AliCTPRawStream.cxx | 5 ++-- STEER/AliCTPRawStream.h | 2 -- STEER/AliModule.cxx | 13 ++------- STEER/AliSimulation.cxx | 14 ++++----- TOF/AliTOFClusterFinder.cxx | 6 ++-- TOF/AliTOFDDLRawData.cxx | 3 +- TOF/AliTOFRawDataRead.C | 2 +- TOF/AliTOFRawStream.cxx | 2 +- TPC/AliTPCDDLRawData.cxx | 5 ++-- TPC/AliTPCRawStream.cxx | 2 +- TPC/AliTPCclustererMI.cxx | 2 +- TRD/AliTRDRawStream.cxx | 2 +- TRD/AliTRDrawData.cxx | 5 ++-- VZERO/AliVZERO.cxx | 3 +- ZDC/AliZDC.cxx | 4 +-- ZDC/AliZDCRawStream.cxx | 2 +- ZDC/AliZDCRawStream.h | 1 - 57 files changed, 160 insertions(+), 174 deletions(-) delete mode 100644 RAW/AliDAQConfig.h diff --git a/EMCAL/AliEMCAL.cxx b/EMCAL/AliEMCAL.cxx index a942eb91b04..44937312c5a 100644 --- a/EMCAL/AliEMCAL.cxx +++ b/EMCAL/AliEMCAL.cxx @@ -48,6 +48,7 @@ class TFile; #include "AliAltroBuffer.h" #include "AliRawReader.h" #include "AliEMCALRawStream.h" +#include "AliDAQ.h" ClassImp(AliEMCAL) Double_t AliEMCAL::fgCapa = 1.; // 1pF @@ -56,7 +57,6 @@ Double_t AliEMCAL::fgTimeMax = 2.56E-5 ; // each sample is over 100 ns fTim Double_t AliEMCAL::fgTimePeak = 4.1E-6 ; // 4 micro seconds Double_t AliEMCAL::fgTimeTrigger = 100E-9 ; // 100ns, just for a reference // some digitization constants -Int_t AliEMCAL::fgDDLOffset = 0x800; Int_t AliEMCAL::fgThreshold = 1; // 24*48=1152 towers per SM; divided up on 3 DDLs, // each DDL with 12FEC *32towers or 12*32*2 channels (high&low gain) @@ -278,9 +278,7 @@ void AliEMCAL::Digits2Raw() } // open new file and write dummy header - TString fileName("EMCAL_") ; - fileName += (iDDL + fgDDLOffset) ; - fileName += ".ddl" ; + TString fileName(AliDAQ::DdlFileName("EMCAL",iDDL)); buffer = new AliAltroBuffer(fileName.Data()); buffer->WriteDataHeader(kTRUE, kFALSE); //Dummy; @@ -350,8 +348,8 @@ void AliEMCAL::Raw2Digits(AliRawReader* reader) // Use AliAltroRawStream to read the ALTRO format. No need to // reinvent the wheel :-) AliEMCALRawStream in(reader); - // Select EMCAL DDL's; lowest 8 bits of DDL offser is used for something else.. - reader->Select(fgDDLOffset >> 8); + // Select EMCAL DDL's; + reader->Select("EMCAL"); // reading is from previously existing AliEMCALGetter.cxx // ReadRaw method diff --git a/EMCAL/AliEMCAL.h b/EMCAL/AliEMCAL.h index 0f4faff5a51..2dba2f172c0 100644 --- a/EMCAL/AliEMCAL.h +++ b/EMCAL/AliEMCAL.h @@ -75,7 +75,6 @@ class AliEMCAL : public AliDetector { Double_t GetRawFormatTimeMax() const { return fgTimeMax ; } Double_t GetRawFormatTimePeak() const { return fgTimePeak ; } Double_t GetRawFormatTimeTrigger() const { return fgTimeTrigger ; } - Int_t GetRawFormatDDLOffset() const { return fgDDLOffset ; } Int_t GetRawFormatThreshold() const { return fgThreshold ; } Int_t GetRawFormatChannelsPerDDL() const { return fgChannelsPerDDL ; } static Double_t RawResponseFunctionMax(Double_t charge, Double_t gain) ; @@ -105,7 +104,6 @@ protected: static Double_t fgTimeMax ; // maximum sampled time of the raw RO signal static Double_t fgTimePeak ; // peaking time of the raw RO signal static Double_t fgTimeTrigger ; // time of the trigger for the RO signal - static Int_t fgDDLOffset; // DDL offset static Int_t fgThreshold; // threshold static Int_t fgChannelsPerDDL; // number of channels per DDL diff --git a/EMCAL/AliEMCALRawStream.cxx b/EMCAL/AliEMCALRawStream.cxx index de3f4349429..12fdfd7597f 100644 --- a/EMCAL/AliEMCALRawStream.cxx +++ b/EMCAL/AliEMCALRawStream.cxx @@ -46,7 +46,7 @@ AliEMCALRawStream::AliEMCALRawStream(AliRawReader* rawReader) : { // create an object to read EMCAL raw digits - SelectRawData(8); + SelectRawData("EMCAL"); fNoAltroMapping = kTRUE; } diff --git a/FMD/AliFMDAltroMapping.cxx b/FMD/AliFMDAltroMapping.cxx index 72683cb4675..883ec085593 100644 --- a/FMD/AliFMDAltroMapping.cxx +++ b/FMD/AliFMDAltroMapping.cxx @@ -75,7 +75,7 @@ AliFMDAltroMapping::Hardware2Detector(UInt_t ddl, UInt_t addr, // Translate a hardware address to detector coordinates. // The detector is simply // - // ddl - kBaseDDL + 1 + // ddl + 1 // // The ring number, sector, and strip number is given by the addr // argument. The address argument, has the following format @@ -141,7 +141,7 @@ AliFMDAltroMapping::Hardware2Detector(UInt_t ddl, UInt_t addr, // us detector coordinates, unique at least up a 128 strips. We // return the first strip in the given range. // - det = (ddl - AliFMDParameters::kBaseDDL) + 1; + det = ddl + 1; UInt_t board = (addr >> 7) & 0x1F; UInt_t altro = (addr >> 4) & 0x7; UInt_t chan = (addr & 0xf); @@ -175,7 +175,7 @@ AliFMDAltroMapping::Detector2Hardware(UShort_t det, Char_t ring, // Translate detector coordinates to a hardware address. // The ddl is simply // - // kBaseDDL + (det - 1) + // (det - 1) // // The ring number, sector, and strip number must be encoded into a // hardware address. The address argument, will have the following @@ -252,7 +252,7 @@ AliFMDAltroMapping::Detector2Hardware(UShort_t det, Char_t ring, // With this information, we can decode the detector coordinates to // give us a unique hardware address // - ddl = AliFMDParameters::kBaseDDL + (det - 1); + ddl = (det - 1); UInt_t nsen = (ring == 'I' ? 10 : 20); UInt_t nsa = (ring == 'I' ? 2 : 4); // Sensors per ALTRO UInt_t ncs = (ring == 'I' ? 8 : 4); // Channels per sensor @@ -310,7 +310,7 @@ AliFMDAltroMapping::GetPadRow(Int_t hwaddr) const Char_t ring; UShort_t sec; UShort_t str; - Int_t ddl = AliFMDParameters::kBaseDDL; + Int_t ddl = 0; if (!Hardware2Detector(ddl, hwaddr, det, ring, sec, str)) return -1; return Int_t(sec); } @@ -332,7 +332,7 @@ AliFMDAltroMapping::GetPad(Int_t hwaddr) const Char_t ring; UShort_t sec; UShort_t str; - Int_t ddl = AliFMDParameters::kBaseDDL; + Int_t ddl = 0; if (!Hardware2Detector(ddl, hwaddr, det, ring, sec, str)) return -1; return Int_t(str); } @@ -354,7 +354,7 @@ AliFMDAltroMapping::GetSector(Int_t hwaddr) const Char_t ring; UShort_t sec; UShort_t str; - Int_t ddl = AliFMDParameters::kBaseDDL; + Int_t ddl = 0; if (!Hardware2Detector(ddl, hwaddr, det, ring, sec, str)) return -1; return Int_t(ring); } diff --git a/FMD/AliFMDParameters.h b/FMD/AliFMDParameters.h index 66b6c1bbd7e..0de6b761044 100644 --- a/FMD/AliFMDParameters.h +++ b/FMD/AliFMDParameters.h @@ -259,9 +259,6 @@ public: AliFMDAltroMapping* GetAltroMap() const; /** @} */ - enum { - kBaseDDL = 0x1000 // DDL offset for the FMD - }; static const char* PulseGainPath() { return fgkPulseGain; } static const char* PedestalPath() { return fgkPedestal; } static const char* DeadPath() { return fgkDead; } diff --git a/FMD/AliFMDRawReader.cxx b/FMD/AliFMDRawReader.cxx index c58bb7c18fd..3c35cd07997 100644 --- a/FMD/AliFMDRawReader.cxx +++ b/FMD/AliFMDRawReader.cxx @@ -174,7 +174,7 @@ AliFMDRawReader::ReadAdcs(TClonesArray* array) AliFMDParameters* pars = AliFMDParameters::Instance(); // Select FMD DDL's - fReader->Select(AliFMDParameters::kBaseDDL>>8); + fReader->Select("FMD"); UShort_t stripMin = 0; UShort_t stripMax = 127; @@ -184,7 +184,7 @@ AliFMDRawReader::ReadAdcs(TClonesArray* array) UChar_t* cdata; if (!fReader->ReadNextData(cdata)) break; size_t nchar = fReader->GetDataSize(); - UShort_t ddl = AliFMDParameters::kBaseDDL + fReader->GetDDLID(); + UShort_t ddl = fReader->GetDDLID(); UShort_t rate = 0; AliDebug(1, Form("Reading %d bytes (%d 10bit words) from %d", nchar, nchar * 8 / 10, ddl)); @@ -253,13 +253,13 @@ AliFMDRawReader::Exec(Option_t*) // Get sample rate AliFMDParameters* pars = AliFMDParameters::Instance(); - fSampleRate = pars->GetSampleRate(AliFMDParameters::kBaseDDL); + fSampleRate = pars->GetSampleRate(0); // Use AliAltroRawStream to read the ALTRO format. No need to // reinvent the wheel :-) AliFMDRawStream input(fReader, fSampleRate); // Select FMD DDL's - fReader->Select(AliFMDParameters::kBaseDDL); + fReader->Select("FMD"); Int_t oldDDL = -1; Int_t count = 0; @@ -319,9 +319,9 @@ AliFMDRawReader::Exec(Option_t*) oldDDL = ddl; // Check that we're processing a FMD detector Int_t detId = fReader->GetDetectorID(); - if (detId != (AliFMDParameters::kBaseDDL >> 8)) { + if (detId != (AliDAQ::DetectorID("FMD"))) { AliError(Form("Detector ID %d != %d", - detId, (AliFMDParameters::kBaseDDL >> 8))); + detId, (AliDAQ::DetectorID("FMD")))); break; } // Figure out what detector we're deling with diff --git a/FMD/AliFMDRawStream.cxx b/FMD/AliFMDRawStream.cxx index 8fc23a9f004..4f5dc864b35 100644 --- a/FMD/AliFMDRawStream.cxx +++ b/FMD/AliFMDRawStream.cxx @@ -45,7 +45,7 @@ AliFMDRawStream::AliFMDRawStream(AliRawReader* reader) // CTOR fNoAltroMapping = kFALSE; // Select FMD DDL's - SelectRawData(AliFMDParameters::kBaseDDL>>8); + SelectRawData("FMD"); } //_____________________________________________________________________________ @@ -69,7 +69,7 @@ AliFMDRawStream::ReadChannel(UInt_t& ddl, UInt_t& addr, AliDebug(15, Form("New hardware address, was 0x%x, now 0x%x", GetPrevHWAddress(), GetHWAddress())); addr = GetPrevHWAddress(); - ddl = AliFMDParameters::kBaseDDL + GetPrevDDLNumber(); + ddl = GetPrevDDLNumber(); len = l+1; // Need to add one - l points to last valid index last = signal; break; diff --git a/FMD/AliFMDRawWriter.cxx b/FMD/AliFMDRawWriter.cxx index 603a44abbc8..8556493ed35 100644 --- a/FMD/AliFMDRawWriter.cxx +++ b/FMD/AliFMDRawWriter.cxx @@ -48,6 +48,7 @@ #include // ROOT_TArrayI #include // ROOT_TClonesArray // #include +#include "AliDAQ.h" //____________________________________________________________________ ClassImp(AliFMDRawWriter) @@ -229,7 +230,7 @@ AliFMDRawWriter::WriteDigits(TClonesArray* digits) } prevddl = ddl; // Need to open a new DDL! - TString filename(Form("%s_%d.ddl", fFMD->GetName(), ddl)); + TString filename(AliDAQ::DdlFileName(fFMD->GetName(), ddl)); AliDebug(15, Form("New altro buffer with DDL file %s", filename.Data())); // Create a new altro buffer - a `1' as the second argument // means `write mode' @@ -316,10 +317,10 @@ AliFMDRawWriter::WriteDigits(TClonesArray* digits) // If we haven't got a writer (either because none were made so // far, or because we've switch DDL), make one. if (!writer) { - AliDebug(1, Form("Opening new ALTRO writer w/file FMD_%d.ddl", ddl)); - file = new std::ofstream(Form("FMD_%d.ddl", ddl)); + AliDebug(1, Form("Opening new ALTRO writer w/file %s", AliDAQ::DdlFileName("FMD",ddl))); + file = new std::ofstream(AliDAQ::DdlFileName("FMD",ddl)); if (!file || !*file) { - AliFatal(Form("Failed to open file FMD_%d.ddl", ddl)); + AliFatal(Form("Failed to open file %s", AliDAQ::DdlFileName("FMD",ddl))); return; } writer = new AliFMDAltroWriter(*file); diff --git a/HLT/misc/AliL3DDLDataFileHandler.cxx b/HLT/misc/AliL3DDLDataFileHandler.cxx index a736ced232c..d3bb3bb66a3 100644 --- a/HLT/misc/AliL3DDLDataFileHandler.cxx +++ b/HLT/misc/AliL3DDLDataFileHandler.cxx @@ -223,7 +223,7 @@ AliL3DigitRowData * AliL3DDLDataFileHandler::DDLData2Memory(UInt_t &nrow,Int_t e } #ifdef use_newio fReader->Reset(); - fReader->Select(0,ddls[0],ddls[ddlsToSearch-1]); + fReader->Select("TPC",ddls[0],ddls[ddlsToSearch-1]); fTPCStream->Reset(); #else fTPCStream->SetDDLID(ddls[i]); //ddl to read out @@ -391,7 +391,7 @@ AliL3DigitRowData * AliL3DDLDataFileHandler::DDLData2Memory(UInt_t &nrow,Int_t e #ifdef use_newio fReader->Reset(); - fReader->Select(0,ddls[0],ddls[ddlsToSearch-1]); + fReader->Select("TPC",ddls[0],ddls[ddlsToSearch-1]); fTPCStream->Reset(); #else fTPCStream->SetDDLID(ddls[i]); //ddl to read out diff --git a/HLT/misc/AliL3DDLTPCRawStream.cxx b/HLT/misc/AliL3DDLTPCRawStream.cxx index 7f22bba1a82..949ee0216ef 100644 --- a/HLT/misc/AliL3DDLTPCRawStream.cxx +++ b/HLT/misc/AliL3DDLTPCRawStream.cxx @@ -49,7 +49,7 @@ AliL3DDLTPCRawStream::AliL3DDLTPCRawStream(AliL3DDLRawReader* rawReader) // create an object to read TPC raw digits fRawReader = rawReader; - fRawReader->Select(0); + fRawReader->Select(3); fData = new UShort_t[fgkDataMax]; fDataSize = fPosition = 0; fCount = fBunchLength = 0; @@ -81,7 +81,7 @@ Bool_t AliL3DDLTPCRawStream::SetDDLID(Int_t d) fSector = fPrevSector = fRow = fPrevRow = fPad = fPrevPad = fTime = fSignal = -1; fRawReader->Reset(); - fRawReader->Select(0,d,d+1); + fRawReader->Select(3,d,d+1); return kTRUE; } diff --git a/ITS/AliITSDDLRawData.cxx b/ITS/AliITSDDLRawData.cxx index 6107ca467f7..7e9bf7fc9e9 100644 --- a/ITS/AliITSDDLRawData.cxx +++ b/ITS/AliITSDDLRawData.cxx @@ -32,6 +32,7 @@ #include "AliITSRawStreamSDD.h" #include "AliITSRawStreamSSD.h" #include "AliBitPacking.h" +#include "AliDAQ.h" ClassImp(AliITSDDLRawData) @@ -287,8 +288,8 @@ Int_t AliITSDDLRawData::RawDataSPD(TBranch* branch){ AliRawDataHeader header; //loop over DDLs - for(Int_t i=0;iSelect(2); + fRawReader->Select("ITSSDD"); } diff --git a/ITS/AliITSRawStreamSDD.h b/ITS/AliITSRawStreamSDD.h index b966a529e20..341b2db619c 100644 --- a/ITS/AliITSRawStreamSDD.h +++ b/ITS/AliITSRawStreamSDD.h @@ -34,7 +34,6 @@ class AliITSRawStreamSDD: public AliITSRawStream { static Int_t GetModuleNumber(UInt_t iDDL, UInt_t iModule) {return fgkDDLModuleMap[iDDL][iModule];} - enum {kDDLOffset = 0x200}; // offset for DDL numbers enum {kDDLsNumber = 12}; // number of DDLs in SDD enum {kModulesPerDDL = 22}; // number of modules in each DDL diff --git a/ITS/AliITSRawStreamSPD.cxx b/ITS/AliITSRawStreamSPD.cxx index a0eb73d89f9..1d4daf9ed4e 100644 --- a/ITS/AliITSRawStreamSPD.cxx +++ b/ITS/AliITSRawStreamSPD.cxx @@ -62,7 +62,7 @@ AliITSRawStreamSPD::AliITSRawStreamSPD(AliRawReader* rawReader) : { // create an object to read ITS SPD raw digits - fRawReader->Select(1); + fRawReader->Select("ITSSPD"); } diff --git a/ITS/AliITSRawStreamSPD.h b/ITS/AliITSRawStreamSPD.h index ee85836b464..b8da11583fa 100644 --- a/ITS/AliITSRawStreamSPD.h +++ b/ITS/AliITSRawStreamSPD.h @@ -24,7 +24,6 @@ class AliITSRawStreamSPD: public AliITSRawStream { Int_t GetRow() const {return fCoord2;}; Int_t GetColumn() const {return fCoord1;}; - enum {kDDLOffset = 0x100}; // offset for DDL numbers enum {kDDLsNumber = 20}; // number of DDLs in SPD enum {kModulesPerDDL = 12}; // number of modules in each DDL diff --git a/ITS/AliITSRawStreamSSD.cxx b/ITS/AliITSRawStreamSSD.cxx index bb2b64acd66..132b4c8dc11 100644 --- a/ITS/AliITSRawStreamSSD.cxx +++ b/ITS/AliITSRawStreamSSD.cxx @@ -212,7 +212,7 @@ AliITSRawStreamSSD::AliITSRawStreamSSD(AliRawReader* rawReader) : { // create an object to read ITS SSD raw digits - fRawReader->Select(3); + fRawReader->Select("ITSSSD"); } diff --git a/ITS/AliITSRawStreamSSD.h b/ITS/AliITSRawStreamSSD.h index b4c7aff22e3..2856f5f0924 100644 --- a/ITS/AliITSRawStreamSSD.h +++ b/ITS/AliITSRawStreamSSD.h @@ -26,7 +26,6 @@ class AliITSRawStreamSSD: public AliITSRawStream { Int_t GetSideFlag() const {return fCoord1;}; Int_t GetStrip() const {return fCoord2;}; - enum {kDDLOffset = 0x300}; // offset for DDL numbers enum {kDDLsNumber = 16}; // number of DDLs in SSD enum {kModulesPerDDL = 109}; // number of modules in each DDL diff --git a/ITS/AliITSRawStreamSSDv1.cxx b/ITS/AliITSRawStreamSSDv1.cxx index 2b969849bd6..39bb2cad45b 100644 --- a/ITS/AliITSRawStreamSSDv1.cxx +++ b/ITS/AliITSRawStreamSSDv1.cxx @@ -34,7 +34,6 @@ AliITSRawStreamSSDv1::AliITSRawStreamSSDv1(AliRawReader* rawReader) : fADC =0; fADModule=0; - fRawReader->Select(3); fRawReader->SelectEquipment(17,102,102); } diff --git a/MUON/AliMUONRawStreamTracker.cxx b/MUON/AliMUONRawStreamTracker.cxx index bb230a1f521..e33b921c027 100644 --- a/MUON/AliMUONRawStreamTracker.cxx +++ b/MUON/AliMUONRawStreamTracker.cxx @@ -194,8 +194,7 @@ Bool_t AliMUONRawStreamTracker::NextDDL() AliDebug(3, Form("DDL Number %d\n", fDDL )); fRawReader->Reset(); - // fRawReader->Select(AliDAQ::DetectorID("MUONTRK"), fDDL, fDDL); //Select the DDL file to be read - fRawReader->Select(0X9, fDDL, fDDL); //Select the DDL file to be read + fRawReader->Select("MUONTRK", fDDL, fDDL); //Select the DDL file to be read fRawReader->ReadHeader(); diff --git a/MUON/AliMUONRawStreamTrigger.cxx b/MUON/AliMUONRawStreamTrigger.cxx index f7b203a4343..657da67924f 100644 --- a/MUON/AliMUONRawStreamTrigger.cxx +++ b/MUON/AliMUONRawStreamTrigger.cxx @@ -148,8 +148,7 @@ Bool_t AliMUONRawStreamTrigger::NextDDL() } fRawReader->Reset(); - // fRawReader->Select(AliDAQ::DetectorID("MUONTRG"),fDDL,fDDL); //Select the DDL file to be read - fRawReader->Select(0XA, fDDL, fDDL); //Select the DDL file to be read + fRawReader->Select("MUONTRG", fDDL, fDDL); //Select the DDL file to be read fRawReader->ReadHeader(); diff --git a/MUON/AliMUONRawWriter.cxx b/MUON/AliMUONRawWriter.cxx index 85fd0000ffe..cfcfd478b2a 100644 --- a/MUON/AliMUONRawWriter.cxx +++ b/MUON/AliMUONRawWriter.cxx @@ -223,13 +223,13 @@ Int_t AliMUONRawWriter::Digits2Raw() { // open files // idDDL = ich * 2 + AliDAQ::DdlIDOffset("MUONTRK"); // waiting update in STEER - idDDL = ich * 2 + 0x900; // official number for MUON - sprintf(name, "MUON_%d.ddl",idDDL); + idDDL = ich * 2; + strcpy(name,AliDAQ::DdlFileName("MUONTRK",idDDL)); fFile[0] = fopen(name,"w"); // idDDL = (ich * 2) + 1 + AliDAQ::DdlIDOffset("MUONTRK"); - idDDL = (ich * 2) + 1 + 0x900; - sprintf(name, "MUON_%d.ddl",idDDL); + idDDL = (ich * 2) + 1; + strcpy(name,AliDAQ::DdlFileName("MUONTRK",idDDL)); fFile[1] = fopen(name,"w"); WriteTrackerDDL(ich); @@ -242,14 +242,12 @@ Int_t AliMUONRawWriter::Digits2Raw() // trigger chambers // open files - // idDDL = AliDAQ::DdlIDOffset("MUONTRG"); - idDDL = 0xA00;// official number for MUTR - sprintf(name, "MUTR_%d.ddl",idDDL); + idDDL = 0;// MUTR + strcpy(name,AliDAQ::DdlFileName("MUONTRG",idDDL)); fFile[0] = fopen(name,"w"); - // idDDL = AliDAQ::DdlIDOffset("MUONTRG") + 1; - idDDL = 0xA00 + 1;// official number for MUTR - sprintf(name, "MUTR_%d.ddl",idDDL); + idDDL = 1;// MUTR + strcpy(name,AliDAQ::DdlFileName("MUONTRG",idDDL)); fFile[1] = fopen(name,"w"); WriteTriggerDDL(); diff --git a/PHOS/AliPHOS.cxx b/PHOS/AliPHOS.cxx index c73bf3d6e35..2cddd4ff839 100644 --- a/PHOS/AliPHOS.cxx +++ b/PHOS/AliPHOS.cxx @@ -16,6 +16,9 @@ /* History of cvs commits: * * $Log$ + * Revision 1.98 2006/05/11 11:30:48 cvetan + * Major changes in AliAltroBuffer. Now it can be used only for writing of raw data. All the corresponding read method are removed. It is based now on AliFstream in order to avoid endianess problems. The altro raw data is written always with little endian + * * Revision 1.97 2006/04/22 10:30:17 hristov * Add fEnergy to AliPHOSDigit and operate with EMC amplitude in energy units (Yu.Kharlov) * @@ -81,6 +84,7 @@ class TFile; #include "AliCDBEntry.h" #include "AliCDBStorage.h" #include "AliPHOSCalibData.h" +#include "AliDAQ.h" ClassImp(AliPHOS) @@ -438,7 +442,6 @@ void AliPHOS::Digits2Raw() } // some digitization constants - const Int_t kDDLOffset = 0x600; // assigned to PHOS // const Int_t kThreshold = 1; // skip digits below this threshold // YVK const Float_t kThreshold = 0.001; // skip digits below 1 MeV const Int_t kAdcThreshold = 1; // Lower ADC threshold to write to raw data @@ -475,9 +478,7 @@ void AliPHOS::Digits2Raw() } // open new file and write dummy header - TString fileName("PHOS_") ; - fileName += (iDDL + kDDLOffset) ; - fileName += ".ddl" ; + TString fileName = AliDAQ::DdlFileName("PHOS",iDDL); buffer = new AliAltroBuffer(fileName.Data()); buffer->WriteDataHeader(kTRUE, kFALSE); //Dummy; diff --git a/PHOS/AliPHOSRawStream.cxx b/PHOS/AliPHOSRawStream.cxx index f4ab53a5048..0a0f4093911 100644 --- a/PHOS/AliPHOSRawStream.cxx +++ b/PHOS/AliPHOSRawStream.cxx @@ -47,7 +47,7 @@ AliPHOSRawStream::AliPHOSRawStream(AliRawReader* rawReader) : { // create an object to read PHOS raw digits - SelectRawData(6); + SelectRawData("PHOS"); fNoAltroMapping = kTRUE; } diff --git a/PMD/AliPMDClusterFinder.cxx b/PMD/AliPMDClusterFinder.cxx index 532938857e6..5661d877bf9 100644 --- a/PMD/AliPMDClusterFinder.cxx +++ b/PMD/AliPMDClusterFinder.cxx @@ -289,7 +289,7 @@ void AliPMDClusterFinder::Digits2RecPoints(AliRawReader *rawReader, ResetCellADC(); rawReader->Reset(); AliPMDRawStream pmdinput(rawReader); - rawReader->Select(12, indexDDL, indexDDL); + rawReader->Select("PMD", indexDDL, indexDDL); while(pmdinput.Next()) { Int_t det = pmdinput.GetDetector(); @@ -513,7 +513,7 @@ void AliPMDClusterFinder::Digits2RecPoints(Int_t ievt, AliRawReader *rawReader) ResetCellADC(); rawReader->Reset(); AliPMDRawStream pmdinput(rawReader); - rawReader->Select(12, indexDDL, indexDDL); + rawReader->Select("PMD", indexDDL, indexDDL); while(pmdinput.Next()) { Int_t det = pmdinput.GetDetector(); diff --git a/PMD/AliPMDDDLRawData.cxx b/PMD/AliPMDDDLRawData.cxx index 847347b6a2b..9ff94e66798 100644 --- a/PMD/AliPMDDDLRawData.cxx +++ b/PMD/AliPMDDDLRawData.cxx @@ -25,7 +25,7 @@ #include "AliPMDdigit.h" #include "AliPMDRawStream.h" #include "AliPMDDDLRawData.h" - +#include "AliDAQ.h" ClassImp(AliPMDDDLRawData) @@ -64,7 +64,7 @@ void AliPMDDDLRawData::WritePMDRawData(TTree *treeD) AliDebug(1,Form("Number of modules inside treeD = %d",nmodules)); const Int_t kSize = 4608; - const Int_t kDDL = 6; + const Int_t kDDL = AliDAQ::NumberOfDdls("PMD"); Int_t modulePerDDL = 0; @@ -79,7 +79,7 @@ void AliPMDDDLRawData::WritePMDRawData(TTree *treeD) Int_t mmodule = 0; for(Int_t iddl = 0; iddl < kDDL; iddl++) { - sprintf(filename,"PMD_%d.ddl",AliPMDRawStream::kDDLOffset+iddl); + strcpy(filename,AliDAQ::DdlFileName("PMD",iddl)); #ifndef __DECCXX outfile.open(filename,ios::binary); #else diff --git a/PMD/AliPMDRawStream.cxx b/PMD/AliPMDRawStream.cxx index 0f165290c53..7814f7dd7e4 100644 --- a/PMD/AliPMDRawStream.cxx +++ b/PMD/AliPMDRawStream.cxx @@ -48,7 +48,7 @@ AliPMDRawStream::AliPMDRawStream(AliRawReader* rawReader) : { // create an object to read PMD raw digits - fRawReader->Select(12); + fRawReader->Select("PMD"); } //_____________________________________________________________________________ diff --git a/RAW/AliAltroRawStream.cxx b/RAW/AliAltroRawStream.cxx index 9cbeb00a376..523be28e33a 100644 --- a/RAW/AliAltroRawStream.cxx +++ b/RAW/AliAltroRawStream.cxx @@ -164,6 +164,15 @@ void AliAltroRawStream::SelectRawData(Int_t detId) fRawReader->Select(detId); } +//_____________________________________________________________________________ +void AliAltroRawStream::SelectRawData(const char *detName) +{ + // Select the raw data for specific + // detector name + AliDebug(1,Form("Selecting raw data for detector %s",detName)); + fRawReader->Select(detName); +} + //_____________________________________________________________________________ UShort_t AliAltroRawStream::GetNextWord() { diff --git a/RAW/AliAltroRawStream.h b/RAW/AliAltroRawStream.h index 08b03c2ec54..2dc9a3f5a94 100644 --- a/RAW/AliAltroRawStream.h +++ b/RAW/AliAltroRawStream.h @@ -46,6 +46,7 @@ class AliAltroRawStream: public TObject { Int_t GetRCUTrailerSize() const { return fRCUTrailerSize; } // Provide size of RCU trailer void SelectRawData(Int_t detId); // Select raw data for specific detector id + void SelectRawData(const char *detName); // Select raw data for specific detector name void SetNoAltroMapping(Bool_t flag) { fNoAltroMapping = flag; } // Specify whenever to use or not the altro mapping void SetOldRCUFormat(Bool_t flag) { fIsOldRCUFormat = flag; } // Specify whenever to use or not the old RCU trailer format diff --git a/RAW/AliDAQ.cxx b/RAW/AliDAQ.cxx index b9d45aa8382..3107f1d2776 100644 --- a/RAW/AliDAQ.cxx +++ b/RAW/AliDAQ.cxx @@ -179,30 +179,34 @@ Int_t AliDAQ::DdlIDOffset(Int_t detectorID) return (detectorID << 8); } -const char *AliDAQ::DetectorNameFromDdlID(Int_t ddlID) +const char *AliDAQ::DetectorNameFromDdlID(Int_t ddlID,Int_t &ddlIndex) { // Returns the detector name for // a given DDL ID - Int_t detectorID = DetectorIDFromDdlID(ddlID); + ddlIndex = -1; + Int_t detectorID = DetectorIDFromDdlID(ddlID,ddlIndex); if (detectorID < 0) return ""; return DetectorName(detectorID); } -Int_t AliDAQ::DetectorIDFromDdlID(Int_t ddlID) +Int_t AliDAQ::DetectorIDFromDdlID(Int_t ddlID,Int_t &ddlIndex) { - // Returns the detector ID for - // a given DDL ID + // Returns the detector ID and + // the ddl index within the + // detector range for + // a given input DDL ID Int_t detectorID = ddlID >> 8; if (detectorID < 0 || detectorID >= kNDetectors) { AliErrorClass(Form("Invalid detector index: %d (%d -> %d) !",detectorID,0,kNDetectors-1)); return -1; } - Int_t ddlIndex = ddlID & 0xFF; + ddlIndex = ddlID & 0xFF; if (ddlIndex >= fgkNumberOfDdls[detectorID]) { AliErrorClass(Form("Invalid DDL index %d (%d -> %d) for detector %d", ddlIndex,0,fgkNumberOfDdls[detectorID],detectorID)); + ddlIndex = -1; return -1; } return detectorID; diff --git a/RAW/AliDAQ.h b/RAW/AliDAQ.h index b8c24662cbf..23b168f0a65 100644 --- a/RAW/AliDAQ.h +++ b/RAW/AliDAQ.h @@ -42,8 +42,8 @@ class AliDAQ: public TObject { static Int_t DdlIDOffset(const char *detectorName); static Int_t DdlIDOffset(Int_t detectorID); - static const char *DetectorNameFromDdlID(Int_t ddlID); - static Int_t DetectorIDFromDdlID(Int_t ddlID); + static const char *DetectorNameFromDdlID(Int_t ddlID, Int_t &ddlIndex); + static Int_t DetectorIDFromDdlID(Int_t ddlID, Int_t &ddlIndex); static Int_t DdlID(const char *detectorName, Int_t ddlIndex); static Int_t DdlID(Int_t detectorID, Int_t ddlIndex); diff --git a/RAW/AliDAQConfig.h b/RAW/AliDAQConfig.h deleted file mode 100644 index babda4b1a22..00000000000 --- a/RAW/AliDAQConfig.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef ALIDAQCONFIG_H -#define ALIDAQCONFIG_H -/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * - * See cxx source for full Copyright notice */ - -////////////////////////////////////////////////////////////////////////////// -// // -// The header file contains all the information about the DAQ configuration.// -// This includes the number of DDLs and LDC per sub-detector readout system.// -// This header file is to be included inside DATE. // -// // -////////////////////////////////////////////////////////////////////////////// - -static const int kNDetectors = 18; - -static const char* kDetectors[kNDetectors] = {"TPC", "ITSSPD", "ITSSDD", "ITSSSD", - "TRD", "TOF", "PHOS", "RICH", - "EMCAL", "MUON", "MUTR", "ZDC", - "PMD", "START", "VZERO", "CRT", - "FMD","TRIG"}; -static const int kDetectorDDLs[kNDetectors] = {216, 20, 12, 16, - 18, 72, 20, 20, - 22, 20, 2, 1, - 6, 1, 1, 1, - 3,1}; -static const float kDetectorLDCs[kNDetectors] = {46, 2, 2, 1, - 4, 2, 1, 2, - 1, 2, 1, 1, - 1, 0.5, 0.5, 1, - 1,1}; - - -#endif diff --git a/RAW/AliRawReader.cxx b/RAW/AliRawReader.cxx index 21668b535a6..95570b08b46 100644 --- a/RAW/AliRawReader.cxx +++ b/RAW/AliRawReader.cxx @@ -38,7 +38,7 @@ #include #include "AliRawReader.h" - +#include "AliDAQ.h" ClassImp(AliRawReader) @@ -157,15 +157,17 @@ Int_t AliRawReader::GetDetectorID() const { // Get the detector ID // The list of detector IDs - // can be found in AliDAQConfig.h + // can be found in AliDAQ.h Int_t equipmentId; if (fEquipmentIdsIn && fEquipmentIdsIn) equipmentId = GetMappedEquipmentId(); else equipmentId = GetEquipmentId(); - if (equipmentId >= 0) - return (equipmentId >> 8); + if (equipmentId >= 0) { + Int_t ddlIndex; + return AliDAQ::DetectorIDFromDdlID(equipmentId,ddlIndex); + } else return -1; } @@ -174,19 +176,32 @@ Int_t AliRawReader::GetDDLID() const { // Get the DDL ID (within one sub-detector) // The list of detector IDs - // can be found in AliDAQConfig.h + // can be found in AliDAQ.h Int_t equipmentId; if (fEquipmentIdsIn && fEquipmentIdsIn) equipmentId = GetMappedEquipmentId(); else equipmentId = GetEquipmentId(); - if (equipmentId >= 0) - return (equipmentId & 0xFF); + if (equipmentId >= 0) { + Int_t ddlIndex; + AliDAQ::DetectorIDFromDdlID(equipmentId,ddlIndex); + return ddlIndex; + } else return -1; } +void AliRawReader::Select(const char *detectorName, Int_t minDDLID, Int_t maxDDLID) +{ +// read only data of the detector with the given name and in the given +// range of DDLs (minDDLID <= DDLID <= maxDDLID). +// no selection is applied if a value < 0 is used. + Int_t detectorID = AliDAQ::DetectorID(detectorName); + if(detectorID >= 0) + Select(detectorID,minDDLID,maxDDLID); +} + void AliRawReader::Select(Int_t detectorID, Int_t minDDLID, Int_t maxDDLID) { // read only data of the detector with the given ID and in the given @@ -194,10 +209,16 @@ void AliRawReader::Select(Int_t detectorID, Int_t minDDLID, Int_t maxDDLID) // no selection is applied if a value < 0 is used. fSelectEquipmentType = -1; - if (minDDLID < 0) minDDLID = 0; - fSelectMinEquipmentId = (detectorID << 8) + minDDLID; - if (maxDDLID < 0) maxDDLID = 0xFF; - fSelectMaxEquipmentId = (detectorID << 8) + maxDDLID; + + if (minDDLID < 0) + fSelectMinEquipmentId = AliDAQ::DdlIDOffset(detectorID); + else + fSelectMinEquipmentId = AliDAQ::DdlID(detectorID,minDDLID); + + if (maxDDLID < 0) + fSelectMaxEquipmentId = AliDAQ::DdlID(detectorID,AliDAQ::NumberOfDdls(detectorID)-1); + else + fSelectMaxEquipmentId = AliDAQ::DdlID(detectorID,maxDDLID); } void AliRawReader::SelectEquipment(Int_t equipmentType, diff --git a/RAW/AliRawReader.h b/RAW/AliRawReader.h index 45d9c37d2cc..586d05b9203 100644 --- a/RAW/AliRawReader.h +++ b/RAW/AliRawReader.h @@ -25,6 +25,8 @@ class AliRawReader: public TObject { void Select(Int_t detectorID, Int_t minDDLID = -1, Int_t maxDDLID = -1); + void Select(const char *detectorName, + Int_t minDDLID = -1, Int_t maxDDLID = -1); void SelectEquipment(Int_t equipmentType, Int_t minEquipmentId = -1, Int_t maxEquipmentId = -1); diff --git a/RICH/AliRICHDigit.h b/RICH/AliRICHDigit.h index df37f55325d..6b510efbeb4 100644 --- a/RICH/AliRICHDigit.h +++ b/RICH/AliRICHDigit.h @@ -53,7 +53,7 @@ public: enum EAbsPad {kChamAbs=10000000,kSecAbs=1000000,kPadAbsX=1000,kPadAbsY=1}; //absolute pad number structure enum ERawData{kDiloX=8,kDiloY=6,kNdilo=10}; //DILOGIC structure, see description above enum EPadData{kFirstPad=1,kPadsSecX=80,kPadsSecY=48,kPadsChamX=160,kPadsChamY=144,kSecX=2,kSecY=3}; //Segmentation structure - enum EDdlData{kNddls=14,kDdlOffset=0x700,kRichRawId=7}; //Common DDL structure, see description above + enum EDdlData{kNddls=14}; //Common DDL structure, see description above //ctor&dtor AliRICHDigit() :AliDigit(),fCFM(-1) ,fChamber(-1 ) ,fPadX(-1) ,fPadY(-1) ,fQdc(-1) {} AliRICHDigit(Int_t pad,Double_t qdc,Int_t cfm=-1,Int_t tid=-1):AliDigit(),fCFM(cfm),fChamber(P2C(pad)) ,fPadX(P2X(pad)),fPadY(P2Y(pad)),fQdc(qdc) {fTracks[0]=tid;} diff --git a/RICH/AliRICHReconstructor.cxx b/RICH/AliRICHReconstructor.cxx index f2c0906d371..6d69a55a43b 100644 --- a/RICH/AliRICHReconstructor.cxx +++ b/RICH/AliRICHReconstructor.cxx @@ -192,7 +192,7 @@ void AliRICHReconstructor::Reconstruct(AliRunLoader *pAL,AliRawReader* pRR)const pRL->MakeTree("R"); pRich->MakeBranch("R"); for(Int_t iChN=1;iChN<=7;iChN++){//chambers loop - pRR->Select(AliRICHDigit::kRichRawId,2*iChN-2,2*iChN-1);//select only DDL files for the current chamber + pRR->Select("RICH",2*iChN-2,2*iChN-1);//select only DDL files for the current chamber UInt_t w32=0; while(pRR->ReadNextInt(w32)){//raw records loop (in selected DDL files) UInt_t ddl=pRR->GetDDLID(); //returns 0,1,2 ... 13 diff --git a/RICH/AliRICHv1.cxx b/RICH/AliRICHv1.cxx index f6ad894c844..d10a8d1bef3 100644 --- a/RICH/AliRICHv1.cxx +++ b/RICH/AliRICHv1.cxx @@ -27,6 +27,7 @@ #include #include //StepManager() #include //Digits2Raw() +#include //Digits2Raw() #include //CreateMaterials() #include //CreateMaterials() #include //CreateGeometry() @@ -481,7 +482,7 @@ void AliRICHv1::Digits2Raw() UInt_t w32=0; //32 bits data word for(Int_t i=0;iBranch("START","AliSTARTdigit",&fDigits,405,1); fRawReader->Reset(); - fRawReader->Select(13,0,1); + fRawReader->Select("START"); } diff --git a/STEER/AliCTPRawData.cxx b/STEER/AliCTPRawData.cxx index be857e24107..b02f55d98bd 100644 --- a/STEER/AliCTPRawData.cxx +++ b/STEER/AliCTPRawData.cxx @@ -25,9 +25,9 @@ #include "AliCTPRawData.h" #include "AliRunLoader.h" #include "AliCentralTrigger.h" -#include "AliDAQConfig.h" #include "AliRawDataHeader.h" #include "AliLog.h" +#include "AliDAQ.h" ClassImp(AliCTPRawData) //////////////////////////////////////////////////////////////////////////////////////// @@ -84,7 +84,7 @@ void AliCTPRawData::RawData() AliDebug(1,Form("CTP detector cluster = 0x%x",l2cluster)); char fileName[15]; - sprintf(fileName,"%s_%d.ddl",kDetectors[kCTPIndex],kCTPIndex*0x100); + strcpy(fileName,AliDAQ::DdlFileName("TRG",0)); AliInfo(Form("Storing CTP raw data in %s",fileName)); ofstream outfile; // logical name of the output file #ifndef __DECCXX diff --git a/STEER/AliCTPRawData.h b/STEER/AliCTPRawData.h index ccbd22e4a04..8006519d3fd 100644 --- a/STEER/AliCTPRawData.h +++ b/STEER/AliCTPRawData.h @@ -16,8 +16,6 @@ class AliCTPRawData:public TObject{ AliCTPRawData(const AliCTPRawData &source); // copy constructor AliCTPRawData& operator=(const AliCTPRawData &source); // assignment operator void RawData(); //This method is used to create the slides (sequence of files) - private: - enum {kCTPIndex = 17}; //CTP detector index (AliDAQConfig.h) ClassDef(AliCTPRawData,1) }; diff --git a/STEER/AliCTPRawStream.cxx b/STEER/AliCTPRawStream.cxx index 0f13c9182ab..f6ed66cf1a3 100644 --- a/STEER/AliCTPRawStream.cxx +++ b/STEER/AliCTPRawStream.cxx @@ -27,6 +27,7 @@ #include "AliCTPRawStream.h" #include "AliRawReader.h" #include "AliLog.h" +#include "AliDAQ.h" ClassImp(AliCTPRawStream) @@ -41,8 +42,8 @@ AliCTPRawStream::AliCTPRawStream(AliRawReader* rawReader) : // select the raw data corresponding to // the CTP detector id fRawReader->Reset(); - AliDebug(1,Form("Selecting raw data for detector %d",kCTPIndex)); - fRawReader->Select(kCTPIndex); + AliDebug(1,Form("Selecting raw data for detector %d",AliDAQ::DetectorID("TRG"))); + fRawReader->Select("TRG"); } //_____________________________________________________________________________ diff --git a/STEER/AliCTPRawStream.h b/STEER/AliCTPRawStream.h index d8e2ce9f6a5..ac0325a3c51 100644 --- a/STEER/AliCTPRawStream.h +++ b/STEER/AliCTPRawStream.h @@ -36,8 +36,6 @@ class AliCTPRawStream: public TObject { AliRawReader* fRawReader; // object for reading the raw data - enum {kCTPIndex = 17}; //CTP detector index (AliDAQConfig.h) - ClassDef(AliCTPRawStream, 0) // class for reading CTP DDL raw data }; diff --git a/STEER/AliModule.cxx b/STEER/AliModule.cxx index 46e97fb7fe7..bde9763d65b 100644 --- a/STEER/AliModule.cxx +++ b/STEER/AliModule.cxx @@ -53,7 +53,7 @@ #include "AliMC.h" #include "AliRawDataHeader.h" -#include "AliDAQConfig.h" +#include "AliDAQ.h" ClassImp(AliModule) @@ -868,14 +868,7 @@ void AliModule::Digits2Raw() AliWarning(Form("Dummy version called for %s", GetName())); - Int_t nDDLs = 1; - Int_t ddlOffset = 0; - for (Int_t i = 0; i < kNDetectors; i++) { - if (strcmp(GetName(), kDetectors[i]) == 0) { - nDDLs = kDetectorDDLs[i]; - ddlOffset = 0x100 * i; - } - } + Int_t nDDLs = AliDAQ::NumberOfDdls(GetName()); if (!GetLoader()) return; fstream digitsFile(GetLoader()->GetDigitsFileName(), ios::in); @@ -888,7 +881,7 @@ void AliModule::Digits2Raw() for (Int_t iDDL = 0; iDDL < nDDLs; iDDL++) { char fileName[20]; - sprintf(fileName, "%s_%d.ddl", GetName(), iDDL + ddlOffset); + strcpy(fileName,AliDAQ::DdlFileName(GetName(),iDDL)); fstream rawFile(fileName, ios::out); if (!rawFile) return; diff --git a/STEER/AliSimulation.cxx b/STEER/AliSimulation.cxx index bd3638fc448..5b35373c867 100644 --- a/STEER/AliSimulation.cxx +++ b/STEER/AliSimulation.cxx @@ -116,7 +116,7 @@ #include "AliCDBManager.h" #include "AliAlignObj.h" #include "AliCentralTrigger.h" -#include "AliDAQConfig.h" +#include "AliDAQ.h" #include "AliDigitizer.h" #include "AliGenerator.h" #include "AliLog.h" @@ -1128,16 +1128,16 @@ Bool_t AliSimulation::ConvertRawFilesToDate(const char* dateFileName) Int_t prevLDC = -1; // loop over detectors and DDLs - for (Int_t iDet = 0; iDet < kNDetectors; iDet++) { - for (Int_t iDDL = 0; iDDL < kDetectorDDLs[iDet]; iDDL++) { + for (Int_t iDet = 0; iDet < AliDAQ::kNDetectors; iDet++) { + for (Int_t iDDL = 0; iDDL < AliDAQ::NumberOfDdls(iDet); iDDL++) { - Int_t ddlID = 0x100*iDet + iDDL; + Int_t ddlID = AliDAQ::DdlID(iDet,iDDL); Int_t ldcID = Int_t(ldc + 0.0001); - ldc += kDetectorLDCs[iDet] / kDetectorDDLs[iDet]; + ldc += AliDAQ::NumberOfLdcs(iDet) / AliDAQ::NumberOfDdls(iDet); char rawFileName[256]; - sprintf(rawFileName, "raw%d/%s_%d.ddl", - iEvent, kDetectors[iDet], ddlID); + sprintf(rawFileName, "raw%d/%s", + iEvent, AliDAQ::DdlFileName(iDet,iDDL)); // check existence and size of raw data file FILE* file = fopen(rawFileName, "rb"); diff --git a/TOF/AliTOFClusterFinder.cxx b/TOF/AliTOFClusterFinder.cxx index aeb2d3ba4ba..b84766baab2 100644 --- a/TOF/AliTOFClusterFinder.cxx +++ b/TOF/AliTOFClusterFinder.cxx @@ -270,7 +270,7 @@ void AliTOFClusterFinder::Digits2RecPoints(AliRawReader *rawReader, rawReader->Reset(); AliTOFRawStream tofInput(rawReader); - rawReader->Select(5, indexDDL, indexDDL); + rawReader->Select("TOF", indexDDL, indexDDL); while(tofInput.Next()) { @@ -347,7 +347,7 @@ void AliTOFClusterFinder::Digits2RecPoints(Int_t iEvent, AliRawReader *rawReader rawReader->Reset(); AliTOFRawStream tofInput(rawReader); - rawReader->Select(5, indexDDL, indexDDL); + rawReader->Select("TOF", indexDDL, indexDDL); while(tofInput.Next()) { @@ -439,7 +439,7 @@ void AliTOFClusterFinder::Raw2Digits(Int_t iEvent, AliRawReader *rawReader) rawReader->Reset(); AliTOFRawStream tofInput(rawReader); - rawReader->Select(5, indexDDL, indexDDL); + rawReader->Select("TOF", indexDDL, indexDDL); while(tofInput.Next()) { diff --git a/TOF/AliTOFDDLRawData.cxx b/TOF/AliTOFDDLRawData.cxx index ee7535d7a38..3705fc79934 100644 --- a/TOF/AliTOFDDLRawData.cxx +++ b/TOF/AliTOFDDLRawData.cxx @@ -47,6 +47,7 @@ Revision 0.01 2004/6/11 A.De Caro, S.B.Sellitto, R.Silvestri #include "AliTOFdigit.h" #include "AliTOFGeometry.h" #include "AliTOFRawStream.h" +#include "AliDAQ.h" ClassImp(AliTOFDDLRawData) @@ -232,7 +233,7 @@ Int_t AliTOFDDLRawData::RawDataTOF(TBranch* branch){ //loop over TOF DDL files for(Int_t i = 0; iSelect(5); + fRawReader->Select("TOF"); } diff --git a/TPC/AliTPCDDLRawData.cxx b/TPC/AliTPCDDLRawData.cxx index 7ab31e45236..5bb95a42ee3 100644 --- a/TPC/AliTPCDDLRawData.cxx +++ b/TPC/AliTPCDDLRawData.cxx @@ -31,6 +31,7 @@ #include "AliTPCAltroMapping.h" #include "AliTPCDDLRawData.h" #include "AliRawDataHeader.h" +#include "AliDAQ.h" ClassImp(AliTPCDDLRawData) //////////////////////////////////////////////////////////////////////////////////////// @@ -110,7 +111,7 @@ void AliTPCDDLRawData::RawData(const char* inputFileName){ ddlNumber=data.Sec*2+data.SubSec; else ddlNumber=72+(data.Sec-36)*4+data.SubSec; - sprintf(filename,"TPC_%d.ddl",ddlNumber+kDDLOffset); + strcpy(filename,AliDAQ::DdlFileName("TPC",ddlNumber)); Int_t patchIndex = data.SubSec; if(data.Sec>=36) patchIndex += 2; buffer=new AliAltroBuffer(filename,mapping[patchIndex]); @@ -148,7 +149,7 @@ void AliTPCDDLRawData::RawData(const char* inputFileName){ ddlNumber=data.Sec*2+data.SubSec; else ddlNumber=72+(data.Sec-36)*4+data.SubSec; - sprintf(filename,"TPC_%d.ddl",ddlNumber+kDDLOffset); + strcpy(filename,AliDAQ::DdlFileName("TPC",ddlNumber)); Int_t patchIndex = data.SubSec; if(data.Sec>=36) patchIndex += 2; buffer=new AliAltroBuffer(filename,mapping[patchIndex]); diff --git a/TPC/AliTPCRawStream.cxx b/TPC/AliTPCRawStream.cxx index bf53594f81f..e15ad95d264 100644 --- a/TPC/AliTPCRawStream.cxx +++ b/TPC/AliTPCRawStream.cxx @@ -47,7 +47,7 @@ AliTPCRawStream::AliTPCRawStream(AliRawReader* rawReader) : { // create an object to read TPC raw digits - SelectRawData(0); + SelectRawData("TPC"); TString path = gSystem->Getenv("ALICE_ROOT"); path += "/TPC/mapping/Patch"; diff --git a/TPC/AliTPCclustererMI.cxx b/TPC/AliTPCclustererMI.cxx index 129c7c2b639..a5160daeadc 100644 --- a/TPC/AliTPCclustererMI.cxx +++ b/TPC/AliTPCclustererMI.cxx @@ -630,7 +630,7 @@ void AliTPCclustererMI::Digits2Clusters(AliRawReader* rawReader) rawReader->Reset(); AliTPCRawStream input(rawReader); input.SetOldRCUFormat(fIsOldRCUFormat); - rawReader->Select(0,indexDDL,indexDDL+nDDLs-1); + rawReader->Select("TPC",indexDDL,indexDDL+nDDLs-1); // Begin loop over altro data while (input.Next()) { diff --git a/TRD/AliTRDRawStream.cxx b/TRD/AliTRDRawStream.cxx index ebd03c7c307..31cb1eb9607 100644 --- a/TRD/AliTRDRawStream.cxx +++ b/TRD/AliTRDRawStream.cxx @@ -48,7 +48,7 @@ AliTRDRawStream::AliTRDRawStream(AliRawReader* rawReader) : { // create an object to read TRD raw digits - fRawReader->Select(4); + fRawReader->Select("TRD"); } AliTRDRawStream::AliTRDRawStream(const AliTRDRawStream& stream) : diff --git a/TRD/AliTRDrawData.cxx b/TRD/AliTRDrawData.cxx index 377c1270507..b510e973f55 100644 --- a/TRD/AliTRDrawData.cxx +++ b/TRD/AliTRDrawData.cxx @@ -32,6 +32,7 @@ #include "AliRawReader.h" #include "AliTRDCommonParam.h" #include "AliTRDcalibDB.h" +#include "AliDAQ.h" ClassImp(AliTRDrawData) @@ -110,7 +111,7 @@ Bool_t AliTRDrawData::Digits2Raw(TTree *digitsTree) // Data bank // - const Int_t kNumberOfDDLs = 18; + const Int_t kNumberOfDDLs = AliDAQ::NumberOfDdls("TRD"); const Int_t kSubeventHeaderLength = 8; const Int_t kSubeventDummyFlag = 0xBB; Int_t headerSubevent[3]; @@ -157,7 +158,7 @@ Bool_t AliTRDrawData::Digits2Raw(TTree *digitsTree) // Open the output files for (Int_t iDDL = 0; iDDL < kNumberOfDDLs; iDDL++) { char name[20]; - sprintf(name, "TRD_%d.ddl", iDDL + AliTRDRawStream::kDDLOffset); + strcpy(name,AliDAQ::DdlFileName("TRD",iDDL)); #ifndef __DECCXX outputFile[iDDL] = new ofstream(name, ios::binary); #else diff --git a/VZERO/AliVZERO.cxx b/VZERO/AliVZERO.cxx index 27b6a8e9092..a07bcf72057 100755 --- a/VZERO/AliVZERO.cxx +++ b/VZERO/AliVZERO.cxx @@ -52,6 +52,7 @@ #include "AliVZEROBuffer.h" #include "AliRunDigitizer.h" #include "AliVZEROdigit.h" +#include "AliDAQ.h" ClassImp(AliVZERO) @@ -252,7 +253,7 @@ void AliVZERO::Digits2Raw() fVZERO->SetTreeAddress(); digits->GetBranch("VZERODigit")->SetAddress(&VZEROdigits); - const char *fileName = "VZERO_3584.ddl"; + const char *fileName = AliDAQ::DdlFileName("VZERO",0); AliVZEROBuffer* buffer = new AliVZEROBuffer(fileName); // Verbose level diff --git a/ZDC/AliZDC.cxx b/ZDC/AliZDC.cxx index 5947f2c7f20..fcc243848a4 100644 --- a/ZDC/AliZDC.cxx +++ b/ZDC/AliZDC.cxx @@ -47,7 +47,7 @@ #include "AliRun.h" #include "AliMC.h" #include "AliLog.h" - +#include "AliDAQ.h" ClassImp(AliZDC) @@ -455,7 +455,7 @@ void AliZDC::Digits2Raw() // open the output file char fileName[30]; - sprintf(fileName, "ZDC_%d.ddl", AliZDCRawStream::kDDLOffset); + strcpy(fileName,AliDAQ::DdlFileName("ZDC",0)); #ifndef __DECCXX ofstream file(fileName, ios::binary); #else diff --git a/ZDC/AliZDCRawStream.cxx b/ZDC/AliZDCRawStream.cxx index c16d845146b..52099f55241 100644 --- a/ZDC/AliZDCRawStream.cxx +++ b/ZDC/AliZDCRawStream.cxx @@ -41,7 +41,7 @@ AliZDCRawStream::AliZDCRawStream(AliRawReader* rawReader) : fSector[0] = 1; fSector[1] = -1; - fRawReader->Select(kDDLOffset / 0x100); + fRawReader->Select("ZDC"); } //_____________________________________________________________________________ diff --git a/ZDC/AliZDCRawStream.h b/ZDC/AliZDCRawStream.h index 034bb44e9ad..d7d6f17042a 100644 --- a/ZDC/AliZDCRawStream.h +++ b/ZDC/AliZDCRawStream.h @@ -28,7 +28,6 @@ class AliZDCRawStream: public TObject { UInt_t GetADCRaw() const {return fRawADC;}; Int_t GetADCGain() const {return fADCGain;}; Bool_t IsADCDataWord() const {return fIsADCDataWord;}; - enum {kDDLOffset = 0xB00}; // offset for DDL numbers private : AliZDCRawStream(const AliZDCRawStream& stream); -- 2.43.0