#include "AliRawReader.h"\r
#include "AliLog.h"\r
#include "AliDAQ.h"\r
+#include "AliRawReaderRoot.h"\r
\r
ClassImp(AliACORDERawStream)\r
\r
// Created: 04 Feb 2008 Mario Sitta\r
//\r
\r
+ fWord[0] = fWord[1] = fWord[2] = fWord[3] = 0;\r
+\r
// Select the raw data corresponding to the ACORDE detector id\r
// fRawReader->Reset();\r
AliDebug(1,Form("Selecting raw data for detector %d",AliDAQ::DetectorID("ACORDE")));\r
\r
fDataSize = fRawReader->GetDataSize();\r
if (fDataSize != 16) {\r
- fRawReader->AddFatalErrorLog(kRawDataSizeErr,Form("size %d != 5488",fDataSize));\r
- AliWarning(Form("Wrong ACORDE raw data size: %d, expected 5488 bytes!",fDataSize));\r
+ fRawReader->AddFatalErrorLog(kRawDataSizeErr,Form("size %d != 16",fDataSize));\r
+ AliWarning(Form("Wrong ACORDE raw data size: %d, expected 16 bytes!",fDataSize));\r
return kFALSE;\r
}\r
\r
}\r
\r
//_____________________________________________________________________________\r
-UShort_t AliACORDERawStream::GetNextShort()\r
-{\r
- //\r
- // Returns the next 16 bit word inside the raw data payload.\r
- // The method is supposed to be endian (platform) independent.\r
- //\r
- // Input:\r
- //\r
- // Output:\r
- // word : a 16 bit word containing the data\r
- //\r
- // Created: 04 Feb 2008 Mario Sitta\r
- //\r
-\r
- if (!fData || fPosition < 0) AliFatal("Raw data payload buffer is not yet initialized !");\r
-\r
- UShort_t word = 0;\r
- word |= fData[fPosition++];\r
- word |= fData[fPosition++] << 8;\r
\r
- return word;\r
+Int_t AliACORDERawStream::GetNEvents(char* fileName) \r
+{\r
+ // Returns the Total Number of Events recorded by ACORDE \r
+ // Note: it may be a better way to do it !!\r
+ // Input: fileName to Analyze\r
+ // Output: Number of Total Events (fNEvents) in fileName\r
+ // Created: 25 March 2008\r
+ // Author: Mario Rodriguez Cahuantzi <mrodrigu@mail.cern.ch>\r
+ \r
+ AliRawReader* rCount = new AliRawReaderRoot(fileName);\r
+ Int_t DyM=0;\r
+ Int_t fNEvents=0;\r
+ while(DyM==0)\r
+ {\r
+ if (!rCount->NextEvent()) DyM=1;\r
+ else fNEvents++;\r
+ }\r
+ delete rCount;\r
+ return fNEvents;\r
}\r
\r
+//____________________________________________________________________________\r