FlyoDoc_2011 Pisa 2011 by GmP --- 011
|
#include <particella.h>
Public Member Functions | |
Particella () | |
const char * | Get_Nome () |
const char * | Get_Fato () |
const char * | Get_Type () |
int | Last_Devhit () |
int | Get_Ifato () |
unsigned long long | Get_DevStory () |
int | Get_Idm () |
int | Get_Id () |
int | Get_Ido () |
int | Get_See () |
int | Get_Nata () |
double | Get_Massa () |
double | Get_Massq () |
double | Get_Width () |
double | Get_Ctau () |
double | Get_Charg () |
gvet & | Get_Gx () |
qvet & | Get_Gp () |
double | Get_Gpx () |
double | Get_Gpy () |
double | Get_Gpz () |
double | Get_Gpn () |
void | Set_Id () |
void | Set_Type (const char *tip) |
void | Set_Nata () |
void | Set_Fato (const char *w, int ift) |
void | Set_Massa (double m) |
void | Set_Pbar () |
void | Save_Link () |
save and restore ********************************************** | |
void | Restore_Link () |
void | Update_Devstory (int) |
void | P2Gp () |
void | X2Gx () |
void | Move (double) |
void | Debug_out () |
void | Spia (char *, Device *, Device *, int, int) |
void | Reset_Stato () |
void | Stampa_questa_particella () |
void | Stampa_particle (Reazione *) |
Particella * | Decay_in_2 (const char *, const char *) |
Particella * | Decay_in_3 (const char *, const char *, const char *) |
Particella * | Decay_in_4 (const char *, const char *, const char *, const char *) |
Particella * | Decay_in_5 (const char *, const char *, const char *, const char *, const char *) |
void | Aggiorna_link (Particella *, Particella *, Particella *, Particella *) |
void | Aggiorna_link_Bullet (Particella *) |
void | Aggiusta_link (Particella *, Particella *, Particella *, Particella *) |
virtual void | DecParm () |
virtual void | DecParm_Pair () |
virtual void | DecParm_Brems () |
virtual double | Get_Ecut () |
virtual int | Get_Brems (Device *, double &, double &) |
virtual void | Get_Pair (Device *, double &, double &) |
virtual void | Get_Bersaglio (Device *, double) |
virtual int | Svalues () |
virtual double | Get_e1 () |
virtual double | Get_e2 () |
virtual double | Get_e3 () |
virtual double | Get_S1 () |
virtual double | Get_S2 () |
virtual double | Get_S3 () |
virtual int | Get_ss_done () |
int | Main_Loop () |
void | MkCluster () |
void | Make_decay_chain () |
int | Voldec (Particella *, Particella *) |
============================================================= | |
int | Trasport () |
Particella * | Get_Pointer (char *) |
Particella * | Ptr_Particle (const char *) |
Public Attributes | |
Reazione * | rea_madre |
gvet | X |
gvet | Vers |
qvet | P |
double | cstar |
double | fistar |
double | pathok |
double | path_max |
double | path_done |
double | last_path |
Particella * | lf |
puntatori alle particelle di : sinistra,destra,sopra,sotto,cluster, urto, prossima. esempio A => B C A.dw punta a B B.up punta a A B.rg punta a C C.up punta a A C.lf punta a B poi se si genera un cluster come nelle interazionigas A.cls punta all prima particella del gas_cluster se A deve urtare con un bersaglio D A.urt punta a D ( vedi implementazione in ....) | |
Particella * | rg |
Particella * | up |
Particella * | dw |
Particella * | cls |
Particella * | next |
Protected Attributes | |
const char * | nome |
const char * | fato |
const char * | type |
unsigned long long | devstory |
int | devhit |
int | ido |
int | id |
int | idm |
int | see |
int | nata |
int | Ifato |
int | Pair_Production |
int | Brems_Production |
double | charg |
double | massa |
double | width |
double | ctau |
gvet | Gx |
qvet | Gp |
qvet | Pbar |
qvet | Pburst |
qvet | Qpatre |
double | tmp |
double | prandom |
Part_db * | pointer_db |
Particella * | lfsav |
Particella * | rgsav |
Particella * | upsav |
Particella * | dwsav |
Friends | |
class | Device |
class | DevStraw |
class | Part_db |
class | Bufdev |
class | Reagas |
class | Illumina |
The base and virtual Class for the intercting particles..
Definition at line 28 of file particella.h.
Particella::Particella | ( | ) |
Particle definition
CP violation program...... in Obj!! Start il 23.6.92 new versio 29.10.99 ... 05.05.2005
Definition at line 37 of file particella.cpp.
{ if ( ( pointer_db=Matter->Get_matter ( Partname, this )) == 0 ) { Gout<<"\n Particella() Partname error.... "<<Partname<<std::endl; exit ( 0 ); } // Create a new reaction with links. SelRea->Totpart++; ido = SelRea->Totpart; if ( SelRea->Lastpart != 0 ) SelRea->Lastpart->next = this; SelRea->Lastpart = this; this->next = 0; id=0; //vedi Set_Id(); fato = Undef; devhit=Ifato =devstory=0; if ( charg ==0 ) type = Neut; else type = Char; if ( massa==0.0&&width==0.0&&ctau==0.0 ) type=Res; nata=0; rea_madre=LastReaction; Pair_Production=Brems_Production=0; // 1 attiva la bremsstrhalung, 2 attiva la pair prodution... P.Riposo(massa); Qpatre=Pburst=Pbar=Gp=P; Gx.Reset(); // Gout<<"\n Part P.mq %12.6lf %12.6lf %12.5lg %12.5lg",massa,P.m,P.mq,Gp.mq); pathok=path_max=path_done=last_path=0.0; cstar=10.; // flag esplicitamente voluta...vedi Voldec... //------------------links---- up = 0; rg = 0; dw = 0; lf = 0; cls = 0; }
void Particella::Save_Link | ( | ) |
save and restore **********************************************
Definition at line 194 of file particella.cpp.
int Particella::Trasport | ( | ) |
T R A N S P O R T
This procedure transports particles with momentum and life time different fron zero... and verifies along the path the crossing of the devices.
Particle status definition during the tracing
RIVELA:
-----------------------------------------
Definition at line 704 of file particella.cpp.
{ int botta = 0, loop = 1000; // do nothing if ..... if ( P.norma == 0.0 || ctau == 0.0 || ( fato != Nata ) ) return botta; // Gout<<"\n Entro in Transport "<<evento_.Gen.Event; // Gout<<"\n Trsa: "<<setprecision(2) // <<" Ev "<<evento_.Gen.Event<<" id "<< id<<" "<<fato<<" P "<<P.norma<<" ctau "<<ctau<<" see "<<see; if ( see == 0 ) { fato = Novede; Ifato=-10; return botta; } double lontano=Zona - X[2]; // Gout<<"\nEv "<<Eventi_Fatti<<" Trans. " <<nome<<" "<< ido<< " " <<type; // if(dw!=0) Gout<< " "<<dw->nome; if ( type != Beam && type!=Bullet) { if ( ctau > 0.0 ) // particella che decade seguita da .....anche nulla.. { double volo = ctau * P.norma / massa; path_max = -volo * log ( EPSI + Pran() ); if ( path_max> lontano ) path_max = lontano; // if(Eventi_Fatti>71&Eventi_Fatti<91) // Gout<<"\nEv "<<setw(8)<<Eventi_Fatti<<" Trans. "<<setw(6)<<nome<<" "<<setw(5)<< ido<<setprecision(2) // <<" "<<setw(9)<< path_max<<" pz "<<setw(9)<<P.z<<" Rand "<<setw(9)<<Pran()<<flush; } else path_max = lontano; // for stable particles...or with decay not defined... } // Gout<<"\nEv "<<Eventi_Fatti<<" Trans. "<<nome<<" " << path_max<<" pz "<<P.z; // set the devices accessible to the flighing particle.. Set_Rivela_in_Dev ( this ); // Apparato->Set_Rivela(this); //===================================================== //===================================================== // start the loop on the apparatus // Vers = flight direction defined in particle object.... path_done = pathok = 0.0; Device *pv,*Dvok; Devloop = Apparato; Apparato->Reset_Pos(); while ( --loop >= 0 ) { pv=Devloop; // starting Dev... can be changed by Get_camm. // if(idm>4&&idm<9) // Gout<<"\n Ev "<<setw(5)<<Eventi_Fatti<< " "<<setw(8)<<nome << " "<<setw(8)<<pv->nome; Dvok=pv->Get_camm ( this ); if ( Dvok == 0 ) break; //end transport: passati tutti i dev... pathok=Dvok->camm; // if(Dvok->idev==2&&ido==1) // Gout<<"\n Ev "<<setw(5)<<Eventi_Fatti<< " "<<setw(8)<<nome << " devloop "<<setw(8)<<pv->nome // << " devok "<<setw(8)<<Dvok->nome<<" " <<setw(8)<<Dvok->camm<< " "<<Dvok->nowpos; /* if(Dvok->idev==2&&ido==1) cout<<"\n Ev "<<setw(5)<<Eventi_Fatti<< " "<<setw(8)<<nome << " "<<setw(8)<<Dvok->nome<<" pth "<<setw(8)<<pathok << " pos "<<setw(2)<<Dvok->nowpos<<" prev "<<setw(8)<<Dvok->prevpos;*/ // potential path redefined if bigger then dacay path. if ( ctau>0.0 && pathok > ( path_max-path_done ) ) { pathok= ( path_max-path_done+0.000001 ); fato=Decay; Ifato=-2; /* if ( this==SelRea->avo && Dvok->fun==Gasint ) { MkCluster(); fato=Gasint; Ifato=-20; //Qui si crea un cluster..... Gout<<"\n Ev0 "<<evento_.Gen.Event<<" "<<nome <<" in "<<Dvok->nome <<" "<<fato <<" path "<<setw ( 8 ) << pathok << " Z "<<setw ( 8 ) << X.z; } */ } //============================================================================== //============================================================================== if ( Dvok->nowpos == ESTERNO ); // do nothing //============================================================================== //============================================================================== else if ( Dvok->nowpos == INTERNO ) { botta++; // if ( idm==14 ) Spia ( "Interno",pv,Dvok,47,52 ); //---------------------------------------------------- //---------------------------------------------------- // destino secondo la funzione if ( Dvok->fun == Trig || Dvok->fun == None || Dvok->fun == Nodef ); // nessuna decisione .. si continua a tracciare // altrimenti le cause per terminare il tracing...si cambia il fato else if ( Dvok->fun == Dead || Dvok->fun == Trigh ) { fato = Dvok->nome; Ifato=Dvok->idev; } if ( Dvok->rivela==2|| // assorbe tutta l'energia e muore Dvok->rivela==4 ) { fato = Dvok->nome; Ifato=Dvok->idev; } else if ( Dvok->fun == Magn || Dvok->fun == Dump ) { // nota il frame del magnete (che corrisponde all' INTERNO) fa da dump. Il campo è sempre nel "buco" if ( nome!=Mum && nome!=Mup ) //except the muons.. { fato = Dvok->nome; Ifato=Dvok->idev; } } else if ( Dvok->fun == Veto ) { // nel caso del "veto" si uccide addirittura l'evento con il flag botta =-1000 // invece si termina solo il tracing della particella se si vuole scrivere tutto if ( WrtNt!=WRTALL ) { fato = Dvok->nome; Ifato=Dvok->idev; botta=-1000; } else { fato = Dvok->nome; Ifato=Dvok->idev; } } // debug quale decisione? /* if ( Dvok->idev==2 ) { X.print ( "X1" ); Gout<<setprecision(3) <<" ev "<< Eventi_Fatti<<" "<< nome <<" pos " <<Dvok->nowpos<<" "<<Dvok->prevpos <<" dh "<<devhit <<" ft "<<fato << " pathok " <<setw(9)<<pathok; } */ //---------------------------------------------------- //---------------------------------------------------- // scrivo i colpi (cioè memorizza gli hits nei devices) quando if ( Dvok->prevpos==ESTERNO || // è appena entrata dall'esterno Dvok->prevpos==INBUCO || // è entrata dal "buco" Dvok->prevpos>=UNDEF || // appena nata o devhit=0 (vedi ScrvColpi() ) devhit==0 ) Dvok->ScrvColpi ( this ); // prima volta vista } // ---------- fine interno ----------- //============================================================================== //============================================================================== //------------ E' nel buco else if ( Dvok->nowpos == INBUCO ) { if ( Dvok->fun==Magn && // entra nel "buco" del mag o nasce nel mag! ( devhit==0 || Dvok->prevpos==UNDEF|| Dvok->prevpos==ESTERNO ) ) { Dvok->ScrvColpi ( this ); } //pro memoria ...dall'INTERNO va nel buco..per ora si lascia tracciare //if ( Dvok->prevpos== INTERNO ); } //--------Fine in buco------------ //============================================================================== //============================================================================== //.... check the fato if ( fato!=Nata&&fato!=Decay ) { return botta; //stop tracking....se il fato è diverso da normale o da "decay" } // qui solo per particelle con fato normale o in decadimento. //*************************************************************************** //----------------------------- real trasport ------------------------------- // now move the particle in the space doing also // pair production or bremsstrhalung .or clusters..or move in magnetic field..and multiplescattering. // if (Dvok->nowpos == ESTERNO) { // free flight Move ( pathok ); last_path=pathok; } else { int ift=0; if ( ( ift=Dvok->Traccia ( this )) > 0 ) // muore nel tracing ... { fato=Dvok->nome; Ifato=Dvok->idev; return botta; } else if (ift < 0 ) // muore nel tracing ... { fato=Dvok->nome; Ifato=ift; return botta; } } //============================================================================== //============================================================================== if ( fato==Decay ) //stop tracking....anche per gam->pair prod and brems ... { if ( X.Norma() >Zona ) { fato=Decfar; Ifato=-8; } // Si verifica se la particella beam deve fare una interazione con il gas // attenzione i dev sono annidati.... if ( this==SelRea->avo && Dvok->nowpos == INBUCO ) //Sono nel buco del dev { // quindi guardo se sono anche nel buco del dev Dectubo .... if ( dectubo!=0 ) { if ( dectubo->Posizione() == INBUCO && dectubo->fun==Gasint ) // attenzione correzione per analisi fondi particolare... { // allora genero un cluster da interazione in gas MkCluster(); fato=Gasint; Ifato=-20; //Qui si crea un cluster..... } } } return botta; } if ( P.norma<0.0001 ) // stop tracking per fine energia { fato = Dvok->nome; Ifato=Dvok->idev; if ( Debugon==1 ) Gout<<"\nTout2: Ev "<<evento_.Gen.Event<<" "<<nome<<" "<<fato<<" "<<X.z; return botta; } } //============================================================================== //============================================================================== //................ e n d t r a c i n g lo o p ........ // here if fato == norm ..... rivedere qui.... if ( ctau < 0.0 ) // particella stabile { if ( X.z<.90*Zona ) { // X.Norma();X.print(nome); pathok=path_max-path_done; X+=Vers*pathok; //transport // X.Norma();X.print(nome); } fato = Lost; Ifato=-9; } // particella che decade...... else if ( ctau > 0.0 && P.norma>0.001 ) { pathok=path_max-path_done; X+=Vers*pathok; //transport fato= Decay; Ifato=-2; if ( X.Norma() >Zona ) { fato=Decfar; Ifato=-8; } } return ( botta ); }
int Particella::Voldec | ( | Particella * | pb, |
Particella * | pc | ||
) |
=============================================================
Definition at line 460 of file particella.cpp.
{ Particella *pa; double eb, pcm,pt,pcmq; double rma, rmb, rmc; double cost,fi, sinfi, cosfi; static qvet Stesso; //dummy for lorentz buster... //============ pa = this; // nota giusto per differenziare rispetto a pb e pc if ( pa ->fato==Decay ); // particelle che decadono else if ( pa->ctau < 0. ) return -1; // stable particle. no action is taken*/ // Test the fato of the father particle, if not normal */ // stop the child generation */ // Gout<<"\n voldec "<<nome; if ( pa->fato != Nata && pa->fato != Decay ) { pb->fato = Undef; pb->Ifato=0; pc->fato = Undef; pc->Ifato=0; pc->X = pb->X = pa->X; return -2; //non va trasportato! } // copia P nel vettore ausiliario Qpatre, può essere alterato da DecParm pa->Qpatre=pa->P; //----------------------------------------------------------- // produzione coppie nella interazione dei gamma nel materiale... // produzione bremsstrhalung da leptoni... if ( pa->Pair_Production>1 ) pa->DecParm_Pair(); if ( pa->Brems_Production>1 ) pa->DecParm_Brems(); pb->fato = Nata; pb->Ifato = -1; pc->fato = Nata; pc->Ifato = -1; // get the parameters for particle : FaseSpace resonance == dec isotropici, // coppia dalitz, ... munu da K3l... // does nothing for stable particles .... pb->DecParm(); pc->DecParm(); // define the particles parameters for next use rma = Qpatre.m; rmb = pb->massa; rmc = pc->massa; pb->P[3] = eb = ( rma * rma + rmb * rmb - rmc * rmc ) * 0.5 / rma; pc->P[3] = rma - eb; pcm = sqrt ( ( pcmq= ( eb + rmb ) * ( eb - rmb ) ) ); pb->P.normaq = pc->P.normaq = pcmq; pb->P.norma = pc->P.norma = pcm; //******************************************************************/ // decdimento isotropo se cstar non e' stato gia' definito! if ( pb->cstar>1. ) // decadimento non definito: genero isotropico { cost = 1.0 - 2.0 * Pran(); fi = DuePiGreco* Pran(); cosfi = cos ( fi ); sinfi = sin ( fi ); } else // fisica di decadimento definita { cost = pb->cstar; fi = pb->fistar; cosfi = cos ( fi ); sinfi = sin ( fi ); } // Gout<<"\n Voldec ev2 "<<Eventi_Fatti<<" "<<this<<" "<<pb <<" "<<pc<<flush; // Gout<<" "<<this->Get_Nome()<<" "<<pb->Get_Nome() <<" "<<pc->Get_Nome()<<flush; // Definisco un sistema con l'asse z nella direzione di moto // della particella padre nel baricentro dove fu creata. // Come creare l'asse x! adesso a random!! // Attenzione Pbar va definito cosi' se si tratta di risonanza // altrimenti occorre Pbar=pa->P vedere meglio!!!!!!!!!!! gvet vaz=pa->Pbar.Verso(); // asse z // definizione del miglior asse sghembo a vaz.. arbitrario gvet vzn ( 1.,0.,0. ); // attenzione rivedere anche se funziona !!!!!!!!!!!!! double ax,ay,az; vaz.putv( ax,ay,az ); ax=fabs ( ax ); ay=fabs ( ay ); az=fabs ( az ); if ( ay<=az&&ay<=ax ) vzn.setv ( 0.,1.,0. ); else if ( az<=ax ) vzn.setv ( 0.,0.,1. ); //------- gvet vay=vaz&vzn; vay.Norma(); vay=vay.Verso(); // asse y gvet vax=vay&vaz; vax.Norma(); vax=vax.Verso(); // asse x pt = pcm * ( sqrt ( 1. - cost * cost ) );// pericolo di negativa sqrt! gvet mom ( vax*pt*cosfi + vay*pt*sinfi + vaz*pcm*cost ); // mom.Norma(); // mom.print("mom"); pc->P[0]=- ( pb->P[0]=mom[0] ); pc->P[1]=- ( pb->P[1]=mom[1] ); pc->P[2]=- ( pb->P[2]=mom[2] ); //ricordo il suo momento nel baricentro. pb->Pbar=pb->P; pc->Pbar=pc->P; pb->Pburst=Qpatre; pc->Pburst=Qpatre; // ricordo il momento del padre ... // vedi qui sotto.. si evitano problemi con le trasformate di lrentz .. //Get the lorentz booster if ( pa->type==Res ) // decadim in 3 or 4 bodies via Res.... // pa->nome==Pic2 ,Pi02,P00p,Gg2 { // prima un burst nella direzione e velocità che aveva la Pa // nel baricentro di suo padre pb->P=pb->P.Lburst ( pa->Pbar ); pc->P=pc->P.Lburst ( Stesso ); //sono nel bar del padre della risonanza // quindi passo al lab con il burst impresso a Pa a suo tempo pb->P=pb->P.Lburst ( pa->Pburst ); pc->P=pc->P.Lburst ( Stesso ); } // se il padre non e' una risonanza passo direttamente al lab if pa moves * else if ( Qpatre.norma > 0.0 ) { pb->P=pb->P.Lburst ( Qpatre ); pc->P=pc->P.Lburst ( Stesso ); } //------------------------------------- pb->Gp = pb->P; pc->Gp = pc->P; pb->Vers=pb->P.Verso(); pc->Vers=pc->P.Verso(); // nascita set to ok... pb->nata=pc->nata=1; // define the initial coordinates at the father space point */ // see the Transport routine */ pb->Gx=pb->X = pc->Gx= pc->X = pa->X; /******************* debug ***/ if ( Debugon==1 ) // if (Eventi_Fatti==129) { // pa->Stampa_questa_particella(); pa->P.print ("Pa_p"); pa->X.print ("Pa_X"); Gout<<" "<<setw(8)<<pa->nome <<" "<<setw(4)<<pa->ido<<" "<<setw(4)<<pa->id <<" Ev "<<Eventi_Fatti; pb->P.print ("Pb_p"); pb->X.print ("Pb_X"); Gout<<" "<<setw(8)<<pb->nome <<" "<<setw(4)<<pb->ido<<" "<<setw(4)<<pb->id; pc->P.print ("Pc_p"); pc->X.print ("Pc_X"); Gout<<" "<<setw(8)<<pc->nome <<" "<<setw(4)<<pc->ido<<" "<<setw(4)<<pc->id; Gout<<endl; } /************ end debug ********/ return 1; }
puntatori alle particelle di : sinistra,destra,sopra,sotto,cluster, urto, prossima. esempio A => B C A.dw punta a B B.up punta a A B.rg punta a C C.up punta a A C.lf punta a B poi se si genera un cluster come nelle interazionigas A.cls punta all prima particella del gas_cluster se A deve urtare con un bersaglio D A.urt punta a D ( vedi implementazione in ....)
Definition at line 87 of file particella.h.