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