AliRoot Core  edcc906 (edcc906)
AliTriggerIR.cxx
Go to the documentation of this file.
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 
17 //
18 // Class represents CTP interaction record
19 //
20 // The definition of the IR follows the ALICE internal note:
21 // ALICE-INT-2002-010
22 // The CTP raw-data payload will contain IRs within +- 1 orbit
23 // around the triggered event.
24 // The same IRs are propagated to the ESD (and AOD).
25 //
26 // cvetan.cheshkov@cern.ch 10/07/2008
27 //
29 
30 #include <Riostream.h>
31 
32 #include "AliTriggerIR.h"
33 
34 using std::endl;
35 using std::cout;
36 using std::dec;
37 using std::hex;
38 ClassImp(AliTriggerIR)
39 
40 //_____________________________________________________________________________
42  TObject(),
43  fOrbit(0),
44  fNWord(0),
45  fInt1(NULL),
46  fInt2(NULL),
47  fBC(NULL),
48  fIncomplete(kFALSE),
49  fTransErr(kFALSE),
50  fNWord2(0),
51  fIntRun2(NULL),
52  fBC2(NULL),
53  fIncomplete2(kFALSE),
54  fTransErr2(kFALSE),
55  fDDLflag(0)
56 {
57  // Default constructor
58 }
59 
60 //_____________________________________________________________________________
61 AliTriggerIR::AliTriggerIR(UInt_t orbit, UInt_t nwords, UInt_t *words, Bool_t incomplete, Bool_t transerr):
62  TObject(),
63  fOrbit(orbit),
64  fNWord(nwords),
65  fInt1(NULL),
66  fInt2(NULL),
67  fBC(NULL),
68  fIncomplete(incomplete),
69  fTransErr(transerr),
70  fNWord2(0),
71  fIntRun2(NULL),
72  fBC2(NULL),
73  fIncomplete2(kFALSE),
74  fTransErr2(kFALSE),
75  fDDLflag(1)
76 {
77  // Standard constructor for DDL1 (run1)
78  //
79  // It takes as an input the CTP raw-data payload (words)
80  // corresponding to the IRs
81  if(fNWord){
82  fInt1 = new Bool_t[fNWord];
83  fInt2 = new Bool_t[fNWord];
84  fBC = new UShort_t[fNWord];
85  for(UInt_t i = 0; i < fNWord; i++) {
86  fInt1[i] = words[i] & 0x1000;
87  fInt2[i] = words[i] & 0x2000;
88  fBC[i] = words[i] & 0xFFF;
89  }
90  }
91 }
92 //_____________________________________________________________________________
93 AliTriggerIR::AliTriggerIR(UInt_t orbit, UInt_t nwords, ULong64_t *words, Bool_t incomplete, Bool_t transerr):
94  TObject(),
95  fOrbit(orbit),
96  fNWord(0),
97  fInt1(NULL),
98  fInt2(NULL),
99  fBC(NULL),
100  fIncomplete(kFALSE),
101  fTransErr(kFALSE),
102  fNWord2(nwords),
103  fIntRun2(NULL),
104  fBC2(NULL),
105  fIncomplete2(incomplete),
106  fTransErr2(transerr),
107  fDDLflag(2)
108 {
109  // Standard constructor for DDL2
110  //
111  // It takes as an input the CTP raw-data payload (words)
112  // corresponding to the IRs
113  if(fNWord2){
114  fIntRun2 = new ULong64_t[fNWord2];
115  fBC2 = new UShort_t[fNWord2];
116  for(UInt_t i = 0; i < fNWord2; i++) {
117  fIntRun2[i] = (words[i] & 0xffffffffffff000ull)>>12;
118  fBC2[i] = words[i] & 0xFFFull;
119  }
120  }
121 }
122 
123 //______________________________________________________________________________
125  TObject(rec),
126  fOrbit(rec.fOrbit),
127  fNWord(rec.fNWord),
128  fInt1(NULL),
129  fInt2(NULL),
130  fBC(NULL),
132  fTransErr(rec.fTransErr),
133  fNWord2(rec.fNWord2),
134  fIntRun2(NULL),
135  fBC2(NULL),
137  fTransErr2(rec.fTransErr2),
138  fDDLflag(rec.fDDLflag)
139 {
140  // Copy constructor
141  //
142  if(fNWord){
143  fInt1 = new Bool_t[fNWord];
144  fInt2 = new Bool_t[fNWord];
145  fBC = new UShort_t[fNWord];
146  for (UInt_t i = 0; i < fNWord; i++) {
147  fInt1[i] = rec.fInt1[i];
148  fInt2[i] = rec.fInt2[i];
149  fBC[i] = rec.fBC[i];
150  }
151  }
152  if(fNWord2){
153  fIntRun2 = new ULong64_t[fNWord2];
154  fBC2 = new UShort_t[fNWord2];
155  for (UInt_t i = 0; i < fNWord2; i++) {
156  fIntRun2[i] = rec.fIntRun2[i];
157  fBC2[i] = rec.fBC2[i];
158  }
159  }
160 
161 }
162 //_____________________________________________________________________________
164 {
165  // assignment operator
166  //
167  if(this==&rec) return *this;
168  ((TObject *)this)->operator=(rec);
169 
170  fOrbit = rec.fOrbit;
171  fNWord = rec.fNWord;
172  if(fNWord){
173  if (fInt1) delete fInt1;
174  fInt1 = new Bool_t[fNWord];
175  if (fInt2) delete fInt2;
176  fInt2 = new Bool_t[fNWord];
177  if (fBC) delete fBC;
178  fBC = new UShort_t[fNWord];
179  for (UInt_t i = 0; i < fNWord; i++) {
180  fInt1[i] = rec.fInt1[i];
181  fInt2[i] = rec.fInt2[i];
182  fBC[i] = rec.fBC[i];
183  }
184  }
185  fIncomplete = rec.fIncomplete;
186  fTransErr = rec.fTransErr;
187  fNWord2 = rec.fNWord2;
188  if(fNWord2){
189  if (fIntRun2) delete fIntRun2;
190  fIntRun2 = new ULong64_t[fNWord2];
191  if (fBC2) delete fBC2;
192  fBC2 = new UShort_t[fNWord2];
193  for (UInt_t i = 0; i < fNWord2; i++) {
194  fIntRun2[i] = rec.fIntRun2[i];
195  fBC2[i] = rec.fBC2[i];
196  }
197  }
199  fTransErr2 = rec.fTransErr2;
200  fDDLflag=rec.fDDLflag;
201  return *this;
202 }
203 
204 //______________________________________________________________________________
206 {
207  // Destructor
208  //
209  if (fInt1) delete [] fInt1;
210  if (fInt2) delete [] fInt2;
211  if (fBC) delete [] fBC;
212  if (fIntRun2) delete [] fIntRun2;
213  if (fBC2) delete [] fBC2;
214 }
215 
216 //_____________________________________________________________________________
217 void AliTriggerIR::Print( const Option_t* ) const
218 {
219  // Print
220  cout << "Trigger Interaction Record DDL"<<fDDLflag<<":" << endl;
221  cout << " Orbit: 0x" << hex << fOrbit << dec << endl;
222  cout << " Number of signals: " << fNWord << endl;
223  for (UInt_t i = 0; i < fNWord; i++)
224  cout << " BC: 0x" << hex << fBC[i] << dec << " Interaction1: " << fInt1[i] << " Interaction2: " << fInt2[i] << endl;
225 
226  cout << " Record incomplete: " << fIncomplete << endl;
227  cout << " Transmission Error: " << fTransErr << endl;
228  cout << "IRRun2 Number of signals: " << fNWord2 << endl;
229  for (UInt_t i = 0; i < fNWord2; i++)
230  cout << " BC: 0x" << hex << fBC[i] << " Interaction1: 0x" << fIntRun2[i] << dec << endl;
231 
232  cout << " Record incomplete: " << fIncomplete2 << endl;
233  cout << " Transmission Error: " << fTransErr2 << endl;
234 
235 }
UShort_t * fBC
Definition: AliTriggerIR.h:64
Int_t fDDLflag
Definition: AliTriggerIR.h:72
UInt_t fNWord2
Definition: AliTriggerIR.h:67
UShort_t * fBC2
Definition: AliTriggerIR.h:69
UInt_t fNWord
Definition: AliTriggerIR.h:61
Bool_t fIncomplete
Definition: AliTriggerIR.h:65
Bool_t * fInt2
Definition: AliTriggerIR.h:63
virtual ~AliTriggerIR()
Bool_t fTransErr2
Definition: AliTriggerIR.h:71
void rec(const char *filename="raw.root")
Definition: rec.C:1
Bool_t fIncomplete2
Definition: AliTriggerIR.h:70
UInt_t fOrbit
Definition: AliTriggerIR.h:60
Bool_t * fInt1
Definition: AliTriggerIR.h:62
Bool_t fTransErr
Definition: AliTriggerIR.h:66
virtual void Print(const Option_t *opt="") const
ULong64_t * fIntRun2
Definition: AliTriggerIR.h:68
AliTriggerIR & operator=(const AliTriggerIR &rec)