Particle Physics - @lemouth exercise 1a by irelandscape

View this thread on steempeak.com
· @irelandscape · (edited)
$9.75
Particle Physics - @lemouth exercise 1a
![](https://cdn.steemitimages.com/DQmYuV5Q1CuPp7ScoCntrZ6MgUPptwhcXNzvQpmirKAUepe/image.png)
[Image Credit: [CERN](https://home.cern/topics/large-hadron-collider)]
#### Repository
https://github.com/irelandscape/cern_contributions

#### Introduction
This post is my result of the exercise 1a submitted by @lemouth in his post [Particle physics @ Utopian - Detecting particles at colliders and implementing this on a computer](https://steemit.com/utopian-io/@lemouth/particle-physics-utopian-detecting-particles-at-colliders-and-implementing-this-on-a-computer#@irelandscape/re-mactro-re-irelandscape-re-lemouth-particle-physics-utopian-detecting-particles-at-colliders-and-implementing-this-on-a-computer-20180525t124618611z)

#### Post Body
After following @lemouth instructions and implementing a one liner in the *Execute* method template, here is the output that I get.
```text
root@lhc:~/madanalysis5/test_folder/Build# ./MadAnalysis5job ../Input/tth_aa.list 
    * SampleAnalyzer for MadAnalysis 5 - Welcome.
    * Initializing all components
      - version: 1.6 (2018/05/04) 
      - general: everything is default.
      - extracting the list of event samples...
      - analyzer 'test_analysis'
BEGIN Initialization
END   Initialization
    * Running over files ...
    * 1/1  /root/cern_contributions/exercises/1a/tth_aa.root
Error in cling::AutoloadingVisitor::InsertIntoAutoloadingState:
   Missing FileEntry for ExRootAnalysis/ExRootTreeReader.h
   requested to autoload type ExRootTreeReader
Error in cling::AutoloadingVisitor::InsertIntoAutoloadingState:
   Missing FileEntry for ExRootAnalysis/ExRootTreeWriter.h
   requested to autoload type ExRootTreeWriter
Error in cling::AutoloadingVisitor::InsertIntoAutoloadingState:
   Missing FileEntry for ExRootAnalysis/ExRootTreeBranch.h
   requested to autoload type ExRootTreeBranch
Error in cling::AutoloadingVisitor::InsertIntoAutoloadingState:
   Missing FileEntry for ExRootAnalysis/ExRootResult.h
   requested to autoload type ExRootResult
Error in cling::AutoloadingVisitor::InsertIntoAutoloadingState:
   Missing FileEntry for ExRootAnalysis/ExRootClassifier.h
   requested to autoload type ExRootClassifier
Error in cling::AutoloadingVisitor::InsertIntoAutoloadingState:
   Missing FileEntry for ExRootAnalysis/ExRootFilter.h
   requested to autoload type ExRootFilter
Error in cling::AutoloadingVisitor::InsertIntoAutoloadingState:
   Missing FileEntry for ExRootAnalysis/ExRootProgressBar.h
   requested to autoload type ExRootProgressBar
Error in cling::AutoloadingVisitor::InsertIntoAutoloadingState:
   Missing FileEntry for ExRootAnalysis/ExRootConfReader.h
   requested to autoload type ExRootConfParam
Error in cling::AutoloadingVisitor::InsertIntoAutoloadingState:
   Missing FileEntry for ExRootAnalysis/ExRootConfReader.h
   requested to autoload type ExRootConfReader
Error in cling::AutoloadingVisitor::InsertIntoAutoloadingState:
   Missing FileEntry for ExRootAnalysis/ExRootTask.h
   requested to autoload type ExRootTask
        => file size: 943.63 ko
WARNING: --------------------------------------------------------------------------------
WARNING:  Msg     | the input file has been produced with ROOT version 61000 whereas the loaded ROOT libs are related to the version 61206
WARNING:  Details | 
WARNING:  Where   | Function = ReadHeader ; File=root/ROOTReader.cpp ; Line=70
WARNING: --------------------------------------------------------------------------------
        => sample format: Delphes-ROOT file produced by Delphes + MA5tuned-cards.
        => progress: [===>                               ]
Photons: 3, Electrons: 0, Muons: 0

        => progress: [======>                            ]
Photons: 3, Electrons: 0, Muons: 0

        => progress: [==========>                        ]
Photons: 3, Electrons: 2, Muons: 1Thank you for 

        => progress: [=============>                     ]
Photons: 1, Electrons: 0, Muons: 1

        => progress: [=================>                 ]
Photons: 4, Electrons: 0, Muons: 0

        => progress: [====================>              ]
Photons: 3, Electrons: 0, Muons: 1

        => progress: [========================>          ]
Photons: 4, Electrons: 0, Muons: 0

        => progress: [===========================>       ]
Photons: 4, Electrons: 1, Muons: 0

        => progress: [===============================>   ]
Photons: 3, Electrons: 0, Muons: 0

        => progress: [==================================>]
Photons: 6, Electrons: 1, Muons: 0

        => progress: [===================================]
        => total number of events: 10 ( analyzed: 10 ; skipped: 0 ) 
    * Finalizing all components ...
    * Total number of processed events: 10.
BEGIN Finalization
END   Finalization
+----------------------------------------------------------------------------------------------------------------------+
|                              LogReport-Warning                                                                       |
+----------------------------------------------------------------------------------------------------------------------+
| Message                                       NIterations @ File                                              Line   |
|----------------------------------------------------------------------------------------------------------------------|
| the input file has been produced with ROOT v  1             root/ROOTReader.cpp                               70     |
+----------------------------------------------------------------------------------------------------------------------+
    * Goodbye.

```

As you can see the program appears to run properly but some errors are reported at startup.

Please let me know in your comments if you know what the problem might be.

The code couldn't be any simpler:

```cpp
bool test_analysis::Execute(SampleFormat& sample, const EventFormat& event)
{
  cout << "Photons: " << event.rec()->photons().size() << ", "
       << "Electrons: " << event.rec()->electrons().size() << ", "
       << "Muons: " << event.rec()->muons().size() << endl;
...
}
```

#### Resources
* [Particle physics @ Utopian - Detecting particles at colliders and implementing this on a computer](https://steemit.com/utopian-io/@lemouth/particle-physics-utopian-detecting-particles-at-colliders-and-implementing-this-on-a-computer#@irelandscape/re-mactro-re-irelandscape-re-lemouth-particle-physics-utopian-detecting-particles-at-colliders-and-implementing-this-on-a-computer-20180525t124618611z), by @lemouth

#### Series Backlinks
This is the first post in this series.
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 56 others
properties (23)
post_id50,238,574
authorirelandscape
permlinkparticle-physics-lemouth-exercise-1a
categoryutopian-io
json_metadata"{"format": "markdown", "image": ["https://cdn.steemitimages.com/DQmYuV5Q1CuPp7ScoCntrZ6MgUPptwhcXNzvQpmirKAUepe/image.png"], "links": ["https://home.cern/topics/large-hadron-collider", "https://github.com/irelandscape/cern_contributions", "https://steemit.com/utopian-io/@lemouth/particle-physics-utopian-detecting-particles-at-colliders-and-implementing-this-on-a-computer#@irelandscape/re-mactro-re-irelandscape-re-lemouth-particle-physics-utopian-detecting-particles-at-colliders-and-implementing-this-on-a-computer-20180525t124618611z"], "app": "steemit/0.1", "tags": ["utopian-io", "steemstem", "cern", "programming", "physics"], "users": ["lemouth"]}"
created2018-05-25 13:06:12
last_update2018-05-25 13:08:12
depth0
children9
net_rshares2,548,292,900,634
last_payout2018-06-01 13:06:12
cashout_time1969-12-31 23:59:59
total_payout_value7.604 SBD
curator_payout_value2.147 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length6,602
author_reputation15,369,745,159,352
root_title"Particle Physics - @lemouth exercise 1a"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (120)
@lemouth ·
Yes, this was very simple and you did it in the most compact possible way. However, I want to move slowly as I have no clue about the level of everyone. The next exercise will be slightly harder ;)
👍  
properties (23)
post_id50,285,562
authorlemouth
permlinkre-irelandscape-particle-physics-lemouth-exercise-1a-20180525t191738077z
categoryutopian-io
json_metadata"{"tags": ["utopian-io"], "app": "steemit/0.1"}"
created2018-05-25 19:18:00
last_update2018-05-25 19:18:00
depth1
children8
net_rshares3,008,216,178
last_payout2018-06-01 19:18:00
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length197
author_reputation178,283,483,453,967
root_title"Particle Physics - @lemouth exercise 1a"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (1)
@irelandscape ·
Of course. That makes sense.
properties (22)
post_id50,294,134
authorirelandscape
permlinkre-lemouth-2018525t213927745z
categoryutopian-io
json_metadata"{"format": "markdown+html", "community": "esteem", "app": "esteem/1.6.0", "tags": ["utopian-io"]}"
created2018-05-25 20:39:30
last_update2018-05-25 20:39:30
depth2
children7
net_rshares0
last_payout2018-06-01 20:39:30
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length28
author_reputation15,369,745,159,352
root_title"Particle Physics - @lemouth exercise 1a"
beneficiaries
0.
accountesteemapp
weight1,000
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@lemouth ·
Update: I have created [this github repository](https://github.com/BFuks/mad5-utopian-exercises) to store all contributions. Can you please add yours following the ```ex1a-irelandscape.cpp``` syntax (I only need the c++ file)? Thanks in advance!
properties (22)
post_id50,358,781
authorlemouth
permlinkre-irelandscape-re-lemouth-2018525t213927745z-20180526t090233693z
categoryutopian-io
json_metadata"{"tags": ["utopian-io"], "app": "steemit/0.1", "links": ["https://github.com/BFuks/mad5-utopian-exercises"]}"
created2018-05-26 09:02:36
last_update2018-05-26 09:02:36
depth3
children6
net_rshares0
last_payout2018-06-02 09:02:36
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length245
author_reputation178,283,483,453,967
root_title"Particle Physics - @lemouth exercise 1a"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000