]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/ESD/AliTriggerPFProtection.cxx
Fix for PF, all information saved in ESD
[u/mrichter/AliRoot.git] / STEER / ESD / AliTriggerPFProtection.cxx
CommitLineData
51f6d619 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/* $Id$ */
17
18///////////////////////////////////////////////////////////////////////////////
19//
20// Class to define a Trigger Past Future Protection
21//
22// name description INT1 INT2
23// Ej:
24// AliTriggerPFProtection sc( "BARREL", "BARREL DET Pb-Pb", "SC","PE" );
25// sc.SetINTa("PE"); // Peripheral
26// sc.SetINTb("SC"); // Semicentral
27// sc.SetINT("PE");
28// sc.SetNa1( 5 );
29// sc.SetNa2( 5 );
30// sc.SetTa( 88 );
31// sc.SetNb1( 1 );
32// sc.SetNb2( 0 );
33// sc.SetTb( 88 );
34//
35///////////////////////////////////////////////////////////////////////////////
36
37#include <Riostream.h>
38
39#include <TObject.h>
40#include <TString.h>
41#include <TObjString.h>
42
43#include "AliLog.h"
44#include "AliTriggerPFProtection.h"
45
46ClassImp( AliTriggerPFProtection )
b87d7e83 47//_____________________________________________________________________________
48AliTriggerPFProtection::AliTriggerPFProtection() :
49TNamed(),
50fINTa(), fINTb(),fINT(),
51fNa1(0),fNa2(0),fTa(0),
52fNb1(0),fNb2(0),fTb(0)
53{
54for(Int_t i=0;i<12;i++)pfdef[i]=0;
55}
56AliTriggerPFProtection::AliTriggerPFProtection( TString & name) :
57TNamed(name, name),
58fINTa(), fINTb(),fINT(),
59fNa1(0),fNa2(0),fTa(0),
60fNb1(0),fNb2(0),fTb(0)
61{
62for(Int_t i=0;i<12;i++)pfdef[i]=0;
63}
64AliTriggerPFProtection::AliTriggerPFProtection( TString & name,TString & inta, TString & intb, TString & interaction ) :
65TNamed(name, name),
66fINTa(inta), fINTb(intb),fINT(interaction),
67fNa1(0),fNa2(0),fTa(0),
68fNb1(0),fNb2(0),fTb(0)
69{
70for(Int_t i=0;i<12;i++)pfdef[i]=0;
71}
72AliTriggerPFProtection::AliTriggerPFProtection(TString& name,UInt_t* pfdefin)
73:TNamed(name,name),
74fINTa(), fINTb(),fINT(),
75fNa1(0),fNa2(0),fTa(0),
76fNb1(0),fNb2(0),fTb(0)
77{
78for(Int_t i=0;i<12;i++)pfdef[i]=pfdefin[i];
79}
51f6d619 80//_____________________________________________________________________________
81void AliTriggerPFProtection::Print( const Option_t* ) const
82{
83 // Print
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;
b87d7e83 91 if(1){
92 cout << "pfdef: " << hex;
93 for(Int_t i=0;i<12;i++)cout << " 0x" << pfdef[i];
94 cout << dec << endl;
95 }
51f6d619 96}
97
98//_____________________________________________________________________________
99Bool_t AliTriggerPFProtection::CheckInteractions(TObjArray &interactions) const
100{
101 // Check if the interactions are valid
102 {
103 TString logic( GetINTa() );
104 TObjArray* tokens = logic.Tokenize(" !&|()\t");
105
106 Int_t ntokens = tokens->GetEntriesFast();
107 for( Int_t i=0; i<ntokens; i++ ) {
108 TObjString* iname = (TObjString*)tokens->At( i );
109
110 if (!interactions.FindObject(iname->String().Data())) {
111 AliError( Form( "The trigger interaction (%s) is not available for past-future protection (%s)",
112 iname->String().Data(), GetName() ) );
113 delete tokens;
114 return kFALSE;
115 }
116 }
117 delete tokens;
118 }
119 {
120 TString logic( GetINTb() );
121 TObjArray* tokens = logic.Tokenize(" !&|()\t");
122
123 Int_t ntokens = tokens->GetEntriesFast();
124 for( Int_t i=0; i<ntokens; i++ ) {
125 TObjString* iname = (TObjString*)tokens->At( i );
126
127 if (!interactions.FindObject(iname->String().Data())) {
128 AliError( Form( "The trigger interaction (%s) is not available for past-future protection (%s)",
129 iname->String().Data(), GetName() ) );
130 delete tokens;
131 return kFALSE;
132 }
133 }
134 delete tokens;
135 }
136 {
137 TString logic( GetINT() );
138 TObjArray* tokens = logic.Tokenize(" !&|()\t");
139
140 Int_t ntokens = tokens->GetEntriesFast();
141 for( Int_t i=0; i<ntokens; i++ ) {
142 TObjString* iname = (TObjString*)tokens->At( i );
143
144 if (!interactions.FindObject(iname->String().Data())) {
145 AliError( Form( "The trigger interaction (%s) is not available for past-future protection (%s)",
146 iname->String().Data(), GetName() ) );
147 delete tokens;
148 return kFALSE;
149 }
150 }
151 delete tokens;
152 }
153 return kTRUE;
154}