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 memcpy(fEventSpecies, tag.fEventSpecies, fESLength*sizeof(Bool_t)) ;
150 //___________________________________________________________________________
151 void AliRunTag::CopyStandardContent(AliRunTag *oldtag) {
152 //function that copies the run, lhc and detector levels
153 SetRunId(oldtag->GetRunId());
154 SetMagneticField(oldtag->GetMagneticField());
155 SetRunStartTime(oldtag->GetRunStartTime());
156 SetRunStopTime(oldtag->GetRunStopTime());
157 SetAlirootVersion(oldtag->GetAlirootVersion());
158 SetRootVersion(oldtag->GetRootVersion());
159 SetGeant3Version(oldtag->GetGeant3Version());
160 SetRunQuality(oldtag->GetRunQuality());
161 SetBeamEnergy(oldtag->GetBeamEnergy());
162 SetBeamType(oldtag->GetBeamType());
163 SetCalibVersion(oldtag->GetCalibVersion());
164 SetDataType(oldtag->GetDataType());
165 SetLHCTag(oldtag->GetLHCTag()->GetLuminosity(),oldtag->GetLHCTag()->GetLHCState());
166 SetDetectorTag(oldtag->GetDetectorTags()->GetIntDetectorMask());
167 SetQA(oldtag->GetQA(), oldtag->GetQALength()) ;
168 SetEventSpecies(oldtag->GetEventSpecies(), oldtag->GetESLength()) ;
171 //___________________________________________________________________________
172 void AliRunTag::SetQA(ULong_t * qa, Int_t qalength) {
173 //Setter for the qa bits
174 fQALength = qalength ;
177 fQA = new ULong_t(qalength) ;
178 memcpy(fQA, qa, qalength*sizeof(ULong_t)) ;
181 //___________________________________________________________________________
182 void AliRunTag::SetEventSpecies(Bool_t * es, Int_t eslength) {
183 //setter for the eventspecices
184 fESLength = eslength ;
186 delete [] fEventSpecies ;
187 fEventSpecies = new Bool_t(eslength) ;
188 memcpy(fEventSpecies, es, eslength*sizeof(Bool_t)) ;
192 //___________________________________________________________________________
193 void AliRunTag::SetLHCTag(Float_t lumin, TString type) {
194 //Setter for the LHC tags
195 fLHCTag.SetLHCTag(lumin,type);
198 //___________________________________________________________________________
199 void AliRunTag::SetDetectorTag(UInt_t mask) {
200 //Setter for the detector tags
201 fDetectorTag.SetDetectorMask(mask);
204 //___________________________________________________________________________
205 void AliRunTag::AddEventTag(const AliEventTag & EvTag) {
206 //Adds an entry to the event tag TClonesArray
207 new(fEventTag[fNumEvents++]) AliEventTag(EvTag);
210 //___________________________________________________________________________
211 void AliRunTag::Clear(const char *) {
212 //Resets the number of events and detectors
215 fDetectorTag.Clear();