From 9ee5d0333e24b078e73b92422fdf892702ef267c Mon Sep 17 00:00:00 2001 From: schutz Date: Fri, 1 May 2009 14:08:50 +0000 Subject: [PATCH] correg savannah bug 48629 --- STEER/AliESDTagCreator.cxx | 2 +- STEER/AliQAManager.cxx | 2 +- STEER/AliRunTag.cxx | 40 +++++++++++++++++++++----------------- STEER/AliRunTag.h | 12 ++++++++---- 4 files changed, 32 insertions(+), 24 deletions(-) diff --git a/STEER/AliESDTagCreator.cxx b/STEER/AliESDTagCreator.cxx index 1635d263a02..9d33e1f3365 100644 --- a/STEER/AliESDTagCreator.cxx +++ b/STEER/AliESDTagCreator.cxx @@ -1552,7 +1552,7 @@ void AliESDTagCreator::CreateESDTags(Int_t fFirstEvent, Int_t fLastEvent, AliGRP tag->SetBeamType(beamtype); //QA setting - tag->SetQA(qa, qalength) ; + tag->SetQAArray(qa, qalength) ; tag->SetEventSpecies(es, eslength) ; tag->AddEventTag(*evTag); diff --git a/STEER/AliQAManager.cxx b/STEER/AliQAManager.cxx index 20dcb306814..6aca2186966 100644 --- a/STEER/AliQAManager.cxx +++ b/STEER/AliQAManager.cxx @@ -396,7 +396,7 @@ AliQA * AliQAManager::GetQA(UInt_t run, UInt_t evt) AliRunTag * tag = new AliRunTag ; tagTree->SetBranchAddress("AliTAG", &tag) ; tagTree->GetEntry(evt) ; - AliQA * qa = AliQA::Instance(tag->GetQALength(), tag->GetQA(), tag->GetESLength(), tag->GetEventSpecies()) ; + AliQA * qa = AliQA::Instance(tag->GetQALength(), tag->GetQAArray(), tag->GetESLength(), tag->GetEventSpecies()) ; tagFile->Close() ; return qa ; } diff --git a/STEER/AliRunTag.cxx b/STEER/AliRunTag.cxx index dae219139c9..e5b8d558943 100644 --- a/STEER/AliRunTag.cxx +++ b/STEER/AliRunTag.cxx @@ -47,8 +47,9 @@ ClassImp(AliRunTag) fEventTag("AliEventTag", 1000), fDetectorTag(), fLHCTag(), + fQA(), fQALength(0), - fQA(NULL), + fQAArray(NULL), fESLength(0), fEventSpecies(NULL) { @@ -59,8 +60,8 @@ ClassImp(AliRunTag) AliRunTag::~AliRunTag() { //Destructor fEventTag.Delete(); - if ( fQA ) - delete [] fQA ; + if ( fQAArray ) + delete [] fQAArray ; if ( fEventSpecies ) delete [] fEventSpecies ; } @@ -85,17 +86,18 @@ fNumDetectors(tag.fNumDetectors), fEventTag(tag.fEventTag), fDetectorTag(tag.fDetectorTag), fLHCTag(tag.fLHCTag), +fQA(tag.fQA), fQALength(tag.fQALength), -fQA(NULL), +fQAArray(NULL), fESLength(tag.fESLength), fEventSpecies(NULL) { //copy constructor if (fQALength == 0 ) - fQA = NULL ; + fQAArray = NULL ; else { - fQA = new ULong_t[fQALength] ; - memcpy(fQA, tag.fQA, fQALength*sizeof(ULong_t)) ; + fQAArray = new ULong_t[fQALength] ; + memcpy(fQAArray, tag.fQAArray, fQALength*sizeof(ULong_t)) ; } if (fESLength == 0 ) fEventSpecies = NULL ; @@ -126,14 +128,15 @@ AliRunTag& AliRunTag::operator = (const AliRunTag& tag) { fEventTag = tag.fEventTag ; fDetectorTag = tag.fDetectorTag ; fLHCTag = tag.fLHCTag ; + fQA = tag.fQA ; fQALength = tag.fQALength ; - if (fQA) - delete [] fQA ; + if (fQAArray) + delete [] fQAArray ; if (fQALength == 0 ) - fQA = NULL ; + fQAArray = NULL ; else { - fQA = new ULong_t[fQALength] ; - memcpy(fQA, tag.fQA, fQALength*sizeof(ULong_t)) ; + fQAArray = new ULong_t[fQALength] ; + memcpy(fQAArray, tag.fQAArray, fQALength*sizeof(ULong_t)) ; } fESLength = tag.fESLength ; if (fEventSpecies) @@ -165,19 +168,20 @@ void AliRunTag::CopyStandardContent(AliRunTag *oldtag) { SetDataType(oldtag->GetDataType()); SetLHCTag(oldtag->GetLHCTag()->GetLuminosity(),oldtag->GetLHCTag()->GetLHCState()); SetDetectorTag(oldtag->GetDetectorTags()->GetIntDetectorMask()); - SetQA(oldtag->GetQA(), oldtag->GetQALength()) ; + SetQA(*(oldtag->GetQA())) ; + SetQAArray(oldtag->GetQAArray(), oldtag->GetQALength()) ; SetEventSpecies(oldtag->GetEventSpecies(), oldtag->GetESLength()) ; } //___________________________________________________________________________ -void AliRunTag::SetQA(ULong_t * qa, Int_t qalength) { +void AliRunTag::SetQAArray(ULong_t * qa, Int_t qalength) { //Setter for the qa bits if (qa && qalength > 0) { fQALength = qalength ; - if (fQA) - delete [] fQA ; - fQA = new ULong_t[qalength] ; - memcpy(fQA, qa, qalength*sizeof(ULong_t)) ; + if (fQAArray) + delete [] fQAArray ; + fQAArray = new ULong_t[qalength] ; + memcpy(fQAArray, qa, qalength*sizeof(ULong_t)) ; } } diff --git a/STEER/AliRunTag.h b/STEER/AliRunTag.h index 7b22157f4df..7672f8bd205 100644 --- a/STEER/AliRunTag.h +++ b/STEER/AliRunTag.h @@ -18,6 +18,7 @@ #include #include "AliLHCTag.h" #include "AliDetectorTag.h" +#include "AliQA.h" class AliEventTag; //class AliDetectorTag; @@ -46,7 +47,8 @@ class AliRunTag : public TObject { void SetNEvents(Int_t Pn) { fNumEvents = Pn; } void SetLHCTag(Float_t Plumin, TString type); void SetDetectorTag(UInt_t mask); - void SetQA(ULong_t * qa, Int_t qalength) ; + void SetQA(const AliQA &qa) { fQA=qa; } + void SetQAArray(ULong_t * qa, Int_t qalength) ; void SetEventSpecies(Bool_t * es, Int_t eslength) ; void AddEventTag(const AliEventTag &t); void Clear(const char * opt = ""); @@ -70,7 +72,8 @@ class AliRunTag : public TObject { AliLHCTag *GetLHCTag() {return &fLHCTag; } AliDetectorTag *GetDetectorTags() {return &fDetectorTag;} const TClonesArray *GetEventTags() const {return &fEventTag;} - ULong_t * GetQA() const {return fQA;} + const AliQA *GetQA() const {return &fQA;} + ULong_t * GetQAArray() const {return fQAArray;} Int_t GetQALength() const { return fQALength ; } Bool_t * GetEventSpecies() const {return fEventSpecies;} Int_t GetESLength() const { return fESLength ; } @@ -94,12 +97,13 @@ class AliRunTag : public TObject { TClonesArray fEventTag; //array with all event tags AliDetectorTag fDetectorTag; //array with all the detector tags AliLHCTag fLHCTag; //LHC tag object + AliQA fQA; //needed for backward compaibility Int_t fQALength; // Length of the fQA array - ULong_t * fQA ; //[fQALength] QA objects's data + ULong_t * fQAArray ; //[fQALength] QA objects's data Int_t fESLength; // Length of the Event Specie Length Bool_t * fEventSpecies; //[fESLength] EventSpecies in this run - ClassDef(AliRunTag,5) //(ClassName, ClassVersion) + ClassDef(AliRunTag,6) //(ClassName, ClassVersion) }; //___________________________________________________________________________ -- 2.39.3