Certainly this is one good way of doing this. The thoughts I have had here is rather along the line of hiding all of this stuff, not inside a new class but in the rawdatainput, input classes and with methods that could define sequence or other reading of files say as in input=new BrRawDataInput(...) or new BrEventIO input->SetFileDirectory(.. ) or DataDirectory input->SetRunNumber(...) or alternative (in case one wanted to read a specific sample of files) input->AddFile("file1") input->AddFile("file2") This would then require just a single open and not a double loop. By doing this want could possible get away from the Open(...) all together and replace by a call to BrIOModule->Init() giving more uniform across IO modules and analysis modules. Could you place the code a suitable place so we can take a look how this effect the Open before being commited Thanks for the information, it is a good idea to standardize this access. Adding what you have should not prevent us from changing methods later. Flemming ----- Original Message ----- From: "Claus O. E. Jorgensen" <ekman@nbi.dk> To: <brahms-dev-l@bnl.gov> Sent: Tuesday, October 10, 2000 10:39 AM Subject: BrSequenceManager > > I've made a new managerclass, that makes it easy to > get events from sequential sequence files from a specific > run. > > Here is an example on how it can be used: > > { > input = new BrRawDataInput("data input"); > > BrSequenceManager* seqMan = BrSequenceManager::Instance(); > seqMan->SetDataDirectory("foo/"); > seqMan->SetRunNumber(4711); > > file://sequence loop > while(1) { > > if (!input->Open(seqMan->GetNextSequenceFile(),"DISKFILE")) > break; > > file://event loop > while(!input->Eof()) { > BrEvent* event = new BrEvent("event", 1, 1); > > input->Event(event); > > //... > > delete event; > } > input->Close(); > } > } > > Is this a bad idea, or should it be done different? If I > don't hear from you, I will commit it one of these days. > > Cheers, > Claus > > > ------------------------------ > Claus Jorgensen > > Phone : (+45) 33 32 49 49 > Office : (+45) 35 32 53 05 > E-mail : ekman@nbi.dk > >
This archive was generated by hypermail 2b29 : Tue Oct 10 2000 - 11:45:35 EDT