Some GEANT 4 exercises GEANT 4 simulation of

  • Slides: 15
Download presentation
Some GEANT 4 exercises…

Some GEANT 4 exercises…

GEANT 4 simulation of the diamond test setup Sr 90 PA diamond Scint. PM

GEANT 4 simulation of the diamond test setup Sr 90 PA diamond Scint. PM 1 PM 2 discr delay ADC & Gate Sr Emip = 1. 5 Me. V d. E/dx = 5. 57 Me. V/cm R = 0. 2 cm Sr Sr Y Y Task: E, Me. V to understand improve the built setup… • are the electrons MIP? • is the ionization homogeneous in diamond? • can be geometry improved? MIP

GEANT 4 geometry + source Source: GE AN T RE AL G 4 General.

GEANT 4 geometry + source Source: GE AN T RE AL G 4 General. Particle. Source or G 4 Radioactive. Decay or your own. . . setup_geometry. cc : G 4 User. Limits *l = new G 4 User. Limits(); // Sets a max Step length in the diamond : G 4 double max. Step = 0. 005*mm; l->Set. Max. Allowed. Step(max. Step); diamond_log->Set. User. Limits(l); setup_Primary. Generator. Action. cc setup_Physics. List. LE. cc: ………… void setup_Physics. List. LE: : Set. Cuts(){ Set. Cut. Value(0. 01*mm, "gamma"); Set. Cut. Value(0. 01*mm, "e-"); Set. Cut. Value. For. Others(default. Cut. Value); Dump. Cut. Values. Table(); }

setup_Root. Manager. hh : class setup. Root. Manager{ //singleton public: . . . class

setup_Root. Manager. hh : class setup. Root. Manager{ //singleton public: . . . class setup_diam. Hit : public G 4 VHit{ static setup. Root. Manager* get. Instance(); public: void fill. X(double d. E, …. double x, double y, double z, int ps. N); private: void fill. E(double i. E, double d. E, double s. E); G 4 int track. ID; … G 4 double edep; private: G 4 Three. Vector pos; static setup. Root. Manager* instance; G 4 String pname; TFile* f; …… TNtuple* ntuple. X; } TNtuple* ntuple. E; … setup_diam. SD. hh : class setup_diam. SD : public G 4 VSensitive. Detector{ }; public: … G 4 bool Process. Hits(G 4 Step*, G 4 Touchable. History*); private: setup_diam. Hits. Collection* diam. Collection; }; setup_diam. Hit. hh : setup_Event. Action. cc : void setup. Event. Action: : End. Of. Event. Action(const G 4 Event* an. Event){ setup. Root. Manager* s. RM = setup. Root. Manager: : get. Instance(); // get information from setup_diam. Hits. Collection, . . . // and fill root histo/ntuple/tree… s. RM->fill. E(Eini, diam. Energy, scint. Energy); s. RM->Fill. Something. Else(…) };

energy spectra Diamond – spectrum (energy deposition) for any e- Diamond – spectrum (energy

energy spectra Diamond – spectrum (energy deposition) for any e- Diamond – spectrum (energy deposition) for triggered e- Initial electrons spectrum for “diamond” e- Initial electrons Spectrum for “triggered” e-

depth distributions all electrons in diamond triggered electrons in diamond

depth distributions all electrons in diamond triggered electrons in diamond

step limits influence - 0. 3 Me. V e. No step limits: => Step

step limits influence - 0. 3 Me. V e. No step limits: => Step size is defined by a process… max Step length = 10 mm : => Step size is defined by the limit

More games… ROOT : )

More games… ROOT : )

histogram fitting… Simple? . . TH 1 F * signal = new TH 1

histogram fitting… Simple? . . TH 1 F * signal = new TH 1 F(…); F 1 * g 1 = new TF 1("g 1", my. Func, min, max, npar); signal->Fit("g 1", "VR"); If the function is not so simple? . . . Signal = Gaus 1 + Landau * Gauss 2 Fit parameters: p[0] = Norm(Gauss 1) p[1] = Mean(Gauss 1) - fixed p[2] = Sigma(Gauss 1) – fixed p[3] = Width(Langau) p[4] = MPV(Langau) p[5] = Area(Langau) p[6] = Sigma(Gauss 2)

Simple fitting for the complicated case… Function: TF 1 * glg = new TF

Simple fitting for the complicated case… Function: TF 1 * glg = new TF 1("glg", gaulangaufun, 50, 400, 7); Proper initial parameters: p[0] = 100. ; p[1] = 139. 1; p[2] = 17. 7; // from noise gauss p[3] = 5. ; p[4] = 180. ; p[5] = 20000. ; p[6] = 30. ; // signal glg->Set. Parameters(p); And fit it: signal->Fit("glg", "VR"); …. And get: FCN=140. 264 FROM MIGRAD STATUS=FAILED 611 CALLS 612 TOTAL EDM=30. 8846 STRATEGY= 1 ERR MATRIX NOT POS-DEF EXT PARAMETER APPROXIMATE STEP FIRST NO. NAME VALUE ERROR SIZE DERIVATIVE 1 p 0 1. 72541 e+01 9. 99999 e-01 -0. 00000 e+00 -1. 74731 e-03 2 p 1 1. 39100 e+02 fixed 3 p 2 1. 77000 e+01 fixed 4 p 3 4. 91314 e+00 1. 79039 e+00 0. 00000 e+00 -4. 07711 e+00 5 p 4 1. 86918 e+02 2. 33982 e+00 0. 00000 e+00 -4. 67063 e-03 6 p 5 9. 58479 e+03 1. 44047 e+02 0. 00000 e+00 -3. 45415 e-09 7 p 6 2. 74389 e+01 2. 34762 e+00 0. 00000 e+00 8. 24991 e-02

To try to improve the fit… To improve: signal->Fit("glg", "EVR"); // „better error estimation“

To try to improve the fit… To improve: signal->Fit("glg", "EVR"); // „better error estimation“ … And it takes ~8 times loneger… …. And get: FCN=140. 208 FROM MINOS STATUS=PROBLEMS 4058 CALLS EDM=0. 358165 STRATEGY= 1 ERR MATRIX NOT POS-DEF EXT PARAMETER PARABOLIC MINOS ERRORS NO. NAME VALUE ERROR NEGATIVE POSITIVE 1 p 0 1. 74193 e+01 1. 29294 e+00 1. 08485 e+00 2 p 1 1. 39100 e+02 fixed 3 p 2 1. 77000 e+01 fixed 4 p 3 4. 87816 e+00 1. 56382 e-03 5 p 4 6 p 5 7 p 6 1. 86941 e+02 6. 02893 e-03 9. 58141 e+03 1. 62875 e+02 2. 73866 e+01 1. 06973 e+00 9. 57228 e-01 5120 TOTAL

going back to MINUIT… Actually: ROOT uses MINUIT: signal->Fit("glg", "VR"); <=> g. Minuit->mnexcm("MIGRAD", arglist

going back to MINUIT… Actually: ROOT uses MINUIT: signal->Fit("glg", "VR"); <=> g. Minuit->mnexcm("MIGRAD", arglist , 2, ierflg); signal->Fit("glg", “EVR"); <=> g. Minuit->mnexcm("MIGRAD", arglist , 2, ierflg); + g. Minuit->mnexcm("MINOS", arglist , npar, ierflg); Then what is wrong? Probably, too many things are predefined? To use TMinuit class directly (only necessary and optimal things)?

going back to MINUIT… Everything (almost) as in Fortran: TMinuit *g. Minuit = new

going back to MINUIT… Everything (almost) as in Fortran: TMinuit *g. Minuit = new TMinuit(7); g. Minuit->Set. FCN(fcn); // just Chi 2 arglist[0] = 1; g. Minuit->mnexcm("SET ERR", arglist, 1, ierflg); // UD = 1 for chisqr // Set starting values and step sizes for parameters Double_t vstart[7] = {100, 139. 1, 17. 7, 5. , 180. , 20000. , 30. }; Double_t step[7] = {1 , 0. 1, . 02, . 1, 50, . 3}; g. Minuit->mnparm(0, "PNorm", vstart[0], step[0], 0, 0, ierflg); …………………. . arglist[0] = 1000; arglist[1] =. 01; // with set maxcall and tolerance g. Minuit->mnexcm("MIGRAD", arglist , 2, ierflg); arglist[0] = 200; arglist[1] = 5; // with set maxcall and npar g. Minuit->mnexcm("MINOS", arglist , 2, ierflg);

and we’ve finally got… FCN=140. 388 FROM MINOS STATUS=SUCCESSFUL 357 CALLS 1062 TOTAL EDM=0.

and we’ve finally got… FCN=140. 388 FROM MINOS STATUS=SUCCESSFUL 357 CALLS 1062 TOTAL EDM=0. 000510439 STRATEGY= 1 ERR MATRIX NOT POS-DEF EXT PARAMETER PARABOLIC MINOS ERRORS NO. NAME VALUE ERROR NEGATIVE POSITIVE 1 PNorm 1. 72476 e+01 2. 44167 e+00 2 PMean 1. 39100 e+02 fixed 3 PSigma 1. 77000 e+01 fixed 4 LSigma 4. 91366 e+00 1. 52320 e-02 5 LMPV 1. 86905 e+02 2. 15345 e-01 -5. 77136 e-01 5. 10611 e-01 6 LNorm 9. 57911 e+03 1. 02587 e+02 7 GSigna 2. 73663 e+01 8. 55687 e-02 Chi 2 LMPV