diff --git a/Inputs/EventGenerator/alpha.source b/Inputs/EventGenerator/alpha.source index b482984f1198ad3b5705566b25d7262f4a9fbcf5..2a3bed47ae6da61402d0683aeeaf2b5b015c6c34 100644 --- a/Inputs/EventGenerator/alpha.source +++ b/Inputs/EventGenerator/alpha.source @@ -4,12 +4,12 @@ % Energy are given in MeV , Position in mm % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Isotropic - EnergyLow= 10 - EnergyHigh= 10 + EnergyLow= 5.2 + EnergyHigh= 5.2 HalfOpenAngleMin= 0 - HalfOpenAngleMax= 45 + HalfOpenAngleMax= 20 x0= 0 - y0= 0 + y0= -12 z0= 0 Particle= alpha ExcitationEnergy= 0 diff --git a/NPLib/CsI/TCsIData.cxx b/NPLib/CsI/TCsIData.cxx index 27dcef3aa843523d0485c913c7556e09b07a8f84..841889205666657ed650fec3df218c08e1095b23 100644 --- a/NPLib/CsI/TCsIData.cxx +++ b/NPLib/CsI/TCsIData.cxx @@ -38,18 +38,19 @@ TCsIData::~TCsIData() void TCsIData::Clear() { - // Energy - fCsI_E_Number.clear(); - fCsI_E_Energy.clear(); - // Time - fCsI_T_Number.clear(); - fCsI_T_Time.clear(); - - // PhotoDiode - fPhotoDiode_E_Energy.clear(); - fPhotoDiode_E_Number.clear(); - fPhotoDiode_T_Time.clear(); - fPhotoDiode_T_Number.clear(); + // Energy + fCsI_E_Number.clear(); + fCsI_E_Energy.clear(); + // Time + fCsI_T_Number.clear(); + fCsI_T_Time.clear(); + + // PhotoDiode + fPhotoDiode_E_Energy.clear(); + fPhotoDiode_E_Number.clear(); + fPhotoDiode_T_Time.clear(); + fPhotoDiode_T_Number.clear(); + fPhotoDiode_E_NumberOfPhoton.clear(); } diff --git a/NPLib/CsI/TCsIData.h b/NPLib/CsI/TCsIData.h index caf462896b0fce332e5aeb1d554b64578fcd92d2..f3fc92afb6b245dc138305e0da1526a771095335 100644 --- a/NPLib/CsI/TCsIData.h +++ b/NPLib/CsI/TCsIData.h @@ -33,6 +33,7 @@ class TCsIData : public TObject { vector<double> fCsI_E_Energy; vector<double> fPhotoDiode_E_Energy; vector<short> fPhotoDiode_E_Number; + vector<short> fPhotoDiode_E_NumberOfPhoton; // Time vector<short> fCsI_T_Number; vector<double> fCsI_T_Time; @@ -63,6 +64,7 @@ class TCsIData : public TObject { void SetCsIEEnergy(double E) {fCsI_E_Energy.push_back(E);} void SetPhotoDiodeEnergy(double E) {fPhotoDiode_E_Energy.push_back(E);} void SetPhotoDiodeEDetectorNbr(int N) {fPhotoDiode_E_Number.push_back(N);} + void SetNumberOfOpticalPhoton(int N) {fPhotoDiode_E_NumberOfPhoton.push_back(N);} // time void SetTNumber(int N) {fCsI_T_Number.push_back(N);} void SetTTime(double T) {fCsI_T_Time.push_back(T);} diff --git a/NPSimulation/Core/CMakeLists.txt b/NPSimulation/Core/CMakeLists.txt index 376f06e99933eddf6f0826c243c20469ca9d3993..7993915c9fd1ddb47ec770162778b5518fc159f9 100644 --- a/NPSimulation/Core/CMakeLists.txt +++ b/NPSimulation/Core/CMakeLists.txt @@ -1,2 +1,2 @@ -add_library(NPSCore SHARED CalorimeterScorers.cc EventAction.cc EventGeneratorParticleDecay.cc ObsoleteGeneralScorers.cc PrimaryGeneratorAction.cc Target.cc Chamber.cc EventGeneratorBeam.cc EventGeneratorTwoBodyReaction.cc Particle.cc PrimaryGeneratorActionMessenger.cc NPSVDetector.cc DetectorConstruction.cc EventGeneratorGammaDecay.cc MaterialManager.cc ParticleStack.cc SiliconScorers.cc VEventGenerator.cc DetectorMessenger.cc EventGeneratorIsotropic.cc MyMagneticField.cc PhysicsList.cc SteppingVerbose.cc NPSDetectorFactory.cc RunAction.cc) +add_library(NPSCore SHARED CalorimeterScorers.cc EventAction.cc EventGeneratorParticleDecay.cc ObsoleteGeneralScorers.cc PrimaryGeneratorAction.cc Target.cc Chamber.cc EventGeneratorBeam.cc EventGeneratorTwoBodyReaction.cc Particle.cc PrimaryGeneratorActionMessenger.cc NPSVDetector.cc DetectorConstruction.cc EventGeneratorGammaDecay.cc MaterialManager.cc ParticleStack.cc SiliconScorers.cc PhotoDiodeScorers.cc VEventGenerator.cc DetectorMessenger.cc EventGeneratorIsotropic.cc MyMagneticField.cc PhysicsList.cc SteppingVerbose.cc NPSDetectorFactory.cc RunAction.cc) target_link_libraries(NPSCore ${ROOT_LIBRARIES} ${Geant4_LIBRARIES} ${NPLib_LIBRARIES}) diff --git a/NPSimulation/Core/PhotoDiodeScorers.cc b/NPSimulation/Core/PhotoDiodeScorers.cc new file mode 100644 index 0000000000000000000000000000000000000000..42267002fad624c62d9ef91216c1a06ccf5f2870 --- /dev/null +++ b/NPSimulation/Core/PhotoDiodeScorers.cc @@ -0,0 +1,137 @@ + /***************************************************************************** + * Copyright (C) 2009-2013 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: morfouac@nscl.msu.edu * + * * + * Creation Date : Dec 2015 * + * Last update : * + *---------------------------------------------------------------------------* + * Decription: * + * Photodiode scorer for optical photon * + * * + *---------------------------------------------------------------------------* + * Comment: * + * This new type of scorer to count optical photon in the photodiode * + * * + *****************************************************************************/ +#include "PhotoDiodeScorers.hh" +#include "G4UnitsTable.hh" +using namespace PHOTODIODESCORERS ; + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... +PS_PhotoDiode_Rectangle::PS_PhotoDiode_Rectangle(G4String name,G4int Level, G4double StripPlaneLength, G4double StripPlaneWidth, G4int NumberOfStripLength,G4int NumberOfStripWidth,G4int depth) +:G4VPrimitiveScorer(name, depth),HCID(-1){ + m_StripPlaneLength = StripPlaneLength; + m_StripPlaneWidth = StripPlaneWidth; + m_NumberOfStripLength = NumberOfStripLength; + m_NumberOfStripWidth = NumberOfStripWidth; + m_StripPitchLength = m_StripPlaneLength / m_NumberOfStripLength; + m_StripPitchWidth = m_StripPlaneWidth / m_NumberOfStripWidth; + m_Level = Level; + + m_Position = G4ThreeVector(-1000,-1000,-1000); + m_DetectorNumber = -1; + m_StripLengthNumber = -1; + m_StripWidthNumber = -1; + m_Index = -1 ; + m_NumberOfOpticalPhoton = 0; +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... +PS_PhotoDiode_Rectangle::~PS_PhotoDiode_Rectangle(){ +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... +G4bool PS_PhotoDiode_Rectangle::ProcessHits(G4Step* aStep, G4TouchableHistory*){ + + // contain Energy Time, DetNbr, StripFront and StripBack + G4double* Infos = new G4double[9]; + Infos[0] = aStep->GetTotalEnergyDeposit(); + Infos[1] = aStep->GetPreStepPoint()->GetGlobalTime(); + + m_DetectorNumber = aStep->GetPreStepPoint()->GetTouchableHandle()->GetCopyNumber(m_Level); + m_Position = aStep->GetPreStepPoint()->GetPosition(); + + // Interaction coordinates (used to fill the InteractionCoordinates branch) + Infos[2] = m_Position.x(); + Infos[3] = m_Position.y(); + Infos[4] = m_Position.z(); + Infos[5] = m_Position.theta(); + Infos[6] = m_Position.phi(); + + //m_Position = aStep->GetPreStepPoint()->GetTouchableHandle()->GetHistory()->GetTopTransform().TransformPoint(m_Position); + + //m_StripLengthNumber = (int)((m_Position.x() + m_StripPlaneLength / 2.) / m_StripPitchLength ) + 1 ; + //m_StripWidthNumber = (int)((m_Position.y() + m_StripPlaneWidth / 2.) / m_StripPitchWidth ) + 1 ; + + //Rare case where particle is close to edge of silicon plan + //if (m_StripLengthNumber > m_NumberOfStripLength) m_StripLengthNumber = m_NumberOfStripLength; + //if (m_StripWidthNumber > m_NumberOfStripWidth) m_StripWidthNumber = m_NumberOfStripWidth; + + Infos[7] = m_DetectorNumber; + //Infos[8] = m_StripLengthNumber; + //Infos[9] = m_StripWidthNumber; + + m_Index = aStep->GetTrack()->GetTrackID() + m_DetectorNumber * 1e3 + m_StripLengthNumber * 1e6 + m_StripWidthNumber * 1e9; + + G4String PID = aStep->GetTrack()->GetDefinition()->GetParticleName(); + + if(PID=="opticalphoton"){ + m_NumberOfOpticalPhoton = 1; + Infos[8] = m_NumberOfOpticalPhoton; + } + + // Check if the particle has interact before, if yes, add up the energies. + map<G4int, G4double**>::iterator it; + it= EvtMap->GetMap()->find(m_Index); + if(it!=EvtMap->GetMap()->end()){ + G4double* dummy = *(it->second); + Infos[0]+=dummy[0]; + } + + EvtMap->set(m_Index, Infos); + return TRUE; +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... +void PS_PhotoDiode_Rectangle::Initialize(G4HCofThisEvent* HCE){ + EvtMap = new G4THitsMap<G4double*>(GetMultiFunctionalDetector()->GetName(), GetName()); + if (HCID < 0) { + HCID = GetCollectionID(0); + } + HCE->AddHitsCollection(HCID, (G4VHitsCollection*)EvtMap); +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... +void PS_PhotoDiode_Rectangle::EndOfEvent(G4HCofThisEvent*){ +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... +void PS_PhotoDiode_Rectangle::clear(){ + std::map<G4int, G4double**>::iterator MapIterator; + for (MapIterator = EvtMap->GetMap()->begin() ; MapIterator != EvtMap->GetMap()->end() ; MapIterator++){ + delete *(MapIterator->second); + } + + EvtMap->clear(); +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... +void PS_PhotoDiode_Rectangle::DrawAll(){ + +} + +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... +void PS_PhotoDiode_Rectangle::PrintAll(){ + G4cout << " MultiFunctionalDet " << detector->GetName() << G4endl ; + G4cout << " PrimitiveScorer " << GetName() << G4endl ; + G4cout << " Number of entries " << EvtMap->entries() << G4endl ; +} +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + + diff --git a/NPSimulation/Core/PhotoDiodeScorers.hh b/NPSimulation/Core/PhotoDiodeScorers.hh new file mode 100644 index 0000000000000000000000000000000000000000..2cfbdf22ee16237c80129b2927d1e413eadb750c --- /dev/null +++ b/NPSimulation/Core/PhotoDiodeScorers.hh @@ -0,0 +1,80 @@ +#ifndef PhotoDiodeScorers_h +#define SiliconScorers_h 1 +/***************************************************************************** + * Copyright (C) 2009-2013 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 : February 2013 * + * Last update : * + *---------------------------------------------------------------------------* + * Decription: * + * File old the scorer specific to the Silicon Detector * + * * + *---------------------------------------------------------------------------* + * Comment: * + * This new style of scorer is aim to become the standard way of doing scorer* + * in NPTool. * + *The index is build using the TrackID, Detector Number and Strip Number. * + *The scorer Hold Energy and time together * + *Only one scorer is needed for a detector * + *****************************************************************************/ +#include "G4VPrimitiveScorer.hh" +#include "G4THitsMap.hh" + +#include <map> +using namespace std; +using namespace CLHEP; + +namespace PHOTODIODESCORERS { +//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... + class PS_PhotoDiode_Rectangle : public G4VPrimitiveScorer{ + + public: // with description + PS_PhotoDiode_Rectangle(G4String name, G4int Level, G4double StripPlaneLength, G4double StripPlaneWidth, G4int NumberOfStripLength,G4int NumberOfStripWidth,G4int depth=0); + ~PS_PhotoDiode_Rectangle(); + + protected: // with description + G4bool ProcessHits(G4Step*, G4TouchableHistory*); + + public: + void Initialize(G4HCofThisEvent*); + void EndOfEvent(G4HCofThisEvent*); + void clear(); + void DrawAll(); + void PrintAll(); + + private: // Geometry of the detector + G4double m_StripPlaneLength; + G4double m_StripPlaneWidth; + G4int m_NumberOfStripLength; + G4int m_NumberOfStripWidth; + G4double m_StripPitchLength; + G4double m_StripPitchWidth; + // Level at which to find the copy number linked to the detector number + G4int m_Level; + + + private: // inherited from G4VPrimitiveScorer + G4int HCID; + G4THitsMap<G4double*>* EvtMap; + + private: // Needed for intermediate calculation (avoid multiple instantiation in Processing Hit) + G4ThreeVector m_Position ; + G4int m_DetectorNumber ; + G4int m_StripLengthNumber ; + G4int m_StripWidthNumber ; + G4int m_Index ; + G4double m_NumberOfOpticalPhoton; + + }; + + +} + +#endif diff --git a/NPSimulation/Core/PhysicsList.cc b/NPSimulation/Core/PhysicsList.cc index 7678b309218cff73bacf93613c381093fbc82ec0..091694f34fb0c06b46dbc62184df55ec22702e21 100644 --- a/NPSimulation/Core/PhysicsList.cc +++ b/NPSimulation/Core/PhysicsList.cc @@ -73,12 +73,13 @@ PhysicsList::PhysicsList() : G4VModularPhysicsList(){ // Optical Photon for scintillator simulation if(m_OpticalPhysics){ - opticalPhysicsList = new G4OpticalPhysics(0); - opticalPhysicsList->SetMaxNumPhotonsPerStep(100); - opticalPhysicsList->SetScintillationYieldFactor(0.01); - opticalPhysicsList->SetTrackSecondariesFirst(kScintillation,true); - opticalPhysicsList->SetTrackSecondariesFirst(kCerenkov,true); - //RegisterPhysics(opticalPhysicsList); + opticalPhysicsList = new G4OpticalPhysics(0); + opticalPhysicsList->SetMaxNumPhotonsPerStep(100); + //opticalPhysicsList->SetScintillationYieldFactor(0.01); + opticalPhysicsList->SetScintillationYieldFactor(0.1); + opticalPhysicsList->SetTrackSecondariesFirst(kScintillation,true); + opticalPhysicsList->SetTrackSecondariesFirst(kCerenkov,true); + //RegisterPhysics(opticalPhysicsList); } diff --git a/NPSimulation/CsI/CsI.cc b/NPSimulation/CsI/CsI.cc index 45537564cc18580d1087953c8cf8dc76fd13e73f..ad805f9391c7a10c4c0d28d9a7b3a8ad5e4fd1f7 100644 --- a/NPSimulation/CsI/CsI.cc +++ b/NPSimulation/CsI/CsI.cc @@ -1,4 +1,4 @@ -/***************************************************************************** + /***************************************************************************** * Copyright (C) 2009-2013 this file is part of the NPTool Project * * * * For the licensing terms see $NPTOOL/Licence/NPTool_Licence * @@ -41,12 +41,14 @@ #include "G4VisAttributes.hh" #include "G4Colour.hh" + // NPTool header #include "CsI.hh" #include "ObsoleteGeneralScorers.hh" #include "RootOutput.h" #include "MaterialManager.hh" #include "SiliconScorers.hh" +#include "PhotoDiodeScorers.hh" #include "CalorimeterScorers.hh" #include "NPSDetectorFactory.hh" //using namespace OBSOLETEGENERALSCORERS ; @@ -62,9 +64,9 @@ using namespace CLHEP; //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... // CsI Specific Method CsI::CsI(){ - m_Event = new TCsIData() ; - m_CsIScorer = 0; - ResoCsI = 2.4;//% + m_Event = new TCsIData() ; + m_CsIScorer = 0; + ResoCsI = 2.5/2.35;// 2.5% FWHM PhotoDiodeFace = 18.;//mm PhotoDiodeThickness = 3.;//mm @@ -389,7 +391,22 @@ void CsI::VolumeMaker(G4ThreeVector Det_pos, int DetNumber, G4LogicalVolume* wor int i = DetNumber-1; - G4Material* CsIMaterial = MaterialManager::getInstance()->GetMaterialFromLibrary(m_Scintillator[i]) ; + G4Material* CsIMaterial = MaterialManager::getInstance()->GetMaterialFromLibrary(m_Scintillator[i]) ; + G4Material* Vacuum = MaterialManager::getInstance()->GetMaterialFromLibrary("Vacuum") ; + + //Create experimental hall + G4double expHall_x = 1.*m; + G4double expHall_y = 1.*m; + G4double expHall_z = 1.*m; + + G4Box* fExperimentalHall_box = new G4Box("expHall_box",expHall_x,expHall_y,expHall_z); + G4LogicalVolume* fExperimentalHall_log = new G4LogicalVolume(fExperimentalHall_box, + Vacuum,"expHall_log",0,0,0); + G4VPhysicalVolume* fExperimentalHall_phys = new G4PVPlacement(0,G4ThreeVector(), + fExperimentalHall_log,"expHall",0,false,0); + + fExperimentalHall_log->SetVisAttributes(G4VisAttributes::Invisible); + // Definition of the volume containing the sensitive detector @@ -411,13 +428,33 @@ void CsI::VolumeMaker(G4ThreeVector Det_pos, int DetNumber, G4LogicalVolume* wor G4VisAttributes* CsIVisAtt = new G4VisAttributes(G4Colour(1.0, 0.5, 0.0,0.25)) ; logicCsI->SetVisAttributes(CsIVisAtt) ; - new G4PVPlacement(0 , - Det_pos , - logicCsI , - Name + "_Scintillator" , - world , - false , - 0 ); + G4VPhysicalVolume* physCsI = new G4PVPlacement(0 , + Det_pos , + logicCsI , + Name + "_Scintillator" , + world , + false , + 0 ); + + G4OpticalSurface* OpticalCrysralSurface = new G4OpticalSurface("CrystalSurface"); + OpticalCrysralSurface->SetType(dielectric_metal); + OpticalCrysralSurface->SetFinish(polished); + OpticalCrysralSurface->SetModel(glisur); + + G4double pp[] = {2.0*eV, 3.5*eV}; + const G4int num = sizeof(pp)/sizeof(G4double); + G4double reflectivity[] = {1., 1.}; + assert(sizeof(reflectivity) == sizeof(pp)); + G4double efficiency[] = {0.0, 0.0}; + assert(sizeof(efficiency) == sizeof(pp)); + + new G4LogicalBorderSurface("CrystalSurface", physCsI, fExperimentalHall_phys, OpticalCrysralSurface); + + G4MaterialPropertiesTable* OpticalCrysralSurfaceProperty = new G4MaterialPropertiesTable(); + + OpticalCrysralSurfaceProperty->AddProperty("REFLECTIVITY",pp,reflectivity,num); + OpticalCrysralSurfaceProperty->AddProperty("EFFICIENCY",pp,efficiency,num); + OpticalCrysralSurface->SetMaterialPropertiesTable(OpticalCrysralSurfaceProperty); // Photodiode G4String NamePD = Name+"PhotoDiode"; @@ -547,6 +584,8 @@ void CsI::ReadSensitive(const G4Event* event){ PhotoDiodeHitMap = (G4THitsMap<G4double*>*)(event->GetHCofThisEvent()->GetHC(PhotoDiodeCollectionID)); // Loop on the PhotoDiode map + vector<double> NumberOfOpticalPhoton; + NumberOfOpticalPhoton.clear(); for (PhotoDiode_itr = PhotoDiodeHitMap->GetMap()->begin() ; PhotoDiode_itr != PhotoDiodeHitMap->GetMap()->end() ; PhotoDiode_itr++){ G4double* Info = *(PhotoDiode_itr->second); double E_PhotoDiode = RandGauss::shoot(Info[0],Info[0]*ResoCsI/100); @@ -556,107 +595,14 @@ void CsI::ReadSensitive(const G4Event* event){ m_Event->SetPhotoDiodeTime(Info[1]); m_Event->SetPhotoDiodeTDetectorNbr(Info[7]); + NumberOfOpticalPhoton.push_back(Info[8]); + //cout << "CsI class Info[8] = " << Info[8] << endl;; + //m_Event->SetNumberOfOpticalPhoton(Info[8]); } + //cout << "CsI class total optical photon = " << NumberOfOpticalPhoton.size() << endl; + m_Event->SetNumberOfOpticalPhoton(NumberOfOpticalPhoton.size()); PhotoDiodeHitMap->clear(); - /* - ////////////////////////////////////////////////////////////////////////////////////// - //////////////////////// Used to Read Event Map of detector ////////////////////////// - ////////////////////////////////////////////////////////////////////////////////////// - - std::map<G4int, G4int*>::iterator DetectorNumber_itr; - std::map<G4int, G4double*>::iterator Energy_itr; - std::map<G4int, G4double*>::iterator Time_itr; - std::map<G4int, G4double*>::iterator Pos_Z_itr; - - G4THitsMap<G4int>* DetectorNumberHitMap; - G4THitsMap<G4double>* EnergyHitMap; - G4THitsMap<G4double>* TimeHitMap; - G4THitsMap<G4double>* PosZHitMap; - - ////////////////////////////////////////////////////////////////////////////////////// - ////////////////////////////////////////////////////////////////////////////////////// - - // Read the Scorer associate to the Silicon Strip - - //Detector Number - G4int StripDetCollectionID = G4SDManager::GetSDMpointer()->GetCollectionID("CsIScorer/CsINumber") ; - DetectorNumberHitMap = (G4THitsMap<G4int>*)(event->GetHCofThisEvent()->GetHC(StripDetCollectionID)) ; - DetectorNumber_itr = DetectorNumberHitMap->GetMap()->begin() ; - - //Energy - G4int StripEnergyCollectionID = G4SDManager::GetSDMpointer()->GetCollectionID("CsIScorer/Energy") ; - EnergyHitMap = (G4THitsMap<G4double>*)(event->GetHCofThisEvent()->GetHC(StripEnergyCollectionID)) ; - Energy_itr = EnergyHitMap->GetMap()->begin() ; - - //Time of Flight - G4int StripTimeCollectionID = G4SDManager::GetSDMpointer()->GetCollectionID("CsIScorer/Time") ; - TimeHitMap = (G4THitsMap<G4double>*)(event->GetHCofThisEvent()->GetHC(StripTimeCollectionID)) ; - Time_itr = TimeHitMap->GetMap()->begin() ; - - //Interaction Coordinate Z - G4int InterCoordZCollectionID = G4SDManager::GetSDMpointer()->GetCollectionID("CsIScorer/InterCoordZ"); - PosZHitMap = (G4THitsMap<G4double>*)(event->GetHCofThisEvent()->GetHC(InterCoordZCollectionID)); - Pos_Z_itr = PosZHitMap->GetMap()->begin(); - - G4int sizeN = DetectorNumberHitMap->entries() ; - G4int sizeE = EnergyHitMap->entries() ; - G4int sizeT = TimeHitMap->entries() ; - - // Loop on CsI Number - for (G4int l = 0 ; l < sizeN ; l++) { - G4int N = *(DetectorNumber_itr->second) ; - G4int NTrackID = DetectorNumber_itr->first - N ; - - - if (N > 0) { - m_Event->SetENumber(N) ; - // Energy - Energy_itr = EnergyHitMap->GetMap()->begin(); - for (G4int h = 0 ; h < sizeE ; h++) { - G4int ETrackID = Energy_itr->first - N ; - G4double E = *(Energy_itr->second) ; - if (ETrackID == NTrackID) { - m_Event->SetEEnergy(RandGauss::shoot(E, E*ResoEnergy/100./2.35)) ; - //m_Event->SetEEnergy(RandGauss::shoot(E, ResoEnergy)) ; - } - Energy_itr++; - } - - - // Time - Time_itr = TimeHitMap->GetMap()->begin(); - for (G4int h = 0 ; h < sizeT ; h++) { - G4int TTrackID = Time_itr->first - N ; - G4double T = *(Time_itr->second) ; - if (TTrackID == NTrackID) { - m_Event->SetTTime(RandGauss::shoot(T, ResoTime)) ; - } - Time_itr++; - } - - // Pos Z - Pos_Z_itr = PosZHitMap->GetMap()->begin(); - for (G4int h = 0 ; h < PosZHitMap->entries() ; h++) { - G4int PosZTrackID = Pos_Z_itr->first - N ; - G4double PosZ = *(Pos_Z_itr->second) ; - if (PosZTrackID == NTrackID) { - ms_InterCoord->SetDetectedPositionZ(PosZ) ; - } - Pos_Z_itr++; - } - } - - DetectorNumber_itr++; - } - - // clear map for next event - TimeHitMap ->clear() ; - DetectorNumberHitMap ->clear() ; - EnergyHitMap ->clear() ; - PosZHitMap ->clear() ; - */ - } @@ -674,7 +620,7 @@ void CsI::InitializeScorers() { G4VPrimitiveScorer* CsIScorer= new CALORIMETERSCORERS::PS_Calorimeter("CsI",NestingLevel); m_CsIScorer->RegisterPrimitive(CsIScorer); - G4VPrimitiveScorer* PDScorer = new SILICONSCORERS::PS_Silicon_Rectangle("PhotoDiode",0, + G4VPrimitiveScorer* PDScorer = new PHOTODIODESCORERS::PS_PhotoDiode_Rectangle("PhotoDiode",0, PhotoDiodeFace, PhotoDiodeFace, 1, diff --git a/NPSimulation/CsI/CsI.hh b/NPSimulation/CsI/CsI.hh index 13b1dbf38e91adc99f6e7f729368c220aa5b2b1d..7602a3fd26927199d8a5a50d6263477323e06be0 100644 --- a/NPSimulation/CsI/CsI.hh +++ b/NPSimulation/CsI/CsI.hh @@ -35,6 +35,9 @@ #include "G4RotationMatrix.hh" #include "G4LogicalVolume.hh" #include "G4MultiFunctionalDetector.hh" +#include "G4OpticalSurface.hh" +#include "G4LogicalBorderSurface.hh" +#include "G4LogicalSkinSurface.hh" // NPTool header #include "NPSVDetector.hh" diff --git a/NPSimulation/PhysicsListOption.txt b/NPSimulation/PhysicsListOption.txt index 6b4623ef5b8ebbb192b3f67f0c289c1fc87b3532..44cbcfc8855e1fd234521986712e992e5948dd05 100644 --- a/NPSimulation/PhysicsListOption.txt +++ b/NPSimulation/PhysicsListOption.txt @@ -2,6 +2,6 @@ IonBinaryCascadePhysics 0 EmExtraPhysics 0 HadronElasticPhysics 0 StoppingPhysics 0 -OpticalPhysics 0 +OpticalPhysics 1 HadronPhysicsQGSP_BIC_HP 0 -Decay 0 +Decay 1 diff --git a/NPSimulation/macro/vis.mac b/NPSimulation/macro/vis.mac index 347319f7cca701aa78b91e9ce5847101250fc3c6..620d7c3f728339eaef51d1669017866b26c48e0d 100644 --- a/NPSimulation/macro/vis.mac +++ b/NPSimulation/macro/vis.mac @@ -47,6 +47,8 @@ /vis/viewer/set/autoRefresh true /vis/verbose 0 +/vis/viewer/set/background white + # print Option #/vis/ogl/set/printMode vectored #/vis/ogl/set/transparency true