![]() |
KaliVeda
Toolkit for HIC analysis
|
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 64 of file GTGanilData.h.
#include <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... | |
| void | ConnectFired (const Int_t index, Bool_t **p) const |
| Connect a pointer to a data to the defined index 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... | |
What to do with scaler buffer.
| Enumerator | |
|---|---|
| kSkipScaler | |
| kDumpScaler | |
| kReportScaler | |
| kAutoWriteScaler | have to take care of it. |
Definition at line 67 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 320 of file GTGanilData.cpp.
Connect a pointer to a data to the defined index in the Data Array.
Definition at line 337 of file GTGanilData.cpp.
Dump parameter index, name and value for the current event.
Definition at line 657 of file GTGanilData.cpp.
Dump parameter index and name.
Definition at line 674 of file GTGanilData.cpp.
|
inline |
Definition at line 109 of file GTGanilData.h.
|
inline |
Definition at line 117 of file GTGanilData.h.
|
inline |
Definition at line 113 of file GTGanilData.h.
Returns current run number.
Definition at line 739 of file GTGanilData.cpp.
|
inline |
Definition at line 123 of file GTGanilData.h.
Definition at line 95 of file GTGanilData.h.
Definition at line 100 of file GTGanilData.h.
Definition at line 750 of file GTGanilData.cpp.
|
inline |
Definition at line 91 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 486 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 387 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 234 of file GTGanilData.cpp.
Not implemented. ...
Definition at line 219 of file GTGanilData.cpp.
Print every class parameters, for now a simple dump.
Definition at line 207 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 703 of file GTGanilData.cpp.
Not used.
Definition at line 761 of file GTGanilData.cpp.