Logo ROOT  
Reference Guide
TMCParticleStatus.h
Go to the documentation of this file.
1// @(#)root/vmc:$Id$
2// Authors: Benedikt Volkel 07/03/2019
3
4/*************************************************************************
5 * Copyright (C) 2019, Rene Brun and Fons Rademakers. *
6 * Copyright (C) 2019, ALICE Experiment at CERN. *
7 * All rights reserved. *
8 * *
9 * For the licensing terms see $ROOTSYS/LICENSE. *
10 * For the list of contributors see $ROOTSYS/README/CREDITS. *
11 *************************************************************************/
12
13#ifndef ROOT_TMCParticleStatus
14#define ROOT_TMCParticleStatus
15
16// Class TMCParticleStatus
17// ---------------------
18// additional information on the current status of a TParticle
19//
20
21#include <iostream>
22
23#include "TVector3.h"
24#include "TLorentzVector.h"
25#include "TParticle.h"
26#include "TError.h"
27
29
30 /// Default constructor
31 TMCParticleStatus() = default;
32
33 /// Use TParticle information as a starting point
34 void InitFromParticle(const TParticle *particle)
35 {
36 particle->ProductionVertex(fPosition);
37 particle->Momentum(fMomentum);
39 fWeight = particle->GetWeight();
40 }
41
42 virtual ~TMCParticleStatus() = default;
43
44 //
45 // verbosity
46 //
47
48 /// Print all info at once
49 void Print() const
50 {
51 ::Info("Print", "Status of track");
52 std::cout << "\t"
53 << "ID: " << fId << "\n"
54 << "\t"
55 << "parentID: " << fParentId << "\n"
56 << "\t"
57 << "weight: " << fWeight << "\n"
58 << "\t"
59 << "geo state index: " << fGeoStateIndex << "\n"
60 << "\t"
61 << "step number: " << fStepNumber << "\n"
62 << "\t"
63 << "track length: " << fTrackLength << "\n"
64 << "\t"
65 << "position" << std::endl;
67 std::cout << "\t"
68 << "momentum" << std::endl;
70 std::cout << "\t"
71 << "polarization" << std::endl;
73 }
74
75 /// Number of steps
77 /// Track length
79 /// position
81 /// momentum
83 /// polarization
85 /// weight
87 /// geo state cache
89 /// Unique ID assigned by the user
90 Int_t fId = -1;
91 /// Unique ID assigned by the user
93 /// Flags to (re)set for TGeoNavigator's fIsOutside state
95
96private:
97 /// Copying kept private
99 /// Assignement kept private
101
103};
104
105#endif /* ROOT_TMCParticleStatus */
double Double_t
Definition: RtypesCore.h:57
#define ClassDef(name, id)
Definition: Rtypes.h:322
void Info(const char *location, const char *msgfmt,...)
virtual void Print(Option_t *option="") const
Print the TLorentz vector components as (x,y,z,t) and (P,eta,phi,E) representations.
Description of the dynamic properties of a particle.
Definition: TParticle.h:26
void GetPolarisation(TVector3 &v) const
Return particle polarisation.
Definition: TParticle.cxx:284
void ProductionVertex(TLorentzVector &v) const
Definition: TParticle.h:113
Float_t GetWeight() const
Definition: TParticle.h:94
void Momentum(TLorentzVector &v) const
Definition: TParticle.h:112
TVector3 is a general three vector class, which can be used for the description of different vectors ...
Definition: TVector3.h:22
void Print(Option_t *option="") const
Print vector parameters.
Definition: TVector3.cxx:460
void InitFromParticle(const TParticle *particle)
Use TParticle information as a starting point.
virtual ~TMCParticleStatus()=default
TLorentzVector fPosition
position
TMCParticleStatus(const TMCParticleStatus &)
Copying kept private.
Bool_t fIsOutside
Flags to (re)set for TGeoNavigator's fIsOutside state.
UInt_t fGeoStateIndex
geo state cache
TMCParticleStatus()=default
Default constructor.
Double_t fTrackLength
Track length.
void Print() const
Print all info at once.
TVector3 fPolarization
polarization
TMCParticleStatus & operator=(const TMCParticleStatus &)
Assignement kept private.
TLorentzVector fMomentum
momentum
Double_t fWeight
weight
Int_t fParentId
Unique ID assigned by the user.
Int_t fStepNumber
Number of steps.
Int_t fId
Unique ID assigned by the user.