WCSimTrueEvent.cc

Go to the documentation of this file.
00001 #include "WCSimTrueEvent.hh"
00002 #include "WCSimTrueTrack.hh"
00003 
00004 #include <iostream>
00005 #include <cmath>
00006 
00007 ClassImp(WCSimTrueEvent)
00008 
00009 WCSimTrueEvent::WCSimTrueEvent()
00010 {
00011   fTrackList = new std::vector<WCSimTrueTrack*>;
00012   
00013   this->Reset();
00014 }
00015 
00016 WCSimTrueEvent::~WCSimTrueEvent()
00017 {
00018   delete fTrackList;
00019 }
00020  
00021 void WCSimTrueEvent::SetHeader( Int_t ipdg,
00022                                 Double_t g4vx, Double_t g4vy, Double_t g4vz,
00023                                 Double_t g4ex, Double_t g4ey, Double_t g4ez,
00024                                 Double_t vx, Double_t vy, Double_t vz,
00025                                 Double_t ex, Double_t ey, Double_t ez,
00026                                 Double_t px, Double_t py, Double_t pz,
00027                                 Double_t trkE, Double_t trkP )
00028 {
00029   fIpdg = ipdg;
00030 
00031   fG4VtxX = g4vx;
00032   fG4VtxY = g4vy;
00033   fG4VtxZ = g4vz;
00034 
00035   fG4EndX = g4ex;
00036   fG4EndY = g4ey;
00037   fG4EndZ = g4ez;
00038 
00039   fVtxX = vx;
00040   fVtxY = vy;
00041   fVtxZ = vz;    
00042 
00043   fEndX = ex;
00044   fEndY = ey;
00045   fEndZ = ez;  
00046 
00047   fDirX = px;
00048   fDirY = py;
00049   fDirZ = pz;
00050 
00051   fTrkE = trkE;
00052   fTrkP = trkP;
00053 
00054   fLength = sqrt( (fEndX-fVtxX)*(fEndX-fVtxX)
00055                  +(fEndY-fVtxY)*(fEndY-fVtxY)
00056                  +(fEndZ-fVtxZ)*(fEndZ-fVtxZ) );
00057 }
00058   
00059 void WCSimTrueEvent::Reset()
00060 {
00061   fIpdg = 0;
00062 
00063   fG4VtxX = -99999.9;
00064   fG4VtxY = -99999.9;
00065   fG4VtxZ = -99999.9;
00066 
00067   fG4EndX = -99999.9;
00068   fG4EndY = -99999.9;
00069   fG4EndZ = -99999.9;
00070 
00071   fVtxX = -99999.9;
00072   fVtxY = -99999.9;
00073   fVtxZ = -99999.9;    
00074 
00075   fEndX = -99999.9;
00076   fEndY = -99999.9;
00077   fEndZ = -99999.9;  
00078 
00079   fDirX = 0.0;
00080   fDirY = 0.0;
00081   fDirZ = 0.0;
00082 
00083   fTrkE = 0.0;
00084   fTrkP = 0.0;
00085 
00086   fLength = 0.0;
00087 
00088   this->ClearTracks();
00089  
00090   return;
00091 }
00092  
00093 Int_t WCSimTrueEvent::GetNTracks()
00094 {
00095   return fTrackList->size();
00096 }
00097   
00098 WCSimTrueTrack* WCSimTrueEvent::GetTrack(Int_t itrack)
00099 {
00100   return (WCSimTrueTrack*)(fTrackList->at(itrack));
00101 }
00102   
00103 void WCSimTrueEvent::AddTrack(WCSimTrueTrack* myTrack)
00104 {
00105   fTrackList->push_back(myTrack);
00106 }
00107 
00108 void WCSimTrueEvent::ClearTracks()
00109 {
00110   fTrackList->clear();
00111 }
00112 
00113 void WCSimTrueEvent::PrintEvent()
00114 {
00115   std::cout << " *** WCSimTrueEvent::PrintEvent() *** " << std::endl
00116             << " * Ipdg = " << fIpdg << std::endl
00117             << " * G4VtxX = " << fG4VtxX << std::endl
00118             << " * G4VtxY = " << fG4VtxY << std::endl
00119             << " * G4VtxZ = " << fG4VtxZ << std::endl
00120             << " * G4EndX = " << fG4EndX << std::endl
00121             << " * G4EndY = " << fG4EndY << std::endl
00122             << " * G4EndZ = " << fG4EndZ << std::endl
00123             << " * VtxX = " << fVtxX << std::endl
00124             << " * VtxY = " << fVtxY << std::endl
00125             << " * VtxZ = " << fVtxZ << std::endl
00126             << " * EndX = " << fEndX << std::endl
00127             << " * EndY = " << fEndY << std::endl
00128             << " * EndZ = " << fEndZ << std::endl
00129             << " * DirX = " << fDirX << std::endl
00130             << " * DirY = " << fDirY << std::endl
00131             << " * DirZ = " << fDirZ << std::endl
00132             << " * TrkE = " << fTrkP << std::endl
00133             << " * TrkP = " << fTrkE << std::endl
00134             << " * Length = " << fLength << std::endl
00135             << " *********************************** " << std::endl;
00136 
00137   return;
00138 }
00139