LCOV - code coverage report
Current view: top level - MUON/MUONtrigger - AliMUONGlobalTrigger.cxx (source / functions) Hit Total Coverage
Test: coverage.info Lines: 42 67 62.7 %
Date: 2016-06-14 17:26:59 Functions: 11 13 84.6 %

          Line data    Source code
       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
      35          18 : ClassImp(AliMUONGlobalTrigger)
      36             : /// \endcond
      37             : 
      38             : //----------------------------------------------------------------------
      39             : AliMUONGlobalTrigger::AliMUONGlobalTrigger()
      40         727 :   : TObject(),
      41         727 :     fSingleLpt(0),
      42         727 :     fSingleHpt(0),
      43             :       
      44         727 :     fPairUnlikeLpt(0),
      45         727 :     fPairUnlikeHpt(0),
      46             :     
      47         727 :     fPairLikeLpt(0),
      48         727 :     fPairLikeHpt(0)
      49        3635 : { 
      50             :   /// Default constructor 
      51        3635 :       AliDebug(1,Form("this=%p",this));
      52        7270 :       for (Int_t i = 0; i < 4; i++) fInput[i] = 0;
      53        1454 : }
      54             : 
      55             : //----------------------------------------------------------------------
      56             : AliMUONGlobalTrigger::AliMUONGlobalTrigger(const AliMUONGlobalTrigger& theMUONGlobalTrig)
      57         713 :   : TObject(theMUONGlobalTrig),
      58             :   
      59         713 :     fSingleLpt(theMUONGlobalTrig.fSingleLpt),
      60         713 :     fSingleHpt(theMUONGlobalTrig.fSingleHpt),
      61             :     
      62         713 :     fPairUnlikeLpt(theMUONGlobalTrig.fPairUnlikeLpt),
      63         713 :     fPairUnlikeHpt(theMUONGlobalTrig.fPairUnlikeHpt),
      64             :     
      65         713 :     fPairLikeLpt(theMUONGlobalTrig.fPairLikeLpt),
      66         713 :     fPairLikeHpt(theMUONGlobalTrig.fPairLikeHpt)
      67        3565 : {
      68             :   /// Copy constructor
      69        3565 :       AliDebug(1,Form("this=%p copy ctor",this));
      70        7130 :       for (Int_t i = 0; i < 4; i++) fInput[i] = theMUONGlobalTrig.fInput[i];
      71             : 
      72        1426 : }
      73             : 
      74             : //----------------------------------------------------------------------
      75             : AliMUONGlobalTrigger::~AliMUONGlobalTrigger()
      76        2984 : {
      77             :   /// Destructor
      78        3675 :   AliDebug(1,Form("this=%p",this));
      79        1492 : }
      80             : 
      81             : //----------------------------------------------------------------------
      82             : AliMUONGlobalTrigger& AliMUONGlobalTrigger::operator=(const AliMUONGlobalTrigger& theMUONGlobalTrig)
      83             : {
      84             :   /// Assignement operator;
      85             :   /// equal operator (useful for non-pointer member in TClonesArray)
      86             : 
      87           0 :   if (this == &theMUONGlobalTrig)
      88           0 :     return *this;
      89             :     
      90             :   // base class assignement
      91           0 :   TObject::operator=(theMUONGlobalTrig);
      92             : 
      93           0 :   fSingleLpt  = theMUONGlobalTrig.fSingleLpt;
      94           0 :   fSingleHpt  = theMUONGlobalTrig.fSingleHpt;
      95             :   
      96           0 :   fPairUnlikeLpt  = theMUONGlobalTrig.fPairUnlikeLpt;
      97           0 :   fPairUnlikeHpt  = theMUONGlobalTrig.fPairUnlikeHpt;
      98             :   
      99           0 :   fPairLikeLpt    = theMUONGlobalTrig.fPairLikeLpt;
     100           0 :   fPairLikeHpt    = theMUONGlobalTrig.fPairLikeHpt;
     101             : 
     102           0 :   for (Int_t i = 0; i < 4; i++) fInput[i] = theMUONGlobalTrig.fInput[i];
     103             : 
     104           0 :   return *this;
     105           0 : }
     106             : 
     107             : //-----------------------------------------------------------
     108             : void 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        1426 :   fSingleLpt = (globalResponse >> 1) & 0x1;
     116         713 :   fSingleHpt = (globalResponse >> 2) & 0x1;
     117             : 
     118         713 :   fPairLikeLpt = (globalResponse >> 3)  & 0x1;
     119         713 :   fPairLikeHpt = (globalResponse >> 4)  & 0x1;
     120             :   
     121         713 :   fPairUnlikeLpt = (globalResponse >> 5)  & 0x1;
     122         713 :   fPairUnlikeHpt = (globalResponse >> 6)  & 0x1;
     123             :   
     124         713 : }
     125             : 
     126             : //-----------------------------------------------------------
     127             : UChar_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        2142 :   if (SingleLpt())     response|= 0x2;
     136        1428 :   if (SingleHpt())     response|= 0x4;
     137             : 
     138         717 :   if (PairLikeLpt())   response|= 0x8;
     139         717 :   if (PairLikeHpt())   response|= 0x10;
     140             :  
     141         720 :   if (PairUnlikeLpt()) response|= 0x20;
     142         720 :   if (PairUnlikeHpt()) response|= 0x40;
     143             : 
     144         714 :   return response;
     145             : }
     146             : 
     147             : //-----------------------------------------------------------
     148             : void AliMUONGlobalTrigger::SetFromGlobalInput(const UInt_t *globalInput)
     149             : {
     150             :   /// Global trigger board input
     151             :   /// 4 words each of 32 bits
     152             : 
     153        7843 :   for (Int_t i = 0; i < 4; i++) fInput[i] = globalInput[i];
     154             : 
     155         713 : }
     156             : 
     157             : //----------------------------------------------------------------------
     158             : void AliMUONGlobalTrigger::Print(Option_t*) const
     159             : {
     160             :   ///
     161             :   /// Printing Global Trigger information
     162             :   ///
     163           0 :       printf("=============================================\n");
     164           0 :       printf(" Global Trigger output       Low pt  High pt\n");
     165           0 :       printf(" Single                    :\t");
     166           0 :       printf("%i\t%i\t",SingleLpt(),SingleHpt());
     167           0 :       printf("\n");
     168             :       
     169           0 :       printf(" UnlikeSign pair           :\t"); 
     170           0 :       printf("%i\t%i\t",PairUnlikeLpt(),PairUnlikeHpt());
     171           0 :       printf("\n");
     172             :       
     173           0 :       printf(" LikeSign pair             :\t");  
     174           0 :       printf("%i\t%i\t",PairLikeLpt(),PairLikeHpt());
     175           0 :       printf("\n");
     176             :       
     177           0 :       printf("=============================================\n");
     178             : 
     179           0 : }
     180             : 
     181             : 

Generated by: LCOV version 1.11