]>
Commit | Line | Data |
---|---|---|
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 | ||
26 | ClassImp(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.... | |
31 | TString AliAODMCHeader::fgkStdBranchName("mcHeader"); | |
32 | ||
33 | //______________________________________________________________________________ | |
34 | AliAODMCHeader::AliAODMCHeader() : | |
35 | AliVHeader() | |
36 | ,fGenerator("") | |
37 | ,fImpactPar(0) | |
38 | ,fEventType(0) | |
39 | { | |
40 | // default constructor | |
41 | fVertex[0] = fVertex[1] = fVertex[2] = 0; | |
42 | SetName(fgkStdBranchName.Data()); | |
43 | } | |
44 | ||
45 | ||
46 | AliAODMCHeader::~AliAODMCHeader() | |
47 | { | |
48 | // destructor | |
49 | } | |
50 | ||
51 | ||
52 | AliAODMCHeader::AliAODMCHeader(const AliAODMCHeader &header) : | |
53 | AliVHeader(header) | |
54 | ,fGenerator(header.fGenerator) | |
55 | ,fImpactPar(header.fImpactPar) | |
56 | ,fEventType(header.fEventType) | |
57 | { | |
58 | // copy constructor | |
59 | for(int i = 0;i<3;++i)fVertex[i] = header.fVertex[i]; | |
60 | SetName(header.fName); | |
61 | SetTitle(header.fTitle); | |
62 | } | |
63 | ||
64 | AliAODMCHeader& AliAODMCHeader::operator=(const AliAODMCHeader &header) | |
65 | { | |
66 | // assigment operator | |
67 | if(this!=&header) { | |
68 | AliVHeader::operator=(header); | |
69 | fGenerator = header.fGenerator; | |
70 | for(int i = 0;i<3;++i)fVertex[i] = header.fVertex[i]; | |
71 | fImpactPar = header.fImpactPar; | |
72 | fEventType = header.fEventType; | |
73 | } | |
74 | return *this; | |
75 | } | |
76 | ||
77 | void AliAODMCHeader::Copy(TObject &obj) const { | |
78 | ||
79 | // this overwrites the virtual TOBject::Copy() | |
80 | // to allow run time copying without casting | |
81 | // in AliESDEvent | |
82 | ||
83 | if(this==&obj)return; | |
84 | AliAODMCHeader *robj = dynamic_cast<AliAODMCHeader*>(&obj); | |
85 | if(!robj)return; // not an AliAODMCHeader | |
86 | *robj = *this; | |
87 | ||
88 | } | |
89 | ||
90 | ||
91 | ||
92 | //______________________________________________________________________________ | |
93 | void AliAODMCHeader::Reset() | |
94 | { | |
95 | // reset all data members | |
96 | fGenerator = ""; | |
97 | fImpactPar = 0; | |
98 | fEventType = 0; | |
99 | fVertex[0] = fVertex[1] = fVertex[2] = 0; | |
100 | } | |
101 | ||
102 | //______________________________________________________________________________ | |
103 | void AliAODMCHeader::Print(const Option_t *) const | |
104 | { | |
105 | // Print some data members | |
106 | Printf("MC EventHeader Generator: %s # EventType %d Vtx = (%3.3f,%3.3f,%3.3f) Impactparameter %3.3f \n", | |
107 | GetGeneratorName(), | |
108 | GetEventType(), | |
109 | GetVtxX(),GetVtxY(),GetVtxZ(), | |
110 | GetImpactParameter()); | |
111 | } | |
112 |