diff --git a/Detector/DetCRD/compact/CRD_common_v01/Lumical_o1_v01.xml b/Detector/DetCRD/compact/CRD_common_v01/Lumical_o1_v01.xml
index e6023ac239a7997ba5ab2f4dda7111a7ee3b0126..4e4b1c63a7fa161bfc0a1de80408cc0893deb1d9 100644
--- a/Detector/DetCRD/compact/CRD_common_v01/Lumical_o1_v01.xml
+++ b/Detector/DetCRD/compact/CRD_common_v01/Lumical_o1_v01.xml
@@ -44,31 +44,31 @@
</slice>
</layer>
<layer name = "Flange">
- <slice type="Tubs" rmin="17.5*mm" rmax="100*mm" z="30*mm" phi1="0*deg" phi2="360*deg" material="stainless_steel" vis="FlangeVis">
+ <slice type="Tubs" rmin="18.5*mm" rmax="100*mm" z="30*mm" phi1="0*deg" phi2="360*deg" material="stainless_steel" vis="FlangeVis">
<position x="0" y="0*mm" z="685*mm"/>
</slice>
- <slice type="Tubs" rmin="17.5*mm" rmax="95*mm" z="20*mm" phi1="0*deg" phi2="360*deg" material="stainless_steel" vis="LumicalFlangeVis">
+ <slice type="Tubs" rmin="18.5*mm" rmax="95*mm" z="20*mm" phi1="0*deg" phi2="360*deg" material="stainless_steel" vis="LumicalFlangeVis">
<position x="0" y="0*mm" z="710*mm"/>
</slice>
- <slice type="Tubs" rmin="17.5*mm" rmax="98*mm" z="20*mm" phi1="0*deg" phi2="360*deg" material="stainless_steel" vis="LumicalFlangeVis">
+ <slice type="Tubs" rmin="18.5*mm" rmax="98*mm" z="20*mm" phi1="0*deg" phi2="360*deg" material="stainless_steel" vis="LumicalFlangeVis">
<position x="0" y="0*mm" z="730*mm"/>
</slice>
- <slice type="Tubs" rmin="17.5*mm" rmax="95*mm" z="1*mm" phi1="0*deg" phi2="360*deg" material="stainless_steel" vis="LumicalFlangeVis">
+ <slice type="Tubs" rmin="18.5*mm" rmax="95*mm" z="1*mm" phi1="0*deg" phi2="360*deg" material="stainless_steel" vis="LumicalFlangeVis">
<position x="0" y="0*mm" z="750*mm"/>
</slice>
- <slice type="Tubs" rmin="17.5*mm" rmax="95*mm" z="1*mm" phi1="0*deg" phi2="360*deg" material="stainless_steel" vis="LumicalFlangeVis">
+ <slice type="Tubs" rmin="18.5*mm" rmax="95*mm" z="1*mm" phi1="0*deg" phi2="360*deg" material="stainless_steel" vis="LumicalFlangeVis">
<position x="0" y="0*mm" z="755*mm"/>
</slice>
- <slice type="Tubs" rmin="17.5*mm" rmax="95*mm" z="1*mm" phi1="0*deg" phi2="360*deg" material="stainless_steel" vis="LumicalFlangeVis">
+ <slice type="Tubs" rmin="18.5*mm" rmax="95*mm" z="1*mm" phi1="0*deg" phi2="360*deg" material="stainless_steel" vis="LumicalFlangeVis">
<position x="0" y="0*mm" z="760*mm"/>
</slice>
- <slice type="Tubs" rmin="17.5*mm" rmax="95*mm" z="1*mm" phi1="0*deg" phi2="360*deg" material="stainless_steel" vis="LumicalFlangeVis">
+ <slice type="Tubs" rmin="18.5*mm" rmax="95*mm" z="1*mm" phi1="0*deg" phi2="360*deg" material="stainless_steel" vis="LumicalFlangeVis">
<position x="0" y="0*mm" z="765*mm"/>
</slice>
- <slice type="Tubs" rmin="17.5*mm" rmax="95*mm" z="1*mm" phi1="0*deg" phi2="360*deg" material="stainless_steel" vis="LumicalFlangeVis">
+ <slice type="Tubs" rmin="18.5*mm" rmax="95*mm" z="1*mm" phi1="0*deg" phi2="360*deg" material="stainless_steel" vis="LumicalFlangeVis">
<position x="0" y="0*mm" z="770*mm"/>
</slice>
- <slice type="Tubs" rmin="17.5*mm" rmax="95*mm" z="1*mm" phi1="0*deg" phi2="360*deg" material="stainless_steel" vis="LumicalFlangeVis">
+ <slice type="Tubs" rmin="18.5*mm" rmax="95*mm" z="1*mm" phi1="0*deg" phi2="360*deg" material="stainless_steel" vis="LumicalFlangeVis">
<position x="0" y="0*mm" z="775*mm"/>
</slice>
</layer>
@@ -79,18 +79,12 @@
</slice>
</layer>
<layer name = "LYSO_2nd">
- <slice dx="10*mm" dy="10*mm" dz="200*mm" material="LYSO" vis="GrayVis" sensitive="yes" limits="5*mm">
- <position x="0" y="-12*mm" z="1000*mm"/>
+ <slice dx="10*mm" dy="10*mm" dz="150*mm" material="LYSO" vis="GrayVis" sensitive="yes" limits="5*mm">
+ <position x="0" y="-12*mm" z="875*mm"/>
<rotation x="0" y="0" z="0" />
</slice>
</layer>
- <layer name = "LYSO_out_W">
- <slice dx = "10*mm" dy="10*mm" dz="200*mm" material="G4_W" vis="LumicalFlangeVis"
- sensitive = "no" limits = "5*mm">
- <position x="0" y="-12" z="1000*mm"/>
- <rotation x="0" y="0" z="0"/>
- </slice>
- </layer>
+
</detector>
diff --git a/Detector/DetCRD/src/Calorimeter/Lumical_v01_geo.cpp b/Detector/DetCRD/src/Calorimeter/Lumical_v01_geo.cpp
index 0e5ca69680263dbcb1db524cd24c2aab99f9d306..d510b940c7b5affedbbd26599a6239d3bdd584e8 100644
--- a/Detector/DetCRD/src/Calorimeter/Lumical_v01_geo.cpp
+++ b/Detector/DetCRD/src/Calorimeter/Lumical_v01_geo.cpp
@@ -51,13 +51,11 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s
int loop = 0;
xml_coll_t LYSO_layer(x_det,_U(layer));
xml_coll_t second_LYSO_layer(x_det,_U(layer));
- xml_coll_t W_LYSO_layer(x_det,_U(layer));
for(xml_coll_t c(x_det,_U(layer));c;c++){
if(loop == 3){LYSO_layer = c;}
else if(loop == 4){second_LYSO_layer=c;
+ break;
}
- else if(loop ==5){W_LYSO_layer =c;
- break;}
loop++;
}
//get the define information of the first LYSO crystal
@@ -181,11 +179,6 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s
//loop in order to build symmetry geo
for(int kz=1;kz>=-1;kz-=2){
- dd4hep::PrintLevel printLevel = dd4hep::ERROR;
- if (x_det.hasAttr(_Unicode(printLevel))) {
- printLevel = dd4hep::printLevel(x_det.attr<std::string>(_Unicode(printLevel)));
- }
-
/////////////////////////////////////////////////////////////////
//build Disk and flange
std::vector<double> cellSizeVector = seg.cellDimensions( encoder.getValue() ); //Assume uniform cell sizes, provide dummy cellID
@@ -219,8 +212,13 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s
PlacedVolume slice_phv = envelope.placeVolume(slice_vol,Position(0*mm,0*mm,kz*x_slice.position().z()));
slice_phv.addPhysVolID("side",kz).addPhysVolID("module",4).addPhysVolID("layer",0 ).addPhysVolID("slice",layer_num);
if(ky==1 && kz==1){
-
+ dd4hep::PrintLevel printLevel = dd4hep::ERROR;
+ if (x_det.hasAttr(_Unicode(printLevel))) {
+ printLevel = dd4hep::printLevel(x_det.attr<std::string>(_Unicode(printLevel)));
+ }
+ dd4hep::PrintLevel oldLevel = dd4hep::setPrintLevel(printLevel);
dd4hep::printout(dd4hep::INFO, "Construct", "Flange ->layer: r0 = %f r1 = %f mat = %s", x_slice.rmin()/dd4hep::mm, x_slice.rmax()/dd4hep::mm,"stainless_steel");
+ dd4hep::setPrintLevel(oldLevel);
}
slice.setPlacement(slice_phv);
@@ -241,10 +239,15 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s
slice_vol.setVisAttributes(description,x_slice.visStr());
PlacedVolume slice_phv = envelope.placeVolume(slice_vol,Position(x_slice.position().x(),ky*x_slice.position().y(),kz*x_slice.position().z()));
slice_phv.addPhysVolID("side",kz).addPhysVolID("stave",ky).addPhysVolID("module",l+1).addPhysVolID("layer",layer_num ).addPhysVolID("slice",slice_number);
-
+ std::cout<<"l + 1 = "<<l+1<<"\n";
if(ky==1 && kz==1){
-
+ dd4hep::PrintLevel printLevel = dd4hep::ERROR;
+ if (x_det.hasAttr(_Unicode(printLevel))) {
+ printLevel = dd4hep::printLevel(x_det.attr<std::string>(_Unicode(printLevel)));
+ }
+ dd4hep::PrintLevel oldLevel = dd4hep::setPrintLevel(printLevel);
dd4hep::printout(dd4hep::INFO, "Construct", "Disk ->layer: y0 = %f y1 = %f mat = %s", (x_slice.position().y()-x_slice.dy()/2)/dd4hep::mm, (x_slice.position().y()+x_slice.dy()/2)/dd4hep::mm, "G4_Si");
+ dd4hep::setPrintLevel(oldLevel);
}
slice.setPlacement(slice_phv);
@@ -266,8 +269,13 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s
slice_phv.addPhysVolID("side",kz).addPhysVolID("stave",ky).addPhysVolID("module",l+1).addPhysVolID("layer",layer_num ).addPhysVolID("slice",slice_number);
slice.setPlacement(slice_phv);
if(ky==1 && kz==1){
-
+ dd4hep::PrintLevel printLevel = dd4hep::ERROR;
+ if (x_det.hasAttr(_Unicode(printLevel))) {
+ printLevel = dd4hep::printLevel(x_det.attr<std::string>(_Unicode(printLevel)));
+ }
+ dd4hep::PrintLevel oldLevel = dd4hep::setPrintLevel(printLevel);
dd4hep::printout(dd4hep::INFO, "Construct", "Disk ->layer: r0 = %f r1 = %f mat = %s", (x_slice.position().y())/dd4hep::mm, (x_slice.position().y()+x_slice.rmax())/dd4hep::mm, "G4_Si");
+ dd4hep::setPrintLevel(oldLevel);
}
slice_number++;
@@ -355,8 +363,13 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s
}
}
if(ky==-1 && kz==1){
-
+ dd4hep::PrintLevel printLevel = dd4hep::ERROR;
+ if (x_det.hasAttr(_Unicode(printLevel))) {
+ printLevel = dd4hep::printLevel(x_det.attr<std::string>(_Unicode(printLevel)));
+ }
+ dd4hep::PrintLevel oldLevel = dd4hep::setPrintLevel(printLevel);
dd4hep::printout(dd4hep::INFO, "Construct", "1st_LYSO ->layer %d : crystal number =%d y = %f x0 = %f x1 =%f mat = %s",(i+1),crystal_id,ky*(y - 0.5*dy-i * dy)/dd4hep::mm, (x-half*dx)/dd4hep::mm,(x+half*dx)/dd4hep::mm, "LYSO");
+ dd4hep::setPrintLevel(oldLevel);
}
}
@@ -374,9 +387,6 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s
double y2 = pos_second.y();
double z2 = pos_second.z();
- xml_coll_t W_second(W_LYSO_layer,_U(slice));
- xml_comp_t component_W = W_second;
- Material mat_W = description.material(component_W.materialStr());
for(int ky=-1;ky<=1;ky=ky+2) {
string module_name = _toString(5,"_module%d")+_toString(ky,"_stave%d");
@@ -389,16 +399,13 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s
double yc =12.0+ dy2/mm * (i+1);
double xc = dx2 / mm;
num = (int) 2 * ((std::sqrt(100.0*100.0 - yc * yc) / xc) - 1);
- int num_W = (int) 2 * ((std::sqrt(120.0*120.0 - yc * yc) / xc) - 1);
string layer_name = det_name+ module_name+_toString(kz*(i+1),"_layer%d");
int j = 0;
- int half = 0,tot_half=0;
+ int half = 0;
if (num % 2 == 1) {
half = (num - 1) / 2;
- tot_half = (num_W - 1)/2;
- j = -tot_half;
- while (j <= tot_half) {
- if(j>=-half&&j<=half){
+ j = -half;
+ while (j <= half) {
string crystal_name = layer_name +_toString(crystal_id,"_slice%d");
DetElement crystalDE(layer_name, _toString(crystal_num,"_slice%d"), x_det.id());
Box crystalBox(0.5*dx2, 0.5*dy2, 0.5*dz2);
@@ -417,33 +424,11 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s
j++;
crystal_id++;
crystal_num++;
- }
- else{
- string crystal_name = layer_name +_toString(crystal_id,"_slice%d");
- DetElement crystalDE(layer_name, _toString(crystal_num,"_slice%d"), x_det.id());
- Box crystalBox(0.5*dx2, 0.5*dy2, 0.5*dz2);
- Volume crystalVol(crystal_name, crystalBox, mat_W);
-
- crystalVol.setVisAttributes(description, component_W.visStr());
-
- Transform3D transform(RotationZYX(0, 0, 0), Translation3D(x2 + j * dx2, ky*(y2 -0.5*dy2- i * dy2), kz*z2));
- PlacedVolume LYSO_phv =envelope.placeVolume(crystalVol, transform);
-
- if (x_det.hasAttr(_U(id))) LYSO_phv.addPhysVolID("system", x_det.id());
- LYSO_phv.addPhysVolID("side",kz).addPhysVolID("stave",ky).addPhysVolID("module",6).addPhysVolID("layer",i+1 ).addPhysVolID("slice",crystal_id);
-
- crystalDE.setPlacement(LYSO_phv);
- j++;
- crystal_id++;
- crystal_num++;
- }
}
} else {
half = num / 2;
- tot_half = num_W/2;
- j = -tot_half;
- while (j < tot_half) {
- if(j>=-half&&j<half){
+ j = -half;
+ while (j < half) {
string crystal_name = layer_name +_toString(crystal_id,"_slice%d");
DetElement crystalDE(layer_name, _toString(crystal_num,"_slice%d"), x_det.id());
Box crystalBox(0.5*dx2, 0.5*dy2, 0.5*dz2);
@@ -462,38 +447,20 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s
j++;
crystal_id++;
crystal_num++;
- }
- else{
- string crystal_name = layer_name +_toString(crystal_id,"_slice%d");
- DetElement crystalDE(layer_name, _toString(crystal_num,"_slice%d"), x_det.id());
- Box crystalBox(0.5*dx2, 0.5*dy2, 0.5*dz2);
- Volume crystalVol(crystal_name, crystalBox, mat_W);
-
- crystalVol.setVisAttributes(description, component_W.visStr());
-
- Transform3D transform(RotationZYX(0, 0, 0), Translation3D(x2 + j * dx2, ky*(y2 -0.5*dy2- i * dy2), kz*z2));
- PlacedVolume LYSO_phv =envelope.placeVolume(crystalVol, transform);
-
- if (x_det.hasAttr(_U(id))) LYSO_phv.addPhysVolID("system", x_det.id());
- LYSO_phv.addPhysVolID("side",kz).addPhysVolID("stave",ky).addPhysVolID("module",6).addPhysVolID("layer",i+1 ).addPhysVolID("slice",crystal_id);
-
- crystalDE.setPlacement(LYSO_phv);
- j++;
- crystal_id++;
- crystal_num++;
- }
+
}
}
if(ky==1 && kz==1){
-
- dd4hep::printout(dd4hep::INFO, "Construct", "2nd_LYSO ->layer %d : crystal number =%d y = %f x_W_0 = %f x0 = %f x1 =%f x_W_1=%f mat_1 = %s mat_2 = %s",i+1,crystal_id,ky*(y2 - 0.5*dy2-i * dy2)/dd4hep::mm,(x2-tot_half*dx2)/dd4hep::mm, (x2-half*dx2)/dd4hep::mm,(x2+half*dx2)/dd4hep::mm,(x2+tot_half*dx2)/dd4hep::mm, "LYSO","G4_W");
+ dd4hep::PrintLevel printLevel = dd4hep::ERROR;
+ if (x_det.hasAttr(_Unicode(printLevel))) {
+ printLevel = dd4hep::printLevel(x_det.attr<std::string>(_Unicode(printLevel)));
+ }
+ dd4hep::PrintLevel oldLevel = dd4hep::setPrintLevel(printLevel);
+ dd4hep::printout(dd4hep::INFO, "Construct", "2nd_LYSO ->layer %d : crystal number =%d y = %f x0 = %f x1 =%f mat = %s",i+1,crystal_id,ky*(y2 - 0.5*dy2-i * dy2)/dd4hep::mm, (x2-half*dx2)/dd4hep::mm,(x2+half*dx2)/dd4hep::mm, "LYSO");
+ dd4hep::setPrintLevel(oldLevel);
}
}
}
- dd4hep::PrintLevel oldLevel = dd4hep::setPrintLevel(printLevel);
-
- dd4hep::setPrintLevel(oldLevel);
-
}
cal.addExtension< LayeredCalorimeterData >( caloData ) ;
return cal;