#include "iostream.h"
#include "TFndRdt.h"
#include "TFndRawEqp.h"
#include "TFndCorbo.h"
#include "TFndTrig.h"
#include "TObjectTable.h"

ClassImp(TFndTrig);

 TFndTrig::TFndTrig() {
  fTB = -1;
  fTBCtfCtr = -1;
  fCtr = -1;
  fCtf = -1;
  for(Int_t i=0;i<16;i++) fScal[i] = -1;
  fCrb = 0;
  }

 TFndTrig::~TFndTrig() { delete fCrb; }    

 TFndTrig::TFndTrig(TFndRdt *prdt) {
  
  //    Trig equipment

  TFndRawEqp *ptrg = prdt->GetTof();
  UInt_t *ltrgptr = ptrg->GetEqp(21);
  UInt_t ltrglen = ptrg->GetEqpLen(21);
  
  if(ltrglen) {
    fTB = (*ltrgptr)&0x1;
    fTBCtfCtr = ((*ltrgptr)>>1)&0x1;
    fCtr = ((*ltrgptr)>>4)&0x1;
    fCtf = ((*ltrgptr)>>5)&0x1;
  } else {
    fTB = -1;
    fTBCtfCtr = -1;
    fCtr = -1;
    fCtf = -1;
  }
  
  //    CAMAC Scaler

  UInt_t *ltrgscal = ptrg->GetEqp(22);
  UInt_t lscallen = ptrg->GetEqpLen(22);  
  
  if(lscallen) 
    for(UInt_t i=1;i<lscallen;i++) fScal[i-1] = *(ltrgscal+i);
  
  //    CORBO
 
  fCrb = 0; 
  if(ptrg) {
    fCrb = new TFndCorbo(ptrg);
    //gObjectTable->Add((TObject *) fCrb);    
  }
}

//******************************************************************/
//*                        Print  Trigger                          */
//******************************************************************/

 void TFndTrig::Print() {
  
  cout <<  "****   Trigger   ****" << endl;
  cout << "Top*Bottom = " << fTB << endl;
  cout << "Top*Bottom*(Central Front || Central Rear) = " << fTBCtfCtr << endl;
  cout << "Central Front = " << fCtf << endl;
  cout << "Central Rear  = " << fCtr << endl;
  cout << "CAMAC Scaler" << endl;
  for(Int_t i=0;i<16;i++) cout << "fScal[" << i << "] " << fScal[i] << endl;
  if(fCrb) fCrb->Print();
}

 void TFndTrig::Streamer(TBuffer &R__b)
{
  // Stream an object of class TFndTrig.
  
  if (R__b.IsReading()) {
    Version_t R__v = R__b.ReadVersion(); if (R__v) { }
    TObject::Streamer(R__b);
    R__b >> fTB;
    R__b >> fTBCtfCtr;
    R__b >> fCtf;
    R__b >> fCtr;
    if(R__v > 1) 
      R__b.ReadStaticArray(fScal);
    if(R__v > 2)
      R__b >> fCrb;
  } else {
    R__b.WriteVersion(TFndTrig::IsA());
    TObject::Streamer(R__b);
    R__b << fTB;
    R__b << fTBCtfCtr;
    R__b << fCtf;
    R__b << fCtr;
    R__b.WriteArray(fScal, 16);
    R__b << fCrb;
  }
}







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.