00001 00002 // File: FP420G4Hit.cc 00003 // Date: 02.2006 00004 // Description: Transient Hit class for the FP420 00006 #include "SimG4CMS/FP420/interface/FP420G4Hit.h" 00007 #include <iostream> 00008 00009 FP420G4Hit::FP420G4Hit():entry(0) { 00010 00011 entrylp(0); 00012 exitlp(0); 00013 elem = 0.; 00014 hadr = 0.; 00015 theIncidentEnergy = 0.; 00016 theTimeSlice = 0.; 00017 theTrackID = -1; 00018 theUnitID = 0; 00019 thePabs =0.; 00020 theTof=0. ; 00021 theEnergyLoss=0. ; 00022 theParticleType=0 ; 00023 theUnitID=0; 00024 theTrackID=-1; 00025 theThetaAtEntry=-10000. ; 00026 thePhiAtEntry=-10000. ; 00027 theParentId=0; 00028 00029 theX = 0.; 00030 theY = 0.; 00031 theZ = 0.; 00032 theVx = 0.; 00033 theVy = 0.; 00034 theVz = 0.; 00035 } 00036 00037 00038 FP420G4Hit::~FP420G4Hit(){} 00039 00040 00041 FP420G4Hit::FP420G4Hit(const FP420G4Hit &right) { 00042 theUnitID = right.theUnitID; 00043 00044 theTrackID = right.theTrackID; 00045 theTof = right.theTof ; 00046 theEnergyLoss = right.theEnergyLoss ; 00047 theParticleType = right.theParticleType ; 00048 thePabs = right.thePabs; 00049 elem = right.elem; 00050 hadr = right.hadr; 00051 theIncidentEnergy = right.theIncidentEnergy; 00052 theTimeSlice = right.theTimeSlice; 00053 entry = right.entry; 00054 entrylp = right.entrylp; 00055 exitlp = right.exitlp; 00056 theThetaAtEntry = right.theThetaAtEntry; 00057 thePhiAtEntry = right.thePhiAtEntry; 00058 theParentId = right.theParentId; 00059 00060 theX = right.theX; 00061 theY = right.theY; 00062 theZ = right.theZ; 00063 00064 theVx = right.theVx; 00065 theVy = right.theVy; 00066 theVz = right.theVz; 00067 00068 00069 } 00070 00071 00072 const FP420G4Hit& FP420G4Hit::operator=(const FP420G4Hit &right) { 00073 theUnitID = right.theUnitID; 00074 00075 theTrackID = right.theTrackID; 00076 theTof = right.theTof ; 00077 theEnergyLoss = right.theEnergyLoss ; 00078 theParticleType = right.theParticleType ; 00079 thePabs = right.thePabs; 00080 elem = right.elem; 00081 hadr = right.hadr; 00082 theIncidentEnergy = right.theIncidentEnergy; 00083 theTimeSlice = right.theTimeSlice; 00084 entry = right.entry; 00085 entrylp = right.entrylp; 00086 exitlp = right.exitlp; 00087 theThetaAtEntry = right.theThetaAtEntry; 00088 thePhiAtEntry = right.thePhiAtEntry; 00089 theParentId = right.theParentId; 00090 00091 theX = right.theX; 00092 theY = right.theY; 00093 theZ = right.theZ; 00094 00095 theVx = right.theVx; 00096 theVy = right.theVy; 00097 theVz = right.theVz; 00098 00099 00100 return *this; 00101 } 00102 00103 00104 void FP420G4Hit::addEnergyDeposit(const FP420G4Hit& aHit) { 00105 00106 elem += aHit.getEM(); 00107 hadr += aHit.getHadr(); 00108 } 00109 00110 00111 void FP420G4Hit::Print() { 00112 std::cout << (*this); 00113 } 00114 00115 G4ThreeVector FP420G4Hit::getEntry() const {return entry;} 00116 void FP420G4Hit::setEntry(G4ThreeVector xyz) { entry = xyz; } 00117 00118 G4ThreeVector FP420G4Hit::getEntryLocalP() const {return entrylp;} 00119 void FP420G4Hit::setEntryLocalP(G4ThreeVector xyz1) { entrylp = xyz1; } 00120 00121 G4ThreeVector FP420G4Hit::getExitLocalP() const {return exitlp;} 00122 void FP420G4Hit::setExitLocalP(G4ThreeVector xyz1) { exitlp = xyz1; } 00123 00124 double FP420G4Hit::getEM() const {return elem; } 00125 void FP420G4Hit::setEM (double e) { elem = e; } 00126 00127 double FP420G4Hit::getHadr() const {return hadr; } 00128 void FP420G4Hit::setHadr (double e) { hadr = e; } 00129 00130 double FP420G4Hit::getIncidentEnergy() const {return theIncidentEnergy; } 00131 void FP420G4Hit::setIncidentEnergy (double e){theIncidentEnergy = e; } 00132 00133 unsigned int FP420G4Hit::getTrackID() const {return theTrackID; } 00134 void FP420G4Hit::setTrackID (int i) { theTrackID = i; } 00135 00136 unsigned int FP420G4Hit::getUnitID() const {return theUnitID; } 00137 void FP420G4Hit::setUnitID (unsigned int i) { theUnitID = i; } 00138 00139 double FP420G4Hit::getTimeSlice() const {return theTimeSlice; } 00140 void FP420G4Hit::setTimeSlice (double d) { theTimeSlice = d; } 00141 int FP420G4Hit::getTimeSliceID() const {return (int)theTimeSlice;} 00142 00143 void FP420G4Hit::addEnergyDeposit(double em, double hd) 00144 {elem += em ; hadr += hd;} 00145 00146 double FP420G4Hit::getEnergyDeposit() const {return elem+hadr;} 00147 00148 float FP420G4Hit::getPabs() const {return thePabs;} 00149 float FP420G4Hit::getTof() const {return theTof;} 00150 float FP420G4Hit::getEnergyLoss() const {return theEnergyLoss;} 00151 int FP420G4Hit::getParticleType() const {return theParticleType;} 00152 00153 void FP420G4Hit::setPabs(float e) {thePabs = e;} 00154 void FP420G4Hit::setTof(float e) {theTof = e;} 00155 void FP420G4Hit::addEnergyLoss(float e) {theEnergyLoss += e;} 00156 void FP420G4Hit::setEnergyLoss(float e) {theEnergyLoss = e;} 00157 void FP420G4Hit::setParticleType(short i) {theParticleType = i;} 00158 00159 float FP420G4Hit::getThetaAtEntry() const {return theThetaAtEntry;} 00160 float FP420G4Hit::getPhiAtEntry() const{ return thePhiAtEntry;} 00161 00162 void FP420G4Hit::setThetaAtEntry(float t){theThetaAtEntry = t;} 00163 void FP420G4Hit::setPhiAtEntry(float f) {thePhiAtEntry = f ;} 00164 00165 float FP420G4Hit::getX() const{ return theX;} 00166 void FP420G4Hit::setX(float t){theX = t;} 00167 00168 float FP420G4Hit::getY() const{ return theY;} 00169 void FP420G4Hit::setY(float t){theY = t;} 00170 00171 float FP420G4Hit::getZ() const{ return theZ;} 00172 void FP420G4Hit::setZ(float t){theZ = t;} 00173 00174 int FP420G4Hit::getParentId() const {return theParentId;} 00175 void FP420G4Hit::setParentId(int p){theParentId = p;} 00176 00177 float FP420G4Hit::getVx() const{ return theVx;} 00178 void FP420G4Hit::setVx(float t){theVx = t;} 00179 00180 float FP420G4Hit::getVy() const{ return theVy;} 00181 void FP420G4Hit::setVy(float t){theVy = t;} 00182 00183 float FP420G4Hit::getVz() const{ return theVz;} 00184 void FP420G4Hit::setVz(float t){theVz = t;} 00185 00186 00187 00188 00189 00190 std::ostream& operator<<(std::ostream& os, const FP420G4Hit& hit) { 00191 os << " Data of this FP420G4Hit are:" << std::endl 00192 << " hitEntryLocalP: " << hit.getEntryLocalP() << std::endl 00193 << " hitExitLocalP: " << hit.getExitLocalP() << std::endl 00194 << " Time slice ID: " << hit.getTimeSliceID() << std::endl 00195 << " Time slice : " << hit.getTimeSlice() << std::endl 00196 << " Tof : " << hit.getTof() << std::endl 00197 << " EnergyDeposit = " << hit.getEnergyDeposit() << std::endl 00198 << " elmenergy = " << hit.getEM() << std::endl 00199 << " hadrenergy = " << hit.getHadr() << std::endl 00200 << " EnergyLoss = " << hit.getEnergyLoss() << std::endl 00201 << " ParticleType = " << hit.getParticleType() << std::endl 00202 << " ParticleType = " << hit.getParticleType() << std::endl 00203 << " Theta at Entry = " << hit.getThetaAtEntry() << std::endl 00204 << " Phi at Entry = " << hit.getPhiAtEntry() << std::endl 00205 << " X at Entry = " << hit.getX() << std::endl 00206 << " Y at Entry = " << hit.getY() << std::endl 00207 << " Z at Entry = " << hit.getZ() << std::endl 00208 << " VtxX = " << hit.getVx() << std::endl 00209 << " VtxY = " << hit.getVy() << std::endl 00210 << " VtxZ = " << hit.getVz() << std::endl 00211 << " parentID = " << hit.getParentId() << std::endl 00212 << " Pabs = " << hit.getPabs() << std::endl 00213 << " Energy of primary particle (ID = " << hit.getTrackID() 00214 << ") = " << hit.getIncidentEnergy() << " (MeV)"<<std::endl 00215 << " Entry point in FP420 unit number " << hit.getUnitID() 00216 << " is: " << hit.getEntry() << " (mm)" << std::endl; 00217 os << "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" 00218 << std::endl; 00219 return os; 00220 } 00221 00222