From: mrodrigu Date: Fri, 11 Apr 2008 21:26:31 +0000 (+0000) Subject: Update: added GetNEvents variable X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=commitdiff_plain;h=820ad81a0c7cd4797bfb26bb9664de9db494885e Update: added GetNEvents variable --- diff --git a/ACORDE/AliACORDERawStream.cxx b/ACORDE/AliACORDERawStream.cxx index 02eba9869f7..e6ead1e9947 100644 --- a/ACORDE/AliACORDERawStream.cxx +++ b/ACORDE/AliACORDERawStream.cxx @@ -23,6 +23,7 @@ #include "AliRawReader.h" #include "AliLog.h" #include "AliDAQ.h" +#include "AliRawReaderRoot.h" ClassImp(AliACORDERawStream) @@ -199,3 +200,26 @@ UShort_t AliACORDERawStream::GetNextShort() return word; } +//_____________________________________________________________________________ + +Int_t AliACORDERawStream::GetNEvents(char* fileName) +{ + // Returns the Total Number of Events recorded by ACORDE + // Note: it may be a better way to do it !! + // Input: fileName to Analyze + // Output: Number of Total Events (fNEvents) in fileName + // Created: 25 March 2008 + // Author: Mario Rodriguez Cahuantzi + + AliRawReader* rCount = new AliRawReaderRoot(fileName); + Int_t DyM=0; + Int_t fNEvents=0; + while(DyM==0) + { + if (!rCount->NextEvent()) DyM=1; + else fNEvents++; + } + return fNEvents; +} + +//____________________________________________________________________________