AliRoot Core  v5-06-30 (35d6c57)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliMUONGlobalTrigger.cxx
Go to the documentation of this file.
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 //-----------------------------------------------------------------------------
32 //-----------------------------------------------------------------------------
33 
37 
38 //----------------------------------------------------------------------
40  : TObject(),
41  fSingleLpt(0),
42  fSingleHpt(0),
43 
44  fPairUnlikeLpt(0),
45  fPairUnlikeHpt(0),
46 
47  fPairLikeLpt(0),
48  fPairLikeHpt(0)
49 {
51  AliDebug(1,Form("this=%p",this));
52  for (Int_t i = 0; i < 4; i++) fInput[i] = 0;
53 }
54 
55 //----------------------------------------------------------------------
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 {
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 //----------------------------------------------------------------------
76 {
78  AliDebug(1,Form("this=%p",this));
79 }
80 
81 //----------------------------------------------------------------------
83 {
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 //-----------------------------------------------------------
108 void AliMUONGlobalTrigger::SetFromGlobalResponse(UShort_t globalResponse)
109 {
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 //-----------------------------------------------------------
128 {
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 //-----------------------------------------------------------
148 void AliMUONGlobalTrigger::SetFromGlobalInput(const UInt_t *globalInput)
149 {
152 
153  for (Int_t i = 0; i < 4; i++) fInput[i] = globalInput[i];
154 
155 }
156 
157 //----------------------------------------------------------------------
158 void AliMUONGlobalTrigger::Print(Option_t*) const
159 {
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 
void SetFromGlobalInput(const UInt_t *globalInput)
printf("Chi2/npoints = %f\n", TMath::Sqrt(chi2/npoints))
void SetFromGlobalResponse(UShort_t globalResponse)
UInt_t fInput[4]
Global input to the global trigger board.
virtual void Print(Option_t *opt="") const
Int_t fSingleHpt
Number of Single High pt.
Int_t fSingleLpt
Number of Single Low pt.
Int_t SingleLpt() const
Return number of Single Low pt.
ClassImp(TPCGenInfo)
Definition: AliTPCCmpNG.C:254
Int_t fPairLikeHpt
Number of Like sign pair High pt.
Int_t fPairUnlikeLpt
Number of Unlike sign pair Low pt.
AliMUONGlobalTrigger & operator=(const AliMUONGlobalTrigger &rhs)
Int_t fPairLikeLpt
Number of Like sign pair Low pt.
Int_t PairLikeHpt() const
Return number of Like sign pair High pt.
UChar_t GetGlobalResponse() const
Global trigger object.
Int_t PairLikeLpt() const
Return number of Like sign pair Low pt.
Int_t SingleHpt() const
Return number of Single High pt.
Int_t fPairUnlikeHpt
Number of Unlike sign pair High pt.
Int_t PairUnlikeLpt() const
Return number of Unlike sign pair Low pt.
Int_t PairUnlikeHpt() const
Return number of Unlike sign pair High pt.