From 86e6c72a5402a3ded108cccd44e53323c8019f01 Mon Sep 17 00:00:00 2001 From: adrien-matta <a.matta@surrey.ac.uk> Date: Fri, 7 Mar 2014 15:20:30 +0000 Subject: [PATCH] * Fixing Hyball --- NPLib/Tiara/TTiaraHyballPhysics.cxx | 16 +++++++++------- NPSimulation/SSSD/ThinSi.cc | 16 +++++++++++++--- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/NPLib/Tiara/TTiaraHyballPhysics.cxx b/NPLib/Tiara/TTiaraHyballPhysics.cxx index 8fd56cc60..da7ec91cd 100644 --- a/NPLib/Tiara/TTiaraHyballPhysics.cxx +++ b/NPLib/Tiara/TTiaraHyballPhysics.cxx @@ -181,6 +181,7 @@ void TTiaraHyballPhysics::PreTreat(){ m_PreTreatedData->SetSectorTTime( Sector_T ); } } + return; } @@ -212,16 +213,17 @@ vector < TVector2 > TTiaraHyballPhysics :: Match_Ring_Sector(){ for(unsigned int j = 0 ; j < sizeS ; j++){ // if same detector check energy if ( m_PreTreatedData->GetRingEDetectorNbr(i) == m_PreTreatedData->GetSectorEDetectorNbr(j) ){ - // Look if energy match - if( abs( (m_PreTreatedData->GetRingEEnergy(i)-m_PreTreatedData->GetSectorEEnergy(j))/2. ) < m_StripEnergyMatchingNumberOfSigma*m_StripEnergyMatchingSigma ) - ArrayOfGoodCouple . push_back ( TVector2(i,j) ) ; + // Look if energy match + if( abs( (m_PreTreatedData->GetRingEEnergy(i)-m_PreTreatedData->GetSectorEEnergy(j))/2. ) + < m_StripEnergyMatchingNumberOfSigma*m_StripEnergyMatchingSigma ) { + ArrayOfGoodCouple . push_back ( TVector2(i,j) ) ; + } } } } - // Prevent to treat event with ambiguous matchin beetween X and Y if( ArrayOfGoodCouple.size() > m_PreTreatedData->GetRingEMult() ) ArrayOfGoodCouple.clear() ; - + return ArrayOfGoodCouple; } @@ -700,12 +702,12 @@ namespace TiaraHyball_LOCAL{ // Sector double fStrip_Sector_E(const TTiaraHyballData* m_EventData , const int i){ - return CalibrationManager::getInstance()->ApplyCalibration( "TIARAHYBALL/D" + itoa( m_EventData->GetSectorTDetectorNbr(i) ) + "_STRIP_SECTOR" + itoa( m_EventData->GetSectorTStripNbr(i) ) +"_E", + return CalibrationManager::getInstance()->ApplyCalibration( "TIARAHYBALL/D" + itoa( m_EventData->GetSectorEDetectorNbr(i) ) + "_STRIP_SECTOR" + itoa( m_EventData->GetSectorEStripNbr(i) ) +"_E", fStrip_Sector_Matchstick(m_EventData,i) ); } double fStrip_Sector_Matchstick(const TTiaraHyballData* m_EventData , const int i){ - return CalibrationManager::getInstance()->ApplyCalibration( "TIARAHYBALL/D" + itoa( m_EventData->GetSectorTDetectorNbr(i) ) + "_STRIP_SECTOR" + itoa( m_EventData->GetSectorTStripNbr(i) ) +"_MATCHSTICK", + return CalibrationManager::getInstance()->ApplyCalibration( "TIARAHYBALL/D" + itoa( m_EventData->GetSectorEDetectorNbr(i) ) + "_STRIP_SECTOR" + itoa( m_EventData->GetSectorEStripNbr(i) ) +"_MATCHSTICK", m_EventData->GetSectorEEnergy(i) ); } diff --git a/NPSimulation/SSSD/ThinSi.cc b/NPSimulation/SSSD/ThinSi.cc index d97c587b9..ed777a5e7 100644 --- a/NPSimulation/SSSD/ThinSi.cc +++ b/NPSimulation/SSSD/ThinSi.cc @@ -131,7 +131,6 @@ void ThinSi::VolumeMaker( G4int DetNumber , Number << NbrTelescopes ; DetectorNumber = Number.str() ; - //////////////////////////////////////////////////////////////// /////////General Geometry Parameter Definition ///////////////// //////////////////////////////////////////////////////////////// @@ -445,8 +444,8 @@ void ThinSi::ReadConfiguration(string Path) // Construct detector and inialise sensitive part. // Called After DetecorConstruction::AddDetector Method -void ThinSi::ConstructDetector(G4LogicalVolume* world) -{ +void ThinSi::ConstructDetector(G4LogicalVolume* world){ + G4RotationMatrix* Det_rot = NULL; G4ThreeVector Det_pos = G4ThreeVector(0, 0, 0); G4ThreeVector Det_u = G4ThreeVector(0, 0, 0); @@ -546,6 +545,17 @@ void ThinSi::ReadSensitive(const G4Event* event) //////////////////////// Used to Read Event Map of detector ////////////////////////// ////////////////////////////////////////////////////////////////////////////////////// + + + + + + + + + + + // Si G4THitsMap<G4int>* DetNbrHitMap; G4THitsMap<G4int>* StripNbrHitMap; -- GitLab