diff --git a/NPSimulation/Detectors/Minos/Minos.cc b/NPSimulation/Detectors/Minos/Minos.cc index cc30a47060e25b5eee8417c18169d504c7cb68c9..a5a6400bab7058b4ebdd3aee4e66042e52f41c42 100644 --- a/NPSimulation/Detectors/Minos/Minos.cc +++ b/NPSimulation/Detectors/Minos/Minos.cc @@ -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 diff --git a/NPSimulation/Scorers/CylinderTPCScorers.cc b/NPSimulation/Scorers/CylinderTPCScorers.cc index b62490a2fc02dcb809d778444c050a4ffe777cfa..fd02e7dbb71827956165f7fcd77c6108c11a03e9 100644 --- a/NPSimulation/Scorers/CylinderTPCScorers.cc +++ b/NPSimulation/Scorers/CylinderTPCScorers.cc @@ -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()) diff --git a/NPSimulation/Scorers/InteractionScorers.cc b/NPSimulation/Scorers/InteractionScorers.cc index 8813c72c1413c6e4e0e12847a675ec90cb752255..860a8962b49a5f04a2d777fd0e895152ac400dc3 100644 --- a/NPSimulation/Scorers/InteractionScorers.cc +++ b/NPSimulation/Scorers/InteractionScorers.cc @@ -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; } diff --git a/NPSimulation/Scorers/InteractionScorers.hh b/NPSimulation/Scorers/InteractionScorers.hh index 2a091e17bc7f0265cd4675d61631654da3b47d97..f5b096c7e3b4ad217092fe8ff91be0a6fb8594e7 100644 --- a/NPSimulation/Scorers/InteractionScorers.hh +++ b/NPSimulation/Scorers/InteractionScorers.hh @@ -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; }; } diff --git a/Projects/Dali/muon.source b/Projects/Dali/muon.source new file mode 100644 index 0000000000000000000000000000000000000000..52d13f32ca9b765e45c3b4380214fb5d64e9ca37 --- /dev/null +++ b/Projects/Dali/muon.source @@ -0,0 +1,17 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%% 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 diff --git a/Projects/Dali/muonCosmic.source b/Projects/Dali/muonCosmic.source new file mode 100644 index 0000000000000000000000000000000000000000..4271225c5bf08f66baafd394df6afcda71833694 --- /dev/null +++ b/Projects/Dali/muonCosmic.source @@ -0,0 +1,17 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%% 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