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 )
48 //_____________________________________________________________________________
49 void AliTriggerPFProtection::Print( const Option_t* ) const
52 cout << "Trigger Past-Future Protection: " << endl;
53 cout << " Name: " << GetName() << endl;
54 cout << " Interaction_a: " << fINTa.Data() << endl;
55 cout << " Interaction_b: " << fINTb.Data() << endl;
56 cout << " Interaction: " << fINT.Data() << endl;
57 cout << " Na1: " << fNa1 << " Na2: " << fNa2 << " Ta: " << fTa << endl;
58 cout << " Nb1: " << fNb1 << " Nb2: " << fNb2 << " Tb: " << fTb << endl;
61 //_____________________________________________________________________________
62 Bool_t AliTriggerPFProtection::CheckInteractions(TObjArray &interactions) const
64 // Check if the interactions are valid
66 TString logic( GetINTa() );
67 TObjArray* tokens = logic.Tokenize(" !&|()\t");
69 Int_t ntokens = tokens->GetEntriesFast();
70 for( Int_t i=0; i<ntokens; i++ ) {
71 TObjString* iname = (TObjString*)tokens->At( i );
73 if (!interactions.FindObject(iname->String().Data())) {
74 AliError( Form( "The trigger interaction (%s) is not available for past-future protection (%s)",
75 iname->String().Data(), GetName() ) );
83 TString logic( GetINTb() );
84 TObjArray* tokens = logic.Tokenize(" !&|()\t");
86 Int_t ntokens = tokens->GetEntriesFast();
87 for( Int_t i=0; i<ntokens; i++ ) {
88 TObjString* iname = (TObjString*)tokens->At( i );
90 if (!interactions.FindObject(iname->String().Data())) {
91 AliError( Form( "The trigger interaction (%s) is not available for past-future protection (%s)",
92 iname->String().Data(), GetName() ) );
100 TString logic( GetINT() );
101 TObjArray* tokens = logic.Tokenize(" !&|()\t");
103 Int_t ntokens = tokens->GetEntriesFast();
104 for( Int_t i=0; i<ntokens; i++ ) {
105 TObjString* iname = (TObjString*)tokens->At( i );
107 if (!interactions.FindObject(iname->String().Data())) {
108 AliError( Form( "The trigger interaction (%s) is not available for past-future protection (%s)",
109 iname->String().Data(), GetName() ) );