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 **************************************************************************/
11 /// \brief Macro to visualise rootified raw-data from MUON spectrometer
12 /// (both tracker and trigger).
14 /// Use muon_raw() in order to run it
16 /// Needs that alieve_init() is already called
18 /// \author P. Pillot, L. Aphecetche; Subatech
20 #if !defined(__CINT__) || defined(__MAKECINT__)
22 #include <Riostream.h>
24 #include <TEveManager.h>
26 #include <TEveQuadSet.h>
28 #include <AliMUONDigitMaker.h>
29 #include <AliMUONDigitStoreV2R.h>
31 #include <AliRawReader.h>
32 #include <AliEveEventManager.h>
38 AliMpCDB::LoadAll(kFALSE);
41 AliRawReader* reader = AliEveEventManager::AssertRawReader();
42 if ( reader->GetEventHeader() )
43 AliInfo(Form("RUN %d EVENT %d", reader->GetRunNumber(),reader->GetEventIndex()) );
45 AliInfo("NO EVENT HEADER ?");
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;
54 // container for graphic representation of digits
55 TEveElementList* cont = new TEveElementList("MUON Raw digits");
56 cont->SetTitle(Form("N=%d",digitStore.GetSize()));
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);
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);
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));
76 // set containers' title
77 bending->SetTitle(Form("N=%d",bending->GetPlex()->Size()));
78 nonBending->SetTitle(Form("N=%d",nonBending->GetPlex()->Size()));
81 gStyle->SetPalette(1);
82 bending->AssertPalette();
83 nonBending->AssertPalette();
85 // add graphic containers
86 gEve->DisableRedraw();
87 gEve->AddElement(cont);