CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Classes | Namespaces | Functions
FSimTrack.h File Reference
#include "SimGeneral/HepPDTRecord/interface/ParticleDataTable.h"
#include "SimDataFormats/Track/interface/SimTrack.h"
#include "SimDataFormats/Vertex/interface/SimVertex.h"
#include "CommonTools/BaseParticlePropagator/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 146 of file FSimTrack.cc.

References FSimTrack::daughter(), RawParticle::e(), FSimTrack::ecalEntrance(), FSimTrack::endVertex(), SimTrack::genpartIndex(), FSimTrack::hcalEntrance(), mps_fire::i, FSimVertex::id(), FSimTrack::id(), FSimTrack::layer1Entrance(), FSimTrack::layer2Entrance(), FSimTrack::momentum(), FSimTrack::mother(), mergeVDriftHistosByStation::name, FSimTrack::nDaughters(), FSimTrack::noEndVertex(), FSimTrack::noMother(), class-composition::o, FSimTrack::onEcal(), FSimTrack::onHcal(), FSimTrack::onLayer1(), FSimTrack::onLayer2(), FSimTrack::onVFcal(), FSimTrack::particleInfo(), FSimVertex::position(), RawParticle::pt(), AlCaHLTBitMon_QueryRunRegistry::string, FSimTrack::vertex(), RawParticle::vertex(), and FSimTrack::vfcalEntrance().

146  {
147  std::string name = t.particleInfo() ? t.particleInfo()->name() : "Unknown";
148  const XYZTLorentzVector& momentum1 = t.momentum();
149  XYZVector vertex1 = t.vertex().position().Vect();
150  int vertexId1 = t.vertex().id();
151 
152  o.setf(std::ios::fixed, std::ios::floatfield);
153  o.setf(std::ios::right, std::ios::adjustfield);
154 
155  o << std::setw(4) << t.id() << "; " << std::setw(4) << t.genpartIndex() << "; " << name << "\n\t\t";
156 
157  //for(unsigned int k=0;k<11-name.length() && k<12; k++) o << "; ";
158 
159  o << "Position: " << std::setw(6) << std::setprecision(2) << momentum1.eta() << "; " << std::setw(6)
160  << std::setprecision(2) << momentum1.phi() << "; " << std::setw(6) << std::setprecision(2) << momentum1.pt() << "; "
161  << std::setw(6) << std::setprecision(2) << momentum1.e() << "; " << std::setw(4) << vertexId1 << "; "
162  << std::setw(6) << std::setprecision(1) << vertex1.x() << "; " << std::setw(6) << std::setprecision(1)
163  << vertex1.y() << "; " << std::setw(6) << std::setprecision(1) << vertex1.z() << "; " << std::setw(4)
164  << (t.particleInfo() ? (t.noMother() ? -1 : t.mother().id()) : -1) << "; "
165  << "\n\t\t";
166 
167  if (!t.noEndVertex()) {
168  XYZTLorentzVector vertex2 = t.endVertex().position();
169  int vertexId2 = t.endVertex().id();
170 
171  o << "Decayed particle: " << std::setw(4) << vertexId2 << "; " << std::setw(6) << std::setprecision(2)
172  << vertex2.eta() << "; " << std::setw(6) << std::setprecision(2) << vertex2.phi() << "; " << std::setw(5)
173  << std::setprecision(1) << vertex2.pt() << "; " << std::setw(6) << std::setprecision(1) << vertex2.z() << "; ";
174  for (int i = 0; i < t.nDaughters(); ++i)
175  o << std::setw(4) << t.daughter(i).id() << "; "
176  << "\n\t\t";
177 
178  } else {
179  if (t.onLayer1()) {
180  XYZTLorentzVector vertex2 = t.layer1Entrance().vertex();
181 
182  o << "Layer 1: " << std::setw(4) << -t.onLayer1() << "; " << std::setw(6) << std::setprecision(2) << vertex2.eta()
183  << "; " << std::setw(6) << std::setprecision(2) << vertex2.phi() << "; " << std::setw(5) << std::setprecision(1)
184  << vertex2.pt() << "; " << std::setw(6) << std::setprecision(1) << vertex2.z() << "; " << std::setw(6)
185  << std::setprecision(2) << t.layer1Entrance().pt() << "; " << std::setw(6) << std::setprecision(2)
186  << t.layer1Entrance().e() << "; "
187  << "\n\t\t";
188  }
189  if (t.onLayer2()) {
190  XYZTLorentzVector vertex2 = t.layer2Entrance().vertex();
191 
192  o << "Layer 2: " << std::setw(4) << -t.onLayer2() << "; " << std::setw(6) << std::setprecision(2) << vertex2.eta()
193  << "; " << std::setw(6) << std::setprecision(2) << vertex2.phi() << "; " << std::setw(5) << std::setprecision(1)
194  << vertex2.pt() << "; " << std::setw(6) << std::setprecision(1) << vertex2.z() << "; " << std::setw(6)
195  << std::setprecision(2) << t.layer2Entrance().pt() << "; " << std::setw(6) << std::setprecision(2)
196  << t.layer2Entrance().e() << "; "
197  << "\n\t\t";
198  }
199  //if ( t.onEcal() ) {
200 
201  XYZTLorentzVector vertex2 = t.ecalEntrance().vertex();
202 
203  o << "ECAL: " << std::setw(4) << -t.onEcal() << "; " << std::setw(6) << std::setprecision(2) << vertex2.eta()
204  << "; " << std::setw(6) << std::setprecision(2) << vertex2.phi() << "; " << std::setw(5) << std::setprecision(1)
205  << vertex2.pt() << "; " << std::setw(6) << std::setprecision(1) << vertex2.z() << "; " << std::setw(6)
206  << std::setprecision(2) << t.ecalEntrance().pt() << "; " << std::setw(6) << std::setprecision(2)
207  << t.ecalEntrance().e() << "; "
208  << "\n\t\t";
209  //}
210  //if ( t.onHcal() ) {
211 
212  vertex2 = t.hcalEntrance().vertex();
213 
214  o << "HCAL: " << std::setw(4) << -t.onHcal() << "; " << std::setw(6) << std::setprecision(2) << vertex2.eta()
215  << "; " << std::setw(6) << std::setprecision(2) << vertex2.phi() << "; " << std::setw(5) << std::setprecision(1)
216  << vertex2.pt() << "; " << std::setw(6) << std::setprecision(1) << vertex2.z() << "; " << std::setw(6)
217  << std::setprecision(2) << t.hcalEntrance().pt() << "; " << std::setw(6) << std::setprecision(2)
218  << t.hcalEntrance().e() << "; "
219  << "\n\t\t";
220  //}
221  //if ( t.onVFcal() ) {
222 
223  vertex2 = t.vfcalEntrance().vertex();
224 
225  o << "VFCAL: " << std::setw(4) << -t.onVFcal() << "; " << std::setw(6) << std::setprecision(2) << vertex2.eta()
226  << "; " << std::setw(6) << std::setprecision(2) << vertex2.phi() << "; " << std::setw(5) << std::setprecision(1)
227  << vertex2.pt() << "; " << std::setw(6) << std::setprecision(1) << vertex2.z() << "; " << std::setw(6)
228  << std::setprecision(2) << t.vfcalEntrance().pt() << "; " << std::setw(6) << std::setprecision(2)
229  << t.vfcalEntrance().e() << "; "
230  << "\n\t\t";
231  //}
232  }
233  return o;
234 }
int id() const
the index in FBaseSimEvent
Definition: FSimVertex.h:43
bool noEndVertex() const
no end vertex
const HepPDT::ParticleData * particleInfo() const
particle info...
Definition: FSimTrack.h:53
double pt() const
transverse momentum
Definition: RawParticle.h:309
const RawParticle & vfcalEntrance() const
The particle at VFCAL entrance.
Definition: FSimTrack.h:149
int onLayer2() const
Definition: FSimTrack.h:106
const FSimVertex & endVertex() const
end vertex
const XYZTLorentzVector & momentum() const
Temporary (until move of SimTrack to Mathcore) - No! Actually very useful.
Definition: FSimTrack.h:209
const RawParticle & layer1Entrance() const
The particle at Preshower Layer 1.
Definition: FSimTrack.h:137
const FSimTrack & daughter(int i) const
Ith daughter.
int nDaughters() const
Number of daughters.
int onEcal() const
Definition: FSimTrack.h:111
double e() const
energy of the momentum
Definition: RawParticle.h:305
const math::XYZTLorentzVector & position() const
Temporary (until CMSSW moves to Mathcore) - No ! Actually very useful.
Definition: FSimVertex.h:48
int genpartIndex() const
index of the corresponding Generator particle in the Event container (-1 if no Genpart) ...
Definition: SimTrack.h:37
const RawParticle & ecalEntrance() const
The particle at ECAL entrance.
Definition: FSimTrack.h:143
int onVFcal() const
Definition: FSimTrack.h:121
const XYZTLorentzVector & vertex() const
the vertex fourvector
Definition: RawParticle.h:320
int id() const
the index in FBaseSimEvent and other vectors
Definition: FSimTrack.h:96
const RawParticle & layer2Entrance() const
The particle at Preshower Layer 2.
Definition: FSimTrack.h:140
int onLayer1() const
Definition: FSimTrack.h:101
int onHcal() const
Definition: FSimTrack.h:116
bool noMother() const
no mother particle
const RawParticle & hcalEntrance() const
The particle at HCAL entrance.
Definition: FSimTrack.h:146
const FSimVertex vertex() const
Origin vertex.
math::XYZVector XYZVector
Definition: RawParticle.h:26
const FSimTrack & mother() const
mother
math::XYZTLorentzVector XYZTLorentzVector
Definition: RawParticle.h:25