CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

CoreSimTrack Class Reference

#include <CoreSimTrack.h>

Inheritance diagram for CoreSimTrack:
SimTrack FSimTrack

List of all members.

Public Member Functions

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

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.

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

Definition at line 21 of file CoreSimTrack.h.

                                                               :
       thePID(ipart), theMomentum(p) {}
CoreSimTrack::CoreSimTrack ( int  ipart,
math::XYZVectorD ip,
double  ie 
) [inline]

Definition at line 24 of file CoreSimTrack.h.

References theMomentum.

                                                             :
       thePID(ipart)
    { theMomentum.SetXYZT( ip.x(), ip.y(), ip.z(), ie ) ; }

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().

                                               {

  
  //...Purpose: to give three times the charge for a particle/parton.

  //      ID     = particle ID
  //      hepchg = particle charge times 3

  int kqa,kq1,kq2,kq3,kqj,irt,kqx,kqn;
  int hepchg;


  int ichg[109]={-1,2,-1,2,-1,2,-1,2,0,0,-3,0,-3,0,-3,0,
-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,
-3,0,-3,0,-3,0,0,0,0,0,-1,2,-1,2,-1,2,0,0,0,0,
-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};


  //...Initial values. Simple case of direct readout.
  hepchg=0;
  kqa=abs(Id);
  kqn=kqa/1000000000%10;
  kqx=kqa/1000000%10;
  kq3=kqa/1000%10;
  kq2=kqa/100%10;
  kq1=kqa/10%10;
  kqj=kqa%10;
  irt=kqa%10000;

  //...illegal or ion
  //...set ion charge to zero - not enough information
  if(kqa==0 || kqa >= 10000000) {

    if(kqn==1) {hepchg=0;}
  }
  //... direct translation
  else if(kqa<=100) {hepchg = ichg[kqa-1];}
  //... deuteron or tritium
  else if(kqa==100 || kqa==101) {hepchg = -3;}
  //... alpha or He3
  else if(kqa==102 || kqa==104) {hepchg = -6;}
  //... KS and KL (and undefined)
  else if(kqj == 0) {hepchg = 0;}
  //C... direct translation
  else if(kqx>0 && irt<100)
    {
      hepchg = ichg[irt-1];
      if(kqa==1000017 || kqa==1000018) {hepchg = 0;}
      if(kqa==1000034 || kqa==1000052) {hepchg = 0;}
      if(kqa==1000053 || kqa==1000054) {hepchg = 0;}
      if(kqa==5100061 || kqa==5100062) {hepchg = 6;}
    }
  //...Construction from quark content for heavy meson, diquark, baryon.
  //...Mesons.
  else if(kq3==0)
    {
      hepchg = ichg[kq2-1]-ichg[kq1-1];
      //...Strange or beauty mesons.
      if((kq2==3) || (kq2==5)) {hepchg = ichg[kq1-1]-ichg[kq2-1];}
    }
  else if(kq1 == 0) {
    //...Diquarks.
    hepchg = ichg[kq3-1] + ichg[kq2-1];
  }

  else{
    //...Baryons
    hepchg = ichg[kq3-1]+ichg[kq2-1]+ichg[kq1-1];
  }

  //... fix sign of charge
  if(Id<0 && hepchg!=0) {hepchg = -1*hepchg;}

  // cout << hepchg<< endl;
  return hepchg;
}
EncodedEventId CoreSimTrack::eventId ( ) const [inline]

Definition at line 46 of file CoreSimTrack.h.

References eId.

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

{return eId;}
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.

{eId=e;}
void CoreSimTrack::setTrackId ( unsigned int  t) [inline]

Definition at line 48 of file CoreSimTrack.h.

References lumiQTWidget::t, and tId.

Referenced by FSimTrack::FSimTrack().

{tId=t;}
unsigned int CoreSimTrack::trackId ( ) const [inline]
int CoreSimTrack::type ( ) const [inline]

Member Data Documentation

Definition at line 54 of file CoreSimTrack.h.

Referenced by eventId(), and setEventId().

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().