#include "AliTRDdataArrayI.h"
#include "AliTRDRawStream.h"
-#include "AliTRDCommonParam.h"
#include "AliTRDcalibDB.h"
+#include "AliFstream.h"
ClassImp(AliTRDrawData)
AliTRDrawData::AliTRDrawData()
:TObject()
,fRawVersion(2) // Default Raw Data version set here
- ,fCommonParam(0)
- ,fCalibration(0)
,fGeo(0)
,fNumberOfDDLs(0)
{
AliTRDrawData::AliTRDrawData(const AliTRDrawData &r)
:TObject(r)
,fRawVersion(2) // Default Raw Data version set here
- ,fCommonParam(0)
- ,fCalibration(0)
,fGeo(0)
,fNumberOfDDLs(0)
{
fGeo = new AliTRDgeometry();
- fCommonParam = AliTRDCommonParam::Instance();
- if (!fCommonParam) {
- AliError("Could not get common params");
- delete fGeo;
- delete digitsManager;
- return kFALSE;
- }
-
- fCalibration = AliTRDcalibDB::Instance();
- if (!fCalibration) {
+ if (!AliTRDcalibDB::Instance()) {
AliError("Could not get calibration object");
delete fGeo;
delete digitsManager;
char name[1024];
sprintf(name,"TRD_%d.ddl",sect + AliTRDRawStream::kDDLOffset);
-#ifndef __DECCXX
- ofstream *of = new ofstream(name, ios::binary);
-#else
- ofstream *of = new ofstream(name);
-#endif
+ AliFstream* of = new AliFstream(name);
// Write a dummy data header
AliRawDataHeader header; // the event header
- UInt_t hpos = of->tellp();
- of->write((char *) (& header), sizeof(header));
+ UInt_t hpos = of->Tellp();
+ of->WriteBuffer((char *) (& header), sizeof(header));
// Reset payload byte size (payload does not include header).
Int_t npayloadbyte = 0;
Int_t iDet = fGeo->GetDetector(plan, cham, sect);
// If chamber status is ok, we assume that the optical link is also OK.
// This is shown in the GTU link mask.
- if ( fCalibration->GetChamberStatus(iDet) )
+ if ( AliTRDcalibDB::Instance()->GetChamberStatus(iDet) )
GtuCdh = GtuCdh | (3 << (2*plan));
}
- of->write((char *) (& GtuCdh), sizeof(GtuCdh));
+ of->WriteBuffer((char *) (& GtuCdh), sizeof(GtuCdh));
npayloadbyte += 4;
}
// Process A side of the chamber
if ( fRawVersion >= 1 && fRawVersion <= 2 ) hcwords = ProduceHcDataV1andV2(digits,0,iDet,hc_buffer,kMaxHcWords);
- of->write((char *) hc_buffer, hcwords*4);
+ of->WriteBuffer((char *) hc_buffer, hcwords*4);
npayloadbyte += hcwords*4;
// Process B side of the chamber
if ( fRawVersion >= 1 && fRawVersion <= 2 ) hcwords = ProduceHcDataV1andV2(digits,1,iDet,hc_buffer,kMaxHcWords);
- of->write((char *) hc_buffer, hcwords*4);
+ of->WriteBuffer((char *) hc_buffer, hcwords*4);
npayloadbyte += hcwords*4;
}
}
// Complete header
- header.fSize = UInt_t(of->tellp()) - hpos;
+ header.fSize = UInt_t(of->Tellp()) - hpos;
header.SetAttribute(0); // Valid data
- of->seekp(hpos); // Rewind to header position
- of->write((char *) (& header), sizeof(header));
- of->close();
+ of->Seekp(hpos); // Rewind to header position
+ of->WriteBuffer((char *) (& header), sizeof(header));
delete of;
-
}
delete hc_buffer;
Int_t plan = fGeo->GetPlane( det ); // Plane
Int_t cham = fGeo->GetChamber( det ); // Chamber
Int_t sect = fGeo->GetSector( det ); // Sector (=iDDL)
- Int_t nRow = fCommonParam->GetRowMax( plan, cham, sect );
- Int_t nCol = fCommonParam->GetColMax( plan );
- const Int_t nTBin = fCalibration->GetNumberOfTimeBins();
+ Int_t nRow = fGeo->GetRowMax( plan, cham, sect );
+ Int_t nCol = fGeo->GetColMax( plan );
+ const Int_t nTBin = AliTRDcalibDB::Instance()->GetNumberOfTimeBins();
Int_t kCtype = 0; // Chamber type (0:C0, 1:C1)
Int_t iEv = 0xA; // Event ID. Now fixed to 10, how do I get event id?
UInt_t x = 0; // General used number