26#include <gan_tape_erreur.h>
27#include <gan_tape_general.h>
28#include <gan_tape_param.h>
29#include <gan_tape_test.h>
30#include <gan_tape_alloc.h>
31#include <gan_tape_mount.h>
32#include <gan_tape_file.h>
33#include <acq_mt_fct_ganil.h>
34#include <acq_ebyedat_get_next_event.h>
35#include <gan_tape_get_parametres.h>
50#include "GTGanilData.h"
52bool AutoswBuf, Swbufon;
151 fBuffer =
new in2p3_buffer_struct;
159 fStatus = acq_get_param_env(lun_id, &DeRetour, argc, argv);
160 if (DeRetour.Val_INT >= 0)
fLun = DeRetour.Val_INT;
164 fStatus = acq_get_param_env(device_id, &DeRetour, argc, argv);
165 strncpy(
fDevice->DevName, DeRetour.Val_CAR, MAX_CARACTERES);
169 fStatus = acq_get_param_env(autoswbuf_id, &DeRetour, argc, argv);
170 AutoswBuf = DeRetour.Val_BOL;
172 fStatus = acq_get_param_env(swbufon_id, &DeRetour, argc, argv);
173 Swbufon = DeRetour.Val_BOL;
176 fStatus = acq_get_param_env(ctrlform_id, &DeRetour, argc, argv);
179 fStatus = acq_get_param_env(density_id, &DeRetour, argc, argv);
182 fStatus = acq_get_param_env(bufsize_id, &DeRetour, argc, argv);
187 fStatus = acq_get_param_env(evbsize_id, &DeRetour, argc, argv);
190 fStatus = acq_get_param_env(evcsize_id, &DeRetour, argc, argv);
242 Int_t structEvent_size = STRUCTEVENTSIZE;
247 gan_tape_erreur(
fStatus,
"test d'allocation");
254 cout <<
"This tape drive is already in use !" << endl;
255 gan_tape_erreur(
fStatus,
"allocation");
261 if (
fStatus == ACQ_ALREADYMOUNT)
262 cout <<
"The tape you want to use is already mounted" << endl;
263 gan_tape_erreur(
fStatus,
"mount");
269 gan_tape_erreur(
fStatus,
"open");
279 gan_tape_erreur(
fStatus,
"Init Run");
282 cout <<
"Run " <<
fRunNumber <<
" opened" << endl;
303 if (strcmp(
fHeader, PARAM_Id) == 0)
306 while (strcmp(
fHeader, PARAM_Id) == 0);
325 cout <<
"Invalid connexion:" <<
index <<
". Valid only in 1<=index<="
342 cout <<
"Invalid connexion:" <<
index <<
". Valid only in 1<=index<="
432 if (strcmp(
fHeader, SCALER_Id) == 0) {
454 cout <<
"GTGanilData::Next: unexpected value for fWhatScaler" << endl;
457 if (strcmp(
fHeader, EVENTDB_Id) == 0) {
463 else if (strcmp(
fHeader, EVENTCT_Id) == 0) {
469 else if (strcmp(
fHeader, EBYEDAT_Id) == 0) {
475 cout <<
"Unknown header in GTGanilData::Next:" <<
fHeader << endl;
496 TFile theTreeFile(theFilename,
"recreate");
497 TTree theTree(
"AutoTree",
"Automatic filled Tree");
500 TString parType = parName +
"/s";
507 if (nEvents <= 0)
break;
533 puts(
"\n>>> Erreur de reconstruction");
537 else if (
fStatus == ACQ_ENDOFBUFFER) {
542 gan_tape_erreur(
fStatus,
"obtention d'evenement");
552 else if (
fStatus == ACQ_ENDOFBUFFER) {
557 gan_tape_erreur(
fStatus,
"obtention d'evenement");
576 UNSINT16* ebyeEventCtrl;
579 else if (
fStatus == ACQ_ENDOFBUFFER) {
584 cout <<
" in ReadNextEvent__EBEYEDAT error status: " <<
fStatus <<
" n";
631 Short_t* brutData = &(pCtrlEvent->ct_par);
640 for (
Int_t i = 0; i < eventLength; i += 2) {
643 fFired[brutData[i]] =
true;
661 cout <<
"--------- DUMPING EVENT ----------------------------" << endl;
666 cout <<
"--------- END ----------------------------" << endl;
678 cout <<
"--------- DUMPING PARAMETERS ----------------------------" << endl;
684 cout <<
"--------- END ----------------------------" << endl;
726 cout <<
"Error in <GTGanilData::SetScalerBuffersManagement> : ";
727 cout <<
"You must open a writable TFile before calling SetScalerBuffersManagement(kAutoWriteScaler)" << endl;
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char filename
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
R__EXTERN TSystem * gSystem
const char * GetParName(const int index) const
Return the text label name corresponding to a parameter number.
int Fill(const char *buffParam)
Read GANIL formatted tapes or files.
Int_t fLun
Logical number of the device.
Int_t fRunNumber
current file run number
char fHeader[9]
Buffer header.
void ConnectFired(const Int_t index, Bool_t **p) const
Connect a pointer to a data to the defined index in the Data Array.
UShort_t * fEventBrut
Brut data buffer.
void InitDefault(const Int_t argc=0, char **argv=NULL)
bool fAllocated
True if the Tape is allocated (useless?)
Int_t fEventCount
Our event counter.
Int_t fEventNumber
Local event number in current buffer (should be renamed)
GTScalers * fScaler
Scaler array.
Int_t fCtrlForm
Fix/variable length events.
void DumpEvent(void) const
Dump parameter index, name and value for the current event.
gan_tape_desc * fDevice
Device structure (ganil_tape interface)
void Connect(const Int_t index, UShort_t **p) const
Connect a pointer to a data to the defined index in the Data Array.
Int_t fDensity
Tape density.
char * fStructEvent
??? (ganil_tape interface)
Int_t GetRunNumber(void) const
Returns current run number.
Int_t fStatus
Status, 0 is OK, any other value suspect.
void SetFileName(const TString filename)
TString fDateStart
Date/time of start of run read from file.
UShort_t * fEventCtrl
Control data buffer.
bool ReadNextEvent_EBYEDAT(void)
void PrintRunParameters(void) const
Print every class parameters, for now a simple dump.
virtual void SetUserTree(TTree *)
Not used.
bool fIsCtrl
We are currently in a CTRL buffer.
bool fIsScalerBuffer
The current buffer is a scaler buffer.
void DumpParameterName(void) const
Dump parameter index and name.
in2p3_buffer_struct * fBuffer
Brut data buffer (ganil_tape interface)
Bool_t IsOpen(void) const
Bool_t * fFired
fired parameters in each event
virtual void ReadParameters(void)
GTGanilData()
Default constructor.
GTDataParameters * fDataParameters
Data parameters names class.
TString fFileName
Filename, can be a tape drive.
Int_t fBufSize
Buffer size.
Int_t fDataArraySize
Data array size.
void SetScalerBuffersManagement(const ScalerWhat_t sc)
UShort_t * fDataArray
Physical data array.
Int_t fEvbsize
Size of the brut data buffer.
ScalerWhat_t fWhatScaler
What do we do with scalers buffers.
void MakeTree(const TString filename="", UInt_t nEvents=kMaxUInt)
virtual ~GTGanilData(void)
virtual bool EventUnravelling(CTRL_EVENT *)
Int_t fEvcsize
Size of the ctrl data buffer.
Int_t fCTRLEVNT_HD
size (in 16-bit words) of CTRL_EVNT header
void PrintDataParameters(void) const
TTree * fScalerTree
Scaler tree for automatic filling.
ScalerWhat_t
What to do with scaler buffer.
@ kAutoWriteScaler
have to take care of it.
Handle scaler buffers in GANIL DAQ data.
void DumpScalers(void)
Dump scalers value on cout.
TString & Remove(EStripType s, char c)
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
virtual int Load(const char *module, const char *entry="", Bool_t system=kFALSE)
Int_t Write(const char *name=nullptr, Int_t option=0, Int_t bufsize=0) const override
virtual Int_t Branch(const char *folder, Int_t bufsize=32000, Int_t splitlevel=99)
union SCALE::JBUS_SCALE jbus_scale
UNSINT16 Info_jbus[NB_MAX_JBUS]
scale_struct UnScale[NB_MAX_CHANNEL]