Fixes for bug #52499: Field polarities inconsistiency
[u/mrichter/AliRoot.git] / STEER / AliAODMCHeader.cxx
CommitLineData
dce1b636 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 AliAODMCHeader
18// Header data
19// for the ESD
20// Origin: Christian Klein-Boesing, CERN, Christian.Klein-Boesing@cern.ch
21//-------------------------------------------------------------------------
22
23#include "AliAODMCHeader.h"
24
25
26ClassImp(AliAODMCHeader)
27
28// Without a trailing dot root does not support
29// direct drawing of some variables if the name is not unique on top label
30// bnrach e.g. fEventType is found here and in AliAODHeader....
31TString AliAODMCHeader::fgkStdBranchName("mcHeader");
32
33//______________________________________________________________________________
34AliAODMCHeader::AliAODMCHeader() :
35 AliVHeader()
36 ,fGenerator("")
37 ,fImpactPar(0)
0fd37a1f 38 ,fPtHard(0)
dce1b636 39 ,fEventType(0)
40{
41 // default constructor
42 fVertex[0] = fVertex[1] = fVertex[2] = 0;
43 SetName(fgkStdBranchName.Data());
44}
45
46
47AliAODMCHeader::~AliAODMCHeader()
48{
49 // destructor
50}
51
52
53AliAODMCHeader::AliAODMCHeader(const AliAODMCHeader &header) :
54 AliVHeader(header)
55 ,fGenerator(header.fGenerator)
56 ,fImpactPar(header.fImpactPar)
0fd37a1f 57 ,fPtHard(header.fPtHard)
dce1b636 58 ,fEventType(header.fEventType)
59{
60 // copy constructor
61 for(int i = 0;i<3;++i)fVertex[i] = header.fVertex[i];
62 SetName(header.fName);
63 SetTitle(header.fTitle);
64}
65
66AliAODMCHeader& AliAODMCHeader::operator=(const AliAODMCHeader &header)
67{
68 // assigment operator
69 if(this!=&header) {
70 AliVHeader::operator=(header);
71 fGenerator = header.fGenerator;
72 for(int i = 0;i<3;++i)fVertex[i] = header.fVertex[i];
73 fImpactPar = header.fImpactPar;
0fd37a1f 74 fPtHard = header.fPtHard;
dce1b636 75 fEventType = header.fEventType;
76 }
77 return *this;
78}
79
80void AliAODMCHeader::Copy(TObject &obj) const {
81
82 // this overwrites the virtual TOBject::Copy()
83 // to allow run time copying without casting
84 // in AliESDEvent
85
86 if(this==&obj)return;
87 AliAODMCHeader *robj = dynamic_cast<AliAODMCHeader*>(&obj);
88 if(!robj)return; // not an AliAODMCHeader
89 *robj = *this;
90
91}
92
93
94
95//______________________________________________________________________________
96void AliAODMCHeader::Reset()
97{
98 // reset all data members
99 fGenerator = "";
100 fImpactPar = 0;
101 fEventType = 0;
0fd37a1f 102 fPtHard = 0;
dce1b636 103 fVertex[0] = fVertex[1] = fVertex[2] = 0;
104}
105
106//______________________________________________________________________________
107void AliAODMCHeader::Print(const Option_t *) const
108{
109 // Print some data members
0fd37a1f 110 Printf("MC EventHeader Generator: %s # EventType %d Vtx = (%3.3f,%3.3f,%3.3f) ptHard = %3.3f GeV Impact parameter %3.3f \n",
dce1b636 111 GetGeneratorName(),
112 GetEventType(),
0fd37a1f 113 GetVtxX(),GetVtxY(),GetVtxZ(),GetPtHard(),
dce1b636 114 GetImpactParameter());
115}
116