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"
34 ClassImp(AliTriggerIR)
36 //_____________________________________________________________________________
37 AliTriggerIR::AliTriggerIR():
47 // Default constructor
50 //_____________________________________________________________________________
51 AliTriggerIR::AliTriggerIR(UInt_t orbit, UInt_t nwords, UInt_t *words, Bool_t incomplete, Bool_t transerr):
58 fIncomplete(incomplete),
61 // Standard constructor
63 // It takes as an input the CTP raw-data payload (words)
64 // corresponding to the IRs
66 fInt1 = new Bool_t[fNWord];
67 fInt2 = new Bool_t[fNWord];
68 fBC = new UShort_t[fNWord];
69 for(UInt_t i = 0; i < fNWord; i++) {
70 fInt1[i] = words[i] & 0x1000;
71 fInt2[i] = words[i] & 0x2000;
72 fBC[i] = words[i] & 0xFFF;
77 //______________________________________________________________________________
78 AliTriggerIR::AliTriggerIR(const AliTriggerIR &rec):
85 fIncomplete(rec.fIncomplete),
86 fTransErr(rec.fTransErr)
91 fInt1 = new Bool_t[fNWord];
92 fInt2 = new Bool_t[fNWord];
93 fBC = new UShort_t[fNWord];
94 for (UInt_t i = 0; i < fNWord; i++) {
95 fInt1[i] = rec.fInt1[i];
96 fInt2[i] = rec.fInt2[i];
101 //_____________________________________________________________________________
102 AliTriggerIR &AliTriggerIR::operator =(const AliTriggerIR& rec)
104 // assignment operator
106 if(this==&rec) return *this;
107 ((TObject *)this)->operator=(rec);
112 if (fInt1) delete fInt1;
113 fInt1 = new Bool_t[fNWord];
114 if (fInt2) delete fInt2;
115 fInt2 = new Bool_t[fNWord];
117 fBC = new UShort_t[fNWord];
118 for (UInt_t i = 0; i < fNWord; i++) {
119 fInt1[i] = rec.fInt1[i];
120 fInt2[i] = rec.fInt2[i];
124 fIncomplete = rec.fIncomplete;
125 fTransErr = rec.fTransErr;
129 //______________________________________________________________________________
130 AliTriggerIR::~AliTriggerIR()
134 if (fInt1) delete [] fInt1;
135 if (fInt2) delete [] fInt2;
136 if (fBC) delete [] fBC;
139 //_____________________________________________________________________________
140 void AliTriggerIR::Print( const Option_t* ) const
143 cout << "Trigger Interaction Record:" << endl;
144 cout << " Orbit: 0x" << hex << fOrbit << dec << endl;
145 cout << " Number of signals: " << fNWord << endl;
146 for (UInt_t i = 0; i < fNWord; i++)
147 cout << " BC: 0x" << hex << fBC[i] << dec << " Interaction1: " << fInt1[i] << " Interaction2: " << fInt2[i] << endl;
149 cout << " Record incomplete: " << fIncomplete << endl;
150 cout << " Transmission Error: " << fTransErr << endl;