From 6f6b78bd7aa9306ca63ad5c6362b64dfc87ea8a1 Mon Sep 17 00:00:00 2001 From: matta <matta@npt> Date: Wed, 18 Jul 2012 12:39:35 +0000 Subject: [PATCH] Adding missing file --- .../TComptonTelescopeDataDict.cxx | 2 +- .../TComptonTelescopeProcessDataDict.cxx | 2 +- NPLib/Eurogam/TEurogamDataDict.cxx | 2 +- NPLib/Maya/TMayaData.cxx | 6 +- NPLib/Vamos/TVamosCHIODataDict.cxx | 2 +- NPLib/Vamos/TVamosDCDataDict.cxx | 2 +- NPLib/Vamos/TVamosFingerDataDict.cxx | 2 +- NPLib/Vamos/TVamosPlasticDataDict.cxx | 2 +- NPSimulation/src/Particle.cc | 82 ++++++++ NPSimulation/src/ParticleStack.cc | 185 ++++++++++++++++++ NPSimulation/src/W1Scorers.cc | Bin 6320 -> 6320 bytes 11 files changed, 277 insertions(+), 10 deletions(-) create mode 100644 NPSimulation/src/Particle.cc create mode 100644 NPSimulation/src/ParticleStack.cc diff --git a/NPLib/ComptonTelescope/TComptonTelescopeDataDict.cxx b/NPLib/ComptonTelescope/TComptonTelescopeDataDict.cxx index 02a4be261..395a14e4c 100644 --- a/NPLib/ComptonTelescope/TComptonTelescopeDataDict.cxx +++ b/NPLib/ComptonTelescope/TComptonTelescopeDataDict.cxx @@ -1,5 +1,5 @@ // -// File generated by rootcint at Tue Jul 17 16:40:44 2012 +// File generated by rootcint at Wed Jul 18 11:43:12 2012 // Do NOT change. Changes will be lost next time file is generated // diff --git a/NPLib/ComptonTelescope/TComptonTelescopeProcessDataDict.cxx b/NPLib/ComptonTelescope/TComptonTelescopeProcessDataDict.cxx index b73fc8d78..1ed66ad98 100644 --- a/NPLib/ComptonTelescope/TComptonTelescopeProcessDataDict.cxx +++ b/NPLib/ComptonTelescope/TComptonTelescopeProcessDataDict.cxx @@ -1,5 +1,5 @@ // -// File generated by rootcint at Tue Jul 17 16:40:46 2012 +// File generated by rootcint at Wed Jul 18 11:43:14 2012 // Do NOT change. Changes will be lost next time file is generated // diff --git a/NPLib/Eurogam/TEurogamDataDict.cxx b/NPLib/Eurogam/TEurogamDataDict.cxx index e187cc5de..688f67b98 100644 --- a/NPLib/Eurogam/TEurogamDataDict.cxx +++ b/NPLib/Eurogam/TEurogamDataDict.cxx @@ -1,5 +1,5 @@ // -// File generated by rootcint at Tue Jul 17 16:40:49 2012 +// File generated by rootcint at Wed Jul 18 11:43:17 2012 // Do NOT change. Changes will be lost next time file is generated // diff --git a/NPLib/Maya/TMayaData.cxx b/NPLib/Maya/TMayaData.cxx index 05f116081..f2432754b 100755 --- a/NPLib/Maya/TMayaData.cxx +++ b/NPLib/Maya/TMayaData.cxx @@ -245,7 +245,7 @@ bool TMayaData::Calibrate(){ if(fMaya_PAD_Nbr.at(i)<fMaya_PAD_E_calpar.size()){ for(unsigned int j=0;j<fMaya_PAD_E_calpar.at(tmpNbr).size();j++){ - tmpCal += pow(fMaya_PAD_E.at(i),j)*fMaya_PAD_E_calpar.at(tmpNbr).at(j) ; + tmpCal += pow((double)fMaya_PAD_E.at(i),(double)j)*fMaya_PAD_E_calpar.at(tmpNbr).at(j) ; } if(tmpCal>fMaya_PAD_E_cal_threshold){ fMaya_PAD_E_cal.at(i) = tmpCal ; @@ -372,7 +372,7 @@ Conclusion : all have two times r-1,r,r+1 combinaisons } else { if(fMaya_QFIL_T_Nbr.at(i)<fMaya_QFIL_T_calpar.size()){ for(unsigned int j=0;j<fMaya_QFIL_T_calpar.at(tmpNbr).size();j++){ - tmpCal += pow(fMaya_QFIL_T.at(i),j)*fMaya_QFIL_T_calpar.at(tmpNbr).at(j) ; + tmpCal += pow((double)fMaya_QFIL_T.at(i),(double)j)*fMaya_QFIL_T_calpar.at(tmpNbr).at(j) ; } fMaya_QFIL_T_cal.at(i) = tmpCal ; //fprintf(fichier_test,"%f \n",fMaya_QFIL_T_cal.at(i)); @@ -416,7 +416,7 @@ cout << "out Qfil " << endl ; } else { if(fMaya_Si_E_Nbr.at(i)<fMaya_Si_E_calpar.size()){ for(unsigned int j=0;j<fMaya_Si_E_calpar.at(tmpNbr).size();j++){ - tmpCal += pow(fMaya_Si_E.at(i),j)*fMaya_Si_E_calpar.at(tmpNbr).at(j) ; + tmpCal += pow((double)fMaya_Si_E.at(i),(double)j)*fMaya_Si_E_calpar.at(tmpNbr).at(j) ; } fMaya_Si_E_cal.at(i) = tmpCal ; } diff --git a/NPLib/Vamos/TVamosCHIODataDict.cxx b/NPLib/Vamos/TVamosCHIODataDict.cxx index 7a325273e..df0790581 100644 --- a/NPLib/Vamos/TVamosCHIODataDict.cxx +++ b/NPLib/Vamos/TVamosCHIODataDict.cxx @@ -1,5 +1,5 @@ // -// File generated by rootcint at Tue Jul 17 16:41:38 2012 +// File generated by rootcint at Wed Jul 18 11:44:03 2012 // Do NOT change. Changes will be lost next time file is generated // diff --git a/NPLib/Vamos/TVamosDCDataDict.cxx b/NPLib/Vamos/TVamosDCDataDict.cxx index fe7b07b7a..b3377069a 100644 --- a/NPLib/Vamos/TVamosDCDataDict.cxx +++ b/NPLib/Vamos/TVamosDCDataDict.cxx @@ -1,5 +1,5 @@ // -// File generated by rootcint at Tue Jul 17 16:41:39 2012 +// File generated by rootcint at Wed Jul 18 11:44:04 2012 // Do NOT change. Changes will be lost next time file is generated // diff --git a/NPLib/Vamos/TVamosFingerDataDict.cxx b/NPLib/Vamos/TVamosFingerDataDict.cxx index 7d9790c6f..1990684d7 100644 --- a/NPLib/Vamos/TVamosFingerDataDict.cxx +++ b/NPLib/Vamos/TVamosFingerDataDict.cxx @@ -1,5 +1,5 @@ // -// File generated by rootcint at Tue Jul 17 16:41:37 2012 +// File generated by rootcint at Wed Jul 18 11:44:02 2012 // Do NOT change. Changes will be lost next time file is generated // diff --git a/NPLib/Vamos/TVamosPlasticDataDict.cxx b/NPLib/Vamos/TVamosPlasticDataDict.cxx index 32f5e5795..76df2db6f 100644 --- a/NPLib/Vamos/TVamosPlasticDataDict.cxx +++ b/NPLib/Vamos/TVamosPlasticDataDict.cxx @@ -1,5 +1,5 @@ // -// File generated by rootcint at Tue Jul 17 16:41:36 2012 +// File generated by rootcint at Wed Jul 18 11:44:01 2012 // Do NOT change. Changes will be lost next time file is generated // diff --git a/NPSimulation/src/Particle.cc b/NPSimulation/src/Particle.cc new file mode 100644 index 000000000..4cdb27810 --- /dev/null +++ b/NPSimulation/src/Particle.cc @@ -0,0 +1,82 @@ +/***************************************************************************** + * Copyright (C) 2009-2010 this file is part of the NPTool Project * + * * + * For the licensing terms see $NPTOOL/Licence/NPTool_Licence * + * For the list of contributors see $NPTOOL/Licence/Contributors * + *****************************************************************************/ + +/***************************************************************************** + * Original Author: Adrien MATTA contact address: matta@ipno.in2p3.fr * + * * + * Creation Date : April 2012 * + * Last update : * + *---------------------------------------------------------------------------* + * Decription: * + * This class define particle to be shoot at the end of the generated event * + * It contain a G4ParticleDefinition, a Kinetic energy and the direction to * + * shoot the particle in the laboratory frame. * + * * + *---------------------------------------------------------------------------* + * Comment: * + * * + *****************************************************************************/ + +#include "Particle.hh" + +Particle::Particle(){ + m_ParticleDefinition = NULL; + m_T = 1*GeV; + m_Direction = G4ThreeVector(0,0,1); +} + +Particle::~Particle(){ +} + +Particle::Particle(G4ParticleDefinition* particle,double T,G4ThreeVector Direction, G4ThreeVector Position,bool ShootStatus){ + m_ParticleDefinition = particle; + m_T = T; + m_Direction = Direction; + m_Position = Position; + m_ShootStatus = ShootStatus; +} + +G4ParticleDefinition* Particle::GetParticleDefinition(){ + return m_ParticleDefinition; +} + +double Particle::GetParticleKineticEnergy(){ + return m_T; +} + +G4ThreeVector Particle::GetParticleMomentumDirection(){ + return m_Direction; +} + +G4ThreeVector Particle::GetParticlePosition(){ + return m_Position; +} + +bool Particle::GetShootStatus(){ + return m_ShootStatus; +} + +void Particle::SetParticleDefinition(G4ParticleDefinition* particle){ + m_ParticleDefinition = particle; +} + +void Particle::SetParticleKineticEnergy(double T){ + m_T = T ; +} + +void Particle::SetParticleMomentumDirection(G4ThreeVector Direction){ + m_Direction = Direction; +} + +void Particle::SetParticlePosition(G4ThreeVector Position){ + m_Position = Position; +} + +void Particle::SetShootStatus(bool ShootStatus){ + m_ShootStatus = ShootStatus; +} + diff --git a/NPSimulation/src/ParticleStack.cc b/NPSimulation/src/ParticleStack.cc new file mode 100644 index 000000000..dde3fa0ed --- /dev/null +++ b/NPSimulation/src/ParticleStack.cc @@ -0,0 +1,185 @@ +/***************************************************************************** + * Copyright (C) 2009-2010 this file is part of the NPTool Project * + * * + * For the licensing terms see $NPTOOL/Licence/NPTool_Licence * + * For the list of contributors see $NPTOOL/Licence/Contributors * + *****************************************************************************/ + +/***************************************************************************** + * Original Author: Adrien MATTA contact address: matta@ipno.in2p3.fr * + * * + * Creation Date : April 2012 * + * Last update : * + *---------------------------------------------------------------------------* + * Decription: * + * This singleton class contain all the particle to be shooted at the end of * + * the event generation. * + * * + *---------------------------------------------------------------------------* + * Comment: * + * * + *****************************************************************************/ + + +#include"ParticleStack.hh" + +// G4 headers +#include "G4ParticleTable.hh" + + +ParticleStack* ParticleStack::instance = 0 ; + +ParticleStack* ParticleStack::getInstance() +{ + if (instance == 0) instance = new ParticleStack(); + return instance ; +} + +ParticleStack::ParticleStack(){ + + m_particleGun = new G4ParticleGun(1); + G4ParticleDefinition* particle + = G4ParticleTable::GetParticleTable()->FindParticle("proton"); + m_particleGun->SetParticleDefinition(particle); + m_particleGun->SetParticleEnergy(10*MeV); + + m_particleGun->SetParticlePosition(G4ThreeVector(0., 0., 0.)); + m_particleGun->SetParticleMomentumDirection(G4ThreeVector(0., 0., 1.)); +} + +ParticleStack::~ParticleStack(){ + +} + +vector<Particle> ParticleStack::GetParticleStack(){ + return m_ParticleStack; +} + +void ParticleStack::SetParticleStack(vector<Particle> particle_stack){ + m_ParticleStack = particle_stack; +} + +void ParticleStack::AddParticleToStack(Particle particle){ + m_ParticleStack.push_back(particle); +} + +Particle ParticleStack::SearchAndRemoveParticle(string name){ + + for(unsigned int i = 0 ; i < m_ParticleStack.size() ; i++){ + string ParticleName = m_ParticleStack[i].GetParticleDefinition()->GetParticleName(); + if(ParticleName.compare(0, name.length(), name) == 0) + { + Particle my_Particule = m_ParticleStack[i]; + m_ParticleStack.erase(m_ParticleStack.begin()+i); + return my_Particule; + } + } + + return Particle(); +} + +string ParticleStack::ChangeNameToG4Standard(string OriginalName){ + string NumberOfMass ; + string Nucleid; + + for (unsigned int i = 0; i < OriginalName.length(); i++) { + ostringstream character; + character << OriginalName[i]; + if (character.str()=="0") NumberOfMass+="0"; + else if (character.str()=="1") NumberOfMass+="1"; + else if (character.str()=="2") NumberOfMass+="2"; + else if (character.str()=="3") NumberOfMass+="3"; + else if (character.str()=="4") NumberOfMass+="4"; + else if (character.str()=="5") NumberOfMass+="5"; + else if (character.str()=="6") NumberOfMass+="6"; + else if (character.str()=="7") NumberOfMass+="7"; + else if (character.str()=="8") NumberOfMass+="8"; + else if (character.str()=="9") NumberOfMass+="9"; + + else if (character.str()=="A") Nucleid+="A"; + else if (character.str()=="B") Nucleid+="B"; + else if (character.str()=="C") Nucleid+="C"; + else if (character.str()=="D") Nucleid+="D"; + else if (character.str()=="E") Nucleid+="E"; + else if (character.str()=="F") Nucleid+="F"; + else if (character.str()=="G") Nucleid+="G"; + else if (character.str()=="H") Nucleid+="H"; + else if (character.str()=="I") Nucleid+="I"; + else if (character.str()=="J") Nucleid+="J"; + else if (character.str()=="K") Nucleid+="K"; + else if (character.str()=="L") Nucleid+="L"; + else if (character.str()=="M") Nucleid+="M"; + else if (character.str()=="N") Nucleid+="N"; + else if (character.str()=="O") Nucleid+="O"; + else if (character.str()=="P") Nucleid+="P"; + else if (character.str()=="Q") Nucleid+="Q"; + else if (character.str()=="R") Nucleid+="R"; + else if (character.str()=="S") Nucleid+="S"; + else if (character.str()=="T") Nucleid+="T"; + else if (character.str()=="U") Nucleid+="U"; + else if (character.str()=="V") Nucleid+="V"; + else if (character.str()=="W") Nucleid+="W"; + else if (character.str()=="X") Nucleid+="X"; + else if (character.str()=="Y") Nucleid+="Y"; + else if (character.str()=="Z") Nucleid+="Z"; + + else if (character.str()=="a") Nucleid+="a"; + else if (character.str()=="b") Nucleid+="b"; + else if (character.str()=="c") Nucleid+="c"; + else if (character.str()=="d") Nucleid+="d"; + else if (character.str()=="e") Nucleid+="e"; + else if (character.str()=="f") Nucleid+="f"; + else if (character.str()=="g") Nucleid+="g"; + else if (character.str()=="h") Nucleid+="h"; + else if (character.str()=="i") Nucleid+="i"; + else if (character.str()=="j") Nucleid+="j"; + else if (character.str()=="k") Nucleid+="k"; + else if (character.str()=="l") Nucleid+="l"; + else if (character.str()=="m") Nucleid+="m"; + else if (character.str()=="n") Nucleid+="n"; + else if (character.str()=="o") Nucleid+="o"; + else if (character.str()=="p") Nucleid+="p"; + else if (character.str()=="q") Nucleid+="q"; + else if (character.str()=="r") Nucleid+="r"; + else if (character.str()=="s") Nucleid+="s"; + else if (character.str()=="t") Nucleid+="t"; + else if (character.str()=="u") Nucleid+="u"; + else if (character.str()=="v") Nucleid+="v"; + else if (character.str()=="w") Nucleid+="w"; + else if (character.str()=="x") Nucleid+="x"; + else if (character.str()=="y") Nucleid+="y"; + else if (character.str()=="z") Nucleid+="z"; + } + + // Special case for light particles + string FinalName=Nucleid+NumberOfMass; + if (FinalName=="H1") FinalName="proton"; + else if (FinalName=="H2") FinalName="deuteron"; + else if (FinalName=="H3") FinalName="triton"; + else if (FinalName=="He4") FinalName="alpha"; + else if (FinalName=="p") FinalName="proton"; + else if (FinalName=="d") FinalName="deuteron"; + else if (FinalName=="t") FinalName="triton"; + else if (FinalName=="a") FinalName="alpha"; + else if (FinalName=="proton") FinalName="proton"; + else if (FinalName=="deuteron") FinalName="deuteron"; + else if (FinalName=="triton") FinalName="triton"; + else if (FinalName=="alpha") FinalName="alpha"; + else if (FinalName=="n") FinalName="neutron"; + else if (FinalName=="neutron") FinalName="neutron"; + return(FinalName); +} + +void ParticleStack::ShootAllParticle(G4Event* anEvent){ + for(unsigned int i = 0 ; i < m_ParticleStack.size() ; i++){ + + if(m_ParticleStack[i].GetShootStatus()){ + m_particleGun->SetParticleDefinition(m_ParticleStack[i].GetParticleDefinition()); + m_particleGun->SetParticleEnergy(m_ParticleStack[i].GetParticleKineticEnergy()); + m_particleGun->SetParticleMomentumDirection(m_ParticleStack[i].GetParticleMomentumDirection()); + m_particleGun->SetParticlePosition(m_ParticleStack[i].GetParticlePosition()); + m_particleGun->GeneratePrimaryVertex(anEvent); + } + } + m_ParticleStack.clear(); +} \ No newline at end of file diff --git a/NPSimulation/src/W1Scorers.cc b/NPSimulation/src/W1Scorers.cc index c6b38ee9ed238a66c9dfcc97b1d639221b294e27..6dffec56882a055351e2f0ab0d4abc00baeff266 100644 GIT binary patch literal 6320 zcmeHK+in{-5PjEI4BP@;IkqmYU%GLODzYpGa4gr7lk_Q|b}5O?YPscd?Ycqw?L9-T zE|%;#7r6+~@I?|iJagg9nNfXvldD48)YjRJQR9iFpk1ZCM&p;=y+*S^M0TQb8mUAQ zJ~Lq~=@B+1ot+P~PUzg|KV)Pf>DM;HZEiWZV{M$uL`5>qRXQds%`~T6O8OCY^m?cD zQ$CAi-JA8c{JCn#3S92IiF9g>8WvWYyD{6#0?UvLx5-tnRO*|=bME%=uqqV^wF*1Y zCZw|(#gh8c$SalLVTl7E@P;Cejm+~9$GJQGRb{EJsdO*<xi&K7;FkUWy6+CIZKSYD zr*tGNObMyES8p`y&E{ugJGfJUH!ZT*fic_{FNWLQ+;Y|($;haT-3@8Lg%u?t&uOBQ zI46-LF3a;s8;MLzrHo}v!yC8zx=DJts5A%n#lEdwd<<vXdODS<{fZ};nfVCL&Y(B& z$<}RhF$vVEyH67-VkAQ42bD%ifs)<o?q8<L<^wTIWNk9pa*`zx-ytniX++ZZ`Q+pm zP_LWI`%5}rH=ShRcs3PNnP(!B1o_`CTNj<DmC7AQ?cPP_qK~tBy@sW=?)4hI9zOXe zuP@ws3_xndWnr~qqhv}iTZ2I><fsoOItMknh*5#B10$k$FOEp$G!+@CG?stWeC=L~ z8`7yn5sQ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