diff --git a/NPLib/Core/NPOptionManager.cxx b/NPLib/Core/NPOptionManager.cxx index 75c36f225a31dffd083e128943484e27224a57a8..2c22cd4853e95279521f14d8ea79497b1374a0a6 100644 --- a/NPLib/Core/NPOptionManager.cxx +++ b/NPLib/Core/NPOptionManager.cxx @@ -130,6 +130,7 @@ void NPOptionManager::ReadTheInputArgument(int argc, char** argv){ fSpectraServerPort = 9092; fRandomSeed = -1; fRecordTrack = 0; + fCutParentID = 1000; fDisableAllBranchOption = false; fInputPhysicalTreeOption = false; fGenerateHistoOption = false ; @@ -211,6 +212,8 @@ void NPOptionManager::ReadTheInputArgument(int argc, char** argv){ else if (argument == "--record-track") fRecordTrack = true ; + else if (argument == "--cut-parent-id" && argc >= i + 1) fCutParentID = atoi(argv[++i]) ; + else if (argument == "-F") fFirstEntryToAnalyse = atoi(argv[++i]); else if (argument == "--last-sim") fLastSimFile = true ; diff --git a/NPLib/Core/NPOptionManager.h b/NPLib/Core/NPOptionManager.h index dc7973fe8811299bac72019a98c9e9bcea53b78d..c830508425153d14ca67538ba67ac72f529ec6bc 100644 --- a/NPLib/Core/NPOptionManager.h +++ b/NPLib/Core/NPOptionManager.h @@ -120,6 +120,7 @@ class NPOptionManager{ int GetSpectraServerPort() {return fSpectraServerPort;} int GetRandomSeed() {return fRandomSeed;} int GetRecordTrack() {return fRecordTrack;} + int GetCutParentID() {return fCutParentID;} std::string GetSharedLibExtension() {return fSharedLibExtension;} std::string GetLastFile(); std::string GetAnalysisOutputPath(){return m_AnalysisOutputPath;}; @@ -182,6 +183,7 @@ class NPOptionManager{ int fSpectraServerPort; int fRandomSeed; int fRecordTrack; + int fCutParentID; std::string fSharedLibExtension; // lib extension is platform dependent std::string fG4MacroPath; // Path to a geant4 macro to execute at start of nps bool fG4BatchMode; // Execute geant4 in batch mode, running the given macro diff --git a/NPLib/Detectors/PISTA/TPISTAPhysics.cxx b/NPLib/Detectors/PISTA/TPISTAPhysics.cxx index 01002b4e51fc4d273ff5f0f7e149b4b0bff7246b..738830201a973de93d24a8a6079ec24d8b08c1f6 100644 --- a/NPLib/Detectors/PISTA/TPISTAPhysics.cxx +++ b/NPLib/Detectors/PISTA/TPISTAPhysics.cxx @@ -82,9 +82,9 @@ void TPISTAPhysics::AddDetector(TVector3 A, TVector3 B, TVector3 C, TVector3 D, if(version==2){ Height= 27; - LongBase= 53; - m_NumberOfStripsX= 45; - m_NumberOfStripsY= 49; + LongBase= 56; + m_NumberOfStripsX= 64; + m_NumberOfStripsY= 64; } double StripPitchY = Height/m_NumberOfStripsY; // mm double StripPitchX = LongBase/m_NumberOfStripsX; // mm @@ -159,9 +159,9 @@ void TPISTAPhysics::AddDetector(double R, double Theta, double Phi, int version) if(version==2){ Height= 27; - LongBase= 53; - m_NumberOfStripsX= 45; - m_NumberOfStripsY= 49; + LongBase= 56; + m_NumberOfStripsX= 64; + m_NumberOfStripsY= 64; } double StripPitchY = Height/m_NumberOfStripsY; // mm diff --git a/NPSimulation/Core/SteppingAction.cc b/NPSimulation/Core/SteppingAction.cc index d82804352761b4c0e2b141f5ff5c0e265e436063..a2dd14105a3cfa73635ebfcfd4b91366e045d85d 100644 --- a/NPSimulation/Core/SteppingAction.cc +++ b/NPSimulation/Core/SteppingAction.cc @@ -29,6 +29,7 @@ //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... SteppingAction::SteppingAction() { m_record_track = NPOptionManager::getInstance()->GetRecordTrack(); + m_cut_parent_id = NPOptionManager::getInstance()->GetCutParentID(); m_tree = RootOutput::getInstance()->GetTree(); m_First = true; @@ -68,6 +69,12 @@ void SteppingAction::AttachTrackInfo() { //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... void SteppingAction::UserSteppingAction(const G4Step* step) { + m_record_track = true; + G4Track* track = step->GetTrack(); + if(track->GetParentID()> m_cut_parent_id) { + m_record_track = false; + track->SetTrackStatus(fKillTrackAndSecondaries); + } if (m_record_track) { TrackRecording(step); } diff --git a/NPSimulation/Core/SteppingAction.hh b/NPSimulation/Core/SteppingAction.hh index 73ab8a18441fdd71533ccdb0de74ef68ea742c31..c7028227342f300b6c9a7402c8ef2110b5832fea 100644 --- a/NPSimulation/Core/SteppingAction.hh +++ b/NPSimulation/Core/SteppingAction.hh @@ -70,6 +70,7 @@ private: // tree private: bool m_record_track; + int m_cut_parent_id; public: // Attach the TrackInfo object to the tree diff --git a/NPSimulation/Detectors/PISTA/PISTA.cc b/NPSimulation/Detectors/PISTA/PISTA.cc index f7ebec47fb36d9d4b1be5a229764f7222313a1d4..2669db035600e142b1837dfdd71a59d58df96941 100644 --- a/NPSimulation/Detectors/PISTA/PISTA.cc +++ b/NPSimulation/Detectors/PISTA/PISTA.cc @@ -75,8 +75,8 @@ namespace PISTA_NS{ double SecondStageNbrOfStrips = 57; // Trapezoid dimension PISTA2 - //double TrapezoidBaseLarge = 53*mm; - //double TrapezoidBaseSmall = 34.0*mm; + //double TrapezoidBaseLarge = 56*mm; + //double TrapezoidBaseSmall = 36.0*mm; //double TrapezoidHeight = 27*mm; //double TrapezoidLength = 1*cm; //double FirstStageThickness = 0.3*mm; @@ -125,15 +125,15 @@ void PISTA::AddDetector(G4ThreeVector A, G4ThreeVector B, G4ThreeVector C, G4Thr SecondStageNbrOfStrips = 57; } else if(m_version==2){ - TrapezoidBaseLarge = 53*mm; - TrapezoidBaseSmall = 34.0*mm; + TrapezoidBaseLarge = 56*mm; + TrapezoidBaseSmall = 36.0*mm; TrapezoidHeight = 27*mm; TrapezoidLength = 1*cm; FirstStageThickness = 0.3*mm; SecondStageThickness = 1.5*mm; DistanceBetweenSi = 3*mm; - FirstStageNbrOfStrips = 49; - SecondStageNbrOfStrips = 45; + FirstStageNbrOfStrips = 64; + SecondStageNbrOfStrips = 64; } } @@ -151,6 +151,30 @@ void PISTA::AddDetector(double R, double Theta, double Phi){ m_B.push_back(empty); m_C.push_back(empty); m_D.push_back(empty); + + if(m_version==1){ + TrapezoidBaseLarge = 72.3*mm; + TrapezoidBaseSmall = 41.0*mm; + TrapezoidHeight = 57.7*mm; + TrapezoidLength = 1*cm; + FirstStageThickness = 300*um; + SecondStageThickness = 1.5*mm; + DistanceBetweenSi = 4*mm; + FirstStageNbrOfStrips = 91; + SecondStageNbrOfStrips = 57; + } + else if(m_version==2){ + TrapezoidBaseLarge = 56.0*mm; + TrapezoidBaseSmall = 36.0*mm; + TrapezoidHeight = 27.0*mm; + TrapezoidLength = 1*cm; + FirstStageThickness = 0.3*mm; + SecondStageThickness = 1.5*mm; + DistanceBetweenSi = 3*mm; + FirstStageNbrOfStrips = 64; + SecondStageNbrOfStrips = 64; + } + } @@ -259,6 +283,8 @@ void PISTA::ReadConfiguration(NPL::InputParser parser){ else if(blocks[i]->HasTokenList(sphe)){ if(NPOptionManager::getInstance()->GetVerboseLevel()) cout << endl << "//// PISTA " << i+1 << endl; + + m_version = blocks[i]->GetInt("VERSION"); double R = blocks[i]->GetDouble("R","mm"); double Theta = blocks[i]->GetDouble("Theta","deg"); double Phi = blocks[i]->GetDouble("Phi","deg");