]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/AliTriggerScalers.cxx
Coverity fixes
[u/mrichter/AliRoot.git] / STEER / AliTriggerScalers.cxx
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  *                                                                        *
4  * Author: The ALICE Off-line Project.                                    *
5  * Contributors are mentioned in the code where appropriate.              *
6  *                                                                        *
7  * Permission to use, copy, modify and distribute this software and its   *
8  * documentation strictly for non-commercial purposes is hereby granted   *
9  * without fee, provided that the above copyright notice appears in all   *
10  * copies and that both the copyright notice and this permission notice   *
11  * appear in the supporting documentation. The authors make no claims     *
12  * about the suitability of this software for any purpose. It is          *
13  * provided "as is" without express or implied warranty.                  *
14  **************************************************************************/
15
16 /* $Id: AliTriggerScalers.cxx 22322 2007-11-22 11:43:14Z cvetan $ */
17
18 ///////////////////////////////////////////////////////////////////////////////
19 //
20 //  Class to define the ALICE Trigger Scalers  
21 //
22 //  For each trigger class there are six scalers:
23 //
24 //    LOCB       L0 triggers before any vetos 
25 //    LOCA       L0 triggers after all vetos 
26 //    L1CB       L1 triggers before any vetos 
27 //    L1CA       L1 triggers after all vetos 
28 //    L2CB       L2 triggers before any vetos 
29 //    L2CA       L2 triggers after all vetos 
30 //
31 //////////////////////////////////////////////////////////////////////////////
32
33 #include <Riostream.h>
34
35 #include "AliLog.h"
36 #include "AliTriggerScalers.h"
37
38 ClassImp( AliTriggerScalers )
39
40 //_____________________________________________________________________________
41 AliTriggerScalers::AliTriggerScalers(): 
42   TObject(),
43   fClassIndex(0),
44   fLOCB(0),     
45   fLOCA(0),     
46   fL1CB(0),     
47   fL1CA(0),     
48   fL2CB(0),     
49   fL2CA(0)      
50 {
51   // Default constructor
52 }
53
54 //_____________________________________________________________________________
55 AliTriggerScalers::AliTriggerScalers( UChar_t classIndex, UInt_t LOCB, UInt_t LOCA,        
56                                       UInt_t L1CB, UInt_t L1CA, UInt_t L2CB, UInt_t L2CA ):   
57   TObject(),
58   fClassIndex( classIndex ),
59   fLOCB(LOCB),     
60   fLOCA(LOCA),     
61   fL1CB(L1CB),     
62   fL1CA(L1CA),     
63   fL2CB(L2CB),     
64   fL2CA(L2CA)      
65 {
66   // Default constructor
67 }
68
69 //_____________________________________________________________________________
70 Int_t  AliTriggerScalers::Compare( const TObject* obj ) const
71 {
72   // Compare Scaler by class index (to sort in Scaler Record by class index)
73   if( fClassIndex < ((AliTriggerScalers*)obj)->fClassIndex ) return -1;
74   if( fClassIndex > ((AliTriggerScalers*)obj)->fClassIndex ) return 1;
75   return 0;
76 }
77 //____________________________________________________________________________
78 void AliTriggerScalers::GetAllScalers(UInt_t *scalers) const
79 {
80  scalers[0]=fLOCB;
81  scalers[1]=fLOCA;
82  scalers[2]=fL1CB;
83  scalers[3]=fL1CA;
84  scalers[4]=fL2CB;
85  scalers[5]=fL2CA;
86 }
87 //_____________________________________________________________________________
88 void AliTriggerScalers::Print( const Option_t* ) const
89 {
90    // Print
91   cout << "Trigger Scalers for Class: " << (Int_t)fClassIndex << endl;
92   cout << "  LOCB: " << fLOCB << " LOCA: " << fLOCA; //<< endl;
93   cout << "  L1CB: " << fL1CB << " L1CA: " << fL1CA; //<< endl;
94   cout << "  L2CB: " << fL2CB << " L2CA: " << fL2CA << endl;
95 }