this page is under construction!

Pit cosmic ray samples were created for the pixel detector simulation optimized for muons passing through the pixel detector. The following describes the datasets and their generation.

Dataset Description

  • 2 samples were created: cosmic ray muons with 1-30 GeV and 30-1 TeV (30 GeV is the average energy a muon looses traversing from the surface to the cavern) using optimized atlas cosmics simulation.
  • The events were generated from a weighted distribution over a surface area of a circle of radius 300m, additionally there was a sphere cut of 2m
  • They were generated without magnetic field: SimLayout='ATLAS-CommNF-02-00-00'
  • To be written to sim file events were required to have a Geant hit in logical AND of TRT Barrel and Pixel Package
  • The files were simulated with CSC misalignments, reconstructed with nominal geometry: IOVDbSvcGlobalTagSim = 'CMCCOND-CSC-00-00-00'
  • The filename conventions are as follows: TRT_Pix_1GeV_30GeV_#.filetype or TRT_Pix_30GeV_1000GeV_#.filetype
  • 300 high E files (~1500 evts/file, 1.59 Hz) and 200 low E files (~500 evts/file, .477 Hz) were created.
  • They correspond to ~80 hrs of High E Cosmics, ~60 hrs of Low E in total.

Dataset Locations

All of the data are dq2 registered

 dq2_ls user.LaurenAlexandraTompkins*=

  user.LaurenAlexandraTompkins.highEPixPitCosmics  *** a test dataset
  user.LaurenAlexandraTompkins.highEPixPitCosmicsCBNT
  user.LaurenAlexandraTompkins.highEPixPitCosmicsDig
  user.LaurenAlexandraTompkins.highEPixPitCosmicsSim
  user.LaurenAlexandraTompkins.highEPixPitCosmicsLog
  user.LaurenAlexandraTompkins.lowEPixPitCosmics_dig1
  user.LaurenAlexandraTompkins.lowEPixPitCosmics_dig2
  user.LaurenAlexandraTompkins.lowEPixPitCosmics_idrs1
  user.LaurenAlexandraTompkins.lowEPixPitCosmics_idrs2
  user.LaurenAlexandraTompkins.lowEPixPitCosmics_log1
  user.LaurenAlexandraTompkins.lowEPixPitCosmics_log2
  user.LaurenAlexandraTompkins.lowEPixPitCosmics_ntuple1
  user.LaurenAlexandraTompkins.lowEPixPitCosmics_ntuple2 

To avoid some problems i had registering the High E dataset, I separated the low E into 2 subsets.

Running Cosmic Simulation on BNL with 13.0.25

After setting up the cmt enviroment I will be mostly following instructions from [https://twiki.cern.ch/twiki/bin/view/Main/HowToSimulateCosmicIn13 HowToSimulateCosmicsIn13]. For simulation at CERN just follow the instructions there, with the exception of the additions for the optimized code.

1. To setup your athena and cmt environment, put the following lines into a .sh (or .csh). NOTE: on BNL, using csh will give you errors because the environment variable names are too long. Use bash instead.

source /afs/usatlas.bnl.gov/software/downloads/releases/13.0.25/cmtsite/setup.sh -tag=13.0.25
  export OFFLINEPATH=$CMTPATH
  export CMTPATH=$PWD:$CMTPATH 
  source $OFFLINEPATH/AtlasOfflineRunTime/cmt/setup.sh

2. Create a working directory, such as ~/testarea/13.0.25. cd to this directory and source the setup script you created. It is important that this is the top level directory of your release 13.0.25 working area. It will be automatically added to your CMTPATH.

3. Get yourself a kerberos 4 ticket by the command: =klog.krb -principal username -cell CERN.CH = This is so that you can checkout the necessary packages.

4. Checkout the following packages: (note the first tag is different from [https://twiki.cern.ch/twiki/bin/view/Main/HowToSimulateCosmicIn13 HowToSimulateCosmicsIn13])

 cmt co -r CosmicGenerator-00-00-27 Generators/CosmicGenerator  
  cmt co -r G4AtlasApps-00-02-15 Simulation/G4Atlas/G4AtlasApps
  cmt co -r LArG4HitManagement-00-00-25 LArCalorimeter/LArG4/LArG4HitManagement
  cmt co -r G4CosmicFilter-00-00-07 Simulation/G4Extensions/G4CosmicFilter 

4* To do filtering on the overlap between 2 volumes: copy the G4CosmicFilter/ package from /afs/cern.ch/user/j/jboyd/scratch0/13.0.10/Simulation/G4Extensions/G4CosmicFilter/ and replace G4CosmicAndFilter.cxx with the one in /afs/cern.ch/user/l/lytken/public/rel_13_cosmics/.

5. Then use setupWorkArea.py to setup your workarea. This command should've created a directory WorkArea, with subdirectory cmt. cd to WorkArea/cmt/ and do cmt bro cmt config; source setup.sh; cmt bro make -s; This will compile the packages you have checked out and link them together.

6. Once this is finished, create a run directory in Simulation/G4Extensions/G4CosmicFilter and copy all the files from /afs/cern.ch/user/l/lytken/public/rel_13_cosmics/ to it.

7. Customization happens in two places. *First you can change the CosmicGun configuration with the myConfig.py file. This allows you to change the surface area of generation (xvert, zvert), the sphere cut radius (Radius), and the maximum and minimum energy of the cosmics generated (emin, emax). Once this is edited add to jobOptions.G4CosmicFilter.py SimFlags.GeneratorPath='myConfig.py' after the SimFlags are initialized. The following is a sample myConfig.py

# myConfig.py
#
# Parameters to run CosmicGenerator with optimizations for pixel detector
#

include( "PartPropSvc/PartPropSvc.py" )

theApp.Dlls  += [ "CosmicGenerator" ]
theApp.TopAlg = [ "CosmicGenerator" ]

# Include to run with trigger
#include("InDetCosmicSimAlgs/InDetCosmicTrigger_jobOptions.py" )

# Random number generator service
theApp.ExtSvc += ["AtRndmGenSvc"]
AtRndmGenSvc = Service( "AtRndmGenSvc" )
AtRndmGenSvc.Seeds = ["COSMICS 2040160768 "+Seed]

# Joboptions for CosmicGenerator
CosmicGenerator = Algorithm( "CosmicGenerator" )

CosmicGenerator.emin  =    1000.                    # Minimum muon energy in MeV
CosmicGenerator.emax  = 2000000.                    # Maximum muon energy in MeV
CosmicGenerator.ctcut =     0.                      # Cut on cos(theta) for cosmics gun

CosmicGenerator.yvert_val =    57300+41000.         # Presumably above surface buildings
#CosmicGenerator.yvert_val =    81000.              # To generate at surface level
CosmicGenerator.ysurface = 81000.                   # Definition of surface level

# Surface area for generating primary vertex in case reweighting is not used
#CosmicGenerator.xvert_low =   -600000.
#CosmicGenerator.xvert_hig =    600000.
#CosmicGenerator.zvert_low =   -600000.
#CosmicGenerator.zvert_hig =    600000.

CosmicGenerator.OptimizeForCavern= True        # Use cavern optimization including sphere cut
CosmicGenerator.Radius= 2000.                  # - sphere cut (in mm)

CosmicGenerator.doPathlengthCut = True         # Optimization based on box cut in pixel detector plane
CosmicGenerator.energyCutThreshold = 100.      # - margin of error for energy loss calculation (in MeV)

CosmicGenerator.doAimedAtPixelsCut = True      # Optimization based on box cut in pixel detector plane
CosmicGenerator.pixelplane_maxx = 1150.        # - require |x| < value in mm
CosmicGenerator.pixelplane_maxz = 1650.        # - require |y| < value in mm

CosmicGenerator.doReweighting = True           # Whether to use reweighting for cosmic ray generation
CosmicGenerator.rvert_max = 300000.            # - radius in mm for generating primary vertex

CosmicGenerator.OutputLevel = INFO             # Verbosity of CosmicGenerator code
CosmicGenerator.PrintMod = 10000               # Reduce messages from cosmic ray gun

print "CosmicGenerator.emin               = ", CosmicGenerator.emin
print "CosmicGenerator.emax               = ", CosmicGenerator.emax
print "CosmicGenerator.ctcut              = ", CosmicGenerator.ctcut
print "CosmicGenerator.yvert_val          = ", CosmicGenerator.yvert_val
print "CosmicGenerator.Radius             = ", CosmicGenerator.Radius
print "CosmicGenerator.doPathlengthCut    = ", CosmicGenerator.doPathlengthCut
print "CosmicGenerator.energyCutThreshold = ", CosmicGenerator.energyCutThreshold
print "CosmicGenerator.doAimedAtPixelsCut = ", CosmicGenerator.doAimedAtPixelsCut
print "CosmicGenerator.pixelplane_maxx    = ", CosmicGenerator.pixelplane_maxx
print "CosmicGenerator.pixelplane_maxz    = ", CosmicGenerator.pixelplane_maxz
print "CosmicGenerator.doReweighting      = ", CosmicGenerator.doReweighting
print "CosmicGenerator.rvert_max          = ", CosmicGenerator.rvert_max

* Secondly, you can add a second filter volume in G4CosmicFilter.py by commenting and uncommenting the file so that it looks like this:

  # add G4CosmicFilter action...
  from G4AtlasApps import PyG4Atlas
  #With two filters, use this line:
  MyAction= PyG4Atlas.UserAction('G4CosmicFilter','G4CosmicAndFilter',['BeginOfEvent','EndOfEvent','BeginOfRun','EndOfRun','Step'])
  #With one filter, use this line:
  #MyAction= PyG4Atlas.UserAction('G4CosmicFilter','G4CosmicFilter',['BeginOfEvent','EndOfEvent','BeginOfRun','EndOfRun','Step'])
  #actionProperties={"VolumeName":"CaloEntryLayer"}
  #actionProperties={"VolumeName":"MuonExitLayer"}
  actionProperties={"VolumeName":"TRTBarrelEntryLayer"}
  #if 2nd volume, add VolumeName2:
  actionProperties={"VolumeName2":"PixelEntryLayer"}
  MyAction.set_Properties(actionProperties)
  AtlasG4Eng.G4Eng.menu_UserActions.add_UserAction(MyAction)
If it works you should see this line in the log file:
   G4CosmicAndFilter: using collectionName TRTBarrelEntryLayer and PixelEntryLayer
Also, you can run with or without magnetic field. If you want no magnetic field change = SimLayout='ATLAS-Comm-02-00-00'= to = SimLayout='ATLAS-CommNF-02-00-00'= 8. Now you can run the simulation. In this directory do: athena -c "directory='$PWD'; Seed='12345'" jobOptions.G4Cosmic_WriteTTR.py

9. And now you have simulation!

Note, for running large jobs at BNL you need to use the batch system, Condor. You can use their [https://www.racf.bnl.gov/docs/sw/condor/quickstart/ Quick Start] guide to get yourself started.

Running Cosmic Digitization on BNL with 13.0.25

Digitization is pretty simple. In the same directory as you ran the simulation, do the following: 1. you need to make sure you have AtlasDigitization.py in your working directory. Copy /afs/cern.ch/user/j/jboyd/scratch0/13.0.10/InstallArea/XML/* to your InstallArea (make an XML directory if necessary).

2. edit prodDigitTRG.py from = input=directory+'/sim.root'= to = input=directory+'/'+simfile= Also, check to make sure that you are using the same geometry database as you did in the simulation (ie w/ or w/out magnetic field). 3. from the command line run athena -c "directory = myRunDirectory; simfile mySimFile" prodDigitTRG.py=

4. You should have digits! If you encounter problems, try copying the latest DB version from CERN: /afs/cern.ch/user/a/atlcond/coolrep/sqlite200/ALLP200.db

Running Reco and InDetRecStatistics 13.0.30 at BNL or CERN

0. Checkout Extrapolator = cmt co -r TrkExRungeKuttaPropagator-01-01-22 Tracking/TrkExtrapolation/TrkExRungeKuttaPropagator =

change line 590 of RungeKuttaPropagator to = double Wmax = 300000. ; // Max way allowed= then compile with packages below

1. Setup 13.0.30 and Checkout and compile InDetCosmicRecExample (either compile in order or use setupWorkArea.py)

 cmt co -r RecExCommission-00-01-51 Reconstruction/RecExample/RecExCommission
  cmt co -r InDetCosmicRecExample-00-03-12 InnerDetector/InDetExample/InDetCosmicRecExample
  cmt co -r InDetRawDataByteStreamCnv-00-00-91 InnerDetector/InDetEventCnv/InDetRawDataByteStreamCnv
  cmt co -r PixelMonitoring-00-02-14 InnerDetector/InDetMonitoring/PixelMonitoring
  cmt co -r InDetCTBTracking-00-00-57 InnerDetector/InDetRecAlgs/InDetCTBTracking
  cmt co -r InDetTestBeamCBNT-00-01-85 InnerDetector/InDetTestBeam/InDetTestBeamAlgs

2. Create file InDet_Statistics.py in share directory containing:

  #
  # --- load truth to track tool
  #]
  from TrkTruthToTrack.TrkTruthToTrackConf import Trk__TruthToTrack
  InDetTruthToTrack  = Trk__TruthToTrack(name         = "InDetTruthToTrack",
                                         Extrapolator = CosmicsExtrapolator)
  ToolSvc += InDetTruthToTrack
  print      InDetTruthToTrack
  #
  # --- load statistics alg
  #
  from InDetRecStatistics.InDetRecStatisticsConf import InDet__InDetRecStatisticsAlg
  InDetRecStatistics = InDet__InDetRecStatisticsAlg (name                     = "InDetRecStatistics",
                                                     TrackCollectionKeys      = TCollections,
                                                     TrackTruthCollectionKeys = TruthCollections,
                                                     MakeNtuple               = True,
                                                     TruthToTrackTool         = InDetTruthToTrack,
                                                     UseTrackSummary          = True,
                                                     SummaryTool              = InDetTrackSummaryTool,
                                                     minPt                    = 1000.0)
                                     
  topSequence += InDetRecStatistics
  print          InDetRecStatistics
  #
  theApp.HistogramPersistency = "ROOT"
  NTupleSvc         =  Service( "NTupleSvc" )
  NTupleSvc.Output += [ "INDETRECSTAT DATAFILE='" + "InDetRecStatistics.root" + "'  TYP='ROOT'  OPT='NEW'" ]
  InDetRecStatistics.NtupleSaveHits=True 

4. To line 227 (ish) of InDetCosmicRec_TopOptions.py add

   # ------------------------------------------------------------
   # Statistics Package and Ntuple
   # ------------------------------------------------------------
   include("InDetCosmicRecExample/InDetCosmic_statistics.py")  

5. Edit InDetCosmicFlags_jobOptions.py to contain your input file and any other options you want

6. From run directory athena jobOptions.py >& myoutfile

7. You now have a file, InDetRecStatistics.root, which contains the truth and reco track information and the hits info for hits associated with tracks for all the track collections!

8. If it crashes, turn off all of the monitoring in the flags file.

-- LaurenTompkins - 18 Feb 2008

Edit | Attach | Watch | Print version | History: r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r1 - 2008-02-18 - LaurenTompkins
 
    • 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-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback