CMS 3D CMS Logo

Classes | Namespaces | Functions
FSimTrack.h File Reference
#include "SimGeneral/HepPDTRecord/interface/ParticleDataTable.h"
#include "SimDataFormats/Track/interface/SimTrack.h"
#include "FastSimulation/Particle/interface/RawParticle.h"
#include <vector>
#include <iosfwd>
#include "FastSimulation/Event/interface/FSimTrack.icc"

Go to the source code of this file.

Classes

class  FSimTrack
 

Namespaces

 HepMC
 

Functions

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

Function Documentation

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

Definition at line 106 of file FSimTrack.cc.

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

106  {
107 
108  std::string name = t.particleInfo() ? t.particleInfo()->name() : "Unknown";
109  XYZTLorentzVector momentum1 = t.momentum();
110  XYZVector vertex1 = t.vertex().position().Vect();
111  int vertexId1 = t.vertex().id();
112 
113  o.setf(std::ios::fixed, std::ios::floatfield);
114  o.setf(std::ios::right, std::ios::adjustfield);
115 
116  o << std::setw(4) << t.id() << " "
117  << std::setw(4) << t.genpartIndex() << " "
118  << name;
119 
120  for(unsigned int k=0;k<11-name.length() && k<12; k++) o << " ";
121 
122  o << std::setw(6) << std::setprecision(2) << momentum1.eta() << " "
123  << std::setw(6) << std::setprecision(2) << momentum1.phi() << " "
124  << std::setw(6) << std::setprecision(2) << momentum1.pt() << " "
125  << std::setw(6) << std::setprecision(2) << momentum1.e() << " "
126  << std::setw(4) << vertexId1 << " "
127  << std::setw(6) << std::setprecision(1) << vertex1.x() << " "
128  << std::setw(6) << std::setprecision(1) << vertex1.y() << " "
129  << std::setw(6) << std::setprecision(1) << vertex1.z() << " "
130  << std::setw(4) << (t.noMother() ? -1 :t.mother().id()) << " ";
131 
132  if ( !t.noEndVertex() ) {
133  XYZTLorentzVector vertex2 = t.endVertex().position();
134  int vertexId2 = t.endVertex().id();
135 
136  o << std::setw(4) << vertexId2 << " "
137  << std::setw(6) << std::setprecision(2) << vertex2.eta() << " "
138  << std::setw(6) << std::setprecision(2) << vertex2.phi() << " "
139  << std::setw(5) << std::setprecision(1) << vertex2.pt() << " "
140  << std::setw(6) << std::setprecision(1) << vertex2.z() << " ";
141  for (int i=0; i<t.nDaughters(); ++i)
142  o << std::setw(4) << t.daughter(i).id() << " ";
143 
144  } else {
145 
146  if ( t.onLayer1() ) {
147 
148  XYZTLorentzVector vertex2 = t.layer1Entrance().vertex();
149 
150  o << std::setw(4) << -t.onLayer1() << " "
151  << std::setw(6) << std::setprecision(2) << vertex2.eta() << " "
152  << std::setw(6) << std::setprecision(2) << vertex2.phi() << " "
153  << std::setw(5) << std::setprecision(1) << vertex2.pt() << " "
154  << std::setw(6) << std::setprecision(1) << vertex2.z() << " "
155  << std::setw(6) << std::setprecision(2) << t.layer1Entrance().pt() << " "
156  << std::setw(6) << std::setprecision(2) << t.layer1Entrance().e() << " ";
157 
158  } else if ( t.onEcal() ) {
159 
160  XYZTLorentzVector vertex2 = t.ecalEntrance().vertex();
161 
162  o << std::setw(4) << -t.onEcal() << " "
163  << std::setw(6) << std::setprecision(2) << vertex2.eta() << " "
164  << std::setw(6) << std::setprecision(2) << vertex2.phi() << " "
165  << std::setw(5) << std::setprecision(1) << vertex2.pt() << " "
166  << std::setw(6) << std::setprecision(1) << vertex2.z() << " "
167  << std::setw(6) << std::setprecision(2) << t.ecalEntrance().pt() << " "
168  << std::setw(6) << std::setprecision(2) << t.ecalEntrance().e() << " ";
169  }
170  }
171  return o;
172 }
int id() const
the index in FBaseSimEvent
Definition: FSimVertex.h:44
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:190
const RawParticle & layer1Entrance() const
The particle at Preshower Layer 1.
Definition: FSimTrack.h:127
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:133
const FSimVertex & vertex() const
Origin vertex.
int k[5][pyjets_maxn]
const XYZTLorentzVector & vertex() const
the vertex fourvector
Definition: RawParticle.h:285
int id() const
the index in FBaseSimEvent and other vectors
Definition: FSimTrack.h:86
int onLayer1() const
Definition: FSimTrack.h:91
bool noMother() const
no mother particle
const FSimTrack & mother() const
mother
math::XYZTLorentzVector XYZTLorentzVector
Definition: RawParticle.h:15