00001
00002
00003 #include "VisReco/VisMuonDT/interface/VisMuonDTContent.h"
00004 #include "VisReco/VisMuonDT/interface/VisDTDigiTwig.h"
00005 #include "VisReco/VisMuonDT/interface/VisDTRecHitsTwig.h"
00006 #include "VisReco/VisMuonDT/interface/VisDT2DSegmentTwig.h"
00007 #include "VisReco/VisMuonDT/interface/VisDT4DSegmentTwig.h"
00008 #include "Iguana/Studio/interface/IgDocumentData.h"
00009 #include "Iguana/Framework/interface/IgTwig.h"
00010 #include "Iguana/Studio/interface/IgQtLock.h"
00011 #include <qstring.h>
00012 #include <classlib/utils/Callback.h>
00013
00014
00015
00016
00017
00018
00019
00020
00021 IG_DEFINE_STATE_ELEMENT (VisMuonDTContent, "Data/Reco/MuonDT");
00022
00023
00024
00025
00026
00028 VisMuonDTContent::VisMuonDTContent (IgState *state)
00029 : VisContent (state, s_key, MAIN_THREAD,
00030 lat::CreateCallback (this, &VisMuonDTContent::init))
00031 {
00032 }
00033
00036 void
00037 VisMuonDTContent::init (void)
00038 {
00039 IgQtLock ();
00040
00041 IgTwig *rootTwig = IgDocumentData::get (state ())->root ();
00042 IgTwig *topTwig = 0;
00043 IgTwig *eventTwig = 0;
00044
00045 topTwig = rootTwig->lookup ("CMS Event and Detector");
00046 if (!topTwig) topTwig = new IgSimpleTwig (rootTwig, "CMS Event and Detector");
00047
00048 eventTwig = topTwig->lookup ("CMS Event");
00049 if (!eventTwig) eventTwig = new IgSimpleTwig (topTwig, "CMS Event");
00050
00051 std::string wname ("Wheel ");
00052 std::string stname ("Station ");
00053 std::string sename ("Sector ");
00054
00055 VisDTDigiTwig *wheelDigiTwig;
00056 VisDTDigiTwig *sectorDigiTwig;
00057
00058 IgTwig *muonEventTwig = new IgSimpleTwig (eventTwig, "Muon DT Event");
00059
00060 VisDTDigiTwig *dtDigiTwig = new VisDTDigiTwig (state (), muonEventTwig, "DT Digis", "", "", "");
00061 for (int w = -2; w <= +2; ++w)
00062 {
00063 if (w == 1)
00064 {
00065 wheelDigiTwig = new VisDTDigiTwig (state (), dtDigiTwig, wname + QString ("%1").arg (w).latin1 (), "", "", "", "", 0x9900cc00, w);
00066 }
00067 else
00068 {
00069 wheelDigiTwig = new VisDTDigiTwig (state (), dtDigiTwig, wname + QString ("%1").arg (w).latin1 (), "", "", "", "", 0x66ff0000, w);
00070 }
00071 int nSector = 14;
00072 for (int se = 1; se <= nSector; ++se)
00073 {
00074 if (w == 1)
00075 {
00076 sectorDigiTwig = new VisDTDigiTwig (state (), wheelDigiTwig, sename + QString ("%1").arg (se).latin1 (), "", "", "", "", 0x9900cc00, w, se);
00077 }
00078 else
00079 {
00080 sectorDigiTwig = new VisDTDigiTwig (state (), wheelDigiTwig, sename + QString ("%1").arg (se).latin1 (), "", "", "", "", 0x66ff0000, w, se);
00081 }
00082 sectorDigiTwig->cascade (false);
00083 sectorDigiTwig->selfTraverse (false);
00084 }
00085 wheelDigiTwig->cascade (false);
00086 wheelDigiTwig->selfTraverse (false);
00087 }
00088
00089 new VisDTRecHitsTwig (state (), muonEventTwig, "DT Hits");
00090 new VisDT2DSegmentTwig (state (), muonEventTwig, "DT 2DSegment");
00091 new VisDT4DSegmentTwig (state (), muonEventTwig, "DT 4DSegment");
00092 }