Indexing grazing-incidence X-ray diffraction patterns of thin films: lattices of higher symmetry

A general indexing procedure for grazing-incidence X-ray diffraction patterns recorded from fibre-textured films is introduced for lattices of monoclinic and higher-symmetry systems. The analytical mathematical expressions are given and their use is demonstrated in detail for two cases (monoclinic and orthorhombic).


Introduction
Crystalline thin films are often characterized by grazing-incidence X-ray diffraction (GIXD) owing to the high surface sensitivity of the technique. A schematic drawing of the experimental method is shown in Fig. 1(a). To achieve this surface sensitivity, the angle of incidence of the primary beam relative to the sample surface ( i ) is chosen close to the critical angle of total external reflection, and the scattered X-ray beam encloses an in-plane angle f , as well as an out-of-plane angle f relative to the surface. The primary X-ray beam, described by the wavevector k 0 , and the scattered beam k determine the scattering vector q by q = k À k 0 . In this geometry the in-plane component q xy and the out-of-plane component q z of q are given by q xy ¼ 2 cos 2 i þ cos 2 f À 2 cos i cos f cos f À Á 1=2 ð1Þ and q z ¼ 2 sin i þ sin f ð Þ : ð2Þ A key direction in reciprocal space is the z direction at q xy = 0, which reveals the orientation of crystals relative to the substrate surface. In the important case of crystalline fibretextured films, it defines the crystallographic plane of the thinfilm crystallites which is parallel to the substrate surface (i.e. ISSN 1600-5767 the contact plane). However, in GIXD geometry the z direction is inaccessible in reciprocal space. To experimentally assess this direction, one needs to resort to specular X-ray diffraction [cf. Fig. 1(b)], where the incidence angle of the primary beam ( i ) and the exit angle of the scattered X-ray beam ( f ) are equal. This results in a scattering vector q always perpendicular to the substrate surface and the scattering vector then exclusively has a q z component (with q xy = 0). In the following, a diffraction peak observed via specular X-ray diffraction is denoted as q spec ¼ ð4=Þðsin i Þ. The correlation between the scattering vector q and the corresponding lattice periodicities is obtained via the Laue equation: for the appearance of a diffraction peak the scattering vector q has to be equal to a reciprocal lattice vector g.
In general, indexing of GIXD patterns means assigning Laue indices to the observed Bragg peaks. In the specific case of GIXD data recorded on fibre-textured films, which is covered in the present manuscript, two components of the reciprocal lattice vectors -q z and q xy -are taken from experimental reciprocal-space maps and available for indexing (Smilgies & Blasini, 2007;Hailey et al., 2014). As the fibretextured crystals have a well defined crystallographic contact plane, the rotation matrix of the crystallites relative to the sample surface must be considered (Shmueli, 2006), i.e. the contact plane of the investigated crystals must be determined. In many cases, it can be deduced from specular X-ray diffraction data; however, the correct assignment to a crystallographic plane with Miller indices u, v and w cannot be obtained from specular X-ray diffraction alone, if the crystal structure is unknown (Salzmann & Resel, 2004;Smilgies & Blasini, 2007;Hailey et al., 2014;Jiang, 2015). By combining the peak positions of the GIXD pattern (q xy , q z ) with the specular peak position (q spec ), mathematical expressions can be derived where the required number of unknown para-meters for indexing the pattern is significantly reduced. In recent work, we demonstrated this approach for the general case of the triclinic crystallographic system (Simbrunner et al., 2018).
Here, we now turn our focus to crystallographic lattices of higher symmetry. Obviously, the equations for the in-plane and out-of-plane components of the reciprocal-space vectors become less complex if the number of unit-cell parameters is reduced. This can facilitate the indexing procedure; however, the parameters of the rotation matrix do not reduce. In the following, we first concentrate on monoclinic systems and subsequently present mathematical expressions for all other systems. Via two practical examples, we then explicitly demonstrate the application of these equations. We stress that our indexing procedure does not rely on knowing either the chemical structure of the material or the experimental intensities of the diffraction peaks. We show that the presented approach can succeed with a limited number of reflections for experimental data of high quality.

Indexing method
For the mathematical treatise a laboratory coordinate system is assumed, where the xy plane runs parallel to the substrate surface; a, b, c, , and are the parameters of the (direct) unit cell, and a*, b*, c*, *, * and * are the reciprocal cell parameters (Giacovazzo, 2011), which are summarized in Table 1. If the (001) lattice plane is parallel to the substrate surface in a GIXD experiment, the reciprocal lattice vector g with its Laue indices h, k and l can be represented by the equation where the matrix A Ã 001 is given as When the Laue condition q = g is fulfilled, diffraction can be observed.
If the (001) lattice plane is not parallel to the substrate surface, the matrix A Ã 001 must be transformed, i.e. the rotation Table 1 Relations between the parameters of the direct lattice (a, b, c, , , ) and of the reciprocal lattice (a*, b*, c*, *, *, *) and the volume of the crystallographic unit cell V.
V ¼ abcð1 À cos 2 À cos 2 À cos 2 þ 2 cos cos cos Þ 1=2 ¼ abc sin Ã sin sin Figure 1 X-ray diffraction geometries for crystal structure investigations of thin films, with k 0 and k as the wavevectors of the incident and scattered X-ray beams, respectively; i is the angle of incidence, f the out-of-plane scattering angle and f the in-plane scattering angle. (a) Grazingincidence X-ray diffraction, where the scattering vector is split into an inplane component q xy and an out-of-plane component q z . (b) Specular X-ray diffraction in co-planar geometry, with i = f and f = 0, where the scattering vector q consists only of a nonzero out-of-plane component q z .
matrix of the thin-film crystallites relative to the substrate surface has to be considered (Shmueli, 2006). In particular, it has to be rotated around the zone axis which is defined by the (001) plane and the new contact plane (uvw). Then the reciprocal-space vector with the Laue/Miller indices u, v and w, g uvw , is perpendicular to the contact plane. Its magnitude is purely out of plane and corresponds to the specular scan, g spec . Furthermore, the out-of-plane component g z and in-plane component g xy of any reciprocal-space vector g hkl can be determined by their scalar product and vector (cross) product with g uvw , respectively. As the magnitude of a vector and the scalar product of two vectors are both rotation invariant, the unrotated expressions, i.e. equation (3), for g hkl and g uvw are sufficient. Therefore, the following expressions result: and where the volume is Furthermore, from equation (3) the length of the vector jg hkl j, g xyz , can be determined as Using equations (5) and (6), equation (9) can be rewritten as and by algebraic transformations the following expression can be derived: g 2 xy g 2 spec ¼ z 2 a u 2 g 2 xy þ hg spec À ug z As a result of symmetry relationships, further analogous expressions for the cell parameter triples (a, c, ) and (b, c, ) and their corresponding Miller and Laue indices can be derived.
From equations (5) and (6) the following expression can be obtained: From equation (12), the residual unit-cell parameters c, , and the Laue indices l can be determined (Truger et al., 2016). Analogously, the following equation is valid: In a monoclinic system ( = = 90 ), equation (11) reduces to g 2 xy g 2 spec ¼ 2=a ð Þ 2 u 2 g 2 xy þ hg spec À ug z Equation (14) comprises -in addition to the rotation parameters u and v -only the lattice parameters a and b, as well as the Laue indices h and k. This facilitates the mathematical analysis, where the integer variables can be varied and only two real unknowns must be calculated.
In rare cases, if the net planes oriented parallel to the substrate surface have a weak structure factor, which inhibits the acquisition of specular diffraction data (Djuric et al., 2012), g spec must be treated as an additional real unknown parameter, which necessitates a more extensive numerical analysis. In the most general case, if no contact plane exists, u, v and w are non-integers. In this case it is preferable to use an alternative notation of the rotation matrix (see Appendix A).
For calculating the remaining unit-cell parameters c, and the Laue indices l, the following expression results from equation (12): Analogously to equation (14), by choosing related substitutions on the basis of the symmetric properties of the relations for g xyz , g xy , g z and g spec for the general (triclinic) case, the following expressions hold: Furthermore, equation (13) reduces to For orthorhombic systems, the formulae are valid with = 90 . In Table 2 we summarize the mathematical expressions for g xyz , g z , g xy and the volume V in triclinic, monoclinic and orthorhombic systems. In tetragonal and cubic lattices, in addition to = 90 , a = b and a = b = c, respectively. In Appendix B useful formulae for tetragonal, trigonal and hexagonal systems are listed. As every linear combination of the unit-cell vectors obeys the Laue condition, the mathematical solutions are not unique and include superlattices (Santoro et al., 1980). The definite crystallographic solution, the reduced cell, is defined as the cell that satisfies the conditions derived from the reduction theory of quadratic forms (Niggli, 1928). The main conditions for reduction require that the unit cell is based on the three shortest vectors of the lattice; such a unit cell is then called a Buerger cell (Buerger, 1957). However, this cell may not be unique. An unambiguous unit cell is the 'reduced cell' defined by Niggli; the criteria are listed in detail in International Tables for Crystallography (De Wolff, 2016). In general, the criteria for reduced cells demand that a 2 b 2 c 2 and that the angles are either acute (type I) or obtuse (type II). Geometrical ambiguities, called lattice metric singularities, which generate subcells of lower symmetry, may occur in some indexing cases (Santoro & Mighell, 1970;Mighell, 2000). Such singularities can often be easily detected from simple relationships between the lattice parameters of the two cells (Boultif & Louë r, 2004).
In the following we turn to employing the formalism derived above to determine the unit-cell parameters of two prototypical organic semiconductors, which show as yet unknown polymorphs if grown in thin films on substrates of highly oriented pyrolytic graphite (HOPG).

Experiments
Thin films of diindenoperylene (DIP, C 32 H 16 ) and of orthodifluorosexiphenyl (o-F 2 -6P, C 36 F 2 H 24 ) were grown on freshly cleaved HOPG (ZYA quality) by physical vapour deposition in a high vacuum (final nominal film thickness 30 nm; base pressure < 5 Â 10 À6 Pa). The films were characterized at beamline W1 at the synchrotron radiation facility DORIS (HASYLAB, Hamburg, Germany). GIXD experiments were performed together with specular X-ray diffraction using a goniometer in pseudo 2 + 2 geometry and a one-dimensional detector (MYTHEN, Dectris). The wavelengths of the primary radiation were 1.1796 and 1.1801 Å for DIP and o-F 2 -6P, respectively. GIXD experiments were performed using incident angles of the primary beam relative to the HOPG substrate of i = 0.13 and 0.15 for DIP and o-F 2 -6P, respectively. Reciprocal-space maps were recorded by keeping the sample fixed and by performing a series of detector scans along the in-plane scattering angle f at differently fixed outof-plane scattering angles f . The vertical mounting of the detector allows the simultaneous measurement of Á f = 3.5 . The diffraction pattern was transformed to reciprocal space using the custom-made software PyGID (Moser, 2012). The resulting reciprocal-space maps give the measured intensities on a logarithmic scale by a colour code; the exact positions of the Bragg peaks in terms of q xy and q z were determined by Gaussian fits. The q z values of the peak positions were corrected for refraction effects; maximum variations of 0.011 and 0.014 Å À1 are obtained for DIP and o-F 2 -6P, respectively .

Diindenoperylene
A specular scan of DIP crystals grown on a HOPG substrate is shown in Fig. 2(a). The dominant diffraction peak at q z = 1.872 Å À1 (d = 3.356 Å ) can be identified as the 002 peak of the HOPG substrate. Forming the difference with the reference data recorded for the plain substrate (orange curve) reveals a clear diffraction peak at q spec = 1.776 Å À1 , which is assigned to the DIP adsorbate and corresponds to a lattice spacing of 3.54 Å . Note that a specular reflection from DIP at the same position has been observed before for gold substrates by Dü rr et al. (2003). The authors concluded on a lying molecular orientation from their data and denoted this polymorph as the phase; however, no direct determination of the unit cell by indexing GIXD reciprocal-space-map data has been performed before. Our reciprocal-space map of DIP on HOPG is shown in Fig. 2(b). Strong diffraction features of the HOPG substrate are located along q xy = 2.94 Å À1 . Additionally, weak diffraction features at q xy = 2.24 Å À1 / q z = 0.98 Å À1 and at q xy = 2.34 Å À1 / q z = 0.98 Å À1 are also due to the HOPG substrate. Bragg peaks at low q values (q 2 = q xy 2 + q z 2 ) were selected for the indexing procedure and lie at centres of the triangles in Fig. 2(b). In total, we only used ten Bragg peaks (based on their q xy and q z positions) together with the Bragg peak of the specular diffraction pattern (q spec ) for our indexing procedure. Note that q spec , q xy and q z are experimental results which describe specific components of the scattering vector, while g spec , g xy and g z refer to these components within the reciprocal lattice. According to the Laue condition, the individual components of the scattering vector q and of the reciprocal lattice vectors g must be equal.
As known crystal structures of DIP exhibit a monoclinic lattice (Heinrich et al., 2007;Kowarik et al., 2009), in a first step of indexing, equation (14) may be chosen. The combination of Bragg peaks from the reciprocal-space map (q xy and q z ) with the peak from the specular scan (q spec ) reduces the number of parameters considerably to two integer numbers (instead of three) for the Miller indices of the contact plane, to two integer numbers (instead of three) for the Laue indices of each Bragg peak, and to two real numbers (instead of four) for the lattice constants. In theory, by using a quadratic equation, a and b can be calculated from two independent pairs of (g xy , g z )  Table 2 Relations for the total length g xyz , the out-of-plane component g z and the in-plane component g xy of the reciprocal-space vectors with indices hkl and of the vector uvw (g spec ) by using direct and reciprocal lattice parameters and the volume V in triclinic, monoclinic and orthorhombic systems.
g 2 xy g 2 spec V 2 1 ð2Þ 4 ¼ ðkw À lvÞ 2 a 2 þ ðhw À luÞ 2 b 2 þ ðhv À kuÞ 2 c 2 þ 2ðku À hvÞðhw À luÞbc cos þ 2ðhv À kuÞðkw À lvÞac cos þ 2ðhw À luÞðlv À kwÞab cos V ¼ abcð1 À cos 2 À cos 2 À cos 2 þ 2 cos cos cos Þ 1=2 ¼ abc sin Ã sin sin . Because of experimental inaccuracies, however, we prefer treating equation (14) as linear with the unknowns 1 ¼ ð2=aÞ 2 , 2 ¼ ð2=bÞ 2 and 3 ¼ ð2=aÞ 2 Â ð2=bÞ 2 . The first step of indexing is then based on a systematic variation of integer variables: (i) a pair of Miller indices for the contact plane (the crystallographic plane of DIP crystals parallel to the substrate surface), and (ii) two Laue indices for each of the selected Bragg peaks from the reciprocal-space map [ Fig. 2(b)]. By using several pairs of (g xy , g z ), sets of overdetermined linear equations are then obtained, from which the solutions with the least errors e concerning the system of equations (i.e. norm of the residuals) and the factor f ¼ j 1 2 À 3 j=j 1 2 j are selected. Furthermore, the volume of the resulting unit cell should be as small as possible. From 1 , 2 and 3 the solution for a and b can be optimized (see Appendix D). In our case, for u = 1 and v = 2, e and f of the optimal solution are 4.8 Â 10 À3 and 1.1 Â 10 À3 , respectively. The next best solutions to the optimal choice of the Laue indices h and k have almost the same error e (plus 1% and minus 1%, respectively) but a larger factor f of about 40 and 56%, respectively.
As equation (16) is analogous to equation (14), two solutions (for a and c, respectively) with consistent unit-cell parameter b, Miller index v and Laue indices k must exist. If the Miller indices are chosen to be v = 2 and w = 1, an appropriate solution can be found. Thus, a monoclinic lattice with the contact plane (121) results and the cell parameters a, b and c and the Laue indices h, k and l can be assigned to the experimental pattern. In a last step, using equation (15), the last cell parameter can be obtained.
Alternatively, in a first step of indexing, equation (17), which is valid for any lattice type, can be used. For this procedure we use the following specific algorithm: appropriate mathematical substitutions transform equation (17) into linear equations with three real unknowns, containing the lattice constants a, c and (see Appendix E). Assigning two low integers as the Miller indices u and w, and choosing Laue indices h and l in a specific range, is a starting point to find solutions for the lattice constants a, c and . In theory, a set of lattice constants can be obtained from three equations with independent pairs of g xy and g z . Being linearized, these equations can be solved analytically by determining the inverse matrix of their coefficients. To account for experimental inaccuracies, however, all ten peaks can be included simultaneously, again for creating an overdetermined system of linear equations. This system can be solved either by multiplying both sides of the equations with the transpose of the coefficient matrix or by QR decomposition to solve the least-squares problem (Bronshtein et al., 2015). In addition to an optimized approximated solution of the unknown variables, the associated error can be calculated. By varying the integer variables, the final solution to the overdetermined system is found. This is done by choosing the optimal set of equations regarding a small error and a volume of the resulting unit cell that is as small as possible. To overcome the computational complexity with an increasing number of equations, this procedure is performed stepwise. In a first step, four equations with small q values are chosen, for which the possible range of Laue indices is restricted. Only systems with errors not exceeding a certain limit are included further. Thus the Laue indices h and l for all reflections can be assigned and the unitcell parameters a, c and are calculated. A modification of this algorithm relies on comparing the systematically varied coefficients of the ten linear equations and seeking clusters of related coefficients.
Thus, for u = 1 and w = 1 a solution for a first set of lattice constants (a, c, ) and the Laue indices h and k can be obtained. Then, in a second step, it can be checked if equation (18) results for all peak positions (q xy , q z ) in integer multiples of 2/b. If -as is the case here -this condition is fulfilled, the assumption of a monoclinic lattice is justified. Furthermore, using equation (13)  X-ray diffraction of DIP grown on a (001) substrate of HOPG. The chemical structure of the molecule is given as an inset. (a) Specular diffraction pattern of the HOPG substrate with and without DIP crystals, as well as the difference between the two patterns around the specular diffraction peak of DIP crystals. (b) Reciprocal-space map measured by grazing-incidence X-ray diffraction with a selection of peaks which were used for indexing. The centres of the triangles and the crosses give the experimental and calculated peak positions, respectively; the respective Laue indices are also given.
In a last step, when all integer variables have been assigned, the values of the real lattice parameters can be numerically fitted. For this procedure, the expressions for g xyz , g xy and g z in Table 2 can be used. For our example of DIP on HOPG, we then obtain the following solution, which obeys the scalar product criteria for type-II cells: u = 1, v = 2, w = 1; a = 7.149, b = 8.465, c = 16.62 Å , = 90, = 93.14, = 90 , V = 1004.5 Å 3 . The accuracy of the result can be assessed by the factors d 10;xyz ¼ 1 10 P 10 i¼1 jðq xyz;i À g xyz;i Þ=q xyz;i j ¼ 0:003 and d 10;z ¼ 1 10 P 10 i¼1 jðq z;i À g z;i Þ=q z;i j ¼ 0:005, where 10 is the number of reflections, and (q xyz,i , q z,i ) are the measured and (g xyz,i , g z,i ) the calculated peak positions of the ith reflection. As an example, the influences of the refraction correction on the lattice constants are demonstrated by using uncorrected values for q z . In this case, we would then obtain significantly different lattice parameters instead: a = 7.194, b = 8.440, c = 16.60 Å , = 90, = 93.54, = 90 , V = 1005.7 Å 3 (d 10,xyz = 0.006, d 10,z = 0.025).
Importantly, however, as the underlying equations do not allow a unique mathematical solution, it must still be checked if the lattice obtained corresponds to the reduced unit cell. For this purpose, three reciprocal lattice vectors g 1 , g 2 and g 3 , e.g. of the three independent Laue triples (0, 0, 1), (1, 1, 0) and (À1, 1, 0), are calculated and the matrix G ¼ g x1 g y1 g z1 g x2 g y2 g z2 g x3 g y2 g z3 0 @ 1 A is formed. By multiplying its inverse matrix G À1 with vectors 2(m 1 , m 2 , m 3 ) T , where m i are systematically varied integers in a reasonable range (e.g. between À3 and 3), lattice vectors of the unit cell and its superlattices can be obtained (Simbrunner et al., 2018). Listing the lengths of these vectors in ascending order yields 7. 149, 8.465, 11.08, 14.30, 16.616 and 16.62 for the six shortest vectors. But as the first five vectors are coplanar, our solution matches the Buerger and reduced cell.
On the basis of this solution, peak positions are calculated and plotted in Fig. 2(b) as crosses. In addition to the ten peaks we initially selected, all other observed peaks can now be indexed according to this unit cell.

ortho-Difluorosexiphenyl
The experimental GIXD data for the o-F 2 -6P film [the synthesis of o-F 2 -6P is reported by Niederhausen et al. (2018)] as grown on HOPG are shown in Fig. 3. We now observe a well pronounced specular diffraction peak at q spec = 1.636 Å À1 , corresponding to a lattice spacing of 3.84 Å in the out-of-plane  Table 3 The lattice constants of diindenoperylene at different temperatures compared with our result. Heinrich et al. (2007) Kowarik et   direction. Like the case of DIP above, this points to lyingstacked growth of the molecules on the HOPG substrate, a growth behaviour that has been reported before for related systems (Salzmann et al., 2012). The reciprocal-space map reveals, besides the diffraction peaks of HOPG (see discussion above), a highly regular sequence of Bragg peaks located at constant q z values. In this example, the indexing procedure was performed on 16 selected reflections.
In marked contrast to non-substituted 6P growing in a monoclinic crystal structure (Baker et al., 1993;Resel, 2003), from the highly symmetric diffraction pattern, an orthorhombic lattice with its contact plane parallel to the (010) plane (u = w = 0) can be assumed for o-F 2 -6P on HOPG. As for the specular scan the relation g spec ¼ 2ð2=bÞ (v = 2) holds, the following expressions (see Table 2) follow: On that basis, we obtained for the unit cell of o-F 2 -6P on HOPG: u = 0, v = 2, w = 0; a = 5.724, b = 7.659, c = 27.424 Å , = = = 90 , V = 1202.3 Å 3 . The accuracy of the result can be assessed by d 16;xyz ¼ 1 16 P 16 i¼1 jðq xyz;i À g xyz;i Þ=q xyz;i j ¼ 0:0015 and d 10;z ¼ 1 10 P 10 i¼1 jðq z;i À g z;i Þ=q z;i j ¼ 0:0015, as for d N,z only the 10 reflections with k > 0 are included. Note that as a result of equation (24) the Laue indices h and l can be either positive or negative. Again, if uncorrected values for q z were used, b = 7.614 Å would follow. It can be proven that a, b and c are the shortest non-coplanar unit-cell vectors.
As an illustration of the comparison between calculated peaks and experimental data, the peak positions are plotted in Fig. 3(b) as crosses; there are no crystal structures known so far for molecular crystals of o-F 2 -6P. The low out-of-plane lattice spacing that we observe via specular diffraction strongly points to -stacked growth of this fluorinated 6P derivative, if grown on HOPG. This is remarkable insofar as non-substituted 6P grows in a herringbone arrangement of the molecules in all known structures and on numerous surfaces including HOPG (Resel, 2003) and, therefore, it is obviously the (one-sided) fluorination of the molecule that changes its growth behaviour dramatically. A similar behaviour has been observed for pentacene (herringbone) and perfluoropentacene on HOPG (-stacking) (Salzmann et al., 2012), as well as for 6,13-bis(triisopropylsilylethynyl)pentacene and pentacenequinone (Swartz et al., 2005). The transition from inclined to parallel molecular planes in these structures has been ascribed to the impact of intramolecular polar bonds by the authors. For o-F 2 -6P, no bulk crystal structures have been published yet, and structural characterization was limited to sub-monolayers on Ag(111) by low-temperature scanning tunnelling microscopy (Niederhausen et al., 2018). There, in contrast to non-fluorinated 6P molecules which individually adsorb in the sub-monolayer regime on the metal surface without packing, the authors find a flat lying stack arrangement of the o-F 2 -6P molecules with small lateral shifts along the row direction. The net dipole moment of o-F 2 -6P is derived as 1.1 Debye owing to the polar C-F bonds at the ortho position of the outer phenyl ring, which appear to maximize their distance in neighbouring molecules.
Building upon previous work (Salzmann et al., 2011;Truger et al., 2016), the unit cell determined in the present work for o-F 2 -6P (and, likewise, for DIP) can now be used to model the molecular arrangement therein, which will be the subject of a forthcoming study.

Discussion -determining the crystallographic system
In the case of powder diffraction only the lengths of the reciprocal-space vectors are used for indexing. In the dichotomy method the cell constants are varied in increasingly smaller intervals and the hkl indices are subsequently refined using the least-squares method (Boultif & Louë r, 1991. The search of indexing solutions typically starts from the cubic end of the symmetry sequence. Each crystal system is explored independently up to a maximum input volume, unless a solution has been found with a higher symmetry. Indexing of GIXD patterns is based on the knowledge of two components of the reciprocal space vector, the in-plane component q xy and the out-of-plane component q z [ Fig. 1(a)]. Since the lattice type cannot be assigned a priori, we suggest following an iterative approach. As a consequence of imperfect data due to experimental inaccuracies, it seems that starting with a lattice of higher symmetry is favourable, since incoherency becomes evident quickly and the tendency to find only a 'local minimum' when finally optimizing the cell parameters increases with the number of variables in the equations. Moreover, boundary conditions and experimental constraints can be included in the indexing procedure with less numerical effort. If no satisfactory solution can be found with a specific lattice type, the next lower symmetry system will then be used.
In single-crystal diffraction, where reciprocal lattice vectors are used for indexing, in a first step the model parameters are refined in a triclinic setting. If possible symmetry elements are detected, cell refinement with symmetry-bases restraints is performed (Sauter et al., 2004). In the matrix approach to symmetry (Himes & Mighell, 1987) this is accomplished by 64 symmetry matrices to check if the transformation leads to identity. Furthermore, systems of higher symmetry imply a high impact of symmetry considerations such as diffraction intensities and systematic absences (Hahn, 2006). Determination of the symmetry profile in crystallographic structures is a persistent challenge (Hicks et al., 2018) and certainly lies beyond the scope of the present work.
The final goal in crystallographic analysis is the determination of the most fundamental property of the structure -the correct space group. Four steps are necessary to achieve this endeavour (Marsh, 1995): (i) the derivation of the correct space lattice, i.e. the smallest primitive (reduced) unit cell; (ii) the assignment of the correct Laue group on the basis of the symmetry of the diffraction intensities and an initial decision if a structure is centrosymmetric; (iii) the identification of any systematic absences characteristic of translational symmetry elements (glide planes or screw axes); and (iv) the research papers J. Appl. Cryst. (2019). 52, 428-439 final decision as to whether or not the structure is centrosymmetric. Higher metric symmetry is usually identified by computer programs (Hicks et al., 2018).
We emphasize that in the present work we focus only on the first point. For determining the lattice parameters and indexing of the diffraction pattern it is appropriate to choose the crystallographic system of the highest order which can be rationally fitted to the measured reflections. However, it is not the shape of the unit cell that determines the lattice type but the symmetry of the diffraction intensities (Marsh, 1995).
In GIXD the diffraction intensities are influenced by various parameters. This may impede the determination of the correct Laue group. Furthermore, as the in-plane component of the reflections is measured, the Laue indices in lattices of higher symmetry can be 'degenerate', i.e. they cannot be assigned with positive or negative sign, as is the case in our example of o-F 2 -6P. For the reliable identification of systematic absences it is further necessary to obtain a reasonable number of reflections.

Conclusion
Indexing of GIXD data of fibre-textured films is important for phase analysis as well as for the identification of new polymorphs. In the present work, we provide a unifying framework for indexing reciprocal-space maps obtained by GIXD for monoclinic lattices and lattices of higher symmetry. Our approach of including the Bragg peak from a specular X-ray diffraction experiment into the mathematical formalism is of considerable help for indexing of GIXD patterns, where the spatial orientation of the unit cell must be considered. Mathematical expressions with a significantly reduced number of unit-cell parameters are derived, which facilitates the computational efforts. For crystallographic lattices of higher symmetry, where the set of unit-cell parameters is reduced, the specular diffraction peak is still important for determining the orientation of the crystallographic unit cell relative to the sample surface. Procedures are described in detail for how to use the derived mathematical expressions. We demonstrate the high value of our approach by successfully applying our formalism for indexing diffraction patterns of two organic semiconductors grown as crystalline thin films on graphite surfaces. We find a monoclinic lattice for diindenoperylene and an orthorhombic lattice for ortho-difluorosexiphenyl, the unit-cell parameters of which were successfully determined following our approach.

APPENDIX A Alternative rotation parameters if no contact plane exists
If u, v and w have to be assumed to be non-integers, it may be preferable to replace the vector g uvw by a sample surface normal vector n = (sin sin È, Àcos sin È, cosÈ) T with the rotation angles È and . Then for the monoclinic system the following expression can be derived: The same equation is valid in the orthorhombic case. For the tetragonal and cubic systems the following expression is valid: Therefore, especially in the cubic case, it is much easier to solve the equation first, as in the case of powder diffraction, and then to determine the rotation parameters. Note that for DIP È = 76.11 and = 149.37 . In the case of o-F 2 -6P È = 90 and = 180 .

APPENDIX B Mathematical expressions for tetragonal, trigonal and hexagonal systems
In Table 4 we summarize the mathematical expressions for g xyz , g z , g xy and the volume V in trigonal and hexagonal systems.