Project

General

Profile

PMA module code analysis » History » Version 4

Ruth Pordes, 06/02/2016 08:58 AM

1 4 Ruth Pordes
h1. PMA module code analysis Report
2 4 Ruth Pordes
3 4 Ruth Pordes
http://cd-docdb.fnal.gov/cgi-bin/RetrieveFile?docid=5766&filename=ReportfromPatternMatchingAlgorithmCodeAnalysis.pdf&version=1 
4 4 Ruth Pordes
5 4 Ruth Pordes
h1 PMA Code Analysis Background
6 1 Ruth Pordes
7 1 Ruth Pordes
PMA Code  and Documentation Links
8 1 Ruth Pordes
9 1 Ruth Pordes
https://indico.fnal.gov/getFile.py/access?contribId=62&sessionId=40&resId=1&materialId=slides&confId=10276
10 1 Ruth Pordes
11 1 Ruth Pordes
Aaron Higuera is maintaining systematic efficiency tests and writes code for it. Here is the last development, for the proton decay / atmospheric neutrino events:
12 1 Ruth Pordes
https://indico.fnal.gov/getFile.py/access?contribId=2&resId=0&materialId=slides&confId=12005 (note that PMA here is used together with Cluster Crawler for 2D clusters reconstruction)
13 1 Ruth Pordes
14 1 Ruth Pordes
Similar test are done for beam neutrinos, I expect that soon we'll have update on this using recent releases of reconstruction algorithms.
15 1 Ruth Pordes
16 1 Ruth Pordes
Redmine links for code:
17 1 Ruth Pordes
https://cdcvs.fnal.gov/redmine/projects/larreco/repository/revisions/develop/entry/larreco/TrackFinder/PMAlgTrackMaker_module.cc
18 1 Ruth Pordes
19 1 Ruth Pordes
Vertexing functionality is collected here:
20 1 Ruth Pordes
https://cdcvs.fnal.gov/redmine/projects/larreco/repository/revisions/develop/entry/larreco/RecoAlg/PMAlgVertexing.h
21 1 Ruth Pordes
22 1 Ruth Pordes
The most basic functions for building, testing, extending tracks are here:
23 1 Ruth Pordes
https://cdcvs.fnal.gov/redmine/projects/larreco/repository/revisions/develop/entry/larreco/RecoAlg/ProjectionMatchingAlg.h
24 1 Ruth Pordes
25 1 Ruth Pordes
And all the building blocks for the track and vertex optimization are in the directory:
26 1 Ruth Pordes
https://cdcvs.fnal.gov/redmine/projects/larreco/repository/revisions/develop/show/larreco/RecoAlg/PMAlg
27 1 Ruth Pordes
28 1 Ruth Pordes
The cost of computations is mostly due to trajectory node optimization, done with finite-difference calculations of the gradient of the objective function with respect to the node position. If you'd like to have a look, the code is here:
29 1 Ruth Pordes
https://cdcvs.fnal.gov/redmine/projects/larreco/repository/revisions/develop/entry/larreco/RecoAlg/PMAlg/PmaNode3D.h#L92
30 1 Ruth Pordes
31 1 Ruth Pordes
void Optimize(float penaltyValue, float endSegWeight);
32 1 Ruth Pordes
33 1 Ruth Pordes
and functions:
34 1 Ruth Pordes
35 1 Ruth Pordes
double Pi(float endSegWeight, bool doAsymm) const;
36 1 Ruth Pordes
double Penalty(float endSegWeight) const;
37 1 Ruth Pordes
double Mse(void) const;
38 1 Ruth Pordes
double MakeGradient(float penaltyValue, float endSegWeight);
39 1 Ruth Pordes
double StepWithGradient(float alfa, float tol, float penalty, float weight);
40 1 Ruth Pordes
41 1 Ruth Pordes
The complexity on the higher level comes from scoring the tracks made of various (possible) matching of clusters in complementary 2D projections, this is done more or less here:
42 1 Ruth Pordes
https://cdcvs.fnal.gov/redmine/projects/larreco/repository/revisions/develop/entry/larreco/TrackFinder/PMAlgTrackMaker_module.cc#L1851
43 2 Erica Snider
44 2 Erica Snider
45 2 Erica Snider
h2. Working session materials
46 2 Erica Snider
47 3 Erica Snider
Valgrind callgraph output attached to this page
48 3 Erica Snider
49 3 Erica Snider
50 3 Erica Snider
Sample jobs
51 3 Erica Snider
* Configuration:  /pnfs/dune/persistent/users/rnd/pma_code_review/test_input/fcl/
52 3 Erica Snider
** protoDUNE_pmtrack_reco.fcl
53 3 Erica Snider
54 3 Erica Snider
* Data:  /pnfs/dune/persistent/users/rnd/pma_code_review/test_input/data
55 3 Erica Snider
**  protoDune_kaon_1GeV_mono_linecluster.root  
56 3 Erica Snider
**  protoDune_proton_1GeV_mono_linecluster.root
57 3 Erica Snider
58 3 Erica Snider
# Check out dunetpc
59 3 Erica Snider
# Run lar -c fcl/protoDUNE_pmtrack_reco.fcl <input> -o output.root
60 3 Erica Snider
# lar -c evd_protoDUNE.fcl reconstructed.root
61 3 Erica Snider
62 3 Erica Snider
63 3 Erica Snider
"The two files in data dir are 1GeV protons and kaons from the recent MCC6. I usually use for tests 2GeV pions, since they are producing moderately complicated topologies and are of the interest for many analyses we are preparing. I'll add such file before our session, I just need to prepare it in the same way as two other files, which is:
64 3 Erica Snider
65 3 Erica Snider
"single particle gun -> g4 propagation in LAr -> detsim making raw digits on readout channels -> partial reconstruction (deconvolution, hit finding, linecluster) that is in the reco chain before PMA"