Step by Step - Include a DAQ System |
This page explains how to use all available data acquisition (DAQ) systems in ROME.
Rome DAQ | ROOT files containing ROME folders. |
Midas DAQ | MIDAS files and online |
Database DAQ | Relational database (SQL) |
User DAQ | User defined DAQ |
The Rome DAQ system writes the standard rome output. It also reads in output files from a previous execution of the analyzer. The data format is a root file containing root trees.
The Rome DAQ system is an integral part of ROME and will always be linked into the framework. Therefore the framework definition file does not need to be changed.
To activate the Rome DAQ specify 'rome' for the <DAQSystem> tag in the <Modes> section.
You must also set the run numbers and/or filenames which you want to read. Therefore you have to edit the <RunNumbers>, the <EventNumbers> and the <InputFileNames> tag.
You may also see the 'tree_write_read' example.
For an introduction to the MIDAS system please visit the MIDAS homepage.
There is an example for including the MIDAS DAQ in the rome package (examples/midas). Please read the README.txt in the directory.
The midas banks can be accessed over the gAnalyzer->GetMidasDAQ() handle. See also the Midas Banks section of the users guide.
The database DAQ system reads the main input data from a database. This is only used when your event data is located in a database system. If you have run based input-data you can not use this DAQ system.
The following example is based on the stepbystep example. It is located under 'rome/examples/stepbystepdbdaq'.
Add the following lines to the folder definition (red tags are added):
<Folder> <FolderName>PMTData</FolderName> <FolderArray>10</FolderArray> <DataBaseAccess>true</DataBaseAccess> <Field> <FieldName>ADC</FieldName> <FieldType>Int_t</FieldType> <FieldComment>ADC Value of a PMT</FieldComment> <DataBaseName>mydatabase</DataBaseName> <DataBasePath>"/PMT[run=# and event=##]/ADC"</DataBasePath> </Field> </Folder> |
Add run and event numbers. For example :
<RunNumbers>1,2</RunNumbers> <EventNumbers>1-4</EventNumbers> |
Set the DAQ system to 'database' :
<Modes> <DAQSystem>database</DAQSystem> </Modes> |
Add a database (under <MainConfiguration>) :
<DataBases> <DataBase> <Name>mydatabase</Name> <Type>xml</Type> <Connection>./xmldatabase;stepbystepdbdaq</Connection> </DataBase> </DataBases> |
Remove the first two lines in the event method of the PrintADCValues task. These are not needed anymore since we read the data from the database now. New code :
void SBSTPrintADCValues::Event() { if (gAnalyzer->GetGSP()->GetOutputOnOff()) { for (int i=0;i<10;i++) cout << gAnalyzer->GetPMTDataAt(i)->GetADC() << endl; cout << endl; } } |
You can make DAQ system for your experiment. ROME builder will make skeleton source code under include/daq and src/daq when you add DAQ in definition file.
The following example is based on the stepbystep example. It is located under 'rome/examples/stepbystepmydaq'.
Add the following lines.
<UserDAQSystems>  <UserDAQSystem>   <DAQSystemName>mydaq</DAQSystemName>  </UserDAQSystem> </UserDAQSystems> |
<DAQSystem>mydaq</DAQSystem> |
Matthias Schneebeli, Ryu Sawada | |
e-mail: ryu.sawada@cern.ch |