CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_3/src/GeneratorInterface/CosmicMuonGenerator/src/CMSCGENnorm.cc

Go to the documentation of this file.
00001 //
00002 // CMSCGENnorm.cc       P. Biallass 2006  
00003 //
00004 // code based on l3cgen.f by T.Hebbeker
00005 // implemented in CMSSW by P. Biallass 11.04.2006  
00006 // see header for documentation
00007 //
00008 
00009 
00010 #include "GeneratorInterface/CosmicMuonGenerator/interface/CMSCGENnorm.h"
00011 
00012 
00013 //count muons which are around 100GeV and theta<33 deg (~vertical), do this for EVERY generated cosmic 
00014 
00015 int CMSCGENnorm::events_n100cos(double energy, double theta)
00016 {
00017    if(energy > 99.5 && energy < 100.5){ 
00018     n100=n100+1;
00019     
00020     if(1.-cos(theta) < 1./(2.*Pi)) { //theta is in rad
00021       n100cos = n100cos + 1 ;
00022     }
00023   }
00024   return n100cos;
00025 }
00026 
00027 
00028 // determine normalization using known flux, do this in the end. Percentage of rejected events and surface needs to be corrected for later!
00029 // Note that the number of actually DICED cosmics is needed for normalisation, and sufficient statistics to have muons at 100 GeV!
00030 
00031 float CMSCGENnorm::norm(int n100cos)
00032 { 
00033   flux = 2.63e-3 ; // +- 0.06e-3 [1/m**2/sr/GeV/s]
00034 
00035   n = n100cos ; // [1/sr/GeV]
00036   
00037   //rate=N/runtime --> Nnorm ~ (1/runtime/m^2 at surface plane) as rate corresponds to known flux
00038   Nnorm = flux/n ;
00039 
00040   //err of Nnorm = Nnorm* 1/sqrt(n)
00041   
00042   return Nnorm; 
00043 }
00044 
00045