1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
20 #include "AliMUONGlobalTrigger.h"
22 #include "AliMUONLocalStruct.h"
24 /// \class AliMUONGlobalTrigger
25 /// Global Trigger algorithm data output.
26 /// Built from Local and Regional algorithms. \n
27 /// Update for copy & assigment operator,
28 /// add SetGlobalPattern and GetGlobalPattern method for rawdata
30 /// \author Ph. Crochet
33 ClassImp(AliMUONGlobalTrigger)
36 //----------------------------------------------------------------------
37 AliMUONGlobalTrigger::AliMUONGlobalTrigger()
48 /// Default constructor
49 AliDebug(1,Form("this=%p",this));
52 //----------------------------------------------------------------------
53 AliMUONGlobalTrigger::AliMUONGlobalTrigger(const AliMUONGlobalTrigger& theMUONGlobalTrig)
54 : TObject(theMUONGlobalTrig),
56 fSingleLpt(theMUONGlobalTrig.fSingleLpt),
57 fSingleHpt(theMUONGlobalTrig.fSingleHpt),
59 fPairUnlikeLpt(theMUONGlobalTrig.fPairUnlikeLpt),
60 fPairUnlikeHpt(theMUONGlobalTrig.fPairUnlikeHpt),
62 fPairLikeLpt(theMUONGlobalTrig.fPairLikeLpt),
63 fPairLikeHpt(theMUONGlobalTrig.fPairLikeHpt)
66 AliDebug(1,Form("this=%p copy ctor",this));
70 //----------------------------------------------------------------------
71 AliMUONGlobalTrigger::~AliMUONGlobalTrigger()
74 AliDebug(1,Form("this=%p",this));
77 //----------------------------------------------------------------------
78 AliMUONGlobalTrigger& AliMUONGlobalTrigger::operator=(const AliMUONGlobalTrigger& theMUONGlobalTrig)
80 /// Assignement operator;
81 /// equal operator (useful for non-pointer member in TClonesArray)
83 if (this == &theMUONGlobalTrig)
86 // base class assignement
87 TObject::operator=(theMUONGlobalTrig);
89 fSingleLpt = theMUONGlobalTrig.fSingleLpt;
90 fSingleHpt = theMUONGlobalTrig.fSingleHpt;
92 fPairUnlikeLpt = theMUONGlobalTrig.fPairUnlikeLpt;
93 fPairUnlikeHpt = theMUONGlobalTrig.fPairUnlikeHpt;
95 fPairLikeLpt = theMUONGlobalTrig.fPairLikeLpt;
96 fPairLikeHpt = theMUONGlobalTrig.fPairLikeHpt;
101 //-----------------------------------------------------------
102 void AliMUONGlobalTrigger::SetFromGlobalResponse(UShort_t globalResponse)
104 /// Set class members from global response
105 /// coming from rawdata & global trigger board
106 /// [US:2, LS:2, Single:2] with [Hpt, Lpt]
109 // don't have the information anymore of the sign
110 fSingleLpt = globalResponse & 0x1;
111 fSingleHpt = (globalResponse >> 1) & 0x1;
113 fPairUnlikeLpt = (globalResponse >> 4) & 0x1;
114 fPairUnlikeHpt = (globalResponse >> 5) & 0x1;
116 fPairLikeLpt = (globalResponse >> 2) & 0x1;
117 fPairLikeHpt = (globalResponse >> 3) & 0x1;
121 //-----------------------------------------------------------
122 UChar_t AliMUONGlobalTrigger::GetGlobalResponse() const
124 /// Global trigger response
125 /// from class member values
126 /// [US:2, LS:2, Single:2] with [Hpt, Lpt]
130 if (SingleLpt()) response|= 0x1;
131 if (SingleHpt()) response|= 0x2;
133 if (PairLikeLpt()) response|= 0x4;
134 if (PairLikeHpt()) response|= 0x8;
136 if (PairUnlikeLpt()) response|= 0x10;
137 if (PairUnlikeHpt()) response|= 0x20;
141 //----------------------------------------------------------------------
142 void AliMUONGlobalTrigger::Print(Option_t*) const
145 /// Printing Global Trigger information
147 printf("=============================================\n");
148 printf(" Global Trigger output Low pt High pt\n");
149 printf(" Single :\t");
150 printf("%i\t%i\t",SingleLpt(),SingleHpt());
153 printf(" UnlikeSign pair :\t");
154 printf("%i\t%i\t",PairUnlikeLpt(),PairUnlikeHpt());
157 printf(" LikeSign pair :\t");
158 printf("%i\t%i\t",PairLikeLpt(),PairLikeHpt());
161 printf("=============================================\n");