EnglishJapanese Reload Front page List of pages Search Recent changes RSS of recent changes

Back to the top page

void RIDF2Tree(){

//Loading library.


// Create event store object

TArtEventStore *estore = new TArtEventStore();

// Open RIDF file


// Get pointer of raw event object.

TArtRawEventObject *rawevent = estore->GetRawEventObject();

// Create tree object

TTree *tree = new TTree("tree","data");

// Create the leaf member for tree.

Int_t adc[32];

// Create the branch of tree


// Loop for event block.
//To get next event block., use GetNextEvent function.


// Loop for segment block.
// To get number of segment including event block, use GetNumSeg function.

for(int i=0;i<rawevent->GetNumSeg();i++){

// Assign segment block to segment object by using GetSegment function.

TArtRawSegmentObject *seg = rawevent->GetSegment(i);

// Loop for data.
//To get number of data block, use GetNumData function.

for(int j=0;j<seg->GetNumData();j++){

//Assign data block to data object by using GetData function.
//And you can get each parameter using GetXX fuctions.

TArtRawDataObject *data = seg->GetData(j);

int geo = data->GetGeo() // Geometry address

int ch = data->GetCh() // Channel number

int val = data->GetVal() // Value

adc[ch] = val;


// Clear rawevent object


// Fill tree




Last-modified: Sun, 28 Oct 2012 22:17:00 HADT (4253d)