Skip to content

Commit eabaa62

Browse files
author
Sunanda
committed
Provide the possibility of running without a Sensitive Detector by setting OnlySD = ['NONE']
1 parent 059eb10 commit eabaa62

File tree

3 files changed

+95
-10
lines changed

3 files changed

+95
-10
lines changed

Geometry/HGCalCommonData/data/hgcalPassive/v18/hgcalpos.xml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,52 +4,52 @@
44
<PosPartSection label="hgcalpos.xml">
55
<PosPart copyNumber="1">
66
<rParent name="cms:CMSE"/>
7-
<rChild name="hgcalPassive:HGCalEEFullAbsorber1"/>
7+
<rChild name="hgcalPassive:HGCalEEPassive1"/>
88
<Translation x="0.0*cm" y="0.0*cm" z="-45.0*cm"/>
99
</PosPart>
1010
<PosPart copyNumber="1">
1111
<rParent name="cms:CMSE"/>
12-
<rChild name="hgcalPassive:HGCalEEFullAbsorber2"/>
12+
<rChild name="hgcalPassive:HGCalEEPassive2"/>
1313
<Translation x="0.0*cm" y="0*cm" z="-35.0*cm"/>
1414
</PosPart>
1515
<PosPart copyNumber="1">
1616
<rParent name="cms:CMSE"/>
17-
<rChild name="hgcalPassive:HGCalEEFullAbsorber3"/>
17+
<rChild name="hgcalPassive:HGCalEEPassive3"/>
1818
<Translation x="0.0*cm" y="0*cm" z="-25.0*cm"/>
1919
</PosPart>
2020
<PosPart copyNumber="1">
2121
<rParent name="cms:CMSE"/>
22-
<rChild name="hgcalPassive:HGCalEEPartialAbsorber100LD1"/>
22+
<rChild name="hgcalPassive:HGCalEEPassive100HD1"/>
2323
<Translation x="0.0*cm" y="0*cm" z="-15.0*cm"/>
2424
</PosPart>
2525
<PosPart copyNumber="1">
2626
<rParent name="cms:CMSE"/>
27-
<rChild name="hgcalPassive:HGCalEEPartialAbsorber200LD2"/>
27+
<rChild name="hgcalPassive:HGCalEEPassive200LD2"/>
2828
<Translation x="0.0*cm" y="0*cm" z="-5.0*cm"/>
2929
</PosPart>
3030
<PosPart copyNumber="1">
3131
<rParent name="cms:CMSE"/>
32-
<rChild name="hgcalPassive:HGCalEEPartialAbsorber300LD3"/>
32+
<rChild name="hgcalPassive:HGCalEEPassive300LD3"/>
3333
<Translation x="0.0*cm" y="0*cm" z="5.0*cm"/>
3434
</PosPart>
3535
<PosPart copyNumber="1">
3636
<rParent name="cms:CMSE"/>
37-
<rChild name="hgcalPassive:HGCalEEPartialAbsorber100LD6"/>
37+
<rChild name="hgcalPassive:HGCalEEPassive100LD6"/>
3838
<Translation x="0.0*cm" y="0*cm" z="15.0*cm"/>
3939
</PosPart>
4040
<PosPart copyNumber="1">
4141
<rParent name="cms:CMSE"/>
42-
<rChild name="hgcalPassive:HGCalEEPartialAbsorber200HD1"/>
42+
<rChild name="hgcalPassive:HGCalEEPassive200HD1"/>
4343
<Translation x="0.0*cm" y="0*cm" z="25.0*cm"/>
4444
</PosPart>
4545
<PosPart copyNumber="1">
4646
<rParent name="cms:CMSE"/>
47-
<rChild name="hgcalPassive:HGCalEEPartialAbsorber300HD3"/>
47+
<rChild name="hgcalPassive:HGCalEEPassive300HD3"/>
4848
<Translation x="0.0*cm" y="0*cm" z="35.0*cm"/>
4949
</PosPart>
5050
<PosPart copyNumber="1">
5151
<rParent name="cms:CMSE"/>
52-
<rChild name="hgcalPassive:HGCalHEPartialSteelCover00LD4"/>
52+
<rChild name="hgcalPassive:HGCalHEPassive00LD5"/>
5353
<Translation x="0.0*cm" y="0*cm" z="45.0*cm"/>
5454
</PosPart>
5555
</PosPartSection>
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
###############################################################################
2+
# Way to use this:
3+
# cmsRun g4OverlapCheckPassive_cfg.py geometry=V18 tol=0.01
4+
#
5+
# Options for geometry V18, V19, V19c
6+
#
7+
###############################################################################
8+
import FWCore.ParameterSet.Config as cms
9+
import os, sys, importlib, re
10+
import FWCore.ParameterSet.VarParsing as VarParsing
11+
12+
####################################################################
13+
### SETUP OPTIONS
14+
options = VarParsing.VarParsing('standard')
15+
options.register('geometry',
16+
"V19",
17+
VarParsing.VarParsing.multiplicity.singleton,
18+
VarParsing.VarParsing.varType.string,
19+
"type of operations: V18, V19, V19c")
20+
options.register('tol',
21+
0.01,
22+
VarParsing.VarParsing.multiplicity.singleton,
23+
VarParsing.VarParsing.varType.float,
24+
"Tolerance for checking overlaps: 0.0, 0.01, 0.1, 1.0")
25+
26+
### get and parse the command line arguments
27+
options.parseArguments()
28+
print(options)
29+
30+
from Configuration.Eras.Era_Phase2C17I13M9_cff import Phase2C17I13M9
31+
process = cms.Process('OverlapCheck',Phase2C17I13M9)
32+
#from Configuration.Eras.Modifier_hgcaltb_cff import hgcaltb
33+
#process = cms.Process('OverlapCheck',Phase2C17I13M9,hgcaltb)
34+
35+
####################################################################
36+
# Use the options
37+
38+
geomFile = "Geometry.HGCalCommonData.testHGCalPassive" + options.geometry + "XML_cfi"
39+
outFile = "hgcal" + options.geometry + str(options.tol)
40+
41+
print("Geometry file: ", geomFile)
42+
print("Output file: ", outFile)
43+
44+
process.load('FWCore.MessageService.MessageLogger_cfi')
45+
process.load(geomFile)
46+
#process.load('Geometry.HGCalCommonData.hgcalParametersInitialization_cfi')
47+
#process.load('Geometry.HGCalCommonData.hgcalNumberingInitialization_cfi')
48+
49+
if hasattr(process,'MessageLogger'):
50+
# process.MessageLogger.SimG4CoreGeometry=dict()
51+
# process.MessageLogger.SimG4CoreApplication=dict()
52+
process.MessageLogger.HGCalGeom=dict()
53+
54+
from SimG4Core.PrintGeomInfo.g4TestGeometry_cfi import *
55+
process = checkOverlap(process)
56+
57+
# enable Geant4 overlap check
58+
process.g4SimHits.CheckGeometry = True
59+
process.g4SimHits.OnlySDs = ["NONE"]
60+
process.g4SimHits.CaloHits = []
61+
process.g4SimHits.TrackHits = []
62+
63+
# Geant4 geometry check
64+
process.g4SimHits.G4CheckOverlap.OutputBaseName = outFile
65+
process.g4SimHits.G4CheckOverlap.OverlapFlag = True
66+
process.g4SimHits.G4CheckOverlap.Tolerance = options.tol
67+
process.g4SimHits.G4CheckOverlap.Resolution = 10000
68+
process.g4SimHits.G4CheckOverlap.Depth = -1
69+
# tells if NodeName is G4Region or G4PhysicalVolume
70+
process.g4SimHits.G4CheckOverlap.RegionFlag = False
71+
# list of names
72+
process.g4SimHits.G4CheckOverlap.NodeNames = ['OCMS']
73+
# enable dump gdml file
74+
process.g4SimHits.G4CheckOverlap.gdmlFlag = False
75+
# if defined a G4PhysicsVolume info is printed
76+
process.g4SimHits.G4CheckOverlap.PVname = ''
77+
# if defined a list of daughter volumes is printed
78+
process.g4SimHits.G4CheckOverlap.LVname = ''
79+
80+
# extra output files, created if a name is not empty
81+
process.g4SimHits.FileNameField = ''
82+
process.g4SimHits.FileNameGDML = ''
83+
process.g4SimHits.FileNameRegions = ''
84+
#

SimG4Core/SensitiveDetector/src/sensitiveDetectorMakers.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ namespace sim {
3434
retValue[info.name_] = SensitiveDetectorPluginFactory::get()->create(info.name_, pset, cc);
3535
}
3636
}
37+
} else if ((chosenMakers.size() == 1) && (chosenMakers[0] == "NONE")) {
3738
} else {
3839
for (auto const& name : chosenMakers) {
3940
retValue[name] = SensitiveDetectorPluginFactory::get()->create(name, pset, cc);

0 commit comments

Comments
 (0)