CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private 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
 particle info... More...
 
void setEventId (EncodedEventId e)
 
void setTrackId (unsigned int t)
 
unsigned int trackId () const
 
int type () const
 particle type (HEP PDT convension) More...
 

Private Member Functions

int chargeValue (const int &) const
 

Private Attributes

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

Detailed Description

a generic Simulated Track

Definition at line 15 of file CoreSimTrack.h.

Constructor & Destructor Documentation

CoreSimTrack::CoreSimTrack ( )
inline

constructors

Definition at line 20 of file CoreSimTrack.h.

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

Definition at line 21 of file CoreSimTrack.h.

21  :
22  thePID(ipart), theMomentum(p) {}
math::XYZTLorentzVectorD theMomentum
Definition: CoreSimTrack.h:57
CoreSimTrack::CoreSimTrack ( int  ipart,
math::XYZVectorD ip,
double  ie 
)
inline

Definition at line 24 of file CoreSimTrack.h.

References theMomentum.

24  :
25  thePID(ipart)
26  { theMomentum.SetXYZT( ip.x(), ip.y(), ip.z(), ie ) ; }
math::XYZTLorentzVectorD theMomentum
Definition: CoreSimTrack.h:57

Member Function Documentation

float CoreSimTrack::charge ( void  ) const
int CoreSimTrack::chargeValue ( const int &  Id) const
private

Definition at line 8 of file CoreSimTrack.cc.

References abs.

Referenced by charge().

8  {
9 
10 
11  //...Purpose: to give three times the charge for a particle/parton.
12 
13  // ID = particle ID
14  // hepchg = particle charge times 3
15 
16  int kqa,kq1,kq2,kq3,kqj,irt,kqx,kqn;
17  int hepchg;
18 
19 
20  int ichg[109]={-1,2,-1,2,-1,2,-1,2,0,0,-3,0,-3,0,-3,0,
21 -3,0,0,0,0,0,0,3,0,0,0,0,0,0,3,0,3,6,0,0,3,6,0,0,-1,2,-1,2,-1,2,0,0,0,0,
22 -3,0,-3,0,-3,0,0,0,0,0,-1,2,-1,2,-1,2,0,0,0,0,
23 -3,0,-3,0,-3,0,3,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
24 
25 
26  //...Initial values. Simple case of direct readout.
27  hepchg=0;
28  kqa=abs(Id);
29  kqn=kqa/1000000000%10;
30  kqx=kqa/1000000%10;
31  kq3=kqa/1000%10;
32  kq2=kqa/100%10;
33  kq1=kqa/10%10;
34  kqj=kqa%10;
35  irt=kqa%10000;
36 
37  //...illegal or ion
38  //...set ion charge to zero - not enough information
39  if(kqa==0 || kqa >= 10000000) {
40 
41  if(kqn==1) {hepchg=0;}
42  }
43  //... direct translation
44  else if(kqa<=100) {hepchg = ichg[kqa-1];}
45  //... deuteron or tritium
46  else if(kqa==100 || kqa==101) {hepchg = -3;}
47  //... alpha or He3
48  else if(kqa==102 || kqa==104) {hepchg = -6;}
49  //... KS and KL (and undefined)
50  else if(kqj == 0) {hepchg = 0;}
51  //C... direct translation
52  else if(kqx>0 && irt<100)
53  {
54  hepchg = ichg[irt-1];
55  if(kqa==1000017 || kqa==1000018) {hepchg = 0;}
56  if(kqa==1000034 || kqa==1000052) {hepchg = 0;}
57  if(kqa==1000053 || kqa==1000054) {hepchg = 0;}
58  if(kqa==5100061 || kqa==5100062) {hepchg = 6;}
59  }
60  //...Construction from quark content for heavy meson, diquark, baryon.
61  //...Mesons.
62  else if(kq3==0)
63  {
64  hepchg = ichg[kq2-1]-ichg[kq1-1];
65  //...Strange or beauty mesons.
66  if((kq2==3) || (kq2==5)) {hepchg = ichg[kq1-1]-ichg[kq2-1];}
67  }
68  else if(kq1 == 0) {
69  //...Diquarks.
70  hepchg = ichg[kq3-1] + ichg[kq2-1];
71  }
72 
73  else{
74  //...Baryons
75  hepchg = ichg[kq3-1]+ichg[kq2-1]+ichg[kq1-1];
76  }
77 
78  //... fix sign of charge
79  if(Id<0 && hepchg!=0) {hepchg = -1*hepchg;}
80 
81  // cout << hepchg<< endl;
82  return hepchg;
83 }
#define abs(x)
Definition: mlp_lapack.h:159
EncodedEventId CoreSimTrack::eventId ( ) const
inline

Definition at line 46 of file CoreSimTrack.h.

References eId.

Referenced by TrackingTruthProducer::createTrackingTruth(), and TrackingTruthProducer::setTrackingParticle().

46 {return eId;}
EncodedEventId eId
Definition: CoreSimTrack.h:54
const math::XYZTLorentzVectorD& CoreSimTrack::momentum ( ) const
inline
void CoreSimTrack::setEventId ( EncodedEventId  e)
inline

Definition at line 45 of file CoreSimTrack.h.

References alignCSCRings::e, and eId.

45 {eId=e;}
EncodedEventId eId
Definition: CoreSimTrack.h:54
void CoreSimTrack::setTrackId ( unsigned int  t)
inline

Definition at line 48 of file CoreSimTrack.h.

References lumiQTWidget::t, and tId.

Referenced by FSimTrack::FSimTrack().

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

Member Data Documentation

EncodedEventId CoreSimTrack::eId
private

Definition at line 54 of file CoreSimTrack.h.

Referenced by eventId(), and setEventId().

math::XYZTLorentzVectorD CoreSimTrack::theMomentum
private

Definition at line 57 of file CoreSimTrack.h.

Referenced by CoreSimTrack(), and momentum().

int CoreSimTrack::thePID
private

Definition at line 56 of file CoreSimTrack.h.

Referenced by charge(), and type().

unsigned int CoreSimTrack::tId
private

Definition at line 55 of file CoreSimTrack.h.

Referenced by setTrackId(), and trackId().