Tagging of charged particles in the CSI barrel

This document describes how to use the software available to tag the CSI blocks hit by charged particles. The information about the CSI detector can be found here and the information on how the tagging is performed is here.

Introduction.

The purpose of the CSI tagging code is to mark (tag) the CSI blocks that have been hit by charged particles and to calculate the "total CSI energy", the "untagged energy" and the "tagged energy".

The input to the tagging routines are the following groups:

The output of the of the tagging routines are:

Tagging routines

The tagging routines are prototyped in tagCsi.h

All the routines return a status code, 0 neams success, non-0 means error.

tagCsi_makeTags
will tag the array of csiHits and return a pointer to the malloced array of tags (csiTags). After use, csiTags should be free()ed.

tagCsi_doEvent
takes an event and generates the GROUP_CSI_TAGS.

tagCsi_countEnergy
takes an array of csiHits (pointer to GROUP_CSI_HITS), and array of csiTags (pointer to GROUP_CSI_TAGS) and computes the tagged and untagged CSI energy.

tagCsi_getEnergy
takes an event, generates the tags, computes and returns the tagged and untagged CSI energy, discards the tags (does not create GROUP_CSI_TAGS).

Examples

Generate the tags and compute tagged and untagged energy:
#include <tagCsi.h> ... itape_header_t *event; /* pointer to the event buffer */ int eventSize; /* size of the event buffer */ ... float etot,etagged,euntagged; ... tagCsi_doEvent(event,eventSize); /* produce the tags */ tagCsi_countEnergy(event, data_getGroup(GROUP_CSI_HITS), data_getGroup(GROUP_CSI_TAGS), 0, &etot,&etagged,&euntagged); ...
Just compute the tagged and untagged energy:
#include <tagCsi.h> ... itape_header_t *event; /* pointer to the event buffer */ ... float etot,etagged,euntagged; ... tagCsi_getEnergy(event, &etot,&etagged,&euntagged); ...