Removing obsolete class and macros from mapping
[u/mrichter/AliRoot.git] / STEER / AliESDHeader.cxx
CommitLineData
d5ebf00e 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// Implementation of Class AliESDHeader
18// Header data
19// for the ESD
20// Origin: Christian Klein-Boesing, CERN, Christian.Klein-Boesing@cern.ch
21//-------------------------------------------------------------------------
22
23#include "AliESDHeader.h"
bf1f98c4 24#include "AliTriggerScalersESD.h"
25#include "AliTriggerScalersRecordESD.h"
8258ca76 26#include "AliTriggerIR.h"
d5ebf00e 27
28ClassImp(AliESDHeader)
29
30//______________________________________________________________________________
31AliESDHeader::AliESDHeader() :
9ae2e5e6 32 AliVHeader(),
d5ebf00e 33 fTriggerMask(0),
34 fOrbitNumber(0),
35 fTimeStamp(0),
36 fEventType(0),
4f036e6e 37 fPeriodNumber(0),
d5ebf00e 38 fEventNumberInFile(0),
39 fBunchCrossNumber(0),
53eef471 40 fTriggerCluster(0),
41 fL0TriggerInputs(0),
42 fL1TriggerInputs(0),
bf1f98c4 43 fL2TriggerInputs(0),
8258ca76 44 fTriggerScalers(),
45 fIRArray("AliTriggerIR",3)
d5ebf00e 46{
9ae2e5e6 47 // default constructor
48
49 SetName("AliESDHeader");
50}
9ae2e5e6 51AliESDHeader::~AliESDHeader()
52{
53 // destructor
d5ebf00e 54}
55
56
57AliESDHeader::AliESDHeader(const AliESDHeader &header) :
9ae2e5e6 58 AliVHeader(header),
d5ebf00e 59 fTriggerMask(header.fTriggerMask),
60 fOrbitNumber(header.fOrbitNumber),
61 fTimeStamp(header.fTimeStamp),
62 fEventType(header.fEventType),
4f036e6e 63 fPeriodNumber(header.fPeriodNumber),
d5ebf00e 64 fEventNumberInFile(header.fEventNumberInFile),
65 fBunchCrossNumber(header.fBunchCrossNumber),
53eef471 66 fTriggerCluster(header.fTriggerCluster),
67 fL0TriggerInputs(header.fL0TriggerInputs),
68 fL1TriggerInputs(header.fL1TriggerInputs),
bf1f98c4 69 fL2TriggerInputs(header.fL2TriggerInputs),
8258ca76 70 fTriggerScalers(header.fTriggerScalers),
71 fIRArray(*((TClonesArray*)header.fIRArray.Clone()))
d5ebf00e 72{
73 // copy constructor
9ae2e5e6 74 SetName(header.fName);
75 SetTitle(header.fTitle);
d5ebf00e 76}
77
78AliESDHeader& AliESDHeader::operator=(const AliESDHeader &header)
79{
80 // assigment operator
81 if(this!=&header) {
9ae2e5e6 82 AliVHeader::operator=(header);
d5ebf00e 83 fTriggerMask = header.fTriggerMask;
84 fOrbitNumber = header.fOrbitNumber;
85 fTimeStamp = header.fTimeStamp;
86 fEventType = header.fEventType;
4f036e6e 87 fPeriodNumber = header.fPeriodNumber;
d5ebf00e 88 fEventNumberInFile = header.fEventNumberInFile;
89 fBunchCrossNumber = header.fBunchCrossNumber;
90 fTriggerCluster = header.fTriggerCluster;
53eef471 91 fL0TriggerInputs = header.fL0TriggerInputs;
92 fL1TriggerInputs = header.fL1TriggerInputs;
93 fL2TriggerInputs = header.fL2TriggerInputs;
bf1f98c4 94 fTriggerScalers = header.fTriggerScalers;
8258ca76 95 fIRArray = header.fIRArray;
4f036e6e 96 SetName(header.fName);
97 SetTitle(header.fTitle);
98
d5ebf00e 99 }
100 return *this;
101}
102
bf1f98c4 103void AliESDHeader::Copy(TObject &obj) const
104{
732a24fe 105 // this overwrites the virtual TOBject::Copy()
106 // to allow run time copying without casting
107 // in AliESDEvent
108
109 if(this==&obj)return;
110 AliESDHeader *robj = dynamic_cast<AliESDHeader*>(&obj);
111 if(!robj)return; // not an AliESDHeader
112 *robj = *this;
113
114}
d5ebf00e 115//______________________________________________________________________________
116void AliESDHeader::Reset()
117{
118 // reset all data members
119 fTriggerMask = 0;
120 fOrbitNumber = 0;
121 fTimeStamp = 0;
122 fEventType = 0;
4f036e6e 123 fPeriodNumber = 0;
d5ebf00e 124 fEventNumberInFile = 0;
125 fBunchCrossNumber = 0;
126 fTriggerCluster = 0;
53eef471 127 fL0TriggerInputs = 0;
128 fL1TriggerInputs = 0;
129 fL2TriggerInputs = 0;
bf1f98c4 130 fTriggerScalers.Reset();
8258ca76 131 fIRArray.Clear();
d5ebf00e 132}
76a7c65b 133//______________________________________________________________________________
134void AliESDHeader::AddTriggerIR(const AliTriggerIR* ir)
135{
136 // Adds trigger interaction record to array
137 new(fIRArray[fIRArray.GetEntriesFast()]) AliTriggerIR(*ir);
138}
d5ebf00e 139//______________________________________________________________________________
140void AliESDHeader::Print(const Option_t *) const
141{
142 // Print some data members
143 printf("Event # %d in file Bunch crossing # %d Orbit # %d Trigger %lld \n",
144 GetEventNumberInFile(),
145 GetBunchCrossNumber(),
146 GetOrbitNumber(),
147 GetTriggerMask());
148}
149