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>
29 #include <AliMUONDigitMaker.h>
30 #include <AliMUONDigitStoreV2R.h>
32 #include <AliRawReader.h>
33 #include <AliEveEventManager.h>
39 AliMpCDB::LoadAll(kFALSE);
42 AliRawReader* reader = AliEveEventManager::AssertRawReader();
43 if ( reader->GetEventHeader() )
44 AliInfoGeneral("muon_raw.C", Form("RUN %d EVENT %d", reader->GetRunNumber(),reader->GetEventIndex()) );
46 AliInfoGeneral("muon_raw.C", "NO EVENT HEADER ?");
48 // convert raw to digits
49 AliMUONDigitMaker digitMaker;
50 digitMaker.SetMakeTriggerDigits(kTRUE);
51 AliMUONDigitStoreV2R digitStore;
52 digitMaker.Raw2Digits(reader,&digitStore);
53 if (digitStore.GetSize() == 0 && !gEve->GetKeepEmptyCont()) return;
55 // container for graphic representation of digits
56 TEveElementList* cont = new TEveElementList("MUON Raw digits");
57 cont->SetTitle(Form("N=%d",digitStore.GetSize()));
59 TEveQuadSet* bending = new TEveQuadSet(TEveQuadSet::kQT_RectangleXY, kFALSE, 32);
60 bending->SetName("Bending");
61 bending->SetRenderMode(TEveDigitSet::kRM_Fill);
62 bending->SetPickable(kFALSE);
63 cont->AddElement(bending);
65 TEveQuadSet* nonBending = new TEveQuadSet(TEveQuadSet::kQT_RectangleXY, kFALSE, 32);
66 nonBending->SetName("Non bending");
67 nonBending->SetRenderMode(TEveDigitSet::kRM_Line);
68 nonBending->SetPickable(kFALSE);
69 cont->AddElement(nonBending);
71 // add digits to the containers
72 TEveUtil::LoadMacro("muon_digits.C+");
73 TIter next(digitStore.CreateIterator());
74 gROOT->ProcessLine(Form("add_muon_digits((TIter*)%p, (TEveQuadSet*)%p, (TEveQuadSet*)%p, kTRUE);",
75 &next, bending, nonBending));
77 // set containers' title
78 bending->SetTitle(Form("N=%d",bending->GetPlex()->Size()));
79 nonBending->SetTitle(Form("N=%d",nonBending->GetPlex()->Size()));
82 gStyle->SetPalette(1);
83 bending->AssertPalette();
84 nonBending->AssertPalette();
86 // add graphic containers
87 gEve->DisableRedraw();
88 gEve->AddElement(cont);