FlyoDoc_2011 Pisa 2011 by GmP --- 011

flyopunta/src/src_par/partgam.cpp

00001 /***************************************************************************
00002  *   Copyright (C) 2005 by Giuseppe Pierazzini          Pisa 20.02.05      *
00003  *   pierazzini@unipi.it                                                   *
00004  *                                     F l y o                             *
00005  *   Epsi/NA48                                                             *
00006  ***************************************************************************/
00007 
00008 #define EPSR     1.0E-200
00009 
00010 #include "flyoh.h"
00011 
00012 using namespace GmpConst;
00013 using namespace std;
00014 
00035 //-------------------------------------------------------------
00036 //            P a r t P a i r    per pair prod.
00037 //--------------------------------------------------------------
00038 // Get the pair quadri momentum
00039 
00040 PartGam::PartGam()
00041 {
00042     type=Gamstar;
00043     prnorm=log(0.13497/0.0010201);
00044     Pair_Production=1;
00045     if (evento_.Gen.Event<1) Gout<<"\n Classe PartGam: "<<nome<<"*  done!";
00046 }
00047 
00048 
00049 void  PartGam::
00050 DecParm_Pair()
00051 {
00052 // Attenzione questa routine vale solo per la
00053 // produzione di  pair nella interazione dei gamma con la materia
00054 // si suppone una distribuzione che va come 1/m**2;
00055 // limiti tra 2 volte la massa dell'elettrone e 100-200 mev.
00056 // mass electron= 0.00051 ,max  mass .100
00057 //
00058 //   P.print( nome);Gout<<" "<<fato<<" Dc "<<evento_.Event;
00059 //   Qpatre.print( nome);Gout<<"  Dc "<<evento_.Event<< " dw "<<dw;
00060 
00061     if (fato!=Decay || dw==0)return ;
00062 //  prnorm=log(0.100/(2.*melec)) =4.585367
00063     Qpatre.m= masspair=0.0010201*exp(Pran()*5.27851);
00064     Qpatre.Energia();
00065 //  Qpatre.print("Pout");Gout<<"  Dc "<<evento_.Event;
00066 // ritorna un quadrivettore massivo di pari impulso...
00067     SelRea->mspair=Qpatre.m;
00068 
00069 // calcolo la direzione di decadimento dei figli.
00070     double cost = 1.0;
00071     while (1)
00072     {
00073         cost = 1.0 -  2.0 * Pran();
00074 
00075         if (Pran()<(0.66666+0.33333*cost*cost)) break;
00076 
00077 // double csq=cost*cost;
00078 // if(dw->Pran()<((1.-csq)*exp(2.*csq)/1.36)) break;  // forma piu' ok??
00079 
00080 
00081     }
00082     /***********/
00083 
00084     double   fi = DuePiGreco * Pran();
00085     dw->cstar=cost;
00086     dw->fistar=fi;
00087     dw->rg->cstar=-cost;
00088     dw->rg->fistar=fi+PiGreco;
00089 
00090     return;
00091 }
00092 //-----------------------------------------------------
00093 //    P a i r   p r o d u c t i o n
00094 //--------------------------------------------------
00095 void   PartGam::
00096 Get_Pair(Device *dev,double &path, double &rad_length)
00097 {
00098 
00099 
00100     if (path<0.01) return;
00101     
00102     
00103     
00104     
00105     double xrd = - log(Pran()+EPSR);
00106     double trt = rad_length * 1.285714 * xrd;  // Lunghezza di radiazione  reale*9/7 //rivedre
00107 
00108 if (trt<path)
00109     {
00110         path=trt;
00111         Pair_Production=2;   //pair pruduction done....
00112         SelRea->Pair_done++;
00113         dev->Pair_done++;
00114         fato=Decay;
00115         Ifato=-12;  // dead per pair production 
00116 
00117         /*    Gout<<setprecision(4)<<"\n Pair: "<<evento_.Event<<"  "<<dev->Get_Nome()<<"  "<<nome<<"  path "
00118              <<setw(8)<<path<<"  trt "
00119              <<setw(8)<<trt<<" rad "
00120              <<setw(8)<<rad_length
00121              <<" Pair_done= " <<SelRea->Pair_done;
00122         */
00123 //    P.print( nome);Gout<<" "<<fato<<" Pr2 "<<evento_.Event;
00124         Particella *pb,*pc;
00125         if (Abilita_Brems>0 && dev->Brem_done<dev->maxBrems)
00126         {
00127             Partname=Elec;
00128             pb = new PartLepton();
00129             Partname=Elep;
00130             pc = new PartLepton();
00131         }
00132         else
00133         {
00134             Partname=Elec;
00135             pb = new Particella(); 
00136             Partname=Elep;
00137             pc = new Particella();
00138         }
00139 // attenzione non alterare la sequenza dei link....altrimenti cambiano gli Id
00140         dw=pb;
00141         pb->up=this;
00142         pb->rg=pc;
00143         pc->lf=pb;
00144         pc->up=this;
00145         pb->Set_Id();
00146         pc->Set_Id(); 
00147 
00148     }
00149        
00150 
00151 }
00152 
 All Classes Namespaces Files Functions Variables