KaliVeda
1.12/06
Heavy-Ion Analysis Toolkit
|
Read GANIL formatted tapes or files.
Usage can be as simple as: GTGanilData myData("filename.dat");
It allow connection of data parameters values by Connect() routines that can operate with the index or the parameter name.
Values of parameters are stored in an array of UShort_t (0 - 65535) Before reading a new event, every parameter is set to 65535 Casting back this value to a Short_t (-32768 to 32768) gives "-1" which is the signal that the parameter's coder did not fire in the event that was read.
Definition at line 63 of file GTGanilData.h.
Public Types | |
enum | ScalerWhat_t { kSkipScaler , kDumpScaler , kReportScaler , kAutoWriteScaler } |
What to do with scaler buffer. More... | |
Public Member Functions | |
GTGanilData () | |
Default constructor. More... | |
GTGanilData (const TString filename) | |
Create the reading class over the given file with all defaults values. More... | |
virtual | ~GTGanilData (void) |
void | Connect (const Int_t index, UShort_t **p) const |
Connect a pointer to a data to the defined index in the Data Array. More... | |
Bool_t | Connect (const TString parName, UShort_t **p) const |
Connect a pointer to a data to a given parameter name in the Data Array. More... | |
void | DumpEvent (void) const |
Dump parameter index, name and value for the current event. More... | |
void | DumpParameterName (void) const |
Dump parameter index and name. More... | |
GTDataParameters * | GetDataParameters () const |
Int_t | GetEventCount () const |
const TList * | GetListOfDataParameters () const |
Int_t | GetRunNumber (void) const |
Returns current run number. More... | |
TString | GetRunStartDate () const |
GTScalers * | GetScalers (void) |
Int_t | GetStatus (void) const |
Bool_t | IsOpen (void) const |
bool | IsScalerBuffer (void) const |
void | MakeTree (const TString filename="", UInt_t nEvents=kMaxUInt) |
bool | Next (void) |
void | Open (void) |
void | PrintDataParameters (void) const |
void | PrintRunParameters (void) const |
Print every class parameters, for now a simple dump. More... | |
void | SetFileName (const TString filename) |
void | SetScalerBuffersManagement (const ScalerWhat_t sc) |
virtual void | SetUserTree (TTree *) |
Not used. More... | |
Protected Member Functions | |
virtual bool | EventUnravelling (CTRL_EVENT *) |
void | InitDefault (const Int_t argc=0, char **argv=NULL) |
void | ReadBuffer (void) |
bool | ReadNextEvent (void) |
bool | ReadNextEvent_EBYEDAT (void) |
virtual void | ReadParameters (void) |
Protected Attributes | |
bool | fAllocated |
True if the Tape is allocated (useless?) More... | |
in2p3_buffer_struct * | fBuffer |
Brut data buffer (ganil_tape interface) More... | |
Int_t | fBufSize |
Buffer size. More... | |
Int_t | fCTRLEVNT_HD |
size (in 16-bit words) of CTRL_EVNT header More... | |
Int_t | fCtrlForm |
Fix/variable length events. More... | |
UShort_t * | fDataArray |
Physical data array. More... | |
Int_t | fDataArraySize |
Data array size. More... | |
GTDataParameters * | fDataParameters |
Data parameters names class. More... | |
TString | fDateStart |
Date/time of start of run read from file. More... | |
Int_t | fDensity |
Tape density. More... | |
gan_tape_desc * | fDevice |
Device structure (ganil_tape interface) More... | |
Int_t | fEvbsize |
Size of the brut data buffer. More... | |
Int_t | fEvcsize |
Size of the ctrl data buffer. More... | |
UShort_t * | fEventBrut |
Brut data buffer. More... | |
Int_t | fEventCount |
Our event counter. More... | |
UShort_t * | fEventCtrl |
Control data buffer. More... | |
Int_t | fEventNumber |
Local event number in current buffer (should be renamed) More... | |
TString | fFileName |
Filename, can be a tape drive. More... | |
char | fHeader [9] |
Buffer header. More... | |
bool | fIsCtrl |
We are currently in a CTRL buffer. More... | |
bool | fIsScalerBuffer |
The current buffer is a scaler buffer. More... | |
Int_t | fLun |
Logical number of the device. More... | |
Int_t | fRunNumber |
current file run number More... | |
GTScalers * | fScaler |
Scaler array. More... | |
TTree * | fScalerTree |
Scaler tree for automatic filling. More... | |
Int_t | fStatus |
Status, 0 is OK, any other value suspect. More... | |
char * | fStructEvent |
??? (ganil_tape interface) More... | |
ScalerWhat_t | fWhatScaler |
What do we do with scalers buffers. More... | |
#include <GTGanilData.h>
What to do with scaler buffer.
Enumerator | |
---|---|
kSkipScaler | |
kDumpScaler | |
kReportScaler | |
kAutoWriteScaler | have to take care of it. |
Definition at line 66 of file GTGanilData.h.
GTGanilData::GTGanilData | ( | const TString | filename | ) |
Create the reading class over the given file with all defaults values.
Definition at line 76 of file GTGanilData.cpp.
GTGanilData::GTGanilData | ( | ) |
Default constructor.
Definition at line 64 of file GTGanilData.cpp.
|
virtual |
Definition at line 104 of file GTGanilData.cpp.
Connect a pointer to a data to the defined index in the Data Array.
Definition at line 317 of file GTGanilData.cpp.
Connect a pointer to a data to a given parameter name in the Data Array.
Definition at line 334 of file GTGanilData.cpp.
Dump parameter index, name and value for the current event.
Definition at line 661 of file GTGanilData.cpp.
Dump parameter index and name.
Definition at line 678 of file GTGanilData.cpp.
|
protectedvirtual |
PRIVATE If mode is variable length event, we have to reconstruct the Data buffer from the given event. WARNING: temporary the default: we dont check that it's really the case Before reading event, all parameters have their value set to -1 (65535 - fDataArray is UShort_t) Parameters which are not fired in the event will have value -1 (65535 - cast back to Short_t for real value)
Definition at line 620 of file GTGanilData.cpp.
|
inline |
Definition at line 108 of file GTGanilData.h.
|
inline |
Definition at line 116 of file GTGanilData.h.
|
inline |
Definition at line 112 of file GTGanilData.h.
Returns current run number.
Definition at line 743 of file GTGanilData.cpp.
|
inline |
Definition at line 122 of file GTGanilData.h.
Definition at line 94 of file GTGanilData.h.
Definition at line 99 of file GTGanilData.h.
PRIVATE Called by every constructors. Init parameters to default values Data are taken first from command line, Second from environment variables if none works, takes defaults values.
Definition at line 127 of file GTGanilData.cpp.
Definition at line 754 of file GTGanilData.cpp.
|
inline |
Definition at line 90 of file GTGanilData.h.
Automatically create and fill a tree created from ganil data. Can be use to convert a ganil tape or file to a ROOT file. The number of actual converted events is set with the nEvents parameter.
Definition at line 484 of file GTGanilData.cpp.
bool GTGanilData::Next | ( | void | ) |
Read an event on tape/file and put in into the event array return true until read fails
If scaler buffer management (fWhatScaler) has been set to kSkipScaler, kDumpScaler or kAutoWriteScaler, then every time this method returns kTRUE a new event has been read (and perhaps 1 or more scaler buffers were read and dealt with internally). In this case, a loop over all events will look like this:
while( my_gtganildata->Next() ){ // new event read from file my_gtganilData->GetFiredDataParameters()->ls(); // or whatever }
If fWhatScaler = kReportScaler then this method also returns kTRUE after reading a scaler buffer (no new event read), so that the user can do something with the scalers. In this case, a loop over all events including treatment of scaler buffers will look like this:
while( my_gtganildata->Next() ){ if( my_gtganildata->IsScalerBuffer() ){ // scaler buffer read from file GTScalers* scalers = my_gtganildata->GetScalers(); // N.B. GTGanilData::GetScalers() also resets the IsScalerBuffer() // flag ready for next event/buffer, so even if you don't // do anything with the scalers, you should call it } else { // new event read from file my_gtganilData->GetFiredDataParameters()->ls(); // or whatever } }
Definition at line 385 of file GTGanilData.cpp.
Open the data file (could be on a tape) with a few checks. Use IsOpen() to check whether the file is opened successfully. After successfully opening the file, we call ReadParameters() to fill the parameter list from the first data buffer which has to be a parameter buffer.
Definition at line 232 of file GTGanilData.cpp.
Not implemented. ...
Definition at line 217 of file GTGanilData.cpp.
Print every class parameters, for now a simple dump.
Definition at line 205 of file GTGanilData.cpp.
PRIVATE Read a single buffer from file
Definition at line 597 of file GTGanilData.cpp.
|
protected |
PRIVATE Utility routine to read events from buffers.
Definition at line 517 of file GTGanilData.cpp.
|
protected |
PRIVATE Utility routine to read EBYEDAT events from buffers. Shamelessly copied from Luc Legeard's GEvent
Definition at line 568 of file GTGanilData.cpp.
PRIVATE Read the data parameters from the current buffer, put it in the parameter list.
Definition at line 293 of file GTGanilData.cpp.
Set the name of the file to read (use if default ctor is used to create object). We check if 'filename' begins with "rfio:"; if so, we remove it
Definition at line 90 of file GTGanilData.cpp.
void GTGanilData::SetScalerBuffersManagement | ( | const ScalerWhat_t | sc | ) |
Set scaler buffers management. It can be: GTGanilData::kSkipScaler : Skip scaler buffers GTGanilData::kDumpScaler : Dump all scaler buffers on stdout GTGanilData::kAutoWriteScaler : Automatic scaler buffer management, all scalers written in a TTree To use this, the current TFile (i.e. gFile) must be writable. i.e. you should do TFile file("somefile.root", "create") and then toto.SetScalerBuffersManagement(GTGanilData::kReportScaler) GTGanilData::kReportScaler : when Next() encounters a scaler buffer, the IsScalerBuffer() flag is set to kTRUE and the data can be retrieved by calling GetScalers() (returns a pointer to a GScalers object). WARNING: this option changes the logic of a loop over all events in the file (see GTGanilData::Next()).
Definition at line 707 of file GTGanilData.cpp.
Not used.
Definition at line 765 of file GTGanilData.cpp.
|
protected |
True if the Tape is allocated (useless?)
Definition at line 148 of file GTGanilData.h.
|
protected |
Brut data buffer (ganil_tape interface)
Definition at line 140 of file GTGanilData.h.
|
protected |
Buffer size.
Definition at line 142 of file GTGanilData.h.
|
protected |
size (in 16-bit words) of CTRL_EVNT header
Definition at line 162 of file GTGanilData.h.
|
protected |
Fix/variable length events.
Definition at line 143 of file GTGanilData.h.
|
protected |
Physical data array.
Definition at line 151 of file GTGanilData.h.
|
protected |
Data array size.
Definition at line 152 of file GTGanilData.h.
|
protected |
Data parameters names class.
Definition at line 158 of file GTGanilData.h.
|
protected |
Date/time of start of run read from file.
Definition at line 161 of file GTGanilData.h.
|
protected |
Tape density.
Definition at line 139 of file GTGanilData.h.
|
protected |
Device structure (ganil_tape interface)
Definition at line 138 of file GTGanilData.h.
|
protected |
Size of the brut data buffer.
Definition at line 144 of file GTGanilData.h.
|
protected |
Size of the ctrl data buffer.
Definition at line 145 of file GTGanilData.h.
|
protected |
Brut data buffer.
Definition at line 146 of file GTGanilData.h.
|
protected |
Our event counter.
Definition at line 154 of file GTGanilData.h.
|
protected |
Control data buffer.
Definition at line 147 of file GTGanilData.h.
|
protected |
Local event number in current buffer (should be renamed)
Definition at line 153 of file GTGanilData.h.
|
protected |
Filename, can be a tape drive.
Definition at line 135 of file GTGanilData.h.
|
protected |
Buffer header.
Definition at line 150 of file GTGanilData.h.
|
protected |
We are currently in a CTRL buffer.
Definition at line 155 of file GTGanilData.h.
|
protected |
The current buffer is a scaler buffer.
Definition at line 156 of file GTGanilData.h.
|
protected |
Logical number of the device.
Definition at line 137 of file GTGanilData.h.
|
protected |
current file run number
Definition at line 149 of file GTGanilData.h.
|
protected |
Scaler array.
Definition at line 159 of file GTGanilData.h.
|
protected |
Scaler tree for automatic filling.
Definition at line 160 of file GTGanilData.h.
|
protected |
Status, 0 is OK, any other value suspect.
Definition at line 136 of file GTGanilData.h.
|
protected |
??? (ganil_tape interface)
Definition at line 141 of file GTGanilData.h.
|
protected |
What do we do with scalers buffers.
Definition at line 157 of file GTGanilData.h.