Classes | Namespaces
AnalysisExample_module.cc File Reference

A basic "skeleton" to read in art::Event records from a file, access their information, and do something with them. More...

#include "larcore/Geometry/Geometry.h"
#include "larcorealg/Geometry/GeometryCore.h"
#include "larcoreobj/SimpleTypesAndConstants/geo_types.h"
#include "lardata/DetectorInfoServices/DetectorClocksService.h"
#include "lardataobj/RecoBase/Cluster.h"
#include "lardataobj/RecoBase/Hit.h"
#include "lardataobj/Simulation/SimChannel.h"
#include "larsim/Simulation/LArG4Parameters.h"
#include "nusimdata/SimulationBase/MCParticle.h"
#include "nusimdata/SimulationBase/MCTruth.h"
#include "art/Framework/Core/EDAnalyzer.h"
#include "art/Framework/Core/ModuleMacros.h"
#include "art/Framework/Principal/Event.h"
#include "art/Framework/Principal/Handle.h"
#include "art/Framework/Services/Registry/ServiceHandle.h"
#include "art_root_io/TFileService.h"
#include "canvas/Persistency/Common/FindManyP.h"
#include "canvas/Utilities/Exception.h"
#include "cetlib/pow.h"
#include "fhiclcpp/types/Atom.h"
#include "fhiclcpp/types/Table.h"
#include "messagefacility/MessageLogger/MessageLogger.h"
#include "TH1.h"
#include "TLorentzVector.h"
#include "TTree.h"
#include "TVector3.h"
#include <cmath>
#include <map>

Go to the source code of this file.

Classes

class  lar::example::AnalysisExample
 Example analyzer module. More...
 
struct  lar::example::AnalysisExample::Config
 

Namespaces

 lar
 LArSoft-specific namespace.
 
 lar::example
 LArSoft examples.
 

Detailed Description

A basic "skeleton" to read in art::Event records from a file, access their information, and do something with them.

Author
William Seligman (selig.nosp@m.man@.nosp@m.nevis.nosp@m..col.nosp@m.umbia.nosp@m..edu)

See https://cdcvs.fnal.gov/redmine/projects/larsoft/wiki/Using_art_in_LArSoft for a description of the ART classes used here.

Almost everything you see in the code below may have to be changed by you to suit your task. The example task is to make histograms and n-tuples related to $ dE/dx $ of particle tracks in the detector.

As you try to understand why things are done a certain way in this example ("What's all this stuff about 'auto const&'?"), it will help to read ADDITIONAL_NOTES.md in the same directory as this file.

Also note that, despite our efforts, the documentation and the practices in this code may fall out of date. In doubt, ask!

The last revision of this code was done in August 2017 with LArSoft v06_44_00.

This is in-source documentation in Doxygen format. Doxygen is a utility that creates web pages from specially-formatted comments in program code. If your package is ever added to an official LArSoft release, the doxygen-style comments will be added to the LArSoft doxygen pages at http://nusoft.fnal.gov/larsoft/doxsvn/html/.

You can see the doxygenated version of the following lines at http://nusoft.fnal.gov/larsoft/doxsvn/html/classlar_1_1example_1_1AnalysisExample.html

Doxygen tips:

In general, comments that start with "///" or in C++ comment blocks (like this one) will appear in the web pages created by Doxygen.

A comment starting with "///" will be associated wth the next code line that follows it, while one starting with "///<" will be associated with the one above it.

For more on doxygen, see the documentation at http://www.stack.nl/~dimitri/doxygen/manual/index.html

Definition in file AnalysisExample_module.cc.