]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/AliTriggerBCMask.cxx
New feature in AliSimulation which allows to write a separate raw-data file with...
[u/mrichter/AliRoot.git] / STEER / AliTriggerBCMask.cxx
CommitLineData
202e63df 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//
18// This class which defines the trigger bunch-crossing mask
19//
20//
21///////////////////////////////////////////////////////////////////////////////
51f6d619 22#include <Riostream.h>
202e63df 23
24#include "AliTriggerBCMask.h"
25
26ClassImp(AliTriggerBCMask)
27
28//_____________________________________________________________________________
29AliTriggerBCMask::AliTriggerBCMask():
30 TNamed()
31{
32 // Default constructor
33 for (Int_t i = 0; i < kNBytesPerBCMask; i++) fBCMask[i] = 0;
34}
35
36//_____________________________________________________________________________
51f6d619 37AliTriggerBCMask::AliTriggerBCMask( TString & name ):
202e63df 38 TNamed( name, name )
39{
40 // Constructor
51f6d619 41 for (Int_t i = 0; i < kNBytesPerBCMask; i++) fBCMask[i] = 255;
42}
43
44//_____________________________________________________________________________
45AliTriggerBCMask::AliTriggerBCMask( TString & name, TString & mask ):
46 TNamed( name, mask )
47{
48 // Constructor
49 CreateMask(mask);
202e63df 50}
51//_____________________________________________________________________________
52AliTriggerBCMask::~AliTriggerBCMask()
53{
54 // Destructor
55}
56//_____________________________________________________________________________
57AliTriggerBCMask::AliTriggerBCMask( const AliTriggerBCMask& mask ):
51f6d619 58 TNamed( mask )
202e63df 59{
60 // Copy constructor
61 for (Int_t i = 0; i < kNBytesPerBCMask; i++) fBCMask[i] = mask.fBCMask[i];
62}
63
64//______________________________________________________________________________
65AliTriggerBCMask& AliTriggerBCMask::operator=(const AliTriggerBCMask& mask)
66{
67 // AliTriggerBCMask assignment operator.
68
69 if (this != &mask) {
70 TNamed::operator=(mask);
71 for (Int_t i = 0; i < kNBytesPerBCMask; i++) fBCMask[i] = mask.fBCMask[i];
72 }
73 return *this;
74}
75
76//_____________________________________________________________________________
51f6d619 77Bool_t AliTriggerBCMask::GetMask( UShort_t index) const
202e63df 78{
79 // Return true or false whenever the mask is active
80 // for the bunch-crossing # = index
81 UShort_t position = index/8;
82 if (position >= kNBytesPerBCMask) return kFALSE;
83 UChar_t offset = index%8;
84 return (fBCMask[position] & (0x1 << offset));
85}
51f6d619 86
87//_____________________________________________________________________________
88void AliTriggerBCMask::Print( const Option_t* ) const
89{
90 // Print
91 cout << "Trigger bunch-crossing mask:" << endl;
92 cout << " Name: " << GetName() << endl;
93 cout << " Mask: " << GetTitle() << endl;
94}