howtoalign.tex 13.6 KB
 Jens Kroeger committed Jan 29, 2019 1 \chapter{Alignment Procedure}  Jens Kroeger committed Jan 29, 2019 2 3 \label{ch:howtoalign}  Jens Kroeger committed Jan 29, 2019 4 5 This chapter provides a description of how to use the alignment features of \corry. It also includes step-by-step instructions on how to align a new set of testbeam data.  Jens Kroeger committed Jan 29, 2019 6   Jens Kroeger committed Jan 29, 2019 7 For the alignment of the \textbf{reference telescope} and \textbf{device-under-test (DUT)}, the following modules are available in \corry.  Jens Kroeger committed Jan 29, 2019 8 \begin{itemize}  Jens Kroeger committed Feb 04, 2019 9 10 11 12 \item \texttt{[Prealignment]} for both telescope and DUT prealignment (see Section~\ref{prealignment}). \item \texttt{[AlignmentTrackChi2]} used for telescope alignment (see Section~\ref{alignmenttrackchi2}). \item \texttt{[AlignmentMillepede]}, an alternative telescope alignment algorithm (see Section~\ref{alignmentmillepede}). \item \texttt{[AlignmentDUTResidual]} used for DUT alignment (see Section~\ref{alignmentdutresidual}).  Jens Kroeger committed Jan 29, 2019 13 14 \end{itemize}  Jens Kroeger committed Jan 31, 2019 15 The general procedure that needs to be followed for a successful alignment is outlined here and explained in detail below.  Jens Kroeger committed Jan 29, 2019 16 \begin{enumerate}  Jens Kroeger committed Feb 04, 2019 17 18 \item Prealignment of the telescope (ignoring the DUT). \item Alignment of the telescope (ignoring the DUT).  Jens Kroeger committed Feb 04, 2019 19 20 \item Prealignment of the DUT (telescope geometry is frozen). \item Alignment of the DUT (telescope alignment is frozen).  Jens Kroeger committed Jan 29, 2019 21 22 \end{enumerate}  Jens Kroeger committed Jan 31, 2019 23 \begin{warning}  Jens Kroeger committed Feb 04, 2019 24 When using the alignment modules, the new geometry is written out to a new geometry file which needs to be specified using the parameter \parameter{detectors_file_updated}.  Jens Kroeger committed Jan 31, 2019 25 For details, see Section~\ref{sec:framework_parameters}.  Jens Kroeger committed Jan 31, 2019 26 \end{warning}  Jens Kroeger committed Jan 29, 2019 27   Jens Kroeger committed Jan 29, 2019 28 29 \section{Aligning the Telescope} \label{sec:align_tel}  Jens Kroeger committed Jan 31, 2019 30 31 Initially, the telescope needs to be aligned. For this, the DUT is ignored.  Jens Kroeger committed Jan 29, 2019 32 33  \subsection*{Prealignment of the Telescope}  Jens Kroeger committed Feb 04, 2019 34 The \texttt{[AlignmentTrackChi2]} module requires a careful prealignment. Otherwise it does not converge and the alignment will fail.  Jens Kroeger committed Jan 31, 2019 35 For the prealignment, two strategies can be applied.  Jens Kroeger committed Jan 29, 2019 36 \begin{itemize}  Jens Kroeger committed Feb 04, 2019 37 \item The \texttt{[Prealignment]} module can be used (see Section~\ref{prealignment}).  Jens Kroeger committed Feb 04, 2019 38 \item If the above does not bring the expected result, a manual prealignment can be performed by having a look at correlations plots between a defined reference plane and the other planes in both x and y and the residuals of tracks with respect to hits on the DUT.  Jens Kroeger committed Jan 29, 2019 39 40 \end{itemize}  Jens Kroeger committed Feb 04, 2019 41 42 The z-positions of all planes need to be measured by hand \textbf{in the existing testbeam setup} and then adjusted in the detectors file. These will not be changed during the alignment process.  Jens Kroeger committed Jan 29, 2019 43 44 For x and y, the alignment file from the last testbeam is a solid basis to start from. If no previous alignment is available, all values for x and y should be set to 0.  Jens Kroeger committed Jan 29, 2019 45 46 47  To have a first look at the initial alignment guess, one can run \begin{verbatim}  Jens Kroeger committed Feb 04, 2019 48 49 50 51 52 $/path/to/corryvreckan/bin/corry \ -c analyse_telescope.conf \ [-o detectors_file= \ -o histogram_file= \ -o EventLoaderTimepix3.input_directory=]  Jens Kroeger committed Jan 29, 2019 53 54 \end{verbatim}  Jens Kroeger committed Feb 04, 2019 55 The \parameter{spatial_cut} in \texttt{[Tracking4D]} should be set to multiple ($\sim4$) pixel pitch.  Jens Kroeger committed Jan 29, 2019 56   Jens Kroeger committed Feb 04, 2019 57 58 One can inspect the track$\chi^2, the correlation in x and y and the residuals with the online monitoring or by opening the generated ROOT file after finishing the script. These can be found in the modules \texttt{[Tracking4D]} (see Section~\ref{tracking4d}) and \texttt{[TestAlgorithm]} (see Section~\ref{testalgorithm}).  Jens Kroeger committed Jan 29, 2019 59   Jens Kroeger committed Jan 31, 2019 60 \begin{warning}  Jens Kroeger committed Feb 04, 2019 61 \textbf{Tip:} To save time, one can limit the number of processed tracks. For instance, set \parameter{number_of_tracks = 100000} (see Section~\ref{sec:framework_parameters}).  Jens Kroeger committed Jan 31, 2019 62 \end{warning}  Jens Kroeger committed Jan 29, 2019 63   Jens Kroeger committed Jan 29, 2019 64 If no peak at all is apparent in the correlations, the hitmaps can be checked to see if valid data is actually available for all planes.  Jens Kroeger committed Jan 29, 2019 65   Jens Kroeger committed Feb 04, 2019 66 Now, the \texttt{[Prealignment]} module can be used.  Jens Kroeger committed Feb 04, 2019 67 68 To prealign only the telescope, the DUT can be excluded by using \parameter{type = } (e.g.~\parameter{CLICPIX2}). For details, see Section~\ref{sec:module_manager}. However, all planes including the DUT can be prealigned at once.  Jens Kroeger committed Jan 29, 2019 69   Jens Kroeger committed Jan 29, 2019 70 Since the prealignment utilizes hit correlations rather than tracks, no cuts are needed here.  Jens Kroeger committed Jan 29, 2019 71   Jens Kroeger committed Feb 04, 2019 72 To use the module, \file{align_tel.conf} needs to be edited such that \texttt{[Prealignment]} is enabled and \texttt{[Alignment]} is disabled:  Jens Kroeger committed Jan 29, 2019 73 74 75 \begin{minted}[frame=single,framesep=3pt,breaklines=true,tabsize=2,linenos]{ini} ... [Prealignment]  Jens Kroeger committed Feb 04, 2019 76 type = # <-- optional!  Jens Kroeger committed Jan 29, 2019 77 78 79 80 [Ignore] #[AlignmentTrackChi2] log_level=INFO iterations = 4  Jens Kroeger committed Feb 04, 2019 81 82 align_orientation=true align_position=true  Jens Kroeger committed Jan 29, 2019 83 84 \end{minted}  Jens Kroeger committed Jan 29, 2019 85 Then one can run  Jens Kroeger committed Jan 29, 2019 86 \begin{verbatim}  Jens Kroeger committed Feb 04, 2019 87 88 89 90 91 92  /path/to/corryvreckan/bin/corry \ -c align_telescope.conf \ [-o detectors_file= \ -o detectors_file_updated= \ -o histogram_file= \ -o EventLoaderTimepix3.input_directory=]  Jens Kroeger committed Jan 29, 2019 93 94 \end{verbatim}  Jens Kroeger committed Feb 04, 2019 95 The actual prealignment is only performed after the events have been analyzed and written to the detectors file in the finalizing step.  Jens Kroeger committed Jan 31, 2019 96 This means to check whether the alignment has improved, one needs to re-run the analysis or the next iteration of the alignment as the previously generated ROOT file corresponds to the initial alignment.  Jens Kroeger committed Jan 29, 2019 97 98 99 This is the case for every iteration of the prealignment or alignment. Generally, it suffices to run the \texttt{[Prealignment]} module once and then proceed with the next step.  Jens Kroeger committed Jan 29, 2019 100   Jens Kroeger committed Feb 04, 2019 101 102 103 104 105 106 107 108 109 110 If the prealignment using the modulde \texttt{[Prealignment]} does not bring the expected results, one can also perform the same steps manually by investigating the residuals of the DUT with respect to tracks. For the residuals, the shift of the peak from 0 can be estimated with a precision of $\mathcal{O}(\SI{100}{\micro m})$ by zooming in using the \texttt{TBrowser}. For instance, if the peak is shifted by +\SI{+300}{\micro m}, the detectors file needs to be edited and \SI{+300}{\micro m} should be added to the respective position, if \SI{-300}{\micro m}, subtracted. After modifying the positions of individual planes in the configuration file, \corry can be re-run to check the correlation plots for the updated geometry. These steps need to be iterated a few times until the peaks of the \textbf{residuals} are centered around 0. It is important \textbf{not} to force the peak of the \textbf{correlations} to be at exactly 0 because the position of the peak in fact corresponds to the physical offset of a plane from its ideal position.  Jens Kroeger committed Jan 29, 2019 111 \subsection*{Alignment of the Telescope}  Jens Kroeger committed Feb 04, 2019 112 113 After the prealignment, the actual \textbf{precise} alignment can be performed using the \texttt{[AlignmentTrackChi2]} module (see Section~\ref{alignmenttrackchi2}). To this end, \file{align_tel.conf} needs to be modified such that the prealignment is disabled and the alignment is enabled:  Jens Kroeger committed Jan 29, 2019 114 115 116 117 118 119 120 \begin{minted}[frame=single,framesep=3pt,breaklines=true,tabsize=2,linenos]{ini} ... #[Prealignment] #[Ignore] [AlignmentTrackChi2] log_level=INFO iterations = 4  Jens Kroeger committed Feb 04, 2019 121 122 align_orientation=true align_position=true  Jens Kroeger committed Jan 29, 2019 123 124 125 \end{minted} The algorithm performs an optimisation of the track $\chi^2$.  Jens Kroeger committed Jan 29, 2019 126 Typically, the alignment needs to be iterated a handful of times until the residuals (which again can be inspected in the ROOT file after re-running the analysis) are nicely centered around 0 and narrow.  Jens Kroeger committed Feb 04, 2019 127 128 In fact, the RMS of the residuals corresponds to the spatial resolution of each plane (convolved with the resolution of the telescope) and should thus be $\lesssim$ pixel pitch$/\sqrt{12}$. Starting with a \parameter{spatial_cut} in \texttt{[Tracking4D]} (see Section~\ref{tracking4d}) of multiple ($\sim4$) pixel pitches, it should be decreased incrementally down to the pixel pitch (e.g. run \SI{200}{\micro\m} twice, then run \SI{150}{\micro\m} twice, then \SI{100}{\micro\m} twice, and then \SI{50}{\micro\m}) twice.  Jens Kroeger committed Jan 29, 2019 129 This allows to perform the alignment with a tight selection of very high quality tracks only.  Jens Kroeger committed Feb 04, 2019 130 Also the \parameter{max_track_chi2ndof} should be decrease for the same reason.  Jens Kroeger committed Jan 29, 2019 131 For the further analysis, the cuts can be released again.  Jens Kroeger committed Jan 29, 2019 132   Jens Kroeger committed Feb 04, 2019 133 It may happen that the procedure runs into a 'false minimum', i.e. it converges in a wrong alignment in which the residuals are clearly not centered around 0.  Jens Kroeger committed Feb 04, 2019 134 In this case, it is required to go one step back and improve the prealignment.  Jens Kroeger committed Jan 29, 2019 135 136 137 138  Once the alignment is done, one should obtain narrow residuals centered around 0 and a good distribution of the track $\chi^2$ as shown in Figures~\ref{fig:exampleAlignment}. If the alignment keeps to fail, it is possible to allow only for rotational or translational alignment while freezing the other for one or a few iterations.  Jens Kroeger committed Jan 31, 2019 139 140 141 142 143 144 145 \begin{minted}[frame=single,framesep=3pt,breaklines=true,tabsize=2,linenos]{ini} ... #[Prealignment] #[Ignore] [AlignmentTrackChi2] log_level=INFO iterations = 4  Jens Kroeger committed Feb 04, 2019 146 147 align_orientation=false #<-- disable rotational alignment align_position=true  Jens Kroeger committed Jan 31, 2019 148 149 \end{minted}  Jens Kroeger committed Jan 29, 2019 150 151 152 \begin{figure} \centering \begin{subfigure}[t]{0.66\textwidth}  Jens Kroeger committed Jan 29, 2019 153  \includegraphics[width=\textwidth]{trackChi2ndof_goodexample}  Jens Kroeger committed Jan 29, 2019 154 155 156 157  \caption{Good example of a track $\chi^2$/ndf distribution.} \label{fig:trackChi2} \end{subfigure} \begin{subfigure}[t]{0.66\textwidth}  Jens Kroeger committed Jan 29, 2019 158  \includegraphics[width=\textwidth]{correlationX_goodexample}  Jens Kroeger committed Jan 29, 2019 159 160 161 162  \caption{Good example of a correlation plot.} \label{fig:correlationX} \end{subfigure} \begin{subfigure}[t]{0.66\textwidth}  Jens Kroeger committed Jan 29, 2019 163  \includegraphics[width=\textwidth]{residualX_goodexample}  Jens Kroeger committed Jan 29, 2019 164 165 166  \caption{Good example of a residual distribution.} \label{fig:residualX} \end{subfigure}  Jens Kroeger committed Jan 29, 2019 167  \caption{Examples of distributions as they should look like.}  Jens Kroeger committed Jan 29, 2019 168 169 170  \label{fig:exampleAlignment} \end{figure}  Jens Kroeger committed Feb 04, 2019 171 172 Instead of using \texttt{[AlignmentTrackChi2]}, one can also use the module \texttt{[AlignmentMillepede]} (see Section~\ref{alignmentmillepede}). It should be noted that this module requires a rather good alignment already.  Jens Kroeger committed Jan 29, 2019 173 174 Once the alignment has converged, this module stops and the alignment is complete.  Jens Kroeger committed Jan 29, 2019 175 176 177 178 179 180 181 \section{Aligning the DUT} \label{sec:align_dut} Once the telescope is aligned, its geometry is not touched anymore. From now on, it is used to build tracks which are then matched to clusters on the DUT. \subsection*{Prealignment of the DUT} The prealignment of the DUT follows the same strategy as for the telescope. To look at the current alignment, the script \begin{verbatim}  Jens Kroeger committed Feb 04, 2019 182 183 184 185 186 187 /path/to/corryvreckan/bin/corry \ -c analyse_atlaspix.conf \ [-o detectors_file= \ -o histogram_file= \ -o EventLoaderTimepix3.input_directory= \ -o EventLoaderATLASpix.input_directory=]  Jens Kroeger committed Jan 29, 2019 188 189 \end{verbatim} needs to be run.  Jens Kroeger committed Feb 04, 2019 190 If no better guess is available, the initial alignment of the DUT should be set tox=y=0.  Jens Kroeger committed Jan 29, 2019 191 192  Then, by repeatedly running \corry and modifying the position of the DUT in the detectors file one should be able to bring the peaks of the correlations in x and y close to 0.  Jens Kroeger committed Feb 04, 2019 193 If no peak at all can be seen in the correlation plots, potentially parameters related to the corresponding event loader need to be corrected in the configuration file.  Jens Kroeger committed Jan 29, 2019 194   Jens Kroeger committed Jan 31, 2019 195 \begin{warning}  Jens Kroeger committed Feb 04, 2019 196 If using the \texttt{[Prealignment]} module, it is possible to prealign all planes at once as described above in Section~\ref{sec:align_tel}.  Jens Kroeger committed Feb 04, 2019 197 If only the DUT shall be prealigned here, the parameter \parameter{name = } or \parameter{type = } need to be used.  Jens Kroeger committed Jan 29, 2019 198 Otherwise, the telescope planes are also shifted again destroying the telescope alignment.  Jens Kroeger committed Jan 31, 2019 199 \end{warning}  Jens Kroeger committed Jan 29, 2019 200 201 202 203  \begin{minted}[frame=single,framesep=3pt,breaklines=true,tabsize=2,linenos]{ini} ... [Prealignment]  Jens Kroeger committed Jan 31, 2019 204 name = # <-- otherwise the telescope planes will be moved!  Jens Kroeger committed Jan 29, 2019 205 206  [Ignore]  Jens Kroeger committed Jan 29, 2019 207 #[AlignmentDUTResiduals]  Jens Kroeger committed Jan 29, 2019 208 209 log_level=INFO iterations = 4  Jens Kroeger committed Feb 04, 2019 210 211 align_orientation=true align_position=true  Jens Kroeger committed Jan 29, 2019 212 213 214 215 \end{minted} \subsection*{Alignment of the DUT} Again, the alignment strategy for the DUT is similar as for the telescope and requires multiple iterations.  Jens Kroeger committed Feb 04, 2019 216 In \file{align_dut.conf}, the prealignment needs to be disabled and the alignment enabled.  Jens Kroeger committed Jan 29, 2019 217 Now, the algorithm optimizes the residuals of the tracks through the DUT.  Jens Kroeger committed Jan 29, 2019 218 219 220 221 222 223 224 225  \begin{minted}[frame=single,framesep=3pt,breaklines=true,tabsize=2,linenos]{ini} ... #[Prealignment] #[Ignore] [AlignmentDUTResiduals] log_level=INFO iterations = 4  Jens Kroeger committed Feb 04, 2019 226 227 align_orientation=true align_position=true  Jens Kroeger committed Jan 29, 2019 228 229 230 231 \end{minted} Then run \begin{verbatim}  Jens Kroeger committed Feb 04, 2019 232 233 234 235 236 237 238  /path/to/corryvreckan/bin/corry \ -c align_dut.conf \ [-o detectors_file= \ -o detectors_file_updated= \ -o histogram_file= \ -o EventLoaderTimepix3.input_directory= \ -o EventLoaderATLASpix.input_directory=]  Jens Kroeger committed Jan 29, 2019 239 240 \end{verbatim}  Jens Kroeger committed Feb 04, 2019 241 242 Like for the telescope alignment, the RMS of the residuals can be interpreted as the spatial resolution of the DUT (convolved with the resolution of the telescope) and should thus be $\lesssim$~pixel pitch$/\sqrt{12}$. Again, starting with a \parameter{spatial_cut} in \texttt{[DUTAssociation]} (see Section~\ref{dutassociation}) of multiple ($\sim4$) pixel pitches, it should be decreased incrementally down to the pixel pitch. Note that an asymmetric pixel geometry requires the \parameter{spatial_cut} to be chosen accordingly.  Jens Kroeger committed Jan 29, 2019 243 244 245 246 247 248 249 250 251 252  If the alignment keeps to fail, it is possible to allow only for rotational or translational alignment while freezing the other for one or a few iterations. \begin{minted}[frame=single,framesep=3pt,breaklines=true,tabsize=2,linenos]{ini} ... #[Prealignment] #[Ignore] [AlignmentDUTResiduals] log_level=INFO iterations = 4  Jens Kroeger committed Feb 04, 2019 253 254 align_orientation=false #<-- disable rotational alignment align_position=true  Jens Kroeger committed Jan 29, 2019 255 \end{minted}