Module Writing Tutorial: Difference between revisions

From Mu2eWiki
Jump to navigation Jump to search
Line 20: Line 20:
various kinds of output.
various kinds of output.


== Exercises ==
* Compile and run HelloWorld in art
The majority of the session time should be spent performing exercises, which you link or embed in the session page.
* Add a configuration parameter to the module
* Each exercise should have a title; ie ''Create a histogram of the reconstructed Ce momentum''
* Find a mu2e data product in an event
* Exercises may be chained (ie the output of the first is used as input to the next), but in that case make sure the output is also part of the downloads, so people who failed at step 1 can continue with the subsequent steps.  Design this so that a failed step 1 does not overwrite the downloaded file that is the input to step 2.
* Create and fill a histogram from a data product
* Some steps may take considerable processing time.  In that case, have your attendees perform a short version (ie process 10 events), and provide the full output (ie histograms from 10^5 events) as part of the session download for subsequent steps.
* Create a subset of a data product and add it to the event
* Each exercise should take between 5 and 15 minutes to complete.  Count on your attendees taking twice as much time as would an experienced person.
* Create a new data product, fill it, and add it to the event
* Start each exercise by bringing the exercise up on the main screen and going through its intro.
* Create and use a persistent pointer (Ptr) to a data product
* Perform each step of the exercise on the screen, describing any decisions or issues involved as you do it.  Check with your audience to make sure most (preferably all) have finished each step before going on to the next.  If someone seems stuck, assign a session helper to help them individually and move on.
* Create an association between 2 data products
* It's OK to provide more exercises than most people will complete during the tutorial; they can be completed as homework.
 
== Session Organization Guideline ==
== Session Organization Guideline ==
* Encourage your attendees to ask questions if they are unsure what to do.
* Encourage your attendees to ask questions if they are unsure what to do.

Revision as of 00:30, 24 May 2019

Tutorial Session Goal

This tutorial will show how to write an art module for Mu2e. It will explain how to structure the code, define runtime parameters, produce histograms and/or TTrees, and consume and produce data products.

Session Prerequisites and Advance Preparation

This tutorial requires the user to:

Session Introduction

Mu2e uses the art framework to organize our event processing code. The art framework processes events through a configurable sequential set of modules, called a path. Modules expects certain inputs, and optionally produces certain outputs. Modules have a standard interface for interacting with the art framework, giving the user access to data at run/subrun/event transitions. Modules have a standard library for defining configuration parameters that can be changed at runtime.

In this tutorial you will learn how to create an art module from a basic template, and perform basic data operations in that module. You will learn how to configure your module in code and fcl, and how to produce various kinds of output.

  • Compile and run HelloWorld in art
  • Add a configuration parameter to the module
  • Find a mu2e data product in an event
  • Create and fill a histogram from a data product
  • Create a subset of a data product and add it to the event
  • Create a new data product, fill it, and add it to the event
  • Create and use a persistent pointer (Ptr) to a data product
  • Create an association between 2 data products

Session Organization Guideline

  • Encourage your attendees to ask questions if they are unsure what to do.
  • You may or may not have session helpers, who have already performed the tutorial
  • If someone finishes a step or exercise early, have them look around for neighbors that need help.
  • If someone is stuck, have them raise their hand to get help.

Reference Materials

  • Use this place to add inks to reference materials.