00001
00006 #ifndef REACTOREVENT_HH
00007 #define REACTOREVENT_HH
00008 #include <math.h>
00009 #include <iostream.h>
00010 #include <string>
00011 #include "ReactorConstants.hh"
00012
00026 class ReactorEvent{
00027
00028 public:
00029
00039 ReactorEvent(int newNevents,
00040 double newRmaxgen=k.Rmaxgen,
00041 double newEmin=k.Emin,
00042 double newEmax=k.Emax,
00043 int newXCorder=k.XCorder);
00045 ~ReactorEvent();
00047 ReactorEvent(const ReactorEvent& Event);
00049 ReactorEvent& operator=(const ReactorEvent& rhs);
00050
00051
00052
00053 double XCReweight();
00054 double XCReweight(double Enu);
00055 double XCReweight(ReactorEvent& Event);
00056
00057 std::string eventType;
00058 std::string pmtRad;
00059
00060 static const int Pdim = 7;
00061 static const int Rdim = 7;
00062
00063
00065 std::string GetPmtRad() const {return pmtRad;}
00066
00068 int GetNevent() const {return Nevent;}
00069
00071 int GetNumNubar() const {return Nnubar;}
00073 int GetNumPositron() const {return Npositron;}
00075 int GetNumElectron() const {return Nelectron;}
00077 int GetNumNeutron() const {return Nneutron;}
00079 int GetNumGamma() const {return Ngamma;}
00080
00081 double GetXCWeight() const {return XCWeight;}
00082 double GetFluxWeight() const {return FluxWeight;}
00083
00088 double GetEnu(int& n) const {return Pnubar[0+n*Pdim];}
00093 double GetNubarParentProcess(int& n) const {return Pnubar[6+n*Pdim];}
00094
00099 double GetElectronKE(int& n) const {return Pelectron[4+n*Pdim];}
00100 double GetElectronCosTheta(int& n) const {return Pelectron[3+n*Pdim]/Pelectron[5+n*Pdim];}
00101 double GetElectronPhi(int& n) const {return atan2(Pelectron[2+n*Pdim],Pelectron[1+n*Pdim]);}
00106 double GetElectronParentProcess(int& n) const {return Pelectron[6+n*Pdim];}
00107 double* const GetElectronPxyz(){return Pelectron+1;}
00108
00113 double GetPositronKE(int& n) const {return Ppositron[4+n*Pdim];}
00114 double GetPositronCosTheta(int& n) const {return Ppositron[3+n*Pdim]/Ppositron[5+n*Pdim];}
00115 double GetPositronPhi(int& n) const {return atan2(Ppositron[2+n*Pdim],Ppositron[1+n*Pdim]);}
00120 double GetPositronParentProcess(int& n) const {return Ppositron[6+n*Pdim];}
00121 double* const GetPositronPxyz(){return Ppositron+1;}
00122
00127 double GetNeutronKE(int& n) const {return Pneutron[4+n*Pdim];}
00128 double GetNeutronCosTheta(int& n) const {return Pneutron[3+n*Pdim]/Pneutron[5+n*Pdim];}
00129 double GetNeutronPhi(int& n) const {return atan2(Pneutron[2+n*Pdim],Pneutron[1+n*Pdim]);}
00134 double GetNeutronParentProcess(int& n) const {return Pneutron[6+n*Pdim];}
00135 double* const GetNeutronPxyz(){return Pneutron+1;}
00136
00141 double GetGammaKE(int& n) const {return Pgamma[0+n*Pdim];}
00146 double GetGammaParentProcess(int& n) const {return Pgamma[6+n*Pdim];}
00147
00148 double GetNubarTime(int& n) const {return Rnubar[0+n*Rdim];}
00149 double GetElectronTime(int& n) const {return Relectron[0+n*Rdim];}
00150 double GetPositronTime(int& n) const {return Rpositron[0+n*Rdim];}
00151 double GetNeutronTime(int& n) const {return Rneutron[0+n*Rdim];}
00152 double GetGammaTime(int& n) const {return Rgamma[0+n*Rdim];}
00153
00154 double GetNubarVertexR(int& n) const {return Rnubar[4+n*Rdim];}
00155 double GetNubarVertexCosTheta(int& n) const {return Rnubar[5+n*Rdim];}
00156 double GetNubarVertexPhi(int& n) const {return Rnubar[6+n*Rdim];}
00157 double* const GetNubarVertexXYZ() {return Rnubar+1;}
00158
00159 double GetElectronVertexR(int& n) const {return Relectron[4+n*Rdim];}
00160 double GetElectronVertexCosTheta(int& n) const {return Relectron[5+n*Rdim];}
00161 double GetElectronVertexPhi(int& n) const {return Relectron[6+n*Rdim];}
00162 double* const GetElectronVertexXYZ() {return Relectron+1;}
00163
00164 double GetPositronVertexR(int& n) const {return Rpositron[4+n*Rdim];}
00165 double GetPositronVertexCosTheta(int& n) const {return Rpositron[5+n*Rdim];}
00166 double GetPositronVertexPhi(int& n) const {return Rpositron[6+n*Rdim];}
00167 double* const GetPositronVertexXYZ() {return Rpositron+1;}
00168
00169 double GetNeutronVertexR(int& n) const {return Rneutron[4+n*Rdim];}
00170 double GetNeutronVertexCosTheta(int& n) const {return Rneutron[5+n*Rdim];}
00171 double GetNeutronVertexPhi(int& n) const {return Rneutron[6+n*Rdim];}
00172 double* const GetNeutronVertexXYZ() {return Rneutron+1;}
00173
00174 double GetGammaVertexR(int& n) const {return Rgamma[4+n*Rdim];}
00175 double GetGammaVertexCosTheta(int& n) const {return Rgamma[5+n*Rdim];}
00176 double GetGammaVertexPhi(int& n) const {return Rgamma[6+n*Rdim];}
00177 double* const GetGammaVertexXYZ() {return Rgamma+1;}
00178
00179 double GetGeneratedElectronTime(int& n) const {return Rgenele[0+n*Rdim];}
00180 double GetGeneratedElectronVertexR(int& n) const {return Rgenele[4+n*Rdim];}
00181 double GetGeneratedElectronVertexCosTheta(int& n) const {return Rgenele[5+n*Rdim];}
00182 double GetGeneratedElectronVertexPhi(int& n) const {return Rgenele[6+n*Rdim];}
00183 double* const GetGeneratedElectronVertexXYZ() {return Rgenele+1;}
00184
00185 double GetGeneratedPositronTime(int& n) const {return Rgenpos[0+n*Rdim];}
00186 double GetGeneratedPositronVertexR(int& n) const {return Rgenpos[4+n*Rdim];}
00187 double GetGeneratedPositronVertexCosTheta(int& n) const {return Rgenpos[5+n*Rdim];}
00188 double GetGeneratedPositronVertexPhi(int& n) const {return Rgenpos[6+n*Rdim];}
00189 double* const GetGeneratedPositronVertexXYZ() {return Rgenpos+1;}
00190
00191 double GetGeneratedNeutronTime(int& n) const {return Rgenneu[0+n*Rdim];}
00192 double GetGeneratedNeutronVertexR(int& n) const {return Rgenneu[4+n*Rdim];}
00193 double GetGeneratedNeutronVertexCosTheta(int& n) const {return Rgenneu[5+n*Rdim];}
00194 double GetGeneratedNeutronVertexPhi(int& n) const {return Rgenneu[6+n*Rdim];}
00195 double* const GetGeneratedNeutronVertexXYZ() {return Rgenneu+1;}
00196
00197
00198 void SetPositronVertex(int& n,double* rpos){
00199 for(int i=0;i<Rdim;i++)Rpositron[i+n*Rdim]=*(rpos+(i+n*Rdim));}
00200
00201 void SetNeutronVertex(int& n,double* rneu){
00202 for(int i=0;i<Rdim;i++)Rneutron[i+n*Rdim]=*(rneu+(i+n*Rdim));}
00203
00204 private:
00205
00206 static ReactorConstants k;
00207
00208 int XCorder;
00209 double Emin;
00210 double Emax;
00211 double Rmaxgen;
00212 int Nevents;
00213
00214 int Nevent;
00215
00216 double XCWeight;
00217 double FluxWeight;
00218
00219 int Nnubar, Nneutron, Nelectron, Npositron, Ngamma;
00220
00221 double* Pnubar;
00222 double* Pneutron;
00223 double* Pelectron;
00224 double* Ppositron;
00225 double* Pgamma;
00226
00227 double* Rnubar;
00228 double* Rneutron;
00229 double* Rgenneu;
00230 double* Relectron;
00231 double* Rgenele;
00232 double* Rpositron;
00233 double* Rgenpos;
00234 double* Rgamma;
00235 };
00236 #endif