acts-project / acts

Experiment-independent toolkit for (charged) particle track reconstruction in (high energy) physics experiments implemented in modern C++
https://acts.readthedocs.io
Mozilla Public License 2.0
102 stars 164 forks source link

Question: Set a different value of eta range using ODD #2776

Open rubihason opened 9 months ago

rubihason commented 9 months ago

Hello, I am running full_chin_odd, and I saw in the paper on odd "https://iopscience.iop.org/article/10.1088/1742-6596/2438/1/012110/pdf" that the range of eta can be up to an absolute value of 4. I tried to do so, but still, the highest value of eta is 3. How can I set the value to 4? Here is my code:

#!/usr/bin/env python3
import os, argparse, pathlib, acts, acts.examples
from acts.examples.simulation import (
    addParticleGun,
    MomentumConfig,
    EtaConfig,
    PhiConfig,
    ParticleConfig,
    addPythia8,
    addFatras,
    addGeant4,
    ParticleSelectorConfig,
    addDigitization,
)
from acts.examples.reconstruction import (
    addSeeding,
    TruthSeedRanges,
    addCKFTracks,
    TrackSelectorConfig,
    addAmbiguityResolution,
    AmbiguityResolutionConfig,
    addAmbiguityResolutionML,
    AmbiguityResolutionMLConfig,
    addVertexFitting,
    VertexFinder,
)
from common import getOpenDataDetectorDirectory
from acts.examples.odd import getOpenDataDetector

parser = argparse.ArgumentParser(description="Full chain with the OpenDataDetector")

parser.add_argument("--events", "-n", help="Number of events", type=int, default=100)
parser.add_argument(
    "--geant4", help="Use Geant4 instead of fatras", action="store_true"
)
parser.add_argument(
    "--ttbar",
    help="Use Pythia8 (ttbar, pile-up 200) instead of particle gun",
    action="store_true",
)
parser.add_argument(
    "--MLSolver",
    help="Use the Ml Ambiguity Solver instead of the classical one",
    action="store_true",
)

args = vars(parser.parse_args())

ttbar = args["ttbar"]
g4_simulation = args["geant4"]
ambiguity_MLSolver = args["MLSolver"]
u = acts.UnitConstants
geoDir = getOpenDataDetectorDirectory()
outputDir = pathlib.Path.cwd() / "odd_output"
# acts.examples.dump_args_calls(locals())  # show python binding calls

# oddMaterialDeco = acts.IMaterialDecorator.fromFile("/home/rubi/Thesis/Acts/thirdparty/OpenDataDetector/data/odd-material-maps.root")
# detector, trackingGeometry, decorators = getOpenDataDetector(odd_dir, oddMaterialDeco)

oddMaterialMap = geoDir / "data/odd-material-maps.root"
oddDigiConfig = geoDir / "config/odd-digi-smearing-config.json"
oddSeedingSel = geoDir / "config/odd-seeding-config.json"
oddMaterialDeco = acts.IMaterialDecorator.fromFile(oddMaterialMap)

detector, trackingGeometry, decorators = getOpenDataDetector(
    geoDir, mdecorator=oddMaterialDeco
)
field = acts.ConstantBField(acts.Vector3(0.0, 0.0, 2.0 * u.T))
rnd = acts.examples.RandomNumbers(seed=42)

s = acts.examples.Sequencer(
    events=100,  #args["events"],
    numThreads=-1,
    logLevel=acts.logging.INFO,
    outputDir=str(outputDir),
)

addPythia8(
    s,
    nhard=1,
    npileup=0,
    cmsEnergy=13.6 * acts.UnitConstants.TeV,
    hardProcess=["WeakSingleBoson:ffbar2ffbar(s:gmZ)=on" ,"WeakZ0:gmZmode=2" ,"23:onMode=off" ,"23:onIfAny=13"],
    pileupProcess=["SoftQCD:all = on"],
    vtxGen=acts.examples.GaussianVertexGenerator(
        mean=acts.Vector4(0, 0, 0, 0),
        stddev=acts.Vector4(0.0125 * u.mm, 0.0125 * u.mm, 55.5 * u.mm, 5.0 * u.ns),
    ),
    rnd=rnd,
    #outputDirRoot=outputDir,
    outputDirCsv=pathlib.Path.cwd() / "odd_output/Pythia8",
)

addFatras(
        s,
        trackingGeometry,
        field,
        rnd=rnd,
        preSelectParticles=ParticleSelectorConfig(
        rho=(0.0 * u.mm, 28.0 * u.mm),
        absZ=(0.0 * u.mm, 1.0 * u.m),
        eta=(-4.0, 4.0),
        pt=(1 * u.GeV, None),
        removeNeutral=True,
    ),
    )

addDigitization(
    s,
    trackingGeometry,
    field,
    digiConfigFile=oddDigiConfig,
    #outputDirRoot=outputDir,
    #outputDirCsv=outputDir,
    rnd=rnd,
)

addSeeding(
    s,
    trackingGeometry,
    field,
    TruthSeedRanges(pt=(1 * u.GeV, None), eta=(-4, 4), nHits=(5, None))
    if ttbar
    else TruthSeedRanges(),
    geoSelectionConfigFile=oddSeedingSel,
    #outputDirRoot=outputDir,
)

addCKFTracks(
    s,
    trackingGeometry,
    field,
    TrackSelectorConfig(pt=((1 * u.GeV, None)), absEta=(None, 4.0)),
    outputDirRoot=outputDir,
    writeCovMat=True,
    #outputDirCsv=outputDir,
)

addAmbiguityResolution(
        s,
        AmbiguityResolutionConfig(
            maximumSharedHits=3, maximumIterations=1000000, nMeasurementsMin=7
        ),
        #outputDirRoot=outputDir,
        writeCovMat=True,
        outputDirCsv=pathlib.Path.cwd() / "odd_output/Ambu",
    )

addVertexFitting(
    s,
    field,
    vertexFinder=VertexFinder.AMVF,
    outputDirRoot=outputDir,
) 

s.run()
github-actions[bot] commented 8 months ago

This issue/PR has been automatically marked as stale because it has not had recent activity. The stale label will be removed if any interaction occurs.

Corentin-Allaire commented 4 months ago

Hello @rubihason,

It looks like we completely missed this issue (I guess because it was posted before the holiday ?)

In the future, I would advise you to contact us on our mattermost for questions that are not bug reports. We are much more active there.

github-actions[bot] commented 3 months ago

This issue/PR has been automatically marked as stale because it has not had recent activity. The stale label will be removed if any interaction occurs.