#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),
+ fAliceReconstructionVersion(0),
+ fAliceRunQuality(0),
+ fAliceBeamEnergy(0.0),
+ fAliceBeamType(""),
+ fAliceCalibrationVersion(0),
+ fAliceDataType(0),
+ fNumEvents(0),
+ fNumDetectors(0),
+ fEventTag("AliEventTag", 1000),
+ fDetectorTag("AliDetectorTag", 1000),
+ fLHCTag()
{
//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;
+ //Destructor
+ fEventTag.Delete();
+ fDetectorTag.Delete();
}
//______________________________________________________________________________
void AliRunTag::SetDetectorTag(const AliDetectorTag &DetTag)
{
//Setter for the detector tags
- TClonesArray &detectors = *fDetectorTag;
- new(detectors[fNumDetectors++]) AliDetectorTag(DetTag);
+ new(fDetectorTag[fNumDetectors++]) AliDetectorTag(DetTag);
}
//______________________________________________________________________________
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);
}
//______________________________________________________________________________
// Origin: Panos Christakoglou, UOA-CERN, Panos.Christakoglou@cern.ch
//-------------------------------------------------------------------------
-#include "TObject.h"
-
+#include <TObject.h>
+#include <TString.h>
+#include <TClonesArray.h>
#include "AliLHCTag.h"
class AliEventTag;
Int_t GetRecoVersion() const {return fAliceReconstructionVersion;}
Int_t GetRunQuality() const {return fAliceRunQuality;}
Float_t GetBeamEnergy() const {return fAliceBeamEnergy;}
- const char *GetBeamType() const {return fAliceBeamType;}
+ const char *GetBeamType() const {return fAliceBeamType.Data();}
Int_t GetCalibVersion() const {return fAliceCalibrationVersion;}
Int_t GetDataType() const {return fAliceDataType;}
Int_t GetNEvents() const {return fNumEvents;}
AliLHCTag *GetLHCTag() {return &fLHCTag; }
- TClonesArray *GetEventTags() const {return fEventTag;}
+ const TClonesArray *GetEventTags() const {return &fEventTag;}
+ const TClonesArray *GetDetectorTags() const {return &fDetectorTag;}
private:
Int_t fAliceRunId; //the run id
Int_t fAliceReconstructionVersion; //reco version
Bool_t fAliceRunQuality; //validation script
Float_t fAliceBeamEnergy; //beam energy cm
- const char *fAliceBeamType; //run type (pp, AA, pA)
+ TString fAliceBeamType; //run type (pp, AA, pA)
Int_t fAliceCalibrationVersion; //calibration version
Int_t fAliceDataType; //0: simulation -- 1: data
Int_t fNumEvents; //number of events per file
Int_t fNumDetectors; //number of detector configs per file
- TClonesArray *fEventTag; //array with all event tags
- TClonesArray *fDetectorTag; //array with all the detector tags
+ TClonesArray fEventTag; //array with all event tags
+ TClonesArray fDetectorTag; //array with all the detector tags
AliLHCTag fLHCTag; //LHC tag object
- static TClonesArray *fgEvents; //static Event tag TClonesArray
- static TClonesArray *fgDetectors; //static Detector tag TClonesArray
-
-
ClassDef(AliRunTag,1) //(ClassName, ClassVersion)
};
//______________________________________________________________________________