Bug corrected.
[u/mrichter/AliRoot.git] / STEER / AliTriggerRunScalers.h
CommitLineData
d7dd8a54 1#ifndef ALITRIGGERRUNSCALERS_H
2#define ALITRIGGERRUNSCALERS_H
3
4/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
6
7/* $Id: AliTriggerRunScalers.h 22322 2007-11-22 11:43:14Z cvetan $ */
8
9///////////////////////////////////////////////////////////////////////////////
10//
11// Class to define a collection scalers per Run
12//
13//
14//
15//////////////////////////////////////////////////////////////////////////////
16class TObject;
d7dd8a54 17class AliTimeStamp;
6441c2a8 18class AliTriggerScalersESD;
d7dd8a54 19class AliTriggerScalersRecord;
6441c2a8 20class AliTriggerScalersRecordESD;
d7dd8a54 21
22#include "TArrayC.h"
23
24class AliTriggerRunScalers : public TObject {
25
26public:
27 AliTriggerRunScalers();
7eaf72df 28 virtual ~AliTriggerRunScalers();
d7dd8a54 29 // Getters
30 Short_t GetVersion() const { return fVersion; }
31 ULong_t GetRunNumber() const { return fRunNumber; }
32 UChar_t GetNumClasses() const { return fnClasses; }
33 Char_t GetClass( Int_t i ) const { return fClassIndex[i]; }
033d0f8e 34 const TObjArray* GetScalersRecords() const { return &fScalersRecord; }
6441c2a8 35 const TObjArray* GetScalersRecordsESD() const { return &fScalersRecordESD; }
033d0f8e 36 AliTriggerScalersRecord* GetScalersRecord( Int_t index ) const { return (AliTriggerScalersRecord*)fScalersRecord.At(index); }
37 Int_t FindNearestScalersRecord( const AliTimeStamp *stamp ) const;
6441c2a8 38 AliTriggerScalersESD* GetScalersForEventClass(const AliTimeStamp* stamp,const Int_t classIndex) const;
39 // Analysis
74135182 40 Int_t ConsistencyCheck(Int_t position,Bool_t correctOverflow, UInt_t** overflow);
6441c2a8 41 Int_t CorrectScalersOverflow();
a93ccff3 42 Int_t CheckRunScalers(){return (fScalersRecord.GetEntriesFast()==fScalersRecordESD.GetEntriesFast());}
d7dd8a54 43 // Setters
44 void SetVersion( Short_t ver ) { fVersion = ver; }
45 void SetRunNumber( ULong_t run ) { fRunNumber = run; }
46 void SetNumClasses( UChar_t nclass ) { fnClasses = nclass; fClassIndex.Set(nclass); }
47 void SetClass( UChar_t i, UChar_t index ) { fClassIndex[i]=index; }
48 void AddTriggerScalers( AliTriggerScalersRecord* scal );
49 virtual void Print( const Option_t* opt ="" ) const;
bf7443cc 50 AliTriggerRunScalers( const AliTriggerRunScalers &run );
51 AliTriggerRunScalers& operator=(const AliTriggerRunScalers& run);
d7dd8a54 52
e39e51f6 53static AliTriggerRunScalers* ReadScalers( TString & filename );
d7dd8a54 54
d7dd8a54 55private:
56 Short_t fVersion; // Version
57 ULong_t fRunNumber; // Run number
58 UChar_t fnClasses; // Number of trigger classes
59 TArrayC fClassIndex; // list of classes used in this partition
60 TObjArray fScalersRecord; // Array of records (AliTriggerScalersRecord)
bf7443cc 61 TObjArray fScalersRecordESD; // Array of records with 64bit scalers (AliTriggerScalersRecordESD)
62
d7dd8a54 63
d7dd8a54 64
74135182 65 ClassDef( AliTriggerRunScalers, 3 ) // Define a Run Trigger Scalers (Scalers)
d7dd8a54 66};
67
68#endif