ROOT logo
/**************************************************************************
 * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
 * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for          *
 * full copyright notice.                                                 *
 **************************************************************************/

#if !defined(__CINT__) || defined(__MAKECINT__)
#include <TGeoMatrix.h>
#include <TStyle.h>
#include <TEveElement.h>
#include <TEveFrameBox.h>
#include <TEveManager.h>
#include <TEveRGBAPalette.h>
#include <TEveTrans.h>
#include <TEveQuadSet.h>

#include <AliHMPIDDigit.h>
#include <AliHMPIDv3.h>
#include <AliHMPIDRawStream.h>
#include <AliRawReader.h>
#include <AliEveEventManager.h>
#endif

void hmpid_raw()
{
  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();
}
 hmpid_raw.C:1
 hmpid_raw.C:2
 hmpid_raw.C:3
 hmpid_raw.C:4
 hmpid_raw.C:5
 hmpid_raw.C:6
 hmpid_raw.C:7
 hmpid_raw.C:8
 hmpid_raw.C:9
 hmpid_raw.C:10
 hmpid_raw.C:11
 hmpid_raw.C:12
 hmpid_raw.C:13
 hmpid_raw.C:14
 hmpid_raw.C:15
 hmpid_raw.C:16
 hmpid_raw.C:17
 hmpid_raw.C:18
 hmpid_raw.C:19
 hmpid_raw.C:20
 hmpid_raw.C:21
 hmpid_raw.C:22
 hmpid_raw.C:23
 hmpid_raw.C:24
 hmpid_raw.C:25
 hmpid_raw.C:26
 hmpid_raw.C:27
 hmpid_raw.C:28
 hmpid_raw.C:29
 hmpid_raw.C:30
 hmpid_raw.C:31
 hmpid_raw.C:32
 hmpid_raw.C:33
 hmpid_raw.C:34
 hmpid_raw.C:35
 hmpid_raw.C:36
 hmpid_raw.C:37
 hmpid_raw.C:38
 hmpid_raw.C:39
 hmpid_raw.C:40
 hmpid_raw.C:41
 hmpid_raw.C:42
 hmpid_raw.C:43
 hmpid_raw.C:44
 hmpid_raw.C:45
 hmpid_raw.C:46
 hmpid_raw.C:47
 hmpid_raw.C:48
 hmpid_raw.C:49
 hmpid_raw.C:50
 hmpid_raw.C:51
 hmpid_raw.C:52
 hmpid_raw.C:53
 hmpid_raw.C:54
 hmpid_raw.C:55
 hmpid_raw.C:56
 hmpid_raw.C:57
 hmpid_raw.C:58
 hmpid_raw.C:59
 hmpid_raw.C:60
 hmpid_raw.C:61
 hmpid_raw.C:62
 hmpid_raw.C:63
 hmpid_raw.C:64
 hmpid_raw.C:65
 hmpid_raw.C:66
 hmpid_raw.C:67
 hmpid_raw.C:68
 hmpid_raw.C:69
 hmpid_raw.C:70
 hmpid_raw.C:71
 hmpid_raw.C:72
 hmpid_raw.C:73
 hmpid_raw.C:74
 hmpid_raw.C:75
 hmpid_raw.C:76
 hmpid_raw.C:77
 hmpid_raw.C:78
 hmpid_raw.C:79
 hmpid_raw.C:80
 hmpid_raw.C:81
 hmpid_raw.C:82
 hmpid_raw.C:83
 hmpid_raw.C:84
 hmpid_raw.C:85
 hmpid_raw.C:86
 hmpid_raw.C:87
 hmpid_raw.C:88
 hmpid_raw.C:89
 hmpid_raw.C:90
 hmpid_raw.C:91
 hmpid_raw.C:92