Experimental Data Processing Laboratory
A.Y. 2025/2026
Learning objectives
We aim to offer students an introduction to the fundamental numerical computing techniques in use in the physical sciences field. Basic operating system features and commands are covered, then data structures
(in particular as included in the C++ standard library), numerical integration techniques, solution of differential equations and random-number based methods. We emphasize on a deep understanding of both the advantages and the limitations of each numerical technique. The C++ programming language is used, so its main design features (inheritance, encapsulation and polymorphism) are explained, in the context of the object-oriented (OO) design and programming paradigm.
(in particular as included in the C++ standard library), numerical integration techniques, solution of differential equations and random-number based methods. We emphasize on a deep understanding of both the advantages and the limitations of each numerical technique. The C++ programming language is used, so its main design features (inheritance, encapsulation and polymorphism) are explained, in the context of the object-oriented (OO) design and programming paradigm.
Expected learning outcomes
Upon completion of the course each student will be able to:
1) interact with the UNIX operating system, in particular its input/output and data storage subsystems.
2) write C++ code to acquire and/or analyze experimental data and compute the main statistical estimators.
3) implement a few numerical algorithms in C++ (function root finding, integrals, differential equation solution.
4) write numerical C++ code to study a few simple mechanics and electrostatics problems.
5) write a random number generator and understand its operation and limitations.
6) use a random number generator to compute one- and multi-dimensional integrals.
7) use a random number generator to simulate the operation of an experimental apparatus, and propagate the systematic error introduced by such a measurement.
1) interact with the UNIX operating system, in particular its input/output and data storage subsystems.
2) write C++ code to acquire and/or analyze experimental data and compute the main statistical estimators.
3) implement a few numerical algorithms in C++ (function root finding, integrals, differential equation solution.
4) write numerical C++ code to study a few simple mechanics and electrostatics problems.
5) write a random number generator and understand its operation and limitations.
6) use a random number generator to compute one- and multi-dimensional integrals.
7) use a random number generator to simulate the operation of an experimental apparatus, and propagate the systematic error introduced by such a measurement.
Lesson period: First semester
Assessment methods: Esame
Assessment result: voto verbalizzato in trentesimi
Single course
This course cannot be attended as a single course. Please check our list of single courses to find the ones available for enrolment.
Course syllabus and organization
Single session
Responsible
Lesson period
First semester
Course syllabus
During the course some numerical techniques are presented to deal with physical problems of interest. The reference language for the implementation of these techniques is C++: during the development of course the main features of this language (classes, templates, polymorphism) will be discussed.
In more details the covered topics will be:
1) Experimental data analysis: reading data from a file, elementary statistical analysis and visualization of the collected data.
- Basic elements of the C language (data types, control structures)
- Introduction to object-oriented programming, the concept of class
- Template classes and functions
- Data containers and algorithms: elementary containers, STL containers (vector, list and map) and algorithms (algorithm.h)
2) Exercises on object oriented approach: calculation of electric and gravitational fields
- derived classes. encapsulation.
3) Methods for finding zeros of a function: bisection algorithm, secant and Newtown methods. Performance and limitations.
- virtual methods, abstract classes and polymorphism
4) Numerical quadrature techniques: midpoint method, trapezoid and Simpson methods. Estimate of the error in the calculation of an integral with numerical techniques.
5) Solution of ordinary differential equations. One step methods (Euler and Runge-Kutta). Application to various physical systems: pendulum, forced and damped harmonic oscillator. Error analysis.
6) Remarks of probability theory, random variables and central limit theorem. Random number generators for uniform, exponential and Gaussian distributions. Inverse function method and accept / reject. Monte Carlo methods for the integration of a function and for the simulation of experimental apparatuses.
In more details the covered topics will be:
1) Experimental data analysis: reading data from a file, elementary statistical analysis and visualization of the collected data.
- Basic elements of the C language (data types, control structures)
- Introduction to object-oriented programming, the concept of class
- Template classes and functions
- Data containers and algorithms: elementary containers, STL containers (vector, list and map) and algorithms (algorithm.h)
2) Exercises on object oriented approach: calculation of electric and gravitational fields
- derived classes. encapsulation.
3) Methods for finding zeros of a function: bisection algorithm, secant and Newtown methods. Performance and limitations.
- virtual methods, abstract classes and polymorphism
4) Numerical quadrature techniques: midpoint method, trapezoid and Simpson methods. Estimate of the error in the calculation of an integral with numerical techniques.
5) Solution of ordinary differential equations. One step methods (Euler and Runge-Kutta). Application to various physical systems: pendulum, forced and damped harmonic oscillator. Error analysis.
6) Remarks of probability theory, random variables and central limit theorem. Random number generators for uniform, exponential and Gaussian distributions. Inverse function method and accept / reject. Monte Carlo methods for the integration of a function and for the simulation of experimental apparatuses.
Prerequisites for admission
1) Knowledge of the main syntax elements of the C/C++ language as presented in the first-year Computer Science course: variable types, control structures (if, for, while), functions, and how to pass data to a function.
2) Basic elements of mathematical analysis: Taylor expansions, derivatives, integrals, and differential equations.
2) Basic elements of mathematical analysis: Taylor expansions, derivatives, integrals, and differential equations.
Teaching methods
The course is divided into 12 two-hour lessons in the classroom and 12 three-hour laboratory sessions. In each lesson the basic theoretical elements are introduced for a new topic which is then deepened through concrete applications in the following laboratory session. In the laboratory sessions, mathematics and physics problems are addressed by implementing numerical algorithms discussed in the class lessons in C ++ codes.
Students carry out the laboratory course exercises following the indications on the reference site and leaning on the help of the teacher or assistants in case of need.
Students carry out the laboratory course exercises following the indications on the reference site and leaning on the help of the teacher or assistants in case of need.
Teaching Resources
D.S. Malik: Programmazione in C++. Apogeo, 2013.
N. M. Josuttis: The C++ Standard Library-A Tutorial and Reference, 2nd Edition, Addison Wesley Longman, 2012
W.H. Press et al.: Numerical recipes in C/C++: the art of scientific computing, Cambridge University Press
http://www.cplusplus.com/
https://en.cppreference.com/w/
Slides of the theory lessons and laboratory web site
https://myariel.unimi.it/course/view.php?id=8085
https://labtnds.docs.cern.ch/
N. M. Josuttis: The C++ Standard Library-A Tutorial and Reference, 2nd Edition, Addison Wesley Longman, 2012
W.H. Press et al.: Numerical recipes in C/C++: the art of scientific computing, Cambridge University Press
http://www.cplusplus.com/
https://en.cppreference.com/w/
Slides of the theory lessons and laboratory web site
https://myariel.unimi.it/course/view.php?id=8085
https://labtnds.docs.cern.ch/
Assessment methods and Criteria
The learning verification will be carried out starting from the evaluation of:
1) codes created by the student during the laboratory sessions for the solution of the proposed exercises.
2) a practical computer test
3) an oral discussion.
The final mark will be defined during the oral examination and will take into account the outcome of the three parts listed above.
- The exercises carried out will be evaluated in terms of correctness, completeness and efficiency of the code.
- The practical test, lasting two hours, aims to verify the student's ability to apply the knowledge acquired during the course to a new physical problem: the student will have to create a C++ program that allows the solution of the proposed problem. In this test the student will be allowed to use the material he made during the laboratory.
- Finally, the oral test, lasting about an hour, will start from a discussion of the contents of the written test and then ascertain more generally the knowledge of the theoretical (algorithms) and methodological (coding) aspects covered in the course.
1) codes created by the student during the laboratory sessions for the solution of the proposed exercises.
2) a practical computer test
3) an oral discussion.
The final mark will be defined during the oral examination and will take into account the outcome of the three parts listed above.
- The exercises carried out will be evaluated in terms of correctness, completeness and efficiency of the code.
- The practical test, lasting two hours, aims to verify the student's ability to apply the knowledge acquired during the course to a new physical problem: the student will have to create a C++ program that allows the solution of the proposed problem. In this test the student will be allowed to use the material he made during the laboratory.
- Finally, the oral test, lasting about an hour, will start from a discussion of the contents of the written test and then ascertain more generally the knowledge of the theoretical (algorithms) and methodological (coding) aspects covered in the course.
FIS/01 - EXPERIMENTAL PHYSICS - University credits: 6
Laboratories: 36 hours
Lessons: 24 hours
Lessons: 24 hours
Shifts:
Professor:
Carminati Leonardo Carlo
Turno 1
Professor:
Carminati Leonardo CarloTurno 2
Professor:
Carminati Leonardo CarloTurno 3
Professor:
Maino DavideTurno 4
Professor:
Tomasi MaurizioTurno 5
Professor:
Galli Davide EmilioCORSO SERALE
Responsible
Lesson period
First semester
Course syllabus
Useful elements to acquire and process data with the help of one or more microprocessors will be presented. In particular.
· Operation of a microprocessor, and fundamental operations it can handle
· Role of the Operating System - UNIX basics
· Common structures of high-level programming languages, and their equivalence
· Debugging techniques
· Data structures and algorithms
· Calculation, measurement and comparison of algorithm efficiency
· Object model basics
· Numerical analysis techniques:
◦ Numerical instability
◦ Function root search
◦ Derivative computation
◦ Solution of ordinary differential equations
◦ Integral computation
◦ Monte-carlo methods
· Regular expressions
· Data networks
· Parallel programming fundamentals
· Operation of a microprocessor, and fundamental operations it can handle
· Role of the Operating System - UNIX basics
· Common structures of high-level programming languages, and their equivalence
· Debugging techniques
· Data structures and algorithms
· Calculation, measurement and comparison of algorithm efficiency
· Object model basics
· Numerical analysis techniques:
◦ Numerical instability
◦ Function root search
◦ Derivative computation
◦ Solution of ordinary differential equations
◦ Integral computation
◦ Monte-carlo methods
· Regular expressions
· Data networks
· Parallel programming fundamentals
Prerequisites for admission
The contents of the first year 'Informatica' (Computer Science) course should have been assimilated. The ability to write simple procedural programs in at least one programming language is expected.
Teaching methods
25 two-hours lab sessions are foreseen, in the evening (6 to 8pm). All groups will initially work on the same assignments, then will shift their focus on the problem selected for the final exam. Theory material, as detailed in the course program, will be presented during the lab sessions, and as needed for the continuation of the development. Asynchronous focus tasks will also be assigned between one lab session and the next.
Teaching Resources
The course material will be made available at the following URL:
https://www.mi.infn.it/~prelz/ltnds2025/
Other useful reference textbooks:
M. T. Goodrich, R. Tamassia et al: Data Structures and Algorithms in C++/Python/*
Wes McKinney, Python for Data Analysis, 3rd edition, O'Reilly 2022
N. M. Josuttis: The C++ Standard Library-A Tutorial and Reference, 2nd Edition, Addison Wesley Longman, 2012
W.H. Press et al.: Numerical recipes in C/C++: the art of scientific computing, Cambridge University Press
https://www.mi.infn.it/~prelz/ltnds2025/
Other useful reference textbooks:
M. T. Goodrich, R. Tamassia et al: Data Structures and Algorithms in C++/Python/*
Wes McKinney, Python for Data Analysis, 3rd edition, O'Reilly 2022
N. M. Josuttis: The C++ Standard Library-A Tutorial and Reference, 2nd Edition, Addison Wesley Longman, 2012
W.H. Press et al.: Numerical recipes in C/C++: the art of scientific computing, Cambridge University Press
Assessment methods and Criteria
Small groups will be formed for the lab work. After tackling a few common assignments, each group will choose a problem that meets the particular interest of the group, and that can be solved with IT and/or data analysis techniques. A solution will have to be coded and justified. A final, invividual oral exam will be based on the code developed in the course of the group activity.
FIS/01 - EXPERIMENTAL PHYSICS - University credits: 6
Laboratories: 36 hours
Lessons: 24 hours
Lessons: 24 hours
Professors:
Prelz Francesco, Rebatto Davide
Educational website(s)
Professor(s)
Reception:
On appointment
Reception:
Wednesday 14:30-16:00, or in other days by appointment (contact me by e-mail or telephone)
Dip. di Fisica, stanza A/T/S5b (piano 0 edificio LITA), via Celoria, 16
Reception:
Rendez-vous by e-mail: [email protected]
Office in the 'I' building - Computing Centre of the Physics Department, via Celoria 16
Reception:
By appointment
Room I/T/11A at "Palazzina Calcolo", Physics Department (via Celoria 16)
Reception:
Ask the teacher
Laboratorio di Strumentazione Spaziale, Department of physics (via Celoria 16, Milano)