]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG3/muon/AliAODEventInfo.cxx
Correct character constantness
[u/mrichter/AliRoot.git] / PWG3 / muon / AliAODEventInfo.cxx
1 // AliAODEventInfo: a class for AODs for the MUON Arm of the ALICE Experiment
2 // Author: P. Cortese, Universita' del Piemonte Orientale in Alessandria and
3 // INFN of Torino - Italy
4 //
5 // This class provides additional information about the AliAODEvent, some
6 // of this is specific to MUON. The information stored in this class will 
7 // follow the evolution of the framework (i.e. some data members  may be 
8 // moved into the header in the future).
9 // Currently it stores the beam energy and the information needed to decode
10 // the trigger pattern (which are the bits corresponding to the different
11 // muon triggers).
12 //
13
14 #include "AliAODEventInfo.h"
15 #include "AliAODHeader.h"
16 #define AliAODEventInfo_CXX
17
18 // ************************************************************************** //
19 ClassImp(AliAODEventInfo)
20
21 //______________________________________________________________________________
22 AliAODEventInfo::AliAODEventInfo():fBeamEnergy(0),
23         fMuonSingleLPtL0(0),fMuonSingleHPtL0(0),fMuonLikeLPtL0(0),
24         fMuonLikeHPtL0(0),fMuonUnlikeLPtL0(0),fMuonUnlikeHPtL0(0),
25         fEv(0),fEi(this),fHe(0),fTr(0),fDi(0)
26 {
27   // Default constructor
28 }
29
30 //______________________________________________________________________________
31 AliAODEventInfo::~AliAODEventInfo()
32 {
33   // Default destructor
34 }
35
36 //______________________________________________________________________________
37 Bool_t AliAODEventInfo::IsHeaderAccessible(const Char_t *msg) const {
38   // Tests if the header pointer is set
39   if(fHe!=0){
40     return 1;
41   }else{
42     if(msg)printf("Error! Header is not accessible: %s",msg);
43     return 0;
44   }
45 }
46
47 //______________________________________________________________________________
48 void AliAODEventInfo::SelectTriggerBits(UChar_t muonSingleLPtL0,
49     UChar_t muonSingleHPtL0,UChar_t muonLikeLPtL0, UChar_t muonLikeHPtL0,
50     UChar_t muonUnlikeLPtL0, UChar_t muonUnlikeHPtL0){
51   // Define which bit in the trigger pattern corresponds to the given trigger condition 
52   fMuonSingleLPtL0=muonSingleLPtL0;
53   fMuonSingleHPtL0=muonSingleHPtL0;
54   fMuonLikeLPtL0=muonLikeLPtL0;  
55   fMuonLikeHPtL0=muonLikeHPtL0;  
56   fMuonUnlikeLPtL0=muonUnlikeLPtL0;
57   fMuonUnlikeHPtL0=muonUnlikeHPtL0;
58 }
59
60 //______________________________________________________________________________
61 Bool_t AliAODEventInfo::MuonSingleLPtL0() const {
62   // Test if the event fired MUON_Single_LPt_L0
63   if(IsHeaderAccessible("MuonSingleLPtL0"))
64     return ((((AliAODHeader*)fHe.GetObject())->GetTriggerMask())>>fMuonSingleLPtL0)&0x1;
65   else
66     return 0;
67 }
68
69 //__________________________________________
70 Bool_t AliAODEventInfo::MuonSingleHPtL0() const {
71   // Test if the event fired MUON_Single_HPt_L0
72   if(IsHeaderAccessible("MuonSingleHPtL0"))
73     return ((((AliAODHeader*)fHe.GetObject())->GetTriggerMask())>>fMuonSingleHPtL0)&0x1;
74   else
75     return 0;
76 }
77
78 //__________________________________________
79 Bool_t AliAODEventInfo::MuonLikeLPtL0() const {
80   // Test if the event fired MUON_Like_LPt_L0
81   if(IsHeaderAccessible("MuonLikeLPtL0"))
82     return ((((AliAODHeader*)fHe.GetObject())->GetTriggerMask())>>fMuonLikeLPtL0)&0x1;
83   else
84     return 0;
85 }
86
87 //__________________________________________
88 Bool_t AliAODEventInfo::MuonLikeHPtL0() const {
89   // Test if the event fired MUON_Like_HPt_L0
90   if(IsHeaderAccessible("MuonLikeHPtL0"))
91     return ((((AliAODHeader*)fHe.GetObject())->GetTriggerMask())>>fMuonLikeHPtL0)&0x1;
92   else
93     return 0;
94 }
95
96 //__________________________________________
97 Bool_t AliAODEventInfo::MuonUnlikeLPtL0() const {
98   // Test if the event fired MUON_Unlike_LPt_L0
99   if(IsHeaderAccessible("MuonUnlikeLPtL0"))
100     return ((((AliAODHeader*)fHe.GetObject())->GetTriggerMask())>>fMuonUnlikeLPtL0)&0x1;
101   else
102     return 0;
103 }
104
105 //__________________________________________
106 Bool_t AliAODEventInfo::MuonUnlikeHPtL0() const {
107   // Test if the event fired MUON_Unlike_HPt_L0
108   if(IsHeaderAccessible("MuonUnlikeHPtL0"))
109     return ((((AliAODHeader*)fHe.GetObject())->GetTriggerMask())>>fMuonUnlikeHPtL0)&0x1;
110   else
111     return 0;
112 }