#include "AliDetectorTag.h"
#include "AliEventTag.h"
-class AliLHCTag;
-
ClassImp(AliRunTag)
-TClonesArray *AliRunTag::fgEvents = 0;
-TClonesArray *AliRunTag::fgDetectors = 0;
-
-//______________________________________________________________________________
-AliRunTag::AliRunTag()
+//___________________________________________________________________________
+ AliRunTag::AliRunTag() :
+ TObject(),
+ fAliceRunId(-1),
+ fAliceMagneticField(0.0),
+ fAliceRunStartTime(0),
+ fAliceRunStopTime(0),
+ fAlirootVersion(0),
+ fRootVersion(0),
+ fGeant3Version(0),
+ fAliceRunQuality(0),
+ fAliceBeamEnergy(0.0),
+ fAliceBeamType(0),
+ fAliceCalibrationVersion(0),
+ fAliceDataType(0),
+ fNumEvents(0),
+ fNumDetectors(0),
+ fEventTag("AliEventTag", 1000),
+ fDetectorTag(),
+ fLHCTag(),
+ fQA()
{
//Default constructor
- if (!fgEvents) fgEvents = new TClonesArray("AliEventTag", 1000);
- fEventTag = fgEvents;
- fNumEvents = 0;
-
- if (!fgDetectors) fgDetectors = new TClonesArray("AliDetectorTag", 1000);
- fDetectorTag = fgDetectors;
- fNumDetectors = 0;
-
- fAliceMagneticField = 0.0;
- fAliceRunStartTime = 0;
- fAliceRunStopTime = 0;
- fAliceReconstructionVersion = 0;
- fAliceRunQuality = 0;
- fAliceBeamEnergy = 0.0;
- fAliceCalibrationVersion = 0;
- fAliceDataType = 0;
}
-//______________________________________________________________________________
-AliRunTag::~AliRunTag()
-{
- //Default destructor
- delete fEventTag;
- delete fDetectorTag;
+//___________________________________________________________________________
+AliRunTag::~AliRunTag() {
+ //Destructor
+ fEventTag.Delete();
}
-//______________________________________________________________________________
-void AliRunTag::SetLHCTag(Float_t lumin, char *type)
-{
+//___________________________________________________________________________
+void AliRunTag::CopyStandardContent(AliRunTag *oldtag) {
+ //function that copies the run, lhc and detector levels
+ SetRunId(oldtag->GetRunId());
+ SetMagneticField(oldtag->GetMagneticField());
+ SetRunStartTime(oldtag->GetRunStartTime());
+ SetRunStopTime(oldtag->GetRunStopTime());
+ SetAlirootVersion(oldtag->GetAlirootVersion());
+ SetRootVersion(oldtag->GetRootVersion());
+ SetGeant3Version(oldtag->GetGeant3Version());
+ SetRunQuality(oldtag->GetRunQuality());
+ SetBeamEnergy(oldtag->GetBeamEnergy());
+ SetBeamType(oldtag->GetBeamType());
+ SetCalibVersion(oldtag->GetCalibVersion());
+ SetDataType(oldtag->GetDataType());
+ SetLHCTag(oldtag->GetLHCTag()->GetLuminosity(),oldtag->GetLHCTag()->GetLHCState());
+ SetDetectorTag(oldtag->GetDetectorTags()->GetIntDetectorMask());
+ SetQA(*(oldtag->GetQA())) ;
+}
+
+//___________________________________________________________________________
+void AliRunTag::SetLHCTag(Float_t lumin, TString type) {
//Setter for the LHC tags
fLHCTag.SetLHCTag(lumin,type);
}
-//______________________________________________________________________________
-void AliRunTag::SetDetectorTag(const AliDetectorTag &DetTag)
-{
+//___________________________________________________________________________
+void AliRunTag::SetDetectorTag(UInt_t mask) {
//Setter for the detector tags
- TClonesArray &detectors = *fDetectorTag;
- new(detectors[fNumDetectors++]) AliDetectorTag(DetTag);
+ fDetectorTag.SetDetectorMask(mask);
}
-//______________________________________________________________________________
-void AliRunTag::AddEventTag(const AliEventTag & EvTag)
-{
+//___________________________________________________________________________
+void AliRunTag::AddEventTag(const AliEventTag & EvTag) {
//Adds an entry to the event tag TClonesArray
- TClonesArray &events = *fEventTag;
- new(events[fNumEvents++]) AliEventTag(EvTag);
+ new(fEventTag[fNumEvents++]) AliEventTag(EvTag);
}
-//______________________________________________________________________________
-void AliRunTag::Clear(const char *)
-{
+//___________________________________________________________________________
+void AliRunTag::Clear(const char *) {
//Resets the number of events and detectors
+ fEventTag.Clear();
fNumEvents = 0;
+ fDetectorTag.Clear();
fNumDetectors = 0;
}