CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch13/src/SimG4CMS/Forward/src/BSCG4Hit.cc

Go to the documentation of this file.
00001 
00002 // File: BscG4Hit.cc
00003 // Date: 02.2006
00004 // Description: Transient Hit class for the Bsc
00006 #include "SimG4CMS/Forward/interface/BscG4Hit.h"
00007 #include <iostream>
00008 
00009 BscG4Hit::BscG4Hit():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 BscG4Hit::~BscG4Hit(){}
00039 
00040 
00041 BscG4Hit::BscG4Hit(const BscG4Hit &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 BscG4Hit& BscG4Hit::operator=(const BscG4Hit &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 BscG4Hit::addEnergyDeposit(const BscG4Hit& aHit) {
00105 
00106   elem += aHit.getEM();
00107   hadr += aHit.getHadr();
00108 }
00109 
00110 
00111 void BscG4Hit::Print() {
00112   std::cout << (*this);
00113 }
00114 
00115 G4ThreeVector   BscG4Hit::getEntry() const           {return entry;}
00116 void         BscG4Hit::setEntry(G4ThreeVector xyz)   { entry    = xyz; }
00117 
00118 G4ThreeVector    BscG4Hit::getEntryLocalP() const           {return entrylp;}
00119 void         BscG4Hit::setEntryLocalP(G4ThreeVector xyz1)   { entrylp    = xyz1; }
00120 
00121 G4ThreeVector     BscG4Hit::getExitLocalP() const           {return exitlp;}
00122 void         BscG4Hit::setExitLocalP(G4ThreeVector xyz1)   { exitlp    = xyz1; }
00123 
00124 double       BscG4Hit::getEM() const              {return elem; }
00125 void         BscG4Hit::setEM (double e)           { elem     = e; }
00126       
00127 double       BscG4Hit::getHadr() const            {return hadr; }
00128 void         BscG4Hit::setHadr (double e)         { hadr     = e; }
00129       
00130 double       BscG4Hit::getIncidentEnergy() const  {return theIncidentEnergy; }
00131 void         BscG4Hit::setIncidentEnergy (double e){theIncidentEnergy  = e; }
00132 
00133 G4int          BscG4Hit::getTrackID() const         {return theTrackID; }
00134 void         BscG4Hit::setTrackID (int i)         { theTrackID = i; }
00135 
00136 unsigned int BscG4Hit::getUnitID() const          {return theUnitID; }
00137 void         BscG4Hit::setUnitID (unsigned int i) { theUnitID = i; }
00138 
00139 double       BscG4Hit::getTimeSlice() const       {return theTimeSlice; }
00140 void         BscG4Hit::setTimeSlice (double d)    { theTimeSlice = d; }
00141 int          BscG4Hit::getTimeSliceID() const     {return (int)theTimeSlice;}
00142 
00143 void         BscG4Hit::addEnergyDeposit(double em, double hd)
00144                                                    {elem  += em ; hadr += hd;}
00145 
00146 double       BscG4Hit::getEnergyDeposit() const   {return elem+hadr;}
00147 
00148 float BscG4Hit::getPabs() const {return thePabs;}
00149 float BscG4Hit::getTof() const {return theTof;}
00150 float BscG4Hit::getEnergyLoss() const {return theEnergyLoss;}
00151 int BscG4Hit::getParticleType() const {return theParticleType;}
00152 
00153 void BscG4Hit::setPabs(float e) {thePabs = e;}
00154 void BscG4Hit::setTof(float e) {theTof = e;}
00155 void BscG4Hit::setEnergyLoss(float e) {theEnergyLoss = e;}
00156 void BscG4Hit::setParticleType(short i) {theParticleType = i;}
00157 
00158 float BscG4Hit::getThetaAtEntry() const {return theThetaAtEntry;}   
00159 float BscG4Hit::getPhiAtEntry() const{ return thePhiAtEntry;}
00160 
00161 void BscG4Hit::setThetaAtEntry(float t){theThetaAtEntry = t;}
00162 void BscG4Hit::setPhiAtEntry(float f) {thePhiAtEntry = f ;}
00163 
00164 float BscG4Hit::getX() const{ return theX;}
00165 void BscG4Hit::setX(float t){theX = t;}
00166 
00167 float BscG4Hit::getY() const{ return theY;}
00168 void BscG4Hit::setY(float t){theY = t;}
00169 
00170 float BscG4Hit::getZ() const{ return theZ;}
00171 void BscG4Hit::setZ(float t){theZ = t;}
00172 
00173 int BscG4Hit::getParentId() const {return theParentId;}
00174 void BscG4Hit::setParentId(int p){theParentId = p;}
00175 
00176 float BscG4Hit::getVx() const{ return theVx;}
00177 void BscG4Hit::setVx(float t){theVx = t;}
00178 
00179 float BscG4Hit::getVy() const{ return theVy;}
00180 void BscG4Hit::setVy(float t){theVy = t;}
00181 
00182 float BscG4Hit::getVz() const{ return theVz;}
00183 void BscG4Hit::setVz(float t){theVz = t;}
00184 
00185 
00186 
00187 
00188 
00189 std::ostream& operator<<(std::ostream& os, const BscG4Hit& hit) {
00190   os << " Data of this BscG4Hit are:" << std::endl
00191      << " hitEntryLocalP: " << hit.getEntryLocalP() << std::endl
00192      << " hitExitLocalP: " << hit.getExitLocalP() << std::endl
00193      << " Time slice ID: " << hit.getTimeSliceID() << std::endl
00194      << " Time slice : " << hit.getTimeSlice() << std::endl
00195      << " Tof : " << hit.getTof() << std::endl
00196      << " EnergyDeposit = " << hit.getEnergyDeposit() << std::endl
00197      << " elmenergy = " << hit.getEM() << std::endl
00198      << " hadrenergy = " << hit.getHadr() << std::endl
00199      << " EnergyLoss = " << hit.getEnergyLoss() << std::endl
00200      << " ParticleType = " << hit.getParticleType() << std::endl
00201      << " Pabs = " << hit.getPabs() << std::endl
00202      << " Energy of primary particle (ID = " << hit.getTrackID()
00203      << ") = " << hit.getIncidentEnergy() << " (MeV)"<<std::endl
00204      << " Entry point in Bsc unit number " << hit.getUnitID()
00205      << " is: " << hit.getEntry() << " (mm)" << std::endl;
00206   os << "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
00207      << std::endl;
00208   return os;
00209 
00210 }
00211 
00212