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

Back to the top page

void RIDF2Histo_online(){

//Loading library.

gSystem->Load("libanacore.so");

// Create event store object

TArtEventStore *estore = new TArtEventStore();

// Open shared memory.

estore->Open(0);

// Create raw event object

TArtRawEventObject *rawevent = estore->GetRawEventObject();

// Create histogram

TH1F *h1 = new TH1F("name","title",100,0.,1000.);

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

while(estore->GetNextEvent()){

// 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

h1->Fill(val);

}

// Clear rawevent object

rawevent->Clear();

}

}

Last-modified: Sun, 28 Oct 2012 21:19:18 HAST (4424d)