]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/AliAODMCHeader.cxx
Add MCNSD flag to trigger mask
[u/mrichter/AliRoot.git] / STEER / AliAODMCHeader.cxx
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
35 AliAODMCHeader::AliAODMCHeader() :
36   AliVHeader()
37   ,fGenerator("")
38   ,fImpactPar(0)
39   ,fPtHard(0)
40   ,fXsection(0)
41   ,fTrials(0)
42   ,fEventType(0)
43   ,fReactionPlaneAngle(0)  
44 {
45   // default constructor
46   fVertex[0] = fVertex[1] = fVertex[2] = 0;  
47   SetName(fgkStdBranchName.Data());
48 }
49
50
51 AliAODMCHeader::~AliAODMCHeader() 
52 {
53   // destructor
54 }
55
56
57 AliAODMCHeader::AliAODMCHeader(const AliAODMCHeader &header) :
58   AliVHeader(header)
59   ,fGenerator(header.fGenerator)
60   ,fImpactPar(header.fImpactPar)
61   ,fPtHard(header.fPtHard)
62   ,fXsection(0)
63   ,fTrials(0)
64   ,fEventType(header.fEventType)
65   ,fReactionPlaneAngle(header.fReactionPlaneAngle)  
66 {
67   // copy constructor
68   for(int i = 0;i<3;++i)fVertex[i] = header.fVertex[i];
69   SetName(header.fName);
70   SetTitle(header.fTitle);
71 }
72
73 AliAODMCHeader& AliAODMCHeader::operator=(const AliAODMCHeader &header)
74
75   // assigment operator
76   if(this!=&header) {
77     AliVHeader::operator=(header);
78     fGenerator = header.fGenerator;
79     for(int i = 0;i<3;++i)fVertex[i] = header.fVertex[i];
80     fImpactPar = header.fImpactPar;
81     fPtHard = header.fPtHard;
82     fXsection = header.fXsection;
83     fTrials = header.fTrials;
84     fEventType = header.fEventType;
85     fReactionPlaneAngle = header.fReactionPlaneAngle;
86   } 
87   return *this;
88 }
89
90 void AliAODMCHeader::Copy(TObject &obj) const {
91   
92   // this overwrites the virtual TOBject::Copy()
93   // to allow run time copying without casting
94   // in AliESDEvent
95
96   if(this==&obj)return;
97   AliAODMCHeader *robj = dynamic_cast<AliAODMCHeader*>(&obj);
98   if(!robj)return; // not an AliAODMCHeader
99   *robj = *this;
100
101 }
102
103
104
105 //______________________________________________________________________________
106 void AliAODMCHeader::Reset()
107 {
108   // reset all data members
109   fGenerator = "";
110   fImpactPar = 0;
111   fEventType = 0;
112   fPtHard = 0;
113   fXsection = 0;
114   fTrials = 0;
115   fVertex[0] = fVertex[1] = fVertex[2] = 0;  
116   fReactionPlaneAngle = 0;
117 }
118
119 //______________________________________________________________________________
120 void AliAODMCHeader::Print(const Option_t *) const
121 {
122   // Print some data members
123   Printf("MC EventHeader Generator: %s # EventType %d  Vtx = (%3.3f,%3.3f,%3.3f) ptHard = %3.3f GeV Impact parameter %3.3f  \n",
124          GetGeneratorName(),
125          GetEventType(),
126          GetVtxX(),GetVtxY(),GetVtxZ(),GetPtHard(),
127          GetImpactParameter());
128 }
129