- jwebb's home page
- Posts
- 2019
- 2018
- 2017
- 2016
- 2015
- 2014
- 2013
- November (1)
- October (1)
- September (1)
- July (1)
- June (1)
- April (1)
- March (3)
- February (1)
- January (1)
- 2012
- 2011
- December (2)
- September (3)
- August (5)
- July (6)
- June (6)
- May (1)
- April (5)
- March (5)
- February (2)
- January (2)
- 2010
- December (3)
- October (3)
- September (2)
- August (2)
- June (2)
- May (4)
- April (4)
- March (2)
- February (4)
- January (10)
- 2009
- 2008
- 2007
- 2006
- July (1)
- My blog
- Post new blog entry
- All blogs
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