Mu2e Home
Printing art Products

This page describes an Offline utility that can be used to print standard mu2e art products and other useful information. An overview of art products and naming is also available.

To print mu2e art products

To print the list of products in a file
mu2e -c Print/fcl/dumpDataProducts.fcl
To print the mu2e art products in a file, in a briefer form. Note that this supresses low-momentum particles. example output
mu2e -c Print/fcl/print.fcl
To print the mu2e art products in a file, in a longer form. Everything possible is printed. example output
mu2e -c Print/fcl/printLong.fcl

These fcl can be modfied to only print certain products, certain instances of products, and to supress low-momentum particles. See the printLong.fcl file to see all options.

The print module can be put in a path with other modules. This is particularly useful to see the KalRep contents, which are not persistent.

Each product has a utility class which can be used anywhere in the code. As an example:

#include "Print/inc/CaloClusterPrinter.hh"
CaloClusterPrinter _ccprinter;
      auto ih = event.getValidHandle(tag);
To print to a separate file
#include "Print/inc/CaloClusterPrinter.hh"
CaloClusterPrinter _ccprinter;

  ofstream ofs("file.log");
  auto ih = event.getValidHandle(tag);
  if(interesting) _ccprinter.Print(ih,ofs);
There are several interfaces:
    void Print(art::Event const& event,
	       std::ostream& os = std::cout) override;
    void Print(const art::Handle& handle, 
	       std::ostream& os = std::cout);
    void Print(const art::ValidHandle& handle, 
	       std::ostream& os = std::cout);
    void Print(const CaloClusterCollection& coll, 
	       std::ostream& os = std::cout);
    void Print(const art::Ptr& ptr, 
	       int ind = -1, std::ostream& os = std::cout);
    void Print(const mu2e::CaloCluster& obj, 
	       int ind = -1, std::ostream& os = std::cout);

We plan to make sure all products have a simple << operator too.

Other print utilties

This print is very similar dumpDataProducts.fcl, but does not print SubRun products and adds a count of dropped products. It uses the art product (not mu2e) module FileDumperOutput. example output
mu2e -c Print/fcl/fileDumper.fcl
This print will compute the average size of the products in the file. example output
artProductSizes file

To print event numbers

To print the run, event and subrun numbers of the file contents
mu2e -c Print/fcl/events.fcl
To count the runs, events and subruns in the file
mu2e -c Print/fcl/count.fcl
To print the piece of the SAM record which is derived from the file
mu2e -c Print/fcl/printSam.fcl

This module fcl can be modified to also print the begin run and subrun numbers. See events.fcl for options.

Fermilab at Work ]  [ Mu2e Home ]  [ Mu2e @ Work ]  [ Mu2e DocDB ]  [ Mu2e Search ]

For web related questions:
For content related questions:
This file last modified Tuesday, 11-Oct-2016 15:44:02 CDT
Security, Privacy, Legal Fermi National Accelerator Laboratory