Added methods for finding a given module in the DDL map (F. Prino)
[u/mrichter/AliRoot.git] / STEER / AliTriggerRunScalers.h
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 //////////////////////////////////////////////////////////////////////////////
16 class TObject;
17
18 class AliTimeStamp;
19 class AliTriggerScalersRecord;
20
21 #include "TArrayC.h"
22
23 class AliTriggerRunScalers : public TObject {
24
25 public:
26                          AliTriggerRunScalers();
27               virtual   ~AliTriggerRunScalers() { fScalersRecord.SetOwner(); fScalersRecord.Delete(); }
28
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]; }
34                 TObjArray*   GetScalersRecords()   { return &fScalersRecord; } 
35   AliTriggerScalersRecord*   GetScalersRecord( Int_t index )         
36                                                 { return (AliTriggerScalersRecord*)fScalersRecord.At(index); }
37                     Int_t    FindNearestScalersRecord( AliTimeStamp * stamp );
38         
39   //  Setters
40                      void    SetVersion( Short_t ver )       { fVersion = ver;   }            
41                      void    SetRunNumber( ULong_t run )     { fRunNumber = run; }
42                      void    SetNumClasses( UChar_t nclass ) { fnClasses = nclass; fClassIndex.Set(nclass); }
43                      void    SetClass( UChar_t i, UChar_t index ) { fClassIndex[i]=index; }
44                      void    AddTriggerScalers( AliTriggerScalersRecord* scal );
45              virtual void    Print( const Option_t* opt ="" ) const;
46
47                                         
48  static AliTriggerRunScalers*  ReadScalers( TString & filename );
49                                       
50
51 private:
52                   Short_t    fVersion;            // Version
53                   ULong_t    fRunNumber;          // Run number
54                   UChar_t    fnClasses;           // Number of trigger classes
55                   TArrayC    fClassIndex;         // list of classes used in this partition
56                 TObjArray    fScalersRecord;      // Array of records (AliTriggerScalersRecord)
57     
58                         //     AliTriggerRunScalers( const AliTriggerRunScalers &run );
59     AliTriggerRunScalers&    operator=(const AliTriggerRunScalers& run);
60
61    ClassDef( AliTriggerRunScalers, 1 )  // Define a Run Trigger Scalers (Scalers)
62 };
63
64 #endif