#include <iostream.h>

#include "TFndZebini.h"
#include "TMath.h"
#include "TFndHSil.h"

ClassImp(TFndHSil);

 TFndHSil::TFndHSil(Short_t f, Short_t a, Short_t b, Short_t c, Int_t d, Short_t e) {
  fHybrid  = f;
  fModule  = a;      
  fSection  = b;
  fNstrip  = c;
  fAdc     = d;
  fNoise   = e;
  if(fSection == 2) fNstrip = 2048 - fNstrip;
  Float_t fpitch = 0.005;
  Float_t zpitch = 0.01;
  Float_t x_g = 0;
  if(fSection == 0) x_g = fpitch*(512-fNstrip);
  Float_t y_g = 5;
  if(fModule == 2) y_g = 6.;
  Float_t z_g = 0.;
  if(fSection) z_g = zpitch*(fNstrip-1024);
  if(fSection == 2) fNstrip = 2048 - fNstrip;
  hmarker = new TMarker3DBox(x_g,y_g,z_g,0.1,0.1,0.1,0.,0.);
}

 TFndHSil::~TFndHSil() {
  delete hmarker;
}

 Int_t TFndHSil::IsSpy(TFndFeeMap *feemap) {
  return feemap->IsSilSpy(fHybrid,fNstrip+1);
}

 void TFndHSil::Draw(char *opt,Float_t size) {
  hmarker->SetLineColor(2);
  hmarker->SetFillColor(2);
  hmarker->SetFillStyle(3);
  
  //  hmarker->SetPosition(x_g,y_g,z_g);
  hmarker->SetSize(size,size,size);
  hmarker->Draw();
}

 void TFndHSil::MzBook(Int_t lsmo,Int_t Module) {

  Int_t *lq = &JFRDT;
  Int_t *iq = lq+8;
  
  Int_t jb;
  char* chid;
  
  Int_t nl=0;
  Int_t ns=0;
  Int_t nd=3;
  Int_t iod=9;
  Int_t nz=0; 

  Int_t lsid = 0;

  if(fSection == 0) {
    jb = -1;
    chid = "FSID";
  } else  {
    jb = -2;
    chid = "ZSID";
  }

  Int_t name = *((int*)chid);
  if(fModule == Module) {
    //    cout << "module " << Module << endl;
    mzbook_(&IXDST ,&lsid ,&lsmo ,&jb ,&name ,&nl ,&ns ,&nd ,&iod,&nz);
    Int_t istrip = (Int_t) fNstrip;
    if(fSection == 2) istrip = 2048 - istrip;
    *(iq+lsid) = istrip;
    *(iq+lsid+1) = fAdc;
    *(iq+lsid+2) = (Int_t) fNoise;

    //for(Int_t j=0; j<nd; j++) cout << "lsid+" << j << " = " << *(iq+lsid+j) << endl;
  }
}
 
 void  TFndHSil::Print() {
  printf("Sil  Hit:  Hybrid: %d; Module %d; Section %d; Strip %d; Adc %d; Noise %dn",fHybrid,fModule,fSection,fNstrip,fAdc,fNoise); 
  Float_t x_g;
  Float_t y_g;
  Float_t z_g;
  hmarker->GetPosition(x_g,y_g,z_g);
  printf("x %f, y %f, z %fn",x_g,y_g,z_g); 
}

//______________________________________________________________________________
 void TFndHSil::Streamer(TBuffer &R__b)
{
   // Stream an object of class TFndHSil.
  
  if (R__b.IsReading()) {
    Version_t R__v = R__b.ReadVersion(); 
    if (R__v==1) { }
    TObject::Streamer(R__b);
    if(R__v >= 5) R__b >> fHybrid;
    R__b >> fModule;
    if(R__v >= 4) R__b >> fSection;
    R__b >> fNstrip;
    R__b >> fAdc;
    if(R__v >= 4) R__b >> fNoise;
    Float_t x_c;
    Float_t y_c;
    Float_t z_c;
    Float_t x_l;
    Float_t y_l;
    Float_t z_l;
    Float_t x_g;
    Float_t y_g;
    Float_t z_g;
    if(R__v <= 2) {
      R__b >> x_c;
      R__b >> y_c;
      R__b >> z_c;
    } 
    if(R__v == 2) {
      R__b >> x_l;
      R__b >> y_l;
      R__b >> z_l;
      R__b >> x_g;
      R__b >> y_g;
      R__b >> z_g;
    }  
    R__b >> hmarker;
  } else {
    R__b.WriteVersion(TFndHSil::IsA());
    TObject::Streamer(R__b);
    R__b << fHybrid;
    R__b << fModule;
    R__b << fSection;
    R__b << fNstrip;
    R__b << fAdc;
    R__b << fNoise;
    R__b << hmarker;
  }
}





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.