ADC 400F Manual Pagina 66

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 74
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 65
Chapter 5. Complete program listings.
//
// At compile time, define: WITHF77UNPACKER
// and F77NPARAMS to be the maximum number of parameters the Fortran
// unpacker will fill in.
//
// In the unpacker, set FPARAMETERS(i) if i has been unpacked from
// the event.
//
//
// PARAMETERS are copied from 1 -> NUSED into parameters numbered
// NOFFSET -> NUSED+NOFFSET
// NOFFSET starts from zero.
//
// The fortran program should be compiled:
// cpp -DF77NPARAMS=nnnn yourprog.f > yourprog.for
// f77 -c yourprog.for
// rm yourprog.for
//
// Assuming you’ve writtne the file yourprog.f
#ifdef WITHF77UNPACKER
struct {
int nOffset;
int nUsed;
int nParameters[F77NPARAMS]; // Fortran will extend this appropriately.
int fParameters[F77NPARAMS];
} f77params_;
extern "C" Bool_t f77unpacker_(const Address_t pEvent);
class CFortranUnpacker : public CEventProcessor
{
public:
virtual Bool_t operator()(const Address_t pEvent, CEvent& rEvent,
CAnalyzer& rAnalyzer, CBufferDecoder& rDecoder);
};
Bool_t
CFortranUnpacker::operator()(const Address_t pEvent,
CEvent& rEvent,
CAnalyzer& rAnalyzer,
CBufferDecoder& rDecoder)
{
Bool_t result = f77unpacker_(pEvent);
if(result) {
int dest = f77params_.nOffset;
for(int i = 0; i < f77params_.nUsed; i++) {
if(f77params_.fParameters[i])
rEvent[dest] = f77params_.nParameters[i];
dest++;
}
61
Vista de pagina 65
1 2 ... 61 62 63 64 65 66 67 68 69 70 71 72 73 74

Comentarios a estos manuales

Sin comentarios