CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions
FSimTrack.cc File Reference
#include "FastSimulation/Event/interface/FSimTrack.h"
#include <iomanip>
#include <string>

Go to the source code of this file.

Functions

std::ostream & operator<< (std::ostream &o, const FSimTrack &t)
 

Function Documentation

std::ostream& operator<< ( std::ostream &  o,
const FSimTrack t 
)

Definition at line 88 of file FSimTrack.cc.

References FSimTrack::daughter(), FSimTrack::ecalEntrance(), FSimTrack::endVertex(), SimTrack::genpartIndex(), i, FSimVertex::id(), FSimTrack::id(), gen::k, FSimTrack::layer1Entrance(), FSimTrack::momentum(), FSimTrack::mother(), mergeVDriftHistosByStation::name, FSimTrack::nDaughters(), FSimTrack::noEndVertex(), connectstrParser::o, FSimTrack::onEcal(), FSimTrack::onLayer1(), FSimTrack::particleInfo(), FSimVertex::position(), FSimTrack::vertex(), and RawParticle::vertex().

88  {
89 
90  std::string name = t.particleInfo() ? t.particleInfo()->name() : "Unknown";
91  XYZTLorentzVector momentum1 = t.momentum();
92  XYZVector vertex1 = t.vertex().position().Vect();
93  int vertexId1 = t.vertex().id();
94 
95  o.setf(std::ios::fixed, std::ios::floatfield);
96  o.setf(std::ios::right, std::ios::adjustfield);
97 
98  o << std::setw(4) << t.id() << " "
99  << std::setw(4) << t.genpartIndex() << " "
100  << name;
101 
102  for(unsigned int k=0;k<11-name.length() && k<12; k++) o << " ";
103 
104  o << std::setw(6) << std::setprecision(2) << momentum1.eta() << " "
105  << std::setw(6) << std::setprecision(2) << momentum1.phi() << " "
106  << std::setw(6) << std::setprecision(2) << momentum1.pt() << " "
107  << std::setw(6) << std::setprecision(2) << momentum1.e() << " "
108  << std::setw(4) << vertexId1 << " "
109  << std::setw(6) << std::setprecision(1) << vertex1.x() << " "
110  << std::setw(6) << std::setprecision(1) << vertex1.y() << " "
111  << std::setw(6) << std::setprecision(1) << vertex1.z() << " "
112  << std::setw(4) << t.mother().id() << " ";
113 
114  if ( !t.noEndVertex() ) {
115  XYZTLorentzVector vertex2 = t.endVertex().position();
116  int vertexId2 = t.endVertex().id();
117 
118  o << std::setw(4) << vertexId2 << " "
119  << std::setw(6) << std::setprecision(2) << vertex2.eta() << " "
120  << std::setw(6) << std::setprecision(2) << vertex2.phi() << " "
121  << std::setw(5) << std::setprecision(1) << vertex2.pt() << " "
122  << std::setw(6) << std::setprecision(1) << vertex2.z() << " ";
123  for (int i=0; i<t.nDaughters(); ++i)
124  o << std::setw(4) << t.daughter(i).id() << " ";
125 
126  } else {
127 
128  if ( t.onLayer1() ) {
129 
130  XYZTLorentzVector vertex2 = t.layer1Entrance().vertex();
131 
132  o << std::setw(4) << -t.onLayer1() << " "
133  << std::setw(6) << std::setprecision(2) << vertex2.eta() << " "
134  << std::setw(6) << std::setprecision(2) << vertex2.phi() << " "
135  << std::setw(5) << std::setprecision(1) << vertex2.pt() << " "
136  << std::setw(6) << std::setprecision(1) << vertex2.z() << " "
137  << std::setw(6) << std::setprecision(2) << t.layer1Entrance().pt() << " "
138  << std::setw(6) << std::setprecision(2) << t.layer1Entrance().e() << " ";
139 
140  } else if ( t.onEcal() ) {
141 
142  XYZTLorentzVector vertex2 = t.ecalEntrance().vertex();
143 
144  o << std::setw(4) << -t.onEcal() << " "
145  << std::setw(6) << std::setprecision(2) << vertex2.eta() << " "
146  << std::setw(6) << std::setprecision(2) << vertex2.phi() << " "
147  << std::setw(5) << std::setprecision(1) << vertex2.pt() << " "
148  << std::setw(6) << std::setprecision(1) << vertex2.z() << " "
149  << std::setw(6) << std::setprecision(2) << t.ecalEntrance().pt() << " "
150  << std::setw(6) << std::setprecision(2) << t.ecalEntrance().e() << " ";
151  }
152  }
153  return o;
154 }
int id() const
the index in FBaseSimEvent
Definition: FSimVertex.h:44
int i
Definition: DBlmapReader.cc:9
bool noEndVertex() const
no end vertex
const HepPDT::ParticleData * particleInfo() const
particle info...
Definition: FSimTrack.h:42
const FSimVertex & endVertex() const
end vertex
const XYZTLorentzVector & momentum() const
Temporary (until move of SimTrack to Mathcore) - No! Actually very useful.
Definition: FSimTrack.h:168
const RawParticle & layer1Entrance() const
The particle at Preshower Layer 1.
Definition: FSimTrack.h:117
const FSimTrack & daughter(int i) const
Ith daughter.
int nDaughters() const
Number of daughters.
int onEcal() const
Definition: FSimTrack.h:101
math::XYZVector XYZVector
const math::XYZTLorentzVector & position() const
Temporary (until CMSSW moves to Mathcore) - No ! Actually very useful.
Definition: FSimVertex.h:49
int genpartIndex() const
index of the corresponding Generator particle in the Event container (-1 if no Genpart) ...
Definition: SimTrack.h:33
const RawParticle & ecalEntrance() const
The particle at ECAL entrance.
Definition: FSimTrack.h:123
const FSimVertex & vertex() const
Origin vertex.
int k[5][pyjets_maxn]
const XYZTLorentzVector & vertex() const
the vertex fourvector
Definition: RawParticle.h:284
int id() const
the index in FBaseSimEvent and other vectors
Definition: FSimTrack.h:86
int onLayer1() const
Definition: FSimTrack.h:91
const FSimTrack & mother() const
mother
math::XYZTLorentzVector XYZTLorentzVector
Definition: RawParticle.h:15