DUTAssociation and AlignmentDUTResidual don't run?

Hi!

I am trying to test the Prealignment and AlignmentDUTResidual modules with a simulated set (using Allpix2). While the prealignment seems to do a good job, trying to run the AlignmentDUTResidual in a second job afterwards with the updated geometry file as input doesn’t seem to do anything. I am probably either missing a needed module or am making some mistake in the scheduling of the modules, but hope you can tell me what goes wrong.

I am running prealignment with

[Corryvreckan]
detectors_file = "corryvreckanGeometry.conf"
detectors_file_updated = "prealign_lgad.geo"
histogram_file = "prealign_lgad.root"
[FileReader]
file_name = "allpix2_sim.root"
include = "Event", "Pixel", "MCParticle"
[ClusteringSpatial]
[Correlations]
[Prealignment]
type = "LGAD"
log_level = INFO
max_correlation_rms = 6.0
damping_factor = 1.0

Which runs fine, the updated geometry makes sense.
I am then trying to refine the alignment with

[Corryvreckan]
detectors_file = "prealign_lgad.geo"
detectors_file_updated = "align_lgad.geo"
histogram_file = "align_lgad.root"
[FileReader]
file_name = "allpix2_sim.root"
include = "Event", "Pixel", "MCParticle"
[ClusteringSpatial]
[TrackingSpatial]
spatial_cut_rel = 5.0
min_hits_on_track = 10
exclude_dut = true
track_model = "straightline"
[DUTAssociation]
log_level = INFO
spatial_cut_rel = 5.0
[AlignmentDUTResidual]
log_level = INFO

But it seems to me like after tracking no other modules are run? Also the detectors_file_updated is an unchanged copy of the previous version

|19:06:47.115|  (STATUS) ===============| Wall-clock timing (seconds) |================
|19:06:47.115|  (STATUS)           FileReader               --  2.01017s = 0.207813ms/evt
|19:06:47.115|  (STATUS)    ClusteringSpatial : telescope0  --  0.08202s = 0.008480ms/evt
|19:06:47.116|  (STATUS)    ClusteringSpatial : telescope1  --  0.04881s = 0.005046ms/evt
|19:06:47.116|  (STATUS)    ClusteringSpatial : telescope2  --  0.04494s = 0.004646ms/evt
|19:06:47.116|  (STATUS)    ClusteringSpatial : telescope3  --  0.04357s = 0.004505ms/evt
|19:06:47.116|  (STATUS)    ClusteringSpatial : telescope4  --  0.04363s = 0.004510ms/evt
|19:06:47.116|  (STATUS)    ClusteringSpatial : telescope5  --  0.04473s = 0.004624ms/evt
|19:06:47.116|  (STATUS)    ClusteringSpatial : telescope6  --  0.04797s = 0.004959ms/evt
|19:06:47.116|  (STATUS)    ClusteringSpatial : telescope7  --  0.04347s = 0.004493ms/evt
|19:06:47.116|  (STATUS)    ClusteringSpatial : telescope8  --  0.04243s = 0.004386ms/evt
|19:06:47.116|  (STATUS)    ClusteringSpatial : telescope9  --  0.04304s = 0.004449ms/evt
|19:06:47.116|  (STATUS)    ClusteringSpatial :      lgad1  --  0.05199s = 0.005375ms/evt
|19:06:47.116|  (STATUS)    ClusteringSpatial :      lgad2  --  0.04169s = 0.004310ms/evt
|19:06:47.116|  (STATUS)    ClusteringSpatial :      lgad3  --  0.04045s = 0.004181ms/evt
|19:06:47.116|  (STATUS)    ClusteringSpatial :      lgad4  --  0.04088s = 0.004227ms/evt
|19:06:47.116|  (STATUS)      TrackingSpatial               --  0.36716s = 0.037957ms/evt
|19:06:47.116|  (STATUS) ==============================================================

Hope you can help me figure out the issue!

I put the files to generate the simulated data as well as the input I use with the above config files on lxplus here if anyone wants to test: /afs/cern.ch/user/a/aleopold/public/corry

used versions:

[aleopold@lxplus722 allpix_sim]$ allpix --version
Allpix Squared version v1.6.0+1390^g3bd423c5
               built on 2021-05-17, 20:28:24 UTC

[aleopold@lxplus7117 corry]$ corry --version
Corryvreckan version v2.0+171^g3d980a26~dirty
             built on 2021-05-03, 13:04:53 UTC

Thanks,
Alex

I just realised that role = "dut" was missing in the geometry file

That’s important :slight_smile: So is the problem solved?

The [CorryvreckanWriter] module of Allpix Squared has a dut keyword, but it’s not mandatory to provide: src/modules/CorryvreckanWriter/README.md · master · Allpix Squared / Allpix Squared · GitLab

Thanks, so yes the two modules are running now, I am not too happy with the results though, maybe you have a suggestion?

So I have true positions of 14 layers of sensors, 10 mimosa26 pixel detectors and additional 4 layers with a 1.3x1.3 mm2 pixel pitch (30x15 pixels per sensor) that look like

#telescope
position = 0,0,0
position = 0,0,100mm
position = 0,0,200mm
position = 0,0,400mm
position = 0,0,800mm
position = 0,0,1000mm
position = 0,0,1200mm
position = 0,0,1400mm
position = 0,0,1700mm
position = 0,0,2100mm
#dut
position = 0um 3.3mm 2700mm
position = -2mm 0um 2710mm
position = 0.5mm 0.5mm 2725mm
position = -200um -200um 2735mm

and assume (before alignment) that hey are located at

position = 0um 0um 2700mm
position = 0um 0um 2710mm
position = 0um 0um 2725mm
position = 0um 0um 2735mm

to see if the alignment procedure can recover these offsets. The telescope I assume to be perfectly alligned already.
After running the [Prealignment] module with

[Prealignment]
type = "LGAD"
log_level = INFO
max_correlation_rms = 6.0
damping_factor = 1.0

I get

position = 3.391um,3.27635mm,2700mm
position = -1.98497mm,-0.601um,2710mm
position = 502.576um,511.968um,2725mm
position = -196.09um,-188.711um,2735mm

which is already quite close. To improve the result, I run

[DUTAssociation]
type = "LGAD"
log_level = INFO
spatial_cut_rel = 5.0
[AlignmentDUTResidual]
align_orientation_axes = false
type = "LGAD"
log_level = INFO
iterations = 7

after spatial tracking and with the updated geometry as input. The resulting positions are

position = -56.154um,2.99104mm,2700mm
position = -2.0062mm,-258.94um,2710mm
position = 593.732um,391.088um,2725mm
position = -706.314um,-258.892um,2735mm

which is worse than running prealignment alone. Am I doing something wrong here?

Thanks a lot!

Hi @aleopold

sorry for the late answer - the issue most likely arises from pixel-perfect alignment in the simulation, minimization algorithms usually have problems to converge on zero.

I would recommend to use the alignment_precision parameters which you can add to the Allpix Squared geometry to introduce an initial misalignment that your alignment algorithm should then pick up and correct for.

/S