Update: added GetNEvents variable
authormrodrigu <mrodrigu@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 11 Apr 2008 21:26:31 +0000 (21:26 +0000)
committermrodrigu <mrodrigu@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 11 Apr 2008 21:26:31 +0000 (21:26 +0000)
ACORDE/AliACORDERawStream.cxx

index 02eba98..e6ead1e 100644 (file)
@@ -23,6 +23,7 @@
 #include "AliRawReader.h"\r
 #include "AliLog.h"\r
 #include "AliDAQ.h"\r
+#include "AliRawReaderRoot.h"\r
 \r
 ClassImp(AliACORDERawStream)\r
 \r
@@ -199,3 +200,26 @@ UShort_t AliACORDERawStream::GetNextShort()
   return word;\r
 }\r
 \r
+//_____________________________________________________________________________\r
+\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
+       return fNEvents;\r
+}\r
+\r
+//____________________________________________________________________________\r