Commit 85b0656c authored by Warren's avatar Warren
Browse files

TACTIC: electron drift time function added

parent c7abcf30
Pipeline #106392 passed with stages
in 17 minutes
......@@ -227,6 +227,10 @@ void TACTIC::ReadConfiguration(NPL::InputParser parser){
m_Temperature = blocks[i]->GetDouble("Temperature","kelvin");
m_Pressure = blocks[i]->GetDouble("Pressure","bar");
m_Active = blocks[i]->GetString("Active");
m_p0 = blocks[i]->GetDouble("p0","0");
m_p1 = blocks[i]->GetDouble("p1","0");
m_p2 = blocks[i]->GetDouble("p2","0");
m_p3 = blocks[i]->GetDouble("p3","0");
//cout << "ACTIVE: " << m_Active << endl;
AddDetector(Pos,Shape);
}
......@@ -324,10 +328,10 @@ void TACTIC::ReadSensitive(const G4Event* event ){
for (Light_itr = LightHitMap->GetMap()->begin(); Light_itr != LightHitMap->GetMap()->end(); Light_itr++) {
G4double* Info = *(Light_itr->second);
//file << event->GetEventID() << "\t";
for(int s = 0; s<12; s++) {
for(int s = 0; s<13; s++) {
file << Info[s] << "\t";
}
file << Info[12] << endl;
file << Info[13] << endl;
}
LightHitMap->clear();
......@@ -340,10 +344,10 @@ void TACTIC::ReadSensitive(const G4Event* event ){
for (Heavy_itr = HeavyHitMap->GetMap()->begin(); Heavy_itr != HeavyHitMap->GetMap()->end(); Heavy_itr++) {
G4double* Info = *(Heavy_itr->second);
//file << event->GetEventID() << "\t";
for(int s = 0; s<12; s++) {
for(int s = 0; s<13; s++) {
file << Info[s] << "\t";
}
file << Info[12] << endl;
file << Info[13] << endl;
}
HeavyHitMap->clear();
......@@ -356,10 +360,10 @@ void TACTIC::ReadSensitive(const G4Event* event ){
for (Beam_itr = BeamHitMap->GetMap()->begin(); Beam_itr != BeamHitMap->GetMap()->end(); Beam_itr++) {
G4double* Info = *(Beam_itr->second);
//file << event->GetEventID() << "\t";
for(int s = 0; s<12; s++) {
for(int s = 0; s<13; s++) {
file << Info[s] << "\t";
}
file << Info[12] << endl;
file << Info[13] << endl;
}
BeamHitMap->clear();
......@@ -385,9 +389,9 @@ void TACTIC::InitializeScorers() {
if(input.GetAllBlocksWithToken("TwoBodyReaction").size()>0) {
// NEED SEPERATE SCORERS FOR EACH PARTICLE! OTHERWISE SCORER JUST RETURNS OUTPUT FOR ONE PARTICLE WHEN THERE IS OVERLAP
G4VPrimitiveScorer* LightScorer = new TACTICScorer::Gas_Scorer("LightScorer",1,TACTIC_NS::active_length,(int)TACTIC_NS::NumberOfStrips);
G4VPrimitiveScorer* HeavyScorer = new TACTICScorer::Gas_Scorer("HeavyScorer",1,TACTIC_NS::active_length,(int)TACTIC_NS::NumberOfStrips);
G4VPrimitiveScorer* BeamScorer = new TACTICScorer::Gas_Scorer("BeamScorer",1,TACTIC_NS::active_length,(int)TACTIC_NS::NumberOfStrips);
G4VPrimitiveScorer* LightScorer = new TACTICScorer::Gas_Scorer("LightScorer",1,TACTIC_NS::active_length,(int)TACTIC_NS::NumberOfStrips,0,m_p0,m_p1,m_p2,m_p3);
G4VPrimitiveScorer* HeavyScorer = new TACTICScorer::Gas_Scorer("HeavyScorer",1,TACTIC_NS::active_length,(int)TACTIC_NS::NumberOfStrips,0,m_p0,m_p1,m_p2,m_p3);
G4VPrimitiveScorer* BeamScorer = new TACTICScorer::Gas_Scorer("BeamScorer",1,TACTIC_NS::active_length,(int)TACTIC_NS::NumberOfStrips,0,m_p0,m_p1,m_p2,m_p3);
G4SDParticleFilter* LightFilter = new G4SDParticleFilter("LightFilter");
G4SDParticleFilter* HeavyFilter = new G4SDParticleFilter("HeavyFilter");
G4SDParticleFilter* BeamFilter = new G4SDParticleFilter("BeamFilter");
......@@ -413,9 +417,9 @@ void TACTIC::InitializeScorers() {
if(input.GetAllBlocksWithToken("Isotropic").size()>0) { //For alpha, proton or neutron source (obviously neutron wont do anything so this is spare).
G4VPrimitiveScorer* LightScorer = new TACTICScorer::Gas_Scorer("LightScorer",1,TACTIC_NS::active_length,(int)TACTIC_NS::NumberOfStrips);
G4VPrimitiveScorer* HeavyScorer = new TACTICScorer::Gas_Scorer("HeavyScorer",1,TACTIC_NS::active_length,(int)TACTIC_NS::NumberOfStrips);
G4VPrimitiveScorer* BeamScorer = new TACTICScorer::Gas_Scorer("BeamScorer",1,TACTIC_NS::active_length,(int)TACTIC_NS::NumberOfStrips);
G4VPrimitiveScorer* LightScorer = new TACTICScorer::Gas_Scorer("LightScorer",1,TACTIC_NS::active_length,(int)TACTIC_NS::NumberOfStrips,0,m_p0,m_p1,m_p2,m_p3);
G4VPrimitiveScorer* HeavyScorer = new TACTICScorer::Gas_Scorer("HeavyScorer",1,TACTIC_NS::active_length,(int)TACTIC_NS::NumberOfStrips,0,m_p0,m_p1,m_p2,m_p3);
G4VPrimitiveScorer* BeamScorer = new TACTICScorer::Gas_Scorer("BeamScorer",1,TACTIC_NS::active_length,(int)TACTIC_NS::NumberOfStrips,0,m_p0,m_p1,m_p2,m_p3);
G4SDParticleFilter* LightFilter = new G4SDParticleFilter("LightFilter","alpha");
G4SDParticleFilter* HeavyFilter = new G4SDParticleFilter("HeavyFilter","proton");
G4SDParticleFilter* BeamFilter = new G4SDParticleFilter("BeamFilter","neutron");
......
......@@ -8,6 +8,10 @@ TACTIC
GasFraction_1 = 90
GasFraction_2 = 10
Temperature = 293.15 kelvin
Pressure = 0.2 bar
Pressure = 0.1 bar
% Pressure = 1.0 bar
Active = gas
\ No newline at end of file
Active = gas
p0 = 0
p1 = 0
p2 = 0
p3 = 0
\ No newline at end of file
......@@ -115,6 +115,7 @@ private: // Geometry
// Shape type
vector<string> m_Shape ;
string m_Active;
double m_p0, m_p1, m_p2, m_p3;
// Visualisation Attribute
G4VisAttributes* m_VisChamber;
......
......@@ -10,7 +10,7 @@
using namespace TACTICScorer;
Gas_Scorer::Gas_Scorer(G4String name,G4int Level,G4double ScorerLength,G4int NumberOfSegments, G4int depth) //what do level and depth do?
Gas_Scorer::Gas_Scorer(G4String name,G4int Level,G4double ScorerLength,G4int NumberOfSegments, G4int depth, G4double p0, G4double p1, G4double p2, G4double p3) //what do level and depth do?
:G4VPrimitiveScorer(name, depth),HCID(-1){
m_ScorerLength = ScorerLength;
m_NumberOfSegments = NumberOfSegments;
......@@ -19,13 +19,17 @@ Gas_Scorer::Gas_Scorer(G4String name,G4int Level,G4double ScorerLength,G4int Num
m_Position = G4ThreeVector(-1000,-1000,-1000);
m_SegmentNumber = -1;
m_Index = -1;
m_p0 = p0;
m_p1 = p1;
m_p2 = p2;
m_p3 = p3;
}
Gas_Scorer::~Gas_Scorer(){}
G4bool Gas_Scorer::ProcessHits(G4Step* aStep, G4TouchableHistory*){
G4double* Infos = new G4double[13];
G4double* Infos = new G4double[14];
m_Position = aStep->GetPreStepPoint()->GetPosition();
Infos[0] = G4RunManager::GetRunManager()->GetCurrentEvent()->GetEventID();
......@@ -47,6 +51,7 @@ G4bool Gas_Scorer::ProcessHits(G4Step* aStep, G4TouchableHistory*){
G4ThreeVector p_vec = aStep->GetTrack()->GetVertexMomentumDirection();
Infos[11] = acos(p_vec[2]/pow(pow(p_vec[0],2)+pow(p_vec[1],2)+pow(p_vec[2],2),0.5))/deg; //angle relative to z axis (theta);
Infos[12] = aStep->GetTrack()->GetTrackLength();
Infos[13] = m_p0 + m_p1*Infos[8] + m_p2*Infos[8]*Infos[8] + m_p3*Infos[8]*Infos[8]*Infos[8];
m_DetectorNumber = aStep->GetPreStepPoint()->GetTouchableHandle()->GetCopyNumber(m_Level);
m_Index = m_DetectorNumber * 1e3 + m_SegmentNumber * 1e6;
......
......@@ -17,7 +17,13 @@ namespace TACTICScorer {
G4int Level,
G4double ScorerLength,
G4int NumberOfSegments,
G4int depth=0);
G4int depth=0,
G4double p0 = 0,
G4double p1 = 0,
G4double p2 = 0,
G4double p3 = 0
);
~Gas_Scorer();
protected: // with description
......@@ -36,10 +42,10 @@ namespace TACTICScorer {
G4double m_SegmentLength;
// Level at which to find the copy number linked to the detector number
G4int m_Level;
//bool first_step = 1;
//vector<double> TOA_PAD;
//int PAD = 1000;
G4double m_p0;
G4double m_p1;
G4double m_p2;
G4double m_p3;
private: // inherited from G4VPrimitiveScorer
G4int HCID;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment