Accessing Trigger Data Files w/in StRoot

Abstract:  Quick turn around time for zdc polarimetry studies requires fast access to the data.  All of the necessary data for the BBCs, ZDC's and VPD's are (in principle) available at trigger level.  Tools to determine polarizations have been written based on analyzing the data stored in the MuDst.  StTDBReader ("trigger data block reader") has been written to allow these codes to access to the data stored in the trigger data files with minimal effort.
 
0. Location of Code
 
/star/u/jwebb/work/2009/02-12-2009-zdc-from-trg/
 
1. Description of code / What works and what doesn't
 
There is a root object (StRoot/StTDBReader/StTDBReader.h) which is based on Pibero's trigger reader, used for online trigger montitoring.  It reads each trigger data block sequentially from the trigger data file.  It then copies the data block into the StTriggerData structure for 2009.  This is the same path the data will take when the MuDst production occurs.  (Except that the data will be read in from the full daq file instead).
 
The code can only read in one trigger data file per root session.  This means that you will need to produce a set of histograms (or numbers) from each trigger data file, then combine the histograms toghether.
 
StTriggerData2009 currently implements code to retrieve:
+ BBC ADC values
+ BBC TDC values
+ ZDC ADC values
+ ZDC TDC values
+ ZDC SMD ADC values
 
and other trigger detectors which are not used for polarimetry (eg calorimeters).
 
StTriggerData2009 currently does not implement access methods for:
+ VPD ADC values
+ VPD TDC values
 
 
2. Example macro
 
/star/u/jwebb/work/2009/02-12-2009-zdc-from-trg/tdbReader.C
 
 


// Trigger data block reader:
//
// Reads Trigger Data Block in root, makes available as StTriggerData2009
// object. Code was developed based on Pibero's trigger reader.
//

class StTDBReader;
StTDBReader *reader = 0;
#include "/afs/rhic.bnl.gov/star/packages/DEV/StRoot/StEvent/StEnumerations.h"
void tdbReader()
{

gStyle->SetHistMinimumZero();

// Load dynamic libraries
loadLibs();
reader = new StTDBReader;
reader->openTriggerDataFile("run10043078.9.dat");

StTriggerData2009 *trgData = 0;
while ( trgData = reader->next() )
{
printf("======== print values ========\n");
printf(" ZDC East ADC : "); for ( int i=1;i<=8;i++ ) { printf("%d ",trgData->zdcSMD(east,0,i)); printf("%d ",trgData->zdcSMD(east,1,i)); }
printf("\n");
printf(" ZDC West ADC : "); for ( int i=1;i<=8;i++ ) { printf("%d ",trgData->zdcSMD(west,0,i)); printf("%d ",trgData->zdcSMD(west,1,i)); }
printf("\n");
// BBC tiles
printf(" BBC East ADC : "); for (int i=1; i<=24;i++){ printf("%d ",trgData->bbcADC(east,i,0)); }; printf("\n");
printf(" BBC West ADC : "); for (int i=1; i<=24;i++){ printf("%d ",trgData->bbcADC(west,i,0)); }; printf("\n");
printf(" BBC East TAC : "); for (int i=1; i<=16;i++){ printf("%d ",trgData->bbcTDC(east,i,0)); }; printf("\n");
printf(" BBC West TAC : "); for (int i=1; i<=16;i++){ printf("%d ",trgData->bbcTDC(west,i,0)); }; printf("\n");
// VPD
// -- not implemented in StTriggerData2009 yet --
printf("======== print values ========\n");

}
}
// --------------------------------------------
void loadLibs() {
gROOT->LoadMacro("$STAR/StRoot/StMuDSTMaker/COMMON/macros/loadSharedLibraries.C");
loadSharedLibraries();
gSystem->Load("StTDBReader");
}