Пример #1
0
TEveBoxSet* boxset(Float_t x=0, Float_t y=0, Float_t z=0,
                   Int_t num=100, Bool_t registerSet=kTRUE)
{
   TEveManager::Create();

   TRandom r(0);
   gStyle->SetPalette(1, 0);

   TEveRGBAPalette* pal = new TEveRGBAPalette(0, 130);

   TEveFrameBox* frm = new TEveFrameBox();
   frm->SetAABoxCenterHalfSize(0, 0, 0, 12, 12, 12);
   frm->SetFrameColor(kCyan);
   frm->SetBackColorRGBA(120,120,120,20);
   frm->SetDrawBack(kTRUE);

   TEveBoxSet* q = new TEveBoxSet("BoxSet");
   q->SetPalette(pal);
   q->SetFrame(frm);
   q->Reset(TEveBoxSet::kBT_AABox, kFALSE, 64);
   for (Int_t i=0; i<num; ++i) {
      q->AddBox(r.Uniform(-10, 10), r.Uniform(-10, 10), r.Uniform(-10, 10),
                r.Uniform(0.2, 1),  r.Uniform(0.2, 1),  r.Uniform(0.2, 1));
      q->DigitValue(r.Uniform(0, 130));
   }
   q->RefitPlex();

   TEveTrans& t = q->RefMainTrans();
   t.SetPos(x, y, z);

   // Uncomment these two lines to get internal highlight / selection.
   // q->SetPickable(1);
   // q->SetAlwaysSecSelect(1);

   if (registerSet)
   {
      gEve->AddElement(q);
      gEve->Redraw3D(kTRUE);
   }

   return q;
}
Пример #2
0
void hmpid_raw()
{
    printf("*** RAW HMPID ***");
    
  const Char_t *name[] = { "HMPID0", "HMPID1", "HMPID2", "HMPID3",
			   "HMPID4", "HMPID5", "HMPID6" };

  AliRawReader *rawReader = AliEveEventManager::AssertRawReader();
  AliHMPIDRawStream stream(rawReader);    

  TEveElementList* list = new TEveElementList("HMPID Raw");
  gEve->AddElement(list);

  gStyle->SetPalette(1, 0);

  TEveRGBAPalette *pal = new TEveRGBAPalette(0, 3000);
  pal->SetMax(1000);
  TEveFrameBox    *box = new TEveFrameBox();
  box->SetAAQuadXY(0, 0, 0, 144, 121);
  box->SetFrameColor(kGray);

  TEveQuadSet* ms[7];
  for (Int_t iCh = 0; iCh < 7; ++iCh)
  {
    ms[iCh] = new TEveQuadSet(Form("Chamber %d", iCh));

    TEveQuadSet* q = ms[iCh];
    q->SetOwnIds(kTRUE);
    q->SetPalette(pal);
    q->SetFrame(box);
    q->SetAntiFlick(kTRUE);
    q->SetPickable(kTRUE);

    q->Reset(TEveQuadSet::kQT_RectangleXYFixedDimZ, kFALSE, 64);
    q->SetDefCoord(0);
    q->SetDefHeight(0.84f);
    q->SetDefWidth(0.8f);
  }

  while (stream.Next())
  {
    Int_t ch = AliHMPIDParam::DDL2C(stream.GetDDLNumber());
    TEveQuadSet* q = ms[ch];

    for (Int_t iPad = 0; iPad < stream.GetNPads(); ++iPad)
    {
      AliHMPIDDigit dig(stream.GetPadArray()[iPad],stream.GetChargeArray()[iPad]);

      q->AddQuad(dig.PadChX()*0.8f,  dig.PadChY()*0.84f);
      q->QuadValue(TMath::Nint(dig.Q()));
      q->QuadId(new AliHMPIDDigit(dig));
    }
  }

  for (Int_t iCh = 0; iCh < 7; ++iCh)
  {
    TEveQuadSet* q = ms[iCh];

    q->RefitPlex();

    TGeoHMatrix mat;
    AliHMPIDv3::IdealPosition(iCh, &mat);
    q->RefMainTrans().SetFrom(mat);
    q->RefMainTrans().Move3LF(-0.5*144, -0.5*121, 0);

    list->AddElement(q);
  }

  gEve->Redraw3D();
}