Added To SVN Repository
This commit is contained in:
@ -96,7 +96,14 @@ LEMuSRDetectorConstruction::LEMuSRDetectorConstruction()
|
||||
dSPhi = 0*deg; // starting angle
|
||||
dEPhi = 360*deg; // ending angle
|
||||
|
||||
|
||||
FieldMapsDir=getenv("LEMuSR_FIELDMAPS_DIR");
|
||||
if(FieldMapsDir)
|
||||
|
||||
G4cout<<"Fied Maps Directory is: "<< FieldMapsDir<<endl;
|
||||
else
|
||||
G4cout<<"Fied Maps Directory is not defined!!!"<<endl;
|
||||
|
||||
|
||||
#ifdef LEMU_GET_NEWMAPS
|
||||
NEWMAPS();
|
||||
#endif
|
||||
@ -157,10 +164,10 @@ G4VPhysicalVolume* LEMuSRDetectorConstruction::Construct()
|
||||
// DEFINE THE DETECTOR
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//
|
||||
|
||||
G4VPhysicalVolume* LEMuSRDetectorConstruction::lemuDetector() // !attention au V dans G4VP...
|
||||
G4VPhysicalVolume* LEMuSRDetectorConstruction::lemuDetector() // !mind the V in G4VP...
|
||||
{
|
||||
|
||||
|
||||
//! Definition of the top mothe volume: the laboratory. Refered to as Wolrd.
|
||||
// +++++++++++++++++++++++++++++++DEFINE THE MOTHER VOLUME: THE LABORATOY++++++++++++++++++++++
|
||||
// solid
|
||||
G4double LABO_x = 1*m;
|
||||
@ -199,30 +206,30 @@ G4VPhysicalVolume* LEMuSRDetectorConstruction::lemuDetector() // !attention au V
|
||||
|
||||
|
||||
// &&&&&&&&&&&&&&&& ADD THE OTHER DETECTOR VOLUMES &&&&&&&&&&&&&&&&&&&&&//
|
||||
|
||||
|
||||
//! Definition of the other volumes:
|
||||
|
||||
//! * -# Definition the attributes.
|
||||
// LOAD ATTRIBUTES AND USER LIMIT
|
||||
LoadAttributes();
|
||||
//-------------------------------
|
||||
|
||||
// main materials
|
||||
|
||||
//! * -# Definition of the materials
|
||||
Vacuum = G4Material::GetMaterial("vacuum");
|
||||
SSteel = G4Material::GetMaterial("stainless_steel");
|
||||
//-------------------------------
|
||||
|
||||
|
||||
//! *-# Add the MCP and Gate Valve chamber.
|
||||
lemuMCP2();
|
||||
|
||||
|
||||
//! If <tt>asymcheck==1</tt> then build a spherical detector around mcp chamber to test the asymmetry. Shall be modified in the future.
|
||||
if(AsymCheck==1)
|
||||
{
|
||||
lemuAsym();
|
||||
}
|
||||
|
||||
|
||||
|
||||
//! If <tt>asymcheck==0</tt> then build the trigger detector, the gate valve chamber, the third lens, the anode and the scintillators.
|
||||
if(AsymCheck==0)
|
||||
{
|
||||
|
||||
@ -233,11 +240,16 @@ G4VPhysicalVolume* LEMuSRDetectorConstruction::lemuDetector() // !attention au V
|
||||
lemuSCINT();
|
||||
|
||||
#ifdef LEMU_TEST_FOCAL_LENGTH
|
||||
lemuFieldCheck();
|
||||
//! If <tt>LEMU_TEST_FOCAL_LENGTH</tt> is defined then
|
||||
lemuFieldCheck();
|
||||
#endif
|
||||
|
||||
|
||||
if(mcdetector==0) //then use cryostat
|
||||
//! Sensitive Detection
|
||||
/*!
|
||||
* The sensitive detector and the hit collection it builds must be singletons, i.e. they can be instanciated only once. Hence, the variable <tt>cryo, mcp</tt> and <tt>scint</tt> are set to 1 as soon as the sensitive detector is built.
|
||||
*/
|
||||
|
||||
if(mcdetector==0) //! If <tt>mcdetector==0</tt> then use cryostat
|
||||
{
|
||||
lemuCRYO();
|
||||
if(cryo==0)
|
||||
@ -257,7 +269,7 @@ G4VPhysicalVolume* LEMuSRDetectorConstruction::lemuDetector() // !attention au V
|
||||
}
|
||||
|
||||
|
||||
else if(mcdetector==1) //then use multiple channel detector
|
||||
else if(mcdetector==1) //! If <tt>mcdetector==1</tt>then use micro channel detector
|
||||
{
|
||||
lemuMCPdet();
|
||||
if(mcp==0)
|
||||
@ -335,6 +347,7 @@ void LEMuSRDetectorConstruction::lemuMCP2()
|
||||
|
||||
// main volumes
|
||||
MCPV_tube= new G4Tubs( "sMCPV", 0.00*cm, 7.65*cm, 25.45*cm, dSPhi, dEPhi);
|
||||
G4cout<<dSPhi<<" "<<dEPhi<<G4endl;
|
||||
MCPS_tube= new G4Tubs( "sMCPS", 7.65*cm, 7.95*cm, 16.2*cm, dSPhi, dEPhi);
|
||||
F160_tube= new G4Tubs( "sF160", 7.95*cm, 10.125*cm,1.1*cm, dSPhi, dEPhi);
|
||||
F100_tube= new G4Tubs( "sF100", 0.00*cm, 7.65*cm, .5*cm, dSPhi, dEPhi);
|
||||
@ -440,16 +453,13 @@ void LEMuSRDetectorConstruction::lemuANODE()
|
||||
|
||||
RA_Ebox = new G4Box("RA_Ebox", 1.*cm,12.5*cm,2.25*cm );
|
||||
RA_Mbox = new G4Box("RA_Mbox", 1.*cm,12.5*cm,2.25*cm );
|
||||
//boolean
|
||||
// RA_E= new G4SubtractionSolid("RA_E", RA_E_cone, RA_Ebox);
|
||||
// RA_M= new G4SubtractionSolid("RA_M", RA_M_cone, RA_Mbox);
|
||||
|
||||
RA_G_tube= new G4Tubs( "sRA_G", 5.8*cm,6.25*cm,5.55*cm, dSPhi, dEPhi);
|
||||
|
||||
|
||||
// logicals volumes
|
||||
lv_RA_E = new G4LogicalVolume( RA_E_cone , SSteel ,"lv_RA_E",0,0,0);
|
||||
lv_RA_M = new G4LogicalVolume( RA_M_cone , SSteel ,"lv_RA_M",0,0,0);
|
||||
// logical volumes
|
||||
lv_RA_E = new G4LogicalVolume( RA_E_cone , SSteel ,"lv_RA_E",0,0,0);
|
||||
lv_RA_M = new G4LogicalVolume( RA_M_cone , SSteel ,"lv_RA_M",0,0,0);
|
||||
lv_RA_G = new G4LogicalVolume( RA_G_tube , SSteel ,"lv_RA_G",0,0,0);
|
||||
|
||||
|
||||
@ -459,7 +469,7 @@ void LEMuSRDetectorConstruction::lemuANODE()
|
||||
RA_Mz= -10.35-2.25;
|
||||
|
||||
|
||||
//#changed mother volumes!!!!
|
||||
// Mother Volume is lv_MCPV!!!!
|
||||
pv_RA_E = new G4PVPlacement( 0, G4ThreeVector( 0*cm, 0*cm, RA_Ez*cm-mcpv_z),lv_RA_E ,"pv_RA_E",lv_MCPV, false, 0 );
|
||||
pv_RA_M = new G4PVPlacement( 0, G4ThreeVector( 0*cm, 0*cm, RA_Mz*cm-mcpv_z),lv_RA_M ,"pv_RA_M",lv_MCPV, false, 0 );
|
||||
pv_RA_G = new G4PVPlacement( 0, G4ThreeVector( 0*cm, 0*cm, RA_Gz*cm-mcpv_z),lv_RA_G ,"pv_RA_G",lv_MCPV, false, 0 );
|
||||
@ -600,7 +610,7 @@ void LEMuSRDetectorConstruction:: lemuCRYO()
|
||||
|
||||
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//
|
||||
// DEFINE THE MULTIPLE CHANNEL-DETECTOR
|
||||
// DEFINE THE MICRO CHANNEL-DETECTOR
|
||||
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$//
|
||||
|
||||
void LEMuSRDetectorConstruction:: lemuMCPdet()
|
||||
@ -638,7 +648,7 @@ void LEMuSRDetectorConstruction:: lemuMCPdet()
|
||||
pv_MCSR = new G4PVPlacement( 0, G4ThreeVector( 0.*cm, 0.*cm, 2.63*cm-mcpv_z),lv_MCSR ,"pv_MCSR",lv_MCPV, false, 0 );
|
||||
pv_MCVR = new G4PVPlacement( 0, G4ThreeVector( 0.*cm, 0.*cm, 0.0*cm),lv_MCVR ,"pv_MCVR",lv_MCSR, false, 0 );//CF SUBSTRACTION
|
||||
pv_MCPA = new G4PVPlacement( 0, G4ThreeVector(0 *cm,0 *cm, 3.73*cm-mcpv_z),lv_MCPA ,"pv_MCPA",lv_MCPV, false, 0 );
|
||||
pv_ANVA = new G4PVPlacement( 0, G4ThreeVector( 0.*cm, 0.*cm, -0.25*cm),lv_ANVA ,"pv_ANVA",lv_MCPA, false, 0 ); // PART OF THE anode
|
||||
pv_ANVA = new G4PVPlacement( 0, G4ThreeVector( 0.*cm, 0.*cm, -0.25*cm),lv_ANVA ,"pv_ANVA",lv_MCPA, false, 0 );
|
||||
pv_ANVA2= new G4PVPlacement( 0, G4ThreeVector( 0.*cm, 0.*cm, 0.25*cm),lv_ANVA ,"pv_ANVA2",lv_MCPA, false, 0 );
|
||||
pv_MCSS = new G4PVPlacement( 0, G4ThreeVector( 0.*cm, 0.*cm, 6.38*cm-mcpv_z),lv_MCSS ,"pv_MCSS",lv_MCPV, false, 0 );
|
||||
|
||||
@ -747,7 +757,7 @@ void LEMuSRDetectorConstruction::lemuLinse3()
|
||||
{
|
||||
|
||||
G4ElectricField* L3Field = new LEMuSRElectricField(L3FieldVal,
|
||||
"/home/l_paraiso/LEMuSR/FieldMaps/ThirdLense/L3b.map"
|
||||
FieldMapsDir+"/ThirdLens/L3b.map"
|
||||
,"dm",-567,60,60,100);
|
||||
|
||||
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
@ -935,9 +945,9 @@ void LEMuSRDetectorConstruction::lemuTrigger_Detector()
|
||||
// logical volumes
|
||||
|
||||
|
||||
lv_TriggerB=new G4LogicalVolume(Trigger_box,Vacuum,"lv_TriggerB",T1FieldMgr,0,0);
|
||||
lv_TriggerB2=new G4LogicalVolume(Trigger_box2,Vacuum,"lv_TriggerB2",T2FieldMgr,0,0);
|
||||
lv_TriggerB3=new G4LogicalVolume(Trigger_box,Vacuum,"lv_TriggerB3",T3FieldMgr,0,0);
|
||||
lv_TriggerE=new G4LogicalVolume(Trigger_box,Vacuum,"lv_TriggerE",T1FieldMgr,0,0);
|
||||
lv_TriggerE2=new G4LogicalVolume(Trigger_box2,Vacuum,"lv_TriggerE2",T2FieldMgr,0,0);
|
||||
lv_TriggerE3=new G4LogicalVolume(Trigger_box,Vacuum,"lv_TriggerE3",T3FieldMgr,0,0);
|
||||
|
||||
|
||||
G4Transform3D Rotation2, transformation2, trl;
|
||||
@ -948,11 +958,11 @@ void LEMuSRDetectorConstruction::lemuTrigger_Detector()
|
||||
|
||||
if(trigger_field!=0)
|
||||
{
|
||||
pv_TriggerB = new G4PVPlacement( 0,G4ThreeVector(0.*cm,0.*cm,(-3.85)*cm),lv_TriggerB,"pv_TriggerB",lv_TriggerV, false, 0 );
|
||||
pv_TriggerE = new G4PVPlacement( 0,G4ThreeVector(0.*cm,0.*cm,(-3.85)*cm),lv_TriggerE,"pv_TriggerE",lv_TriggerV, false, 0 );
|
||||
|
||||
pv_TriggerB2 = new G4PVPlacement(transformation2,lv_TriggerB2,"pv_TriggerB2",lv_TriggerV, false, 0 );
|
||||
pv_TriggerE2 = new G4PVPlacement(transformation2,lv_TriggerE2,"pv_TriggerE2",lv_TriggerV, false, 0 );
|
||||
|
||||
pv_TriggerB3 = new G4PVPlacement( 0,G4ThreeVector(0.*cm,0.*cm,(+4.3)*cm),lv_TriggerB3,"pv_TriggerB3",lv_TriggerV, false, 0 );
|
||||
pv_TriggerE3 = new G4PVPlacement( 0,G4ThreeVector(0.*cm,0.*cm,(+4.3)*cm),lv_TriggerE3,"pv_TriggerE3",lv_TriggerV, false, 0 );
|
||||
}
|
||||
|
||||
|
||||
@ -1023,29 +1033,30 @@ void LEMuSRDetectorConstruction::buildAnodeField()
|
||||
{
|
||||
|
||||
|
||||
char dir[256]="\0";
|
||||
|
||||
int k=2*Grid+Guards;
|
||||
std::cout<<"k: "<<k<<std::endl;
|
||||
switch(k)
|
||||
G4String dir= FieldMapsDir;
|
||||
|
||||
int k=2*Grid+Guards;
|
||||
|
||||
std::cout<<"buildAnodeField::case = "<<k<<std::endl;
|
||||
switch(k)
|
||||
{
|
||||
|
||||
case 0:
|
||||
stpcpy(dir,"/home/l_paraiso/LEMuSR/FieldMaps/MCPV-80-80-200/No_Grid_NoGuards/\0"); break;
|
||||
dir+="/MCPV-80-80-200/No_Grid_NoGuards/"; break;
|
||||
|
||||
case 1:
|
||||
stpcpy(dir,"/home/l_paraiso/LEMuSR/FieldMaps/MCPV-80-80-200/No_Grid_Guards/\0"); break;
|
||||
dir+="/MCPV-80-80-200/No_Grid_Guards/"; break;
|
||||
|
||||
case 2:
|
||||
stpcpy(dir,"/home/l_paraiso/LEMuSR/FieldMaps/MCPV-80-80-200/Grid_NoGuards/\0"); break;
|
||||
dir+="/MCPV-80-80-200/Grid_NoGuards/"; break;
|
||||
|
||||
case 3:
|
||||
stpcpy(dir,"/home/l_paraiso/LEMuSR/FieldMaps/MCPV-80-80-200/Grid_Guards/\0"); break;
|
||||
|
||||
default: break;
|
||||
|
||||
dir+="/MCPV-80-80-200/Grid_Guards/"; break;
|
||||
|
||||
default: break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// IF THERE IS A FIELD IN THE ANODE
|
||||
@ -1058,10 +1069,8 @@ void LEMuSRDetectorConstruction::buildAnodeField()
|
||||
// G4cout<<"offset"<<mcpv_z/mm<<G4endl;
|
||||
// left
|
||||
|
||||
char leftfile[]="RAL.map";
|
||||
char leftmap[256];
|
||||
stpcpy(leftmap,dir);
|
||||
strcat(leftmap,leftfile);
|
||||
G4String leftfile="RAL.map";
|
||||
G4String leftmap = dir+leftfile;
|
||||
|
||||
LEMuSRElectricField* GFieldLeft = new LEMuSRElectricField(1,leftmap,"mm",0.0,80,80,200);
|
||||
|
||||
@ -1069,10 +1078,8 @@ void LEMuSRDetectorConstruction::buildAnodeField()
|
||||
|
||||
// right
|
||||
|
||||
char rightfile[]="RAR.map";
|
||||
char rightmap[256];
|
||||
stpcpy(rightmap,dir);
|
||||
strcat(rightmap,rightfile);
|
||||
G4String rightfile="RAR.map";
|
||||
G4String rightmap = dir+rightfile;
|
||||
|
||||
LEMuSRElectricField* GFieldRight = new LEMuSRElectricField(1,rightmap,"mm",0.0,80,80,200);
|
||||
|
||||
@ -1234,11 +1241,11 @@ void LEMuSRDetectorConstruction::buildAnodeField()
|
||||
|
||||
#ifdef LEMU_TRANSVERSE_FIELD
|
||||
mcField = new LEMuSRMagneticField(G4ThreeVector(0.,B*gauss,0.));
|
||||
G4cout<<"Transverse Field Applied: (0 G, " <<B <<"G, 0 G) \n"<<G4endl;
|
||||
G4cout<<"Longitudinal Field Applied: (0 G, " <<B <<"G, 0 G) \n"<<G4endl;
|
||||
sleep(3); // wait 3 seconds
|
||||
#else
|
||||
mcField = new LEMuSRMagneticField(G4ThreeVector(0.,0.,B*gauss));
|
||||
G4cout<<"Longitudinal Field Applied: (0 G, 0 G, " <<B <<"G) \n"<<G4endl;
|
||||
G4cout<<"Transverse Field Applied: (0 G, 0 G, " <<B <<"G) \n"<<G4endl;
|
||||
sleep(3); // wait 3 seconds
|
||||
#endif
|
||||
|
||||
@ -1279,38 +1286,36 @@ void LEMuSRDetectorConstruction::buildAnodeField()
|
||||
void LEMuSRDetectorConstruction::buildCryoField()
|
||||
{
|
||||
// sample ELECTRIC field
|
||||
G4double d= cryoFieldLength*cm;
|
||||
G4double V= cryoVoltage*kilovolt;
|
||||
// G4double d= cryoFieldLength*cm;
|
||||
// G4double V= cryoVoltage*kilovolt;
|
||||
|
||||
G4ThreeVector C_field(0.,0.,-V/d);
|
||||
// G4ThreeVector C_field(0.,0.,-V/d);
|
||||
|
||||
G4String dir= FieldMapsDir;
|
||||
|
||||
// char dir[]="/home/l_paraiso/LEMuSR/FieldMaps/MCPV-80-80-200/Grid_NoGuards/";
|
||||
|
||||
char dir[256];
|
||||
int k=2*Grid+Guards;
|
||||
int k=2*Grid+Guards;
|
||||
switch(k)
|
||||
{
|
||||
|
||||
case 0:
|
||||
stpcpy(dir,"/home/l_paraiso/LEMuSR/FieldMaps/MCPV-80-80-200/No_Grid_NoGuards/\0"); break;
|
||||
dir+="/MCPV-80-80-200/No_Grid_NoGuards/"; break;
|
||||
|
||||
case 1:
|
||||
stpcpy(dir,"/home/l_paraiso/LEMuSR/FieldMaps/MCPV-80-80-200/No_Grid_Guards/\0"); break;
|
||||
dir+="/MCPV-80-80-200/No_Grid_Guards/"; break;
|
||||
|
||||
case 2:
|
||||
stpcpy(dir,"/home/l_paraiso/LEMuSR/FieldMaps/MCPV-80-80-200/Grid_NoGuards/\0"); break;
|
||||
dir+="/MCPV-80-80-200/Grid_NoGuards/"; break;
|
||||
|
||||
case 3:
|
||||
stpcpy(dir,"/home/l_paraiso/LEMuSR/FieldMaps/MCPV-80-80-200/Grid_Guards/\0"); break;
|
||||
dir+="/MCPV-80-80-200/Grid_Guards/"; break;
|
||||
|
||||
default: break;
|
||||
}
|
||||
|
||||
|
||||
char filename[]="SAMPLE.map";
|
||||
G4String filename="SAMPLE.map";
|
||||
|
||||
const char* fmap=strcat(dir,filename);
|
||||
G4String fmap=dir+filename;
|
||||
|
||||
cryoField = new LEMuSRElectricField(cryoVoltage,fmap,"mm",0.0,80,80,200);//offset in milimeters)
|
||||
|
||||
@ -1326,7 +1331,6 @@ void LEMuSRDetectorConstruction::buildCryoField()
|
||||
cryoField->GetFieldValue(position,Efield);
|
||||
do
|
||||
{
|
||||
|
||||
cryoField->GetFieldValue(position,Efield);
|
||||
G4cout<<position[0]<<" "<<position[1]<<" "<<position[2]<<G4endl;
|
||||
G4cout<<"Field E Value " << G4BestUnit(Efield[0]*meter,"Electric potential") <<"/m " <<Efield[1]/volt*meter <<" V/m "<< Efield[2]/volt*meter <<" V/m " <<G4endl;
|
||||
@ -1348,17 +1352,17 @@ void LEMuSRDetectorConstruction::NEWMAPS()
|
||||
// left
|
||||
LEMuSRElectricField* LEFTMAP =
|
||||
new LEMuSRElectricField(1,
|
||||
"/home/l_paraiso/LEMuSR/FieldMaps/MCPV-80-80-200/Grid_NoGuards/RAL_Ex.txt",
|
||||
"/home/l_paraiso/LEMuSR/FieldMaps/MCPV-80-80-200/Grid_NoGuards/RAL_Ey.txt",
|
||||
"/home/l_paraiso/LEMuSR/FieldMaps/MCPV-80-80-200/Grid_NoGuards/RAL_Ez.txt",
|
||||
FieldMapsDir+"/MCPV-80-80-200/Grid_NoGuards/RAL_Ex.txt",
|
||||
FieldMapsDir+"/MCPV-80-80-200/Grid_NoGuards/RAL_Ey.txt",
|
||||
FieldMapsDir+"/MCPV-80-80-200/Grid_NoGuards/RAL_Ez.txt",
|
||||
"mm",0.0,80,80,200);//offset in milimeters
|
||||
|
||||
// right
|
||||
LEMuSRElectricField* RIGHTMAP =
|
||||
new LEMuSRElectricField(1,
|
||||
"/home/l_paraiso/LEMuSR/FieldMaps/MCPV-80-80-200/Grid_NoGuards/RAR_Ex.txt",
|
||||
"/home/l_paraiso/LEMuSR/FieldMaps/MCPV-80-80-200/Grid_NoGuards/RAR_Ey.txt",
|
||||
"/home/l_paraiso/LEMuSR/FieldMaps/MCPV-80-80-200/Grid_NoGuards/RAR_Ez.txt",
|
||||
FieldMapsDir+"/MCPV-80-80-200/Grid_NoGuards/RAR_Ex.txt",
|
||||
FieldMapsDir+"/MCPV-80-80-200/Grid_NoGuards/RAR_Ey.txt",
|
||||
FieldMapsDir+"/MCPV-80-80-200/Grid_NoGuards/RAR_Ez.txt",
|
||||
"mm",0.0,80,80,200);//offset in milimeters
|
||||
|
||||
|
||||
@ -1367,9 +1371,9 @@ void LEMuSRDetectorConstruction::NEWMAPS()
|
||||
|
||||
LEMuSRElectricField* SAMPLEMAP =
|
||||
new LEMuSRElectricField(1,
|
||||
"/home/l_paraiso/LEMuSR/FieldMaps/MCPV-80-80-200/Grid_NoGuards/SAMPLE_Ex.txt",
|
||||
"/home/l_paraiso/LEMuSR/FieldMaps/MCPV-80-80-200/Grid_NoGuards/SAMPLE_Ey.txt",
|
||||
"/home/l_paraiso/LEMuSR/FieldMaps/MCPV-80-80-200/Grid_NoGuards/SAMPLE_Ez.txt",
|
||||
FieldMapsDir+"/MCPV-80-80-200/Grid_NoGuards/SAMPLE_Ex.txt",
|
||||
FieldMapsDir+"/MCPV-80-80-200/Grid_NoGuards/SAMPLE_Ey.txt",
|
||||
FieldMapsDir+"/MCPV-80-80-200/Grid_NoGuards/SAMPLE_Ez.txt",
|
||||
"mm",0.0,80,80,200);//offset in milimeters)
|
||||
|
||||
|
||||
@ -1390,7 +1394,7 @@ void LEMuSRDetectorConstruction::PrintStatus()
|
||||
G4cout<<G4endl
|
||||
<<" Detector Status " <<G4endl;
|
||||
|
||||
|
||||
|
||||
G4cout<<"magfield " << magfield <<G4endl
|
||||
<<"elfield " <<elfield <<G4endl
|
||||
<<"anode_elfield " <<anode_elfield <<G4endl
|
||||
@ -1400,5 +1404,12 @@ void LEMuSRDetectorConstruction::PrintStatus()
|
||||
<<"GUARDS " <<Guards <<G4endl
|
||||
<<G4endl;
|
||||
|
||||
|
||||
if(FieldMapsDir)
|
||||
{
|
||||
G4cout<<"Fied Maps Directory is: "<< FieldMapsDir<<endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
G4cout<<"Fied Maps Directory is not defined!!!"<<endl;sleep(10);
|
||||
}
|
||||
}
|
||||
|
@ -93,8 +93,8 @@ LEMuSRDetectorMessenger::LEMuSRDetectorMessenger(LEMuSRDetectorConstruction *lem
|
||||
|
||||
|
||||
// ELECTRIC POTENTIALS
|
||||
SetThirdLensPotential = new G4UIcmdWithADouble("/Detector/Voltage/ThirdLense",this);
|
||||
SetThirdLensPotential->SetGuidance("\n Third Lense Middle Cylinder Voltage Value >> IN KILOVOLT ");
|
||||
SetThirdLensPotential = new G4UIcmdWithADouble("/Detector/Voltage/ThirdLens",this);
|
||||
SetThirdLensPotential->SetGuidance("\n Third Lens Middle Cylinder Voltage Value >> IN KILOVOLT ");
|
||||
SetThirdLensPotential->SetParameterName("f",false);
|
||||
SetThirdLensPotential->SetDefaultValue(1);
|
||||
SetThirdLensPotential->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
@ -129,7 +129,7 @@ LEMuSRDetectorMessenger::LEMuSRDetectorMessenger(LEMuSRDetectorConstruction *lem
|
||||
SetDetVisualization->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
|
||||
SetFieldStepLim = new G4UIcmdWithADouble("/Detector/MaxStepInField",this);
|
||||
SetFieldStepLim->SetGuidance("\n The user step limitation in third lense and conical anode [mm] ");
|
||||
SetFieldStepLim->SetGuidance("\n The user step limitation in third lens chamber and sample chamber [mm] ");
|
||||
SetFieldStepLim->SetParameterName("usl",false);
|
||||
SetFieldStepLim->SetDefaultValue(10.);
|
||||
SetFieldStepLim->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
@ -306,21 +306,26 @@ void LEMuSRDetectorMessenger::SetNewValue(G4UIcommand* command, G4String newvalu
|
||||
// theDetector->elfield=1;
|
||||
// theDetector->anode_elfield=1;
|
||||
theDetector->trigger_field=1;
|
||||
|
||||
newDetector = theDetector->Construct();
|
||||
G4RunManager::GetRunManager()->DefineWorldVolume(newDetector);
|
||||
G4cout<<"THIS COMMAND ONLY ENABLES THE TRIGGER FIELD.\n"
|
||||
<<" TO SET THE ELECTROSTATIC LENSES USE /Detector/Voltage COMMAND."<<G4endl;
|
||||
<<"TO SET THE ELECTROSTATIC LENSES PLEASE USE THE /Detector/Voltage COMMANDS."<<G4endl;
|
||||
}
|
||||
else if(newvalue=="off")
|
||||
{
|
||||
theDetector->elfield=0;
|
||||
theDetector->anode_elfield=0;
|
||||
theDetector->trigger_field=0;
|
||||
|
||||
newDetector = theDetector->Construct();
|
||||
G4RunManager::GetRunManager()->DefineWorldVolume(newDetector);
|
||||
G4cout<<"ALL ELECTRIC FIELDS ARE NOW DISABLED."<<G4endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
G4cout<<"UNRECOGNIZED COMMAND ENTER on OR off."<<G4endl;
|
||||
G4cout<<"UNRECOGNIZED COMMAND PLEASE ENTER on OR off."<<G4endl;
|
||||
}
|
||||
newDetector = theDetector->Construct();
|
||||
G4RunManager::GetRunManager()->DefineWorldVolume(newDetector);
|
||||
|
||||
}
|
||||
|
||||
@ -401,28 +406,37 @@ void LEMuSRDetectorMessenger::SetNewValue(G4UIcommand* command, G4String newvalu
|
||||
theDetector->dSPhi=0*deg;
|
||||
theDetector->dEPhi=360*deg;
|
||||
theDetector->halfview=0;
|
||||
|
||||
newDetector = theDetector->Construct();
|
||||
G4RunManager::GetRunManager()->DefineWorldVolume(newDetector);
|
||||
G4cout << " \n TOTAL GEOMETRY IS LOADED. \n" ;
|
||||
}
|
||||
else if(newvalue=="half")
|
||||
{
|
||||
theDetector->dSPhi=+90*deg;
|
||||
theDetector->dEPhi=180*deg;
|
||||
theDetector->halfview=1;
|
||||
|
||||
newDetector = theDetector->Construct();
|
||||
G4RunManager::GetRunManager()->DefineWorldVolume(newDetector);
|
||||
G4cout << " \n !!! BEFORE '/run/beamOn' :: PLEASE ENSURE TOTAL GEOMETRY IS LOADED !!! \n" ;
|
||||
}
|
||||
else if(newvalue=="quarter")
|
||||
{
|
||||
theDetector->dSPhi=0*deg;
|
||||
theDetector->dEPhi=270*deg;
|
||||
theDetector->halfview=1;
|
||||
|
||||
newDetector = theDetector->Construct();
|
||||
G4RunManager::GetRunManager()->DefineWorldVolume(newDetector);
|
||||
G4cout << " \n !!! BEFORE '/run/beamOn' :: PLEASE ENSURE TOTAL GEOMETRY IS LOADED !!! \n" ;
|
||||
}
|
||||
else
|
||||
{
|
||||
G4cout << "Unknown command: please check value."<<G4endl;
|
||||
G4cout << "Unknown command: please check value is total/quarter/half ."<<G4endl;
|
||||
}
|
||||
|
||||
newDetector = theDetector->Construct();
|
||||
G4RunManager::GetRunManager()->DefineWorldVolume(newDetector);
|
||||
|
||||
G4cout << " \n !!! BEFORE '/run/beamOn' :: PLEASE ENSURE TOTAL GEOMETRY IS LOADED !!! \n" ;
|
||||
|
||||
// Update visualization
|
||||
//UI ->ApplyCommand("/vis/viewer/refresh") ;
|
||||
//UI ->ApplyCommand("/vis/viewer/update");
|
||||
|
@ -23,9 +23,9 @@
|
||||
#include"G4UnitsTable.hh"
|
||||
|
||||
|
||||
LEMuSRElectricField::LEMuSRElectricField(G4double fieldval,const char* Xfile,
|
||||
const char* Yfile,
|
||||
const char* Zfile,
|
||||
LEMuSRElectricField::LEMuSRElectricField(G4double fieldval,G4String Xfile,
|
||||
G4String Yfile,
|
||||
G4String Zfile,
|
||||
G4String map_length_unit,
|
||||
G4double Offset, G4double nbx, G4double nby, G4double nbz)
|
||||
{
|
||||
@ -148,7 +148,7 @@ LEMuSRElectricField::LEMuSRElectricField(G4double fieldval,const char* Xfile,
|
||||
|
||||
|
||||
|
||||
LEMuSRElectricField::LEMuSRElectricField(G4double fieldval,const char* file,
|
||||
LEMuSRElectricField::LEMuSRElectricField(G4double fieldval,G4String file,
|
||||
G4String map_length_unit,
|
||||
G4double Offset,
|
||||
G4double nbx,
|
||||
|
@ -288,7 +288,7 @@ void LEMuSRDetectorConstruction :: MaterialsDefinition ()
|
||||
|
||||
|
||||
|
||||
/***MATERIAUX***/
|
||||
/***MATERIALS***/
|
||||
|
||||
// definition : composition de Air
|
||||
density=1.290*mg/cm3;
|
||||
@ -323,22 +323,22 @@ void LEMuSRDetectorConstruction :: MaterialsDefinition ()
|
||||
|
||||
|
||||
|
||||
//definition materiau 'tantale'
|
||||
//definition material 'tantale'
|
||||
density = 16.650*g/cm3;
|
||||
G4Material* tantale = new G4Material(name="tantale", density, 1);
|
||||
tantale->AddElement (Ta, nbelements=1);
|
||||
|
||||
//definition materiau 'or'
|
||||
//definition material 'or'
|
||||
density = 19.300*g/cm3;
|
||||
G4Material* gold = new G4Material(name="gold", density, 1);
|
||||
gold->AddElement (Au, nbelements=1);
|
||||
|
||||
// definition materiau 'iron'
|
||||
// definition material 'iron'
|
||||
density = 7.874*g/cm3;
|
||||
G4Material* iron = new G4Material("iron",density,1);
|
||||
iron->AddElement (Fe,1);
|
||||
|
||||
// definition materiau 'tungsten'
|
||||
// definition material 'tungsten'
|
||||
density =19.250*g/cm3;
|
||||
G4Material* tungsten = new G4Material("tungsten",density,1);
|
||||
tungsten->AddElement(W,1);
|
||||
@ -350,7 +350,7 @@ void LEMuSRDetectorConstruction :: MaterialsDefinition ()
|
||||
graphite->AddElement (C,1);
|
||||
|
||||
|
||||
/***MATERIAUX***/
|
||||
/***MATERIALS***/
|
||||
|
||||
// definition composition of NaI
|
||||
density = 3.67*g/cm3;
|
||||
@ -390,12 +390,12 @@ void LEMuSRDetectorConstruction :: MaterialsDefinition ()
|
||||
saphire->AddElement (Al, nbelements=2);
|
||||
saphire->AddElement (O, nbelements=3);
|
||||
|
||||
//definition materiau 'copper'
|
||||
//definition material 'copper'
|
||||
density = 8.920*g/cm3;
|
||||
G4Material* copper = new G4Material(name="copper", density, 1);
|
||||
copper->AddElement (Cu, nbelements=1);
|
||||
|
||||
// definition materiau 'aluminium'
|
||||
// definition material 'aluminium'
|
||||
density = 2.700*g/cm3;
|
||||
G4Material* aluminium = new G4Material("aluminium",density,1);
|
||||
aluminium->AddElement (Al,1);
|
||||
|
@ -35,12 +35,12 @@
|
||||
LEMuSRParticleGun::LEMuSRParticleGun()
|
||||
{
|
||||
SetInitialValues();
|
||||
Messenger = new G4ParticleGunMessenger(this);
|
||||
theMessenger = new LEMuSRParticleGunMessenger(this);
|
||||
}
|
||||
|
||||
LEMuSRParticleGun::~LEMuSRParticleGun()
|
||||
{
|
||||
delete Messenger;
|
||||
delete theMessenger;
|
||||
}
|
||||
|
||||
void LEMuSRParticleGun::SetInitialValues()
|
||||
|
@ -38,7 +38,6 @@
|
||||
#include "TCanvas.h"
|
||||
|
||||
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
LEMuSRRunAction::LEMuSRRunAction()
|
||||
@ -55,16 +54,25 @@ LEMuSRRunAction::~LEMuSRRunAction()
|
||||
/*! Initializes the user interface manager.*/
|
||||
void LEMuSRRunAction::BeginOfRunAction(const G4Run* aRun)
|
||||
{
|
||||
G4UImanager* UI = G4UImanager::GetUIpointer();
|
||||
G4cout << "### Run " << aRun->GetRunID() << " start." << G4endl;
|
||||
|
||||
G4RunManager::GetRunManager()->SetRandomNumberStore(true);
|
||||
|
||||
if (G4VVisManager::GetConcreteInstance())
|
||||
{
|
||||
G4UImanager* UI = G4UImanager::GetUIpointer();
|
||||
UI->ApplyCommand("/vis/scene/notifyHandlers");
|
||||
}
|
||||
|
||||
//! BUILD THE DETECTOR IN TOTAL GEOMETRY
|
||||
// G4cout<<"WILL REBUILD THE DETECTOR"<<G4endl;
|
||||
// UI->ApplyCommand("/Detector/View total");
|
||||
|
||||
// G4VPhysicalVolume* newDetector = LEMuSRDetectorConstruction::GetInstance()->Construct();
|
||||
// G4RunManager::GetRunManager()->DefineWorldVolume(newDetector);
|
||||
// G4cout<<"DETECTOR BUILT."<<G4endl;
|
||||
|
||||
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
Reference in New Issue
Block a user