Particle Physics - @lemouth exercise 1a

in #utopian-io6 years ago (edited)


[Image Credit: CERN]

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

Post Body

After following @lemouth instructions and implementing a one liner in the Execute method template, here is the output that I get.

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:

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

Series Backlinks

This is the first post in this series.

Sort:  

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 ;)

Of course. That makes sense.

Update: I have created this github repository to store all contributions. Can you please add yours following the ex1a-irelandscape.cpp syntax (I only need the c++ file)? Thanks in advance!

Hi @lemouth, not 100% familiar with github.
Do I need to have permissions to be able to push commits to your repository?
Or should I create a fork first?

I gave you writing rights for this folder. Please let me know whether it works.

It doesn't seem to be working at the moment:

root@lhc:~/mad5-utopian-exercises# ls -ltr
total 16
-rw-r--r-- 1 root root  511 May 26 17:31 README.md
-rw-r--r-- 1 root root 9070 May 26 17:33 ex1a-irelandscape.cpp
root@lhc:~/mad5-utopian-exercises# git push
Username for 'https://github.com': irelandscape
Password for 'https://[email protected]': 
remote: Permission to BFuks/mad5-utopian-exercises.git denied to irelandscape.
fatal: unable to access 'https://github.com/BFuks/mad5-utopian-exercises/': The requested URL returned error: 403

You must first accept the invitation that I sent you through github.

Thanks, that was the problem.
I've pushed the change now.

Coin Marketplace

STEEM 0.20
TRX 0.13
JST 0.030
BTC 65248.25
ETH 3471.40
USDT 1.00
SBD 2.51