// $Id: Telemetry.hh,v 1.8 2005/04/06 14:03:43 thea Exp $
// Author: M. Pallavicini
// M. Pallavicini - created
// 04/01/2002 add Dump
// 07/05/2003 add montecarlo truth
/*****************************************************************************
* ESAF: Euso Simulation and Analysis Framework *
* *
* Id: SimpleTelemetry *
* Package: Electronics *
* Coordinator: Marco.Pallavicini *
* *
*****************************************************************************/
#ifndef _TELEMETRY_HH_
#define _TELEMETRY_HH_
#include <string>
#include "euso.hh"
class MacroCellData; // simulation results data from a MacroCell
class MCTruth; // montecarlo truth from LightToEuso object
////////////////////////////////////////////////////////////////////////////////
// //
// Telemetry //
// //
// Base class for Telemetry. Pure abstract class for all type of output //
// formats each daughter class will get the file informations (name,type..) //
// in the constructor //
// //
////////////////////////////////////////////////////////////////////////////////
class Telemetry {
public:
// ctor
Telemetry() {}
// dtor
virtual ~Telemetry() {}
// simulate third level triggering at TCU level and
// on-board data handling
virtual void SimulateTCU() = 0;
// open file or output stream
virtual Bool_t Open( const char* ) = 0;
// close
virtual Bool_t Close() = 0;
// write event and clear it
virtual Bool_t Write() = 0;
// clear event
virtual void Clear() = 0;
// dump summary on string
virtual string& Dump() = 0;
// add montecarlo truth
inline void SetTruth( MCTruth* tr) { fTruth = tr;}
inline MCTruth* GetTruth() { return fTruth; }
// add data from a MacroCell
virtual void Add( MacroCellData* ) = 0;
// returns number of MacroCell with data
virtual int NumCell() const = 0;
// returns data of a specific macrocell
virtual MacroCellData* GetData(int) = 0;
inline Bool_t IsOpen() const {return fIsOpen;}
private:
Bool_t fIsOpen;
MCTruth* fTruth;
protected:
inline void SetState( Bool_t s = kTRUE) { fIsOpen = s; }
ClassDef(Telemetry,0)
};
#endif