00001 #ifndef MCPART_CC
00002 #define MCPART_CC
00003
00004 #include "mcpart.hh"
00005
00006 namespace larlight {
00007
00008 mcpart::mcpart(DATA::DATA_TYPE type) : data_base(type),
00009 ftrajectory(DATA::MCTrajectory),
00010 fpolarization(),
00011 fdaughters(),
00012 fGvtx(),
00013 ftrackFiducial()
00014 {
00015 if(_type!=DATA::MCParticle) {
00016
00017 Message::send(MSG::ERROR,__FUNCTION__,
00018 Form("Provided data type (%s) not supported! Reset to default.",DATA::DATA_TREE_NAME[_type].c_str()));
00019
00020 _type=DATA::MCParticle;
00021 }
00022
00023 clear_data();
00024
00025 }
00026
00027
00028 mcpart::mcpart(const Int_t trackId,
00029 const Int_t pdgid,
00030 const std::string process,
00031 const Int_t mother,
00032 const Double_t mass,
00033 const Int_t status)
00034 : data_base(DATA::MCParticle),
00035 ftrajectory(DATA::MCTrajectory),
00036 fpolarization(),
00037 fdaughters(),
00038 fGvtx(),
00039 ftrackFiducial()
00040
00041 {
00042 clear_data();
00043 ftrackId = trackId;
00044 fpdgCode = pdgid;
00045 fprocess = process;
00046 fmother = mother;
00047 fmass = mass;
00048 fstatus = status;
00049 }
00050
00051
00052 void mcpart::clear_data()
00053
00054 {
00055 data_base::clear_data();
00056 fstatus = DATA::INVALID_INT;
00057 ftrackId = DATA::INVALID_INT;
00058 fpdgCode = DATA::INVALID_INT;
00059 fmother = DATA::INVALID_INT;
00060 fprocess = "";
00061 ftrajectory.clear_data();
00062 fmass = DATA::INVALID_DOUBLE;
00063 fpolarization.Clear();
00064 fdaughters.clear();
00065 fWeight = DATA::INVALID_DOUBLE;
00066 fGvtx.Clear();
00067 ftrackFiducial.clear();
00068 }
00069
00070
00071 event_mcpart::event_mcpart(DATA::DATA_TYPE type) : std::vector<larlight::mcpart>(),
00072 event_base(type)
00073
00074 {
00075 if(_type!=DATA::MCParticle) {
00076
00077 Message::send(MSG::ERROR,__FUNCTION__,
00078 Form("Provided data type (%s) not supported! Reset to default.",DATA::DATA_TREE_NAME[_type].c_str()));
00079
00080 _type=DATA::MCParticle;
00081 }
00082
00083 clear_data();
00084 }
00085
00086 }
00087
00088 #endif