#include <iostream.h>
#include <stdio.h>
#include <stdlib.h>
#include "TFndRawEqp.h"

ClassImp(TFndRawEqp);

///////////////////////////////////////////////////////////////////////////////
//                                                                           //
//  TFndRawEqp is the fundamental class of Finuda Raw                        //
//                                                                           //
////////////////////////////////////////////////////////////////////////////////
 TFndRawEqp::TFndRawEqp() {
//
//Class default costructor
//
  memset (fEqp, (Int_t)NULL ,sizeof(fEqp) );
  memset (fEqpLen,(Int_t)0  ,sizeof(fEqpLen));
} 

 TFndRawEqp::TFndRawEqp(UInt_t *raw, Int_t j) {
//
//Class costructor
//
  memset (fEqp, (Int_t)NULL ,sizeof(fEqp) );
  memset (fEqpLen,(Int_t)0  ,sizeof(fEqpLen));
  
  UInt_t *det = raw[7+j]? raw+raw[7+j] : (UInt_t*) NULL;
  for (Int_t k=0;k<kN_EQP; k++) {
    UInt_t *eqp = det[6+k] ? det+det[6+k] : (UInt_t*) NULL;
    if (eqp){ 
      fEqpLen[k] = eqp[0]-1;
      fEqp[k]    = new UInt_t[fEqpLen[k]];
      memcpy(fEqp[k] ,eqp+1,fEqpLen[k]*sizeof(UInt_t));
    }
  }
}

 TFndRawEqp::~TFndRawEqp() {
  for(Int_t i=0; i<kN_EQP; i++) delete [] fEqp[i];
}

 void TFndRawEqp::PrtEqp(Int_t neqp) {
  
  UInt_t *equ=0;
  Int_t eqplen=0;
  equ = this->GetEqp(neqp);
  if(equ) {
    eqplen = this->GetEqpLen(neqp);
    cout << " equipment " << neqp << ", length " << eqplen << endl;
    for(Int_t i=1;i<=eqplen;i++) cout << "content of channel " << i << " is " << *equ++ << endl;
  }
}

 void TFndRawEqp::Dump() {
//
//Dump Raw Event
//
  for(Int_t k = 0;k<kN_EQP; k++) if (fEqpLen[k]) {
    cout << "eqp#" << k << "(" << fEqpLen[k] << ")" << ":";
    for(UInt_t h=0; h < fEqpLen[k]; h++) cout << fEqp[k][h] << " ";
    cout<<endl;
  }
}

 void TFndRawEqp::Streamer(TBuffer &R__b) {
//
//Stream an object of class TFndRaw
//
  if(R__b.IsReading()) { 
    Version_t R__v = R__b.ReadVersion(); if(R__v) {}
    TObject::Streamer(R__b);
    int i;
    R__b >> i;
    while(i) {
      R__b >> fEqpLen[--i];
      fEqp[i] = new UInt_t[fEqpLen[i]];
      for(UInt_t k = 0; k < fEqpLen[i];k++) R__b >> fEqp[i][k];
      R__b >> i;
    }
  } else {
    R__b.WriteVersion(TFndRawEqp::IsA());
    TObject::Streamer(R__b);
    for(int i = 0;i<kN_EQP;i++) if (fEqpLen[i]) {
      R__b << i+1;
      R__b << fEqpLen[i];
      for(UInt_t k = 0; k < fEqpLen[i]; k++) R__b<< fEqp[i][k];
    }
  }
  R__b << 0;
}

/* void TFndRawEqp::ShowMembers(TMemberInspector &R__insp, char *R__parent)
{
   // Inspect the data members of an object of class TFndRawEqp.

   TClass *R__cl  = TFndRawEqp::IsA();
   Int_t   R__ncp = strlen(R__parent);
   R__insp.Inspect(R__cl, R__parent, "fEqpLen[30]", fEqpLen);
   R__insp.Inspect(R__cl, R__parent, "*fEqp[30]", &fEqp);
   TObject::ShowMembers(R__insp, R__parent);
} */








ROOT page - Class index - Top of the page

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.