00001
00002
00003
00004
00005
00006
00007
00008 #include "Simulation/MCTruth.h"
00009 #include <iostream>
00010 using namespace sim;
00011 ClassImp(MCTruth);
00012
00013
00014
00015 MCTruth::MCTruth() :
00016 fPartList(0),
00017 fNuType(0),
00018 fMode(0),
00019 fCCNC(0),
00020 fEnu(0)
00021 {
00022 for (int i=0; i<6; ++i) fFluxGen[i]=fFluxPos[i]=fFluxNeg[i]= 0;
00023 }
00024
00025
00033 double MCTruth::Flux(int pdgcode, int which) const
00034 {
00035 const float* flux = 0;
00036 if (which==kGenerator) flux = fFluxGen;
00037 if (which==kPlusFocus) flux = fFluxPos;
00038 if (which==kMinusFocus) flux = fFluxNeg;
00039 if (pdgcode== 12) return flux[0];
00040 if (pdgcode==-12) return flux[1];
00041 if (pdgcode== 14) return flux[2];
00042 if (pdgcode==-14) return flux[3];
00043 if (pdgcode== 16) return flux[4];
00044 if (pdgcode==-16) return flux[5];
00045 return 0.0;
00046 }
00047
00048
00049
00050 void MCTruth::SetFluxPos(double nue, double nuebar,
00051 double numu, double numubar,
00052 double nutau,double nutaubar)
00053 {
00054 fFluxPos[0] = nue; fFluxPos[1] = nuebar;
00055 fFluxPos[2] = numu; fFluxPos[3] = numubar;
00056 fFluxPos[4] = nutau; fFluxPos[5] = nutaubar;
00057 }
00058
00059
00060
00061 void MCTruth::SetFluxNeg(double nue, double nuebar,
00062 double numu, double numubar,
00063 double nutau,double nutaubar)
00064 {
00065 fFluxNeg[0] = nue; fFluxNeg[1] = nuebar;
00066 fFluxNeg[2] = numu; fFluxNeg[3] = numubar;
00067 fFluxNeg[4] = nutau; fFluxNeg[5] = nutaubar;
00068 }
00069
00070
00071
00072 void MCTruth::SetFluxGen(double nue, double nuebar,
00073 double numu, double numubar,
00074 double nutau,double nutaubar)
00075 {
00076 fFluxGen[0] = nue; fFluxGen[1] = nuebar;
00077 fFluxGen[2] = numu; fFluxGen[3] = numubar;
00078 fFluxGen[4] = nutau; fFluxGen[5] = nutaubar;
00079 }
00080
00081
00082
00083 void MCTruth::Print()
00084 {
00085 for (unsigned int i=0; i<fPartList.size(); ++i) {
00086 std::cout << i << ") "
00087 << fPartList[i].GetName() << "\t"
00088 << "["
00089 << fPartList[i].Vx() << ","
00090 << fPartList[i].Vy() << ","
00091 << fPartList[i].Vz() << ","
00092 << fPartList[i].T()
00093 << "] ["
00094 << fPartList[i].Px() << ","
00095 << fPartList[i].Py() << ","
00096 << fPartList[i].Pz()
00097 << "]"
00098 << std::endl;
00099 }
00100 }
00101
00102 MCTruth::~MCTruth() { }
00103