CandNtupleSR

Contents

Contact Name

Sue Kasahara.

Further Links

The Standard Ntuple web site with ntuple analysis examples, etc. is available as a primary resource for current information about the ntuples. A link to this site is also available off of the main WebDocs page.

This page supplements the material available there.

Overview

The CandNtupleSR package contains the ntuple class definitions for the standard reconstruction ntuple, produced as part of production running and stored in production files ending in .sntp.<release>.root or .snts.<release>.root in root TTree "NtpSR". This ntuple stores a subset of data produced during standard reconstruction. The files storing the ntuple data are therefore of smaller size and are more easily accessible than the full reconstruction data stored in .cand.<release>.root files, however they don't attempt to store the complete reconstruction results stored in the .cand. files. The SR ntuple is especially useful for end-user analyses interested in summary reconstruction results, e.g. results from track fitting. The SR ntuple can also be used as a starting point in an analysis to select a subset of Snarls of interest, before turning to the .cand.root files for a deeper analysis of just those selected events.

The SR ntuple is analyzable in a "bare" root session, without the load of minossoft libraries, or in a loon session. Examples of this are given on the Standard Ntuple site described above. The ntuple may be also be read into a subsequent loon job using job control for further analysis or record selection.

Structure

The SR ntuple consists of a record of class type NtpSRRecord, which is stored in a ROOT TTree of name "NtpSR" with one record per tree entry. One NtpSRRecord contains the ntuple summary data from one Snarl.

The NtpSR tree is constructed with one main branch of name "NtpSRRecord", which has been "split" (automatically, specifying the splitlevel in a root method) to create a branch.subbranch.(...).leaf structure for the NtpSR tree, such that every leaf stores the data of one ntuple variable of basic data type (float,int, etc.).

The NtpSR tree contains hundreds of data branches. Its structure can be viewed in a bare root session using the TTree::Print() command, for example:

{
 //usage: root -bq thisscript.C >& thisscript.log  
 TFile* file = new TFile("filename.sntp.R1.9.root","READ");
 TTree* tree = (TTree*)(file->Get("NtpSR"));
 tree -> Print();
}

The contents of the ntuple can be better understood by looking at the data members of the top level ntuple class, NtpSRRecord. From NtpSRRecord.h:

  NtpSREventSummary  evthdr;    // event summary data
  NtpSRShieldSummary vetohdr;   // veto shield summary data
  NtpSRCosmicRay     crhdr;     // cr data, filled from last recons. trk vertex
  NtpSRDmxStatus     dmxstatus; // status of demux

  TClonesArray* vetostp; //-> array of shield strips of type NtpSRShieldStrip
  TClonesArray* stp;  //-> array of strips of type NtpSRStrip
  TClonesArray* slc;  //-> array of slices of type NtpSRSlice
  TClonesArray* shw;  //-> array of showers of type NtpSRShower
  TClonesArray* trk;  //-> array of tracks of type NtpSRTrack
  TClonesArray* evt;  //-> array of events of type NtpSREvent
The NtpSRRecord class stores data members organized as objects and arrays of objects. The object data members, for example "evthdr", represent summary data for the entire snarl, and the (TClones)Arrays of objects, for example "trk", represent the different reconstruction entities associated with the snarl, specifically events,tracks, showers, slices, and strips (detector and veto).

Brief descriptions of the data members appearing in the ntuple are given in the class definition header files alongside the data members, so that the CandNtupleSR/*.h files can be a useful introductory resource to the content of the SR ntuple.

Input/Output

NtpSRRecords are produced by the NtpSRModule defined in CandNtupleSR/Module. A second job module CandNtupleSR/Module/NtpSRFilterModule is used to produced the stripped down version of the NtpSRRecord stored in the smaller (.snts.) files. These files have the same content as the full ntuples, but the strip information as been removed to save space.

Input Objects

The RawRecord and CandRecord are the input data source for constructing a NtpSRRecord. Raw and CandRecords from a previously produced .cand.<release>.root file can be used as input to a subsequent job in which only the NtpSRModule is run to produce ntuples.

Output Objects

The output of the NtpSRModule is a NtpSRRecord stored in Mom. The Output module will store the NtpSRRecord in a tree NtpSR in the user specified output file, if requested in the job script. The name of the output tree may be changed by the user from the default NtpSR.

Configuring & Running

A simple script to run the NtpSRModule to generate a file testNtpSR.root with tree NtpSR is shown here. The input file for this script should be a .cand.<release>.root file.
{
  // A job to demonstrate how to run the NtpSRModule
  // usage: loon -bq thisscript.C <cand filename>
  
  JobC j;

  j.Input.Set("Format=input");
  j.Input.Set("Streams=DaqSnarl,Cand"); // Define the input data streams

  j.Path.Create("Demo","NtpSRModule::Reco "
                       "Output::Put ");

  j.Path("Demo").Mod("Output").Set("Streams=NtpSR"); // output data stream
  j.Path("Demo").Mod("Output").Set("FileName=testNtpSR.root"); // output file


  j.Path("Demo").Run();
}

Sue Kasahara Last Modified: $Date: 2004/10/23 03:02:25 $