00001
00008 #include "RMCSecondary.hh"
00009 #include "RMCPMT.hh"
00010 #include "ReactorDetector.hh"
00011 #include "TObject.h"
00012
00013 ClassImp(RMCSecondary);
00014
00015 RMCSecondary::RMCSecondary() : TObject()
00016 {
00017
00018 fPMTs = new TObjArray(2000);
00019
00020 fNPMT = 0;
00021
00022 }
00023 RMCSecondary::RMCSecondary(ReactorDetector& Detector, int s) : TObject()
00024 {
00025 fPMTs = new TObjArray(2000);
00026
00027 fSecondaryType = s;
00028 std::string parent;
00029 if (fSecondaryType==0) {
00030 fNumPMTs = Detector.GetHitPMTsPos();
00031 parent = "P";
00032 }
00033 if (fSecondaryType==1) {
00034 fNumPMTs = Detector.GetHitPMTsNeu();
00035 parent = "N";
00036 }
00037 fNPMT = 0;
00038 int npmt=Detector.GetNpmt();
00039
00040
00041
00042 for(int pmtindex=0;pmtindex<npmt;pmtindex++)
00043 {
00044 int npe=0;
00045 int hits=0;
00046 double Q=0.;
00047 double Time=0.;
00048 double PH=0;
00049 double XYZpmt[3];
00050 for (int i=0;i<3;i++){
00051 XYZpmt[i]=0;
00052 }
00053 Detector.GetPMTdata(parent,pmtindex,XYZpmt,&hits,
00054 &PH,&Q,&Time,&npe);
00055 if (hits > 0){
00056 RMCPMT *pmt = new RMCPMT();
00057 fPMTs->AddAt(pmt,pmtindex);
00058 pmt->SetPMTid(pmtindex);
00059 pmt->SetPMTQ(Q);
00060 pmt->SetPMTtime(Time);
00061 pmt->SetPMTPH(PH);
00062 pmt->SetPMTnpe(npe);
00063 pmt->SetPMThits(hits);
00064 pmt->SetPMTxyz(XYZpmt);
00065 }
00066 }
00067 }
00068
00069
00070
00071 RMCSecondary::~RMCSecondary(){
00072
00073
00074 }