Initialization of data members
[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
e16601cf 28class AliLHCTag;
29
f3a97c86 30ClassImp(AliRunTag)
31
32TClonesArray *AliRunTag::fgEvents = 0;
33TClonesArray *AliRunTag::fgDetectors = 0;
34
35//______________________________________________________________________________
36AliRunTag::AliRunTag()
37{
e16601cf 38 //Default constructor
f3a97c86 39 if (!fgEvents) fgEvents = new TClonesArray("AliEventTag", 1000);
40 fEventTag = fgEvents;
41 fNumEvents = 0;
42
43 if (!fgDetectors) fgDetectors = new TClonesArray("AliDetectorTag", 1000);
44 fDetectorTag = fgDetectors;
45 fNumDetectors = 0;
46
47 fAliceMagneticField = 0.0;
48 fAliceRunStartTime = 0;
49 fAliceRunStopTime = 0;
50 fAliceReconstructionVersion = 0;
51 fAliceRunQuality = 0;
52 fAliceBeamEnergy = 0.0;
53 fAliceCalibrationVersion = 0;
54 fAliceDataType = 0;
55}
56
57//______________________________________________________________________________
58AliRunTag::~AliRunTag()
59{
e16601cf 60 //Default destructor
61 delete fEventTag;
62 delete fDetectorTag;
f3a97c86 63}
64
65//______________________________________________________________________________
66void AliRunTag::SetLHCTag(Float_t lumin, char *type)
67{
e16601cf 68 //Setter for the LHC tags
f3a97c86 69 fLHCTag.SetLHCTag(lumin,type);
70}
71
72//______________________________________________________________________________
e16601cf 73void AliRunTag::SetDetectorTag(const AliDetectorTag &DetTag)
f3a97c86 74{
e16601cf 75 //Setter for the detector tags
f3a97c86 76 TClonesArray &detectors = *fDetectorTag;
77 new(detectors[fNumDetectors++]) AliDetectorTag(DetTag);
78}
79
80//______________________________________________________________________________
cb1645b7 81void AliRunTag::AddEventTag(const AliEventTag & EvTag)
f3a97c86 82{
e16601cf 83 //Adds an entry to the event tag TClonesArray
f3a97c86 84 TClonesArray &events = *fEventTag;
85 new(events[fNumEvents++]) AliEventTag(EvTag);
86}
87
88//______________________________________________________________________________
89void AliRunTag::Clear(const char *)
90{
e16601cf 91 //Resets the number of events and detectors
f3a97c86 92 fNumEvents = 0;
93 fNumDetectors = 0;
94}