#include "AliAltroBuffer.h"
#include "AliRawReader.h"
#include "AliEMCALRawStream.h"
+#include "AliDAQ.h"
ClassImp(AliEMCAL)
Double_t AliEMCAL::fgCapa = 1.; // 1pF
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)
}
// 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;
// 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
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) ;
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
{
// create an object to read EMCAL raw digits
- SelectRawData(8);
+ SelectRawData("EMCAL");
fNoAltroMapping = kTRUE;
}
// 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
// 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);
// 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
// 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
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);
}
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);
}
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);
}
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; }
AliFMDParameters* pars = AliFMDParameters::Instance();
// Select FMD DDL's
- fReader->Select(AliFMDParameters::kBaseDDL>>8);
+ fReader->Select("FMD");
UShort_t stripMin = 0;
UShort_t stripMax = 127;
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));
// 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;
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
// CTOR
fNoAltroMapping = kFALSE;
// Select FMD DDL's
- SelectRawData(AliFMDParameters::kBaseDDL>>8);
+ SelectRawData("FMD");
}
//_____________________________________________________________________________
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;
#include <TArrayI.h> // ROOT_TArrayI
#include <TClonesArray.h> // ROOT_TClonesArray
// #include <fstream>
+#include "AliDAQ.h"
//____________________________________________________________________
ClassImp(AliFMDRawWriter)
}
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'
// 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);
}
#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
#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
// 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;
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;
}
#include "AliITSRawStreamSDD.h"
#include "AliITSRawStreamSSD.h"
#include "AliBitPacking.h"
+#include "AliDAQ.h"
ClassImp(AliITSDDLRawData)
AliRawDataHeader header;
//loop over DDLs
- for(Int_t i=0;i<AliITSRawStreamSPD::kDDLsNumber;i++){
- sprintf(fileName,"ITSSPD_%d.ddl",i+AliITSRawStreamSPD::kDDLOffset); //The name of the output file.
+ for(Int_t i=0;i<AliDAQ::NumberOfDdls("ITSSPD");i++){
+ strcpy(fileName,AliDAQ::DdlFileName("ITSSPD",i)); //The name of the output file.
#ifndef __DECCXX
outfile.open(fileName,ios::binary);
#else
AliRawDataHeader header;
//loop over DDLs
- for(Int_t i=0;i<AliITSRawStreamSSD::kDDLsNumber;i++){
- sprintf(fileName,"ITSSSD_%d.ddl",i+AliITSRawStreamSSD::kDDLOffset); //The name of the output file
+ for(Int_t i=0;i<AliDAQ::NumberOfDdls("ITSSSD");i++){
+ strcpy(fileName,AliDAQ::DdlFileName("ITSSSD",i)); //The name of the output file.
#ifndef __DECCXX
outfile.open(fileName,ios::binary);
#else
AliRawDataHeader header;
//loop over DDLs
- for(Int_t i=0;i<AliITSRawStreamSDD::kDDLsNumber;i++){
- sprintf(fileName,"ITSSDD_%d.ddl",i+AliITSRawStreamSDD::kDDLOffset); //The name of the output file
+ for(Int_t i=0;i<AliDAQ::NumberOfDdls("ITSSDD");i++){
+ strcpy(fileName,AliDAQ::DdlFileName("ITSSDD",i)); //The name of the output file.
#ifndef __DECCXX
outfile.open(fileName,ios::binary);
#else
fAnode[i]=0;
fLowThreshold[i]=0;
}
- fRawReader->Select(2);
+ fRawReader->Select("ITSSDD");
}
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
{
// create an object to read ITS SPD raw digits
- fRawReader->Select(1);
+ fRawReader->Select("ITSSPD");
}
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
{
// create an object to read ITS SSD raw digits
- fRawReader->Select(3);
+ fRawReader->Select("ITSSSD");
}
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
fADC =0;
fADModule=0;
- fRawReader->Select(3);
fRawReader->SelectEquipment(17,102,102);
}
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();
}
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();
{
// 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);
// 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();
/* 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)
*
#include "AliCDBEntry.h"
#include "AliCDBStorage.h"
#include "AliPHOSCalibData.h"
+#include "AliDAQ.h"
ClassImp(AliPHOS)
}
// 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
}
// 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;
{
// create an object to read PHOS raw digits
- SelectRawData(6);
+ SelectRawData("PHOS");
fNoAltroMapping = kTRUE;
}
ResetCellADC();
rawReader->Reset();
AliPMDRawStream pmdinput(rawReader);
- rawReader->Select(12, indexDDL, indexDDL);
+ rawReader->Select("PMD", indexDDL, indexDDL);
while(pmdinput.Next())
{
Int_t det = pmdinput.GetDetector();
ResetCellADC();
rawReader->Reset();
AliPMDRawStream pmdinput(rawReader);
- rawReader->Select(12, indexDDL, indexDDL);
+ rawReader->Select("PMD", indexDDL, indexDDL);
while(pmdinput.Next())
{
Int_t det = pmdinput.GetDetector();
#include "AliPMDdigit.h"
#include "AliPMDRawStream.h"
#include "AliPMDDDLRawData.h"
-
+#include "AliDAQ.h"
ClassImp(AliPMDDDLRawData)
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;
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
{
// create an object to read PMD raw digits
- fRawReader->Select(12);
+ fRawReader->Select("PMD");
}
//_____________________________________________________________________________
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()
{
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
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;
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);
+++ /dev/null
-#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
#include <Riostream.h>
#include "AliRawReader.h"
-
+#include "AliDAQ.h"
ClassImp(AliRawReader)
{
// 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;
}
{
// 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
// 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,
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);
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;}
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
#include <AliPDG.h>
#include <AliMC.h> //StepManager()
#include <AliRawDataHeader.h> //Digits2Raw()
+#include <AliDAQ.h> //Digits2Raw()
#include <AliRun.h> //CreateMaterials()
#include <AliMagF.h> //CreateMaterials()
#include <TGeoManager.h> //CreateGeometry()
UInt_t w32=0; //32 bits data word
for(Int_t i=0;i<AliRICHDigit::kNddls;i++){//open all 14 DDL in parallel
- file[i].open(Form("RICH_%4i.ddl",AliRICHDigit::kDdlOffset+i)); //first is 0x700
+ file[i].open(AliDAQ::DdlFileName("RICH",i));
file[i].write((char*)&header,sizeof(header)); //write dummy header as place holder, actual will be written later when total size of DDL is known
cnt[i]=0; //reset counters
}
#include "AliBitPacking.h"
#include "AliRawDataHeader.h"
#include "AliBitPacking.h"
+#include "AliDAQ.h"
ClassImp(AliSTARTRawData)
ofstream outfile; // logical name of the output file
AliRawDataHeader header;
//loop over TOF DDL files
- sprintf(fileName,"START_%d.ddl", 0xd00);
- // sprintf(fileName,"START_0xd00.ddl"); //The name of the output file
+ strcpy(fileName,AliDAQ::DdlFileName("START",0)); //The name of the output file
#ifndef __DECCXX
outfile.open(fileName,ios::binary);
#else
fTree->Branch("START","AliSTARTdigit",&fDigits,405,1);
fRawReader->Reset();
- fRawReader->Select(13,0,1);
+ fRawReader->Select("START");
}
#include "AliCTPRawData.h"
#include "AliRunLoader.h"
#include "AliCentralTrigger.h"
-#include "AliDAQConfig.h"
#include "AliRawDataHeader.h"
#include "AliLog.h"
+#include "AliDAQ.h"
ClassImp(AliCTPRawData)
////////////////////////////////////////////////////////////////////////////////////////
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
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)
};
#include "AliCTPRawStream.h"
#include "AliRawReader.h"
#include "AliLog.h"
+#include "AliDAQ.h"
ClassImp(AliCTPRawStream)
// 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");
}
//_____________________________________________________________________________
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
};
#include "AliMC.h"
#include "AliRawDataHeader.h"
-#include "AliDAQConfig.h"
+#include "AliDAQ.h"
ClassImp(AliModule)
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);
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;
#include "AliCDBManager.h"
#include "AliAlignObj.h"
#include "AliCentralTrigger.h"
-#include "AliDAQConfig.h"
+#include "AliDAQ.h"
#include "AliDigitizer.h"
#include "AliGenerator.h"
#include "AliLog.h"
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");
rawReader->Reset();
AliTOFRawStream tofInput(rawReader);
- rawReader->Select(5, indexDDL, indexDDL);
+ rawReader->Select("TOF", indexDDL, indexDDL);
while(tofInput.Next()) {
rawReader->Reset();
AliTOFRawStream tofInput(rawReader);
- rawReader->Select(5, indexDDL, indexDDL);
+ rawReader->Select("TOF", indexDDL, indexDDL);
while(tofInput.Next()) {
rawReader->Reset();
AliTOFRawStream tofInput(rawReader);
- rawReader->Select(5, indexDDL, indexDDL);
+ rawReader->Select("TOF", indexDDL, indexDDL);
while(tofInput.Next()) {
#include "AliTOFdigit.h"
#include "AliTOFGeometry.h"
#include "AliTOFRawStream.h"
+#include "AliDAQ.h"
ClassImp(AliTOFDDLRawData)
//loop over TOF DDL files
for(Int_t i = 0; i<AliTOFGeometry::NDDL()*AliTOFGeometry::NSectors(); i++){
- sprintf(fileName,"TOF_%d.ddl",i+AliTOFRawStream::kDDLOffset); //The name of the output file
+ strcpy(fileName,AliDAQ::DdlFileName("TOF",i)); //The name of the output file
#ifndef __DECCXX
outfile.open(fileName,ios::binary);
#else
reader.Reset();
AliTOFRawStream stream(&reader);
- reader.Select(5, indexDDL, indexDDL);
+ reader.Select("TOF", indexDDL, indexDDL);
//FILE *fpw = fopen("TOFrawDataRead.txt","w");
fTOFGeometry = new AliTOFGeometryV5();
- fRawReader->Select(5);
+ fRawReader->Select("TOF");
}
#include "AliTPCAltroMapping.h"
#include "AliTPCDDLRawData.h"
#include "AliRawDataHeader.h"
+#include "AliDAQ.h"
ClassImp(AliTPCDDLRawData)
////////////////////////////////////////////////////////////////////////////////////////
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]);
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]);
{
// create an object to read TPC raw digits
- SelectRawData(0);
+ SelectRawData("TPC");
TString path = gSystem->Getenv("ALICE_ROOT");
path += "/TPC/mapping/Patch";
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()) {
{
// create an object to read TRD raw digits
- fRawReader->Select(4);
+ fRawReader->Select("TRD");
}
AliTRDRawStream::AliTRDRawStream(const AliTRDRawStream& stream) :
#include "AliRawReader.h"
#include "AliTRDCommonParam.h"
#include "AliTRDcalibDB.h"
+#include "AliDAQ.h"
ClassImp(AliTRDrawData)
// 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];
// 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
#include "AliVZEROBuffer.h"
#include "AliRunDigitizer.h"
#include "AliVZEROdigit.h"
+#include "AliDAQ.h"
ClassImp(AliVZERO)
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
#include "AliRun.h"
#include "AliMC.h"
#include "AliLog.h"
-
+#include "AliDAQ.h"
ClassImp(AliZDC)
// 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
fSector[0] = 1;
fSector[1] = -1;
- fRawReader->Select(kDDLOffset / 0x100);
+ fRawReader->Select("ZDC");
}
//_____________________________________________________________________________
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);