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 **************************************************************************/
16 ///////////////////////////////////////////////////////////////////////////////
18 // This class which defines the trigger bunch-crossing mask
21 ///////////////////////////////////////////////////////////////////////////////
23 #include "AliTriggerBCMask.h"
25 ClassImp(AliTriggerBCMask)
27 //_____________________________________________________________________________
28 AliTriggerBCMask::AliTriggerBCMask():
31 // Default constructor
32 for (Int_t i = 0; i < kNBytesPerBCMask; i++) fBCMask[i] = 0;
35 //_____________________________________________________________________________
36 AliTriggerBCMask::AliTriggerMask( TString & name, UChar_t *mask ):
40 for (Int_t i = 0; i < kNBytesPerBCMask; i++) fBCMask[i] = mask[i];
42 //_____________________________________________________________________________
43 AliTriggerBCMask::~AliTriggerBCMask()
47 //_____________________________________________________________________________
48 AliTriggerBCMask::AliTriggerBCMask( const AliTriggerBCMask& mask ):
52 for (Int_t i = 0; i < kNBytesPerBCMask; i++) fBCMask[i] = mask.fBCMask[i];
55 //______________________________________________________________________________
56 AliTriggerBCMask& AliTriggerBCMask::operator=(const AliTriggerBCMask& mask)
58 // AliTriggerBCMask assignment operator.
61 TNamed::operator=(mask);
62 for (Int_t i = 0; i < kNBytesPerBCMask; i++) fBCMask[i] = mask.fBCMask[i];
67 //_____________________________________________________________________________
68 Bool_t AliTriggerBCMask::GetMask( UShort_t index)
70 // Return true or false whenever the mask is active
71 // for the bunch-crossing # = index
72 UShort_t position = index/8;
73 if (position >= kNBytesPerBCMask) return kFALSE;
74 UChar_t offset = index%8;
75 return (fBCMask[position] & (0x1 << offset));