1 // @(#)alimdc:$Name$:$Id$
2 // Author: Fons Rademakers 26/11/99
4 /**************************************************************************
5 * Copyright(c) 1998-2003, ALICE Experiment at CERN, All rights reserved. *
7 * Author: The ALICE Off-line Project. *
8 * Contributors are mentioned in the code where appropriate. *
10 * Permission to use, copy, modify and distribute this software and its *
11 * documentation strictly for non-commercial purposes is hereby granted *
12 * without fee, provided that the above copyright notice appears in all *
13 * copies and that both the copyright notice and this permission notice *
14 * appear in the supporting documentation. The authors make no claims *
15 * about the suitability of this software for any purpose. It is *
16 * provided "as is" without express or implied warranty. *
17 **************************************************************************/
19 //////////////////////////////////////////////////////////////////////////
21 // AliRawEventHeader //
23 //////////////////////////////////////////////////////////////////////////
29 #include "AliRawEventHeader.h"
32 ClassImp(AliRawEventHeader)
35 //______________________________________________________________________________
36 Bool_t AliRawEventHeader::DataIsSwapped() const
38 // Returns true if event data is swapped.
41 if (TEST_SYSTEM_ATTRIBUTE(fTypeAttribute, ATTR_EVENT_SWAPPED))
47 //______________________________________________________________________________
48 void AliRawEventHeader::Swap()
53 fSize = net2host(fSize);
54 fMagic = net2host(fMagic);
55 fHeadLen = net2host(fHeadLen);
56 fVersion = net2host(fVersion);
57 fType = net2host(fType);
58 fRunNb = net2host(fRunNb);
59 for (int i = 0; i < kIdWords; i++)
60 fId[i] = net2host(fId[i]);
61 for (int i = 0; i < kTriggerWords; i++)
62 fTriggerPattern[i] = net2host(fTriggerPattern[i]);
63 for (int i = 0; i < kDetectorWords; i++)
64 fDetectorPattern[i] = net2host(fDetectorPattern[i]);
65 for (int i = 0; i < kAttributeWords; i++)
66 fTypeAttribute[i] = net2host(fTypeAttribute[i]);
67 fLDCId = net2host(fLDCId);
68 fGDCId = net2host(fGDCId);
72 //______________________________________________________________________________
73 UInt_t AliRawEventHeader::GetEventInRun() const
75 // Get event number in run. Correct for fixed target mode which is used
76 // in the Data Challenge Setup.
79 if (!TEST_SYSTEM_ATTRIBUTE(fTypeAttribute, ATTR_ORBIT_BC)) {
80 return EVENT_ID_GET_NB_IN_RUN(fId);
86 //______________________________________________________________________________
87 const char *AliRawEventHeader::GetTypeName() const
89 // Get event type as a string.
93 return "START_OF_RUN";
98 case kStartOfRunFiles:
99 return "START_OF_RUN_FILES";
102 return "END_OF_RUN_FILES";
105 return "START_OF_BURST";
108 return "END_OF_BURST";
111 return "PHYSICS_EVENT";
113 case kCalibrationEvent:
114 return "CALIBRATION_EVENT";
117 return "EVENT_FORMAT_ERROR";
120 return "*** UNKNOWN EVENT TYPE ***";