TWiki
>
Main Web
>
WebPreferences
>
SwanGDMLVisualization
(2017-09-19,
MaciejTomaszKocot
)
(raw view)
E
dit
A
ttach
P
DF
---++ About SWAN [[http://swan002.cern.ch/][SWAN]] is an online application allowing to execute scripts (for example in !ROOT, R or Python notebooks). You can use it to visualize geometry, displaying an interactive preview of all the volumes, as well as access them programmatically (e.g. to detect overlaps). You can find out more about SWAN [[https://swan.web.cern.ch/content/faq][here]]. After logging in and starting a session (when prompted, you can use the default session parameters) you will see a list of files in your main EOS directory (e.g. =/eos/user/m/makocot=): <img alt="" src="%ATTACHURL%/swan01-2.png" /> _Please note that SWAN uses the =/eos/user/...= instance being mounted on LXPLUS by default, rather than =/eos/totem/user/...= ._ ---++ GDML file visualization We will also need a file describing the geometry - unfortunately, SWAN does not support the classic XML format. For this, we're going to use GDML. It's an XML-like geometry description format supported by Geant4. You can generate it with your [[CMSPublic.SWGuideAboutPythonConfigFile][Python configuration file and cmsRun]]. Just find the place where g4SimHits properties are defined and add the following: _Warning: To create a GDML file, you have to use configuration for simulation with Geant4 enabled. If you use reconstruction only, you will not see g4SimHits object at all!_ <verbatim>process.g4SimHits.FileNameGDML = cms.untracked.string('filename.gdml')</verbatim> This way, the program will know you're expecting a GDML file to be generated. To keep the running time short, you can set the number of events to 1. When the program is finished, you should see filename.gdml in your current directory. Upload it to SWAN using EOS (e.g. =cp filename.gdml /eos/user/m/makocot=) or your web browser as presented below: <img alt="" src="%ATTACHURL%/swan02-2.png" /> Next, create a !ROOT notebook: <img alt="" src="%ATTACHURL%/swan03-2.png" /> ... And paste the following, replacing filename.gdml with the path to your file. The path can be either absolute, or relative in regard to the location of the notebook you're currently using: <verbatim>TGeoManager::Import("filename.gdml"); topVolumep = gGeoManager->GetTopVolume(); topVolumep->Draw();</verbatim> You can then run it using the controls at the top of the page, or using the keyboard shortcut (Shift+Enter). A visualization of your geometry should appear. <img alt="" src="%ATTACHURL%/swan05-2.png" /> ---++ Navigation * Use *left mouse button* to rotate the view * and *right mouse button* to move it * *Scroll* to zoom * *Right click* on any volume to show extra options (focus and hide are especially useful for navigating) * Full screen is available in the bottom left corner of the window (enlarge geometry drawing) <img alt="" src="%ATTACHURL%/swan04-2.png" /> ---++ Overlaps detection Overlaps are a very likely reason that some parts dont appear in the visualization or its not possible to detect hits on them. To check the geometry for overlaps, add the following after the previous piece of code: <verbatim>gGeoManager->CheckOverlaps(); ol = gGeoManager->GetListOfOverlaps(); for(int i=0;i<ol->GetEntries();++i) { ol->At(i)->Print(); }</verbatim> It will print a list of overlapping volumes and information about the parameters of their geometry. For instance, here's an overlap report for !ZDCtoFP420 and RP_220_Right_Station volumes: <verbatim> = Overlap ov00005: CMSE/ZDCtoFP4200x7fe4ed735880 overlapping CMSE/RP_220_Right_Station0x7fe4ed89a840 ovlp=50.5 - first volume: ZDCtoFP420 at position: matrix - tr=1 rot=0 refl=0 scl=0 1.000000 0.000000 0.000000 Tx = 0.000000 0.000000 1.000000 0.000000 Ty = 0.000000 0.000000 0.000000 1.000000 Tz = 27000.000000 *** Shape ZDCtoFP420: TGeoTube *** Rmin = 0.00000 Rmax = 100.00000 dz = 12000.00000 Bounding box: *** Shape ZDCtoFP420: TGeoBBox *** dX = 100.00000 dY = 100.00000 dZ = 12000.00000 origin: x= 0.00000 y= 0.00000 z= 0.00000 - second volume: RP_220_Right_Station at position: matrix - tr=1 rot=0 refl=0 scl=0 1.000000 0.000000 0.000000 Tx = 0.000000 0.000000 1.000000 0.000000 Ty = 0.000000 0.000000 0.000000 1.000000 Tz = 21731.400000 *** Shape RP_220_Right_Station: TGeoTube *** Rmin = 0.00000 Rmax = 49.50000 dz = 329.40000 Bounding box: *** Shape RP_220_Right_Station: TGeoBBox *** dX = 49.50000 dY = 49.50000 dZ = 329.40000 origin: x= 0.00000 y= 0.00000 z= 0.00000</verbatim> -- Main.MaciejTomaszKocot - 2017-09-12
E
dit
|
A
ttach
|
Watch
|
P
rint version
|
H
istory
: r7
<
r6
<
r5
<
r4
<
r3
|
B
acklinks
|
V
iew topic
|
WYSIWYG
|
M
ore topic actions
Topic revision: r7 - 2017-09-19
-
MaciejTomaszKocot
Log In
Main
Home
Index
Search
User Search
Changes
Notifications
RSS Feed
Documentation
Support
Webs
Main
Main Archive
Plugins
Sandbox for tests
Public webs
Public webs
ABATBEA
ACPP
ADCgroup
AEGIS
AfricaMap
AgileInfrastructure
ALICE
AliceEbyE
AliceSPD
AliceSSD
AliceTOF
AliFemto
ALPHA
Altair
ArdaGrid
ASACUSA
AthenaFCalTBAna
Atlas
AtlasLBNL
AXIALPET
CAE
CALICE
CDS
CENF
CERNSearch
CLIC
Cloud
CloudServices
CMS
Controls
CTA
CvmFS
DB
DefaultWeb
DESgroup
DPHEP
DM-LHC
DSSGroup
EGEE
EgeePtf
ELFms
EMI
ETICS
FIOgroup
FlukaTeam
Frontier
Gaudi
GeneratorServices
GuidesInfo
HardwareLabs
HCC
HEPIX
ILCBDSColl
ILCTPC
IMWG
Inspire
IPv6
IT
ItCommTeam
ITCoord
ITdeptTechForum
ITDRP
ITGT
ITSDC
LAr
LCG
LCGAAWorkbook
Leade
LHCAccess
LHCAtHome
LHCb
LHCgas
LHCONE
LHCOPN
LinuxSupport
Main
Medipix
Messaging
MPGD
NA49
NA61
NA62
NTOF
Openlab
PDBService
Persistency
PESgroup
Plugins
PSAccess
PSBUpgrade
R2Eproject
RCTF
RD42
RFCond12
RFLowLevel
ROXIE
Sandbox
SocialActivities
SPI
SRMDev
SSM
Student
SuperComputing
Support
SwfCatalogue
TMVA
TOTEM
TWiki
UNOSAT
Virtualization
VOBox
WITCH
XTCA
Welcome Guest
Login
or
Register
Cern Search
TWiki Search
Google Search
Main
All webs
Copyright &© 2008-2022 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use
Discourse
or
Send feedback