Method for determining the position of a door leaf relative to a door frame, wherein the method comprises at least the steps of: - obtaining at least the spatial orientation of a magnetic field vector relative to a reference direction being defined in the door leaf's coordinate system and/or the length of the magnetic field vector, and or at least one component of the magnetic field vector and or its length using at least a magnetic field sensor being attached to the door leaf; - comparing the spatial orientation and/or the length of the magnetic field vector or of at least one of its components with at least a first or a second predetermined orientation and/or first or second predetermined length, respectively, to thereby determine if the door is open or closed, wherein the door is determined to be ∘ closed, if a first closed condition is met, wherein the first closed condition is met, if the magnetic field vector points in a first predetermined direction and/or has a first predetermined length and/or at least one of its components has a first predetermined value, ∘ open, if a first open condition is met, wherein the first open condition is met if the magnetic field vector points in a second predetermined direction and/or has a second predetermined length and/or at least one of its components has a second predetermined value. - executing a calibration sequence, the calibration sequence comprising: ∘ closing the door, o initializing a calibration mode of the door lock, o obtaining at least the spatial orientation of a magnetic field relative to a reference direction being defined in the door leaf's coordinate system after the door was closed, o assigning the predetermined orientation to a vector being derived from said spatial orientation being obtained in said calibration mode while the door remained closed, characterized in that the calibration sequence further comprises - measuring at least the absolute value of the acceleration of the door leaf and - skipping thee the assigning step, if the absolute value of the mean of the acceleration and/or the maximum of the absolute value of the acceleration in the time interval starting after closing of the door and ending with the end of the measurement of the obtaining step of the calibration sequence exceed a threshold. - obtaining at least the spatial orientation of a magnetic field vector relative to a reference direction being defined in the door leaf's coordinate system and/or the length of the magnetic field vector, and or at least one component of the magnetic field vector and or its length using at least a magnetic field sensor being attached to the door leaf; - comparing the spatial orientation and/or the length of the magnetic field vector or of at least one of its components with at least a first or a second predetermined orientation and/or first or second predetermined length, respectively, to thereby determine if the door is open or closed, wherein the door is determined to be ∘ closed, if a first closed condition is met, wherein the first closed condition is met, if the magnetic field vector points in a first predetermined direction and/or has a first predetermined length and/or at least one of its components has a first predetermined value, ∘ open, if a first open condition is met, wherein the first open condition is met if the magnetic field vector points in a second predetermined direction and/or has a second predetermined length and/or at least one of its components has a second predetermined value. ∘ closed, if a first closed condition is met, wherein the first closed condition is met, if the magnetic field vector points in a first predetermined direction and/or has a first predetermined length and/or at least one of its components has a first predetermined value, ∘ open, if a first open condition is met, wherein the first open condition is met if the magnetic field vector points in a second predetermined direction and/or has a second predetermined length and/or at least one of its components has a second predetermined value. - executing a calibration sequence, the calibration sequence comprising: ∘ closing the door, o initializing a calibration mode of the door lock, o obtaining at least the spatial orientation of a magnetic field relative to a reference direction being defined in the door leaf's coordinate system after the door was closed, o assigning the predetermined orientation to a vector being derived from said spatial orientation being obtained in said calibration mode while the door remained closed, characterized in that the calibration sequence further comprises ∘ closing the door, o initializing a calibration mode of the door lock, o obtaining at least the spatial orientation of a magnetic field relative to a reference direction being defined in the door leaf's coordinate system after the door was closed, o assigning the predetermined orientation to a vector being derived from said spatial orientation being obtained in said calibration mode while the door remained closed, - measuring at least the absolute value of the acceleration of the door leaf and - skipping thee the assigning step, if the absolute value of the mean of the acceleration and/or the maximum of the absolute value of the acceleration in the time interval starting after closing of the door and ending with the end of the measurement of the obtaining step of the calibration sequence exceed a threshold.