From 91460b266819e03a31317b49259d469fd4fa2f22 Mon Sep 17 00:00:00 2001 From: shahoian Date: Mon, 14 Nov 2011 15:29:59 +0000 Subject: [PATCH] Setting of beam info directly from GRP --- STEER/ESD/AliESDEvent.h | 4 ++++ STEER/ESD/AliESDRun.cxx | 8 ++++++-- STEER/ESD/AliESDRun.h | 10 ++++++++-- STEER/STEER/AliReconstruction.cxx | 13 +++++++++---- 4 files changed, 27 insertions(+), 8 deletions(-) diff --git a/STEER/ESD/AliESDEvent.h b/STEER/ESD/AliESDEvent.h index 7ef4f9afc23..3dbf37e50f7 100644 --- a/STEER/ESD/AliESDEvent.h +++ b/STEER/ESD/AliESDEvent.h @@ -153,6 +153,7 @@ public: void SetCurrentDip(Float_t cur) const {if(fESDRun) fESDRun->SetCurrentDip(cur);} void SetBeamEnergy(Float_t be) const {if(fESDRun) fESDRun->SetBeamEnergy(be);} void SetBeamType(const char* bt) const {if(fESDRun) fESDRun->SetBeamType(bt);} + void SetBeamParticle(Int_t az, Int_t ibeam) {if(fESDRun) fESDRun->SetBeamParticle(az,ibeam);} void SetUniformBMap(Bool_t val=kTRUE) const {if(fESDRun) fESDRun->SetBit(AliESDRun::kUniformBMap,val);} void SetBInfoStored(Bool_t val=kTRUE) const {if(fESDRun) fESDRun->SetBit(AliESDRun::kBInfoStored,val);} // @@ -160,6 +161,9 @@ public: Float_t GetCurrentDip() const {return fESDRun?fESDRun->GetCurrentDip():0;} Float_t GetBeamEnergy() const {return fESDRun?fESDRun->GetBeamEnergy():0;} const char* GetBeamType() const {return fESDRun?fESDRun->GetBeamType():0;} + Int_t GetBeamParticle(Int_t ibeam) const {return fESDRun?fESDRun->GetBeamParticle(ibeam):0;} + Int_t GetBeamParticleA(Int_t ibeam) const {return fESDRun?fESDRun->GetBeamParticleA(ibeam):0;} + Int_t GetBeamParticleZ(Int_t ibeam) const {return fESDRun?fESDRun->GetBeamParticleZ(ibeam):0;} Bool_t IsUniformBMap() const {return fESDRun?fESDRun->TestBit(AliESDRun::kUniformBMap):kFALSE;} // Bool_t InitMagneticField() const {return fESDRun?fESDRun->InitMagneticField():kFALSE;} diff --git a/STEER/ESD/AliESDRun.cxx b/STEER/ESD/AliESDRun.cxx index 87af68f87f0..7a72bfe7478 100644 --- a/STEER/ESD/AliESDRun.cxx +++ b/STEER/ESD/AliESDRun.cxx @@ -49,6 +49,7 @@ AliESDRun::AliESDRun() : { for (Int_t i=0; i<2; i++) fDiamondXY[i]=0.; + fBeamParticle[0] = fBeamParticle[1] = 0; fDiamondCovXY[0]=fDiamondCovXY[2]=3.*3.; fDiamondCovXY[1]=0.; fTriggerClasses.SetOwner(kTRUE); @@ -80,7 +81,7 @@ AliESDRun::AliESDRun(const AliESDRun &esd) : // Copy constructor for (Int_t i=0; i<2; i++) fDiamondXY[i]=esd.fDiamondXY[i]; for (Int_t i=0; i<3; i++) fDiamondCovXY[i]=esd.fDiamondCovXY[i]; - + for (Int_t i=0; i<2; i++) fBeamParticle[i] = esd.fBeamParticle[i]; for(Int_t i = 0; i < kNTriggerClasses; i++) { TNamed *str = (TNamed *)((esd.fTriggerClasses).At(i)); if (str) fTriggerClasses.AddAt(new TNamed(*str),i); @@ -125,6 +126,7 @@ AliESDRun& AliESDRun::operator=(const AliESDRun &esd) fBeamEnergy = esd.fBeamEnergy; for (Int_t i=0; i<2; i++) fDiamondXY[i]=esd.fDiamondXY[i]; for (Int_t i=0; i<3; i++) fDiamondCovXY[i]=esd.fDiamondCovXY[i]; + for (Int_t i=0; i<2; i++) fBeamParticle[i] = esd.fBeamParticle[i]; fTriggerClasses.Clear(); for(Int_t i = 0; i < kNTriggerClasses; i++) { TNamed *str = (TNamed *)((esd.fTriggerClasses).At(i)); @@ -206,7 +208,9 @@ void AliESDRun::Print(const Option_t *) const // Print some data members printf("Mean vertex in RUN %d: X=%.4f Y=%.4f Z=%.4f cm\n", GetRunNumber(),GetDiamondX(),GetDiamondY(),GetDiamondZ()); - printf("Beam Type: %s, Energy: %.1f GeV\n",fBeamType.IsNull() ? "N/A":fBeamType.Data(),fBeamEnergy); + printf("Beam Type: %s (%d/%d - %d/%d), Energy: %.1f GeV\n",fBeamType.IsNull() ? "N/A":GetBeamType(), + GetBeamParticleA(0),GetBeamParticleZ(0),GetBeamParticleA(1),GetBeamParticleZ(1), + fBeamEnergy); printf("Magnetic field in IP= %f T | Currents: L3:%+.1f Dipole:%+.1f %s\n", GetMagneticField(),fCurrentL3,fCurrentDip,TestBit(kUniformBMap) ? "(Uniform)":""); printf("Event from reconstruction version %d \n",fRecoVersion); diff --git a/STEER/ESD/AliESDRun.h b/STEER/ESD/AliESDRun.h index 6f7e76c2294..e24b1efdcdd 100644 --- a/STEER/ESD/AliESDRun.h +++ b/STEER/ESD/AliESDRun.h @@ -66,7 +66,12 @@ public: Float_t GetCurrentL3() const {return fCurrentL3;} Float_t GetCurrentDip() const {return fCurrentDip;} Float_t GetBeamEnergy() const {return IsBeamEnergyIsSqrtSHalfGeV() ? fBeamEnergy : fBeamEnergy/2;} - const char* GetBeamType() const {return fBeamType.Data();} + const char* GetBeamType() const {return (fBeamType=="Pb-Pb") ? "A-A":fBeamType.Data();} + void SetBeamParticle(Int_t az, Int_t ibeam) {fBeamParticle[ibeam] = az;} + Int_t GetBeamParticle(Int_t ibeam) const {return fBeamParticle[ibeam];} + Int_t GetBeamParticleA(Int_t ibeam) const {return fBeamParticle[ibeam]/1000;} + Int_t GetBeamParticleZ(Int_t ibeam) const {return fBeamParticle[ibeam]%1000;} + UInt_t GetDetectorsInDAQ() const {return fDetInDAQ; } UInt_t GetDetectorsInReco() const {return fDetInReco; } @@ -121,6 +126,7 @@ private: UInt_t fPeriodNumber; // PeriodNumber Int_t fRunNumber; // Run Number Int_t fRecoVersion; // Version of reconstruction + Int_t fBeamParticle[2]; // A*1000+Z for each beam particle TString fBeamType; // beam type from GRP TObjArray fTriggerClasses; // array of TNamed containing the names of the active trigger classes UInt_t fDetInDAQ; // Detector mask for detectors in datataking @@ -131,7 +137,7 @@ private: Int_t fCaloTriggerType[8]; // Calorimeter trigger type Float_t fVZEROEqFactors[64]; // V0 channel equalization factors for event-plane reconstruction - ClassDef(AliESDRun,12) + ClassDef(AliESDRun,13) }; #endif diff --git a/STEER/STEER/AliReconstruction.cxx b/STEER/STEER/AliReconstruction.cxx index e14983f776e..4c9fd411a70 100644 --- a/STEER/STEER/AliReconstruction.cxx +++ b/STEER/STEER/AliReconstruction.cxx @@ -1976,19 +1976,24 @@ Bool_t AliReconstruction::ProcessEvent(Int_t iEvent) esdRunH->SetMeanIntensity(ib,it, fBeamInt[ib][it]); } // + fesd->SetBeamEnergy(fGRPData->GetBeamEnergy()); + fesd->SetBeamType(fGRPData->GetBeamType().Data()); + fesd->SetBeamParticle(fGRPData->GetSingleBeamType(0).Atoi(),0); + fesd->SetBeamParticle(fGRPData->GetSingleBeamType(1).Atoi(),1); + fhltesd->SetBeamEnergy(fGRPData->GetBeamEnergy()); + fhltesd->SetBeamType(fGRPData->GetBeamType().Data()); + fhltesd->SetBeamParticle(fGRPData->GetSingleBeamType(0).Atoi(),0); + fhltesd->SetBeamParticle(fGRPData->GetSingleBeamType(1).Atoi(),1); + // AliMagF* fld = (AliMagF*)TGeoGlobalMagField::Instance()->GetField(); if (fld) { // set info needed for field initialization fesd->SetCurrentL3(fld->GetCurrentSol()); fesd->SetCurrentDip(fld->GetCurrentDip()); - fesd->SetBeamEnergy(fld->GetBeamEnergy()); - fesd->SetBeamType(fld->GetBeamTypeText()); fesd->SetUniformBMap(fld->IsUniform()); fesd->SetBInfoStored(); // fhltesd->SetCurrentL3(fld->GetCurrentSol()); fhltesd->SetCurrentDip(fld->GetCurrentDip()); - fhltesd->SetBeamEnergy(fld->GetBeamEnergy()); - fhltesd->SetBeamType(fld->GetBeamTypeText()); fhltesd->SetUniformBMap(fld->IsUniform()); fhltesd->SetBInfoStored(); } -- 2.43.0