Skip to content
Snippets Groups Projects
Commit e51a3500 authored by Adrien Matta's avatar Adrien Matta :skull_crossbones:
Browse files

Merge branch 'NPTool.2.dev' of https://github.com/adrien-matta/nptool into NPTool.2.dev

parents 8ead055d d2ec7262
No related branches found
No related tags found
No related merge requests found
......@@ -733,55 +733,96 @@ void Minos::ConstructDetector(G4LogicalVolume* world){
G4ChordFinder* ChordFinder = new G4ChordFinder(IntgrDriver);
FieldManager->SetChordFinder( ChordFinder );
///////// CONSTRUCT ANODE w/ PADS
G4double InnerRadius = 45*mm;
G4double OuterRadius = 88.46*mm;
// Volume where Pads are placed
G4Tubs* solidAnode = new G4Tubs("Anode",
InnerRadius, OuterRadius, 1.2*mm,0,360*deg);
G4LogicalVolume* logicAnode = new G4LogicalVolume(solidAnode,
TPCMaterial,
"Anode");
new G4PVPlacement(0,
G4ThreeVector(0,0,-ChamberLength+2*mm),
logicAnode, //its logical volume
"Anode", //its name
logicTPC, //its mother volume
false, //no boolean operation
0); //copy number
{G4VisAttributes* atb= new G4VisAttributes(G4Colour(1., 1., 0.,0.1));
logicAnode->SetVisAttributes(atb);}
// Volume of One Pad
G4Material* Cu
= MaterialManager::getInstance()->GetMaterialFromLibrary("Cu");
//Box Pad
/* G4Box* solidPad = new G4Box("Pad", 1.0*mm,1.0*mm,1.0*mm); */
///////// CONSTRUCT PADS using parametrized volumes or replica (uncomment the correct section)
//// Using parametrized volumes
/* G4double InnerRadius = 45*mm; */
/* G4double OuterRadius = 88.46*mm; */
/* // Volume where Pads are placed */
/* G4Tubs* solidAnode = new G4Tubs("Anode", */
/* InnerRadius, OuterRadius, 1.2*mm,0,360*deg); */
/* G4LogicalVolume* logicAnode = new G4LogicalVolume(solidAnode, */
/* TPCMaterial, */
/* "Anode"); */
/* new G4PVPlacement(0, */
/* G4ThreeVector(0,0,-ChamberLength+2*mm), */
/* logicAnode, //its logical volume */
/* "Anode", //its name */
/* logicTPC, //its mother volume */
/* false, //no boolean operation */
/* 0); //copy number */
/* {G4VisAttributes* atb= new G4VisAttributes(G4Colour(1., 1., 0.,0.1)); */
/* logicAnode->SetVisAttributes(atb);} */
/* // Volume of One Pad */
/* //Box Pad */
/* /1* G4Box* solidPad = new G4Box("Pad", 1.0*mm,1.0*mm,1.0*mm); *1/ */
/* /1* G4LogicalVolume* logicPad = new G4LogicalVolume(solidPad, Cu,"Pad"); *1/ */
/* //Trapez Pad */
/* G4Trd* solidPad = new G4Trd("Pad",0.97,0.97,0.97,1.01,1.04); */
/* G4LogicalVolume* logicPad = new G4LogicalVolume(solidPad, Cu,"Pad"); */
//Trapez Pad
G4Trd* solidPad = new G4Trd("Pad",0.97,0.97,0.97,1.01,1.04);
G4LogicalVolume* logicPad = new G4LogicalVolume(solidPad, Cu,"Pad");
{G4VisAttributes* atb= new G4VisAttributes(G4Colour(0.8, 0.4, 0.,0.8));
logicPad->SetVisAttributes(atb);}
logicPad->SetSensitiveDetector(m_MinosPadScorer);
/* {G4VisAttributes* atb= new G4VisAttributes(G4Colour(0.8, 0.4, 0.,0.8)); */
/* logicPad->SetVisAttributes(atb);} */
/* logicPad->SetSensitiveDetector(m_MinosPadScorer); */
G4int NbOfPads = 3604;
/* G4int NbOfPads = 3604; */
G4VPVParameterisation* PadParam =
new PadParameterisation(
);
new G4PVParameterised("Pad", // their name
logicPad, // their logical volume
logicAnode, // Mother logical volume
kZAxis, // Are placed along this axis
NbOfPads, // Number of Pads
PadParam, // The parametrisation
false); // checking overlaps
/* G4VPVParameterisation* PadParam = */
/* new PadParameterisation( */
/* ); */
/* new G4PVParameterised("Pad", // their name */
/* logicPad, // their logical volume */
/* logicAnode, // Mother logical volume */
/* kZAxis, // Are placed along this axis */
/* NbOfPads, // Number of Pads */
/* PadParam, // The parametrisation */
/* false); // checking overlaps */
//// Using REPLICA
for (int RingNbr = 0; RingNbr < 18; RingNbr++){
int PadsPerRing[18]={144,152,156,164,172,176,184,192,196,204,212,216,224,228,236,244,248,256};
G4double InnerRadius = (45.2+RingNbr*2.1+0.02)*mm;
G4double OuterRadius = (47.3+RingNbr*2.1)*mm;
G4VSolid* AnodeRing = new G4Tubs("ring",InnerRadius,OuterRadius,
1.1*mm,0.,360*deg);
G4LogicalVolume * AnodeRing_log = new G4LogicalVolume(AnodeRing,
TPCMaterial, "ringL", 0, 0, 0);
{G4VisAttributes* atb= new G4VisAttributes(G4Colour(0.8, 0.4, 0.,0));
AnodeRing_log->SetVisAttributes(atb);}
new G4PVPlacement(0,G4ThreeVector(0,0,-ChamberLength+2*mm),
AnodeRing_log,"ring", logicTPC, false, RingNbr);
G4double Pad_dPhi = (360./(PadsPerRing[RingNbr]+1))*deg; // longitudinal component of Pad
G4double Pad_shift = (360./PadsPerRing[RingNbr])*deg; // dPhi between each Pads
G4VSolid* Pad = new G4Tubs("div_ring", InnerRadius, OuterRadius,
1*mm,0, Pad_dPhi);
G4LogicalVolume* Pad_log = new G4LogicalVolume(Pad,
Cu,"div_ringL",0,0,0);
{G4VisAttributes* atb= new G4VisAttributes(G4Colour(0.8, 0.4, 0.,0.8));
Pad_log->SetVisAttributes(atb);}
Pad_log->SetSensitiveDetector(m_MinosPadScorer);
new G4PVReplica("div_ring_phys", Pad_log,
AnodeRing_log, kPhi, PadsPerRing[RingNbr],Pad_shift ,0);
}
//////////////////////////////////////
new G4PVPlacement(0, //its name
......
......@@ -62,8 +62,24 @@ G4bool PS_TPCAnode::ProcessHits(G4Step* aStep, G4TouchableHistory*){
// contain Enegy Time, DetNbr, StripFront and StripBack
t_Charge = aStep->GetTrack()->GetWeight();
t_DriftTime = aStep->GetPreStepPoint()->GetProperTime();
// Convert Pad number to X,Y position
//For the case of replica pads
G4int Ring = aStep->GetPreStepPoint()->GetTouchableHandle()->GetCopyNumber(1);
int PadsPerRing[18]={144,152,156,164,172,176,184,192,196,204,212,216,224,228,236,244,248,256};
int PadsPerRing[18]={144,152,156,164,172,176,184,192,196,204,212,216,224,228,236,244,248,256};
G4double R = (50.+ Ring*2.2)*mm;
G4double dPhi= (2.*M_PI/PadsPerRing[Ring]);
G4double Phi = Pad*dPhi;
for(int i = 0; i < Ring; i++){
Pad += PadsPerRing[i];
}
t_Pad = Pad;
//For the case of parameterized pads
/*
t_Pad = Pad;
G4int Ring = 0;
if (Pad<144){
Ring = 0;}
......@@ -77,7 +93,7 @@ G4bool PS_TPCAnode::ProcessHits(G4Step* aStep, G4TouchableHistory*){
Ring = 4;}
else if (788<=Pad && Pad<964){
Ring = 5;}
else if (964<=Pad && Pad<1148){
else if (964<=Pad && Pad<1148){
Ring = 6;}
else if (1148<=Pad && Pad<1340){
Ring = 7;}
......@@ -104,13 +120,16 @@ G4bool PS_TPCAnode::ProcessHits(G4Step* aStep, G4TouchableHistory*){
G4double R = (50.+ Ring*2.2)*mm;
G4double dPhi= (2*M_PI/PadsPerRing[Ring]);
for(int i = 0; i < Ring; i++) {
Pad -= PadsPerRing[Ring];
}
G4double Phi = Pad*dPhi;
*/
t_X = R*cos(Phi);
t_Y = R*sin(Phi);
t_Pad = Pad;
vector<AnodeData>::iterator it;
it = m_Data.find(t_Pad);
if(it!= m_Data.end())
......
......@@ -46,14 +46,19 @@ G4bool PS_Interactions::ProcessHits(G4Step* aStep, G4TouchableHistory*){
t_Energy = aStep->GetTotalEnergyDeposit();
t_Time = point->GetGlobalTime();
t_Position = point->GetPosition();
// add it to check the theta of momentum
// MOMENT = aStep->GetPreStepPoint()->GetMomentumDirection();
t_Index = aStep->GetTrack()->GetTrackID();
vector<InteractionData>::iterator it;
it = m_DataVector.find(t_Index);
if(it!=m_DataVector.end())
it->Add(t_Energy);
else
m_DataVector.Set(t_Index,t_Energy,t_Time,t_Position.x(),t_Position.y(),t_Position.z(),t_Position.theta(),t_Position.phi());
{ m_DataVector.Set(t_Index,t_Energy,t_Time,t_Position.x(),t_Position.y(),t_Position.z(), /*MOMENT*/ t_Position.theta(),t_Position.phi());
}
return TRUE;
}
......
......@@ -55,6 +55,7 @@ namespace InteractionScorers {
double m_PositionZ;
double m_Theta;
double m_Phi;
public:
unsigned int GetIndex() const{return m_Index;};
......@@ -131,6 +132,7 @@ namespace InteractionScorers {
double t_Energy;
double t_Time;
G4ThreeVector t_Position;
//G4ThreeVector MOMENT;
};
}
......
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%% An Isotropic Source to be used as EventGenerator %%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Energy are given in MeV , Position in mm %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Isotropic
EnergyLow= 6 GeV
EnergyHigh= 6 GeV
HalfOpenAngleMin= 85 deg
HalfOpenAngleMax= 95 deg
x0= 0 mm
y0= 0 mm
z0= 0 mm
Particle= mu-
ExcitationEnergy= 0 MeV
% Supported particle type: proton, neutron, deuton, triton, He3 , alpha, muon
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%% An Isotropic Source to be used as EventGenerator %%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Energy are given in MeV , Position in mm %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Cosmic
EnergyLow= 2.5 GeV
EnergyHigh= 2.5 GeV
HalfOpenAngleMin= 0 deg
HalfOpenAngleMax= 0 deg
x0= 0 mm
y0= 300 mm
z0= 0 mm
Particle= mu-
ExcitationEnergy= 0 MeV
% Supported particle type: proton, neutron, deuton, triton, He3 , alpha, muon
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment