next up previous contents
Next: Fiber Cluster level functions Up: SF Interface Functions Previous: Pixel Cluster level functions   Contents

Fiber level functions

The next class of functions deal with information pertaining to a single fiber. The information available includes the position of the fiber in the detector, the position on the CCD image, and whether or not that fiber has been marked as hit. Most of these routines use the FIBER common block.


int num_fidfib_sheet(int iit, int isc);
int num_fib_sheet(int iit, int isc);
int get_fiber_id(int id);
int get_fiber_schem(int ixy,int isc,int ish,int ifib);
int get_fiber_ccd(int iitn,float x,float y);
int get_fiber_rs(float x,float y,float z,int ixy);
int get_fiber_pos(float pos,int ixy,int isc);
int get_fiber_intersect(float x1,float y1,float z1,float x2,float y2,float z2,int ixy,int isc);
int get_next_fiber(void);
int get_nth_fiber_hit(int n);
void put_fiber_hit(void);
void clear_fiber_hits(void);

The functions num_fidfib_sheet() and num_fib_sheet() do not use any common blocks. They simply return the number of fiducial fibers or total number of fibers in the specified sheet.

The remaining routines function more or less as the routines previously described, differing only in their arguments.

get_fiber_id() takes a fiber id number and fills the common block with the information which describes that fiber. A fiber id number is defined as $((iit<<24)\vert(isc<<16)\vert(ifib))$, where iit is the IIT number, isc is the section number, and ifib is the fiber number. get_fiber_id() returns the hit weight of the fiber.

get_fiber_schem() is almost the same as get_fiber_id, except that it takes the fiber's schematic coordinates as arguments rather than its id number.

get_fiber_ccd() takes a CCD position and attempts to find the closest fiber. A fiber is always returned in the common block, even if the point specified is far from the fiber bundle. It is up to the user to determine if this information is useful or not.

get_fiber_rs() takes a point in the detector and a dimension (X or Y) and finds the corresponding fiber which most closely passes that point. Again, as with get_fiber_ccd(), a fiber is always returned, regardless of how far from the detector the input point is.

get_fiber_pos() is like get_fiber_rs(), except rather than specifying a single point (three coordinates in three dimensional space), the user may specify only two coordinates, one coordinate parallel to the beam axis, another perpendicular. The value of the flag ixy determines whether the transverse coordinate is interpreted as an X coordinate or a Y coordinate. The missing coordinate is assumed to be near the center of the detector.

get_fiber_intersect() takes two points, a dimension, and a section number as input. This routine fills the common block with the fiber in the specified section which passes closest to the line formed by the two points given as arguments. This routine can be useful for tracking.

get_next_fiber() can be used to easily loop over all fibers. It works by reading the current contents of the FIBER common block and returning the fiber with the lowest id number greater than the current fiber's id number. To use this function to loop over all fibers, the FIBER common block must be manually initialized with ``fiber 0'', a fictitious zeroth fiber, so that when this routine is called for the first time, the first fiber is returned.

get_nth_fiber_hit() works like get_nth_pixel_hit(), only with fibers rather than pixels.

put_fiber_hit() records the current contents of the common block in the main data structures. (Only the hit information is recorded. This function can not be used to change fiber geometry information.)

clear_fiber_hits() removes all fiber hit information from memory. Fiber geometry information is preserved and cannot be removed.


next up previous contents
Next: Fiber Cluster level functions Up: SF Interface Functions Previous: Pixel Cluster level functions   Contents
K2K experimant account
2000-02-22