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 fAliceDipoleField(0.0),
36 fAliceRunStartTime(0),
45 fAliceBeamEnergy(0.0),
47 fAliceCalibrationVersion(0),
51 fEventTag("AliEventTag", 1000),
63 //___________________________________________________________________________
64 AliRunTag::~AliRunTag() {
70 delete [] fEventSpecies ;
73 //___________________________________________________________________________
74 AliRunTag::AliRunTag(const AliRunTag& tag):
76 fAliceRunId(tag.fAliceRunId),
77 fAliceMagneticField(tag.fAliceMagneticField),
78 fAliceDipoleField(tag.fAliceDipoleField),
79 fAliceRunStartTime(tag.fAliceRunStartTime),
80 fAliceRunStopTime(fAliceRunStopTime),
81 fAlirootVersion(tag.fAlirootVersion),
82 fRootVersion(tag.fRootVersion),
83 fGeant3Version(tag.fGeant3Version),
84 fLHCPeriod(tag.fLHCPeriod),
85 fRecPass(tag.fRecPass),
86 fProductionName(tag.fProductionName),
87 fAliceRunQuality(tag.fAliceRunQuality),
88 fAliceBeamEnergy(tag.fAliceBeamEnergy),
89 fAliceBeamType(tag.fAliceBeamType),
90 fAliceCalibrationVersion(tag.fAliceCalibrationVersion),
91 fAliceDataType(tag.fAliceDataType),
92 fNumEvents(tag.fNumEvents),
93 fNumDetectors(tag.fNumDetectors),
94 fEventTag(tag.fEventTag),
95 fDetectorTag(tag.fDetectorTag),
98 fQALength(tag.fQALength),
100 fESLength(tag.fESLength),
107 fQAArray = new ULong_t[fQALength] ;
108 memcpy(fQAArray, tag.fQAArray, fQALength*sizeof(ULong_t)) ;
111 fEventSpecies = NULL ;
113 fEventSpecies = new Bool_t[fESLength] ;
114 memcpy(fEventSpecies, tag.fEventSpecies, fESLength*sizeof(Bool_t)) ;
118 //___________________________________________________________________________
119 AliRunTag& AliRunTag::operator = (const AliRunTag& tag) {
120 //assignment operator
122 fAliceRunId = tag.fAliceRunId ;
123 fAliceMagneticField = tag.fAliceMagneticField ;
124 fAliceDipoleField = tag.fAliceDipoleField ;
125 fAliceRunStartTime = tag.fAliceRunStartTime ;
126 fAliceRunStopTime = tag.fAliceRunStopTime ;
127 fAlirootVersion = tag.fAlirootVersion ;
128 fRootVersion = tag.fRootVersion ;
129 fGeant3Version = tag.fGeant3Version ;
130 fLHCPeriod = tag.fLHCPeriod ;
131 fRecPass = tag.fRecPass ;
132 fProductionName = tag.fProductionName ;
133 fAliceRunQuality = tag.fAliceRunQuality ;
134 fAliceBeamEnergy = tag.fAliceBeamEnergy ;
135 fAliceBeamType = tag.fAliceBeamType ;
136 fAliceCalibrationVersion = tag.fAliceCalibrationVersion ;
137 fAliceDataType = tag.fAliceDataType ;
138 fNumEvents = tag.fNumEvents ;
139 fNumDetectors = tag.fNumDetectors ;
140 fEventTag = tag.fEventTag ;
141 fDetectorTag = tag.fDetectorTag ;
142 fLHCTag = tag.fLHCTag ;
144 fQALength = tag.fQALength ;
150 fQAArray = new ULong_t[fQALength] ;
151 memcpy(fQAArray, tag.fQAArray, fQALength*sizeof(ULong_t)) ;
153 fESLength = tag.fESLength ;
155 delete [] fEventSpecies ;
157 fEventSpecies = NULL ;
159 fEventSpecies = new Bool_t[fESLength] ;
160 memcpy(fEventSpecies, tag.fEventSpecies, fESLength*sizeof(Bool_t)) ;
166 //___________________________________________________________________________
167 void AliRunTag::CopyStandardContent(AliRunTag *oldtag) {
168 //function that copies the run, lhc and detector levels
169 SetRunId(oldtag->GetRunId());
170 SetMagneticField(oldtag->GetMagneticField());
171 SetDipoleField(oldtag->GetDipoleField());
172 SetRunStartTime(oldtag->GetRunStartTime());
173 SetRunStopTime(oldtag->GetRunStopTime());
174 SetAlirootVersion(oldtag->GetAlirootVersion());
175 SetRootVersion(oldtag->GetRootVersion());
176 SetGeant3Version(oldtag->GetGeant3Version());
177 SetLHCPeriod(oldtag->GetLHCPeriod());
178 SetReconstructionPass(oldtag->GetReconstructionPass());
179 SetProductionName(oldtag->GetProductionName());
180 SetRunQuality(oldtag->GetRunQuality());
181 SetBeamEnergy(oldtag->GetBeamEnergy());
182 SetBeamType(oldtag->GetBeamType());
183 SetCalibVersion(oldtag->GetCalibVersion());
184 SetDataType(oldtag->GetDataType());
185 SetLHCTag(oldtag->GetLHCTag()->GetLuminosity(),oldtag->GetLHCTag()->GetLHCState());
186 SetDetectorTag(oldtag->GetDetectorTags()->GetIntDetectorMaskDAQ(), oldtag->GetDetectorTags()->GetIntDetectorMaskReco());
187 SetQA(*(oldtag->GetQA())) ;
188 SetQAArray(oldtag->GetQAArray(), oldtag->GetQALength()) ;
189 SetEventSpecies(oldtag->GetEventSpecies(), oldtag->GetESLength()) ;
192 //___________________________________________________________________________
193 void AliRunTag::SetQAArray(ULong_t * qa, Int_t qalength) {
194 //Setter for the qa bits
195 if (qa && qalength > 0) {
196 fQALength = qalength ;
199 fQAArray = new ULong_t[qalength] ;
200 memcpy(fQAArray, qa, qalength*sizeof(ULong_t)) ;
204 //___________________________________________________________________________
205 void AliRunTag::SetEventSpecies(Bool_t * es, Int_t eslength) {
206 //setter for the eventspecices
207 if (es && eslength >0 ) {
208 fESLength = eslength ;
210 delete [] fEventSpecies ;
211 fEventSpecies = new Bool_t[eslength] ;
212 memcpy(fEventSpecies, es, eslength*sizeof(Bool_t)) ;
217 //___________________________________________________________________________
218 void AliRunTag::SetLHCTag(Float_t lumin, TString type) {
219 //Setter for the LHC tags
220 fLHCTag.SetLHCTag(lumin,type);
223 //___________________________________________________________________________
224 void AliRunTag::SetDetectorTag(UInt_t mask, UInt_t maskReco) {
225 //Setter for the detector tags
226 fDetectorTag.SetDetectorMaskDAQ(mask);
228 fDetectorTag.SetDetectorMaskReco(mask);
230 fDetectorTag.SetDetectorMaskReco(maskReco);
233 for (int iter=0; iter<32; iter++)
234 ndet += (mask & (1 << iter)) > 0;
236 fNumDetectors = ndet;
239 //___________________________________________________________________________
240 void AliRunTag::AddEventTag(const AliEventTag & EvTag) {
241 //Adds an entry to the event tag TClonesArray
242 new(fEventTag[fNumEvents++]) AliEventTag(EvTag);
245 //___________________________________________________________________________
246 void AliRunTag::Clear(const char *) {
247 //Resets the number of events and detectors
250 fDetectorTag.Clear();
257 if ( fEventSpecies ) {
258 delete [] fEventSpecies ;