Giter Site home page Giter Site logo

hybridmcforgm2's Introduction

Fast Simulation For Muon G-2 Experiment

About
The simulation is divided into three parts:
1. Beam and spin dynamics of the muons in the storage ring
2. Sampling of positrons spectrum (from muon decay) in LAB frame
3. Detection of the positrons (via ML methods)


Versions
v0.0.0:
	- first prototype
	- minor mistakes on sampling of positron PZ in the Muon Rest Frame
	- corrected part of the code is in part2 file 
	
v0.0.1:
	- correction to minor mistakes on sampling of positron PZ in MRF (by adding artificial spin precession before lorentz boost)
	- sampling and plotting of the result in the same file (to be separated in the newer version)
	
	
v0.0.2: 
	- separate sampling and plotting codes
	- added a notebook file for quick visualization (using hist_dict.npy that contains only histogram information from a large dataset)
	- added information in the codes
	- the positron sampling codes is still in toyMC status, beam and spin dynamics to be added later


v0.1.0:
	- added modularity to positron sampling code: test_modules.ipynb
	- tested positron sampling (with uniformly distributed random number VS simple beam and spin dynamics), see test_modules.ipynb
	- Changed alpha, rot variables to theta_s (spin angle), theta_c (cyclotron angle)
	- GeneratePositron_LAB: changed beta_mu_x,z to muDecayPX,Z (muDecay vs muInit problem to be resolved later) 
	- removed W_mue from GeneratePositron_MRF(to reduce redundancy) and modified GenerateMichelKinematics to return energy,cos(theta) instead of x,cos(theta)


v0.1.1: *latest*
	- revert GenerateMichelKinematics to x,cos(theta)
	- added muDecayPY return in  GeneratePositron_LAB; muDecayPolY in GeneratePositron_MRF (not considering EDM, set to 0)
	- removed 02_positron_sampling/test_modules.ipynb and added modules in external .py files: Constants.py, FourVector.py, PositronDecay.py
	- upgrade positron sampling (01_sampling.ipynb in version <v0.1.0) in terms of the modules
	- new directory: 01_beam_spin_dyn,incoporated simple beam and spin dynamics (cyclotron motion and spin precession) in simplebd.ipynb
	* note 7/4/2022: using spin precession angle is not consistent with gm2ringsim, which use muon polarization to fix positron momentum direction


v0.1.2: (comming soon) git tag -a v0.1.2 -m "updated from v0.1.1, with bug fixed"
	- added docstring to functions in positron sampling
	- change time pts from discrete to continuous (use uniform random numbers)
	- wiggle plot from toyMC data (cut posiInitE >=1.8 GeV)
	! Major bug (fixed and KIV): in 02_sampling.ipynb (bug since v0.1.0)
		bug from line: four_momenta_LAB[:,7] = muDecayPolX
		correct: four_momenta_LAB[i,7] = muDecayPolX
		affected files: simplebd.ipynb
	    this resulted in the columns that have the same value, and caused:
		- painfully long runtime, for N>=1e6
	    - EvsPhase diagram not uniform, cant fully matched to gm2ringsim data
	- not implemented: unified seed for all random generators from all modules (PositronDecay.py and simplebd.ipynb).
	- this version was used to generate data for BDT phase map studies. But it relied on simple BD (not yet included in the repo), and it gave major issue (single r,p)

v0.1.3:(comming soon)
	- included sample (complete,working) codes to generate data for BDT phase map 
	- try using toyMC data -> DT to get isCaloHit label, and draw wiggle plot for (isCaloHit==1 && posiInitE>1700)

v0.2.0:(comming soon)
	- crude, ad-hoc implementation of 3-vector class
	- GaussianGasGun (docsdb2571)::ProduceMuonVector implementation, with modifications:
		- uniform / exponential decay time distribution
		- sample the storage ring in circular shape (instead of square in original implementation)
	- modified positron codes (v0.1.3 and before is mainly positron sampling) to suite 3-vector class and physics of ProduceMuonVector
	- included codes for test and characterizing the complete muon+positron codes
	- included sample (complete,working) codes to generate data for BDT phase map 


(planning)
	- general rotation (3-parameters) implementation

hybridmcforgm2's People

Contributors

junkai2998 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.