]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/AliRunTag.cxx
Added possibility to invert the sign of the parametization
[u/mrichter/AliRoot.git] / STEER / AliRunTag.cxx
CommitLineData
f3a97c86 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 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//-----------------------------------------------------------------
23
f3a97c86 24#include "AliRunTag.h"
f3a97c86 25#include "AliDetectorTag.h"
26#include "AliEventTag.h"
27
28ClassImp(AliRunTag)
29
bec9a2e7 30//___________________________________________________________________________
17a9d008 31 AliRunTag::AliRunTag() :
32 TObject(),
33 fAliceRunId(-1),
34 fAliceMagneticField(0.0),
850d5792 35 fAliceDipoleField(0.0),
17a9d008 36 fAliceRunStartTime(0),
37 fAliceRunStopTime(0),
bec9a2e7 38 fAlirootVersion(0),
39 fRootVersion(0),
40 fGeant3Version(0),
850d5792 41 fLHCPeriod(0),
42 fRecPass(0),
43 fProductionName(0),
17a9d008 44 fAliceRunQuality(0),
45 fAliceBeamEnergy(0.0),
bec9a2e7 46 fAliceBeamType(0),
17a9d008 47 fAliceCalibrationVersion(0),
48 fAliceDataType(0),
49 fNumEvents(0),
50 fNumDetectors(0),
51 fEventTag("AliEventTag", 1000),
c5caed45 52 fDetectorTag(),
46af88be 53 fLHCTag(),
9ee5d033 54 fQA(),
27293674 55 fQALength(0),
9ee5d033 56 fQAArray(NULL),
27293674 57 fESLength(0),
58 fEventSpecies(NULL)
f3a97c86 59{
e16601cf 60 //Default constructor
f3a97c86 61}
62
bec9a2e7 63//___________________________________________________________________________
64AliRunTag::~AliRunTag() {
17a9d008 65 //Destructor
66 fEventTag.Delete();
9ee5d033 67 if ( fQAArray )
68 delete [] fQAArray ;
27293674 69 if ( fEventSpecies )
70 delete [] fEventSpecies ;
71}
72
73//___________________________________________________________________________
74AliRunTag::AliRunTag(const AliRunTag& tag):
75TObject(),
76fAliceRunId(tag.fAliceRunId),
77fAliceMagneticField(tag.fAliceMagneticField),
850d5792 78fAliceDipoleField(tag.fAliceDipoleField),
27293674 79fAliceRunStartTime(tag.fAliceRunStartTime),
80fAliceRunStopTime(fAliceRunStopTime),
81fAlirootVersion(tag.fAlirootVersion),
82fRootVersion(tag.fRootVersion),
83fGeant3Version(tag.fGeant3Version),
850d5792 84fLHCPeriod(tag.fLHCPeriod),
85fRecPass(tag.fRecPass),
86fProductionName(tag.fProductionName),
27293674 87fAliceRunQuality(tag.fAliceRunQuality),
88fAliceBeamEnergy(tag.fAliceBeamEnergy),
89fAliceBeamType(tag.fAliceBeamType),
90fAliceCalibrationVersion(tag.fAliceCalibrationVersion),
91fAliceDataType(tag.fAliceDataType),
92fNumEvents(tag.fNumEvents),
93fNumDetectors(tag.fNumDetectors),
94fEventTag(tag.fEventTag),
95fDetectorTag(tag.fDetectorTag),
96fLHCTag(tag.fLHCTag),
9ee5d033 97fQA(tag.fQA),
27293674 98fQALength(tag.fQALength),
9ee5d033 99fQAArray(NULL),
27293674 100fESLength(tag.fESLength),
101fEventSpecies(NULL)
102{
103 //copy constructor
104 if (fQALength == 0 )
9ee5d033 105 fQAArray = NULL ;
27293674 106 else {
9ee5d033 107 fQAArray = new ULong_t[fQALength] ;
108 memcpy(fQAArray, tag.fQAArray, fQALength*sizeof(ULong_t)) ;
27293674 109 }
110 if (fESLength == 0 )
111 fEventSpecies = NULL ;
112 else {
e1ffd6bc 113 fEventSpecies = new Bool_t[fESLength] ;
27293674 114 memcpy(fEventSpecies, tag.fEventSpecies, fESLength*sizeof(Bool_t)) ;
115 }
116}
117
118//___________________________________________________________________________
119AliRunTag& AliRunTag::operator = (const AliRunTag& tag) {
120//assignment operator
121 if(&tag != this) {
122 fAliceRunId = tag.fAliceRunId ;
123 fAliceMagneticField = tag.fAliceMagneticField ;
850d5792 124 fAliceDipoleField = tag.fAliceDipoleField ;
27293674 125 fAliceRunStartTime = tag.fAliceRunStartTime ;
126 fAliceRunStopTime = tag.fAliceRunStopTime ;
127 fAlirootVersion = tag.fAlirootVersion ;
128 fRootVersion = tag.fRootVersion ;
129 fGeant3Version = tag.fGeant3Version ;
850d5792 130 fLHCPeriod = tag.fLHCPeriod ;
131 fRecPass = tag.fRecPass ;
132 fProductionName = tag.fProductionName ;
27293674 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 ;
9ee5d033 143 fQA = tag.fQA ;
27293674 144 fQALength = tag.fQALength ;
9ee5d033 145 if (fQAArray)
146 delete [] fQAArray ;
27293674 147 if (fQALength == 0 )
9ee5d033 148 fQAArray = NULL ;
27293674 149 else {
9ee5d033 150 fQAArray = new ULong_t[fQALength] ;
151 memcpy(fQAArray, tag.fQAArray, fQALength*sizeof(ULong_t)) ;
27293674 152 }
153 fESLength = tag.fESLength ;
154 if (fEventSpecies)
155 delete [] fEventSpecies ;
156 if (fESLength == 0 )
157 fEventSpecies = NULL ;
158 else {
e1ffd6bc 159 fEventSpecies = new Bool_t[fESLength] ;
27293674 160 memcpy(fEventSpecies, tag.fEventSpecies, fESLength*sizeof(Bool_t)) ;
161 }
162 }
163 return *this ;
f3a97c86 164}
165
4c117ffd 166//___________________________________________________________________________
167void AliRunTag::CopyStandardContent(AliRunTag *oldtag) {
168 //function that copies the run, lhc and detector levels
169 SetRunId(oldtag->GetRunId());
170 SetMagneticField(oldtag->GetMagneticField());
850d5792 171 SetDipoleField(oldtag->GetDipoleField());
4c117ffd 172 SetRunStartTime(oldtag->GetRunStartTime());
173 SetRunStopTime(oldtag->GetRunStopTime());
174 SetAlirootVersion(oldtag->GetAlirootVersion());
175 SetRootVersion(oldtag->GetRootVersion());
176 SetGeant3Version(oldtag->GetGeant3Version());
850d5792 177 SetLHCPeriod(oldtag->GetLHCPeriod());
178 SetReconstructionPass(oldtag->GetReconstructionPass());
179 SetProductionName(oldtag->GetProductionName());
4c117ffd 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());
52314abc 186 SetDetectorTag(oldtag->GetDetectorTags()->GetIntDetectorMask());
9ee5d033 187 SetQA(*(oldtag->GetQA())) ;
188 SetQAArray(oldtag->GetQAArray(), oldtag->GetQALength()) ;
850d5792 189 SetEventSpecies(oldtag->GetEventSpecies(), oldtag->GetESLength()) ;
4c117ffd 190}
191
27293674 192//___________________________________________________________________________
9ee5d033 193void AliRunTag::SetQAArray(ULong_t * qa, Int_t qalength) {
27293674 194 //Setter for the qa bits
e1ffd6bc 195 if (qa && qalength > 0) {
196 fQALength = qalength ;
9ee5d033 197 if (fQAArray)
198 delete [] fQAArray ;
199 fQAArray = new ULong_t[qalength] ;
200 memcpy(fQAArray, qa, qalength*sizeof(ULong_t)) ;
e1ffd6bc 201 }
27293674 202}
203
204//___________________________________________________________________________
205void AliRunTag::SetEventSpecies(Bool_t * es, Int_t eslength) {
206 //setter for the eventspecices
e1ffd6bc 207 if (es && eslength >0 ) {
208 fESLength = eslength ;
209 if (fEventSpecies)
210 delete [] fEventSpecies ;
211 fEventSpecies = new Bool_t[eslength] ;
212 memcpy(fEventSpecies, es, eslength*sizeof(Bool_t)) ;
213 }
27293674 214}
215
216
bec9a2e7 217//___________________________________________________________________________
c5caed45 218void AliRunTag::SetLHCTag(Float_t lumin, TString type) {
e16601cf 219 //Setter for the LHC tags
f3a97c86 220 fLHCTag.SetLHCTag(lumin,type);
221}
222
bec9a2e7 223//___________________________________________________________________________
c5caed45 224void AliRunTag::SetDetectorTag(UInt_t mask) {
e16601cf 225 //Setter for the detector tags
c5caed45 226 fDetectorTag.SetDetectorMask(mask);
850d5792 227 fNumDetectors = fDetectorTag.GetDetectorMask()->GetEntries();
f3a97c86 228}
229
bec9a2e7 230//___________________________________________________________________________
231void AliRunTag::AddEventTag(const AliEventTag & EvTag) {
e16601cf 232 //Adds an entry to the event tag TClonesArray
17a9d008 233 new(fEventTag[fNumEvents++]) AliEventTag(EvTag);
f3a97c86 234}
235
bec9a2e7 236//___________________________________________________________________________
237void AliRunTag::Clear(const char *) {
e16601cf 238 //Resets the number of events and detectors
9c23604f 239 fEventTag.Delete();
f3a97c86 240 fNumEvents = 0;
fed6034e 241 fDetectorTag.Clear();
f3a97c86 242 fNumDetectors = 0;
a9d95c96 243 if ( fQAArray ) {
244 delete [] fQAArray ;
245 fQAArray = 0x0;
246 }
b9f60f9d 247 fQALength=0;
a9d95c96 248 if ( fEventSpecies ) {
249 delete [] fEventSpecies ;
250 fEventSpecies = 0x0;
251 }
b9f60f9d 252 fESLength=0;
f3a97c86 253}