Formatting changes.
[u/mrichter/AliRoot.git] / MUON / AliMUONGlobalTrigger.cxx
CommitLineData
a9e2aefa 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. *
8c343c7c 14 **************************************************************************/
15
e516b01d 16
30178c30 17/* $Id$ */
a9e2aefa 18
d1525c79 19
a9e2aefa 20#include "AliMUONGlobalTrigger.h"
eba3379e 21#include <assert.h>
22#include "AliLog.h"
23#include "AliMUONLocalStruct.h"
a9e2aefa 24
5398f946 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
925e6570 34ClassImp(AliMUONGlobalTrigger)
5398f946 35/// \endcond
8d7dfec2 36
a9e2aefa 37//----------------------------------------------------------------------
38AliMUONGlobalTrigger::AliMUONGlobalTrigger()
8d7dfec2 39 : TObject(),
8d4fefab 40 fSingleLpt(0),
41 fSingleHpt(0),
42
8d7dfec2 43 fPairUnlikeLpt(0),
44 fPairUnlikeHpt(0),
8d7dfec2 45
46 fPairLikeLpt(0),
ad705f30 47 fPairLikeHpt(0)
8d7dfec2 48{
5398f946 49 /// Default constructor
a9e2aefa 50}
5398f946 51
a9e2aefa 52//----------------------------------------------------------------------
30178c30 53AliMUONGlobalTrigger::AliMUONGlobalTrigger(const AliMUONGlobalTrigger& theMUONGlobalTrig)
5398f946 54 : TObject(theMUONGlobalTrig),
e9b63742 55
8d4fefab 56 fSingleLpt(theMUONGlobalTrig.fSingleLpt),
57 fSingleHpt(theMUONGlobalTrig.fSingleHpt),
5398f946 58
59 fPairUnlikeLpt(theMUONGlobalTrig.fPairUnlikeLpt),
60 fPairUnlikeHpt(theMUONGlobalTrig.fPairUnlikeHpt),
5398f946 61
62 fPairLikeLpt(theMUONGlobalTrig.fPairLikeLpt),
ad705f30 63 fPairLikeHpt(theMUONGlobalTrig.fPairLikeHpt)
5398f946 64{
65 /// Copy constructor
66}
67
68//----------------------------------------------------------------------
69AliMUONGlobalTrigger::~AliMUONGlobalTrigger()
70{
71 /// Destructor
e9b63742 72}
73
74//----------------------------------------------------------------------
30178c30 75AliMUONGlobalTrigger& AliMUONGlobalTrigger::operator=(const AliMUONGlobalTrigger& theMUONGlobalTrig)
e9b63742 76{
5398f946 77 /// Assignement operator;
78 /// equal operator (useful for non-pointer member in TClonesArray)
8d7dfec2 79
30178c30 80 if (this == &theMUONGlobalTrig)
e9b63742 81 return *this;
30178c30 82
83 // base class assignement
84 TObject::operator=(theMUONGlobalTrig);
e9b63742 85
8d4fefab 86 fSingleLpt = theMUONGlobalTrig.fSingleLpt;
87 fSingleHpt = theMUONGlobalTrig.fSingleHpt;
e9b63742 88
30178c30 89 fPairUnlikeLpt = theMUONGlobalTrig.fPairUnlikeLpt;
90 fPairUnlikeHpt = theMUONGlobalTrig.fPairUnlikeHpt;
e9b63742 91
30178c30 92 fPairLikeLpt = theMUONGlobalTrig.fPairLikeLpt;
93 fPairLikeHpt = theMUONGlobalTrig.fPairLikeHpt;
e9b63742 94
95 return *this;
96}
97
1908473e 98//-----------------------------------------------------------
8d4fefab 99void AliMUONGlobalTrigger::SetFromGlobalResponse(UShort_t globalResponse)
1908473e 100{
101 /// Set class members from global response
8d4fefab 102 /// coming from rawdata & global trigger board
1908473e 103 /// [US:2, LS:2, Single:2] with [Hpt, Lpt]
104 /// remove Apt
105
106 // don't have the information anymore of the sign
8d4fefab 107 fSingleLpt = globalResponse & 0x1;
108 fSingleHpt = (globalResponse >> 1) & 0x1;
1908473e 109
110 fPairUnlikeLpt = (globalResponse >> 4) & 0x1;
111 fPairUnlikeHpt = (globalResponse >> 5) & 0x1;
112
113 fPairLikeLpt = (globalResponse >> 2) & 0x1;
114 fPairLikeHpt = (globalResponse >> 3) & 0x1;
115
116}
402fb06e 117
1908473e 118//-----------------------------------------------------------
119UChar_t AliMUONGlobalTrigger::GetGlobalResponse() const
120{
121 /// Global trigger response
122 /// from class member values
123 /// [US:2, LS:2, Single:2] with [Hpt, Lpt]
1908473e 124
79e561d6 125 Int_t response = 0;
1908473e 126
79e561d6 127 if (SingleLpt()) response|= 0x1;
128 if (SingleHpt()) response|= 0x2;
1908473e 129
79e561d6 130 if (PairLikeLpt()) response|= 0x4;
131 if (PairLikeHpt()) response|= 0x8;
132
133 if (PairUnlikeLpt()) response|= 0x10;
134 if (PairUnlikeHpt()) response|= 0x20;
1908473e 135
136 return response;
1908473e 137}
eba3379e 138//----------------------------------------------------------------------
139void 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
ad705f30 148 printf("=============================================\n");
149 printf(" Global Trigger output Low pt High pt\n");
86a4c9ca 150 printf(" Single :\t");
8d4fefab 151 printf("%i\t%i\t",SingleLpt(),SingleHpt());
eba3379e 152 printf("\n");
153
86a4c9ca 154 printf(" UnlikeSign pair :\t");
ad705f30 155 printf("%i\t%i\t",PairUnlikeLpt(),PairUnlikeHpt());
eba3379e 156 printf("\n");
157
86a4c9ca 158 printf(" LikeSign pair :\t");
ad705f30 159 printf("%i\t%i\t",PairLikeLpt(),PairLikeHpt());
eba3379e 160 printf("\n");
161
ad705f30 162 printf("=============================================\n");
eba3379e 163 }
164}
402fb06e 165
166