Skip to content

Commit

Permalink
Add "system" id to DREndcapTubes subdetector
Browse files Browse the repository at this point in the history
Add "system" id to DREndcapTubes xml file and assign it to the highest
volume in the geometry node. While recreating the volumeID in the
DRTubesSDAction, "system" id is set as in DectDimensions_IDEA_o2_v01.xml
file. In both xml files add a comment on ids to prevent unwanted
modifications.
  • Loading branch information
lopezzot authored and BrieucF committed Dec 6, 2024
1 parent e7a48c4 commit 2e136e3
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 9 deletions.
15 changes: 14 additions & 1 deletion FCCee/IDEA/compact/IDEA_o2_v01/DREndcapTubes_o1_v01.xml
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,21 @@
<segmentation type="CartesianGridXY"
grid_size_x="1*mm"
grid_size_y="1*mm"/>
<!--
Volume ids of this subdetector are defined as "system" for the entire endcap calorimeter,
"stave" for the phi-slices, "tower" for the towers (trapezoids) inside a phi-slice,
"air" dummy for the moment but useful if a tower supporting structure will be added,
"col" and "row" colum and row of tube inside a tower, "clad" "core" "cherenkov"
cladding core volumes and cherenkov identifiers of an optical fiber
-->
<!--
This subdetector is supposed to be used with regexSD, therefore volumeID(aStep) will
not work in the DRTubesSDAction to retrieve the volumeID. Instead we use g4 copynumbers
accessed from the G4Step to recreate the 64-bit volume ID inside DRTubesSDAction.
Do not change these ids, contact the experts (Lorenzo Pezzotti) before any modification.
-->
<!-- NO SPACES BETWEEN ID DESCRIPTORS!!! -->
<id>stave:10,tower:6,air:1,col:16,row:16,clad:1,core:1,cherenkov:1</id>
<id>system:5,stave:10,tower:6,air:1,col:16,row:16,clad:1,core:1,cherenkov:1</id>
</readout>
</readouts>

Expand Down
5 changes: 5 additions & 0 deletions FCCee/IDEA/compact/IDEA_o2_v01/DectDimensions_IDEA_o2_v01.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@


<!-- Dual-Readout Endcap Tubes (DRET) calorimeter DetID-->
<!-- This number is used in DRTubesSDAction to recreate
the volume ids for this subdetector.
Do not change it, contact the experts (Lorenzo Pezzoti)
before any modification.
-->
<constant name="DetID_DREndcapTubes" value=" 25"/>

<constant name="DetID_muonSystem" value=" 26"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,7 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s
Volume motherVolume = description.pickMotherVolume(sdet);
// Place the assembly container inside the mother volume
PlacedVolume AssemblyEndcapPV = motherVolume.placeVolume(AssemblyEndcap);
AssemblyEndcapPV.addPhysVolID("system",x_det.id());
sdet.setPlacement(AssemblyEndcapPV);

std::cout << "--> DREndcapTubes::create_detector() end" << std::endl;
Expand Down
10 changes: 2 additions & 8 deletions plugins/DRTubesSDAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,8 @@ bool Geant4SensitiveAction<DRTubesSDData>::process(const G4Step* aStep,
auto StaveID = static_cast<unsigned int>(aStep->GetPreStepPoint()->GetTouchable()->GetCopyNumber(4));

VolumeID VolID = 0; // recreate the 64-bit VolumeID
BitFieldCoder bc("stave:10,tower:6,air:1,col:16,row:16,clad:1,core:1,cherenkov:1");
BitFieldCoder bc("system:5,stave:10,tower:6,air:1,col:16,row:16,clad:1,core:1,cherenkov:1");
bc.set(VolID, "system", 25); // this number is set in DectDimensions_IDEA_o2_v01.xml
bc.set(VolID, "stave" , StaveID);
bc.set(VolID, "tower" , TowerID);
bc.set(VolID, "air", 0);
Expand All @@ -178,8 +179,6 @@ bool Geant4SensitiveAction<DRTubesSDData>::process(const G4Step* aStep,

if (IsScin) { // it is a scintillating fiber

//m_userData.fEvtAction->AddEdepScin(Edep);

if (aStep->GetTrack()->GetDefinition()->GetPDGCharge() == 0 || steplength == 0.) {
return true; // not ionizing particle
}
Expand All @@ -188,12 +187,9 @@ bool Geant4SensitiveAction<DRTubesSDData>::process(const G4Step* aStep,
DRTubesSglHpr::SmearSSignal(DRTubesSglHpr::ApplyBirks(Edep, steplength));
signalhit = DRTubesSglHpr::AttenuateSSignal(signalhit, distance_to_sipm);
if (signalhit == 0) return true;
//m_userData.fEvtAction->AddSglScin(signalhit);
} // end of scintillating fibre sigal calculation

else { // it is a Cherenkov fiber
// save mc truth info in analysismanager auxiliary outputfile
//m_userData.fEvtAction->AddEdepCher(Edep);
// calculate the signal in terms of Cherenkov photo-electrons
if (aStep->GetTrack()->GetParticleDefinition() == G4OpticalPhoton::Definition()) {
G4OpBoundaryProcessStatus theStatus = Undefined;
Expand Down Expand Up @@ -221,8 +217,6 @@ bool Geant4SensitiveAction<DRTubesSDData>::process(const G4Step* aStep,
G4int c_signal = DRTubesSglHpr::SmearCSignal();
signalhit = DRTubesSglHpr::AttenuateCSignal(c_signal, distance_to_sipm);
if (signalhit == 0) return true;
// save mc truth info in analysismanager auxiliary outputfile
//m_userData.fEvtAction->AddSglCher(signalhit);
aStep->GetTrack()->SetTrackStatus(fStopAndKill);
break;
}
Expand Down

0 comments on commit 2e136e3

Please sign in to comment.