]> git.uio.no Git - u/mrichter/AliRoot.git/blame - EVE/alice-macros/muon_raw.C
Coverity
[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__)
21
22#include "AliMUONDigitMaker.h"
23#include "AliMUONDigitStoreV2R.h"
24
25#include "AliMpCDB.h"
26
27#include "AliRawReader.h"
28
29#include "EveBase/AliEveEventManager.h"
30
31#include <TEveManager.h>
32#include <TEveUtil.h>
33#include <TEveQuadSet.h>
34
35#include <TStyle.h>
36#include <Riostream.h>
37#include <TROOT.h>
38
39#endif
40
41void muon_raw()
42{
43 // load mapping
44 AliMpCDB::LoadAll(kFALSE);
45
46 // load raw data
47 AliRawReader* reader = AliEveEventManager::AssertRawReader();
48 if ( reader->GetEventHeader() )
49 cout << "RUN " << reader->GetRunNumber() << " EVENT " << reader->GetEventIndex() << endl;
50 else
51 cout << "NO EVENT HEADER ?" << endl;
52
53 // convert raw to digits
54 AliMUONDigitMaker digitMaker;
55 digitMaker.SetMakeTriggerDigits(kTRUE);
56 AliMUONDigitStoreV2R digitStore;
57 digitMaker.Raw2Digits(reader,&digitStore);
58 if (digitStore.GetSize() == 0 && !gEve->GetKeepEmptyCont()) return;
59
60 // container for graphic representation of digits
61 TEveElementList* cont = new TEveElementList("MUON Raw digits");
62 cont->SetTitle(Form("N=%d",digitStore.GetSize()));
63
64 TEveQuadSet* bending = new TEveQuadSet(TEveQuadSet::kQT_RectangleXY, kFALSE, 32);
65 bending->SetName("Bending");
66 bending->SetRenderMode(TEveDigitSet::kRM_Fill);
67 bending->SetPickable(kFALSE);
68 cont->AddElement(bending);
69
70 TEveQuadSet* nonBending = new TEveQuadSet(TEveQuadSet::kQT_RectangleXY, kFALSE, 32);
71 nonBending->SetName("Non bending");
72 nonBending->SetRenderMode(TEveDigitSet::kRM_Line);
73 nonBending->SetPickable(kFALSE);
74 cont->AddElement(nonBending);
75
76 // add digits to the containers
77 TEveUtil::LoadMacro("muon_digits.C+");
78 TIter next(digitStore.CreateIterator());
79 gROOT->ProcessLine(Form("add_muon_digits((TIter*)%p, (TEveQuadSet*)%p, (TEveQuadSet*)%p, kTRUE);",
80 &next, bending, nonBending));
81
82 // set containers' title
83 bending->SetTitle(Form("N=%d",bending->GetPlex()->Size()));
84 nonBending->SetTitle(Form("N=%d",nonBending->GetPlex()->Size()));
85
86 // automatic scaling
87 gStyle->SetPalette(1);
88 bending->AssertPalette();
89 nonBending->AssertPalette();
90
91 // add graphic containers
92 gEve->DisableRedraw();
93 gEve->AddElement(cont);
94 gEve->EnableRedraw();
95 gEve->Redraw3D();
96}