Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

include HCal Endcap in run_thetamodulemerged.py #31

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 43 additions & 16 deletions FCCSW_ecal/run_thetamodulemerged.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,11 +282,12 @@
saveHCalTool.CaloHits.Path = hcalBarrelHitsName
mmlynari marked this conversation as resolved.
Show resolved Hide resolved

# - HCAL endcap
# saveHCalEndcapTool = SimG4SaveCalHits(
# "saveHCalEndcapHits",
# readoutName = hcalEndcapReadoutName
# )
# saveHCalEndcapTool.CaloHits.Path = "HCalEndcapHits"
saveHCalEndcapTool = SimG4SaveCalHits(
"saveHCalEndcapHits",
readoutName = hcalEndcapReadoutName,
OutputLevel=INFO
)
saveHCalEndcapTool.CaloHits.Path = "HCalEndcapHits"

# next, create the G4 algorithm, giving the list of names of tools ("XX/YY")
particle_converter = SimG4PrimariesFromEdmTool("EdmConverter")
Expand All @@ -299,7 +300,7 @@
if runHCal:
outputTools += [
saveHCalTool,
# saveHCalEndcapTool
saveHCalEndcapTool
]

if saveG4Hist:
Expand Down Expand Up @@ -491,14 +492,34 @@
createHcalBarrelPositionedCells2.positionedHits.Path = hcalBarrelPositionedCellsName2

# Create cells in HCal endcap
# createHcalEndcapCells = CreateCaloCells("CreateHcalEndcapCaloCells",
# doCellCalibration=True,
# calibTool=calibHcalEndcap,
# addCellNoise=False,
# filterCellNoise=False,
# OutputLevel=INFO)
# createHcalEndcapCells.hits.Path="HCalEndcapHits"
# createHcalEndcapCells.cells.Path="HCalEndcapCells"
# 1 - merge hits into cells with the default readout
hcalEndcapCellsName = "HCalEndcapCells"
createHcalEndcapCells = CreateCaloCells("CreateHCalEndcapCells",
doCellCalibration=True,
calibTool=calibHcalEndcap,
addCellNoise=False,
filterCellNoise=False,
addPosition=True,
hits="HCalEndcapHits",
cells=hcalEndcapCellsName,
OutputLevel=INFO)

# 2 - attach positions to the cells (cell positions needed for RedoSegmentation!)
mmlynari marked this conversation as resolved.
Show resolved Hide resolved
#cellPositionHcalEndcapTool = CellPositionsHCalBarrelPhiThetaSegTool(
cellPositionHcalEndcapTool = CellPositionsHCalBarrelPhiThetaSegTool(
"CellPositionsHCalEndcap",
readoutName=hcalEndcapReadoutName,
detectorName="HCalThreePartsEndcap",
OutputLevel=DEBUG
mmlynari marked this conversation as resolved.
Show resolved Hide resolved
)
hcalEndcapPositionedCellsName = "HCalEndcapPositionedCells"
createHcalEndcapPositionedCells = CreateCaloCellPositionsFCCee(
"CreateHcalEndcapPositionedCells",
OutputLevel=INFO
)
createHcalEndcapPositionedCells.positionsTool = cellPositionHcalEndcapTool
createHcalEndcapPositionedCells.hits.Path = hcalEndcapCellsName
createHcalEndcapPositionedCells.positionedHits.Path = hcalEndcapPositionedCellsName

else:
hcalBarrelCellsName = "emptyCaloCells"
Expand Down Expand Up @@ -742,10 +763,12 @@

if not saveCells:
out.outputCommands.append("drop ECal*Cells*")
out.outputCommands.append("drop HCal*Cells*")
if not saveClusterCells:
out.outputCommands.append("drop *ClusterCells*")
if not saveHits:
out.outputCommands.append("drop ECal*Hits*")
out.outputCommands.append("drop HCal*Hits*")

# out.filename = "root/output_fullCalo_SimAndDigi_withTopoCluster_MagneticField_"+str(magneticField)+"_pMin_"+str(momentum*1000)+"_MeV"+"_ThetaMinMax_"+str(thetaMin)+"_"+str(thetaMax)+"_pdgId_"+str(pdgCode)+"_pythia"+str(use_pythia)+"_Noise"+str(addNoise)+".root"
out.filename = "./root/output_evts_" + str(Nevts) + "_pdg_" + str(pdgCode) + "_" + str(momentum) + "_GeV" + "_ThetaMinMax_" + str(thetaMin) + "_" + str(
Expand All @@ -761,7 +784,10 @@
createEcalBarrelCells.AuditExecute = True
createEcalBarrelPositionedCells.AuditExecute = True
if runHCal:
createHcalBarrelCells.AuditExecute = True
createHcalBarrelCells.AuditExecute =
mmlynari marked this conversation as resolved.
Show resolved Hide resolved
createHcalBarrelPositionedCells.AuditExecute = True
createHcalEndcapCells.AuditExecute = True
createHcalEndcapPositionedCells.AuditExecute = True
if doTopoClustering:
createTopoClusters.AuditExecute = True
out.AuditExecute = True
Expand Down Expand Up @@ -793,7 +819,8 @@
rewriteHCalBarrel,
createHcalBarrelCells2,
createHcalBarrelPositionedCells2,
# createHcalEndcapCells
createHcalEndcapCells,
createHcalEndcapPositionedCells
]

if doSWClustering or doTopoClustering:
Expand Down