Skip to content
Snippets Groups Projects

Add RetinaClusters to digi files

Merged Giovanni Bassi requested to merge add_retina_clusters_to_digi into master
1 file
+ 59
0
Compare changes
  • Side-by-side
  • Inline
###############################################################################
# (c) Copyright 2019 CERN for the benefit of the LHCb Collaboration #
# #
# This software is distributed under the terms of the GNU General Public #
# Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". #
# #
# In applying this licence, CERN does not waive the privileges and immunities #
# granted to it by virtue of its status as an Intergovernmental Organization #
# or submit itself to any jurisdiction. #
###############################################################################
from Moore import options, run_reconstruction
from Moore.config import Reconstruction, DETECTOR_RAW_BANK_TYPES
from PyConf.Algorithms import RawEventCombiner, bankKiller
from RecoConf.hlt1_tracking import make_SPmixed_raw_event, make_RetinaCluster_raw_event
from PyConf.application import default_raw_event, root_writer
options.input_files = [
'root://eoslhcb.cern.ch//eos/lhcb/wg/IonPhysics/Simulations/SMOG2jpsi/digi/SMOG2jpsi_0-Extended.digi'
]
options.input_type = "ROOT"
options.evt_max = -1
options.dddb_tag = 'dddb-20190223'
options.conddb_tag = 'sim-20180530-vc-mu100'
options.output_file = 'test.digi'
options.output_type = 'ROOT'
def combiner_digi():
data = []
# mix VELO SPs
spmix = make_SPmixed_raw_event()
data.append(spmix)
# remove VELO SP bank
spkiller = bankKiller(BankTypes=["VP"])
data.append(spkiller)
# create VELO retina clusters
vpclus = make_RetinaCluster_raw_event(make_raw=make_SPmixed_raw_event)
data.append(vpclus)
detector_parts = [
default_raw_event([bt]) for bt in DETECTOR_RAW_BANK_TYPES
]
# get only unique elements while preserving order
detector_parts = list(dict.fromkeys(detector_parts).keys())
# put mixed SPs and clusters together with rest of event
combiner = RawEventCombiner(
RawEventLocations=detector_parts + [spmix, vpclus])
data.append(combiner)
data.append(root_writer(options.output_file, [combiner.RawEvent]))
return Reconstruction('write_digi', data)
run_reconstruction(options, combiner_digi)
Loading