FlyoDoc_2011 Pisa 2011 by GmP --- 011

flyopunta/src/src_dev62/devsac.cpp

00001 /***************************************************************************
00002                           devsac.cpp  -  description  2010
00003                              -------------------
00004 
00005   ***************************************************************************
00006   *                                                                         *
00007   *   NA62  simulation program.                                             *
00008   *                                                                         *
00009   ***************************************************************************/
00010 #include "parm.h"
00011 #include "evento.h"
00012 #include "devsac.h"
00013 #include "particella.h"
00014 #include "part_db.h"
00015 
00016 DevSac::DevSac()
00017 {
00018     devtype=TypDevSac;
00019     devclass="Small Angle Calorimeter";
00020 Gout<<"\n\n < "<<nome <<" > Dev Id "<<idev<<" Device type <"<<devclass<<"> typ "<<devtype; 
00021          
00022 }
00023 DevSac::~DevSac()
00024 {}
00025 //----------------- --------
00026 void DevSac::Prgeom()
00027 {
00028 
00029     Gout<<"==================  R i v e l a t o r e =================";
00030     Gout<<"\n --> < "<<nome <<" >  [ "<<fun
00031     <<" ]  Small Angle  Calorimeter:  Rettangolare"<<std::endl;
00032     Device::Prgeom();
00033 }
00034 //=======-----------------------------------
00035 int DevSac::SimulaDev()
00036 {
00037           if(mhit<1)return 0;
00038     double Thres_gam=.100;
00039     double Thres_neu=.100; //threshold su p!
00040 
00041 // loop sulle particelle viste;
00042     qvet Eimp;
00043     int loop=0;
00044     const char *Part_nome;
00045     //   double Probint= 1.-exp(-2.*Lout.z/liint);
00046     //double Probint= .99752;
00047 double Probint= .715418; //10.5 cm Pb + 10.5 cm Scintillator (70 strips da 1..5 +1.5 mm l'una)
00048     while (loop<mhit)
00049     {
00050         Eimp=M_Hits[loop].Pdev;
00051         Part_nome= M_Hits[loop].pnome;
00052 
00053         if ( Part_nome==Gam)
00054         {
00055 
00056 // nota i gamma sono dampati.... quindi  l'energia è automaticamente memorizzata in me
00057             if ( Eimp.e<Thres_gam)  M_Hits[loop].idead=-99999;
00058             /*uccido la particella sotto soglia*/
00059         }
00060         else if ( Part_nome==Neutrone|| Part_nome==A_Neutrone)
00061         {
00062             if (Pran()>Probint|| Eimp.mom<Thres_neu)  M_Hits[loop].idead=-99999;
00063             /*uccido la particella se non interagisce o sotto soglia*/
00064         }
00065 
00066         else if (M_Hits[loop].Pr->Get_Charg()==0) //tutte le altre particelle neutre
00067         {
00068             //  per ora come per il neutrone
00069             if (Pran()>Probint|| Eimp.mom<Thres_neu)  M_Hits[loop].idead=-99999;
00070             /*uccido la particella*/
00071         }
00072 
00073         loop++;
00074 
00075     }
00076 //==============  La parte che segue è fissa!
00077 // elimino le paricelle morte, compattizzo i dati e  ridefinisco nhit e mhit;
00078 //  Gout<<"\n Prima  del coppattamento..."<<nome<<" "<< nhit<<" " <<mhit<< "  "<<M_Hits[nhit].pnome;
00079 
00080     loop =0;
00081     int newhit=mhit;
00082     while (loop<newhit)
00083     {
00084         if (M_Hits[loop].idead!=-99999)loop++;
00085         else if (newhit==1)newhit=0;
00086         else {
00087             newhit--;
00088             for (int i=loop;i<newhit;i++)
00089             {
00090                 M_Hits[i]=M_Hits[i+1];
00091             }
00092         }
00093     }
00094     mhit=newhit;
00095     nhit=mhit-1;
00096 //     Gout<<"\n Dopo il coppattamento..."<<nome<<" "<<nhit<<" " <<mhit;
00097 //     if (nhit>-1)  Gout<<"  "<<M_Hits[nhit].pnome;
00098     return 0;
00099 
00100 
00101 
00102 
00103 
00104     return 1.;
00105 }
 All Classes Namespaces Files Functions Variables