// Example for SAMURAI BPC void BPCHist(){ // set raw data file TArtEventStore *eventstore = new TArtEventStore; const char* filename = "ridf/sdaq02/dayone0080.ridf";//22C+C run if(!eventstore->Open(filename)){ std::cout << "cannot open " << filename << std::endl; return; } // calibration parameters TArtSAMURAIParameters *smprm = TArtSAMURAIParameters::Instance(); smprm->LoadParameter("db/SAMURAIBPC.xml"); // TArtStoreManager is a class for accessing calibrated data TArtStoreManager *sman = TArtStoreManager::Instance(); // calibration class TArtCalibBPCHit *calibbpc = new TArtCalibBPCHit; // define histograms TH1* hid = new TH1I("hid", "BPC ID", 128, 0.5, 128.5); TH1* hlayertdc = new TH2D("hlayertdc", "BPCLayer-TDC", 2,-0.5,1.5, 4100, 0, 4100); TH1* hx = new TH1D("hx", "BPC X", 200,-150,150); // event loop int nevent = 0; while(eventstore->GetNextEvent() && nevent<10000){ calibbpc->ReconstructData(); //-------------------------------------------------------- // Get BPC hit information TClonesArray *bpchits = (TClonesArray *)sman->FindDataContainer("SAMURAIBPCHit"); if ( bpchits != 0 ){ Int_t nhit = bpchits->GetEntries(); if ( nhit > 0 ){ Double_t pos_sum = 0; for (Int_t i=0; iAt(i); hid->Fill( hit->GetID() ); hlayertdc->Fill( hit->GetLayer(), hit->GetTDC() ); pos_sum += hit->GetWirePosition(); } hx->Fill( pos_sum/nhit );// simple position determination } } // clear calibbpc->ClearData(); eventstore->ClearData(); ++nevent; } return; }