Class AlnConstants ================== These data are the values needed to convert a TDC time measurement into the relevant spatial coordinate and vice versa. A second-order polynominal is allowed although so far the quadratic term has not been used. The basic conversion equation to go from the TDC value t to the spatial coordinate x (and similarly for y) is x = vd (t - t0) + q (t - t0)^2 where the constant t0 is the TDC value which corresponds to x=0, the linear term is vd (the "drift velocity") and the quadratic term is q. Hence for each dimension (x,y) and tracking chamber (up to four chambers per dimension), then three constants (t0, vd and q) are stored in the AlnConstants class, for a total of 24 double values for alignment. The inverse of this equation for q=0 is t = t0 + x/vd For non-zero q, then the general quadratic solution is t = t0 + (-vd +/- (vd^2 + 4 q x)^0.5)/2q which has two solutions and is tricky to handle for q=0. Assuming q is small, then this becomes t ~ t0 + (-vd +/- (vd + 2 q x/vd - 2 q^2 x^2/vd^3 + 4 q^3 x^3/vd^5))/2q so it is clear that to match with the q=0 case, the positive sign must be used. Hence t ~ t0 + (2 q x/vd - 2 q^2 x^2/vd^3 + 4 q^3 x^3/vd^5)/2q ~ t0 + x/vd - q x^2/vd^3 + 2 q^2 x^3/vd^5 ~ t0 + (x/vd) - (q/vd)(x/vd)^2 + 2(q/vd)^2(x/vd)^3 and this is the equation used in the AlnConstants class. TDC units are used throughout for t and t0. Hence, although the size of the TDC unit in terms of ns is also given in AlnConstants (making 25 double values total in the class), this is for information only and is not used in the alignment. The units of vd and q are then mm/TDC unit and mm/(TDC unit)^2, respectively. The code for this class is in calice_reco/raw2calohit/include/TBTrackUtil/AlnConstants.hh calice_reco/raw2calohit/src/TBTrackUtil/AlnConstants.cc The methods to access or set the values are tdcUnit() - the value of the TDC unit in ns cTzero(d,l) - the value of t0 for dimension d (d=0 for x, 1 for y) and layer l (l=0-3) vDrift(d,l) - the value of vd for dimension d (d=0 for x, 1 for y) and layer l (l=0-3) vDquad(d,l) - the value of q for dimension d (d=0 for x, 1 for y) and layer l (l=0-3) The main method to convert between TDC time and spatial coordinate is coordinate(d,l,t) for int t where d and l are as above. For alignment purposes, it is useful to have a floating point time for average values, etc, so dCoordinate(d,l,t) for double t can be used. The equivalent inverse transformation methods are tdcValue(d,l,c) returning an int and dTdcValue(d,l,c) returning a double The AlnConstants are stored in the database in separate folders for DESY, CERN and FNAL, namely DESY /cd_calice_beam/TBTrack/AlnConstants CERN /cd_calice_cernbeam/TBTrack/AlnConstants FNAL /cd_calice_fnalbeam/TBTrack/AlnConstants These values are used for data only. The simulation uses the same structure but accesses the values through SimConstants, which inherits from AlnConstants, and is stored in a different folder.