KaliVeda  1.12/06
Heavy-Ion Analysis Toolkit
List of all members | Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
KVEventFiltering Class Reference

Filter simulated events with multidetector response.

Use this KVEventSelector on simulated data TTrees containing a branch with KVSimEvent-derived objects:

my_tree->Process("KVEventFiltering", "[options]");

where "[options]" is the list of options in the form "BranchName=toto,Dataset=titi,System=tata, ...".

The following options must be given:

The following are optional options:

The filtered data will be written in the directory given as option "OutputDir". The filename is built up from the original simulation filename and the values of various options:

[simfile]_geo=[geometry]_filt=[filter-type]_[dataset]_[system]_run=[run-number].root
int type
#define _(A, B)

The data will be stored in a TTree with name 'ReconstructedEvents', in a branch with name 'ReconEvent'. The class used for reconstructed events depends on the dataset, it is given by KVDataSet::GetReconstructedEventClassName().

Each filtered event will have some or all of the following parameters in its list:

When using Gemini++ to decay simulated events before filtering, each particle will have the following parameter defined:

The combination of SIMEVENT_TREE_ENTRY/_NUMBER and SIMEVENT_NUC allows to connect primary fragments in the simulated events with their detected decay products in the filtered event.

Example: suppose 'recev' is a filtered event and 'sim_tree' is the TTree containing the original simulation, while 'simev' is a pointer to a KVSimEvent object connected to the appropriate branch in 'sim_tree'. Then we can retrieve the parent nucleus responsible for producing a particular nucleus in 'recev' like so:

sim_tree.GetEntry( recev.GetParameters()->GetIntValue("SIMEVENT_TREE_ENTRY" ) );
KVSimNucleus* parent_nuc = (KVSimNucleus*)simev->GetParticle( recev.GetNucleus(15)->GetParameters()->GetIntValue("GEMINI_PARENT_INDEX") ); // parent nucleus of 15th nucleus in filtered event 'recev'
Nucleus in a simulated event.
Definition: KVSimNucleus.h:20

Definition at line 96 of file KVEventFiltering.h.

Public Member Functions

 KVEventFiltering ()
 Default constructor. More...
 
 KVEventFiltering (const KVEventFiltering &)
 
virtual ~KVEventFiltering ()
 Destructor. More...
 
Bool_t Analysis ()
 
void Copy (TObject &) const
 
void EndAnalysis ()
 
void EndRun ()
 
void InitAnalysis ()
 
void InitRun ()
 
void OpenOutputFile (KVDBSystem *, Int_t)
 
- Public Member Functions inherited from KVEventSelector
 KVEventSelector (TTree *=0)
 
virtual ~KVEventSelector ()
 
KVVarGlobAddGV (const Char_t *class_name, const Char_t *name)
 
void AddGV (KVVarGlob *vg)
 
template<typename HistoType , typename... Args>
HistoType * AddHisto (Args &&... args)
 
void AddHisto (TH1 *histo)
 
TTreeAddTree (const TString &name, const TString &title="", Int_t splitLevel=99, TDirectory *=gDirectory)
 Add TTree with given name and title to list of TTree to be filled by user's analysis. More...
 
void AddTree (TTree *tree)
 
Bool_t AtEndOfRun (void)
 
virtual void Begin (TTree *tree)
 
virtual void CheckEndOfRun ()
 Testing whether EndRun() should be called. More...
 
Bool_t CreateTreeFile (const Char_t *filename="")
 
void FillHisto (const Char_t *sname, const Char_t *label, Double_t weight=1)
 Fill 1D histogram with named bins. More...
 
void FillHisto (const Char_t *sname, Double_t one, Double_t two=1, Double_t three=1, Double_t four=1)
 
void FillTree (const Char_t *sname="")
 
const Char_tGetBranchName () const
 
virtual Int_t GetEntry (Long64_t entry, Int_t getall=0)
 
KVEventGetEvent () const
 
Int_t GetEventNumber () const
 
KVEventGetFriendEvent () const
 
Int_t GetFriendTreeEntry (Long64_t entry, Int_t getall=0)
 
KVVarGlobGetGV (const Char_t *name) const
 
KVGVListGetGVList (void)
 
const KVGVListGetGVList (void) const
 
TH1GetHisto (const Char_t *name) const
 
const KVHashListGetHistoList () const
 return the list of created trees More...
 
virtual TString GetOpt (const Char_t *option) const
 
virtual TListGetOutputList () const
 
TTreeGetTree (const Char_t *name) const
 return the tree named tree_name More...
 
const KVHashListGetTreeList () const
 return the list of created trees More...
 
virtual void Init (TTree *tree)
 
void InitFriendTree (TTree *tree, const TString &branchname)
 
virtual Bool_t IsOptGiven (const Char_t *option)
 Returns kTRUE if the option 'opt' has been set. More...
 
virtual Bool_t Notify ()
 
virtual void ParseOptions ()
 
virtual Bool_t Process (Long64_t entry)
 
virtual void RecalculateGlobalVariables ()
 
virtual void SaveHistos (const Char_t *filename="", Option_t *option="recreate", Bool_t onlyfilled=kFALSE)
 
virtual void SetAdditionalBranchAddress ()
 
virtual void SetAnalysisFrame ()
 
void SetBranchName (const Char_t *n)
 
virtual void SetCurrentRun (KVDBRun *)
 
void SetEvent (KVEvent *e)
 
void SetEventsReadInterval (Long64_t N)
 
virtual void SetInputList (TList *input)
 
void SetJobOutputFileName (const TString &filename)
 
virtual void SetObject (TObject *obj)
 
virtual void SetOpt (const Char_t *option, const Char_t *value)
 Set a value for an option. More...
 
void SetParticleConditions (const KVParticleCondition &, const KVString &="")
 
void SetParticleConditionsParticleClassName (const KVString &t)
 
void SetTriggerConditionsForRun (int)
 
virtual void SlaveBegin (TTree *tree)
 
virtual void SlaveTerminate ()
 
virtual void Terminate ()
 
virtual void UnsetOpt (const Char_t *opt)
 Removes the option 'opt' from the internal lists, as if it had never been set. More...
 
virtual Int_t Version () const
 
- Public Member Functions inherited from TSelector
 TSelector ()
 
virtual ~TSelector ()
 
virtual void Abort (const char *why, EAbort what=kAbortProcess)
 
virtual EAbort GetAbort () const
 
virtual TListGetInputList () const
 
virtual const char * GetOption () const
 
virtual Long64_t GetStatus () const
 
virtual void ImportOutput (TList *output)
 
virtual Bool_t ProcessCut (Long64_t)
 
virtual void ProcessFill (Long64_t)
 
virtual void ResetAbort ()
 
virtual void SetOption (const char *option)
 
virtual void SetStatus (Long64_t status)
 
- Public Member Functions inherited from TObject
 TObject ()
 
 TObject (const TObject &object)
 
virtual ~TObject ()
 
void AbstractMethod (const char *method) const
 
virtual void AppendPad (Option_t *option="")
 
virtual void Browse (TBrowser *b)
 
ULong_t CheckedHash ()
 
virtual const char * ClassName () const
 
virtual void Clear (Option_t *="")
 
virtual TObjectClone (const char *newname="") const
 
virtual Int_t Compare (const TObject *obj) const
 
virtual void Delete (Option_t *option="")
 
virtual Int_t DistancetoPrimitive (Int_t px, Int_t py)
 
virtual void Draw (Option_t *option="")
 
virtual void DrawClass () const
 
virtual TObjectDrawClone (Option_t *option="") const
 
virtual void Dump () const
 
virtual void Error (const char *method, const char *msgfmt,...) const
 
virtual void Execute (const char *method, const char *params, Int_t *error=0)
 
virtual void Execute (TMethod *method, TObjArray *params, Int_t *error=0)
 
virtual void ExecuteEvent (Int_t event, Int_t px, Int_t py)
 
virtual void Fatal (const char *method, const char *msgfmt,...) const
 
virtual TObjectFindObject (const char *name) const
 
virtual TObjectFindObject (const TObject *obj) const
 
virtual Option_tGetDrawOption () const
 
virtual const char * GetIconName () const
 
virtual const char * GetName () const
 
virtual char * GetObjectInfo (Int_t px, Int_t py) const
 
virtual const char * GetTitle () const
 
virtual UInt_t GetUniqueID () const
 
virtual Bool_t HandleTimer (TTimer *timer)
 
virtual ULong_t Hash () const
 
Bool_t HasInconsistentHash () const
 
virtual void Info (const char *method, const char *msgfmt,...) const
 
virtual Bool_t InheritsFrom (const char *classname) const
 
virtual Bool_t InheritsFrom (const TClass *cl) const
 
virtual void Inspect () const
 
void InvertBit (UInt_t f)
 
virtual Bool_t IsEqual (const TObject *obj) const
 
virtual Bool_t IsFolder () const
 
R__ALWAYS_INLINE Bool_t IsOnHeap () const
 
virtual Bool_t IsSortable () const
 
R__ALWAYS_INLINE Bool_t IsZombie () const
 
virtual void ls (Option_t *option="") const
 
void MayNotUse (const char *method) const
 
void Obsolete (const char *method, const char *asOfVers, const char *removedFromVers) const
 
void operator delete (void *ptr)
 
void operator delete[] (void *ptr)
 
voidoperator new (size_t sz)
 
voidoperator new (size_t sz, void *vp)
 
voidoperator new[] (size_t sz)
 
voidoperator new[] (size_t sz, void *vp)
 
TObjectoperator= (const TObject &rhs)
 
virtual void Paint (Option_t *option="")
 
virtual void Pop ()
 
virtual void Print (Option_t *option="") const
 
virtual Int_t Read (const char *name)
 
virtual void RecursiveRemove (TObject *obj)
 
void ResetBit (UInt_t f)
 
virtual void SaveAs (const char *filename="", Option_t *option="") const
 
virtual void SavePrimitive (std::ostream &out, Option_t *option="")
 
void SetBit (UInt_t f)
 
void SetBit (UInt_t f, Bool_t set)
 
virtual void SetDrawOption (Option_t *option="")
 
virtual void SetUniqueID (UInt_t uid)
 
virtual void SysError (const char *method, const char *msgfmt,...) const
 
R__ALWAYS_INLINE Bool_t TestBit (UInt_t f) const
 
Int_t TestBits (UInt_t f) const
 
virtual void UseCurrentStyle ()
 
virtual void Warning (const char *method, const char *msgfmt,...) const
 
virtual Int_t Write (const char *name=0, Int_t option=0, Int_t bufsize=0)
 
virtual Int_t Write (const char *name=0, Int_t option=0, Int_t bufsize=0) const
 

Public Attributes

TVector3 fCMVelocity
 
TFilefFile
 
TString fNewFrame
 allow the definition of a specific frame More...
 
TVector3 fProjVelocity
 
KVReconstructedEventfReconEvent
 
Bool_t fTransformKinematics
 =kTRUE if simulation not in lab frame More...
 
TTreefTree
 
- Public Attributes inherited from KVEventSelector
TProofOutputFilemergeFile
 for merging with PROOF More...
 
TFilewriteFile
 
- Public Attributes inherited from TSelector
 kAbortFile
 
 kAbortProcess
 
 kContinue
 
- Public Attributes inherited from TObject
 kBitMask
 
 kCanDelete
 
 kCannotPick
 
 kHasUUID
 
 kInconsistent
 
 kInvalidObject
 
 kIsOnHeap
 
 kIsReferenced
 
 kMustCleanup
 
 kNoContextMenu
 
 kNotDeleted
 
 kObjInCanvas
 
 kOverwrite
 
 kSingleKey
 
 kWriteDelete
 
 kZombie
 

Private Member Functions

void RandomRotation (KVEvent *to_rotate, const TString &frame_name="") const
 

Private Attributes

Long64_t fEVN
 event number counter More...
 
Bool_t fGemAddRotEner
 true if rotational energy has to be added to excitation energy [default: no] More...
 
Int_t fGemDecayPerEvent
 number of Gemini++ decays to be performed for each event [default:1] More...
 
KVSimEvent fGemEvent
 event after decay with Gemini More...
 
Bool_t fGemini
 true if Gemini++ decay should be performed before detection [default: no] More...
 
const char * fIdCalMode
 original exp setup hasIDandCalib to be reset in case of modifications More...
 
Bool_t fRotate
 true if random phi rotation should be applied [default: yes] More...
 
KVGemini GEM
 

Additional Inherited Members

- Public Types inherited from TSelector
enum  EAbort
 
- Public Types inherited from TObject
enum  EDeprecatedStatusBits
 
enum  EStatusBits
 
- Static Public Member Functions inherited from TSelector
static TSelectorGetSelector (const char *filename)
 
static Bool_t IsStandardDraw (const char *selec)
 
- Static Public Member Functions inherited from TObject
static Longptr_t GetDtorOnly ()
 
static Bool_t GetObjectStat ()
 
static void SetDtorOnly (void *obj)
 
static void SetObjectStat (Bool_t stat)
 
- Protected Member Functions inherited from KVEventSelector
void add_histo (TH1 *histo)
 
void add_tree (TTree *tree)
 
void FillTH1 (TH1 *h1, Double_t one, Double_t two)
 
void FillTH2 (TH2 *h2, Double_t one, Double_t two, Double_t three)
 
void FillTH3 (TH3 *h3, Double_t one, Double_t two, Double_t three, Double_t four)
 
void FillTProfile (TProfile *h1, Double_t one, Double_t two, Double_t three)
 
void FillTProfile2D (TProfile2D *h2, Double_t one, Double_t two, Double_t three, Double_t four)
 
void SetCombinedOutputFile (const TString &filename)
 
void SetUpAuxEventChain ()
 
- Protected Member Functions inherited from TObject
virtual void DoError (int level, const char *location, const char *fmt, va_list va) const
 
void MakeZombie ()
 
- Protected Attributes inherited from KVEventSelector
KVEventAuxEvent
 [optional] events in fAuxChain More...
 
TBranchb_Event
 List of branches. More...
 
KVEventEvent
 Declaration of leaf types. More...
 
TTreefAuxChain
 [optional] pointer to another TTree or TChain which may be used during analysis More...
 
KVString fBranchName
 name of branch which contains events to analyse More...
 
TTreefChain
 pointer to the analyzed TTree or TChain More...
 
KVString fCombinedOutputFile
 optional name for single results file with trees and histos More...
 
Bool_t fDisableCreateTreeFile
 used with PROOF More...
 
Long64_t fEventsRead
 number of events read More...
 
Long64_t fEventsReadInterval
 interval at which to print number of events read More...
 
Bool_t fFirstEvent
 set to kFALSE after first event is read More...
 
Bool_t fNotifyCalled
 avoid multiple calls to Notify/InitRun More...
 
KVNameValueList fOptionList
 parsed list of options given to TTree::Process More...
 
KVParticleCondition fPartCond
 (optional) conditions for selecting particles More...
 
KVString fPartName
 (optional) classname for upcasting in KVParticleCondition::Optimize More...
 
Long64_t fTreeEntry
 current tree entry number More...
 
KVGVList gvlist
 List of global variables. More...
 
KVHashListlhisto
 ! More...
 
KVHashListltree
 ! More...
 
- Protected Attributes inherited from TSelector
EAbort fAbort
 
TListfInput
 
TObjectfObject
 
TString fOption
 
TSelectorListfOutput
 
Long64_t fStatus
 
- Protected Attributes inherited from TObject
 kOnlyPrepStep
 

#include <KVEventFiltering.h>

Inheritance diagram for KVEventFiltering:
Inheritance graph
[legend]

Constructor & Destructor Documentation

◆ KVEventFiltering() [1/2]

KVEventFiltering::KVEventFiltering ( )

Default constructor.

Definition at line 21 of file KVEventFiltering.cpp.

◆ KVEventFiltering() [2/2]

KVEventFiltering::KVEventFiltering ( const KVEventFiltering obj)

Copy constructor This ctor is used to make a copy of an existing object (for example when a method returns an object), and it is always a good idea to implement it. If your class allocates memory in its constructor(s) then it is ESSENTIAL :-)

Definition at line 47 of file KVEventFiltering.cpp.

◆ ~KVEventFiltering()

KVEventFiltering::~KVEventFiltering ( )
virtual

Destructor.

Definition at line 65 of file KVEventFiltering.cpp.

Member Function Documentation

◆ Analysis()

Bool_t KVEventFiltering::Analysis ( void  )
virtual

Event-by-event filtering of simulated data. If needed (fTransformKinematics = kTRUE), kinematics of event are transformed to laboratory frame using C.M. velocity calculated in InitAnalysis(). Detection of particles in event is simulated with KVMultiDetArray::DetectEvent, then the reconstructed detected event is treated by the same identification and calibration procedures as for experimental data. few event counter print at the beginning to be sure the process started properly because in case GEMINI decay is used, it sometimes stops (randomly) after few events

Reimplemented from KVEventSelector.

Definition at line 136 of file KVEventFiltering.cpp.

◆ Copy()

void KVEventFiltering::Copy ( TObject obj) const
virtual

This method copies the current state of 'this' object into 'obj' You should add here any member variables, for example: (supposing a member variable KVEventFiltering::fToto) CastedObj.fToto = fToto; or CastedObj.SetToto( GetToto() );

Reimplemented from TObject.

Definition at line 84 of file KVEventFiltering.cpp.

◆ EndAnalysis()

void KVEventFiltering::EndAnalysis ( )
virtual

Reimplemented from KVEventSelector.

Definition at line 211 of file KVEventFiltering.cpp.

◆ EndRun()

void KVEventFiltering::EndRun ( )
virtual

Reimplemented from KVEventSelector.

Definition at line 220 of file KVEventFiltering.cpp.

◆ InitAnalysis()

void KVEventFiltering::InitAnalysis ( )
virtual

Select required dataset for filtering (option "Dataset") Build the associated multidetector geometry. Calculate C.M. velocity associated with required experimental collision kinematics (option "System").

Set the parameters of the detectors according to the required run if given (option "Run"), or the first run of the given system otherwise. If ROOT/TGeo geometry is required (option "Geometry"="ROOT"), build the TGeometry representation of the detector array.

Open file for filtered data (see KVEventFiltering::OpenOutputFile), which will be stored in a TTree with name 'ReconstructedEvents', in a branch with name 'ReconEvent'. The class used for reconstructed events depends on the dataset, it is given by KVDataSet::GetReconstructedEventClassName().

Reimplemented from KVEventSelector.

Definition at line 242 of file KVEventFiltering.cpp.

◆ InitRun()

void KVEventFiltering::InitRun ( )
virtual

Reimplemented from KVEventSelector.

Definition at line 406 of file KVEventFiltering.cpp.

◆ OpenOutputFile()

void KVEventFiltering::OpenOutputFile ( KVDBSystem S,
Int_t  run 
)

Open ROOT file for new filtered events TTree. The file will be written in the directory given as option "OutputDir". The filename is built up from the original simulation filename and the values of various options:

[simfile]_[Gemini]_geo=[geometry]_filt=[filter-type]_[dataset]_[system]_run=[run-number].root

In addition, informations on the filtered data are stored in the file as TNamed objects. These can be read by KVSimDir::AnalyseFile:

KEY: TNamed System;1 title=[full system name] KEY: TNamed Dataset;1 title=[dataset name] KEY: TNamed Run;1 title=[run-number] KEY: TNamed Geometry;1 title=[geometry-type] KEY: TNamed Filter;1 title=[filter-type] KEY: TNamed Origin;1 title=[name of simulation file] KEY: TNamed RandomPhi;1 title=[yes/no, random rotation about beam axis] KEY: TNamed Gemini++;1 title=[yes/no, Gemini++ decay before detection] KEY: TNamed GemDecayPerEvent;1 title=[number of Gemini++ decays per primary event] KEY: TNamed GemAddRotEner;1 title=[Enable or not the addition of the rotational energy to the excitation energy]

Definition at line 439 of file KVEventFiltering.cpp.

◆ RandomRotation()

void KVEventFiltering::RandomRotation ( KVEvent to_rotate,
const TString frame_name = "" 
) const
private

do random phi rotation around z-axis if frame_name is given, apply rotation to that frame

store phi rotation angle [radians] in event parameter "RANDOM_PHI"

Definition at line 110 of file KVEventFiltering.cpp.

Member Data Documentation

◆ fCMVelocity

TVector3 KVEventFiltering::fCMVelocity

Definition at line 129 of file KVEventFiltering.h.

◆ fEVN

Long64_t KVEventFiltering::fEVN
private

event number counter

Definition at line 100 of file KVEventFiltering.h.

◆ fFile

TFile* KVEventFiltering::fFile

Definition at line 126 of file KVEventFiltering.h.

◆ fGemAddRotEner

Bool_t KVEventFiltering::fGemAddRotEner
private

true if rotational energy has to be added to excitation energy [default: no]

Definition at line 104 of file KVEventFiltering.h.

◆ fGemDecayPerEvent

Int_t KVEventFiltering::fGemDecayPerEvent
private

number of Gemini++ decays to be performed for each event [default:1]

Definition at line 105 of file KVEventFiltering.h.

◆ fGemEvent

KVSimEvent KVEventFiltering::fGemEvent
private

event after decay with Gemini

Definition at line 106 of file KVEventFiltering.h.

◆ fGemini

Bool_t KVEventFiltering::fGemini
private

true if Gemini++ decay should be performed before detection [default: no]

Definition at line 103 of file KVEventFiltering.h.

◆ fIdCalMode

const char* KVEventFiltering::fIdCalMode
private

original exp setup hasIDandCalib to be reset in case of modifications

Definition at line 110 of file KVEventFiltering.h.

◆ fNewFrame

TString KVEventFiltering::fNewFrame

allow the definition of a specific frame

Definition at line 132 of file KVEventFiltering.h.

◆ fProjVelocity

TVector3 KVEventFiltering::fProjVelocity

Definition at line 130 of file KVEventFiltering.h.

◆ fReconEvent

KVReconstructedEvent* KVEventFiltering::fReconEvent

Definition at line 128 of file KVEventFiltering.h.

◆ fRotate

Bool_t KVEventFiltering::fRotate
private

true if random phi rotation should be applied [default: yes]

Definition at line 101 of file KVEventFiltering.h.

◆ fTransformKinematics

Bool_t KVEventFiltering::fTransformKinematics

=kTRUE if simulation not in lab frame

Definition at line 131 of file KVEventFiltering.h.

◆ fTree

TTree* KVEventFiltering::fTree

Definition at line 127 of file KVEventFiltering.h.

◆ GEM

KVGemini KVEventFiltering::GEM
private

Definition at line 107 of file KVEventFiltering.h.


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