]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONGlobalTrigger.cxx
Extracting the BLOCK DATA in a separate file. Changes to make it working on macosx
[u/mrichter/AliRoot.git] / MUON / AliMUONGlobalTrigger.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
17 /* $Id$ */
18
19
20 #include "AliMUONGlobalTrigger.h"
21 #include <assert.h>
22 #include "AliLog.h"
23 #include "AliMUONLocalStruct.h"
24
25 /// \class AliMUONGlobalTrigger
26 /// Global Trigger algorithm data output.
27 /// Built from Local and Regional algorithms.                          \n 
28 /// Update for copy & assigment operator,
29 /// add SetGlobalPattern and GetGlobalPattern method for rawdata 
30 /// (Ch. Finck)
31 /// \author Ph. Crochet
32
33 /// \cond CLASSIMP
34 ClassImp(AliMUONGlobalTrigger)
35 /// \endcond
36
37 //----------------------------------------------------------------------
38 AliMUONGlobalTrigger::AliMUONGlobalTrigger()
39   : TObject(),
40     fSingleLpt(0),
41     fSingleHpt(0),
42       
43     fPairUnlikeLpt(0),
44     fPairUnlikeHpt(0),
45     
46     fPairLikeLpt(0),
47     fPairLikeHpt(0)
48
49   /// Default constructor 
50 }
51
52 //----------------------------------------------------------------------
53 AliMUONGlobalTrigger::AliMUONGlobalTrigger(const AliMUONGlobalTrigger& theMUONGlobalTrig)
54   : TObject(theMUONGlobalTrig),
55   
56     fSingleLpt(theMUONGlobalTrig.fSingleLpt),
57     fSingleHpt(theMUONGlobalTrig.fSingleHpt),
58     
59     fPairUnlikeLpt(theMUONGlobalTrig.fPairUnlikeLpt),
60     fPairUnlikeHpt(theMUONGlobalTrig.fPairUnlikeHpt),
61     
62     fPairLikeLpt(theMUONGlobalTrig.fPairLikeLpt),
63     fPairLikeHpt(theMUONGlobalTrig.fPairLikeHpt)
64 {
65   /// Copy constructor
66 }
67
68 //----------------------------------------------------------------------
69 AliMUONGlobalTrigger::~AliMUONGlobalTrigger()
70 {
71   /// Destructor
72 }
73
74 //----------------------------------------------------------------------
75 AliMUONGlobalTrigger& AliMUONGlobalTrigger::operator=(const AliMUONGlobalTrigger& theMUONGlobalTrig)
76 {
77   /// Assignement operator;
78   /// equal operator (useful for non-pointer member in TClonesArray)
79
80   if (this == &theMUONGlobalTrig)
81     return *this;
82     
83   // base class assignement
84   TObject::operator=(theMUONGlobalTrig);
85
86   fSingleLpt  = theMUONGlobalTrig.fSingleLpt;
87   fSingleHpt  = theMUONGlobalTrig.fSingleHpt;
88   
89   fPairUnlikeLpt  = theMUONGlobalTrig.fPairUnlikeLpt;
90   fPairUnlikeHpt  = theMUONGlobalTrig.fPairUnlikeHpt;
91   
92   fPairLikeLpt    = theMUONGlobalTrig.fPairLikeLpt;
93   fPairLikeHpt    = theMUONGlobalTrig.fPairLikeHpt;
94
95   return *this;
96 }
97
98 //-----------------------------------------------------------
99 void AliMUONGlobalTrigger::SetFromGlobalResponse(UShort_t globalResponse)
100 {
101   /// Set class members from global response
102   /// coming from rawdata & global trigger board
103   /// [US:2, LS:2, Single:2] with [Hpt, Lpt]
104   /// remove Apt
105
106   // don't have the information anymore of the sign
107   fSingleLpt = globalResponse & 0x1;
108   fSingleHpt = (globalResponse >> 1) & 0x1;
109
110   fPairUnlikeLpt = (globalResponse >> 4)  & 0x1;
111   fPairUnlikeHpt = (globalResponse >> 5)  & 0x1;
112   
113   fPairLikeLpt = (globalResponse >> 2)  & 0x1;
114   fPairLikeHpt = (globalResponse >> 3)  & 0x1;
115   
116 }
117
118 //-----------------------------------------------------------
119 UChar_t AliMUONGlobalTrigger::GetGlobalResponse() const
120 {
121   /// Global trigger response
122   /// from class member values
123   /// [US:2, LS:2, Single:2] with [Hpt, Lpt]
124
125   Int_t response = 0;
126
127   if (SingleLpt())     response|= 0x1;
128   if (SingleHpt())     response|= 0x2;
129
130   if (PairLikeLpt())   response|= 0x4;
131   if (PairLikeHpt())   response|= 0x8;
132  
133   if (PairUnlikeLpt()) response|= 0x10;
134   if (PairUnlikeHpt()) response|= 0x20;
135
136   return response;
137 }
138 //----------------------------------------------------------------------
139 void AliMUONGlobalTrigger::Print(Option_t* opt) const
140 {
141   //
142   // Printing Global Trigger information
143   //
144   TString sopt(opt);
145   sopt.ToUpper();
146   if ( sopt.Contains("FULL") ) { 
147
148       printf("=============================================\n");
149       printf(" Global Trigger output       Low pt  High pt\n");
150       printf(" Single                    :\t");
151       printf("%i\t%i\t",SingleLpt(),SingleHpt());
152       printf("\n");
153       
154       printf(" UnlikeSign pair           :\t"); 
155       printf("%i\t%i\t",PairUnlikeLpt(),PairUnlikeHpt());
156       printf("\n");
157       
158       printf(" LikeSign pair             :\t");  
159       printf("%i\t%i\t",PairLikeLpt(),PairLikeHpt());
160       printf("\n");
161       
162       printf("=============================================\n");
163   }  
164 }
165
166