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 **************************************************************************/
16 ///////////////////////////////////////////////////////////////////////////////
18 // Class represents CTP interaction record
20 // The definition of the IR follows the ALICE internal note:
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).
26 // cvetan.cheshkov@cern.ch 10/07/2008
28 ///////////////////////////////////////////////////////////////////////////////
30 #include <Riostream.h>
32 #include "AliTriggerIR.h"
38 ClassImp(AliTriggerIR)
40 //_____________________________________________________________________________
41 AliTriggerIR::AliTriggerIR():
51 // Default constructor
54 //_____________________________________________________________________________
55 AliTriggerIR::AliTriggerIR(UInt_t orbit, UInt_t nwords, UInt_t *words, Bool_t incomplete, Bool_t transerr):
62 fIncomplete(incomplete),
65 // Standard constructor
67 // It takes as an input the CTP raw-data payload (words)
68 // corresponding to the IRs
70 fInt1 = new Bool_t[fNWord];
71 fInt2 = new Bool_t[fNWord];
72 fBC = new UShort_t[fNWord];
73 for(UInt_t i = 0; i < fNWord; i++) {
74 fInt1[i] = words[i] & 0x1000;
75 fInt2[i] = words[i] & 0x2000;
76 fBC[i] = words[i] & 0xFFF;
81 //______________________________________________________________________________
82 AliTriggerIR::AliTriggerIR(const AliTriggerIR &rec):
89 fIncomplete(rec.fIncomplete),
90 fTransErr(rec.fTransErr)
95 fInt1 = new Bool_t[fNWord];
96 fInt2 = new Bool_t[fNWord];
97 fBC = new UShort_t[fNWord];
98 for (UInt_t i = 0; i < fNWord; i++) {
99 fInt1[i] = rec.fInt1[i];
100 fInt2[i] = rec.fInt2[i];
105 //_____________________________________________________________________________
106 AliTriggerIR &AliTriggerIR::operator =(const AliTriggerIR& rec)
108 // assignment operator
110 if(this==&rec) return *this;
111 ((TObject *)this)->operator=(rec);
116 if (fInt1) delete fInt1;
117 fInt1 = new Bool_t[fNWord];
118 if (fInt2) delete fInt2;
119 fInt2 = new Bool_t[fNWord];
121 fBC = new UShort_t[fNWord];
122 for (UInt_t i = 0; i < fNWord; i++) {
123 fInt1[i] = rec.fInt1[i];
124 fInt2[i] = rec.fInt2[i];
128 fIncomplete = rec.fIncomplete;
129 fTransErr = rec.fTransErr;
133 //______________________________________________________________________________
134 AliTriggerIR::~AliTriggerIR()
138 if (fInt1) delete [] fInt1;
139 if (fInt2) delete [] fInt2;
140 if (fBC) delete [] fBC;
143 //_____________________________________________________________________________
144 void AliTriggerIR::Print( const Option_t* ) const
147 cout << "Trigger Interaction Record:" << endl;
148 cout << " Orbit: 0x" << hex << fOrbit << dec << endl;
149 cout << " Number of signals: " << fNWord << endl;
150 for (UInt_t i = 0; i < fNWord; i++)
151 cout << " BC: 0x" << hex << fBC[i] << dec << " Interaction1: " << fInt1[i] << " Interaction2: " << fInt2[i] << endl;
153 cout << " Record incomplete: " << fIncomplete << endl;
154 cout << " Transmission Error: " << fTransErr << endl;