Visualization Configuration Tutorial

Complete: 5

Basic Concepts

VisConfigurationService can be used to configure an Iguana CMSSW application such as a number of various windows to be popped up and tiled, which iglets to load, which branches to be set visible at startup, and the default parameters for visualization cuts and scales (e.g. VisActiveConfigurables).

The visualization configuration keeps track of all registered visualization configuration parameters. The default value of a configuration parameter is set by a developer when he or she defines the class. This value can be changed at the application startup by defining it as an untracked parameter of a VisConfigurationService in a configuration file. The configuration parameter value can also be changed interactively via a configuration editor.

Configuration File Fragment

Here is an example of a configuration file fragment which defines a VisConfigurationService and sets the default values for the VisActiveConfigurables: VisEnergyCut, VisCaloAnnotation, VisCaloEnergyScale, and VisLegoScale.

service = VisConfigurationService {
 ##########
 # Number of various windows to be popped up and tiled.
 # Default value is 'RPhi Window'
 #
 # untracked vstring Views = {'3D Window', 'Lego Window', 'RPhi Window', 'RZ Window'}
 untracked vstring Views = {'3D Window'}

 # #########
 # Which iglets to load (the default value is defined
 # in VisApplicationMain and usually loads all available iglets):
 untracked vstring  ContentProxies =
  {'Reco/Detector','Reco/Hcal', 'Reco/MuonDT', 'Reco/CMS.MuonCSC', 'Reco/CMS.MuonRPC',
   'Reco/Trigger', 'Reco/Calorimetry', 'Reco/Ecal'}
   
 untracked vstring  EnabledTwigs = {
  '/Objects/CMS Event and Detector/HCAL Event/Hcal Barrel and Endcap RecHits',
  '/Objects/CMS Event and Detector/HCAL Event/Hcal Forward RecHits',
  '/Objects/CMS Event and Detector/ECAL Event/Rec hits',
  '/Objects/CMS Event and Detector/Muon DT Event/DT Digis',
  '/Objects/CMS Event and Detector/Muon DT Event/DT Hits',
  '/Objects/CMS Event and Detector/Muon DT Event/DT 2DSegment',
  '/Objects/CMS Event and Detector/Muon DT Event/DT 4DSegment',
  '/Objects/CMS Event and Detector/DTs/Wheel 0/Sector 10',
  '/Objects/CMS Event and Detector/DTs/Wheel 0/Sector 12',
  '/Objects/CMS Event and Detector/DTs/Wheel 0/Sector 14',
  '/Objects/CMS Event and Detector/DTs/Wheel 1/Sector 10',
  '/Objects/CMS Event and Detector/DTs/Wheel 1/Sector 11',
  '/Objects/CMS Event and Detector/DTs/Wheel 1/Sector 14',
  '/Objects/CMS Event and Detector/Calorimetry/HCAL/Hcal Barrel',
  '/Objects/CMS Event and Detector/Calorimetry/HCAL/Hcal Forward'
 }

########################################### 
#
# Set the default values for the VisActiveConfigurables:
#
 untracked double VisEnergyCut = 1.0
 untracked bool VisCaloAnnotation = false
 untracked double VisCaloEnergyScale = 1.0
 untracked double VisLegoScale = 1.0
}

Visualization Configuration Editor

To popup a Configuration editor GUI, use menu Config->Edit...:

Configuration editor menu

Note: The Config menu will be available only if the application uses the active configurable parameters. If this is the case the menu is loaded automatically.

The configuration editor main window is shown beneath:

Configuration editor window

To edit a parameter, select the configurable from the list and either double mouse click on its name or click "Edit" pushbutton. This will popup a parameter editor window where you can type the new value and click "Accept". At this point all the objects which use this parameter will be notified about the change and they will be updated immediately.

Configuration editor

Active Configurable Parameters

Active Configurable Name Type Default Value Description
VisEnergyCut double 0.1 (GeV) Do not display objects if their energy is lower then this one.
VisCaloAnnotation bool true Show the annotations.
VisCaloEnergyScale double 1.0 The scale of the CaloHit objects. It is the same for all Calo objects in all views.
VisLegoScale double 20.0 (GeV) The size of a measurement stick in the lego plot. All lego objects use it as a scale.

Developer Guidelines

To provide an active configurable, derive from the VisActiveConfigurable class:

http://cmslxr.fnal.gov/lxr/source/VisFramework/VisFrameworkBase/interface/VisEnergyCut.h

Define the configurable name and the default value:

http://cmslxr.fnal.gov/lxr/source/VisFramework/VisFrameworkBase/src/VisEnergyCut.cc

And use it in your class as follows. Declare it as a private member of your Twig class. Declare a public member function, for example cutChanged, which will be called when the parameter changes.

class MyTwig : public VisQueuedTwig
{
public:
  MyTwig (IgState *state, IgTwig *parent);
  virtual void        cutChanged (void);

private:
  VisEnergyCut		m_cut;
}

Initialize the configurable parameter in the Twig constructor:

MyTwig::MyTwig (IgState *state, IgTwig *parent)
  : VisQueuedTwig (state, parent),
    m_cut (state, lat::CreateCallback (this, &MyTwig::cutChanged))

Provide a member function which will trigger an update of all representations for the Twig:

void
MyTwig::cutChanged (void)
{ IgRepSet::invalidate (this, SELF_MASK); }

Use the configurable parameter in the other member functions:

if (energy > m_cut.value ()) 
{
 // draw it.
}

Review status

Reviewer/Editor and Date (copy from screen) Comments
IannaOsborne - 17 Oct 2007 page author

Responsible: IannaOsborne
Last reviewed by:

Topic attachments
I Attachment History Action Size Date Who Comment
JPEGjpg configEditor.jpg r1 manage 191.3 K 2007-10-17 - 17:06 IannaOsborne  
JPEGjpg configEditorMenu.jpg r1 manage 10.8 K 2007-10-17 - 17:26 IannaOsborne  
JPEGjpg configEditorWindow.jpg r1 manage 23.8 K 2007-10-17 - 17:30 IannaOsborne  
Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r4 - 2007-10-18 - IannaOsborne



 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    CMSPublic All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback