CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch12/src/SimG4CMS/Forward/src/TotemG4Hit.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 // Package:     Forward
00004 // Class  :     TotemG4Hit
00005 //
00006 // Implementation:
00007 //     <Notes on implementation>
00008 //
00009 // Original Author: 
00010 //         Created:  Tue May 16 10:14:34 CEST 2006
00011 // $Id: TotemG4Hit.cc,v 1.3 2007/11/20 12:37:21 fabiocos Exp $
00012 //
00013 
00014 // system include files
00015 
00016 // user include files
00017 #include "SimG4CMS/Forward/interface/TotemG4Hit.h"
00018 
00019 //
00020 // constructors and destructor
00021 //
00022 
00023 TotemG4Hit::TotemG4Hit(){
00024 
00025   setEntry(0.,0.,0.);
00026   theEntryPoint.SetCoordinates(0.,0.,0.);
00027   theExitPoint.SetCoordinates(0.,0.,0.);
00028 
00029   elem              = 0.;
00030   hadr              = 0.;
00031   theIncidentEnergy = 0.;
00032   theTrackID        = -1;
00033   theUnitID         =  0;
00034   theTimeSlice      = 0.;
00035 
00036   theX              = 0.;
00037   theY              = 0.;
00038   theZ              = 0.;
00039   thePabs           = 0.;
00040   theTof            = 0.;
00041   theEnergyLoss     = 0.;
00042   theParticleType   = 0;
00043   theThetaAtEntry   = 0.;
00044   thePhiAtEntry     = 0.;
00045   theParentId       = 0;
00046   theVx             = 0.;
00047   theVy             = 0.;
00048   theVz             = 0.;
00049 }
00050 
00051 TotemG4Hit::~TotemG4Hit() {}
00052 
00053 TotemG4Hit::TotemG4Hit(const TotemG4Hit &right) {
00054 
00055   entry             = right.entry;
00056   elem              = right.elem;
00057   hadr              = right.hadr;
00058   theIncidentEnergy = right.theIncidentEnergy;
00059   theTrackID        = right.theTrackID;
00060   theUnitID         = right.theUnitID;
00061   theTimeSlice      = right.theTimeSlice;
00062 
00063   theX              = right.theX;
00064   theY              = right.theY;
00065   theZ              = right.theZ;
00066   thePabs           = right.thePabs;
00067   theTof            = right.theTof;
00068   theEnergyLoss     = right.theEnergyLoss;
00069   theParticleType   = right.theParticleType;
00070 
00071   theThetaAtEntry   = right.theThetaAtEntry;
00072   thePhiAtEntry     = right.thePhiAtEntry;
00073   theEntryPoint     = right.theEntryPoint;
00074   theExitPoint      = right.theExitPoint;
00075   theParentId       = right.theParentId;
00076   theVx             = right.theVx;
00077   theVy             = right.theVy;
00078   theVz             = right.theVz;
00079 }
00080 
00081 
00082 const TotemG4Hit& TotemG4Hit::operator=(const TotemG4Hit &right) {
00083 
00084   entry             = right.entry;
00085   elem              = right.elem;
00086   hadr              = right.hadr;
00087   theIncidentEnergy = right.theIncidentEnergy;
00088   theTrackID        = right.theTrackID;
00089   theUnitID         = right.theUnitID;
00090   theTimeSlice      = right.theTimeSlice;
00091  
00092   theX              = right.theX;
00093   theY              = right.theY;
00094   theZ              = right.theZ;
00095   thePabs           = right.thePabs;
00096   theTof            = right.theTof ;
00097   theEnergyLoss     = right.theEnergyLoss   ;
00098   theParticleType   = right.theParticleType ;
00099 
00100   theThetaAtEntry   = right.theThetaAtEntry;
00101   thePhiAtEntry     = right.thePhiAtEntry;
00102   theEntryPoint     = right.theEntryPoint;
00103   theExitPoint      = right.theExitPoint;
00104   theParentId       = right.theParentId;
00105   theVx             = right.theVx;
00106   theVy             = right.theVy;
00107   theVz             = right.theVz;
00108 
00109   return *this;
00110 }
00111 
00112 void TotemG4Hit::addEnergyDeposit(const TotemG4Hit& aHit) {
00113 
00114   elem += aHit.getEM();
00115   hadr += aHit.getHadr();
00116 }
00117 
00118 
00119 void TotemG4Hit::Print() {
00120   std::cout << (*this);
00121 }
00122 
00123 
00124 math::XYZPoint TotemG4Hit::getEntry() const           {return entry;}
00125 
00126 double     TotemG4Hit::getEM() const              {return elem; }
00127 void       TotemG4Hit::setEM (double e)           { elem     = e; }
00128       
00129 double     TotemG4Hit::getHadr() const            {return hadr; }
00130 void       TotemG4Hit::setHadr (double e)         { hadr     = e; }
00131       
00132 double     TotemG4Hit::getIncidentEnergy() const  {return theIncidentEnergy; }
00133 void       TotemG4Hit::setIncidentEnergy(double e) {theIncidentEnergy  = e; }
00134 
00135 int        TotemG4Hit::getTrackID() const         {return theTrackID; }
00136 void       TotemG4Hit::setTrackID (int i)         { theTrackID = i; }
00137 
00138 uint32_t   TotemG4Hit::getUnitID() const          {return theUnitID; }
00139 void       TotemG4Hit::setUnitID (uint32_t i)     { theUnitID = i; }
00140 
00141 double     TotemG4Hit::getTimeSlice() const       {return theTimeSlice; }
00142 void       TotemG4Hit::setTimeSlice (double d)    { theTimeSlice = d; }
00143 int        TotemG4Hit::getTimeSliceID() const     {return (int)theTimeSlice;}
00144 
00145 void       TotemG4Hit::addEnergyDeposit(double em, double hd) {elem += em;  hadr += hd;}
00146 
00147 double     TotemG4Hit::getEnergyDeposit() const   {return elem+hadr;}
00148 
00149 float      TotemG4Hit::getPabs() const            {return thePabs;}
00150 float      TotemG4Hit::getTof() const             {return theTof;}
00151 float      TotemG4Hit::getEnergyLoss() const      {return theEnergyLoss;}
00152 int        TotemG4Hit::getParticleType() const    {return theParticleType;}
00153 
00154 void       TotemG4Hit::setPabs(float e)           {thePabs = e;}
00155 void       TotemG4Hit::setTof(float e)            {theTof = e;}
00156 void       TotemG4Hit::setEnergyLoss(float e)     {theEnergyLoss = e;}
00157 void       TotemG4Hit::setParticleType(short i)   {theParticleType = i;}
00158 
00159 float      TotemG4Hit::getThetaAtEntry() const    {return theThetaAtEntry;}   
00160 float      TotemG4Hit::getPhiAtEntry() const      {return thePhiAtEntry;}
00161 
00162 void       TotemG4Hit::setThetaAtEntry(float t)   {theThetaAtEntry = t;}
00163 void       TotemG4Hit::setPhiAtEntry(float f)     {thePhiAtEntry = f ;}
00164 
00165 float      TotemG4Hit::getX() const               {return theX;}
00166 void       TotemG4Hit::setX(float t)              {theX = t;}
00167 
00168 float      TotemG4Hit::getY() const               {return theY;}
00169 void       TotemG4Hit::setY(float t)              {theY = t;}
00170 
00171 float      TotemG4Hit::getZ() const               {return theZ;}
00172 void       TotemG4Hit::setZ(float t)              {theZ = t;}
00173 
00174 int        TotemG4Hit::getParentId() const        {return theParentId;}
00175 void       TotemG4Hit::setParentId(int p)         {theParentId = p;}
00176 
00177 float      TotemG4Hit::getVx() const              {return theVx;}
00178 void       TotemG4Hit::setVx(float t)             {theVx = t;}
00179 
00180 float      TotemG4Hit::getVy() const              {return theVy;}
00181 void       TotemG4Hit::setVy(float t)             {theVy = t;}
00182 
00183 float      TotemG4Hit::getVz() const              {return theVz;}
00184 void       TotemG4Hit::setVz(float t)             {theVz = t;}
00185 
00186 std::ostream& operator<<(std::ostream& os, const TotemG4Hit& hit) {
00187   os << " Data of this TotemG4Hit are:\n" 
00188      << " Time slice ID: " << hit.getTimeSliceID() << "\n"
00189      << " EnergyDeposit = " << hit.getEnergyLoss() << "\n"
00190      << " Energy of primary particle (ID = " << hit.getTrackID()
00191      << ") = " << hit.getIncidentEnergy() << " (MeV)" << "\n"
00192      << " Entry point in Totem unit number " << hit.getUnitID()
00193      << " is: " << hit.getEntry() << " (mm)" << "\n"
00194      << "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n";
00195   return os;
00196 }
00197 
00198