VMC Version 2.0
Loading...
Searching...
No Matches
TMCParticleStatus.h
Go to the documentation of this file.
1// -----------------------------------------------------------------------
2// Copyright (C) 2019 CERN and copyright holders of VMC Project.
3// This software is distributed under the terms of the GNU General Public
4// License v3 (GPL Version 3), copied verbatim in the file "LICENSE".
5//
6// See https://github.com/vmc-project/vmc for full licensing information.
7// -----------------------------------------------------------------------
8
9// Authors: Benedikt Volkel 07/03/2019
10
11/*************************************************************************
12 * Copyright (C) 2019, Rene Brun and Fons Rademakers. *
13 * Copyright (C) 2019, ALICE Experiment at CERN. *
14 * All rights reserved. *
15 * *
16 * For the licensing terms see $ROOTSYS/LICENSE. *
17 * For the list of contributors see $ROOTSYS/README/CREDITS. *
18 *************************************************************************/
19
20#ifndef ROOT_TMCParticleStatus
21#define ROOT_TMCParticleStatus
22
23// Class TMCParticleStatus
24// ---------------------
25// additional information on the current status of a TParticle
26//
27
28#include <iostream>
29
30#include "TVector3.h"
31#include "TLorentzVector.h"
32#include "TParticle.h"
33#include "TError.h"
34
36
38 TMCParticleStatus() = default;
39
41 void InitFromParticle(const TParticle *particle)
42 {
43 particle->ProductionVertex(fPosition);
44 particle->Momentum(fMomentum);
45 particle->GetPolarisation(fPolarization);
46 fWeight = particle->GetWeight();
47 }
48
49 virtual ~TMCParticleStatus() = default;
50
51 //
52 // verbosity
53 //
54
56 void Print() const
57 {
58 ::Info("Print", "Status of track");
59 std::cout << "\t"
60 << "ID: " << fId << "\n"
61 << "\t"
62 << "parentID: " << fParentId << "\n"
63 << "\t"
64 << "weight: " << fWeight << "\n"
65 << "\t"
66 << "geo state index: " << fGeoStateIndex << "\n"
67 << "\t"
68 << "step number: " << fStepNumber << "\n"
69 << "\t"
70 << "track length: " << fTrackLength << "\n"
71 << "\t"
72 << "position" << std::endl;
73 fPosition.Print();
74 std::cout << "\t"
75 << "momentum" << std::endl;
76 fMomentum.Print();
77 std::cout << "\t"
78 << "polarization" << std::endl;
79 fPolarization.Print();
80 }
81
83 Int_t fStepNumber = 0;
85 Double_t fTrackLength = 0.;
87 TLorentzVector fPosition;
89 TLorentzVector fMomentum;
91 TVector3 fPolarization;
93 Double_t fWeight = 1.;
95 UInt_t fGeoStateIndex = 0;
97 Int_t fId = -1;
99 Int_t fParentId = -1;
102
103private:
108
109 ClassDef(TMCParticleStatus, 1)
110};
111
112#endif /* ROOT_TMCParticleStatus */
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.