diff --git a/NPAnalysis/10He_Riken/Analysis b/NPAnalysis/10He_Riken/Analysis index 26e6e27779acdfb7f4c0a90264d8b8cda462c3a6..cf79ecf074b7abdf28d3a2bb5b17cac87ad2e359 100755 Binary files a/NPAnalysis/10He_Riken/Analysis and b/NPAnalysis/10He_Riken/Analysis differ diff --git a/NPAnalysis/10He_Riken/include/ObjectManager.hh b/NPAnalysis/10He_Riken/include/ObjectManager.hh index d8120bdb7d1422eb74467f6b384e056bc987cf98..3e2c4435f74626023ca02557ed06719e8ef50154 100644 --- a/NPAnalysis/10He_Riken/include/ObjectManager.hh +++ b/NPAnalysis/10He_Riken/include/ObjectManager.hh @@ -106,22 +106,22 @@ namespace ENERGYLOSS // Declare your Energy loss here : EnergyLoss He3TargetWind = EnergyLoss ( "3He_Mylar.txt" , - 100000 , + 1000 , 1 , 3 ); EnergyLoss He3TargetGaz = EnergyLoss ( "3He_D2gaz_1b_26K.txt" , - 100000 , + 1000 , 1 , 3 ); EnergyLoss He3StripAl = EnergyLoss ( "3He_Al.txt" , - 1000 , + 10 , 1 , 3 ); EnergyLoss He3StripSi = EnergyLoss ( "3He_Si.txt" , - 1000 , + 10 , 1 , 3 ); @@ -129,6 +129,18 @@ namespace ENERGYLOSS using namespace ENERGYLOSS ; // ---------------------------------------------------------------------------------------------- -///////////////////////////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////////////////////////////////// +// -----------------------------------Random Engine---------------------------------------------- +#include "TRandom3.h" +namespace RANDOMENGINE + { + + TRandom3 RandomEngine = TRandom3(); + + } + +using namespace RANDOMENGINE ; +// ---------------------------------------------------------------------------------------------- +///////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/NPAnalysis/10He_Riken/src/Analysis.cc b/NPAnalysis/10He_Riken/src/Analysis.cc index f1003bc7c1b0f398376d9ef52dead1ff739faafa..d7562d0db53c984e14fb06de472a16e247b86cec 100644 --- a/NPAnalysis/10He_Riken/src/Analysis.cc +++ b/NPAnalysis/10He_Riken/src/Analysis.cc @@ -38,7 +38,6 @@ int main(int argc,char** argv) RootOutput::getInstance()->GetTree()->Branch("A",&TT,"TT/D") ; RootOutput::getInstance()->GetTree()->Branch("X",&X,"X/D") ; RootOutput::getInstance()->GetTree()->Branch("Y",&Y,"Y/D") ; - RootOutput::getInstance()->GetTree()->Branch("Y",&Y,"Y/D") ; RootOutput::getInstance()->GetTree()->Branch("ThinSi_E",&ThinSi,"ThinSi/D") ; RootOutput::getInstance()->GetTree()->Branch("ThetaCM",&ThetaCM,"ThetaCM/D") ; RootOutput::getInstance()->GetTree()->Branch("ResolThetaCM",&ResolThetaCM,"ResolThetaCM/D") ; @@ -55,8 +54,7 @@ int main(int argc,char** argv) Chain->SetBranchAddress("InitialConditions" ,&Init ); - double TargetX=0 ; double TargetY=0; double BeamTheta = 0 ; double BeamPhi = 0 ; -double TrueE=0 ; double TrueTheta=0 ; + double XTarget=0 ; double YTarget=0; double BeamTheta = 0 ; double BeamPhi = 0 ; double E=-1000; // Get Must2 Pointer: MUST2Array* M2 = (MUST2Array*) myDetector -> m_Detector["MUST2"] ; @@ -69,15 +67,25 @@ double TrueE=0 ; double TrueTheta=0 ; myDetector -> ClearEventPhysics() ; myDetector -> BuildPhysicalEvent() ; - double E = M2 -> GetEnergyDeposit(); - TVector3 HitDirection = M2 -> GetPositionOfInteraction() - TVector3(Init->GetICPositionX(0),Init->GetICPositionY(0),0); + E = M2 -> GetEnergyDeposit(); + + XTarget = RandomEngine.Gaus(Init->GetICPositionX(0),1); + YTarget = RandomEngine.Gaus(Init->GetICPositionY(0),1); + + TVector3 HitDirection = M2 -> GetPositionOfInteraction() - TVector3(XTarget,YTarget,0); - BeamTheta = Init->GetICIncidentAngleTheta(0)*deg ; BeamPhi = Init->GetICIncidentAnglePhi(0)*deg ; + BeamTheta = RandomEngine.Gaus( Init->GetICIncidentAngleTheta(0)*deg , 2*deg ) ; + BeamPhi = RandomEngine.Gaus( Init->GetICIncidentAnglePhi(0)*deg , 2*deg ) ; + +// BeamTheta = Init->GetICIncidentAngleTheta(0)*deg ; BeamPhi = Init->GetICIncidentAnglePhi(0)*deg ; TVector3 BeamDirection = TVector3(cos(BeamPhi)*sin(BeamTheta) , sin(BeamPhi)*sin(BeamTheta) , cos(BeamTheta)) ; + // Angle between beam and particle double Theta = ThetaCalculation ( HitDirection , BeamDirection ) ; + // Angle between particule and z axis (target Normal) double ThetaN = ThetaCalculation ( HitDirection , TVector3(0,0,1) ) ; - double ThetaMM2Surface = ThetaCalculation ( HitDirection , M2 -> GetPositionOfInteraction() ); + // ANgle between particule and Must2 Si surface + double ThetaMM2Surface = ThetaCalculation ( HitDirection , M2 -> GetTelescopeNormal() ); if(E>-1000 && ThinSi>0 ) { @@ -89,7 +97,7 @@ double TrueE=0 ; double TrueTheta=0 ; 20*micrometer , // Target Thickness at 0 degree ThetaMM2Surface ); - //E = E + ThinSi ; +// E = E + ThinSi ; E= He3StripAl.EvaluateInitialEnergy( E , // Energy of the detected particle 0.4*micrometer , // Target Thickness at 0 degree diff --git a/NPLib/MUST2/Must2Array.cxx b/NPLib/MUST2/Must2Array.cxx index 8041b3ae25d1a641577b3752687fe79941fbe360..ff4a1f8a3e6e9759c95f0cd2d15417922471f467 100644 --- a/NPLib/MUST2/Must2Array.cxx +++ b/NPLib/MUST2/Must2Array.cxx @@ -563,6 +563,36 @@ TVector3 MUST2Array::GetPositionOfInteraction() } +TVector3 MUST2Array::GetTelescopeNormal() + { + TVector3 Normal = TVector3(-1000,-1000,-1000); + + if(EventPhysics->TelescopeNumber.size()==1) + { + TVector3 U = TVector3 ( GetStripPositionX( EventPhysics->TelescopeNumber[0] , 128 , 1 ) , + GetStripPositionY( EventPhysics->TelescopeNumber[0] , 128 , 1 ) , + GetStripPositionZ( EventPhysics->TelescopeNumber[0] , 128 , 1 ) ) + + - TVector3 ( GetStripPositionX( EventPhysics->TelescopeNumber[0] , 1 , 1 ) , + GetStripPositionY( EventPhysics->TelescopeNumber[0] , 1 , 1 ) , + GetStripPositionZ( EventPhysics->TelescopeNumber[0] , 1 , 1 ) ); + + TVector3 V = TVector3 ( GetStripPositionX( EventPhysics->TelescopeNumber[0] , 128 , 128 ) , + GetStripPositionY( EventPhysics->TelescopeNumber[0] , 128 , 128 ) , + GetStripPositionZ( EventPhysics->TelescopeNumber[0] , 128 , 128 ) ) + + - TVector3 ( GetStripPositionX( EventPhysics->TelescopeNumber[0] , 128 , 1 ) , + GetStripPositionY( EventPhysics->TelescopeNumber[0] , 128 , 1 ) , + GetStripPositionZ( EventPhysics->TelescopeNumber[0] , 128 , 1 ) ); + + Normal = U.Cross(V); + } + + return(Normal.Unit()) ; + + } + + void MUST2Array::Print() { cout << "Number of telescope : " << NumberOfTelescope << endl ; diff --git a/NPLib/MUST2/Must2Array.h b/NPLib/MUST2/Must2Array.h index 538fb699cf4f49108db6768ea07843ca27bf6717..4f6349f2631f75b9ba175936de04b6edf4204cd9 100644 --- a/NPLib/MUST2/Must2Array.h +++ b/NPLib/MUST2/Must2Array.h @@ -74,7 +74,7 @@ class MUST2Array : public NPA::VDetector double GetEnergyDeposit() ; TVector3 GetPositionOfInteraction(); - + TVector3 GetTelescopeNormal() ; void Print() ; private: // Root Input and Output tree classes