#include "AliHMPIDParam.h"
#include <AliDAQ.h> //WriteRaw()
#include "Riostream.h" //WriteRaw()
+#include "AliFstream.h"
+
ClassImp(AliHMPIDDigit)
/*
Preface: all geometrical information (like left-right sides) is reported as seen from electronic side.
- d10 d1 d10 d1
+ d10 d1 d10 d1
_______________ _______________
-r24 | | | |126.16 r1
+r1 | | | |126.16 r24
| 4 | | 5 |
| | | |
|_______________| |_______________|85.84
| | | |40.32
| 0 | | 1 |
| | | |
-r1 |_______________| |_______________|0 r24
- 0 64.0 66.6 130.6
+r24 |_______________| |_______________|0 r1 //updated: 15/02/2008
+ 0 64.0 66.6 130.6 //corrected: 05/08/2009 clm
fTracks[0],fTracks[1],fTracks[2],w32,ddl,r,d,a, (AliHMPIDParam::IsOverTh(Q()))?"":"below thr");
}
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-void AliHMPIDDigit::WriteRaw(TObjArray *pDigAll)
-{
-// Write a list of digits for a given chamber in raw data stream
-// Arguments: pDigAll- list of digits
-// Returns: none
- for(Int_t iCh=AliHMPIDParam::kMinCh;iCh<=AliHMPIDParam::kMaxCh;iCh++){//chambers loop
- ofstream ddlL,ddlR; //output streams, 2 per chamber
- Int_t cntL=0,cntR=0; //data words counters for DDLs
- AliRawDataHeader header; header.SetAttribute(0); //empty DDL header
-
- ddlL.open(AliDAQ::DdlFileName("HMPID",2*iCh));
- ddlR.open(AliDAQ::DdlFileName("HMPID",2*iCh+1)); //open both DDL of this chamber in parallel
- ddlL.write((char*)&header,sizeof(header)); //write dummy header as place holder, actual
- ddlR.write((char*)&header,sizeof(header)); //will be rewritten later when total size of DDL is known
-
- UInt_t w32=0; //32 bits data word
- TClonesArray *pDigCh=(TClonesArray *)pDigAll->At(iCh); //list of digits for current chamber
- for(Int_t iDig=0;iDig<pDigCh->GetEntriesFast();iDig++){//digits loop
- AliHMPIDDigit *pDig=(AliHMPIDDigit*)pDigCh->At(iDig);
- if(pDig->Q() < 1) continue;
- Int_t ddl,r,d,a; //32 bits data word
- pDig->Raw(w32,ddl,r,d,a);
- if(ddl%2){
- ddlL.write((char*)&w32,sizeof(w32)); cntL++;
- }else{
- ddlR.write((char*)&w32,sizeof(w32)); cntR++;
- }
- }//digits loop
-
- header.fSize=sizeof(header)+cntL*sizeof(w32); ddlL.seekp(0); ddlL.write((char*)&header,sizeof(header)); ddlL.close(); //rewrite header with size set to
- header.fSize=sizeof(header)+cntR*sizeof(w32); ddlR.seekp(0); ddlR.write((char*)&header,sizeof(header)); ddlR.close(); //number of bytes and close file
- }//chambers loop
-}//WriteRaw()
-//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++