AliInfo displays better than std::cout
[u/mrichter/AliRoot.git] / EVE / alice-macros / muon_raw.C
CommitLineData
39d6561a 1// $Id$
2
3/**************************************************************************
4 * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
5 * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for *
6 * full copyright notice. *
7 **************************************************************************/
8
25b4bdb2 9/// \ingroup evemacros
10/// \file muon_raw.C
11/// \brief Macro to visualise rootified raw-data from MUON spectrometer
12/// (both tracker and trigger).
13///
14/// Use muon_raw() in order to run it
15///
16/// Needs that alieve_init() is already called
17///
18/// \author P. Pillot, L. Aphecetche; Subatech
39d6561a 19
20#if !defined(__CINT__) || defined(__MAKECINT__)
39d6561a 21#include <TStyle.h>
22#include <Riostream.h>
23#include <TROOT.h>
ba978640 24#include <TEveManager.h>
25#include <TEveUtil.h>
26#include <TEveQuadSet.h>
39d6561a 27
6c49a8e1 28#include <AliMUONDigitMaker.h>
29#include <AliMUONDigitStoreV2R.h>
30#include <AliMpCDB.h>
31#include <AliRawReader.h>
32#include <AliEveEventManager.h>
39d6561a 33#endif
34
35void muon_raw()
36{
37 // load mapping
38 AliMpCDB::LoadAll(kFALSE);
39
40 // load raw data
41 AliRawReader* reader = AliEveEventManager::AssertRawReader();
42 if ( reader->GetEventHeader() )
1cec595f 43 AliInfo(Form("RUN %d EVENT %d", reader->GetRunNumber(),reader->GetEventIndex()) );
39d6561a 44 else
1cec595f 45 AliInfo("NO EVENT HEADER ?");
39d6561a 46
47 // convert raw to digits
48 AliMUONDigitMaker digitMaker;
49 digitMaker.SetMakeTriggerDigits(kTRUE);
50 AliMUONDigitStoreV2R digitStore;
51 digitMaker.Raw2Digits(reader,&digitStore);
52 if (digitStore.GetSize() == 0 && !gEve->GetKeepEmptyCont()) return;
53
54 // container for graphic representation of digits
55 TEveElementList* cont = new TEveElementList("MUON Raw digits");
56 cont->SetTitle(Form("N=%d",digitStore.GetSize()));
57
58 TEveQuadSet* bending = new TEveQuadSet(TEveQuadSet::kQT_RectangleXY, kFALSE, 32);
59 bending->SetName("Bending");
60 bending->SetRenderMode(TEveDigitSet::kRM_Fill);
61 bending->SetPickable(kFALSE);
62 cont->AddElement(bending);
63
64 TEveQuadSet* nonBending = new TEveQuadSet(TEveQuadSet::kQT_RectangleXY, kFALSE, 32);
65 nonBending->SetName("Non bending");
66 nonBending->SetRenderMode(TEveDigitSet::kRM_Line);
67 nonBending->SetPickable(kFALSE);
68 cont->AddElement(nonBending);
69
70 // add digits to the containers
71 TEveUtil::LoadMacro("muon_digits.C+");
72 TIter next(digitStore.CreateIterator());
73 gROOT->ProcessLine(Form("add_muon_digits((TIter*)%p, (TEveQuadSet*)%p, (TEveQuadSet*)%p, kTRUE);",
74 &next, bending, nonBending));
75
76 // set containers' title
77 bending->SetTitle(Form("N=%d",bending->GetPlex()->Size()));
78 nonBending->SetTitle(Form("N=%d",nonBending->GetPlex()->Size()));
79
80 // automatic scaling
81 gStyle->SetPalette(1);
82 bending->AssertPalette();
83 nonBending->AssertPalette();
84
85 // add graphic containers
86 gEve->DisableRedraw();
87 gEve->AddElement(cont);
88 gEve->EnableRedraw();
89 gEve->Redraw3D();
90}