ADC 400F Manuel Page 66

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 74
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 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
Vue de la page 65
1 2 ... 61 62 63 64 65 66 67 68 69 70 71 72 73 74

Commentaires sur ces manuels

Pas de commentaire