Update of the tag system. 1. Correct implementation of the event ID - period, orbit...
[u/mrichter/AliRoot.git] / STEER / AliEventTag.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 /* $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"
25
26 ClassImp(AliEventTag)
27
28 //______________________________________________________________________________
29   AliEventTag::AliEventTag() : 
30     TObject(),
31     fPeriodNumber(0),
32     fOrbitNumber(0),
33     fBunchCrossNumber(0),
34     fFiredTriggerClasses(),
35     fEventType(0),
36     fGUID(0),
37     fPath(0),
38     fsize(0),
39     fmd5(0),
40     fturl(0),
41     fNumberOfParticipants(-10),
42     fNumberOfParticipants2(-10),
43     fImpactParameter(-10.0),
44     fPrimaryVertexFlag(-1),
45     fPrimaryVertexX(-100.0),
46     fPrimaryVertexY(-100.0),
47     fPrimaryVertexZ(-100.0),
48     fPrimaryVertexZError(-100.0),
49     fTriggerMask(0),
50     fTriggerCluster(0),
51     fZDCNeutron1Energy(-10.0),
52     fZDCProton1Energy(-10.0),
53     fZDCNeutron2Energy(-10.0),
54     fZDCProton2Energy(-10.0),
55     fT0VertexZ(-10.0),
56     fNumberOfTracks(-10),
57     fNumberOfPositiveTracks(-10),
58     fNumberOfNegativeTracks(-10),
59     fNumberOfNeutralTracks(-10),  
60     fNumberOfV0s(-10),
61     fNumberOfCascades(-10),
62     fNumberOfKinks(-10),
63     fNumberOfPMDTracks(-10),
64     fNumberOfFMDTracks(-10),
65     fNumberOfPHOSClusters(-10),
66     fNumberOfEMCALClusters(-10),
67     fNumberOfJetCandidates(-10),
68     fMaxJetEnergy(-100.0),
69     fNumberOfHardPhotonsCandidates(-10),
70     fMaxNeutralEnergy(-100.0),
71     fNumberOfChargedAbove1GeV(-10),
72     fNumberOfChargedAbove3GeV(-10),
73     fNumberOfChargedAbove10GeV(-10),
74     fNumberOfMuonsAbove1GeV(-10),
75     fNumberOfMuonsAbove3GeV(-10),
76     fNumberOfMuonsAbove10GeV(-10),
77     fNumberOfElectronsAbove1GeV(-10),
78     fNumberOfElectronsAbove3GeV(-10),
79     fNumberOfElectronsAbove10GeV(-10),
80     fNumberOfElectrons(-10),
81     fNumberOfFWMuons(-10),
82     fNumberOfMuons(-10),
83     fNumberOfPions(-10),
84     fNumberOfKaons(-10),
85     fNumberOfProtons(-10),
86     fNumberOfLambdas(-10),
87     fNumberOfPhotons(-10),
88     fNumberOfPi0s(-10),
89     fNumberOfNeutrons(-10),
90     fNumberOfKaon0s(-10),
91     fTotalP(-10.0),
92     fMeanPt(-10.0),
93     fMaxPt(-10.0),
94     fTotalNeutralP(-10.0),
95     fMeanNeutralPt(-10.0),
96     fMaxNeutralPt(-10.0),
97     fEventPlaneAngle(-10.0),
98     fHBTRadii(-10.0),
99     fNumberOfFiredChipsLayer1(0),
100     fNumberOfFiredChipsLayer2(0),
101     fNumberOfSPDTracklets(0)
102 {
103   // AliEventTag default constructor
104   for(Int_t i=0; i<2; i++)     fZDCEMEnergy[i] = -10.0;
105   for(Int_t i1 = 0; i1 < 64; i1++) fVZEROADC[i1] = 0;
106   for(Int_t i2 = 0; i2 < 64; i2++) fVZEROTime[i2] = kFALSE;
107 }
108
109
110 //___________________________________________________________________________
111 AliEventTag::AliEventTag(const AliEventTag & evTag) :
112   TObject(evTag),
113   fPeriodNumber(evTag.fPeriodNumber),
114   fOrbitNumber(evTag.fOrbitNumber),
115   fBunchCrossNumber(evTag.fBunchCrossNumber),
116   fFiredTriggerClasses(evTag.fFiredTriggerClasses),
117   fEventType(evTag.fEventType),
118   fGUID(evTag.fGUID),
119   fPath(evTag.fPath),
120   fsize(evTag.fsize),
121   fmd5(evTag.fmd5),
122   fturl(evTag.fturl),
123   fNumberOfParticipants(evTag.fNumberOfParticipants),
124   fNumberOfParticipants2(evTag.fNumberOfParticipants2),
125   fImpactParameter(evTag.fImpactParameter),
126   fPrimaryVertexFlag(evTag.fPrimaryVertexFlag),
127   fPrimaryVertexX(evTag.fPrimaryVertexX),
128   fPrimaryVertexY(evTag.fPrimaryVertexY),
129   fPrimaryVertexZ(evTag.fPrimaryVertexZ),
130   fPrimaryVertexZError(evTag.fPrimaryVertexZError),
131   fTriggerMask(evTag.fTriggerMask),
132   fTriggerCluster(evTag.fTriggerCluster),
133   fZDCNeutron1Energy(evTag.fZDCNeutron1Energy),
134   fZDCProton1Energy(evTag.fZDCProton1Energy),
135   fZDCNeutron2Energy(evTag.fZDCNeutron2Energy),
136   fZDCProton2Energy(evTag.fZDCProton2Energy),
137   fT0VertexZ(evTag.fT0VertexZ),
138   fNumberOfTracks(evTag.fNumberOfTracks),
139   fNumberOfPositiveTracks(evTag.fNumberOfPositiveTracks),
140   fNumberOfNegativeTracks(evTag.fNumberOfNegativeTracks),
141   fNumberOfNeutralTracks(evTag.fNumberOfNeutralTracks),  
142   fNumberOfV0s(evTag.fNumberOfV0s),
143   fNumberOfCascades(evTag.fNumberOfCascades),
144   fNumberOfKinks(evTag.fNumberOfKinks),
145   fNumberOfPMDTracks(evTag.fNumberOfPMDTracks),
146   fNumberOfFMDTracks(evTag.fNumberOfFMDTracks),
147   fNumberOfPHOSClusters(evTag.fNumberOfPHOSClusters),
148   fNumberOfEMCALClusters(evTag.fNumberOfEMCALClusters),
149   fNumberOfJetCandidates(evTag.fNumberOfJetCandidates),
150   fMaxJetEnergy(evTag.fMaxJetEnergy),
151   fNumberOfHardPhotonsCandidates(evTag.fNumberOfHardPhotonsCandidates),
152   fMaxNeutralEnergy(evTag.fMaxNeutralEnergy),
153   fNumberOfChargedAbove1GeV(evTag.fNumberOfChargedAbove1GeV),
154   fNumberOfChargedAbove3GeV(evTag.fNumberOfChargedAbove3GeV),
155   fNumberOfChargedAbove10GeV(evTag.fNumberOfChargedAbove10GeV),
156   fNumberOfMuonsAbove1GeV(evTag.fNumberOfMuonsAbove1GeV),
157   fNumberOfMuonsAbove3GeV(evTag.fNumberOfMuonsAbove3GeV),
158   fNumberOfMuonsAbove10GeV(evTag.fNumberOfMuonsAbove10GeV),
159   fNumberOfElectronsAbove1GeV(evTag.fNumberOfElectronsAbove1GeV),
160   fNumberOfElectronsAbove3GeV(evTag.fNumberOfElectronsAbove3GeV),
161   fNumberOfElectronsAbove10GeV(evTag.fNumberOfElectronsAbove10GeV),
162   fNumberOfElectrons(evTag.fNumberOfElectrons),
163   fNumberOfFWMuons(evTag.fNumberOfFWMuons),
164   fNumberOfMuons(evTag.fNumberOfMuons),
165   fNumberOfPions(evTag.fNumberOfPions),
166   fNumberOfKaons(evTag.fNumberOfKaons),
167   fNumberOfProtons(evTag.fNumberOfProtons),
168   fNumberOfLambdas(evTag.fNumberOfLambdas),
169   fNumberOfPhotons(evTag.fNumberOfPhotons),
170   fNumberOfPi0s(evTag.fNumberOfPi0s),
171   fNumberOfNeutrons(evTag.fNumberOfNeutrons),
172   fNumberOfKaon0s(evTag.fNumberOfKaon0s),
173   fTotalP(evTag.fTotalP),
174   fMeanPt(evTag.fMeanPt),
175   fMaxPt(evTag.fMaxPt),
176   fTotalNeutralP(evTag.fTotalNeutralP),
177   fMeanNeutralPt(evTag.fMeanNeutralPt),
178   fMaxNeutralPt(evTag.fMaxNeutralPt),
179   fEventPlaneAngle(evTag.fEventPlaneAngle),
180   fHBTRadii(evTag.fHBTRadii),
181   fNumberOfFiredChipsLayer1(evTag.fNumberOfFiredChipsLayer1),
182   fNumberOfFiredChipsLayer2(evTag.fNumberOfFiredChipsLayer2),
183   fNumberOfSPDTracklets(evTag.fNumberOfSPDTracklets)
184  {
185   // EventTag copy constructor
186   for(Int_t i=0; i<2; i++)     fZDCEMEnergy[i] = evTag.fZDCEMEnergy[i];
187   for(Int_t i1 = 0; i1 < 64; i1++) fVZEROADC[i1] = 0;
188   for(Int_t i2 = 0; i2 < 64; i2++) fVZEROTime[i2] = kFALSE;
189 }
190
191 //___________________________________________________________________________
192 AliEventTag & AliEventTag::operator=(const AliEventTag &evTag) {
193   // EventTag assignment operator
194   if (this != &evTag) {
195     TObject::operator=(evTag);
196     
197     SetPeriodNumber(evTag.GetPeriodNumber());
198     SetOrbitNumber(evTag.GetOrbitNumber());
199     SetBunchCrossNumber(evTag.GetBunchCrossNumber());
200     SetFiredTriggerClasses(evTag.GetFiredTriggerClasses());
201     SetEventType(evTag.GetEventType());
202     SetGUID(evTag.GetGUID());
203     SetPath(evTag.GetPath());
204     SetMD5(evTag.GetMD5());
205     SetTURL(evTag.GetTURL());
206     SetSize(evTag.GetSize());
207     SetNumOfParticipants(evTag.GetNumOfParticipants());
208     SetImpactParameter(evTag.GetImpactParameter());
209     SetVertexX(evTag.GetVertexX());
210     SetVertexY(evTag.GetVertexY());
211     SetVertexZ(evTag.GetVertexZ());
212     SetVertexFlag(evTag.GetVertexFlag());
213     SetVertexZError(evTag.GetVertexZError());
214     SetTriggerMask(evTag.GetTriggerMask());
215     SetTriggerCluster(evTag.GetTriggerCluster());
216     SetZDCNeutron1Energy(evTag.GetZDCNeutron1Energy());
217     SetZDCProton1Energy(evTag.GetZDCProton1Energy());
218     SetZDCNeutron2Energy(evTag.GetZDCNeutron2Energy());
219     SetZDCProton2Energy(evTag.GetZDCProton2Energy());
220     SetZDCEMEnergy(evTag.GetZDCEMEnergy(0),evTag.GetZDCEMEnergy(1));
221     SetT0VertexZ(evTag.GetT0VertexZ());
222     SetNumOfTracks(evTag.GetNumOfTracks());
223     SetNumOfPosTracks(evTag.GetNumOfPosTracks());
224     SetNumOfNegTracks(evTag.GetNumOfNegTracks());
225     SetNumOfNeutrTracks(evTag.GetNumOfNeutrTracks());
226     SetNumOfV0s(evTag.GetNumOfV0s());
227     SetNumOfCascades(evTag.GetNumOfCascades());
228     SetNumOfKinks(evTag.GetNumOfKinks());
229     SetNumOfPMDTracks(evTag.GetNumOfPMDTracks());
230     SetNumOfFMDTracks(evTag.GetNumOfFMDTracks());
231     SetNumOfPHOSClusters(evTag.GetNumOfPHOSClusters());
232     SetNumOfEMCALClusters(evTag.GetNumOfEMCALClusters());
233     SetNumOfJetCandidates(evTag.GetNumOfJetCandidates());
234     SetNumOfHardPhotonsCandidates(evTag.GetNumOfHardPhotonsCandidates());
235     SetMaxJetEnergy(evTag.GetMaxJetEnergy());
236     SetMaxNeutralEnergy(evTag.GetMaxNeutralEnergy());
237     SetNumOfChargedAbove1GeV(evTag.GetNumOfChargedAbove1GeV());
238     SetNumOfChargedAbove3GeV(evTag.GetNumOfChargedAbove3GeV());
239     SetNumOfChargedAbove10GeV(evTag.GetNumOfChargedAbove10GeV());
240     SetNumOfMuonsAbove1GeV(evTag.GetNumOfMuonsAbove1GeV());
241     SetNumOfMuonsAbove3GeV(evTag.GetNumOfMuonsAbove3GeV());
242     SetNumOfMuonsAbove10GeV(evTag.GetNumOfMuonsAbove10GeV());
243     SetNumOfElectronsAbove1GeV(evTag.GetNumOfElectronsAbove1GeV());
244     SetNumOfElectronsAbove3GeV(evTag.GetNumOfElectronsAbove3GeV());
245     SetNumOfElectronsAbove10GeV(evTag.GetNumOfElectronsAbove10GeV());
246     SetNumOfElectrons(evTag.GetNumOfElectrons());
247     SetNumOfFWMuons(evTag.GetNumOfFWMuons());
248     SetNumOfMuons(evTag.GetNumOfMuons());
249     SetNumOfPions(evTag.GetNumOfPions());
250     SetNumOfKaons(evTag.GetNumOfKaons());
251     SetNumOfProtons(evTag.GetNumOfProtons());
252     SetNumOfLambdas(evTag.GetNumOfLambdas());
253     SetNumOfPhotons(evTag.GetNumOfPhotons());
254     SetNumOfPi0s(evTag.GetNumOfPi0s());
255     SetNumOfNeutrons(evTag.GetNumOfNeutrons());
256     SetNumOfKaon0s(evTag.GetNumOfKaon0s());
257     SetTotalMomentum(evTag.GetTotalMomentum());
258     SetMeanPt(evTag.GetMeanPt());
259     SetMaxPt(evTag.GetMaxPt());
260     SetNeutralTotalMomentum(evTag.GetNeutralTotalMomentum());
261     SetNeutralMeanPt(evTag.GetNeutralMeanPt());
262     SetNeutralMaxPt(evTag.GetNeutralMaxPt());
263     SetEventPlaneAngle(evTag.GetEventPlaneAngle());
264     SetHBTRadii(evTag.GetHBTRadii());
265     SetNumberOfFiredChipsLayer1(evTag.GetNumberOfFiredChipsLayer1());
266     SetNumberOfFiredChipsLayer2(evTag.GetNumberOfFiredChipsLayer2());
267     SetNumberOfSPDTracklets(evTag.GetNumberOfSPDTracklets());
268     for(Int_t i1 = 0; i1 < 64; i1++) 
269       SetVZEROADC(i1,evTag.GetVZEROADC(i1));
270     for(Int_t i2 = 0; i2 < 64; i2++) 
271       SetVZEROTime(i2,evTag.GetVZEROTime(i2));
272   }
273   return *this;
274 }
275
276 //___________________________________________________________________________
277 AliEventTag::~AliEventTag() {
278   // AliEventTag destructor
279 }