Changeset 73 in JEM-EUSO for esaf_lal


Ignore:
Timestamp:
Apr 15, 2013, 6:57:42 PM (11 years ago)
Author:
barrand
Message:

G.Barrand : Darwin : arrange to create the global TF2 objets when needed. It avoids a crash at startup of Simu

File:
1 edited

Legend:

Unmodified
Added
Removed
  • esaf_lal/trunk/esaf/packages/simulation/generators/showers/src/ShowerTrack.cc

    r16 r73  
    171171}
    172172
     173#ifdef __APPLE__
     174//G.Barrand : on Mac the below global variables induces a crash at startup of
     175//            Simu. Then we create the objects "when needed" in the
     176//            ShowerTrack::Get methods. Sight, using global variables,
     177//            as long as the singleton pattern, is NEVER a good idea.       
     178TF2* ShowerTrack::fEnergyAgeDistributionDefault = 0;
     179TF2* ShowerTrack::fEnergyAgeDistributionHillas  = 0;
     180TF2* ShowerTrack::fEnergyAgeDistributionGiller  = 0;
     181TF2* ShowerTrack::fEnergyAgeDistributionNerling = 0;
     182TF2* ShowerTrack::fEnergyAgeDistributionMelot   = 0;
     183TF2* ShowerTrack::fLateralDistributionDefalt = 0;
     184TF2* ShowerTrack::fLateralDistribution1 = 0;
     185TF2* ShowerTrack::fLateralDistribution2 = 0;
     186TF2* ShowerTrack::fLateralDistribution3 = 0;
     187TF2* ShowerTrack::fAngularDistribution1 = 0;
     188#else
    173189// Set of static distributions. Note! Default does not mean that this is the best rather it is
    174190// a convinient choice for the debugging study
     
    185201
    186202TF2* ShowerTrack::fAngularDistribution1 = new TF2("baltru",ShowerTrackBaltru,0.,Pi(),.5,1000.);
     203#endif
    187204
    188205//______________________________________________________________________________
     
    207224    // Return Pointer to the energy distribution of electrons in the shower
    208225    //
     226
     227#ifdef __APPLE__
     228  //G.Barrand :
     229  if(!fEnergyAgeDistributionDefault)
     230    fEnergyAgeDistributionDefault = new TF2("EneAgeDefault",ShowerTrackGiller,0.1,1000,m,2);
     231  if(!fEnergyAgeDistributionHillas)
     232    fEnergyAgeDistributionHillas  = new TF2("hillas",ShowerTrackHillas,0.1,1000,0,2);
     233  if(!fEnergyAgeDistributionGiller)
     234    fEnergyAgeDistributionGiller  = new TF2("giller",ShowerTrackGiller,0.1,1000,0,2);
     235  if(!fEnergyAgeDistributionNerling)
     236    fEnergyAgeDistributionNerling = new TF2("nerling",ShowerTrackNerling,0.1,1000,0,2);
     237  if(!fEnergyAgeDistributionMelot)
     238    fEnergyAgeDistributionMelot   = new TF2("melot",ShowerTrackMelot,0.1,1000,0,2);
     239#endif
     240
    209241    if( name == "hillas" )
    210242        return fEnergyAgeDistributionHillas;
     
    223255    // Return Pointer to the lateral distribution of electrons in the shower
    224256    //
     257#ifdef __APPLE__
     258  //G.Barrand :
     259  if(!fLateralDistributionDefalt)
     260    fLateralDistributionDefalt = new TF2("LateralDistributionDefalt",ShowerTrackNKG1,0.001,50,0,2);
     261  if(!fLateralDistribution1)
     262    fLateralDistribution1 = new TF2("NKG1",ShowerTrackNKG1,0.001,50,0,2);
     263  if(!fLateralDistribution2)
     264    fLateralDistribution2 = new TF2("NKG",ShowerTrackNKG2,0.001,5000,0,2,1);
     265  if(!fLateralDistribution3)
     266    fLateralDistribution3 = new TF2("NKGhadron",ShowerTrackNKGhadron,0.001,5000,0,2,1);
     267#endif
     268
    225269    if( name == "NKG1" )
    226270        return fLateralDistribution1;
     
    239283    // Return Pointer to the angular distribution of electrons in the shower
    240284    //
     285#ifdef __APPLE__
     286  //G.Barrand :
     287  if(!fAngularDistribution1)
     288    fAngularDistribution1 = new TF2("baltru",ShowerTrackBaltru,0.,Pi(),.5,1000.);
     289#endif
     290
    241291    if( name == "baltru" )
    242292        return fAngularDistribution1;
Note: See TracChangeset for help on using the changeset viewer.