Bug corrected.
[u/mrichter/AliRoot.git] / STEER / AliEventTag.cxx
CommitLineData
f3a97c86 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/* $Id$ */
17
18//-----------------------------------------------------------------
19// Implementation of the EventTag class
20// This is the class to deal with the tags in the event level
21// Origin: Panos Christakoglou, UOA-CERN, Panos.Christakoglou@cern.ch
22//-----------------------------------------------------------------
23
24#include "AliEventTag.h"
04cb11d4 25#include <TObjArray.h>
26#include <TObjString.h>
f3a97c86 27
28ClassImp(AliEventTag)
29
30//______________________________________________________________________________
cb1645b7 31 AliEventTag::AliEventTag() :
32 TObject(),
7e3c2e04 33 fPeriodNumber(0),
34 fOrbitNumber(0),
35 fBunchCrossNumber(0),
04cb11d4 36 //*T* fFiredTriggerClasses(),
7e3c2e04 37 fEventType(0),
850d5792 38 fPhysicsFlag(0),
39 fBackgroundFlag(0),
04cb11d4 40// fGUID(0),
41// fPath(0),
42// fsize(0),
43// fmd5(0),
44// fturl(0),
45// fFileRef(0),
cb1645b7 46 fNumberOfParticipants(-10),
491f873f 47 fNumberOfParticipants2(-10),
cb1645b7 48 fImpactParameter(-10.0),
49 fPrimaryVertexFlag(-1),
50 fPrimaryVertexX(-100.0),
51 fPrimaryVertexY(-100.0),
52 fPrimaryVertexZ(-100.0),
53 fPrimaryVertexZError(-100.0),
8bd8ac26 54 fTriggerMask(0),
55 fTriggerCluster(0),
32a5cab4 56 fZDCNeutron1Energy(-10.0),
57 fZDCProton1Energy(-10.0),
32a5cab4 58 fZDCNeutron2Energy(-10.0),
59 fZDCProton2Energy(-10.0),
cb1645b7 60 fT0VertexZ(-10.0),
61 fNumberOfTracks(-10),
62 fNumberOfPositiveTracks(-10),
63 fNumberOfNegativeTracks(-10),
64 fNumberOfNeutralTracks(-10),
65 fNumberOfV0s(-10),
66 fNumberOfCascades(-10),
67 fNumberOfKinks(-10),
68 fNumberOfPMDTracks(-10),
cb1645b7 69 fNumberOfFMDTracks(-10),
85c60a8e 70 fNumberOfPHOSClusters(-10),
71 fNumberOfEMCALClusters(-10),
cb1645b7 72 fNumberOfJetCandidates(-10),
73 fMaxJetEnergy(-100.0),
74 fNumberOfHardPhotonsCandidates(-10),
75 fMaxNeutralEnergy(-100.0),
76 fNumberOfChargedAbove1GeV(-10),
77 fNumberOfChargedAbove3GeV(-10),
78 fNumberOfChargedAbove10GeV(-10),
79 fNumberOfMuonsAbove1GeV(-10),
80 fNumberOfMuonsAbove3GeV(-10),
81 fNumberOfMuonsAbove10GeV(-10),
82 fNumberOfElectronsAbove1GeV(-10),
83 fNumberOfElectronsAbove3GeV(-10),
84 fNumberOfElectronsAbove10GeV(-10),
85 fNumberOfElectrons(-10),
d3893274 86 fNumberOfFWMuons(-10),
e21df713 87 fNumberOfFWMatchedMuons(-10),
cb1645b7 88 fNumberOfMuons(-10),
89 fNumberOfPions(-10),
90 fNumberOfKaons(-10),
91 fNumberOfProtons(-10),
92 fNumberOfLambdas(-10),
93 fNumberOfPhotons(-10),
94 fNumberOfPi0s(-10),
95 fNumberOfNeutrons(-10),
96 fNumberOfKaon0s(-10),
97 fTotalP(-10.0),
98 fMeanPt(-10.0),
99 fMaxPt(-10.0),
73e1181d 100 fEtaMaxPt(-13.0),
101 fPhiMaxPt(+13.0),
cb1645b7 102 fTotalNeutralP(-10.0),
103 fMeanNeutralPt(-10.0),
104 fMaxNeutralPt(-10.0),
105 fEventPlaneAngle(-10.0),
7e3c2e04 106 fHBTRadii(-10.0),
107 fNumberOfFiredChipsLayer1(0),
108 fNumberOfFiredChipsLayer2(0),
4c454ade 109 fNumberOfSPDTracklets(0),
110 fMTotV0A(0),
111 fMTotV0C(0),
112 fNbPMV0A(0),
113 fNbPMV0C(0)
f3a97c86 114{
cb1645b7 115 // AliEventTag default constructor
a85132e7 116 for(Int_t i=0; i<2; i++) fZDCEMEnergy[i] = -10.0;
f3a97c86 117}
118
119
bec9a2e7 120//___________________________________________________________________________
fe12e09c 121AliEventTag::AliEventTag(const AliEventTag & evTag) :
122 TObject(evTag),
7e3c2e04 123 fPeriodNumber(evTag.fPeriodNumber),
124 fOrbitNumber(evTag.fOrbitNumber),
125 fBunchCrossNumber(evTag.fBunchCrossNumber),
04cb11d4 126 //*T* fFiredTriggerClasses(evTag.fFiredTriggerClasses),
7e3c2e04 127 fEventType(evTag.fEventType),
850d5792 128 fPhysicsFlag(evTag.fPhysicsFlag),
129 fBackgroundFlag(evTag.fBackgroundFlag),
04cb11d4 130// fGUID(evTag.fGUID),
131// fPath(evTag.fPath),
132// fsize(evTag.fsize),
133// fmd5(evTag.fmd5),
134// fturl(evTag.fturl),
135// fFileRef(0),
fe12e09c 136 fNumberOfParticipants(evTag.fNumberOfParticipants),
491f873f 137 fNumberOfParticipants2(evTag.fNumberOfParticipants2),
fe12e09c 138 fImpactParameter(evTag.fImpactParameter),
139 fPrimaryVertexFlag(evTag.fPrimaryVertexFlag),
140 fPrimaryVertexX(evTag.fPrimaryVertexX),
141 fPrimaryVertexY(evTag.fPrimaryVertexY),
142 fPrimaryVertexZ(evTag.fPrimaryVertexZ),
143 fPrimaryVertexZError(evTag.fPrimaryVertexZError),
144 fTriggerMask(evTag.fTriggerMask),
145 fTriggerCluster(evTag.fTriggerCluster),
146 fZDCNeutron1Energy(evTag.fZDCNeutron1Energy),
147 fZDCProton1Energy(evTag.fZDCProton1Energy),
148 fZDCNeutron2Energy(evTag.fZDCNeutron2Energy),
149 fZDCProton2Energy(evTag.fZDCProton2Energy),
fe12e09c 150 fT0VertexZ(evTag.fT0VertexZ),
151 fNumberOfTracks(evTag.fNumberOfTracks),
152 fNumberOfPositiveTracks(evTag.fNumberOfPositiveTracks),
153 fNumberOfNegativeTracks(evTag.fNumberOfNegativeTracks),
154 fNumberOfNeutralTracks(evTag.fNumberOfNeutralTracks),
155 fNumberOfV0s(evTag.fNumberOfV0s),
156 fNumberOfCascades(evTag.fNumberOfCascades),
157 fNumberOfKinks(evTag.fNumberOfKinks),
158 fNumberOfPMDTracks(evTag.fNumberOfPMDTracks),
159 fNumberOfFMDTracks(evTag.fNumberOfFMDTracks),
160 fNumberOfPHOSClusters(evTag.fNumberOfPHOSClusters),
161 fNumberOfEMCALClusters(evTag.fNumberOfEMCALClusters),
162 fNumberOfJetCandidates(evTag.fNumberOfJetCandidates),
163 fMaxJetEnergy(evTag.fMaxJetEnergy),
164 fNumberOfHardPhotonsCandidates(evTag.fNumberOfHardPhotonsCandidates),
165 fMaxNeutralEnergy(evTag.fMaxNeutralEnergy),
166 fNumberOfChargedAbove1GeV(evTag.fNumberOfChargedAbove1GeV),
167 fNumberOfChargedAbove3GeV(evTag.fNumberOfChargedAbove3GeV),
168 fNumberOfChargedAbove10GeV(evTag.fNumberOfChargedAbove10GeV),
169 fNumberOfMuonsAbove1GeV(evTag.fNumberOfMuonsAbove1GeV),
170 fNumberOfMuonsAbove3GeV(evTag.fNumberOfMuonsAbove3GeV),
171 fNumberOfMuonsAbove10GeV(evTag.fNumberOfMuonsAbove10GeV),
172 fNumberOfElectronsAbove1GeV(evTag.fNumberOfElectronsAbove1GeV),
173 fNumberOfElectronsAbove3GeV(evTag.fNumberOfElectronsAbove3GeV),
174 fNumberOfElectronsAbove10GeV(evTag.fNumberOfElectronsAbove10GeV),
175 fNumberOfElectrons(evTag.fNumberOfElectrons),
d3893274 176 fNumberOfFWMuons(evTag.fNumberOfFWMuons),
e21df713 177 fNumberOfFWMatchedMuons(evTag.fNumberOfFWMatchedMuons),
fe12e09c 178 fNumberOfMuons(evTag.fNumberOfMuons),
179 fNumberOfPions(evTag.fNumberOfPions),
180 fNumberOfKaons(evTag.fNumberOfKaons),
181 fNumberOfProtons(evTag.fNumberOfProtons),
182 fNumberOfLambdas(evTag.fNumberOfLambdas),
183 fNumberOfPhotons(evTag.fNumberOfPhotons),
184 fNumberOfPi0s(evTag.fNumberOfPi0s),
185 fNumberOfNeutrons(evTag.fNumberOfNeutrons),
186 fNumberOfKaon0s(evTag.fNumberOfKaon0s),
187 fTotalP(evTag.fTotalP),
188 fMeanPt(evTag.fMeanPt),
189 fMaxPt(evTag.fMaxPt),
73e1181d 190 fEtaMaxPt(evTag.fEtaMaxPt),
191 fPhiMaxPt(evTag.fPhiMaxPt),
fe12e09c 192 fTotalNeutralP(evTag.fTotalNeutralP),
193 fMeanNeutralPt(evTag.fMeanNeutralPt),
194 fMaxNeutralPt(evTag.fMaxNeutralPt),
195 fEventPlaneAngle(evTag.fEventPlaneAngle),
7e3c2e04 196 fHBTRadii(evTag.fHBTRadii),
197 fNumberOfFiredChipsLayer1(evTag.fNumberOfFiredChipsLayer1),
198 fNumberOfFiredChipsLayer2(evTag.fNumberOfFiredChipsLayer2),
4c454ade 199 fNumberOfSPDTracklets(evTag.fNumberOfSPDTracklets),
200 fMTotV0A(evTag.fMTotV0A),
201 fMTotV0C(evTag.fMTotV0C),
202 fNbPMV0A(evTag.fNbPMV0A),
203 fNbPMV0C(evTag.fNbPMV0C)
fe12e09c 204 {
f3a97c86 205 // EventTag copy constructor
a85132e7 206 for(Int_t i=0; i<2; i++) fZDCEMEnergy[i] = evTag.fZDCEMEnergy[i];
cb1645b7 207}
208
bec9a2e7 209//___________________________________________________________________________
fe12e09c 210AliEventTag & AliEventTag::operator=(const AliEventTag &evTag) {
cb1645b7 211 // EventTag assignment operator
fe12e09c 212 if (this != &evTag) {
213 TObject::operator=(evTag);
bec9a2e7 214
7e3c2e04 215 SetPeriodNumber(evTag.GetPeriodNumber());
216 SetOrbitNumber(evTag.GetOrbitNumber());
217 SetBunchCrossNumber(evTag.GetBunchCrossNumber());
04cb11d4 218 //*T* SetFiredTriggerClasses(evTag.GetFiredTriggerClasses());
7e3c2e04 219 SetEventType(evTag.GetEventType());
850d5792 220 SetPhysicsFlag(evTag.GetPhysicsFlag());
221 SetBackgroungFlag(evTag.GetBackgroundFlag());
04cb11d4 222// SetGUID(evTag.GetGUID());
223// SetPath(evTag.GetPath());
224// SetMD5(evTag.GetMD5());
225// SetTURL(evTag.GetTURL());
226// SetSize(evTag.GetSize());
fe12e09c 227 SetNumOfParticipants(evTag.GetNumOfParticipants());
228 SetImpactParameter(evTag.GetImpactParameter());
229 SetVertexX(evTag.GetVertexX());
230 SetVertexY(evTag.GetVertexY());
231 SetVertexZ(evTag.GetVertexZ());
232 SetVertexFlag(evTag.GetVertexFlag());
233 SetVertexZError(evTag.GetVertexZError());
234 SetTriggerMask(evTag.GetTriggerMask());
235 SetTriggerCluster(evTag.GetTriggerCluster());
236 SetZDCNeutron1Energy(evTag.GetZDCNeutron1Energy());
237 SetZDCProton1Energy(evTag.GetZDCProton1Energy());
238 SetZDCNeutron2Energy(evTag.GetZDCNeutron2Energy());
239 SetZDCProton2Energy(evTag.GetZDCProton2Energy());
a85132e7 240 SetZDCEMEnergy(evTag.GetZDCEMEnergy(0),evTag.GetZDCEMEnergy(1));
fe12e09c 241 SetT0VertexZ(evTag.GetT0VertexZ());
242 SetNumOfTracks(evTag.GetNumOfTracks());
243 SetNumOfPosTracks(evTag.GetNumOfPosTracks());
244 SetNumOfNegTracks(evTag.GetNumOfNegTracks());
245 SetNumOfNeutrTracks(evTag.GetNumOfNeutrTracks());
246 SetNumOfV0s(evTag.GetNumOfV0s());
247 SetNumOfCascades(evTag.GetNumOfCascades());
248 SetNumOfKinks(evTag.GetNumOfKinks());
249 SetNumOfPMDTracks(evTag.GetNumOfPMDTracks());
250 SetNumOfFMDTracks(evTag.GetNumOfFMDTracks());
251 SetNumOfPHOSClusters(evTag.GetNumOfPHOSClusters());
252 SetNumOfEMCALClusters(evTag.GetNumOfEMCALClusters());
253 SetNumOfJetCandidates(evTag.GetNumOfJetCandidates());
254 SetNumOfHardPhotonsCandidates(evTag.GetNumOfHardPhotonsCandidates());
255 SetMaxJetEnergy(evTag.GetMaxJetEnergy());
256 SetMaxNeutralEnergy(evTag.GetMaxNeutralEnergy());
257 SetNumOfChargedAbove1GeV(evTag.GetNumOfChargedAbove1GeV());
258 SetNumOfChargedAbove3GeV(evTag.GetNumOfChargedAbove3GeV());
259 SetNumOfChargedAbove10GeV(evTag.GetNumOfChargedAbove10GeV());
260 SetNumOfMuonsAbove1GeV(evTag.GetNumOfMuonsAbove1GeV());
261 SetNumOfMuonsAbove3GeV(evTag.GetNumOfMuonsAbove3GeV());
262 SetNumOfMuonsAbove10GeV(evTag.GetNumOfMuonsAbove10GeV());
263 SetNumOfElectronsAbove1GeV(evTag.GetNumOfElectronsAbove1GeV());
264 SetNumOfElectronsAbove3GeV(evTag.GetNumOfElectronsAbove3GeV());
265 SetNumOfElectronsAbove10GeV(evTag.GetNumOfElectronsAbove10GeV());
266 SetNumOfElectrons(evTag.GetNumOfElectrons());
d3893274 267 SetNumOfFWMuons(evTag.GetNumOfFWMuons());
e21df713 268 SetNumOfFWMatchedMuons(evTag.GetNumOfFWMatchedMuons());
fe12e09c 269 SetNumOfMuons(evTag.GetNumOfMuons());
270 SetNumOfPions(evTag.GetNumOfPions());
271 SetNumOfKaons(evTag.GetNumOfKaons());
272 SetNumOfProtons(evTag.GetNumOfProtons());
273 SetNumOfLambdas(evTag.GetNumOfLambdas());
274 SetNumOfPhotons(evTag.GetNumOfPhotons());
275 SetNumOfPi0s(evTag.GetNumOfPi0s());
276 SetNumOfNeutrons(evTag.GetNumOfNeutrons());
277 SetNumOfKaon0s(evTag.GetNumOfKaon0s());
278 SetTotalMomentum(evTag.GetTotalMomentum());
279 SetMeanPt(evTag.GetMeanPt());
280 SetMaxPt(evTag.GetMaxPt());
73e1181d 281 SetEtaMaxPt(evTag.GetEtaMaxPt());
282 SetPhiMaxPt(evTag.GetPhiMaxPt());
fe12e09c 283 SetNeutralTotalMomentum(evTag.GetNeutralTotalMomentum());
284 SetNeutralMeanPt(evTag.GetNeutralMeanPt());
285 SetNeutralMaxPt(evTag.GetNeutralMaxPt());
286 SetEventPlaneAngle(evTag.GetEventPlaneAngle());
287 SetHBTRadii(evTag.GetHBTRadii());
7e3c2e04 288 SetNumberOfFiredChipsLayer1(evTag.GetNumberOfFiredChipsLayer1());
289 SetNumberOfFiredChipsLayer2(evTag.GetNumberOfFiredChipsLayer2());
290 SetNumberOfSPDTracklets(evTag.GetNumberOfSPDTracklets());
4c454ade 291 SetMTotV0A(evTag.GetMTotV0A());
292 SetMTotV0C(evTag.GetMTotV0C());
293 SetNbPMV0A(evTag.GetNbPMV0A());
294 SetNbPMV0C(evTag.GetNbPMV0C());
cb1645b7 295 }
296 return *this;
f3a97c86 297}
cb1645b7 298
bec9a2e7 299//___________________________________________________________________________
300AliEventTag::~AliEventTag() {
cb1645b7 301 // AliEventTag destructor
f3a97c86 302}
04cb11d4 303
304// void AliEventTag::SetGUID(TString Pid) { ((AliFileTag * ) fFileRef.GetObject())->SetGUID(Pid);}
305// void AliEventTag::SetPath(TString Pid) {((AliFileTag * ) fFileRef.GetObject())->SetPath(Pid);}
306// void AliEventTag::SetMD5(TString Pid) {((AliFileTag * ) fFileRef.GetObject())->SetMD5(Pid);}
307// void AliEventTag::SetTURL(TString Pid) {((AliFileTag * ) fFileRef.GetObject())->SetTURL(Pid);}
308// void AliEventTag::SetSize(Long64_t i) {((AliFileTag * ) fFileRef.GetObject())->SetSize(i);}
309
310TString AliEventTag::GetFiredTriggerClasses(TString actclass) const
311{
312 // Uses the actclass string to decode the trigger mask
313 // into the fired trigger classes
314 TObjArray *actrig = actclass.Tokenize(" ");
315 TString tFired("");
316
317 for(Int_t i = 0; i < actrig->GetEntries(); i++) {
318 if (fTriggerMask & (1ull << i)) {
319 TString str = ((TObjString *) actrig->At(i))->GetString();
320 if (tFired.Length() > 0)
321 tFired += " ";
322 tFired += str;
323 }
324 }
325
326 return tFired;
327}