Line data Source code
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 : // 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 : //
28 : ///////////////////////////////////////////////////////////////////////////////
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 172 : ClassImp(AliTriggerIR)
39 :
40 : //_____________________________________________________________________________
41 : AliTriggerIR::AliTriggerIR():
42 4 : TObject(),
43 4 : fOrbit(0),
44 4 : fNWord(0),
45 4 : fInt1(NULL),
46 4 : fInt2(NULL),
47 4 : fBC(NULL),
48 4 : fIncomplete(kFALSE),
49 4 : fTransErr(kFALSE),
50 4 : fNWord2(0),
51 4 : fIntRun2(NULL),
52 4 : fBC2(NULL),
53 4 : fIncomplete2(kFALSE),
54 4 : fTransErr2(kFALSE),
55 4 : fDDLflag(0)
56 20 : {
57 : // Default constructor
58 8 : }
59 :
60 : //_____________________________________________________________________________
61 : AliTriggerIR::AliTriggerIR(UInt_t orbit, UInt_t nwords, UInt_t *words, Bool_t incomplete, Bool_t transerr):
62 0 : TObject(),
63 0 : fOrbit(orbit),
64 0 : fNWord(nwords),
65 0 : fInt1(NULL),
66 0 : fInt2(NULL),
67 0 : fBC(NULL),
68 0 : fIncomplete(incomplete),
69 0 : fTransErr(transerr),
70 0 : fNWord2(0),
71 0 : fIntRun2(NULL),
72 0 : fBC2(NULL),
73 0 : fIncomplete2(kFALSE),
74 0 : fTransErr2(kFALSE),
75 0 : fDDLflag(1)
76 0 : {
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 0 : if(fNWord){
82 0 : fInt1 = new Bool_t[fNWord];
83 0 : fInt2 = new Bool_t[fNWord];
84 0 : fBC = new UShort_t[fNWord];
85 0 : for(UInt_t i = 0; i < fNWord; i++) {
86 0 : fInt1[i] = words[i] & 0x1000;
87 0 : fInt2[i] = words[i] & 0x2000;
88 0 : fBC[i] = words[i] & 0xFFF;
89 : }
90 0 : }
91 0 : }
92 : //_____________________________________________________________________________
93 : AliTriggerIR::AliTriggerIR(UInt_t orbit, UInt_t nwords, ULong64_t *words, Bool_t incomplete, Bool_t transerr):
94 0 : TObject(),
95 0 : fOrbit(orbit),
96 0 : fNWord(0),
97 0 : fInt1(NULL),
98 0 : fInt2(NULL),
99 0 : fBC(NULL),
100 0 : fIncomplete(kFALSE),
101 0 : fTransErr(kFALSE),
102 0 : fNWord2(nwords),
103 0 : fIntRun2(NULL),
104 0 : fBC2(NULL),
105 0 : fIncomplete2(incomplete),
106 0 : fTransErr2(transerr),
107 0 : fDDLflag(2)
108 0 : {
109 : // Standard constructor for DDL2
110 : //
111 : // It takes as an input the CTP raw-data payload (words)
112 : // corresponding to the IRs
113 0 : if(fNWord2){
114 0 : fIntRun2 = new ULong64_t[fNWord2];
115 0 : fBC2 = new UShort_t[fNWord2];
116 0 : for(UInt_t i = 0; i < fNWord2; i++) {
117 0 : fIntRun2[i] = (words[i] & 0xffffffffffff000ull)>>12;
118 0 : fBC2[i] = words[i] & 0xFFFull;
119 : }
120 0 : }
121 0 : }
122 :
123 : //______________________________________________________________________________
124 : AliTriggerIR::AliTriggerIR(const AliTriggerIR &rec):
125 0 : TObject(rec),
126 0 : fOrbit(rec.fOrbit),
127 0 : fNWord(rec.fNWord),
128 0 : fInt1(NULL),
129 0 : fInt2(NULL),
130 0 : fBC(NULL),
131 0 : fIncomplete(rec.fIncomplete),
132 0 : fTransErr(rec.fTransErr),
133 0 : fNWord2(rec.fNWord2),
134 0 : fIntRun2(NULL),
135 0 : fBC2(NULL),
136 0 : fIncomplete2(rec.fIncomplete2),
137 0 : fTransErr2(rec.fTransErr2),
138 0 : fDDLflag(rec.fDDLflag)
139 0 : {
140 : // Copy constructor
141 : //
142 0 : if(fNWord){
143 0 : fInt1 = new Bool_t[fNWord];
144 0 : fInt2 = new Bool_t[fNWord];
145 0 : fBC = new UShort_t[fNWord];
146 0 : for (UInt_t i = 0; i < fNWord; i++) {
147 0 : fInt1[i] = rec.fInt1[i];
148 0 : fInt2[i] = rec.fInt2[i];
149 0 : fBC[i] = rec.fBC[i];
150 : }
151 0 : }
152 0 : if(fNWord2){
153 0 : fIntRun2 = new ULong64_t[fNWord2];
154 0 : fBC2 = new UShort_t[fNWord2];
155 0 : for (UInt_t i = 0; i < fNWord2; i++) {
156 0 : fIntRun2[i] = rec.fIntRun2[i];
157 0 : fBC2[i] = rec.fBC2[i];
158 : }
159 0 : }
160 :
161 0 : }
162 : //_____________________________________________________________________________
163 : AliTriggerIR &AliTriggerIR::operator =(const AliTriggerIR& rec)
164 : {
165 : // assignment operator
166 : //
167 0 : if(this==&rec) return *this;
168 0 : ((TObject *)this)->operator=(rec);
169 :
170 0 : fOrbit = rec.fOrbit;
171 0 : fNWord = rec.fNWord;
172 0 : if(fNWord){
173 0 : if (fInt1) delete fInt1;
174 0 : fInt1 = new Bool_t[fNWord];
175 0 : if (fInt2) delete fInt2;
176 0 : fInt2 = new Bool_t[fNWord];
177 0 : if (fBC) delete fBC;
178 0 : fBC = new UShort_t[fNWord];
179 0 : for (UInt_t i = 0; i < fNWord; i++) {
180 0 : fInt1[i] = rec.fInt1[i];
181 0 : fInt2[i] = rec.fInt2[i];
182 0 : fBC[i] = rec.fBC[i];
183 : }
184 0 : }
185 0 : fIncomplete = rec.fIncomplete;
186 0 : fTransErr = rec.fTransErr;
187 0 : fNWord2 = rec.fNWord2;
188 0 : if(fNWord2){
189 0 : if (fIntRun2) delete fIntRun2;
190 0 : fIntRun2 = new ULong64_t[fNWord2];
191 0 : if (fBC2) delete fBC2;
192 0 : fBC2 = new UShort_t[fNWord2];
193 0 : for (UInt_t i = 0; i < fNWord2; i++) {
194 0 : fIntRun2[i] = rec.fIntRun2[i];
195 0 : fBC2[i] = rec.fBC2[i];
196 : }
197 0 : }
198 0 : fIncomplete2 = rec.fIncomplete2;
199 0 : fTransErr2 = rec.fTransErr2;
200 0 : fDDLflag=rec.fDDLflag;
201 0 : return *this;
202 0 : }
203 :
204 : //______________________________________________________________________________
205 : AliTriggerIR::~AliTriggerIR()
206 24 : {
207 : // Destructor
208 : //
209 4 : if (fInt1) delete [] fInt1;
210 4 : if (fInt2) delete [] fInt2;
211 4 : if (fBC) delete [] fBC;
212 4 : if (fIntRun2) delete [] fIntRun2;
213 4 : if (fBC2) delete [] fBC2;
214 12 : }
215 :
216 : //_____________________________________________________________________________
217 : void AliTriggerIR::Print( const Option_t* ) const
218 : {
219 : // Print
220 0 : cout << "Trigger Interaction Record DDL"<<fDDLflag<<":" << endl;
221 0 : cout << " Orbit: 0x" << hex << fOrbit << dec << endl;
222 0 : cout << " Number of signals: " << fNWord << endl;
223 0 : for (UInt_t i = 0; i < fNWord; i++)
224 0 : cout << " BC: 0x" << hex << fBC[i] << dec << " Interaction1: " << fInt1[i] << " Interaction2: " << fInt2[i] << endl;
225 :
226 0 : cout << " Record incomplete: " << fIncomplete << endl;
227 0 : cout << " Transmission Error: " << fTransErr << endl;
228 0 : cout << "IRRun2 Number of signals: " << fNWord2 << endl;
229 0 : for (UInt_t i = 0; i < fNWord2; i++)
230 0 : cout << " BC: 0x" << hex << fBC[i] << " Interaction1: 0x" << fIntRun2[i] << dec << endl;
231 :
232 0 : cout << " Record incomplete: " << fIncomplete2 << endl;
233 0 : cout << " Transmission Error: " << fTransErr2 << endl;
234 :
235 0 : }
|