Skip to content

12-Sector CyMBaL - #1146

Open
ybedfer wants to merge 16 commits into
mainfrom
12-Sector-CyMBaL
Open

ybedfer wants to merge 16 commits into
mainfrom
12-Sector-CyMBaL

Conversation

@ybedfer

@ybedfer ybedfer commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

Briefly, what does this PR introduce? Please link to any relevant presentations or discussions.

12-Sector CyMBaL, aiming at simplifying maintenance, see e.g. "https://indico.bnl.gov/event/28403"

What is the urgency of this PR?

  • [*] Medium

What kind of change does this PR introduce?

  • [* ] New feature (no related issue ever created)

Please check if any of the following apply

None

ybedfer added 4 commits July 23, 2026 15:16
- One and only one model of stave, thanks to the fish scale layout.
- New, more realistic, stack-up (and more colors for its display).
- No <service> any more (will have to be re-introduced).
- Both phi and Z pitches were bugged.
- Resolutions are added, as <constant>'s.
- "PCB" tag for module parameters, instead of "Active", to underline the presence of DeadZone.
@github-actions github-actions Bot added topic: tracking topic: barrel Mid-rapidity detectors topic: forward Positive-rapidity detectors (hadron-going side) labels Aug 5, 2026
@ybedfer

ybedfer commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor Author

This is the second one of the series of PRs meant to commit a 12-sector version of CyMBaL.
Needs EICrecon PR #2829 "eic/EICrecon#2829".

The 12-sector layout has a fish scale structure that allows to have a unique model of module in all four sections along Z.
=> This greatly simplifies the design of the XML and detector builder, which are hence completely reshuffled.

Here is a picture of the layout, w/ its 12 sectors.:
12SCyMBaL layout
(There are two distinct sets of 12 sectors in the above picture: they correspond to the projections of the inner and outer Z-sections, the latter being shifted outwards along the bisector of the sectors, so that the sections do not overlap.)

The new version has a more detailed and realistic specification of the stack-up. It's based on the following list parameters (provided by Damien Neyret):

 [stack-up Geico_v7.pdf](https://github.com/user-attachments/files/30742247/stack-up.Geico_v7.pdf)

  // parameters
  ZActiveX = 340; ZActiveY = 590;  // size of active area
  nbStrX = 192, nbStrY = 576; // nb de voies
  pitchX = 1.766; pitchY = 1.021;  // pitch en X et Y
  sizeStrX = 0.7; sizeStrY = 0.9;  // taille de l'aperture des pistes, carré size X size
  gapEndStrip = 1; // gap between end of strips and side of active area

 Il y a aussi le quadrillage de masse au-dessus de la dérive mais c'est assez peu dense, pitch 
2,4mm avec des pistes de 200µm de large (dans les 2 directions U et V). A ce moment il y a 
aussi le quadrillage de masse sur le plancher, pitch 800µm et pistes de 200µm dans les 2 
sens.

The new stack-up contains more material than the previous version. See the following plot of %X0 as a function of θ, where new is red and old is blue:
12SCyMBaL vs 8S material budget
(Note that in the new version the services to the inner section are not included: explains why on the edge, red lies below blue.)

Below plots of the distributions of SimHit and RecHit-SimHit residuals:
12SCyMBaL SimHits
12SCyMBaL Residuals
(They can be compared to those attached to PR #2829 of EICrecon ("eic/EICrecon#2829"), obtained w/ the older, 8-sector version. => in particular, the new resolutions, which differ in φ (=260 μm) and Z (=150 μm) and the new overlaps along both φ and Z are found to be wider: they stick out more, in black, over the rest of the distributions. The resolutions are defined as constants in the XML, from where they are converted into configuration parameters by the MPGD plugin. This, if available, default being 150 μm.)

Another feature of the new version is the DeadZone lining the PCB on all four sides. Here is a picture of the resulting RecHit distribution:
12SCyMBaL DeadZone
=> The region devoid of hits corresponds to the distance between the edge of the PCB and the centre of the closest strip = 1 mm of DeadZone + half-strip width. This, because digitization cannot but make so that hits w/in the corresponding half-pitch have a cluster size of 1 and all sit at the centre of the strip. The first non empty bin of the histogram has about the same content as the rest, despite its narrow width (of a half-pitch), as expected for an approximately uniform distribution of incoming SimHit. hasDeadZone is yet another configuration parameter, which is set = true for CyMBaL by the MPGD plugin, and hence also modifies, very slightly, the working of the 8-sector CyMBaL.

@ybedfer

ybedfer commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

stack-up Geico_v7.pdf

@ybedfer

ybedfer commented Aug 7, 2026 •

Copy link
Copy Markdown
Contributor Author

Hit-to-Track association (barrel MPGDs are subdivided in 'p', 'n' and 'p&n' sub-bins, 'p' being 'φ' or 'U' and 'n' being 'Z' or 'V'):
Hit Association 12SCyMBaL

Association Efficiency 12SCyMBaL

=> The association efficiency of 12SCyMBaL looks reasonable: it's as good as that of the Outer MPGD, slightly worse still than that of the rest of the barrel trackers.

R vs Z 12SCyMBaL

=> CyMBaL, which is the next to most outward detector (on this picture there is no TOF), displays a discontinuity in radius when one moves from the outer Z-sections to the inner ones: this translates the outward shift applied to the outer sections mentioned supra (the actual radius of curvature is the same for all sections).

(Note that I have had to edit the hit_matching macro (see "https://github.com/eic/snippets/blob/main/Tracking/TrackHitContributions/hit_matching.C") to get the above plots. This, because for some reason, I do not get TOF RecHit from my execution of eicrecon. Here is the patch:

diff --git a/Tracking/TrackHitContributions/hit_matching.C b/Tracking/TrackHitContributions/hit_matching.C
index 1009dfc..2ae4f74 100644
--- a/Tracking/TrackHitContributions/hit_matching.C
+++ b/Tracking/TrackHitContributions/hit_matching.C
@@ -262,3 +262,9 @@ void hit_matching(int verbose = 0, int nEvtMx = 0){
        //...making room for two indices for the 2DStrip MPGDs.
+#define EXCLUDE_TOF
+       // if "TOFBarrelRecHits" and "TOFEndcapRecHits" are absent.
+#ifdef EXCLUDE_TOF
+       size_t nRecColls = 7;
+#else
        size_t nRecColls = rec_coll_names.size();
+#endif
        for (size_t i = 0; i < nRecColls; i++) {
@@ -463,3 +469,8 @@ void hit_matching(int verbose = 0, int nEvtMx = 0){
                        cout<<"Number of SimHit collections = "<<sim_coll_names.size()<<endl;
-               for(int icoll = 0; icoll < (int)sim_coll_names.size(); icoll++){
+#ifdef EXCLUDE_TOF
+               size_t nSimColls = 7;
+#else
+               size_t nSimColls = sim_coll_names.size();
+#endif
+               for(int icoll = 0; icoll < (int)nSimColls; icoll++){
                        //SimHits
@@ -511,3 +522,3 @@ void hit_matching(int verbose = 0, int nEvtMx = 0){
                }
-               for(int icoll = 0; icoll < (int)rec_coll_names.size(); icoll++){
+               for(int icoll = 0; icoll < (int)nRecColls; icoll++){
                        //RecHits
@@ -612,3 +623,7 @@ void hit_matching(int verbose = 0, int nEvtMx = 0){
                //Loop over Measurement2D hits (independent of track reconstruction)
+#ifdef EXCLUDE_TOF
+               auto& meas2d_coll = f.get<edm4eic::Measurement2DCollection>("CentralWithoutTOFTrackerMeasurements");
+#else
                auto& meas2d_coll = f.get<edm4eic::Measurement2DCollection>("CentralTrackerMeasurements");
+#endif
                //Book keeping of MPGD strip hits.

And I removed TOF from my epic_craterlake_tracking_2DStrip configuration.)

@ybedfer

ybedfer commented Sep 30, 2026

Copy link
Copy Markdown
Contributor Author

@veprbl
There is a problem w/ 12-Sector CyMBaL, see (on Mattermost) "https://chat.epic-eic.org/main/pl/my9fecsj3j8mmpepsewd3nzdgy".

@veprbl

veprbl commented Sep 30, 2026

Copy link
Copy Markdown
Member

@ybedfer Thanks for the pointer. I'll look into that.

@veprbl

veprbl commented Sep 30, 2026

Copy link
Copy Markdown
Member

(I did see it originally, but need to get to it)

@ybedfer

ybedfer commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor Author

@veprbl
I've had several ideas:

  • Could it be my use of mirror reflection? It's not.
  • Could it be my use of materials defined in the detector's XML, as opposed to compact/materials.xml? It's not.
  • Could it be my use of materials not present in the material map? Not yet tested. But if it turns out to be the origin of the crash, then I would need to produce a dedicated material map. Which, for some reason, I am not able to do at present...
    ...But in fact, it's not that either...
    ...and now the material map production script seems to be working again: I just launched a production, dedicated to 12-Sector.

@ybedfer

ybedfer commented Oct 1, 2026

Copy link
Copy Markdown
Contributor Author

@veprbl
Hello,
When I execute the material map script on the 12-Sector, I get the following
crash:

Error in <TGeoVoxelFinder::SortAll>: Wrong bounding box for volume envelope26
Traceback (most recent call last):
  File "/local/home/bedfer/eicA/epicAug/scripts/material_map/material_validation_epic.py", line 66, in <module>
    detector = epic.getDetector(args.xmlFile, matFile)
  File "/local/home/bedfer/eicA/epicAug/scripts/material_map/epic.py", line 40, in getDetector
    detector = acts.examples.dd4hep.DD4hepDetector(dd4hepConfig)
  File "/opt/local/python/acts/_adapter.py", line 14, in wrapped
    fn(self, maybe_config, *args[1:], **kwargs)
    ~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: Surface::assignSurfaceMaterial: material axis directions {AxisPhi, AxisZ} are not supported by this surface. Supported axes are: {AxisR, AxisPhi}

Note that the error concerning is always there, even w/ the epic from the eic-shell: it must have nothing to do w/ the crash.

@veprbl

veprbl commented Oct 7, 2026

Copy link
Copy Markdown
Member

This last clue makes sense. If you change the geometry significantly, it won't load together with the current material map. But that's what run_material_map_validation.sh does. You may want to take out everything related to "current" and just keep "regenerated". But I'd also like to understand what about your changes that makes it so different.

@ybedfer

ybedfer commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor Author

I have to admit that I am completely lost.
Here are some remarks/questions which I came by in my investigations.

This last clue makes sense. If you change the geometry significantly, it won't load together with the current material map. But that's what run_material_map_validation.sh does.

I am not sure I understand. Do you mean that run_material_map_validation.sh also loads current material map? And that the (possible) inconsistency of that map w/ the new geometry (the one pointed to by $DETECTOR_CONFIG, that is) is not only the reason for the error in the execution of eicrecon but also for that of run_material_map_validation.sh?
So that we have a catch 22: to produce a material map compatible w/ the new geometry we need a material map... compatible w/ the new geometry!

You may want to take out everything related to "current" and just keep "regenerated".

I don't get how I can do this. How can take out "current"? And to do what?

But I'd also like to understand what about your changes that makes it so different.

I have spent an entire week, if not more, trying to understand precisely this. I listed supra all the changes I made to the 12-Sector geometry. In addition, I also removed the "tilt" (that "tilt" that gives rise to the fish-scale structure), so that I got a visual aspect very similar to the 8-Sector version: to no avail. The only way I could get rid of the

[] [acts] [error] Error during DD4Hep -> ACTS geometry conversion: Surface::assignSurfaceMaterial: material axis directions {AxisPhi, AxisZ} are not supported by this surface. Supported axes are: {AxisR, AxisPhi}

error was to fully go back to the 8-Sector epic.

It could also be that I forget some requisite action (setting detector's flag or the like) in the detector builder. But I checked my source code several times and could not find...

Something that I wanted to try, but could not, is to produce a material map w/out CyMBaL, removing mpgd_barrel.xml from my configuration (both from epic.xml and epic_craterlake_tracking_only.xml). I still get the above two errors, in the execution of eicrecon and run_material_map_validation.sh. I don't get where eicrecon (and hence acts) gets its list of detectors from. To
make this clearer: when I exclude mpgd_barrel.xml, I still get the following log (of eicrecon):

[] [acts] [info] CONV           Translating DD4hep geometry into Acts geometry
[] [acts] [info] CONV           Translating DD4hep sub detector: acts_beampipe_central
 [...]
[] [acts] [info] CONV           Translating DD4hep sub detector: InnerMPGDBarrelSubAssembly
 [...]
[] [acts] [info] CONV           Translating DD4hep sub detector: B0TrackerSubAssembly

And then:

[] [acts] [info] D2A_V:InnerM   No layers present, returning nullptr
20:22:47    TrackingGeom   INFO      Received nullptr volume from builder, keeping previous highest volume

And then the error about material axis directions.

@veprbl

veprbl commented Oct 7, 2026

Copy link
Copy Markdown
Member

run_material_map_validation.sh is a shell script which implements effectively two parallel processes. Consider these two lines:

python material_validation_epic.py --xmlFile ${DETECTOR_PATH}/${DETECTOR_CONFIG}.xml --outputName ${propFile}_regenerated --matFileBase ${matFileBase}_map -n ${nevents} -t ${nparticles}
python material_validation_epic.py --xmlFile ${DETECTOR_PATH}/${DETECTOR_CONFIG}.xml --outputName ${propFile}_current --matFileBase calibrations/materials-map -n ${nevents} -t ${nparticles}

One operates on ${matFileBase}_map which is also the material map that it produces earlier in the same script. The other looks at calibrations/materials-map that is not a material map that is produced by the script, that file is downloaded from current calibrations. Processing of later is not critical for your work, you can comment those lines out and just leave the lines that you need. You should still get your new material map, just not some of the other debugging plots.

@ybedfer

ybedfer commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor Author

you can comment those lines out and just leave the lines that you need. You should still get your new material map, just not some of the other debugging plots.

I did that. I think I did it correctly.
Then, I don't get any .cbor or .json output. The only material map I get is a ROOT file: material-map_map.root.
When I feed this ROOT file to the -Pacts:MaterialMap= option of eicrecon, I don't get any track. No error in the log.

@ybedfer

ybedfer commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

@veprbl
Hello again,
I tried to produce a material map, with this time, everything from main branch and command as from the readme:

./run_material_map_validation.sh --nevents 1000 --nparticles 5000

=> No .cbor nor json output.

Then, as I remembered having read that .cbor was no longer provided for (and this is also what I can conclude from reading the source code). Therefore, I modified the source to enforce .json:

diff --git a/scripts/material_map/run_material_map_validation.sh b/scripts/material_map/run_material_map_validation.sh
index 6814dbb8e..c4ab0a817 100755
--- a/scripts/material_map/run_material_map_validation.sh
+++ b/scripts/material_map/run_material_map_validation.sh
@@ -148 +148 @@ matFileBase="${prefix}material-map${suffix}"
-matFileFormats="cbor root"  # Generate both CBOR and ROOT output formats
+matFileFormats="json root"  # Generate both CBOR and ROOT output formats

=> Same outcome: no .json output.

@veprbl

veprbl commented Oct 9, 2026

Copy link
Copy Markdown
Member

I was told CBOR was fixed. I will try running it now.

@veprbl

veprbl commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

@ybedfer I think you found a bug. Can you try:

- matFormatArgs=$(echo ${matFileFormats} | sed 's/\([^ ]*\)/--matFileFormat \1/g')                                                              
+ matFormatArgs="--matFileFormat ${matFileFormats}"                                                                                             

filed under #1193

@ybedfer

ybedfer commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor Author

I think you found a bug. Can you try:

- matFormatArgs=$(echo ${matFileFormats} | sed 's/\([^ ]*\)/--matFileFormat \1/g')                                                              
+ matFormatArgs="--matFileFormat ${matFileFormats}"                                                                                             

Yes. It definitely improves the situation.
I can now produce .cbor material maps, in epic main and in my 12-Sector-CyMBaL branch. And reconstruct tracks w/ them.
I don't know yet whether it fixes all of my problems: haven't yet seen decent RecHit-SimHit residuals nor tried any 2DStrip reconstruction.

…12-Sector-CyMBaL.

- This alternative file is meant to exist only temporary, until 12-Sector-CyMBaL is committed.
- It will allow github checks to succeed for the PR of epic (this, once EICrecon PR is accepted).
@ybedfer

ybedfer commented Oct 22, 2026

Copy link
Copy Markdown
Contributor Author

Now that I have committed the link to the material map dedicated to 12-Sector-CyMBaL (see commit #e3eee5be1: "e3eee5b"), the eicrecon checks should work (except for those involving 2DStrip, which in addition require PR #2829 of EICrecon, "eic/EICrecon#2829"). I don't understand why some don't.

@veprbl

This comment was marked as resolved.

Comment thread compact/tracking/mpgd_barrel.xml Resolved
Comment thread compact/tracking/mpgd_barrel.xml Resolved
@ybedfer

ybedfer commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor Author

Commit #5c6769693 (5c6769693") does have an impact (for the worse) on the % of X0. See picture of %X0 as a f(θ):
12SCyMBaL matBudget full vs fracCu
where red is BEFORE (just as in the picture supra) and magenta is AFTER.

@veprbl

veprbl commented Oct 26, 2026

Copy link
Copy Markdown
Member

And that makes sense - the overall Cu mass is now not scaled twice.

@eic eic deleted a comment from github-actions Bot Oct 30, 2026
@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

tom-bleher pushed a commit to tom-bleher/EICrecon that referenced this pull request Nov 1, 2026
### Briefly, what does this PR introduce? Please link to any relevant
presentations or discussions.
New version of MPGD plugin and digitization compatible w/ upcoming
12-Sector-CyMBaL (see eic/epic#1146).

### What is the urgency of this PR?
- [ *] Medium

### What kind of change does this PR introduce?
- [* ] New feature (no related issue ever created)

### Please check if any of the following apply
None.

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: epic-capybara <139920704+epic-capybara@users.noreply.github.com>
Co-authored-by: Dmitry Kalinkin <dmitry.kalinkin@gmail.com>

This branch was previously deployed

1 inactive deployment
github-pages — ec8ee475 Deployed Nov 2, 2026 by veprbl via deploy-artifacts-page #6204
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

topic: barrel Mid-rapidity detectors topic: forward Positive-rapidity detectors (hadron-going side) topic: tracking

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants