GammaWare  Head Version for release 0.9
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Gw::GeantLMOF Class Reference

Class to read/decode Geant List Mode Output Files. More...

#include <GeantLMOF.h>

Public Types

enum  Status { kEmpty, kGood, kEoE, kFail }
 Reading status. More...
 

Public Member Functions

void AddFile (const char *fname)
 to add an input file More...
 
 GeantLMOF ()
 
Double_t GetDistFactor () const
 
const std::vector< Double_t > & GetDx ()
 
const std::vector< Double_t > & GetDy ()
 
const std::vector< Double_t > & GetDz ()
 
const std::vector< Double_t > & GetEdep ()
 
Double_t GetEnerFactor () const
 
const std::vector< Double_t > & GetEnergy ()
 
const std::vector< Double_t > & GetEventsRead ()
 
const std::vector< Int_t > & GetEvNum ()
 
Double_t GetfRecoilBeta () const
 
const std::vector< Int_t > & GetNdet ()
 
const std::vector< Int_t > & GetNInt ()
 
const std::vector< Double_t > & GetNseg ()
 
const std::vector< Int_t > & GetPrimary ()
 
const std::vector< Double_t > & GetPx ()
 
const std::vector< Double_t > & GetPy ()
 
const std::vector< Double_t > & GetPz ()
 
void GetRecoil (Double_t &b, Double_t &dx, Double_t &dy, Double_t &dz) const
 
const std::vector< Int_t > & GetType ()
 
UInt_t NbEmitted () const
 
UInt_t NbImpacts () const
 
Bool_t NextEvent (UInt_t mult=kMaxUInt)
 To load the next event. More...
 
void NextFile ()
 switch to next file. More...
 
GeantLMOFoperator<< (GeantLMOF &(*pf)(GeantLMOF &))
 
void operator>> (GammaTracker *)
 fill the tracker with the current event More...
 
void SetPath (const char *path="./")
 
void SetRecoil (Float_t b=0.0, Float_t dx=0.0, Float_t dy=0.0, Float_t dz=1.0, Float_t angle=0.0)
 
void ShowCurrentConditions ()
 The current status is shown on the standard ouptut. More...
 
void ShowCurrentEvent ()
 
 ~GeantLMOF ()
 

Static Public Member Functions

static TGeoVolume * ImportAgataG4 (const char *asolid="asolid", const char *aclust="aclust", const char *aeuler="aeuler", const char *top="World")
 to import the agata geometry from the Agata-Geant4 world More...
 

Protected Member Functions

UInt_t OnlyType (const GeantLMOF &input, Int_t fTypemin=1, Int_t fTypemax=1)
 Fill this using another GeantLMOF by keeping only emmitted particles with fType between fTypemin & fTypemax. More...
 

Friends

GeantLMOFcheckout (GeantLMOF &reader)
 
GeantLMOFfastout (GeantLMOF &reader)
 

Detailed Description

Class to read/decode Geant List Mode Output Files.

This class is an event stream to read events written in GEANT list-mode output files (see AGATA documentation). Several files could be chained to allow large dataset to be treated. Once a single directory is provided (see SetPath()), you can add as many files as you need with the AddFile member. The file's name is relative to the path directory. For instance, if you need to chain two files /data/mysimu1/run1 and /data/mysimu1/run2, you should do:
GeantLMOF reader;
reader.SetPath("/data/mysimu1/"); reader.AddFile("run1"); reader.AddFile("run2");
Once the input files are given, the member NextEvent() loads the next event. An event is composed of a list of emmitted particles and a list of associated impacts. The members NbEmitted() and NbImpacts() returns the values for the current event. Several additionnal members (GetXXX like) help you to get everything that is defined in the list-mode output file format. The Get members have about the same name as given in the AGATA-GEANT documentation.
The current event could be send to a GammaTracker through the >> operator:
GeantLMOF reader;
GammaTracker *tracker = GammaTracker::GetTracker("TheTrackerYouWant");
while ( reader.NextEvent() ) { reader >> tracker; ... and do whatever you want with the tracker output ... }

As a default, this class is as general as possible. It means the input files may contains other particles that gammas. These particles cannot be sent to the GammaTracker. To remove the additionnal particles, the >> operator sorts the inputs before sending them to the tracker. if you are sure that your input files contain only gamma-rays, you can call speed up the process with the following command:
GeantLMOF reader;
reader << fastout;

To toggle back on the checking: reader << checkout;

Todo:
  • full reading of the header part
  • some reading of event by event not yet implemented (ID -101, -102 and -103)
  • position of impacts in the detector frame (mgs reference frame)
    @author Olivier Stezowski

Definition at line 59 of file GeantLMOF.h.


The documentation for this class was generated from the following files: