FlyoDoc_2011 Pisa 2011 by GmP --- 011
|
00001 /*************************************************************************** 00002 greaprod.cpp - description 00003 ------------------- 00004 begin : Sun Nov 26 2000 00005 copyright : (C) 2000 by Giuseppe m Pierazzini 00006 email : pierazzini@unipi.it 00007 ***************************************************************************/ 00008 //--------------------------------------------------------------*/ 00009 // Routine di B e a m P r o d u c t i o n */ 00010 //--------------------------------------------------------------*/ 00011 // Fbeam : beam production GMP 21/7/92/23.04.99/ 00012 00013 #include "flyoh.h" 00014 using namespace GmpConst; 00015 using namespace std; 00016 00017 //--------------------------------------------------- 00018 // M a x S p e t t r o 00019 //------------------------------------------------------ 00020 void Reazione:: 00021 MaxSpettro() 00032 { 00033 Particella *pr=avo; 00034 Reazione* prea=up; 00035 double dW; 00036 Gout<<"\n\n ----------> P r o d u z i o n e <------------ "; 00037 Gout<<"\n "<<pr->Get_Nome() <<" Beam pruduction probability " 00038 <<" for the reaction "<<header<<endl; 00039 00040 00041 00042 if ( inc_pinc<=0.0 ) 00043 { Gout << " \n Incident pinc non defined.... exit "; exit ( 0 );} 00044 00045 00046 Gout<<"\n Production parameters: \n inc_pinc=" 00047 <<setprecision ( 2 ) <<fixed 00048 <<setw ( 8 ) <<inc_pinc 00049 <<" teta="<<setw ( 8 ) <<inc_teta; 00050 00051 Gout<<"\n Virtual collimator position and dimension..."; 00052 00053 gvet dcoll = Ccoll-Ctarg; dcoll.Norma(); 00054 Ctarg.print ( "Targ" ); 00055 Ccoll.print ( "Ccol" );Gout<< " r="<<rcoll; 00056 dcoll.print ( "dcoll" ); 00057 dW=PiGreco*rcoll*rcoll/ ( dcoll.z*dcoll.z ); // angolo solido coperto dal collimatore virtuale 00058 Gout<<"\nSolide angle dW = "<< dW; 00059 00060 00061 //---------------------------------------------------------------- 00062 while ( prea!=0 ) 00063 { 00064 00065 00066 // verifico se lo stesso di una reazione precedente.... 00067 if ( avo->Get_Idm() ==prea->avo->Get_Idm() && Pinc.norma==prea->Pinc.norma ) 00068 { 00069 maxspettro=prea->maxspettro; 00070 Dnsudp=prea->Dnsudp; 00071 prodrate=rate*Dnsudp; 00072 pincmx=prea->pincmx; 00073 00074 Gout<<"\n -------"; 00075 Gout<<"\n Maxspettro has found previuos reaction with the same beam!" 00076 << " got the same parametrs..."; 00077 00078 00079 Gout<<"\n\n " 00080 <<setprecision ( 7 ) <<fixed 00081 <<" EV/PPP " 00082 <<setw ( 13 ) << prodrate<<" Max=" 00083 <<setw ( 13 ) <<maxspettro <<" at " 00084 <<setprecision ( 2 ) <<fixed 00085 <<setw ( 6 ) <<pincmx<<" GeV for " 00086 <<setw ( 6 ) <<avo->Get_Nome() 00087 <<" with "<< rate <<" of B.R."; 00088 00089 00090 Gout<<"\n ----------------------------------------\n"; 00091 if ( next!=0 ) next->MaxSpettro(); 00092 return; 00093 } 00094 prea=prea->up; 00095 } 00096 //========================== end verifica ========================--- 00097 00098 //loop 00099 // Non !!! Integro sulla sup del collimatore virtuale 00100 00101 00102 00103 //========================================== 00104 // integration loop 00105 // calcolo il momentum spectrum...nell'intervallo Pinc +- Wpinc 00106 // for particles produced versus the collimator center direction... 00107 00108 double stepp= wpinc*0.05; //40 step in pinc 00109 ppb=Pinc.norma-wpinc; 00110 double mxpp= Pinc.norma+wpinc+stepp*0.5; 00111 Dnsudp=0.0; 00112 Gout<<"\n\n T A B E L L A "; 00113 Gout<<"\n teta p dN/dpdw "; 00114 00115 // fix parameters for beam particle production 00116 // attenzione se l'angolo di produzione è diverso andrebbe corretto... 00117 vxb=vyb=0.0,vzb=1.0; 00118 double tett=0.0, Pmedio=0.0; 00119 00120 while ( ppb<= mxpp ) 00121 { 00122 /************************* n o t e ******************* 00123 calcolo di wexp! 00124 la formula di Doble/Gatignon 00125 dn/do alla targhetta 00126 00127 */ 00128 if(ubeam==0) prob=Produci(); //Creare una routine utente..... 00129 else prob=1000.0; //prob è la sezione d'urto differenziale!!!! 00130 00131 if ( maxspettro<prob ) { maxspettro=prob;pincmx=ppb;} 00132 Dnsudp+=prob; //Integro in funzione di p 00133 Pmedio+=prob*ppb; 00134 // qui teta sempre nulla tra la direzione del p e del beam generato 00135 00136 Gout<<"\n " 00137 <<setprecision ( 4 ) <<fixed 00138 <<setw ( 9 ) <<tett<<" " 00139 <<setw ( 9 ) <<ppb<<" " 00140 <<setw ( 9 ) <<prob; 00141 00142 ppb+=stepp; 00143 } 00144 00145 Pmedio= Pmedio/Dnsudp; 00146 00147 Gout<<"\n\n Doble production max spettrum"<<setw ( 13 ) <<maxspettro 00148 <<"\n for "<<setw ( 6 ) <<avo->Get_Nome() 00149 <<" at "<<setprecision ( 2 ) <<fixed<<setw ( 6 ) 00150 <<pincmx<<" GeV " 00151 <<"\n with B.R "<< rate <<" and P_med "<<Pmedio 00152 <<setprecision ( 8 ) <<" in Dw = "<< dW; 00153 00154 // Domega by the defining collimator.divided by 16 step of domega.. vedi loop up. 00155 // 00156 00157 Dnsudp=Dnsudp*stepp*dW; 00158 prodrate=rate*Dnsudp; 00159 00160 00161 00162 Gout<<"\n\n Ev/PPP " 00163 <<setprecision ( 7 ) <<fixed<<setw ( 13 ) << prodrate; 00164 00165 00166 Gout<<"\n ----------------------------------------\n"; 00167 00168 if ( next!=0 ) next->MaxSpettro(); 00169 00170 } 00171 00172 00173 //-------------------------------------------------------------- 00174 // Routine di B e a m P r o d u c t i o n 00175 //-------------------------------------------------------------- 00176 //-------------------------------------------------------------- 00177 double Reazione::Produci () { return 1.0;} //base procedure 00178 //=============================================================== 00179 00180 double ReaKld::Produci() 00181 00182 00186 // calcola la probabilita' della produzione Kl di impulso p 00187 // secondo la distribuzione per protone incidente 00188 // Nota: Kl=Ks=(K0+ K0a)/2 = (K+ + 3K-)/4 00189 00190 { 00191 00192 gvet vtet= Vbeam&Vinc_ppp; vtet.Norma(); 00193 double tetq= asin ( vtet.norma );tetq*=tetq; 00194 00195 00196 00197 // old Niels code...end 00198 // double A=0.16, B=8.5, C=3.0; 00199 /* 00200 double ppbs=pow(ppb,2.); 00201 double A=0.16, B=10.5, C=3.0; 00202 double c1= ( B/inc_pinc ) *exp ( -B*ppb/inc_pinc ); 00203 double c2= ( C*ppbs/PiGreco ) *exp ( -C*ppb*ppb*tetq ); 00204 double Kpfluss= A*c1*c2 ; 00205 00206 // A=0.1, B=13., C=3.5; 00207 A=0.1, B=13., C=3.5;Inizio 00208 00209 // spettro*=1. + 8.8*exp ( -.05*ppb ); 00210 // spettro*=exp ( -5.*(ppb-60.)/inc_pinc ); 00211 00212 c1= ( B/inc_pinc ) *exp ( -B*ppb/inc_pinc ); 00213 c2= ( C*ppbs/PiGreco ) *exp ( -C*ppb*ppb*tetq ); 00214 double Kmfluss= A*c1*c2 ; 00215 double spettro=(Kpfluss+3.*Kmfluss)*.25; 00216 00217 */ 00218 00219 00220 // double C=3.5; 00221 00222 00223 // italo.. 00224 00225 //double slope =0.032840722 == 1./30.45; org power === 1.671; 00226 double slope =1./30.45; 00227 double power=1.671; //org power === 1.671; 00228 double spettro = pow ( ppb,power ) *exp ( -slope*ppb ); 00229 00230 //correzione per cammino.... 00231 double Inizio,Fine; 00232 Inizio= Beg_fid - Ctarg.z; 00233 Fine= End_fid - Ctarg.z; 00234 double dzdec=End_fid-Beg_fid; 00235 double camvol = ctau_avo_su_mass * ppb ; 00236 double pathcor= exp ( -Inizio/camvol ) * ( 1.-exp ( -dzdec/camvol ) ) ; 00237 spettro*=pathcor; 00238 00239 // spettro*= ( 0.6325-0.2324e-2*ppb+0.2244e-4*ppb*ppb ); //standard... 00240 // spettro*=(0.6325-0.2324e-2*ppb+0.2144e-4*ppb*ppb); 00241 00242 00243 // spettro*=(0.6325-0.1900e-2*ppb+0.2450e-4*ppb*ppb); // quasi perfetto 00244 spettro*= ( 0.6325-0.1900e-2*ppb+0.27e-4*ppb*ppb ); // forse più perfetto 00245 return spettro; 00246 } 00250 double ReaKsd::Produci() 00251 00252 // ok for Ksdec. Vedi commento sopra. 00253 00254 { 00255 gvet vtet= Vbeam&Vinc_ppp; vtet.Norma(); 00256 double tetq= asin ( vtet.norma );tetq*=tetq; 00257 double A=0.12, B=16.2, C=3.2; 00258 double c1= ( B/inc_pinc ) *exp ( -B*ppb/inc_pinc ); 00259 double c2= ( C*ppb*ppb/PiGreco ) *exp ( -C*ppb*ppb*tetq ); 00260 double Kpfluss= A*c1*c2 ; 00261 double spettro=Kpfluss; 00262 00263 return spettro; 00264 } 00265 00266 //========================== 00270 double ReaKpd::Produci() 00271 00272 // calcola la probabilita' della produzione Kp di impulso p 00273 // secondo la distribuzione per protone incidente 00274 // dNk/Np=(A/inc_pinc)*p^3*exp(-B*p/inc_pinc -C*(p*teta)^2 )[dp/p*dOmega] 00275 00276 { 00277 double A=0.16, B=8.5, C=3.0; 00278 00279 // vedi articolo 00280 gvet vtet= Vbeam&Vinc_ppp; vtet.Norma(); 00281 double tetq= asin ( vtet.norma );tetq*=tetq; 00282 double c1= ( B/inc_pinc ) *exp ( -B*ppb/inc_pinc ); 00283 double c2= ( C*ppb*ppb/PiGreco ) *exp ( -C*ppb*ppb*tetq ); 00284 return ( A*c1*c2 ); 00285 00286 00287 00288 } 00292 //------------------ 00293 double ReaKmd::Produci() 00294 // calcola la probabilita' della produzione Km di impulso p 00295 // secondo la distribuzione per protone incidente 00296 // dNk/Np=(A/inc_pinc)*p^3*exp(-B*p/inc_pinc -C*(p*teta)^2 )[dp/p*dOmega] 00297 // con A=0.58/inc_pinc, B=13.0, C=3.5, inc_pinc=400. Gev e teta=-2 10-3 rad. 00298 00299 { 00300 double A=.1, B=13.0, C=3.5; 00301 // vedi articolo 00302 gvet vtet= Vbeam&Vinc_ppp; vtet.Norma(); 00303 double tetq= asin ( vtet.norma );tetq*=tetq; 00304 double c1= ( B/inc_pinc ) *exp ( -B*ppb/inc_pinc ); 00305 double c2= ( C*ppb*ppb/PiGreco ) *exp ( -C*ppb*ppb*tetq ); 00306 return ( A*c1*c2 ); 00307 } 00308 //------------------ 00312 double Reappd::Produci() 00313 // calcola la probabilita' della produzione pip di impulso p 00314 00315 //............................ 00316 { 00317 double A=.8, B=11.5, C=5.0; 00318 gvet vtet= Vbeam&Vinc_ppp; vtet.Norma(); 00319 double tetq= asin ( vtet.norma );tetq*=tetq; 00320 double c1= ( B/inc_pinc ) *exp ( -B*ppb/inc_pinc ); 00321 double c2= ( C*ppb*ppb/PiGreco ) *exp ( -C*ppb*ppb*tetq ); 00322 return ( A*c1*c2 ); 00323 00324 } 00328 //------------------------------ 00329 double Reapmd::Produci() 00330 00331 // calcola la probabilita' della produzione pim di impulso p 00332 // con A=5.86/inc_pinc, B=11.5, C=5.0, inc_pinc=400. Gev e teta=2 10-3 mrad. 00333 //............................ 00334 { 00335 double A=5.86, B=11.5, C=5.0; 00336 gvet vtet= Vbeam&Vinc_ppp; vtet.Norma(); 00337 double tetq= asin ( vtet.norma );tetq*=tetq; 00338 double a= - B*ppb/inc_pinc; 00339 double b= - C*ppb*ppb*tetq; 00340 return ( A* ppb*ppb*exp ( a+b ) /inc_pinc ); 00341 } 00342 //------------------------------ 00343 00347 double ReaEtad::Produci() 00348 00349 // calcola la probabilita' della produzione eta 00350 00351 //............................ 00352 { 00353 double mmq = 0.5473* 0.5473; 00354 double ener = sqrt ( ppb*ppb+mmq ); 00355 double teta=acos ( vzb ); 00356 if ( teta>0.02||teta<0.00001 ) return ( 0.0 ); 00357 double w1, w2; 00358 w1=-46.309+2.6560*ener-.36088e-1*ener*ener+.18706e-3* 00359 ener*ener*ener-.33651e-6*ener*ener*ener*ener; 00360 w2=teta*exp ( -36646.*teta*teta ); 00361 00362 return ( w1*w2 ); 00363 00364 } 00365 //------------------------------ 00369 double ReaPi0d::Produci() 00370 00371 00372 // come per il pim ?????????? 00373 //............................ 00374 { 00375 double A=5.86, B=11.5, C=5.0; 00376 gvet vtet= Vbeam&Vinc_ppp; vtet.Norma(); 00377 double tetq= asin ( vtet.norma );tetq*=tetq; 00378 double a= - B*ppb/inc_pinc; 00379 double b= - C*ppb*ppb*tetq; 00380 return ( A* ppb*ppb*exp ( a+b ) /inc_pinc ); 00381 } 00382 //--------------------------------------- 00386 double ReaEleb::Produci() 00387 00388 // calcola la probabilita' della produzione elec/elep 00389 //......... spettro come vole iacopini................... 00390 { 00391 double A=40.,B=50., C=5.; 00392 gvet vtet= Vbeam&Vinc_ppp; vtet.Norma(); 00393 double tetq= asin ( vtet.norma );tetq*=tetq; 00394 double a=2.- ( ppb-B ) *.05;if ( a<0. ) a=0.; // spettro lineare 00395 double b= - C*ppb*ppb*tetq; 00396 return ( A*a*exp ( b ) /inc_pinc ); 00397 // return 1. ; 00398 } 00399 //------------------------------ 00404 double ReaPb::Produci() 00405 // calcola la probabilita' della produzione proton di impulso p 00406 // con A=.14, C=3.5, inc_pinc=400. Gev e teta=2 10-3 m 00407 //............................ 00408 { 00409 double A=0.14, C=3.5; 00410 gvet vtet= Vbeam&Vinc_ppp; vtet.Norma(); 00411 double tetq= asin ( vtet.norma );tetq*=tetq; 00412 double a=0.4*log ( ppb/inc_pinc ); 00413 double b= - C*ppb*ppb*tetq; 00414 return ( A* ppb*exp ( a+b ) ); 00415 } 00416 00417 00418 00419 00420 00421