CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
CoreSimTrack Class Reference

#include <CoreSimTrack.h>

Inheritance diagram for CoreSimTrack:
SimTrack FSimTrack

Public Member Functions

float charge () const
 charge More...
 
 CoreSimTrack ()
 constructors More...
 
 CoreSimTrack (int ipart, const math::XYZTLorentzVectorD &p)
 
 CoreSimTrack (int ipart, math::XYZVectorD &ip, double ie)
 
EncodedEventId eventId () const
 
const math::XYZTLorentzVectorDmomentum () const
 
void setEventId (EncodedEventId e)
 
void setTrackId (unsigned int t)
 
unsigned int trackId () const
 
int type () const
 particle type (HEP PDT convension) More...
 

Private Attributes

EncodedEventId eId
 
math::XYZTLorentzVectorD theMomentum
 
int thePID
 
unsigned int tId
 

Detailed Description

Definition at line 9 of file CoreSimTrack.h.

Constructor & Destructor Documentation

CoreSimTrack::CoreSimTrack ( )
inline

constructors

Definition at line 12 of file CoreSimTrack.h.

12 : tId(0), thePID(0) {}
unsigned int tId
Definition: CoreSimTrack.h:35
CoreSimTrack::CoreSimTrack ( int  ipart,
const math::XYZTLorentzVectorD p 
)
inline

Definition at line 13 of file CoreSimTrack.h.

13 : tId(0), thePID(ipart), theMomentum(p) {}
unsigned int tId
Definition: CoreSimTrack.h:35
math::XYZTLorentzVectorD theMomentum
Definition: CoreSimTrack.h:37
CoreSimTrack::CoreSimTrack ( int  ipart,
math::XYZVectorD ip,
double  ie 
)
inline

Definition at line 15 of file CoreSimTrack.h.

References theMomentum.

15  : tId(0), thePID(ipart) {
16  theMomentum.SetXYZT(ip.x(), ip.y(), ip.z(), ie);
17  }
unsigned int tId
Definition: CoreSimTrack.h:35
math::XYZTLorentzVectorD theMomentum
Definition: CoreSimTrack.h:37

Member Function Documentation

float CoreSimTrack::charge ( void  ) const

charge

Definition at line 17 of file CoreSimTrack.cc.

References funct::abs(), chg, and thePID.

Referenced by TrackingTruthAccumulator::accumulateEvent(), pat::GenPlusSimParticleProducer::addGenParticle(), FWSimTrackProxyBuilder::build(), pat::PATGenCandsFromSimTracksProducer::makeGenParticle_(), SeedMatcher::matchSimTrack(), SimpleL1MuGMTCand::operator=(), MuonSimHitProducer::produce(), SimpleL1MuGMTCand::SimpleL1MuGMTCand(), PropagateToMuon::startingState(), FastTSGFromPropagation::trackerSeeds(), and type().

17  {
18  float hepchg = 0;
19  if (thePID != 0) {
20  int kqa = std::abs(thePID);
21  if (kqa < 10000000) {
22  //... direct translation
23  if (kqa <= 100) {
24  hepchg = chg[kqa - 1];
25  }
26  //... deuteron or tritium
27  else if (kqa == 100 || kqa == 101) {
28  hepchg = -1;
29  }
30  //... alpha or He3
31  else if (kqa == 102 || kqa == 104) {
32  hepchg = -2;
33  } else if (kqa % 10 != 0) {
34  int kqx = kqa / 1000000 % 10;
35  int kq3 = kqa / 1000 % 10;
36  int kq2 = kqa / 100 % 10;
37  int kq1 = kqa / 10 % 10;
38  int irt = kqa % 10000;
39  if (kqx > 0 && irt < 100) {
40  hepchg = chg[irt - 1];
41  if (kqa == 5100061 || kqa == 5100062) {
42  hepchg = 2;
43  }
44  } else if (kq3 == 0) {
45  // Construction from quark content for heavy meson,
46  // diquark, baryon, mesons.
47  hepchg = chg[kq2 - 1] - chg[kq1 - 1];
48  //...Strange or beauty mesons.
49  if ((kq2 == 3) || (kq2 == 5)) {
50  hepchg = chg[kq1 - 1] - chg[kq2 - 1];
51  }
52  } else if (kq1 == 0) {
53  //...Diquarks.
54  hepchg = chg[kq3 - 1] + chg[kq2 - 1];
55  } else {
56  //...Baryons
57  hepchg = chg[kq3 - 1] + chg[kq2 - 1] + chg[kq1 - 1];
58  }
59  }
60  //... fix sign of charge
61  if (thePID < 0) {
62  hepchg = -hepchg;
63  }
64  }
65  }
66  return hepchg;
67 }
const float chg[109]
Definition: CoreSimTrack.cc:5
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
EncodedEventId CoreSimTrack::eventId ( ) const
inline
const math::XYZTLorentzVectorD& CoreSimTrack::momentum ( ) const
inline
void CoreSimTrack::setEventId ( EncodedEventId  e)
inline

Definition at line 27 of file CoreSimTrack.h.

References MillePedeFileConverter_cfg::e, and eId.

void CoreSimTrack::setTrackId ( unsigned int  t)
inline

Definition at line 30 of file CoreSimTrack.h.

References protons_cff::t, and tId.

Referenced by FSimTrack::FSimTrack().

30 { tId = t; }
unsigned int tId
Definition: CoreSimTrack.h:35
unsigned int CoreSimTrack::trackId ( ) const
inline
int CoreSimTrack::type ( ) const
inline

Member Data Documentation

EncodedEventId CoreSimTrack::eId
private

Definition at line 34 of file CoreSimTrack.h.

Referenced by eventId(), and setEventId().

math::XYZTLorentzVectorD CoreSimTrack::theMomentum
private

Definition at line 37 of file CoreSimTrack.h.

Referenced by CoreSimTrack(), and momentum().

int CoreSimTrack::thePID
private

Definition at line 36 of file CoreSimTrack.h.

Referenced by charge(), and type().

unsigned int CoreSimTrack::tId
private

Definition at line 35 of file CoreSimTrack.h.

Referenced by setTrackId(), and trackId().