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 **************************************************************************/
18 ///////////////////////////////////////////////////////////////////////////////
20 // Class to define a Trigger Past Future Protection
22 // name description INT1 INT2
24 // AliTriggerPFProtection sc( "BARREL", "BARREL DET Pb-Pb", "SC","PE" );
25 // sc.SetINTa("PE"); // Peripheral
26 // sc.SetINTb("SC"); // Semicentral
35 ///////////////////////////////////////////////////////////////////////////////
37 #include <Riostream.h>
41 #include <TObjString.h>
44 #include "AliTriggerPFProtection.h"
46 ClassImp( AliTriggerPFProtection )
47 //_____________________________________________________________________________
48 AliTriggerPFProtection::AliTriggerPFProtection() :
50 fINTa(), fINTb(),fINT(),
51 fNa1(0),fNa2(0),fTa(0),
52 fNb1(0),fNb2(0),fTb(0)
54 for(Int_t i=0;i<12;i++)fPFdef[i]=0;
56 AliTriggerPFProtection::AliTriggerPFProtection( TString & name) :
58 fINTa(), fINTb(),fINT(),
59 fNa1(0),fNa2(0),fTa(0),
60 fNb1(0),fNb2(0),fTb(0)
62 for(Int_t i=0;i<12;i++)fPFdef[i]=0;
64 AliTriggerPFProtection::AliTriggerPFProtection( TString & name,TString & inta, TString & intb, TString & interaction ) :
66 fINTa(inta), fINTb(intb),fINT(interaction),
67 fNa1(0),fNa2(0),fTa(0),
68 fNb1(0),fNb2(0),fTb(0)
70 for(Int_t i=0;i<12;i++)fPFdef[i]=0;
72 AliTriggerPFProtection::AliTriggerPFProtection(TString& name,UInt_t* pfdef)
74 fINTa(), fINTb(),fINT(),
75 fNa1(0),fNa2(0),fTa(0),
76 fNb1(0),fNb2(0),fTb(0)
78 for(Int_t i=0;i<12;i++)fPFdef[i]=pfdef[i];
80 //_____________________________________________________________________________
81 void AliTriggerPFProtection::Print( const Option_t* ) const
84 cout << "Trigger Past-Future Protection: " << endl;
85 cout << " Name: " << GetName() << endl;
86 cout << " Interaction_a: " << fINTa.Data() << endl;
87 cout << " Interaction_b: " << fINTb.Data() << endl;
88 cout << " Interaction: " << fINT.Data() << endl;
89 cout << " Na1: " << fNa1 << " Na2: " << fNa2 << " Ta: " << fTa << endl;
90 cout << " Nb1: " << fNb1 << " Nb2: " << fNb2 << " Tb: " << fTb << endl;
91 cout << "PFdef: " << hex;
92 for(Int_t i=0;i<12;i++)cout << " 0x" << fPFdef[i];
96 //_____________________________________________________________________________
97 Bool_t AliTriggerPFProtection::CheckInteractions(TObjArray &interactions) const
99 // Check if the interactions are valid
101 TString logic( GetINTa() );
102 TObjArray* tokens = logic.Tokenize(" !&|()\t");
104 Int_t ntokens = tokens->GetEntriesFast();
105 for( Int_t i=0; i<ntokens; i++ ) {
106 TObjString* iname = (TObjString*)tokens->At( i );
108 if (!interactions.FindObject(iname->String().Data())) {
109 AliError( Form( "The trigger interaction (%s) is not available for past-future protection (%s)",
110 iname->String().Data(), GetName() ) );
118 TString logic( GetINTb() );
119 TObjArray* tokens = logic.Tokenize(" !&|()\t");
121 Int_t ntokens = tokens->GetEntriesFast();
122 for( Int_t i=0; i<ntokens; i++ ) {
123 TObjString* iname = (TObjString*)tokens->At( i );
125 if (!interactions.FindObject(iname->String().Data())) {
126 AliError( Form( "The trigger interaction (%s) is not available for past-future protection (%s)",
127 iname->String().Data(), GetName() ) );
135 TString logic( GetINT() );
136 TObjArray* tokens = logic.Tokenize(" !&|()\t");
138 Int_t ntokens = tokens->GetEntriesFast();
139 for( Int_t i=0; i<ntokens; i++ ) {
140 TObjString* iname = (TObjString*)tokens->At( i );
142 if (!interactions.FindObject(iname->String().Data())) {
143 AliError( Form( "The trigger interaction (%s) is not available for past-future protection (%s)",
144 iname->String().Data(), GetName() ) );