lb-dev DaVinci /latest -c x86_64_v2-centos7-gcc11+dd4hep-opt cd ./DaVinciDev_v63r4 [v63r4 is the latest as of 9th Feb.] git lb-use DaVinci git lb-checkout DaVinci /v63r4 DaVinciExamples makeDaVinci directory is set with example DaVinci option files to produce ntuples. You can find many examples in DaVinci directory In order to run data or MC in DaVinci, you will need a yaml file for Run 3. A basic yaml file for Run3 data is below:
In case you are running it locally, you can type :input_files: - mdf:root://eoslhcb.cern.ch//eos/lhcb/point8/lhcb/data/2022/RAW/TURBO/LHCb/COLLISION22/255620/255620_00150000_0000.raw data_type: 'Upgrade' input_type: 'RAW' input_raw_format: 0.5 simulation: False conddb_tag: '2022_12_HLT2Processing' dddb_tag: 'master' ntuple_file: "tuple_Bp2JpsiKpDetached_down.root"
evt_max: -1 input_process: 'Hlt2'
./run lbexec DaVinciExamples.tupling.option_davinci_example:main basic.yamlThe other option is to run on grid since the data is in bookkeeping now. Then you will need to give a proper path and flags to the data. You can find the data in DiracPortal go in the Data quality, check the box "UNCHECKED", then back to Bookkeeping tree got to LHCb --> Collision22 --> e.g., Beam6800GeV -VeloClosed-MagDown-Excl-UT --> Real Data --> e.g. 90000000 --> RAW Example to the full stream data where you should give the correct name and link to your yaml and davinci options
splitter = SplitByFiles() splitter.filesPerJob = 1 splitter.maxFiles = -1 splitter.bulksubmit = False splitter.ignoremissing = True j = Job( name = "Run3-data", splitter = splitter, comment="DV63r4") myApp = GaudiExec() myApp.directory = "/afs/cern.ch/work/o/oozcelik/stack/b2cchltlines/DaVinciDev_v63r4" j.application = myApp j.application.platform = "x86_64_v2-centos7-gcc11+dd4hep-opt" j.application.options = ["./davinci_runb2cclines.py"] j.inputfiles = ["Bp2JpsiKpDetached.Run3data.yaml"] path = "/LHCb/Collision22/Beam6800GeV-VeloClosed-MagDown-Excl-UT/Real Data/90000000/RAW" j.inputdata = BKQuery(path, dqflag=['UNCHECKED']).getDataset() j.backend = Dirac() j.outputfiles = [DiracFile('*.root')] j.submit()
curl https://gitlab.cern.ch/rmatev/lb-stack-setup/raw/master/setup.py | python3 - stack
cd stack
make Moore (this will take some time)
git checkout bnoc_run3 /// this is spesific to bnoc-only decays, no need for it if you have any other decay of relevance..
cd ..
make MooreAnalysis
Create a new function or use the existing one with "make_(yourdecayname)"
Put your line in corresponding file under Hlt/Hlt2Conf/python/Hlt2Conf/lines, e.g., BdsTohhhh.py or BdsToVV.py
To book the Hlt2 line, use hlt2_bnoc.py under bnoc directory with @register_line_builder and make sure you point out your own function with "make_(yourdecayname)".
An example to produce your MCDecayTree with your signal MC in Moore with your corresponding hlt line: from Moore import optionsThen the only thing you have to do is to run MooreAnalysis in roder to produce your ntuples . MooreAnalysis /run gaudirun.py youroptionfile.py with the setup above, one can not access the reconstructed level information. To be able to do that, one must have a different configuration instead of red line above and then use DaVinci to analyse HLT line output. First step is done by setting properties with Moore.run_moore to produce outputs
from HltEfficiencyChecker.config import run_moore_with_tuples
from RecoConf.reconstruction_objects import reconstruction
from RecoConf.protoparticles import make_charged_protoparticles
import glob
from Moore import options, run_moore
from Hlt2Conf.lines.bnoc.hlt2_bnoc import hlt2_lines decay = ( #### your own decay "[${B_s0}B_s0 => "
"(phi(1020) => ${Kp0}K+ ${Km0}K-) "
"(phi(1020) => ${Kp1}K+ ${Km1}K-) ]CC"
) options.set_input_from_testfiledb('Upgrade_BsPhiPhi_MD_FTv4_DIGI') ##(Upgrade_BsPhiPhi_MU_FTv4_DIGI') #### your own MC
options.evt_max = -1
options.set_conds_from_testfiledb('Upgrade_BsPhiPhi_MD_FTv4_DIGI') options.input_type = 'ROOT'
options.input_raw_format = 0.3 #### 4.3 for DIGI options.simulation = True
options.data_type = 'Upgrade'
options.dddb_tag = 'dddb-20180815' ## for MD : 'dddb-20190223'
options.conddb_tag = 'sim-20180530-vc-md100'
options.ntuple_file = "/eos/lhcb/user/o/oozcelik/Run3trigger/eff_ntuple_Bs2KKKK.root" ### your own directory you want to dump your ntuples. ###### your own trigger line to be pointed out def hlt2_lines():
return [Bds_PhiPhi_line()] options.lines_maker = hlt2_lines from RecoConf.hlt1_tracking import default_ft_decoding_version
default_ft_decoding_version.global_bind(value=5) #value=2) from RecoConf.global_tools import stateProvider_with_simplified_geom
with reconstruction.bind(from_file=False), make_charged_protoparticles.bind(enable_muon_id=True):
run_moore_with_tuples(
options,
hlt1 = False, ###### if you need to test the hlt1, then the sequence should be different than run_moore_with_tuples ###
descriptor_template = decay,
public_tools=[stateProvider_with_simplified_geom()]
)
from RecoConf.reconstruction_objects import reconstruction with reconstruction.bind(from_file=False):and to read the output with DaVinci, a configuration file, which is similar to analyse Turbo data, is needed. This will produce ntuples with "DecayTree" and will have both the generated and the reconstructed level information. Find an example script attached at the bottom of the page. Now you can run your options within the DaVinci runtime environment using lb-run:
config=run_moore(options, all_lines, public_tools)
lb-run DaVinci/VERSION gaudirun.py OPTIONSNOTE: You can still produce your tuples with "DecayTree" (instead of FunTuple) but you need a specific DaVinci version to be compatible with it. In that case, it is "v54r1" to be used with the corresponding platform "x86_64_v3-centos7-gcc11-opt" .
if you test your own trigger line - not deployed yet - then you need to create your own branch in Moore with the corresponding script(s) for your line.and then you can do git lb-checkout Moore/new_branch Hlt make ## to compile the environment the rest will be very similar to job submission in ganga. First, you have the option file. Find an example below :git clone
git checkout -b new_branchgit push origin new_branch
splitter = SplitByFiles ()then simply run it in ganga %ganga youroptionfile.py there you go.. and the output rate_ntuple.root can be run to get the rates:
splitter.filesPerJob = 15
splitter.bulksubmit = False
splitter.ignoremissing = True j = Job( name = "MB-MD", splitter = splitter, comment="") myApp = GaudiExec ()
myApp.directory = "/afs/cern.ch/work/o/oozcelik/MooreAnalysisDev_master" j.application = myApp
j.application.platform = "x86_64_v2-centos7-gcc11-opt"
j.application.options = ["/afs/cern.ch/work/o/oozcelik/stack/rate_Bs2phiphi.py"] #### your file that points out the trigger line for rate calculation. find the example attached. bkq = BKQuery("/MC/Upgrade/Beam7000GeV-Upgrade-MagDown-Nu7.6-25ns-Pythia8/Sim10aU1/30000000/DIGI")
ds = bkq.getDataset()
j.inputdata = ds
j.backend = Dirac()
j.backend.diracOpts = 'j.setTag(["/cvmfs/lhcbdev.cern.ch/"])'
j.outputfiles = [DiracFile('*.root')]
j.submit()
-- OzlemOzcelik - 2022-01-12MooreAnalysis/run MooreAnalysis/HltEfficiencyChecker/scripts/hlt_calculate_rates.py rate_ntuple.root --using-hlt1-filtered-MC --json Hlt2_rates.json
MooreAnalysis/run MooreAnalysis/HltEfficiencyChecker/scripts/hlt_overlap_tool.py rate_ntuple.root MooreAnalysis/HltEfficiencyChecker/options/hlt1_overlap_example.json
from RecoConf.global_tools import stateProvider_with_simplified_geom with allen_sequence.bind(sequence=“hlt1_pp_default”), reconstruction.bind( from_file=False): run_chained_hlt_with_tuples( options, decay, public_tools=[stateProvider_with_simplified_geom()])To have the efficiency of HLT1 on top of the HLT2 you will need to Run MooreAnalysis over your entire produced ntuples, in this way:
MooreAnalysis /run MooreAnalysis /HltEfficiencyChecker/scripts/hlt_line_efficiencies.py Xic0_eff_computation.root —custom-denoms Hlt1TrackMVAs:Hlt1TrackMVADecision || Hlt1TwoTrackMVADecision --reconstructible-children=p,Km,Km,pip --legend-header=“Xi_{c}0#rightarrow p+ K- K-#pi+” --make-plots
Hlt1TrackMVAs:Hlt1TrackMVADecision || Hlt1TwoTrackMVADecision means that we are selecting both the HLT1 decision 1 track or two tracks, that are the most important for our studies.You will have lots of plots in output, what you have to look is a plot with the name of your HLT2 line and the HLT1 requirement, like this: Efficiencies__Hlt2Xic0ToPpKmKmPipLineDecision__CanRecoChildrenAndHlt1TrackMVAs__PT.pdf
I | Attachment | History | Action | Size | Date | Who | Comment |
---|---|---|---|---|---|---|---|
txt | analyzer.py.txt | r1 | manage | 4.4 K | 2022-01-18 - 16:08 | OzlemOzcelik | read the HLT output via DaVinci |
txt | gangajob_rate.py.txt | r1 | manage | 0.7 K | 2022-01-18 - 15:25 | OzlemOzcelik | option files for ganga jobs |
txt | rate_Bs2phiphi.py.txt | r1 | manage | 2.4 K | 2022-01-18 - 15:25 | OzlemOzcelik | option files for ganga jobs |