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 //-----------------------------------------------------------------------------
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
31 /// \author Ph. Crochet
32 //-----------------------------------------------------------------------------
35 ClassImp(AliMUONGlobalTrigger)
38 //----------------------------------------------------------------------
39 AliMUONGlobalTrigger::AliMUONGlobalTrigger()
50 /// Default constructor
51 AliDebug(1,Form("this=%p",this));
54 //----------------------------------------------------------------------
55 AliMUONGlobalTrigger::AliMUONGlobalTrigger(const AliMUONGlobalTrigger& theMUONGlobalTrig)
56 : TObject(theMUONGlobalTrig),
58 fSingleLpt(theMUONGlobalTrig.fSingleLpt),
59 fSingleHpt(theMUONGlobalTrig.fSingleHpt),
61 fPairUnlikeLpt(theMUONGlobalTrig.fPairUnlikeLpt),
62 fPairUnlikeHpt(theMUONGlobalTrig.fPairUnlikeHpt),
64 fPairLikeLpt(theMUONGlobalTrig.fPairLikeLpt),
65 fPairLikeHpt(theMUONGlobalTrig.fPairLikeHpt)
68 AliDebug(1,Form("this=%p copy ctor",this));
72 //----------------------------------------------------------------------
73 AliMUONGlobalTrigger::~AliMUONGlobalTrigger()
76 AliDebug(1,Form("this=%p",this));
79 //----------------------------------------------------------------------
80 AliMUONGlobalTrigger& AliMUONGlobalTrigger::operator=(const AliMUONGlobalTrigger& theMUONGlobalTrig)
82 /// Assignement operator;
83 /// equal operator (useful for non-pointer member in TClonesArray)
85 if (this == &theMUONGlobalTrig)
88 // base class assignement
89 TObject::operator=(theMUONGlobalTrig);
91 fSingleLpt = theMUONGlobalTrig.fSingleLpt;
92 fSingleHpt = theMUONGlobalTrig.fSingleHpt;
94 fPairUnlikeLpt = theMUONGlobalTrig.fPairUnlikeLpt;
95 fPairUnlikeHpt = theMUONGlobalTrig.fPairUnlikeHpt;
97 fPairLikeLpt = theMUONGlobalTrig.fPairLikeLpt;
98 fPairLikeHpt = theMUONGlobalTrig.fPairLikeHpt;
103 //-----------------------------------------------------------
104 void AliMUONGlobalTrigger::SetFromGlobalResponse(UShort_t globalResponse)
106 /// Set class members from global response
107 /// coming from rawdata & global trigger board
108 /// [US:2, LS:2, Single:2] with [Hpt, Lpt]
111 // don't have the information anymore of the sign
112 fSingleLpt = globalResponse & 0x1;
113 fSingleHpt = (globalResponse >> 1) & 0x1;
115 fPairUnlikeLpt = (globalResponse >> 4) & 0x1;
116 fPairUnlikeHpt = (globalResponse >> 5) & 0x1;
118 fPairLikeLpt = (globalResponse >> 2) & 0x1;
119 fPairLikeHpt = (globalResponse >> 3) & 0x1;
123 //-----------------------------------------------------------
124 UChar_t AliMUONGlobalTrigger::GetGlobalResponse() const
126 /// Global trigger response
127 /// from class member values
128 /// [US:2, LS:2, Single:2] with [Hpt, Lpt]
132 if (SingleLpt()) response|= 0x1;
133 if (SingleHpt()) response|= 0x2;
135 if (PairLikeLpt()) response|= 0x4;
136 if (PairLikeHpt()) response|= 0x8;
138 if (PairUnlikeLpt()) response|= 0x10;
139 if (PairUnlikeHpt()) response|= 0x20;
143 //----------------------------------------------------------------------
144 void AliMUONGlobalTrigger::Print(Option_t*) const
147 /// Printing Global Trigger information
149 printf("=============================================\n");
150 printf(" Global Trigger output Low pt High pt\n");
151 printf(" Single :\t");
152 printf("%i\t%i\t",SingleLpt(),SingleHpt());
155 printf(" UnlikeSign pair :\t");
156 printf("%i\t%i\t",PairUnlikeLpt(),PairUnlikeHpt());
159 printf(" LikeSign pair :\t");
160 printf("%i\t%i\t",PairLikeLpt(),PairLikeHpt());
163 printf("=============================================\n");