]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Simplified data structure
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 17 Nov 2005 22:27:10 +0000 (22:27 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 17 Nov 2005 22:27:10 +0000 (22:27 +0000)
STEER/AliRunTag.cxx
STEER/AliRunTag.h

index eca6984f837cc81cff85aa70aee14cb90435747d..c6b2ad473b7e42755b8fcc9b38b45e18b211473e 100644 (file)
 #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();
 }
 
 //______________________________________________________________________________
@@ -73,16 +68,14 @@ void AliRunTag::SetLHCTag(Float_t lumin, char *type)
 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);
 }
 
 //______________________________________________________________________________
index d1a4ce86790c2667503d63f92f0eb917beff9cc3..8fc27ed1520c4a80538b20443e0e1c0866bc2627 100644 (file)
@@ -13,8 +13,9 @@
 //    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;
@@ -55,7 +56,7 @@ class AliRunTag : public TObject
   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;}
@@ -63,7 +64,8 @@ class AliRunTag : public TObject
   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
@@ -73,22 +75,18 @@ class AliRunTag : public TObject
   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)
 };
 //______________________________________________________________________________