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() [1/3]

CoreSimTrack::CoreSimTrack ( )
inline

constructors

Definition at line 12 of file CoreSimTrack.h.

12 : tId(0), thePID(0) {}

◆ CoreSimTrack() [2/3]

CoreSimTrack::CoreSimTrack ( int  ipart,
const math::XYZTLorentzVectorD p 
)
inline

Definition at line 13 of file CoreSimTrack.h.

13 : tId(0), thePID(ipart), theMomentum(p) {}

◆ CoreSimTrack() [3/3]

CoreSimTrack::CoreSimTrack ( int  ipart,
math::XYZVectorD ip,
double  ie 
)
inline

Definition at line 15 of file CoreSimTrack.h.

15  : tId(0), thePID(ipart) {
16  theMomentum.SetXYZT(ip.x(), ip.y(), ip.z(), ie);
17  }

References theMomentum.

Member Function Documentation

◆ charge()

float CoreSimTrack::charge ( void  ) const

charge

Definition at line 17 of file CoreSimTrack.cc.

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 }

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

Referenced by pat::GenPlusSimParticleProducer::addGenParticle(), FWSimTrackProxyBuilder::build(), JetCoreMCtruthSeedGenerator::coreTracksFillingDeltaR(), pat::PATGenCandsFromSimTracksProducer::makeGenParticle_(), MuonSimHitProducer::produce(), PropagateToMuon::startingState(), and FastTSGFromPropagation::trackerSeeds().

◆ eventId()

EncodedEventId CoreSimTrack::eventId ( ) const
inline

Definition at line 28 of file CoreSimTrack.h.

28 { return eId; }

References eId.

Referenced by CaloParticle::CaloParticle(), ntupleDataFormat.Event::eventIdStr(), and SimCluster::SimCluster().

◆ momentum()

const math::XYZTLorentzVectorD& CoreSimTrack::momentum ( ) const
inline

◆ setEventId()

void CoreSimTrack::setEventId ( EncodedEventId  e)
inline

Definition at line 27 of file CoreSimTrack.h.

27 { eId = e; }

References MillePedeFileConverter_cfg::e, and eId.

◆ setTrackId()

void CoreSimTrack::setTrackId ( unsigned int  t)
inline

Definition at line 30 of file CoreSimTrack.h.

30 { tId = t; }

References submitPVValidationJobs::t, and tId.

Referenced by FSimTrack::FSimTrack().

◆ trackId()

unsigned int CoreSimTrack::trackId ( ) const
inline

◆ type()

int CoreSimTrack::type ( ) const
inline

Member Data Documentation

◆ eId

EncodedEventId CoreSimTrack::eId
private

Definition at line 34 of file CoreSimTrack.h.

Referenced by eventId(), and setEventId().

◆ theMomentum

math::XYZTLorentzVectorD CoreSimTrack::theMomentum
private

Definition at line 37 of file CoreSimTrack.h.

Referenced by CoreSimTrack(), and momentum().

◆ thePID

int CoreSimTrack::thePID
private

Definition at line 36 of file CoreSimTrack.h.

Referenced by charge(), and type().

◆ tId

unsigned int CoreSimTrack::tId
private

Definition at line 35 of file CoreSimTrack.h.

Referenced by setTrackId(), and trackId().

CoreSimTrack::theMomentum
math::XYZTLorentzVectorD theMomentum
Definition: CoreSimTrack.h:37
CoreSimTrack::thePID
int thePID
Definition: CoreSimTrack.h:36
chg
const float chg[109]
Definition: CoreSimTrack.cc:5
CoreSimTrack::tId
unsigned int tId
Definition: CoreSimTrack.h:35
CoreSimTrack::eId
EncodedEventId eId
Definition: CoreSimTrack.h:34
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37