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),
58 //___________________________________________________________________________
59 AliRunTag::~AliRunTag() {
65 delete [] fEventSpecies ;
68 //___________________________________________________________________________
69 AliRunTag::AliRunTag(const AliRunTag& tag):
71 fAliceRunId(tag.fAliceRunId),
72 fAliceMagneticField(tag.fAliceMagneticField),
73 fAliceRunStartTime(tag.fAliceRunStartTime),
74 fAliceRunStopTime(fAliceRunStopTime),
75 fAlirootVersion(tag.fAlirootVersion),
76 fRootVersion(tag.fRootVersion),
77 fGeant3Version(tag.fGeant3Version),
78 fAliceRunQuality(tag.fAliceRunQuality),
79 fAliceBeamEnergy(tag.fAliceBeamEnergy),
80 fAliceBeamType(tag.fAliceBeamType),
81 fAliceCalibrationVersion(tag.fAliceCalibrationVersion),
82 fAliceDataType(tag.fAliceDataType),
83 fNumEvents(tag.fNumEvents),
84 fNumDetectors(tag.fNumDetectors),
85 fEventTag(tag.fEventTag),
86 fDetectorTag(tag.fDetectorTag),
88 fQALength(tag.fQALength),
90 fESLength(tag.fESLength),
97 fQA = new ULong_t[fQALength] ;
98 memcpy(fQA, tag.fQA, fQALength*sizeof(ULong_t)) ;
101 fEventSpecies = NULL ;
103 fEventSpecies = new Bool_t[fESLength] ;
104 memcpy(fEventSpecies, tag.fEventSpecies, fESLength*sizeof(Bool_t)) ;
108 //___________________________________________________________________________
109 AliRunTag& AliRunTag::operator = (const AliRunTag& tag) {
110 //assignment operator
112 fAliceRunId = tag.fAliceRunId ;
113 fAliceMagneticField = tag.fAliceMagneticField ;
114 fAliceRunStartTime = tag.fAliceRunStartTime ;
115 fAliceRunStopTime = tag.fAliceRunStopTime ;
116 fAlirootVersion = tag.fAlirootVersion ;
117 fRootVersion = tag.fRootVersion ;
118 fGeant3Version = tag.fGeant3Version ;
119 fAliceRunQuality = tag.fAliceRunQuality ;
120 fAliceBeamEnergy = tag.fAliceBeamEnergy ;
121 fAliceBeamType = tag.fAliceBeamType ;
122 fAliceCalibrationVersion = tag.fAliceCalibrationVersion ;
123 fAliceDataType = tag.fAliceDataType ;
124 fNumEvents = tag.fNumEvents ;
125 fNumDetectors = tag.fNumDetectors ;
126 fEventTag = tag.fEventTag ;
127 fDetectorTag = tag.fDetectorTag ;
128 fLHCTag = tag.fLHCTag ;
129 fQALength = tag.fQALength ;
135 fQA = new ULong_t[fQALength] ;
136 memcpy(fQA, tag.fQA, fQALength*sizeof(ULong_t)) ;
138 fESLength = tag.fESLength ;
140 delete [] fEventSpecies ;
142 fEventSpecies = NULL ;
144 fEventSpecies = new Bool_t[fESLength] ;
145 memcpy(fEventSpecies, tag.fEventSpecies, fESLength*sizeof(Bool_t)) ;
151 //___________________________________________________________________________
152 void AliRunTag::CopyStandardContent(AliRunTag *oldtag) {
153 //function that copies the run, lhc and detector levels
154 SetRunId(oldtag->GetRunId());
155 SetMagneticField(oldtag->GetMagneticField());
156 SetRunStartTime(oldtag->GetRunStartTime());
157 SetRunStopTime(oldtag->GetRunStopTime());
158 SetAlirootVersion(oldtag->GetAlirootVersion());
159 SetRootVersion(oldtag->GetRootVersion());
160 SetGeant3Version(oldtag->GetGeant3Version());
161 SetRunQuality(oldtag->GetRunQuality());
162 SetBeamEnergy(oldtag->GetBeamEnergy());
163 SetBeamType(oldtag->GetBeamType());
164 SetCalibVersion(oldtag->GetCalibVersion());
165 SetDataType(oldtag->GetDataType());
166 SetLHCTag(oldtag->GetLHCTag()->GetLuminosity(),oldtag->GetLHCTag()->GetLHCState());
167 SetDetectorTag(oldtag->GetDetectorTags()->GetIntDetectorMask());
168 SetQA(oldtag->GetQA(), oldtag->GetQALength()) ;
169 SetEventSpecies(oldtag->GetEventSpecies(), oldtag->GetESLength()) ;
172 //___________________________________________________________________________
173 void AliRunTag::SetQA(ULong_t * qa, Int_t qalength) {
174 //Setter for the qa bits
175 if (qa && qalength > 0) {
176 fQALength = qalength ;
179 fQA = new ULong_t[qalength] ;
180 memcpy(fQA, qa, qalength*sizeof(ULong_t)) ;
184 //___________________________________________________________________________
185 void AliRunTag::SetEventSpecies(Bool_t * es, Int_t eslength) {
186 //setter for the eventspecices
187 if (es && eslength >0 ) {
188 fESLength = eslength ;
190 delete [] fEventSpecies ;
191 fEventSpecies = new Bool_t[eslength] ;
192 memcpy(fEventSpecies, es, eslength*sizeof(Bool_t)) ;
197 //___________________________________________________________________________
198 void AliRunTag::SetLHCTag(Float_t lumin, TString type) {
199 //Setter for the LHC tags
200 fLHCTag.SetLHCTag(lumin,type);
203 //___________________________________________________________________________
204 void AliRunTag::SetDetectorTag(UInt_t mask) {
205 //Setter for the detector tags
206 fDetectorTag.SetDetectorMask(mask);
209 //___________________________________________________________________________
210 void AliRunTag::AddEventTag(const AliEventTag & EvTag) {
211 //Adds an entry to the event tag TClonesArray
212 new(fEventTag[fNumEvents++]) AliEventTag(EvTag);
215 //___________________________________________________________________________
216 void AliRunTag::Clear(const char *) {
217 //Resets the number of events and detectors
220 fDetectorTag.Clear();