15 TString gasVolumes[3]={
"logicalMdc",
"logicalWorld",
"Cgem_logic"};
16 if(useNCGem_>0) nGas=2;
20 TString IDCVolumes[3]={
"LogicalMdcInnerFilm1",
"logicalMdcSegment2",
"LogicalMdcInnerFilm0"};
21 if(useNCGem_>0) nIDC=0;
25 TString CgemVolumes[114]={
26 "Separator_logic_Al2",
"Separator_logic_CarFib",
"Separator_logic_Al1",
28 "Anode_Cu4_logic2",
"Anode_Kapton6_logic2",
"Anode_Kapton5_logic2",
"Anode_Cu3_logic2",
"Anode_Epoxy5_logic2",
"Anode_Carbonf2_logic2",
"Anode_Epoxy4_logic2",
"Anode_Honeycomb_logic2",
29 "Anode_Epoxy3_logic2",
"Anode_Kapton3_logic2",
"Anode_Epoxy2_logic2",
"Anode_Kapton2_logic2",
"Anode_Epoxy1_logic2",
"Anode_Cu2_logic2",
"Anode_Kapton1_logic2",
"Anode_Cu1_logic2",
31 "GemFoil_Cu2_logic2foil2",
"GemFoil_Kapton_logic2foil2",
"GemFoil_Cu1_logic2foil2",
33 "GemFoil_Cu2_logic2foil1",
"GemFoil_Kapton_logic2foil1",
"GemFoil_Cu1_logic2foil1",
35 "GemFoil_Cu2_logic2foil0",
"GemFoil_Kapton_logic2foil0",
"GemFoil_Cu1_logic2foil0",
37 "Cathode_Cu2_logic2",
"Cathode_Kapton3_logic2",
"Cathode_Epoxy3_logic2",
"Cathode_Kapton2_logic2",
"Cathode_Epoxy2_logic2",
"Cathode_Honeycomb_logic2",
"Cathode_Epoxy1_logic2",
"Cathode_Carbonf_logic2",
"Cathode_Epoxy0_logic2",
39 "Anode_Kapton5_logic1",
"Anode_Cu3_logic1",
"Anode_Epoxy5_logic1",
"Anode_Rohacell2_logic1",
"Anode_Epoxy4_logic1",
"Anode_Kapton4_logic1",
"Anode_Epoxy3_logic1",
40 "Anode_Rohacell1_logic1",
"Anode_Epoxy2_logic1",
"Anode_Kapton2_logic1",
"Anode_Epoxy1_logic1",
"Anode_Cu2_logic1",
"Anode_Kapton1_logic1",
"Anode_Cu1_logic1",
42 "GemFoil_Cu2_logic1foil2",
"GemFoil_Kapton_logic1foil2",
"GemFoil_Cu1_logic1foil2",
44 "GemFoil_Cu2_logic1foil1",
"GemFoil_Kapton_logic1foil1",
"GemFoil_Cu1_logic1foil1",
46 "GemFoil_Cu2_logic1foil0",
"GemFoil_Kapton_logic1foil0",
"GemFoil_Cu1_logic1foil0",
48 "Cathode_Cu2_logic1",
"Cathode_Kapton3_logic1",
"Cathode_Epoxy4_logic1",
"Cathode_Rohacell2_logic1",
"Cathode_Epoxy3_logic1",
"Cathode_Kapton2_logic1",
"Cathode_Epoxy2_logic1",
"Cathode_Rohacell1_logic1",
"Cathode_Epoxy1_logic1",
"Cathode_Kapton1_logic1",
50 "Anode_Kapton5_logic0",
"Anode_Cu3_logic0",
"Anode_Epoxy5_logic0",
"Anode_Carbonf2_logic0",
"Anode_Epoxy4_logic0",
"Anode_Honeycomb_logic0",
"Anode_Epoxy3_logic0",
"Anode_Carbonf1_logic0",
51 "Anode_Epoxy2_logic0",
"Anode_Kapton2_logic0",
"Anode_Epoxy1_logic0",
"Anode_Cu2_logic0",
"Anode_Kapton1_logic0",
"Anode_Cu1_logic0",
53 "GemFoil_Cu2_logic0foil2",
"GemFoil_Kapton_logic0foil2",
"GemFoil_Cu1_logic0foil2",
55 "GemFoil_Cu2_logic0foil1",
"GemFoil_Kapton_logic0foil1",
"GemFoil_Cu1_logic0foil1",
57 "GemFoil_Cu2_logic0foil0",
"GemFoil_Kapton_logic0foil0",
"GemFoil_Cu1_logic0foil0",
59 "Cathode_Cu2_logic0",
"Cathode_Kapton3_logic0",
"Cathode_Epoxy3_logic0",
"Cathode_Kapton2_logic0",
"Cathode_Epoxy2_logic0",
"Cathode_Honeycomb_logic0",
"Cathode_Epoxy1_logic0",
"Cathode_Kapton1_logic0",
"Cathode_Cu1_logic0"
61 if(useNCGem_==0) nCgemVolumes=0;
65 TString beamPipeVolumes[4]={
"logicalouterBe",
"logicaloilLayer",
"logicalinnerBe",
"logicalgoldLayer"};
69 int iV=0;
int nV=nGas+nIDC+nCgemVolumes+nPipeV;
70 cout<<
"KalFitAlg needs to prepare "<<nV<<
" volumes"<<endl;
71 for(
int i=0; i<nGas; i++, iV++) volumes[iV]=gasVolumes[i];
72 for(
int i=0; i<nIDC; i++, iV++) volumes[iV]=IDCVolumes[i];
73 for(
int i=0; i<nCgemVolumes; i++, iV++) volumes[iV]=CgemVolumes[i];
74 for(
int i=0; i<nPipeV; i++, iV++) volumes[iV]=beamPipeVolumes[i];
82 double Z(0.),A(0.),
Ionization(0.),Density(0.),Radlen(0.);
83 for(iV=0; iV<nV; iV++)
85 G4LogicalVolume* logicVolume =
const_cast<G4LogicalVolume*
>(GDMLProcessor::GetInstance()->GetLogicalVolume(volumes[iV]));
86 G4Material* material = logicVolume->GetMaterial();
89 for(
int i=0; i<material->GetElementVector()->size(); i++){
90 Z += (material->GetElement(i)->GetZ())*
91 (material->GetFractionVector()[i]);
92 A += (material->GetElement(i)->GetA())*
93 (material->GetFractionVector()[i]);
95 Ionization = material->GetIonisation()->GetMeanExcitationEnergy();
96 Density = material->GetDensity()/(g/cm3);
97 Radlen = material->GetRadlen();
100 _BesKalmanFitMaterials.push_back(kalFitMaterial);
101 cout<<volumes[iV]<<
": Z: "<<Z<<
", A: "<<(A/(g/mole))<<
", Ionization: "<<(
Ionization/eV)<<
", Density: "<<Density<<
", Radlen: "<<Radlen<<
", as material "<<_BesKalmanFitMaterials.size()<<endl;
105 double lastRmin=-100;
106 double radius, Rmax, thick,
length , z0;
107 for(iV=nGas; iV<nV; iV++)
109 G4LogicalVolume* logicVolume =
const_cast<G4LogicalVolume*
>(GDMLProcessor::GetInstance()->GetLogicalVolume(volumes[iV]));
111 G4Tubs* tub =
dynamic_cast<G4Tubs*
>(logicVolume->GetSolid());
112 radius = tub->GetInnerRadius()/(cm);
113 Rmax = tub->GetOuterRadius()/(cm);
114 thick = tub->GetOuterRadius()/(cm) - tub->GetInnerRadius()/(cm);
115 length = 2.0*tub->GetZHalfLength()/(cm);
117 if(iV>nGas&&lastRmin!=Rmax) {
118 cout<<
" lastRmin!=Rmax from "<<volumes[iV-1]<<
" to "<<volumes[iV]<<std::endl;
119 if(lastRmin-Rmax>0.0001)
122 _BesKalmanFitWalls.push_back(aCylinder);
123 cout<<
" add a cylinder with "<<lastRmin-Rmax<<
" cm air"<<endl;
127 _BesKalmanFitWalls.push_back(aCylinder);
128 std::cout<<volumes[iV]<<
": "<<
"radius outer to inner: "<<radius+thick<<
" "<<radius<<
", length: "<<
length<<std::endl;
129 cout<<
" wall "<<_BesKalmanFitWalls.size()<<
" Z: "<<_BesKalmanFitMaterials[iV].Z()<<endl;