Skip to content

Draft: AprimeToEE - test new stripping

Michael Kent Wilkinson requested to merge AprimeToEE into main

AprimeToEE

There was an issue in earlier versions of the stripping where CaloHypos for photons were not always persisted. This has been addressed in Stripping 34r0p3.

Unfortunately, it looks like, since these CaloHypos were not persisted in Stripping 34, restripping is not sufficient to manifest them (see evidence below). Thus, we believe a new MC production is needed. This request is to test our hypothesis before submitting a large MC request.

evidence

Looking at the _restrip logs here, one sees many errors like

ERROR CaloHypoCloner:: CaloHypo in '/Event/Rec/Calo/Photons' has null cluster SmartRef -> skipping StatusCode=FAILURE

The DST files output by these jobs, despite running over thousands of input signal events, only contain a handful of events each. Browsing the input DST using Bender (code below), one finds that, indeed, the vast majority of events do not have any input photons with their clusters and digits intact.

# to run in Bender session
n_events_with_photons = n_good_events = 0
while get("/Event"):
    any_photons = any_photons_with_clusters_and_digits = False
    for p in get("Phys/StdVeryLooseAllPhotons/Particles"):
        any_photons = True
        has_all_clusters = has_all_digits = False
        for pp in p.protoparticles():
            for h in pp.calo():
                for c in h.clusters():
                    if c:
                        has_all_clusters = True
                    else:
                        has_all_clusters = False
                        break
                if not has_all_clusters:
                    break
                for d in h.digits():
                    if d:
                        has_all_digits = True
                    else:
                        has_all_digits = False
                        break
                if not has_all_digits:
                    break
            if not (has_all_clusters and has_all_digits):
                break
        if has_all_clusters and has_all_digits:
            any_photons_with_clusters_and_digits = True
            break
    n_events_with_photons += any_photons
    n_good_events += any_photons_with_clusters_and_digits
    run(1)
print "Events with photons:", n_events_with_photons
print "Events with good photons:", n_good_events
counter-evidence

I ran this production locally to create 1,000 events by running lb-conda Simulation/liaisons lb-mc AprimeToEE/AprimeToEE.stage0.yaml AprimeToEE/AprimeToEE.stage6.yaml, modifying AprimeToEE.stage6.yaml appropriately, then running

lb-dirac dirac-production-request-run-local AprimeToEE/AprimeToEE.stage6.yaml "Dielectron dark photon - test new stripping 2018 pp MagUp"

The output of the Bender script in "evidence" is

Events with photons: 1000
Events with good photons: 62

If I run a similar restripping job to that above on the produced DST, I again find many of the same errors. Something seems to be wrong with our diagnosis.


Running Bender script

lines = [
    "ExoticaDisplDiELowMassMicroLine",
    "ExoticaEtaToDiEGammaMicroLine",
    "ExoticaPi0ToDiEGammaMicroLine",
]
stream = "CustomStream"
n_events_with_rhos = n_good_events = 0
while get("/Event"):
    any_rhos = all_photons_have_clusters_and_digits = False
    for l in lines:
        done = False
        path = "{}/Phys/{}/Particles".format(stream, l)
        if not get(path):
            continue
        for p in get(path):
            if p.name() != "rho(770)0":
                assert l == "ExoticaDisplDiELowMassMicroLine", l
                continue
            any_rhos = all_photons_have_clusters_and_digits = True
            photon = None
            for d in p.daughters():
                if d.name() == "gamma":
                    assert photon is None
                    photon = d
            assert photon is not None
            has_all_clusters = has_all_digits = False
            for pp in photon.protoparticles():
                for h in pp.calo():
                    for c in h.clusters():
                        if c:
                            has_all_clusters = True
                        else:
                            has_all_clusters = False
                            break
                    for d in h.digits():
                        if d:
                            has_all_digits = True
                        else:
                            has_all_digits = False
                            break
                    if not (has_all_clusters and has_all_digits):
                        break
                if not (has_all_clusters and has_all_digits):
                    break
            if not (has_all_clusters and has_all_digits):
                all_photons_have_clusters_and_digits = False
                done = True
                break
        if done:
            break
    n_events_with_rhos += any_rhos
    n_good_events += all_photons_have_clusters_and_digits
    run(1)
print "Events with rhos:", n_events_with_rhos
print "Events with good photons:", n_good_events

over the output of lb-ap debug AprimeToEE 2018_MagUp_EtaPrompt500MeV_restrip, I get:

Events with rhos: 12                                                                                                                                     
Events with good photons: 0                                                                                                                              

Running the same Bender script (with stream = "AllStreams") over the input of that AnalysisProduction, I get (out of 2,455 events):

Events with rhos: 12
Events with good photons: 0

If I instead run the same AnalysisProduction job over my locally-produced MC (as described above) and use it as the input for the same Bender script, I get:

Events with rhos: 5
Events with good photons: 1

If I run the Bender script directly over my locally-produced MC (rather than restripping it first) (and set stream = "AllStreams"), I again get (out of 1,000 events):

Events with rhos: 5
Events with good photons: 1

Subworking Group

Exotica

Total number of events requested

50k

Data format requested

DST

Comments

@johndan @fevolle @philten

Edited by Michael Kent Wilkinson

Merge request reports