Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
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 
28 struct TMCParticleStatus {
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);
38  particle->GetPolarisation(fPolarization);
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;
66  fPosition.Print();
67  std::cout << "\t"
68  << "momentum" << std::endl;
69  fMomentum.Print();
70  std::cout << "\t"
71  << "polarization" << std::endl;
72  fPolarization.Print();
73  }
74 
75  /// Number of steps
76  Int_t fStepNumber = 0;
77  /// Track length
78  Double_t fTrackLength = 0.;
79  /// position
80  TLorentzVector fPosition;
81  /// momentum
82  TLorentzVector fMomentum;
83  /// polarization
84  TVector3 fPolarization;
85  /// weight
86  Double_t fWeight = 1.;
87  /// geo state cache
88  UInt_t fGeoStateIndex = 0;
89  /// Unique ID assigned by the user
90  Int_t fId = -1;
91  /// Unique ID assigned by the user
92  Int_t fParentId = -1;
93  /// Flags to (re)set for TGeoNavigator's fIsOutside state
94  Bool_t fIsOutside;
95 
96 private:
97  /// Copying kept private
98  TMCParticleStatus(const TMCParticleStatus &);
99  /// Assignement kept private
100  TMCParticleStatus &operator=(const TMCParticleStatus &);
101 
102  ClassDef(TMCParticleStatus, 1)
103 };
104 
105 #endif /* ROOT_TMCParticleStatus */