1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 //-----------------------------------------------------------------
19 // Implementation of the RunTag class
20 // This is the class to deal with the tags in the run level
21 // Origin: Panos Christakoglou, UOA-CERN, Panos.Christakoglou@cern.ch
22 //-----------------------------------------------------------------
24 #include "AliRunTag.h"
25 #include "AliDetectorTag.h"
26 #include "AliEventTag.h"
30 //___________________________________________________________________________
31 AliRunTag::AliRunTag() :
34 fAliceMagneticField(0.0),
35 fAliceRunStartTime(0),
41 fAliceBeamEnergy(0.0),
43 fAliceCalibrationVersion(0),
47 fEventTag("AliEventTag", 1000),
59 //___________________________________________________________________________
60 AliRunTag::~AliRunTag() {
66 delete [] fEventSpecies ;
69 //___________________________________________________________________________
70 AliRunTag::AliRunTag(const AliRunTag& tag):
72 fAliceRunId(tag.fAliceRunId),
73 fAliceMagneticField(tag.fAliceMagneticField),
74 fAliceRunStartTime(tag.fAliceRunStartTime),
75 fAliceRunStopTime(fAliceRunStopTime),
76 fAlirootVersion(tag.fAlirootVersion),
77 fRootVersion(tag.fRootVersion),
78 fGeant3Version(tag.fGeant3Version),
79 fAliceRunQuality(tag.fAliceRunQuality),
80 fAliceBeamEnergy(tag.fAliceBeamEnergy),
81 fAliceBeamType(tag.fAliceBeamType),
82 fAliceCalibrationVersion(tag.fAliceCalibrationVersion),
83 fAliceDataType(tag.fAliceDataType),
84 fNumEvents(tag.fNumEvents),
85 fNumDetectors(tag.fNumDetectors),
86 fEventTag(tag.fEventTag),
87 fDetectorTag(tag.fDetectorTag),
90 fQALength(tag.fQALength),
92 fESLength(tag.fESLength),
99 fQAArray = new ULong_t[fQALength] ;
100 memcpy(fQAArray, tag.fQAArray, fQALength*sizeof(ULong_t)) ;
103 fEventSpecies = NULL ;
105 fEventSpecies = new Bool_t[fESLength] ;
106 memcpy(fEventSpecies, tag.fEventSpecies, fESLength*sizeof(Bool_t)) ;
110 //___________________________________________________________________________
111 AliRunTag& AliRunTag::operator = (const AliRunTag& tag) {
112 //assignment operator
114 fAliceRunId = tag.fAliceRunId ;
115 fAliceMagneticField = tag.fAliceMagneticField ;
116 fAliceRunStartTime = tag.fAliceRunStartTime ;
117 fAliceRunStopTime = tag.fAliceRunStopTime ;
118 fAlirootVersion = tag.fAlirootVersion ;
119 fRootVersion = tag.fRootVersion ;
120 fGeant3Version = tag.fGeant3Version ;
121 fAliceRunQuality = tag.fAliceRunQuality ;
122 fAliceBeamEnergy = tag.fAliceBeamEnergy ;
123 fAliceBeamType = tag.fAliceBeamType ;
124 fAliceCalibrationVersion = tag.fAliceCalibrationVersion ;
125 fAliceDataType = tag.fAliceDataType ;
126 fNumEvents = tag.fNumEvents ;
127 fNumDetectors = tag.fNumDetectors ;
128 fEventTag = tag.fEventTag ;
129 fDetectorTag = tag.fDetectorTag ;
130 fLHCTag = tag.fLHCTag ;
132 fQALength = tag.fQALength ;
138 fQAArray = new ULong_t[fQALength] ;
139 memcpy(fQAArray, tag.fQAArray, fQALength*sizeof(ULong_t)) ;
141 fESLength = tag.fESLength ;
143 delete [] fEventSpecies ;
145 fEventSpecies = NULL ;
147 fEventSpecies = new Bool_t[fESLength] ;
148 memcpy(fEventSpecies, tag.fEventSpecies, fESLength*sizeof(Bool_t)) ;
154 //___________________________________________________________________________
155 void AliRunTag::CopyStandardContent(AliRunTag *oldtag) {
156 //function that copies the run, lhc and detector levels
157 SetRunId(oldtag->GetRunId());
158 SetMagneticField(oldtag->GetMagneticField());
159 SetRunStartTime(oldtag->GetRunStartTime());
160 SetRunStopTime(oldtag->GetRunStopTime());
161 SetAlirootVersion(oldtag->GetAlirootVersion());
162 SetRootVersion(oldtag->GetRootVersion());
163 SetGeant3Version(oldtag->GetGeant3Version());
164 SetRunQuality(oldtag->GetRunQuality());
165 SetBeamEnergy(oldtag->GetBeamEnergy());
166 SetBeamType(oldtag->GetBeamType());
167 SetCalibVersion(oldtag->GetCalibVersion());
168 SetDataType(oldtag->GetDataType());
169 SetLHCTag(oldtag->GetLHCTag()->GetLuminosity(),oldtag->GetLHCTag()->GetLHCState());
170 SetDetectorTag(oldtag->GetDetectorTags()->GetIntDetectorMask());
171 SetQA(*(oldtag->GetQA())) ;
172 SetQAArray(oldtag->GetQAArray(), oldtag->GetQALength()) ;
173 SetEventSpecies(oldtag->GetEventSpecies(), oldtag->GetESLength()) ;
176 //___________________________________________________________________________
177 void AliRunTag::SetQAArray(ULong_t * qa, Int_t qalength) {
178 //Setter for the qa bits
179 if (qa && qalength > 0) {
180 fQALength = qalength ;
183 fQAArray = new ULong_t[qalength] ;
184 memcpy(fQAArray, qa, qalength*sizeof(ULong_t)) ;
188 //___________________________________________________________________________
189 void AliRunTag::SetEventSpecies(Bool_t * es, Int_t eslength) {
190 //setter for the eventspecices
191 if (es && eslength >0 ) {
192 fESLength = eslength ;
194 delete [] fEventSpecies ;
195 fEventSpecies = new Bool_t[eslength] ;
196 memcpy(fEventSpecies, es, eslength*sizeof(Bool_t)) ;
201 //___________________________________________________________________________
202 void AliRunTag::SetLHCTag(Float_t lumin, TString type) {
203 //Setter for the LHC tags
204 fLHCTag.SetLHCTag(lumin,type);
207 //___________________________________________________________________________
208 void AliRunTag::SetDetectorTag(UInt_t mask) {
209 //Setter for the detector tags
210 fDetectorTag.SetDetectorMask(mask);
213 //___________________________________________________________________________
214 void AliRunTag::AddEventTag(const AliEventTag & EvTag) {
215 //Adds an entry to the event tag TClonesArray
216 new(fEventTag[fNumEvents++]) AliEventTag(EvTag);
219 //___________________________________________________________________________
220 void AliRunTag::Clear(const char *) {
221 //Resets the number of events and detectors
224 fDetectorTag.Clear();