]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliRunTag.cxx
EMD DA updated
[u/mrichter/AliRoot.git] / STEER / AliRunTag.cxx
index 95f74f7c72aa6f846541cacfdf8b9bc1e2eeb106..38844880833ebef4e8b043e217876000454bdf3a 100644 (file)
@@ -47,7 +47,11 @@ ClassImp(AliRunTag)
     fEventTag("AliEventTag", 1000),
     fDetectorTag(),
     fLHCTag(), 
-    fQA()
+    fQA(),  
+    fQALength(0), 
+    fQAArray(NULL), 
+    fESLength(0), 
+    fEventSpecies(NULL)
 {
   //Default constructor
 }
@@ -56,6 +60,95 @@ ClassImp(AliRunTag)
 AliRunTag::~AliRunTag() {
   //Destructor
   fEventTag.Delete();
+  if ( fQAArray ) 
+    delete [] fQAArray ; 
+  if ( fEventSpecies )
+    delete [] fEventSpecies ; 
+}
+
+//___________________________________________________________________________
+AliRunTag::AliRunTag(const AliRunTag& tag):
+TObject(),
+fAliceRunId(tag.fAliceRunId),
+fAliceMagneticField(tag.fAliceMagneticField),
+fAliceRunStartTime(tag.fAliceRunStartTime),
+fAliceRunStopTime(fAliceRunStopTime),
+fAlirootVersion(tag.fAlirootVersion),
+fRootVersion(tag.fRootVersion),
+fGeant3Version(tag.fGeant3Version),
+fAliceRunQuality(tag.fAliceRunQuality),
+fAliceBeamEnergy(tag.fAliceBeamEnergy),
+fAliceBeamType(tag.fAliceBeamType),
+fAliceCalibrationVersion(tag.fAliceCalibrationVersion),
+fAliceDataType(tag.fAliceDataType),
+fNumEvents(tag.fNumEvents),
+fNumDetectors(tag.fNumDetectors),
+fEventTag(tag.fEventTag),
+fDetectorTag(tag.fDetectorTag),
+fLHCTag(tag.fLHCTag), 
+fQA(tag.fQA),
+fQALength(tag.fQALength),
+fQAArray(NULL), 
+fESLength(tag.fESLength),
+fEventSpecies(NULL)
+{
+  //copy constructor
+  if (fQALength == 0 ) 
+    fQAArray = NULL ; 
+  else {
+    fQAArray = new ULong_t[fQALength] ; 
+    memcpy(fQAArray, tag.fQAArray, fQALength*sizeof(ULong_t)) ;
+  }
+  if (fESLength == 0 ) 
+    fEventSpecies = NULL ; 
+  else {
+    fEventSpecies = new Bool_t[fESLength] ; 
+    memcpy(fEventSpecies, tag.fEventSpecies, fESLength*sizeof(Bool_t)) ;
+  }
+}
+
+//___________________________________________________________________________
+AliRunTag& AliRunTag::operator = (const AliRunTag& tag) {
+//assignment operator
+  if(&tag != this) {
+    fAliceRunId               = tag.fAliceRunId ; 
+    fAliceMagneticField       = tag.fAliceMagneticField ;
+    fAliceRunStartTime        = tag.fAliceRunStartTime ; 
+    fAliceRunStopTime         = tag.fAliceRunStopTime ; 
+    fAlirootVersion           = tag.fAlirootVersion ; 
+    fRootVersion              = tag.fRootVersion ;
+    fGeant3Version            = tag.fGeant3Version ; 
+    fAliceRunQuality          = tag.fAliceRunQuality ; 
+    fAliceBeamEnergy          = tag.fAliceBeamEnergy ;
+    fAliceBeamType            = tag.fAliceBeamType ; 
+    fAliceCalibrationVersion  = tag.fAliceCalibrationVersion ; 
+    fAliceDataType            = tag.fAliceDataType ; 
+    fNumEvents                = tag.fNumEvents ;
+    fNumDetectors             = tag.fNumDetectors ; 
+    fEventTag                 = tag.fEventTag ;
+    fDetectorTag              = tag.fDetectorTag ;
+    fLHCTag                   = tag.fLHCTag ;  
+    fQA                       = tag.fQA ;      
+    fQALength                 = tag.fQALength ; 
+    if (fQAArray) 
+      delete [] fQAArray ; 
+    if (fQALength == 0 ) 
+      fQAArray = NULL ; 
+    else {
+      fQAArray = new ULong_t[fQALength] ; 
+      memcpy(fQAArray, tag.fQAArray, fQALength*sizeof(ULong_t)) ;
+    }
+    fESLength                 = tag.fESLength ; 
+    if (fEventSpecies)
+      delete [] fEventSpecies ; 
+    if (fESLength == 0 ) 
+      fEventSpecies = NULL ; 
+    else {
+      fEventSpecies = new Bool_t[fESLength] ; 
+      memcpy(fEventSpecies, tag.fEventSpecies, fESLength*sizeof(Bool_t)) ;
+    }
+  }
+  return *this ; 
 }
 
 //___________________________________________________________________________
@@ -76,8 +169,35 @@ void AliRunTag::CopyStandardContent(AliRunTag *oldtag) {
   SetLHCTag(oldtag->GetLHCTag()->GetLuminosity(),oldtag->GetLHCTag()->GetLHCState());
   SetDetectorTag(oldtag->GetDetectorTags()->GetIntDetectorMask());
   SetQA(*(oldtag->GetQA())) ;          
+  SetQAArray(oldtag->GetQAArray(), oldtag->GetQALength()) ;  
+       SetEventSpecies(oldtag->GetEventSpecies(), oldtag->GetESLength()) ;  
 }
 
+//___________________________________________________________________________
+void AliRunTag::SetQAArray(ULong_t * qa, Int_t qalength) {
+  //Setter for the qa bits 
+  if (qa && qalength > 0) {
+    fQALength = qalength ; 
+    if (fQAArray) 
+      delete [] fQAArray ; 
+    fQAArray = new ULong_t[qalength] ; 
+    memcpy(fQAArray, qa, qalength*sizeof(ULong_t)) ;
+  }
+}
+
+//___________________________________________________________________________
+void AliRunTag::SetEventSpecies(Bool_t * es, Int_t eslength) {
+  //setter for the eventspecices 
+  if (es && eslength >0 ) {
+    fESLength = eslength ; 
+    if (fEventSpecies) 
+      delete [] fEventSpecies ; 
+    fEventSpecies = new Bool_t[eslength] ;
+    memcpy(fEventSpecies, es, eslength*sizeof(Bool_t)) ; 
+  }
+}
+
+
 //___________________________________________________________________________
 void AliRunTag::SetLHCTag(Float_t lumin, TString type) {
   //Setter for the LHC tags
@@ -99,8 +219,18 @@ void AliRunTag::AddEventTag(const AliEventTag & EvTag) {
 //___________________________________________________________________________
 void AliRunTag::Clear(const char *) {
   //Resets the number of events and detectors
-  fEventTag.Clear();
+  fEventTag.Delete();
   fNumEvents = 0;
   fDetectorTag.Clear();
   fNumDetectors = 0;
+  if ( fQAArray ) {
+    delete [] fQAArray ;
+    fQAArray = 0x0;
+  } 
+  fQALength=0;
+  if ( fEventSpecies ) {
+    delete [] fEventSpecies ;
+    fEventSpecies = 0x0;
+  } 
+  fESLength=0;
 }