Accessing Trigger Data Files w/in StRoot
// 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");
}
- jwebb's blog
- Login or register to post comments