remove unused code
[u/mrichter/AliRoot.git] / MUON / MUONtrigger / 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 "AliLog.h"
22#include "AliMUONLocalStruct.h"
a9e2aefa 23
3d1463c8 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
3d1463c8 32//-----------------------------------------------------------------------------
5398f946 33
34/// \cond CLASSIMP
925e6570 35ClassImp(AliMUONGlobalTrigger)
5398f946 36/// \endcond
8d7dfec2 37
a9e2aefa 38//----------------------------------------------------------------------
39AliMUONGlobalTrigger::AliMUONGlobalTrigger()
8d7dfec2 40 : TObject(),
8d4fefab 41 fSingleLpt(0),
42 fSingleHpt(0),
43
8d7dfec2 44 fPairUnlikeLpt(0),
45 fPairUnlikeHpt(0),
8d7dfec2 46
47 fPairLikeLpt(0),
ad705f30 48 fPairLikeHpt(0)
8d7dfec2 49{
5398f946 50 /// Default constructor
fcf99e71 51 AliDebug(1,Form("this=%p",this));
41a38dec 52 for (Int_t i = 0; i < 4; i++) fInput[i] = 0;
a9e2aefa 53}
5398f946 54
a9e2aefa 55//----------------------------------------------------------------------
30178c30 56AliMUONGlobalTrigger::AliMUONGlobalTrigger(const AliMUONGlobalTrigger& theMUONGlobalTrig)
5398f946 57 : TObject(theMUONGlobalTrig),
e9b63742 58
8d4fefab 59 fSingleLpt(theMUONGlobalTrig.fSingleLpt),
60 fSingleHpt(theMUONGlobalTrig.fSingleHpt),
5398f946 61
62 fPairUnlikeLpt(theMUONGlobalTrig.fPairUnlikeLpt),
63 fPairUnlikeHpt(theMUONGlobalTrig.fPairUnlikeHpt),
5398f946 64
65 fPairLikeLpt(theMUONGlobalTrig.fPairLikeLpt),
ad705f30 66 fPairLikeHpt(theMUONGlobalTrig.fPairLikeHpt)
5398f946 67{
68 /// Copy constructor
fcf99e71 69 AliDebug(1,Form("this=%p copy ctor",this));
41a38dec 70 for (Int_t i = 0; i < 4; i++) fInput[i] = theMUONGlobalTrig.fInput[i];
fcf99e71 71
5398f946 72}
73
74//----------------------------------------------------------------------
75AliMUONGlobalTrigger::~AliMUONGlobalTrigger()
76{
77 /// Destructor
fcf99e71 78 AliDebug(1,Form("this=%p",this));
e9b63742 79}
80
81//----------------------------------------------------------------------
30178c30 82AliMUONGlobalTrigger& AliMUONGlobalTrigger::operator=(const AliMUONGlobalTrigger& theMUONGlobalTrig)
e9b63742 83{
5398f946 84 /// Assignement operator;
85 /// equal operator (useful for non-pointer member in TClonesArray)
8d7dfec2 86
30178c30 87 if (this == &theMUONGlobalTrig)
e9b63742 88 return *this;
30178c30 89
90 // base class assignement
91 TObject::operator=(theMUONGlobalTrig);
e9b63742 92
8d4fefab 93 fSingleLpt = theMUONGlobalTrig.fSingleLpt;
94 fSingleHpt = theMUONGlobalTrig.fSingleHpt;
e9b63742 95
30178c30 96 fPairUnlikeLpt = theMUONGlobalTrig.fPairUnlikeLpt;
97 fPairUnlikeHpt = theMUONGlobalTrig.fPairUnlikeHpt;
e9b63742 98
30178c30 99 fPairLikeLpt = theMUONGlobalTrig.fPairLikeLpt;
100 fPairLikeHpt = theMUONGlobalTrig.fPairLikeHpt;
e9b63742 101
41a38dec 102 for (Int_t i = 0; i < 4; i++) fInput[i] = theMUONGlobalTrig.fInput[i];
103
e9b63742 104 return *this;
105}
106
1908473e 107//-----------------------------------------------------------
8d4fefab 108void AliMUONGlobalTrigger::SetFromGlobalResponse(UShort_t globalResponse)
1908473e 109{
110 /// Set class members from global response
8d4fefab 111 /// coming from rawdata & global trigger board
1908473e 112 /// [US:2, LS:2, Single:2] with [Hpt, Lpt]
113 /// remove Apt
114
f25f84f5 115 fSingleLpt = (globalResponse >> 1) & 0x1;
116 fSingleHpt = (globalResponse >> 2) & 0x1;
1908473e 117
f25f84f5 118 fPairLikeLpt = (globalResponse >> 3) & 0x1;
119 fPairLikeHpt = (globalResponse >> 4) & 0x1;
1908473e 120
f25f84f5 121 fPairUnlikeLpt = (globalResponse >> 5) & 0x1;
122 fPairUnlikeHpt = (globalResponse >> 6) & 0x1;
1908473e 123
124}
402fb06e 125
1908473e 126//-----------------------------------------------------------
127UChar_t AliMUONGlobalTrigger::GetGlobalResponse() const
128{
129 /// Global trigger response
130 /// from class member values
131 /// [US:2, LS:2, Single:2] with [Hpt, Lpt]
1908473e 132
f25f84f5 133 UChar_t response = 0;
1908473e 134
f25f84f5 135 if (SingleLpt()) response|= 0x2;
136 if (SingleHpt()) response|= 0x4;
1908473e 137
f25f84f5 138 if (PairLikeLpt()) response|= 0x8;
139 if (PairLikeHpt()) response|= 0x10;
79e561d6 140
f25f84f5 141 if (PairUnlikeLpt()) response|= 0x20;
142 if (PairUnlikeHpt()) response|= 0x40;
1908473e 143
144 return response;
1908473e 145}
41a38dec 146
147//-----------------------------------------------------------
a90f8830 148void AliMUONGlobalTrigger::SetFromGlobalInput(const UInt_t *globalInput)
41a38dec 149{
150 /// Global trigger board input
151 /// 4 words each of 32 bits
152
153 for (Int_t i = 0; i < 4; i++) fInput[i] = globalInput[i];
154
155}
156
eba3379e 157//----------------------------------------------------------------------
fcf99e71 158void AliMUONGlobalTrigger::Print(Option_t*) const
eba3379e 159{
71a2d3aa 160 ///
161 /// Printing Global Trigger information
162 ///
ad705f30 163 printf("=============================================\n");
164 printf(" Global Trigger output Low pt High pt\n");
86a4c9ca 165 printf(" Single :\t");
8d4fefab 166 printf("%i\t%i\t",SingleLpt(),SingleHpt());
eba3379e 167 printf("\n");
168
86a4c9ca 169 printf(" UnlikeSign pair :\t");
ad705f30 170 printf("%i\t%i\t",PairUnlikeLpt(),PairUnlikeHpt());
eba3379e 171 printf("\n");
172
86a4c9ca 173 printf(" LikeSign pair :\t");
ad705f30 174 printf("%i\t%i\t",PairLikeLpt(),PairLikeHpt());
eba3379e 175 printf("\n");
176
ad705f30 177 printf("=============================================\n");
fcf99e71 178
eba3379e 179}
402fb06e 180
181