NtpMCStdHep Class Reference

#include <NtpMCStdHep.h>

List of all members.

Public Member Functions

 NtpMCStdHep ()
virtual ~NtpMCStdHep ()
virtual std::ostream & Print (std::ostream &os, const Option_t *option="", std::string printpreface="", const TClonesArray *stdheparray=0) const
virtual void Print (const Option_t *option="") const
Float_t P () const
Float_t Charge () const
std::string ParticleName () const

Public Attributes

UInt_t index
 index of this stdhep entry in stdhep array
Short_t mc
 index of associated mc primary in mc array
Int_t parent [2]
 indices of first/last parent
Int_t child [2]
 indices of first/last child
Int_t IstHEP
 status code(see list in UserManual MC chapter)
Int_t IdHEP
 particle ID (PDG standard)
Float_t mass
 particle mass (GeV)
Float_t p4 [4]
 momentum 4-vector (GeV)
Float_t vtx [4]
 vertex 4-vector ((x,y,z)(m),t(sec))
Int_t ndethit
 number of det digihits produced by this track
NtpMCStdHepHit dethit [2]
 record info about first/last detector digihit

Detailed Description

Definition at line 22 of file NtpMCStdHep.h.


Constructor & Destructor Documentation

NtpMCStdHep::NtpMCStdHep (  ) 

Definition at line 28 of file NtpMCStdHep.cxx.

References child, LoadMinosPDG(), p4, parent, and vtx.

00028                          : index(0),mc(-1),IstHEP(0),IdHEP(0),mass(0),
00029                              ndethit(0) {
00030   //
00031   // Purpose: Default constructor
00032   //
00033 
00034   LoadMinosPDG();
00035   
00036   for ( Int_t i = 0; i < 2; i++ ) {
00037     parent[i] = -1;
00038     child[i] = -1;
00039   }
00040 
00041   for ( Int_t i = 0; i < 4; i++ ) {
00042     p4[i]  = 0.;
00043     vtx[i] = 0.;
00044   }
00045 
00046 }

virtual NtpMCStdHep::~NtpMCStdHep (  )  [inline, virtual]

Definition at line 27 of file NtpMCStdHep.h.

00027 {}


Member Function Documentation

Float_t NtpMCStdHep::Charge (  )  const

Definition at line 49 of file NtpMCStdHep.cxx.

References IdHEP.

Referenced by MCMonitorCosmicHistograms::FillReTrDelQPCurve().

00049                                   {
00050   //
00051   // Purpose: Return charge of particle in units of |e|, e.g.
00052   // electron has charge -1.  Returns -999 if unknown
00053   //
00054 
00055   const TDatabasePDG& dbpdg = *(TDatabasePDG::Instance());
00056   Double_t charge = -999;
00057   if ( dbpdg.GetParticle(IdHEP) ) charge 
00058                                   = dbpdg.GetParticle(IdHEP)->Charge();
00059   // TParticlePDG returns charge in units of |e|/3, e.g. electron has charge -3
00060   // Convert to units of |e|
00061   return charge/3.;
00062 
00063 }

Float_t NtpMCStdHep::P (  )  const [inline]

Definition at line 37 of file NtpMCStdHep.h.

References p4.

Referenced by MCMonitorCosmicHistograms::FillReTrDelQPCurve().

00037 {return TMath::Sqrt(p4[0]*p4[0]+p4[1]*p4[1]+p4[2]*p4[2]);}

std::string NtpMCStdHep::ParticleName (  )  const

Definition at line 66 of file NtpMCStdHep.cxx.

References IdHEP.

Referenced by MCMonitorCosmicHistograms::FillHistsReTrTrk().

00066                                           {
00067   //
00068   // Purpose: Return name of particle, "???" if unknown
00069   //
00070 
00071   const TDatabasePDG& dbpdg = *(TDatabasePDG::Instance());
00072   std::string partname = "???";
00073   if ( dbpdg.GetParticle(IdHEP) ) partname=dbpdg.GetParticle(IdHEP)->GetName();
00074 
00075   return partname;
00076 
00077 }

void NtpMCStdHep::Print ( const Option_t *  option = ""  )  const [virtual]

Definition at line 133 of file NtpMCStdHep.cxx.

References Print().

00133                                                     {
00134   //
00135   // Purpose: Print stdhep data in form supported by TObject::Print.
00136   //
00137   // Arguments: option (not used).
00138   //
00139 
00140   Print(std::cout,option);
00141   return;
00142 
00143 }

std::ostream & NtpMCStdHep::Print ( std::ostream &  os,
const Option_t *  option = "",
std::string  printpreface = "",
const TClonesArray *  stdheparray = 0 
) const [virtual]

Definition at line 80 of file NtpMCStdHep.cxx.

References UtilIstHEP::AsString(), child, dethit, IdHEP, index, IstHEP, mc, Munits::nanosecond, ndethit, p4, parent, Print(), and vtx.

Referenced by inuke_reweight::add_to_stdhep(), MadScanDisplay::Display(), MadEvDisplay::Display(), NtpMCModule::FillNtpMCStdHep(), Print(), NtpMCRecord::Print(), and inuke_reweight::test_fill_stdhep().

00083                                                                         {
00084   // Print stdhep data on ostream.  If the stdheparray has been given 
00085   // (default null), than print all descendants of this particle as well.
00086 
00087   const TDatabasePDG& dbpdg = *(TDatabasePDG::Instance());
00088   std::string partname = "???";
00089   if ( dbpdg.GetParticle(IdHEP) ) partname=dbpdg.GetParticle(IdHEP)->GetName();
00090   std::string statusname = "/" + std::string(UtilIstHEP::AsString(IstHEP));
00091 
00092   // only keep first 12 characters for print
00093   if (statusname.size() > 12) statusname.resize(12); 
00094   
00095   ostringstream oss;
00096   oss << printpreface.c_str() << "[" << index << "]";
00097   Int_t prefacesize = oss.str().size();
00098   std::string blanks(prefacesize,' ');
00099   
00100   os << oss.str().c_str()
00101      << IdHEP << "/" << partname.c_str()
00102      << " s: " << IstHEP << statusname.c_str()
00103      << setprecision(3)
00104      << " v: " << vtx[0] << " " << vtx[1] << " " << vtx[2]
00105      << " mc: " << mc  
00106      << "\n" << blanks.c_str() 
00107      << "t(ns): " << vtx[3]/Munits::nanosecond  
00108      << " p: " << p4[0] << " " << p4[1] << " " << p4[2]
00109      << " P: " << parent[0]  << " " << parent[1] 
00110      << " C: " << child[0] << " " << child[1] << " ndethit: " << ndethit 
00111      << endl;
00112   if ( dethit[0].IsValid() ) {
00113     os << blanks.c_str() << "First Hit: " << dethit[0];
00114     os << blanks.c_str() << "Last  Hit: " << dethit[1];
00115   }
00116   
00117   if ( stdheparray && child[0] >= 0 ) {
00118     Int_t nd = child[1] - child[0] + 1;
00119     if ( nd > 0 ) {
00120       for (Int_t id = child[0]; id <= child[1]; id++ ) {
00121         const NtpMCStdHep* cdpart 
00122           = dynamic_cast<const NtpMCStdHep*>(stdheparray->At(id));
00123         cdpart->Print(os,"",blanks,stdheparray);
00124       }
00125     }
00126   }
00127     
00128   return os;
00129 
00130 }


Member Data Documentation

record info about first/last detector digihit

Definition at line 57 of file NtpMCStdHep.h.

Referenced by NtpMCModule::FillNtpMCStdHep(), NuReco::GetMuonFirstHitEnergy(), NuReco::GetMuonLastHitEnergy(), and Print().

particle ID (PDG standard)

Definition at line 52 of file NtpMCStdHep.h.

Referenced by inuke_reweight::add_to_stdhep(), TruthCompareAna::ana(), MNtpModule::Ana(), StdHepInfoAna::Analyze(), calbaryonpt(), CalcDaughters(), Charge(), checkParent(), TruthCompareAna::ComputeStatistics(), countpi0(), NuCounter::CountTrkStdhepId(), MadScanDisplay::Display(), MadEvDisplay::Display(), MadEvDisplay::DrawInteractionDiagram(), MadScanDisplay::DrawInteractionDiagram(), NuAnalysis::EfficienciesOld(), ReweightHelpers::EventRegistryFilla(), ANtpInfoObjectFillerBeam::FillBeamMCTruthInformation(), MCMonitorBeamHistograms::FillHistsTrueStdHep(), NtpMCModule::FillNtpMCStdHep(), NuReco::GetHadronicFinalState(), NuReco::GetInitialState(), NuReco::GetMuonContainmentMC(), NuReco::GetPreInukeFinalStateVars(), NuReco::GetPrimaryMuonStdHepIndex(), NtpTools::GetTotHadPt(), NuReco::GetTrueTrackId(), MNtpModule::HadronicFinalState(), MadQuantities::HadronicFinalState(), MadQuantities::Initial_state(), MNtpModule::Initial_state(), isLeptonic(), NuReco::IsTrkWithDimuon(), NuReco::IsTrkWithMuonFromKaonDecay(), NuReco::IsTrkWithMuonFromNotNuNotPiNotKaonNotCharm(), NuReco::IsTrkWithMuonFromPionDecay(), TruthCompareAna::MatchRecoElectron(), TruthCompareAna::MatchRecoMuon(), TruthCompareAna::MatchRecoProton(), ReweightHelpers::MCEventInfoFilla(), ParticleName(), MadCluAnalysis::Plot(), NueDisplayModule::plotmc(), Print(), NuReco::PrintCharm(), NuReco::PrintStdhep(), ParticleCheck::Process(), TruthCompareAna::ProcessTrueParticles(), ParticleTruthMaker::Reco(), and MadQuantities::SetStdHepVars().

Short_t NtpMCStdHep::mc

number of det digihits produced by this track

Definition at line 56 of file NtpMCStdHep.h.

Referenced by NtpMCModule::FillNtpMCStdHep(), and Print().

Float_t NtpMCStdHep::p4[4]
Float_t NtpMCStdHep::vtx[4]

The documentation for this class was generated from the following files:

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1