+
+//_____________________________________________________________________________
+Bool_t AliESDRun::InitMagneticField() const
+{
+ // Create mag field from stored information
+ //
+ if (!TestBit(kBInfoStored)) {
+ AliError("No information on currents, cannot create field from run header");
+ return kFALSE;
+ }
+ //
+ if ( TGeoGlobalMagField::Instance()->IsLocked() ) {
+ if (TGeoGlobalMagField::Instance()->GetField()->TestBit(AliMagF::kOverrideGRP)) {
+ AliInfo("ExpertMode!!! Information on magnet currents will be ignored !");
+ AliInfo("ExpertMode!!! Running with the externally locked B field !");
+ return kTRUE;
+ }
+ else {
+ AliInfo("Destroying existing B field instance!");
+ delete TGeoGlobalMagField::Instance();
+ }
+ }
+ //
+ AliMagF* fld = AliMagF::CreateFieldMap(fCurrentL3,fCurrentDip,AliMagF::kConvLHC,
+ TestBit(kUniformBMap), GetBeamEnergy(), GetBeamType());
+ if (fld) {
+ TGeoGlobalMagField::Instance()->SetField( fld );
+ TGeoGlobalMagField::Instance()->Lock();
+ AliInfo("Running with the B field constructed out of the Run Header !");
+ return kTRUE;
+ }
+ else {
+ AliError("Failed to create a B field map !");
+ return kFALSE;
+ }
+ //
+}
+
+//_____________________________________________________________________________
+void AliESDRun::SetT0spread(Int_t i,Float_t t)
+{
+ //
+ // Setting the T0 spread value at index i
+ //
+
+ if ( (i>=0) && (i<kT0spreadSize)) {
+ fT0spread[i]=t;
+ } else {
+ AliError(Form("Index %d out of bound",i));
+ }
+ return;
+}
+
+//_____________________________________________________________________________
+void AliESDRun::SetT0spread(Float_t *t)
+{
+ //
+ // Setting the T0 spread values
+ //
+ if (t == 0x0){
+ AliError(Form("Null pointer passed"));
+ }
+ else{
+ for (Int_t i=0;i<kT0spreadSize;i++) fT0spread[i]=t[i];
+ }
+ return;
+}
+