FlyoDoc_2011 Pisa 2011 by GmP --- 011

flyopunta/src/src_dev62/devrich.cpp

00001 /*
00002     <one line to give the program's name and a brief idea of what it does.>
00003     Copyright (C) <year>  <name of author>
00004 
00005     This program is free software; you can redistribute it and/or modify
00006     it under the terms of the GNU General Public License as published by
00007     the Free Software Foundation; either version 2 of the License, or
00008     (at your option) any later version.
00009 
00010     This program is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013     GNU General Public License for more details.
00014 
00015     You should have received a copy of the GNU General Public License along
00016     with this program; if not, write to the Free Software Foundation, Inc.,
00017     51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
00018 
00019 */
00020 #include "parm.h"
00021 #include "part_db.h"
00022 #include "devrich.h"
00023 
00024 using namespace std;
00025 
00026 DevRich::DevRich()
00027         :DevCrn()
00028 {
00029     devtype=TypDevRich;
00030     devclass="Ring Imaging Cherenkov";
00031 Gout<<"\n\n < "<<nome <<" > Dev Id "<<idev<<" Device type <"<<devclass<<"> typ "<<devtype; 
00032 
00033 }
00034 
00035 DevRich::~DevRich()
00036 {
00037 }
00038 
00039 int DevRich::SimulaDev()
00040 {
00041     if(mhit<1)return 0;
00042     double Thres_pi=15.;
00043     double Thres_mu=12.;
00044     qvet Eimp;
00045     int loop=0;
00046     const char *Part_nome;
00047     while (loop<mhit)
00048     {
00049         Eimp=M_Hits[loop].Pdev;
00050         Part_nome= M_Hits[loop].pnome;
00051 
00052         if ( Part_nome==Pip|| Part_nome==Pim)
00053         {
00054             if (M_Hits[loop].Pdev.mom <Thres_pi)
00055                 M_Hits[loop].idead=-99999;
00056             /*uccido la particella*/
00057         } if (M_Hits[loop].Pdev.mom <Thres_pi)
00058             M_Hits[loop].idead=-99999;
00059 
00060         else  if ( Part_nome==Mum|| Part_nome==Mup)
00061         {
00062             if (M_Hits[loop].Pdev.mom <Thres_mu)
00063                 M_Hits[loop].idead=-99999;
00064         }
00065 
00066 
00067 
00068 
00069 
00070 
00071 //Gout<<"\n Nome "<<Part_nome<<" e "<<Eimp;
00072 //Gout<<"\n Nome "<<Part_nome<<" e "<<Eimp;
00073         loop++;
00074     }
00075 //==============  La parte che segue รจ fissa!
00076 // elimino le paricelle morte, compattizzo i dati e  ridefinisco nhit e m
00077 
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 
00097 
00098 
00099     return 0;
00100 }
 All Classes Namespaces Files Functions Variables