Beispiel #1
0
    "PileupCaloHitMergeTool/ECalEndcapHitMerge",
    "PileupCaloHitMergeTool/ECalFwdHitMerge",
    "PileupCaloHitMergeTool/HCalBarrelHitMerge",
    "PileupCaloHitMergeTool/HCalExtBarrelHitMerge",
    "PileupCaloHitMergeTool/HCalEndcapHitMerge",
    "PileupCaloHitMergeTool/HCalFwdHitMerge"
]
overlay.PileUpTool = pileuptool
overlay.noSignal = noSignal

##############################################################################################################
#######                                       DIGITISATION                                       #############
##############################################################################################################
from Configurables import CreateCaloCells
createEcalBarrelCells = CreateCaloCells("CreateEcalBarrelCells",
                                        doCellCalibration=False,
                                        addCellNoise=False,
                                        filterCellNoise=False)
createEcalBarrelCells.hits.Path = "pileupECalBarrelCells"
createEcalBarrelCells.cells.Path = "mergedECalBarrelCells"
createEcalEndcapCells = CreateCaloCells("CreateEcalEndcapCells",
                                        doCellCalibration=False,
                                        addCellNoise=False,
                                        filterCellNoise=False)
createEcalEndcapCells.hits.Path = "pileupECalEndcapCells"
createEcalEndcapCells.cells.Path = "mergedECalEndcapCells"
createEcalFwdCells = CreateCaloCells("CreateEcalFwdCells",
                                     doCellCalibration=False,
                                     addCellNoise=False,
                                     filterCellNoise=False)
createEcalFwdCells.hits.Path = "pileupECalFwdCells"
createEcalFwdCells.cells.Path = "mergedECalFwdCells"
Beispiel #2
0
##############################################################################################################
#######                                       RECALIBRATE ECAL                                   #############
##############################################################################################################

from Configurables import CalibrateInLayersTool, CreateCaloCells
recalibEcalBarrel = CalibrateInLayersTool(
    "RecalibrateEcalBarrel",
    samplingFraction=[0.299654475899 / 0.12125] + [0.148166996525 / 0.14283] +
    [0.163005489744 / 0.16354] + [0.176907220821 / 0.17662] +
    [0.189980731321 / 0.18867] + [0.202201963561 / 0.19890] +
    [0.214090761907 / 0.20637] + [0.224706564289 / 0.20802],
    readoutName=ecalBarrelReadoutName,
    layerFieldName="layer")
recreateEcalBarrelCells = CreateCaloCells("redoEcalBarrelCells",
                                          doCellCalibration=True,
                                          calibTool=recalibEcalBarrel,
                                          addCellNoise=False,
                                          filterCellNoise=False)
recreateEcalBarrelCells.hits.Path = "ECalBarrelCells"
recreateEcalBarrelCells.cells.Path = "ECalBarrelCellsRedo"

##############################################################################################################
#######                                       CELL POSITIONS  TOOLS                              #############
##############################################################################################################

#Configure tools for calo cell positions
from Configurables import CellPositionsECalBarrelTool, CellPositionsHCalBarrelTool, CellPositionsHCalBarrelNoSegTool, CellPositionsCaloDiscsTool, CellPositionsTailCatcherTool
ECalBcells = CellPositionsECalBarrelTool("CellPositionsECalBarrel",
                                         readoutName=ecalBarrelReadoutName,
                                         OutputLevel=INFO)
EMECcells = CellPositionsCaloDiscsTool("CellPositionsEMEC",
Beispiel #3
0
    # sampling fraction obtained using SamplingFractionInLayers from DetStudies package
    samplingFraction=[0.12125] + [0.14283] + [0.16354] + [0.17662] +
    [0.18867] + [0.19890] + [0.20637] + [0.20802],
    readoutName="ECalBarrelEta",
    layerFieldName="layer")
calibcellsEndcap = CalibrateInLayersTool(
    "CalibrateEndcap",
    # sampling fraction obtained using SamplingFractionInLayers from DetStudies package
    samplingFraction=[0.15] * 118,
    readoutName="EMECPhiEta",
    layerFieldName="layer")

from Configurables import CreateCaloCells
createcellsBarrel = CreateCaloCells("CreateCaloCellsBarrel",
                                    doCellCalibration=True,
                                    calibTool=calibcellsBarrel,
                                    addCellNoise=False,
                                    filterCellNoise=False,
                                    OutputLevel=DEBUG)
createcellsBarrel.hits.Path = "ECalBarrelHits"
createcellsBarrel.cells.Path = "ECalBarrelCellsNoPhi"
# Retrieve phi positions from centres of cells
from Configurables import CreateVolumeCaloPositions
positionsEcalBarrel = CreateVolumeCaloPositions("positionsEcalBarrel",
                                                OutputLevel=INFO)
positionsEcalBarrel.hits.Path = "ECalBarrelCellsNoPhi"
positionsEcalBarrel.positionedHits.Path = "ECalBarrelPositions"
from Configurables import RedoSegmentation
resegmentEcal = RedoSegmentation("ReSegmentationEcalBarrel",
                                 oldReadoutName='ECalBarrelEta',
                                 oldSegmentationIds=['eta'],
                                 newReadoutName='ECalBarrelPhiEta')
                                   invSamplingFraction="5.4")
noise = NoiseCaloCellsFlatTool("NoiseCaloCellsFlatTool", cellNoise=0.01)
ecalgeo = TubeLayerPhiEtaCaloTool("EcalGeo",
                                  readoutName=ecalReadoutName,
                                  activeVolumeName=ecalVolumeName,
                                  activeFieldName=ecalIdentifierName,
                                  fieldNames=ecalFieldNames,
                                  fieldValues=ecalFieldValues,
                                  OutputLevel=DEBUG)

from Configurables import CreateCaloCells

createcells = CreateCaloCells("CreateCaloCells",
                              geometryTool=ecalgeo,
                              doCellCalibration=True,
                              calibTool=calibcells,
                              addCellNoise=True,
                              filterCellNoise=False,
                              noiseTool=noise,
                              OutputLevel=DEBUG)
createcells.hits.Path = "ECalHits"
createcells.cells.Path = "caloCells"

#Create calo clusters
from Configurables import CreateCaloClustersSlidingWindow, SingleCaloTowerTool
from GaudiKernel.PhysicalConstants import pi

towers = SingleCaloTowerTool("towers",
                             deltaEtaTower=0.01,
                             deltaPhiTower=2 * pi / 629.,
                             readoutName=ecalReadoutName,
                             OutputLevel=DEBUG)
Beispiel #5
0
                                    positionedHits = "HCalBarrelPositions")

# Use Phi-Eta segmentation in Hcal barrel                       
resegmentHcalBarrel = RedoSegmentation("ReSegmentationHcal",
                                       # old bitfield (readout) 
                                       oldReadoutName = hcalBarrelReadoutName,
                                       # specify which fields are going to be altered (deleted/rewritten)
                                       oldSegmentationIds = ["module","row"],
                                       # new bitfield (readout), with new segmentation                                                                                     
                                       newReadoutName = hcalBarrelReadoutNamePhiEta,
                                       inhits = "HCalBarrelPositions",
                                       outhits = "HCalBarrelCellsStep2")
    
createHcalBarrelCells = CreateCaloCells("CreateHCalBarrelCells",
                                        doCellCalibration=False,recalibrateBaseline =False, 
                                        addCellNoise=False, filterCellNoise=False,
                                        hits="HCalBarrelCellsStep2",
                                        cells="newHCalBarrelCells")
hcalCells = prefix+"HCalBarrelCells"
hcalCellsForTowers = "HCalBarrelCellsStep2"
if resegmentHCal:
    hcalCells = "newHCalBarrelCells"
    hcalCellsForTowers = "newHCalBarrelCells"

# geometry tool
from Configurables import TubeLayerPhiEtaCaloTool, LayerPhiEtaCaloTool, NestedVolumesCaloTool
ecalBarrelGeometry = TubeLayerPhiEtaCaloTool("EcalBarrelGeo",
                                             readoutName = ecalBarrelReadoutNamePhiEta,
                                             activeVolumeName = "LAr_sensitive",
                                             activeFieldName = "layer",
                                             fieldNames = ["system"],
Beispiel #6
0
        numRadialLayers=8)

    # add noise, create all existing cells in detector
    barrelGeometry = TubeLayerPhiEtaCaloTool(
        "EcalBarrelGeo",
        readoutName=ecalBarrelReadoutNamePhiEta,
        activeVolumeName="LAr_sensitive",
        activeFieldName="layer",
        fieldNames=["system"],
        fieldValues=[5],
        activeVolumesNumber=8)
    createEcalBarrelCells = CreateCaloCells(
        "CreateECalBarrelCells",
        geometryTool=barrelGeometry,
        doCellCalibration=False,  # already calibrated
        addCellNoise=True,
        filterCellNoise=False,
        noiseTool=noiseBarrel,
        hits="ECalBarrelCells",
        cells="ECalBarrelCellsNoise")
    # noiseEndcap = NoiseCaloCellsFromFileTool("NoiseEndcap",
    #                                          readoutName = ecalEndcapReadoutName,
    #                                          noiseFileName = ecalEndcapNoisePath,
    #                                          elecNoiseHistoName = ecalEndcapNoiseHistName,
    #                                          activeFieldName = "layer",
    #                                          addPileup = False,
    #                                          numRadialLayers = 40,
    #                                          noiseCells = "ECalEndcapElNoiseOnlyCells")
    # endcapGeometry = TubeLayerPhiEtaCaloTool("EcalEndcapGeo",
    #                                          readoutName = ecalEndcapReadoutName,
    #                                          activeVolumeName = "layerEnvelope",
                                   readoutName = ecalBarrelReadoutName,
                                   layerFieldName = "layer")

calibEcalEndcap = CalibrateCaloHitsTool("CalibrateECalEndcap", invSamplingFraction="13.89")
calibEcalFwd = CalibrateCaloHitsTool("CalibrateECalFwd", invSamplingFraction="303.03")
calibHcalEndcap = CalibrateCaloHitsTool("CalibrateHCalEndcap", invSamplingFraction="33.62")
calibHcalFwd = CalibrateCaloHitsTool("CalibrateHCalFwd", invSamplingFraction="1207.7")

# Create cells in ECal barrel
# 1. step - merge hits into cells with default Eta segmentation
# 2. step - rewrite the cellId using the Phi-Eta segmentation
from Configurables import CreateCaloCells
createEcalBarrelCellsStep1 = CreateCaloCells("CreateECalBarrelCellsStep1",
                               doCellCalibration=True,
                               calibTool = calibEcalBarrel,
                               addCellNoise=False, filterCellNoise=False,
                               OutputLevel=INFO,
                               hits="ECalBarrelHits",
                               cells="ECalBarrelCellsStep1")
# Ecal barrel cell positions
from Configurables import CreateVolumeCaloPositions
positionsEcalBarrel = CreateVolumeCaloPositions("positionsBarrelEcal", OutputLevel = INFO)
positionsEcalBarrel.hits.Path = "ECalBarrelCellsStep1"
positionsEcalBarrel.positionedHits.Path = "ECalBarrelPositions"
# Use Phi-Eta segmentation in ECal barrel
from Configurables import RedoSegmentation
resegmentEcalBarrel = RedoSegmentation("ReSegmentationEcal",
                             # old bitfield (readout)
                             oldReadoutName = ecalBarrelReadoutName,
                             # specify which fields are going to be altered (deleted/rewritten)
                             oldSegmentationIds = ["module"],
                                   layerFieldName = "layer")
calibcellsEndcap = CalibrateInLayersTool("CalibrateEndcap",
                                         # sampling fraction obtained using SamplingFractionInLayers from DetStudies package
                                    samplingFraction = [0.15] * 118,
                                    readoutName = "EMECPhiEta",
                                    layerFieldName = "layer")
calibcellsFwd = CalibrateInLayersTool("CalibrateFwd",
                                         # sampling fraction obtained using SamplingFractionInLayers from DetStudies package
                                    samplingFraction = [0.00056] * 22,
                                    readoutName = "EMFwdPhiEta",
                                    layerFieldName = "layer")

from Configurables import CreateCaloCells
createcellsBarrel = CreateCaloCells("CreateCaloCellsBarrel",
                                    doCellCalibration=True,
                                    calibTool=calibcellsBarrel,
                                    addCellNoise=False, filterCellNoise=False,
                                    OutputLevel=DEBUG)
createcellsBarrel.hits.Path="ECalBarrelHits"
createcellsBarrel.cells.Path="ECalBarrelCellsNoPhi"
# Retrieve phi positions from centres of cells
from Configurables import CreateVolumeCaloPositions
positionsEcalBarrel = CreateVolumeCaloPositions("positionsEcalBarrel", OutputLevel = INFO)
positionsEcalBarrel.hits.Path = "ECalBarrelCellsNoPhi"
positionsEcalBarrel.positionedHits.Path = "ECalBarrelPositions"
from Configurables import RedoSegmentation
resegmentEcal = RedoSegmentation("ReSegmentationEcalBarrel",
                             oldReadoutName = 'ECalBarrelEta',
                             oldSegmentationIds = ['eta'],
                             newReadoutName = 'ECalBarrelPhiEta')
resegmentEcal.inhits.Path = "ECalBarrelPositions"
Beispiel #9
0
    # name of output of pileup merge
    ecalBarrelOutput1 = "mergedECalBarrelCellsStep1"
    hcalBarrelOutput1 = "mergedHCalBarrelCellsStep1"
    # input for rebase
    hcalBarrelOutput2 = hcalBarrelOutput1
    if resegmentHCal:
        hcalBarrelOutput2 = "newHCalBarrelCells"

##############################################################################################################
#######                                       DIGITISATION                                       #############
##############################################################################################################

from Configurables import CreateCaloCells
createEcalBarrelCells = CreateCaloCells("CreateEcalBarrelCells",
                                        doCellCalibration=False,
                                        recalibrateBaseline=False,
                                        addCellNoise=False,
                                        filterCellNoise=False)
createEcalBarrelCells.hits.Path = "pileupECalBarrelCells"
createEcalBarrelCells.cells.Path = ecalBarrelOutput1
createEcalEndcapCells = CreateCaloCells("CreateEcalEndcapCells",
                                        doCellCalibration=False,
                                        recalibrateBaseline=False,
                                        addCellNoise=False,
                                        filterCellNoise=False)
createEcalEndcapCells.hits.Path = "pileupECalEndcapCells"
createEcalEndcapCells.cells.Path = "mergedECalEndcapCells"
createEcalFwdCells = CreateCaloCells("CreateEcalFwdCells",
                                     doCellCalibration=False,
                                     recalibrateBaseline=False,
                                     addCellNoise=False,
Beispiel #10
0
# Use Phi-Eta segmentation in Hcal barrel
resegmentHcalBarrel = RedoSegmentation(
    "ReSegmentationHcal",
    # old bitfield (readout)
    oldReadoutName="HCalBarrelReadout",
    # specify which fields are going to be altered (deleted/rewritten)
    oldSegmentationIds=["module", "row"],
    # new bitfield (readout), with new segmentation
    newReadoutName="BarHCal_Readout_phieta",
    inhits="HCalBarrelPositions",
    outhits="HCalBarrelCellsStep2")

createHcalBarrelCells = CreateCaloCells("CreateHCalBarrelCells",
                                        doCellCalibration=False,
                                        recalibrateBaseline=False,
                                        addCellNoise=False,
                                        filterCellNoise=False,
                                        hits="HCalBarrelCellsStep2",
                                        cells="newHCalBarrelCells")

##############################################################################################################
#######                                      GEOMETRY DISCRIPTIONS                               #############
##############################################################################################################

from Configurables import NestedVolumesCaloTool, TubeLayerPhiEtaCaloTool, LayerPhiEtaCaloTool
# add noise, create all existing cells in detector
barrelEcalGeometry = TubeLayerPhiEtaCaloTool("BarrelEcalGeo",
                                             readoutName="ECalBarrelPhiEta",
                                             activeVolumeName="LAr_sensitive",
                                             activeFieldName="layer",
                                             fieldNames=["system"],
Beispiel #11
0
posHcalBarrel.hits.Path = hcalCells
posHcalBarrel.positionedHits.Path = "HCalBarrelPositions"
# Use Phi-Eta segmentation in Hcal barrel       
resegmentHcalBarrel = RedoSegmentation("ReSegmentationHcal",
                                       # old bitfield (readout)                         
                                       oldReadoutName = hcalBarrelReadoutName,
                                       # specify which fields are going to be altered (deleted/rewritten)
                                       oldSegmentationIds = ["module","row"],
                                       # new bitfield (readout), with new segmentation                   
                                       newReadoutName = hcalBarrelReadoutNamePhiEta,
                                       OutputLevel = INFO,
                                       inhits = "HCalBarrelPositions",
                                       outhits = "HCalBarrelCellsStep2")
createHcalBarrelCells = CreateCaloCells("CreateHCalBarrelCells",
                                        doCellCalibration=False, recalibrateBaseline =False,
                                        addCellNoise=False, filterCellNoise=False,
                                        OutputLevel=DEBUG,
                                        hits="HCalBarrelCellsStep2",
                                        cells="newHCalBarrelCells")

# Ext Hcal barrel cell positions
posHcalExtBarrel = CreateVolumeCaloPositions("posExtBarrelHcal", OutputLevel = INFO)
posHcalExtBarrel.hits.Path = hcalExtCells
posHcalExtBarrel.positionedHits.Path = "HCalExtBarrelPositions"
# Use Phi-Eta segmentation in Hcal barrel       
resegmentHcalExtBarrel = RedoSegmentation("ReSegmentationHcalExt",
                                          # old bitfield (readout)   
                                          oldReadoutName = hcalExtBarrelReadoutName,
                                          # specify which fields are going to be altered (deleted/rewritten)
                                          oldSegmentationIds = ["module","row"],
                                          # new bitfield (readout), with new segmentation                   
                                          newReadoutName = hcalExtBarrelReadoutNamePhiEta,
saveecaltool.positionedCaloHits.Path = "ECalBarrelPositionedHits"
saveecaltool.caloHits.Path = "ECalBarrelHits"

from Configurables import SimG4PrimariesFromEdmTool
particle_converter = SimG4PrimariesFromEdmTool("EdmConverter")
particle_converter.genParticles.Path = "GenParticles"

# next, create the G4 algorithm, giving the list of names of tools ("XX/YY")
geantsim = SimG4Alg("SimG4Alg",
                    outputs=["SimG4SaveCalHits/saveECalBarrelHits"],
                    eventProvider=particle_converter,
                    OutputLevel=DEBUG)

from Configurables import CreateCaloCells
createcellsBarrel = CreateCaloCells("CreateCaloCellsBarrel",
                                    doCellCalibration=False,
                                    addCellNoise=False,
                                    filterCellNoise=False)
createcellsBarrel.hits.Path = "ECalBarrelHits"
createcellsBarrel.cells.Path = "ECalBarrelCells"

from Configurables import UpstreamMaterial
hist = UpstreamMaterial(
    "histsPresampler",
    energyAxis=momentum,
    phiAxis=0.1,
    readoutName="ECalBarrelEta",
    layerFieldName="layer",
    numLayers=8,
    # sampling fraction is given as the upstream correction will be applied on calibrated cells
    samplingFraction=[0.24833] * 1 + [0.09482] * 1 + [0.12242] * 1 +
    [0.14182] * 1 + [0.15667] * 1 + [0.16923] * 1 + [0.17980] * 1 +
from Configurables import CalibrateInLayersTool

calibEcalBarrel = CalibrateInLayersTool("CalibrateECalBarrel")
calibEcalBarrel.samplingFraction = [0.36571381189697705] * 1 + [0.09779064189677973] * 1 + [0.12564152224404024] * 1 + [0.14350599973146283] * 1 + [0.1557126972314961] * 1 + [0.16444759076233928] * 1 + [0.17097165096847836] * 1 + [0.17684775359805122] * 1 + [0.18181154293837265] * 1 + [0.18544247938196395] * 1 + [0.18922747431624687] * 1 + [0.21187001375505543] * 1
calibEcalBarrel.readoutName = "ECalBarrelEta"
calibEcalBarrel.layerFieldName = "layer"

from Configurables import CalibrateCaloHitsTool
calibHcells = CalibrateCaloHitsTool("CalibrateHCal")
calibHcells.invSamplingFraction = "41.66"

# Create cells in ECal barrel
# 1. step - merge hits into cells with Eta and module segmentation (phi module is a 'physical' cell i.e. lead + LAr + PCB + LAr +lead)
# 2. step - rewrite the cellId using the Eta-Phi segmentation (merging several modules into one phi readout cell)
from Configurables import CreateCaloCells
createEcalBarrelCellsStep1 = CreateCaloCells("CreateECalBarrelCellsStep1")
createEcalBarrelCellsStep1.doCellCalibration = True
createEcalBarrelCellsStep1.calibTool = calibEcalBarrel
createEcalBarrelCellsStep1.addCellNoise = False
createEcalBarrelCellsStep1.filterCellNoise = False
# todo: add when update on cvmfs
createEcalBarrelCellsStep1.addPosition = True
createEcalBarrelCellsStep1.hits = "ECalBarrelPositionedHits"
createEcalBarrelCellsStep1.cells = "ECalBarrelCellsStep1"
ApplicationMgr().TopAlg += [createEcalBarrelCellsStep1]

## Use Phi-Theta segmentation in ECal barrel
from Configurables import RedoSegmentation
resegmentEcalBarrel = RedoSegmentation("ReSegmentationEcal")
# old bitfield (readout)
resegmentEcalBarrel.oldReadoutName = "ECalBarrelEta"
    elecNoiseHistoName=ecalBarrelNoiseHistName,
    activeFieldName="layer",
    addPileup=False,
    numRadialLayers=8)
barrelGeometry = TubeLayerPhiEtaCaloTool("EcalBarrelGeo",
                                         readoutName=ecalBarrelReadoutName,
                                         activeVolumeName="LAr_sensitive",
                                         activeFieldName="layer",
                                         fieldNames=["system"],
                                         fieldValues=[5],
                                         activeVolumesNumber=8)
createEcalBarrelCells = CreateCaloCells(
    "CreateECalBarrelCells",
    geometryTool=barrelGeometry,
    doCellCalibration=False,  # already calibrated
    addCellNoise=True,
    filterCellNoise=False,
    noiseTool=noiseBarrel,
    hits=ecalBarrelCellsName,
    cells=ecalBarrelCellsName + "Noise",
    OutputLevel=INFO)

# add noise, create all existing cells in detector
# currently only positive side!
#noiseEndcap = NoiseCaloCellsFromFileTool("NoiseEndcap",
#                                                 readoutName = ecalEndcapReadoutName,
#                                                 noiseFileName = ecalEndcapNoisePath,
#                                                 elecNoiseHistoName = ecalEndcapNoiseHistName,
#                                                 activeFieldName = "layer",
#                                                 addPileup = False,
#                                                 numRadialLayers = 6)
#endcapGeometry = TubeLayerPhiEtaCaloTool("EcalEndcapGeo",
Beispiel #15
0
    ],
    OutputLevel=INFO)

#Configure tools for calo reconstruction
from Configurables import CalibrateCaloHitsTool

calibcells = CalibrateCaloHitsTool("CalibrateCaloHitsTool",
                                   invSamplingFraction="5.4")

from Configurables import CreateCaloCells

createcells = CreateCaloCells(
    "CreateCaloCells",
    calibTool=calibcells,
    doCellCalibration=True,
    addCellNoise=True,
    filterCellNoise=False,
    readoutName="ECalHitsPhiEta",
    fieldNames=["system", "ECAL_Cryo", "bath", "EM_barrel"],
    fieldValues=[5, 1, 1, 1],
    OutputLevel=INFO)
createcells.DataInputs.hits.Path = "ECalHits"
createcells.DataOutputs.cells.Path = "caloCells"

from Configurables import CreatePositionedHit

positionhit = CreatePositionedHit("CreatePositionedHit",
                                  readoutName="ECalHitsPhiEta",
                                  activeFieldName="active_layer",
                                  activeVolumeName="LAr_sensitive")
positionhit.DataInputs.caloCells.Path = "caloCells"
positionhit.DataOutputs.caloPositionedHits.Path = "caloCellsPositions"
from Configurables import CalibrateInLayersTool
calibEcells = CalibrateInLayersTool("Calibrate",
                                    # sampling fraction obtained using SamplingFractionInLayers from DetStudies package
                                    samplingFraction = [0.168] * 4 + [0.176] * 4 + [0.184] * 4 + [0.191] * 4 + [0.198] * 4 + [0.204] * 4 + [0.210] * 4 + [0.215] * 4,
                                    readoutName = ecalReadoutName,
                                    layerFieldName = "cell")

#Configure tools for calo reconstruction
from Configurables import CalibrateCaloHitsTool
calibHcells = CalibrateCaloHitsTool("CalibrateHCal", invSamplingFraction="31")

from Configurables import CreateCaloCells
createEcells = CreateCaloCells("CreateECaloCells",
                               doCellCalibration=True,
                               calibTool=calibEcells,
                               addCellNoise=False, filterCellNoise=False,
                               OutputLevel=DEBUG,
                               hits="ECalHits",
                               cells="ECalCells")

createHcells = CreateCaloCells("CreateHCaloCells",
                               doCellCalibration=True,
                               calibTool=calibHcells,
                               addCellNoise = False, filterCellNoise = False,
                               OutputLevel = DEBUG,
                               hits="HCalHits",
                               cells="HCalCells")

# additionally for HCal
from Configurables import CreateVolumeCaloPositions
positions = CreateVolumeCaloPositions("positions", OutputLevel = VERBOSE)
Beispiel #17
0
                                       outhits = "HCalBarrelCellsStep1")
resegmentHcalExtBarrel = RewriteBitfield("ReSegmentationExtHcal",
                                       # old bitfield (readout)                         
                                       oldReadoutName = "HCalExtBarrelReadout",
                                       # specify which fields are going to be altered (deleted/rewritten)
                                       removeIds = ["eta"],
                                       # new bitfield (readout), with new segmentation                   
                                       newReadoutName = "ExtBarHCal_Readout_phi",
                                       inhits = "ExtHCalHits",
                                       outhits = "HCalExtBarrelCellsStep1")

from Configurables import CreateCaloCells
createHcalBarrelTiles = CreateCaloCells("CreateHCalBarrelTiles",
                                        calibTool=calibHcells,
                                        doCellCalibration=True,
                                        addCellNoise=False, filterCellNoise=False,
                                        OutputLevel=INFO,
                                        hits="HCalBarrelCellsStep1",
                                        cells="HCalAllTiles")
createHcalExtBarrelTiles = CreateCaloCells("CreateHCalExtBarrelTiles",
                                        calibTool=calibHcells,
                                        doCellCalibration=True,
                                        addCellNoise=False, filterCellNoise=False,
                                        OutputLevel=INFO,
                                        hits="HCalExtBarrelCellsStep1",
                                        cells="ExtHCalAllTiles")

createHcalBarrelCells = CreateCaloCells("CreateHCalBarrelCells",
                                        calibTool=calibHcells,
                                        doCellCalibration=True,
                                        addCellNoise=False, filterCellNoise=False,
Beispiel #18
0
    samplingFraction=[0.12125] * 4 + [0.14283] * 18 + [0.16354] * 18 +
    [0.17662] * 18 + [0.18867] * 18 + [0.19890] * 18 + [0.20637] * 18 +
    [0.20802] * 18,
    readoutName=ecalReadoutName,
    layerFieldName="layer")

#Configure tools for calo reconstruction - Calibration to EM scale
from Configurables import CalibrateCaloHitsTool
calibHcells = CalibrateCaloHitsTool("CalibrateHCal",
                                    invSamplingFraction="34.5")

from Configurables import CreateCaloCells
createEcells = CreateCaloCells("CreateECaloCells",
                               doCellCalibration=True,
                               calibTool=calibEcells,
                               addCellNoise=False,
                               filterCellNoise=False,
                               OutputLevel=DEBUG,
                               hits="ECalBarrelHits",
                               cells="ECalBarrelCells")

createHcells = CreateCaloCells("CreateHCaloCells",
                               doCellCalibration=True,
                               calibTool=calibHcells,
                               addCellNoise=False,
                               filterCellNoise=False,
                               OutputLevel=DEBUG,
                               hits="HCalHits",
                               cells="HCalCells")

createExtHcells = CreateCaloCells("CreateExtHCaloCells",
                                  doCellCalibration=True,
    numRadialLayers=8)

#add noise, create all existing cells in detector
barrelGeometry = TubeLayerPhiEtaCaloTool("EcalBarrelGeo",
                                         readoutName=ecalBarrelReadoutName,
                                         activeVolumeName="LAr_sensitive",
                                         activeFieldName="layer",
                                         fieldNames=["system"],
                                         fieldValues=[5],
                                         activeVolumesNumber=8)

createEcalBarrelCells = CreateCaloCells(
    "CreateECalBarrelCells",
    geometryTool=barrelGeometry,
    doCellCalibration=False,
    #already calibrated
    addCellNoise=True,
    filterCellNoise=False,
    noiseTool=noiseBarrel,
    hits="ECalBarrelCells",
    cells="ECalBarrelCellsNoise")

#HCal Barrel noise
noiseHcal = NoiseCaloCellsFlatTool("HCalNoise", cellNoise=0.01)

# Geometry for layer-eta-phi segmentation
barrelHcalGeometry = LayerPhiEtaCaloTool("BarrelHcalGeo",
                                         readoutName="BarHCal_Readout_phieta",
                                         activeVolumeName="layerVolume",
                                         activeFieldName="layer",
                                         fieldNames=["system"],
                                         fieldValues=[8],
Beispiel #20
0
from Configurables import ApplicationMgr, FCCDataSvc, PodioOutput

podioevent   = FCCDataSvc("EventDataSvc", input="output_hcalSim_e50GeV_eta036_1events.root")

# reads HepMC text file and write the HepMC::GenEvent to the data service
from Configurables import PodioInput
podioinput = PodioInput("PodioReader", collections=["HCalHits"], OutputLevel=DEBUG)

from Configurables import GeoSvc
geoservice = GeoSvc("GeoSvc", detectors=[  'file:Detector/DetFCChhBaseline1/compact/FCChh_DectEmptyMaster.xml',
                                           'file:Detector/DetFCChhHCalTile/compact/FCChh_HCalBarrel_TileCal.xml'],
                    OutputLevel = INFO)

from Configurables import CreateCaloCells
createcells = CreateCaloCells("CreateCaloCells",
                              doCellCalibration = False,
                              addCellNoise = False, filterCellNoise = False,
                              OutputLevel = DEBUG)
createcells.hits.Path="HCalHits"
createcells.cells.Path="HCalCells"

out = PodioOutput("out", filename="output_HCalCells_digitisation_noNoise.root",
                   OutputLevel = DEBUG)
out.outputCommands = ["keep *"]

#CPU information
from Configurables import AuditorSvc, ChronoAuditor
chra = ChronoAuditor()
audsvc = AuditorSvc()
audsvc.Auditors = [chra]
podioinput.AuditExecute = True
createcells.AuditExecute = True
Beispiel #21
0
calibEcalEndcap = CalibrateCaloHitsTool("CalibrateECalEndcap",
                                        invSamplingFraction="13.89")
calibEcalFwd = CalibrateCaloHitsTool("CalibrateECalFwd",
                                     invSamplingFraction="303.03")
calibHcalEndcap = CalibrateCaloHitsTool("CalibrateHCalEndcap",
                                        invSamplingFraction="33.62")
calibHcalFwd = CalibrateCaloHitsTool("CalibrateHCalFwd",
                                     invSamplingFraction="1207.7")

# Create cells
from Configurables import CreateCaloCells
# -> ECal barrel
# 1. step - merge hits into cells with default Eta segmentation
createEcalBarrelCellsStep1 = CreateCaloCells("EcalBarrelCellsStep1",
                                             doCellCalibration=True,
                                             calibTool=calibEcalBarrel,
                                             addCellNoise=False,
                                             filterCellNoise=False)
createEcalBarrelCellsStep1.hits.Path = "ECalBarrelHits"
createEcalBarrelCellsStep1.cells.Path = "ECalBarrelCellsStep1"
# 2. step - rewrite the cellId using the Phi-Eta segmentation (remove 'module')
# 2.1. retrieve phi positions from centres of cells
from Configurables import CreateVolumeCaloPositions
positionsEcalBarrel = CreateVolumeCaloPositions("positionsEcalBarrel")
positionsEcalBarrel.hits.Path = "ECalBarrelCellsStep1"
positionsEcalBarrel.positionedHits.Path = "ECalBarrelPositions"
# 2.2. assign cells into phi bins
from Configurables import RedoSegmentation
resegmentEcalBarrel = RedoSegmentation("ReSegmentationEcalBarrel",
                                       oldReadoutName='ECalBarrelEta',
                                       oldSegmentationIds=['module'],
    elecNoiseHistoName=ecalBarrelNoiseHistName,
    activeFieldName="layer",
    addPileup=False,
    numRadialLayers=8)
barrelGeometry = TubeLayerPhiEtaCaloTool("EcalBarrelGeo",
                                         readoutName=ecalBarrelReadoutName,
                                         activeVolumeName="LAr_sensitive",
                                         activeFieldName="layer",
                                         fieldNames=["system"],
                                         fieldValues=[5],
                                         activeVolumesNumber=8)
createEcalBarrelCells = CreateCaloCells(
    "CreateECalBarrelCells",
    geometryTool=barrelGeometry,
    doCellCalibration=False,  # already calibrated
    addCellNoise=True,
    filterCellNoise=False,
    noiseTool=noiseBarrel,
    hits=ecalBarrelCellsName,
    cells=ecalBarrelCellsName + "Noise",
    OutputLevel=DEBUG)

noiseHcal = NoiseCaloCellsFlatTool("HCalNoise", cellNoise=0.009)

barrelHcalGeometry = LayerPhiEtaCaloTool("HcalBarrelGeo",
                                         readoutName=hcalBarrelReadoutName,
                                         activeVolumeName="layerVolume",
                                         activeFieldName="layer",
                                         fieldNames=["system"],
                                         fieldValues=[8],
                                         activeVolumesNumber=10)
createHcalBarrelCells = CreateCaloCells(
noiseBarrel.activeFieldName = "layer"
noiseBarrel.addPileup = False
noiseBarrel.cellPositionsTool = ECalBcells
noiseBarrel.numRadialLayers = 8

from Configurables import TubeLayerPhiEtaCaloTool
barrelGeometry = TubeLayerPhiEtaCaloTool("EcalBarrelGeo")
barrelGeometry.readoutName = ecalBarrelReadoutName
barrelGeometry.activeVolumeName = "LAr_sensitive"
barrelGeometry.activeFieldName = "layer"
barrelGeometry.fieldNames = ["system"]
barrelGeometry.fieldValues = [5]
barrelGeometry.activeVolumesNumber = 8

from Configurables import CreateCaloCells
createEcalBarrelCells = CreateCaloCells("CreateECalBarrelCells")
createEcalBarrelCells.geometryTool = barrelGeometry
createEcalBarrelCells.doCellCalibration=False # already calibrated
createEcalBarrelCells.addCellNoise=True
createEcalBarrelCells.filterCellNoise=False
createEcalBarrelCells.noiseTool = noiseBarrel
createEcalBarrelCells.hits=ecalBarrelCellsName
createEcalBarrelCells.cells=ecalBarrelCellsName+"Noise"
ApplicationMgr().TopAlg +=[createEcalBarrelCells]

# add noise, create all existing cells in detector
# currently only positive side!
from Configurables import NoiseCaloCellsFromFileTool
noiseEndcap = NoiseCaloCellsFromFileTool("NoiseEndcap")
noiseEndcap.readoutName = ecalEndcapReadoutName
noiseEndcap.noiseFileName = "root://eospublic.cern.ch//eos/experiment/fcc/hh/testsamples/elecNoise_emec_50Ohm_2shieldWidth_6layers.root"
                                   # sampling fraction obtained using SamplingFractionInLayers from DetStudies package
                                   samplingFraction =  [0.24833] * 1 + [0.09482] * 1  +  [0.12242] * 1  +  [0.14182] * 1  +  [0.15667] * 1  +  [0.16923] * 1  +  [0.17980] * 1  +  [0.20085] * 1,
                                   readoutName = ecalBarrelReadoutName,
                                   layerFieldName = "layer")

from Configurables import CalibrateCaloHitsTool
calibHcells = CalibrateCaloHitsTool("CalibrateHCal", invSamplingFraction="41.66")

# Create cells in ECal barrel
# 1. step - merge hits into cells with default Eta segmentation
# 2. step - rewrite the cellId using the Phi-Eta segmentation
from Configurables import CreateCaloCells
createEcalBarrelCellsStep1 = CreateCaloCells("CreateECalBarrelCellsStep1",
                               doCellCalibration=True,
                               calibTool = calibEcalBarrel,
                               addCellNoise=False, filterCellNoise=False,
                               OutputLevel=INFO,
                               hits="ECalBarrelHits",
                               cells="ECalBarrelCellsStep1")

# Use Phi-Eta segmentation in ECal barrel
from Configurables import RedoSegmentation
resegmentEcalBarrel = RedoSegmentation("ReSegmentationEcal",
                             # old bitfield (readout)
                             oldReadoutName = ecalBarrelReadoutName,
                             # specify which fields are going to be altered (deleted/rewritten)
                             oldSegmentationIds = ["module"],
                             # new bitfield (readout), with new segmentation
                             newReadoutName = ecalBarrelReadoutNamePhiEta,
                             OutputLevel = INFO,
                             inhits = "ECalBarrelPositions",
                                         elecNoiseHistoName = ecalBarrelNoiseHistName,
                                         activeFieldName = "layer",
                                         addPileup = False,
                                         numRadialLayers = 8)

#add noise, create all existing cells in detector
barrelGeometry = TubeLayerPhiEtaCaloTool("EcalBarrelGeo",
                                         readoutName = ecalBarrelReadoutName,
                                         activeVolumeName = "LAr_sensitive",
                                         activeFieldName = "layer",
                                         fieldNames = ["system"],
                                         fieldValues = [5],
                                         activeVolumesNumber = 8)

createEcalBarrelCells = CreateCaloCells(
    "CreateECalBarrelCells", geometryTool = barrelGeometry, doCellCalibration = False,
    #already calibrated addCellNoise = True, filterCellNoise = False,
    noiseTool = noiseBarrel, hits = "ECalBarrelCells", cells = "ECalBarrelCellsNoise")

#HCal Barrel noise
noiseHcal = NoiseCaloCellsFlatTool("HCalNoise", cellNoise = 0.009)

hcalgeo = NestedVolumesCaloTool("HcalGeo",
                                activeVolumeName = hcalVolumeName,
                                activeFieldName = hcalIdentifierName,
                                readoutName = hcalBarrelReadoutName,
                                fieldNames = hcalFieldNames,
                                fieldValues = hcalFieldValues,
                                OutputLevel = INFO)

createHcalBarrelCells =CreateCaloCells("CreateHCalBarrelCells", geometryTool = hcalgeo,
                                       doCellCalibration = False, addCellNoise = True,
geantsim = SimG4Alg("SimG4Alg",
                    outputs= ["SimG4SaveCalHits/saveECalHits"],
                    eventProvider = pgun)

#Configure tools for calo reconstruction
from Configurables import CalibrateInLayersTool
calibcells = CalibrateInLayersTool("Calibrate",
                                   # sampling fraction obtained using SamplingFractionInLayers from DetStudies package
                                   samplingFraction = [0.168] * 4 + [0.176] * 4 + [0.184] * 4 + [0.191] * 4 + [0.198] * 4 + [0.204] * 4 + [0.210] * 4 + [0.215] * 4,
                                   readoutName = "ECalHitsEta",
                                   layerFieldName = "cell")

from Configurables import CreateCaloCells
createcells = CreateCaloCells("CreateCaloCells",
                              doCellCalibration=True,
                              calibTool=calibcells,
                              addCellNoise=False, filterCellNoise=False,
                              OutputLevel=DEBUG)
createcells.hits.Path="ECalHits"
createcells.cells.Path="caloCells"

out = PodioOutput("out", filename="output_ecalInclinedDigi_test.root",
                   OutputLevel=DEBUG)
out.outputCommands = ["keep *"]

#CPU information
from Configurables import AuditorSvc, ChronoAuditor
chra = ChronoAuditor()
audsvc = AuditorSvc()
audsvc.Auditors = [chra]
geantsim.AuditExecute = True
Beispiel #27
0
##############################################################################################################
#######                                       RECALIBRATE ECAL                                   #############
##############################################################################################################

from Configurables import CalibrateInLayersTool, CreateCaloCells
recalibEcalBarrel = CalibrateInLayersTool(
    "RecalibrateEcalBarrel",
    samplingFraction=[0.299654475899 / 0.12125] + [0.148166996525 / 0.14283] +
    [0.163005489744 / 0.16354] + [0.176907220821 / 0.17662] +
    [0.189980731321 / 0.18867] + [0.202201963561 / 0.19890] +
    [0.214090761907 / 0.20637] + [0.224706564289 / 0.20802],
    readoutName=ecalBarrelReadoutName,
    layerFieldName="layer")
recreateEcalBarrelCells = CreateCaloCells("redoEcalBarrelCells",
                                          doCellCalibration=True,
                                          calibTool=recalibEcalBarrel,
                                          addCellNoise=False,
                                          filterCellNoise=False)
recreateEcalBarrelCells.hits.Path = "ECalBarrelCells"
recreateEcalBarrelCells.cells.Path = "ECalBarrelCellsRedo"

from Configurables import RewriteBitfield
rewriteECalEC = RewriteBitfield(
    "RewriteECalEC",
    # old bitfield (readout)
    oldReadoutName="EMECPhiEta",
    # specify which fields are going to be deleted
    removeIds=["sublayer"],
    # new bitfield (readout), with new segmentation
    newReadoutName=ecalEndcapReadoutName,
    debugPrint=10,