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
65 fInt1 = new Bool_t[fNWord];
66 fInt2 = new Bool_t[fNWord];
67 fBC = new UShort_t[fNWord];
68 for(UInt_t i = 0; i < fNWord; i++) {
69 fInt1[i] = words[i] & 0x1000;
70 fInt2[i] = words[i] & 0x2000;
71 fBC[i] = words[i] & 0xFFF;
75 //______________________________________________________________________________
76 AliTriggerIR::AliTriggerIR(const AliTriggerIR &rec):
83 fIncomplete(rec.fIncomplete),
84 fTransErr(rec.fTransErr)
88 fInt1 = new Bool_t[fNWord];
89 fInt2 = new Bool_t[fNWord];
90 fBC = new UShort_t[fNWord];
91 for (UInt_t i = 0; i < fNWord; i++) {
92 fInt1[i] = rec.fInt1[i];
93 fInt2[i] = rec.fInt2[i];
98 //_____________________________________________________________________________
99 AliTriggerIR &AliTriggerIR::operator =(const AliTriggerIR& rec)
101 // assignment operator
103 if(this==&rec) return *this;
104 ((TObject *)this)->operator=(rec);
109 if (fInt1) delete fInt1;
110 fInt1 = new Bool_t[fNWord];
111 if (fInt2) delete fInt2;
112 fInt2 = new Bool_t[fNWord];
114 fBC = new UShort_t[fNWord];
115 for (UInt_t i = 0; i < fNWord; i++) {
116 fInt1[i] = rec.fInt1[i];
117 fInt2[i] = rec.fInt2[i];
121 fIncomplete = rec.fIncomplete;
122 fTransErr = rec.fTransErr;
127 //______________________________________________________________________________
128 AliTriggerIR::~AliTriggerIR()
132 if (fInt1) delete fInt1;
133 if (fInt2) delete fInt2;
137 //_____________________________________________________________________________
138 void AliTriggerIR::Print( const Option_t* ) const
141 cout << "Trigger Ineteraction Record:" << endl;
142 cout << " Orbit: 0x" << hex << fOrbit << dec << endl;
143 cout << " Number of signals: " << fNWord << endl;
144 for (UInt_t i = 0; i < fNWord; i++)
145 cout << " BC: 0x" << hex << fBC[i] << dec << " Interaction1: " << fInt1[i] << " Interaction2: " << fInt2[i] << endl;
147 cout << " Record incomplete: " << fIncomplete << endl;
148 cout << " Transmission Error: " << fTransErr << endl;