Most techniques for aligning photographs involve Control points at some stage.
The principle is that by identifying the same physical features (a door, a tree, whatever) in more than one photo, it is possible to establish facts about the relative camera orientations mathematically. The pano12 library contains a program called PTOptimizer that does this job.
Each of these real-world features is defined as a pair of control points. Usually two pairs of control points are sufficient to simply align one photograph against another, and more photographs require more pairs - This alignment process is called control point optimisation.
Control points can be picked manually by clicking with a mouse, and there are a number of GUI front-ends to help you do this. There are other tools such as autopano-sift and autopano that can generate control points automatically with some limitations.
In addition to these simple control points, PTOptimizer allows users to define horizontal control points, vertical control points and straight line control points. These have various uses, but mainly they are good for Leveling a Finished Panorama and perspective correction.