-- AndreaDellAcqua - 10-May-2012

This page is about simulation of the ATLAS New Small Wheel (NSW) and is a working log, rather than a documentation page. Please feel free to modify and/or add pieces, just let me know if you do that.

Main points

The general idea is to have the possibility of simulating the general characteristics of the NSW in the standard ATLAS simulation framework. The standard approach boils down to working out an implementation for any new detector (Micromegas, sTGC) in MuonGeoModel, to coming up with an AMDB description which contains the NSW, to creating a new geometry tag and ensuring that hits/digits are propagated through the whole software chain. There are several difficulties with this approach:

  1. AMDB knows nothing about Micromegas or sTGC, though most likely sMDT could fit in the present scheme.
  2. Steps to be taken for going from AMDB to a geometry tag are very convoluted and time consuming and are not very suitable for fast turn-around and development cycles.
  3. Development in the current framework is painful and very labour-intensive.

The solution proposed here is instead to use XML to describe the detector geometry which bypasses the AMDB-GeoTag obstacle and simplifies development considerably. In due time, we expect that this provisional approach will be replaced by the standard chain and the NSW will be incorporated into MuonGeoModel.

A few more things must be borne in mind concerning the NSW simulation:

  • All current reconstruction chains only work with existing (i.e. present) technologies, hence reconstruction is probably Micromegas-blind
  • The very fine micromegas and sTGC granularity will most likely break the existing identification scheme and we will probably have to migrate to 64-bit IDs
  • Existing digitizers would probably not work with the NSW

Running simulation

Setting up

The NSW simulation should be run with one of the latest releases. For this example I will be using one of the nightlies (dev) from a directory called myTest:

cd myTest

asetup --single here,dev,rel_5,dbg,runtime

Extracting the standard XML configuration file

For the time being, AGDD2Geo is not equipped to run several XML configuration file on top of the existing (DB stored) configuration. What one must do is to extract the existing XML configuration file and customize that by adding the NSW description:

get_files -jo jobOptions.G4Atlas.py

Edit the file, tell AGDD2GeoSvc to dump the standard configuration file:

from AGDD2Geo.AGDD2GeoConf import AGDD2GeoSvc
agdd2GeoSvc = AGDD2GeoSvc()
agdd2GeoSvc.DumpAGDD=True

Run a sample job. If it succeeds a file called Generated_amdb_simrec_Pool should appear in your run area:

athena jobOptions.G4Atlas.py

Rename the generated file to something more sensible (here AGDD_conf.xml)

mv Generated_amdb_simrec_Pool AGDD_conf.xml

Note that the XML file is divided into "section"s, each representing, as a matter of principle, a major detector assembly. The NSW geometry will be implemented as a section. Note that volume tags in a section must be unique, for the time being. To be valid, sections must be confined within the main : brackets which define the file scope.

Customizing simulation

Check out Simulation/G4Atlas/G4AtlasApps, either from the head or corresponding to the release being used

cmt co Simulation/G4Atlas/G4AtlasApps

Edit the SimAtlasKernel.py file in the python directory and find the AGDD section in it: It should look like this

            if 'ATLAS-GEO' in simFlags.SimLayout.get_Value():
                ## Additional material in the muon system
                from AGDD2Geo.AGDD2GeoConf import AGDD2GeoSvc
                agdd2GeoSvc = AGDD2GeoSvc()
                import logging
                if AtlasG4Eng.G4Eng.log.getEffectiveLevel()<logging.INFO:
                    agdd2GeoSvc.PrintSections = True
                else:
                    agdd2GeoSvc.PrintSections = False
                agdd2GeoSvc.Locked = True
                theApp.CreateSvc += ["AGDD2GeoSvc"]
                ServiceMgr += agdd2GeoSvc
            else:
                AtlasG4Eng.G4Eng.log.info("AtlasSimSkeleton._do_external :: You are using a layout that does not support additional Muon material.")

When running simulation out of the box, AGDD2GeoSvc is in "locked" (i.e. fully automatic) mode. To customize its functioning, we must "unlock" it, add all sections we want to build and eventually add the NSW. Here is what the above piece of code should look like to allow customization:

            if 'ATLAS-GEO' in simFlags.SimLayout.get_Value():
                ## Additional material in the muon system
                from AGDD2Geo.AGDD2GeoConf import AGDD2GeoSvc
                agdd2GeoSvc = AGDD2GeoSvc()
                agdd2GeoSvc.PrintSections = True

                agdd2GeoSvc.Locked = False

                agdd2GeoSvc.XMLFiles += ["AGDD_conf.xml"]

                agdd2GeoSvc.Sections += ["ATLAS Feet"]
                agdd2GeoSvc.Sections += ["Atlas Barrel Toroidal Magnets"]
                agdd2GeoSvc.Sections += ["Atlas ECT Toroidal Magnets"]
                agdd2GeoSvc.Sections += ["ATLAS Rail"]
                agdd2GeoSvc.Sections += ["pp2"]
                agdd2GeoSvc.Sections += ["Eta0Services"]
                agdd2GeoSvc.Sections += ["MDT Big Wheel"]
                agdd2GeoSvc.Sections += ["HFtruck"]
                agdd2GeoSvc.Sections += ["Calorimeter Saddle"]
                agdd2GeoSvc.Sections += ["MdtRailSupport"]
                agdd2GeoSvc.Sections += ["AccessPlatforms"]
                agdd2GeoSvc.Volumes += ["JDSH_Shield"]
                agdd2GeoSvc.Volumes += ["JTSH_Shield"]
                agdd2GeoSvc.Volumes += ["JFSH_Shield"]
                agdd2GeoSvc.Volumes += ["TBWH_BigWheels"]
                agdd2GeoSvc.Volumes += ["TGC3_BigWheels"]
                agdd2GeoSvc.Volumes += ["TGC1_BigWheels"]
#                agdd2GeoSvc.Sections += ["NewSmallWheel"]
                agdd2GeoSvc.DisableSections = False
                theApp.CreateSvc += ["AGDD2GeoSvc"]
                ServiceMgr += agdd2GeoSvc
            else:
                AtlasG4Eng.G4Eng.log.info("AtlasSimSkeleton._do_external :: You are using a layout that does not support additional Muon material.")

Note that, in this configuration, simulation will read the AGDD_conf.xml that we created and build all relevant sections, as listed here (this is basically the whole muon spectrometer, barring chambers and little else). The NSW section is still commented out. Before we can turn that on we must describe a geometry for it and turn the current small wheel off. Now "make" the G4AtlasApps package with the modified SimAtlasKernel.py file, so as to use it.

Turning off the current small wheel

Well, that's a piece of cake, in its latest incarnation the MuonDetectorTool comes with a facility which allows one to turn off selected muon stations. To turn off the current small wheel, we must remove EIL, EIS, the CSCs and a few TGCs called T4E and T4F. here is goes, add this python snippet in your job options:

from MuonGeoModel.MuonGeoModelConf import MuonDetectorTool
MuonDetectorTool=MuonDetectorTool()
MuonDetectorTool.StationSelection  = 2
MuonDetectorTool.SelectedStations  = [ "EIL*" ] 
MuonDetectorTool.SelectedStations  += [ "EIS*" ]
MuonDetectorTool.SelectedStations  += [ "EIL1*" ]
MuonDetectorTool.SelectedStations  += [ "CSS*" ]
MuonDetectorTool.SelectedStations  += [ "CSL*" ]
MuonDetectorTool.SelectedStations  += [ "T4E*" ]
MuonDetectorTool.SelectedStations  += [ "T4F*" ]

That should be it, once tools are available everything is easy....

Describing the NSW in XML

Edit AGDD_conf.xml, go to the very bottom of the file, just before the last tag add the following, simple description:

<section name = "NewSmallWheel"
version = "1.0"
date = "12 October 2011"
author = "Andy Yen"
top_volume = "useless">
<var  name="NSW_FDinnRad_FrontDisk_innerRadius"        value=" 1000." />
<var  name="NSW_FDoutRad_FrontDisk_outerRadius"        value=" 4000." />
<var  name="NSW_FDthickn_FrontDisk_thickness"          value="   50." />

<var  name="NSW_FDzposit_ADisk_Z"      value="JDSH_XYZrefpt_XYZReferencePoint + 7400. " />
<var  name="NSW_BDzposit_CDisk_Z"       value="-NSW_FDzposit_ADisk_Z " />

<tubs   name="NSW_Disk"   material="Aluminium1" Rio_Z="NSW_FDinnRad_FrontDisk_innerRadius; NSW_FDoutRad_FrontDisk_outerRadius; NSW_FDthickn_FrontDisk_thickness" />

<composition  name="NSW_Disk_Assembly_A" >
  <posXYZ  volume="NSW_Disk"      X_Y_Z="0.;0.;NSW_FDzposit_ADisk_Z"     rot="0.;0.;0." />
</composition>
<composition  name="NSW_Disk_Assembly_C" >
  <posXYZ  volume="NSW_Disk"       X_Y_Z="0.;0.;NSW_BDzposit_CDisk_Z"      rot="0.;180.;0." />
</composition>
</section>

While this might look intimidating at first sight, it is all quite simple: an aluminum disk (inner radius 1m, outer radius 4m, thickness 50cm) is created and positioned at +-7.4m from the interaction point. This whole concoction is built in a section called NewSmallWheel (which is how the thing will be referred to from here on). Now you can go back to SimAtlasKernel.py, uncomment the line dealing with NewSmallWheel and run simulation: the NSW should be in and running!

At this point, please have a look to Susumu Oda's page, he basically took it from here and ran a complete simulation of sMDT.

Recording hits in the NSW

A generic muon hit scorer (recording, between others, the particle position, momentum and energy) was recently implemented in the MuonG4SD package (under MuonSpectrometer/MuonG4) which can be used with any volume that we want to make sensitive. Check out (from the head) the following packages and build them:

MuonSpectrometer/MuonG4/MuonG4SD
MuonSpectrometer/MuonSimEvent
MuonSpectrometer/MuonCnv/MuonEventAthenaPool
MuonSpectrometer/MuonCnv/MuonEventTPCnv
At this point, it should just be matter of linking the generic hit scorer to the NSW sensitive volume(s). Go to G4AtlasApps/python and edit atlas_muon.py. Change the _init_SD() method to add the sensitive volume (called NSW_Disk in the XML file above):
    def _initSD(self):
        """ Describes the sensitive detector.
        """
        sdsuffix = ""
        if jobproperties.Beam.beamType() == 'cosmics':
            sdsuffix = "_Cosmics"
        self.atlas_muon.add_SenDetector('MuonG4SD', 'MDTSens'+sdsuffix, 'AMS', 'Muon::SensitiveGas')
        self.atlas_muon.add_SenDetector('MuonG4SD', 'RPCSens'+sdsuffix, 'RMS', 'Muon::gazGap')
        self.atlas_muon.add_SenDetector('MuonG4SD', 'TGCSens'+sdsuffix, 'TMS', 'Muon::muo::TGCGas')
        self.atlas_muon.add_SenDetector('MuonG4SD', 'CSCSens'+sdsuffix, 'CMS', 'Muon::CscArCO2')
      
        self.atlas_muon.add_SenDetector('MuonG4SD', 'GenericMuonSensitiveDetector' , 'NEW', 'Muon::NSW_Disk')

Note that "GenericMuonSensitiveDetector" is the name of the hit scorer and should not be changed and the leading "Muon::" scope operator (that simply says this volume belongs to the muon system). A similar line must be added for any additional volume one wishes to make sensitive.

Running VP1 to check geometry

run vp1 with the setup given above

vp1

choose "geometry studies" in the opening page and open the "Geo" folder. By checking the checkboxes corresponding to "Endcap stations" you should obtain a picture that looks like this (yellow: CSC, dark red: TGC, green: MDT):

  • standard endcap station layout:
    vp1.jpg

By choosing "Toroids, feet, shields etc." you can also visualize what of the muon spectrometer is included in vp1: this is important as anything which is described in an XML file which does not belong to a predefined list of muon stations:

  • Muon spectrometer in vp1:
    toroids.jpg

Now, get the vp1 configuration file:

get_files -jo vp1.py

edit it and look for the AGDD part. just before it add the instruction for the MuonDetectorTool to switch off the small wheel:


# turn-off the old small wheel
from MuonGeoModel.MuonGeoModelConf import MuonDetectorTool
MuonDetectorTool=MuonDetectorTool()
MuonDetectorTool.StationSelection  = 2
MuonDetectorTool.SelectedStations  = [ "EIL*" ]
MuonDetectorTool.SelectedStations  += [ "EIS*" ]
MuonDetectorTool.SelectedStations  += [ "EIL1*" ]
MuonDetectorTool.SelectedStations  += [ "CSS*" ]
MuonDetectorTool.SelectedStations  += [ "CSL*" ]
MuonDetectorTool.SelectedStations  += [ "T4E*" ]
MuonDetectorTool.SelectedStations  += [ "T4F*" ]

In the AGDD stuff comment out all active sections:


#AGDD2GeoSvc.Sections += ["ATLAS Feet"]
#AGDD2GeoSvc.Sections += ["Atlas Barrel Toroidal Magnets"]
#AGDD2GeoSvc.Sections += ["Atlas ECT Toroidal Magnets"]

Rerun vp1 and check that the small wheel is gone (together with the toroids):

  • Small wheel has been removed:
    noSW.jpg

To turn on the NSW visualization, edit the AGDD part in order to read the previously modified AGDD_conf.xml file and to add the NSW section:


                AGDD2GeoSvc.XMLFiles += ["AGDD_conf.xml"]
                AGDD2GeoSvc.Sections += ["NewSmallWheel"]

Rerun vp1 and check that the NSW is there (by choosing "Toroids, feet, shields etc." in the "Geo" folder):

  • New Small Wheel added:
    NSW.jpg
Topic attachments
I Attachment History Action Size Date Who Comment
JPEGjpg NSW.jpg r1 manage 66.0 K 2012-06-06 - 14:47 AntonioPolicicchio New Small Wheel added to the visualization
JPEGjpg noSW.jpg r1 manage 42.1 K 2012-05-22 - 17:43 AndreaDellAcqua Small wheel has been removed
JPEGjpg toroids.jpg r1 manage 79.3 K 2012-05-22 - 15:49 AndreaDellAcqua Muon spectrometer in vp1
JPEGjpg vp1.jpg r1 manage 73.8 K 2012-05-22 - 15:26 AndreaDellAcqua standard endcap station layout
Edit | Attach | Watch | Print version | History: r9 < r8 < r7 < r6 < r5 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r9 - 2012-06-06 - AntonioPolicicchio
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Sandbox 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.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback