/scratch0/jsnuveri/BDSIM/BDSIMgit/bdsim/include/BDSEnergyCounterHit.hh

00001 /* BDSIM code.    Version 1.0
00002    Author: Grahame A. Blair, Royal Holloway, Univ. of London.
00003    Last modified 24.7.2002
00004    Copyright (c) 2002 by G.A.Blair.  ALL RIGHTS RESERVED. 
00005 */
00006 
00007 #ifndef BDSEnergyCounterHit_h
00008 #define BDSEnergyCounterHit_h 1
00009 
00010 #include "G4VHit.hh"
00011 #include "G4THitsCollection.hh"
00012 #include "G4Allocator.hh"
00013 #include "G4ThreeVector.hh"
00014 
00015 //LowestSPosPrimaryHit declaration at the bottom of this file
00016 //HighestSPosPrimaryHit declaration at the bottom of this file
00017 
00018 class BDSEnergyCounterHit :public G4VHit
00019 {
00020 public:
00021   BDSEnergyCounterHit(G4int    nCopyIn = 0, 
00022                       G4double energyIn = 0, 
00023                       G4double XIn = 0, 
00024                       G4double YIn = 0, 
00025                       G4double ZIn = 0,
00026                       G4double SIn = 0,
00027                       G4double xIn = 0,
00028                       G4double yIn = 0,
00029                       G4double zIn = 0,
00030                       G4String nameIn = "", 
00031                       G4int    partIDIn = 0, 
00032                       G4double weightIn = 1, 
00033                       G4bool   precisionRegionIn = false, 
00034                       G4int    turnsTakenIn = 1,
00035                       G4int    eventNoIn = 0
00036                       );
00037 
00038   ~BDSEnergyCounterHit();
00039   
00040   inline void* operator new(size_t) ;
00041   inline void operator delete(void *aHit);
00042 
00043   inline G4double GetEnergy();
00044   inline G4int    GetCopyNumber();
00045   inline G4String GetName();
00046   inline void     SetEnergy(G4double energyIn);
00047   inline void     AddEnergy(G4double EnergyIn, G4double weightIn);
00048   inline void     AddEnergyWeightedPosition(G4double energyIn, 
00049                                             G4double XIn, 
00050                                             G4double YIn,
00051                                             G4double ZIn, 
00052                                             G4double SIn,
00053                                             G4double weightIn);
00054   inline G4double GetX(); 
00055   inline G4double GetY();
00056   inline G4double GetZ(); 
00057   inline G4double GetS();
00058   inline G4double Getx(); 
00059   inline G4double Gety();
00060   inline G4double Getz(); 
00061   inline G4double GetEnergyWeightedY(); 
00062   inline G4double GetEnergyWeightedZ(); 
00063   inline G4double GetEnergyWeightedX();
00064   inline G4double GetEnergyWeightedS();
00065   inline G4int    GetPartID();
00066   inline void     SetPartID(G4int partIDIn);
00067   inline G4double GetWeight(); 
00068   inline void     SetWeight(G4double weightIn);
00069   inline G4bool   GetPrecisionRegion();
00070   inline void     SetPrecisionRegion(G4bool precisionRegionIn);
00071   inline G4int    GetTurnsTaken();
00072   inline void     SetTurnsTaken(G4int turnstakenIn);
00073   inline G4int    GetEventNo();
00074   inline void     SetEventNo(G4int eventNoIn);
00075   
00076 private:
00078   BDSEnergyCounterHit();
00079 
00080   G4double energy;
00081   G4double energyWeightedX;
00082   G4double energyWeightedY;
00083   G4double energyWeightedZ;
00084   G4double energyWeightedS;
00085   // global coordinates
00086   G4double X;
00087   G4double Y;
00088   G4double Z;
00089   G4double S;
00090   // local coordinates
00091   G4double x;
00092   G4double y;
00093   G4double z;
00094   G4double weight;
00095   G4int    copyNumber;
00096   G4int    partID;
00097   G4String name;
00098   G4bool   precisionRegion; //Whether or not the hit is in the precision region
00099   G4int    turnsTaken;
00100   G4int    eventNo;
00101 };
00102 
00103 inline G4double BDSEnergyCounterHit::GetEnergy()
00104 {return energy;}
00105 
00106 inline G4double BDSEnergyCounterHit::GetX()
00107 {return X;}
00108 
00109 inline G4double BDSEnergyCounterHit::GetY()
00110 {return Y;}
00111 
00112 inline G4double BDSEnergyCounterHit::GetZ()
00113 {return Z;}
00114 
00115 inline G4double BDSEnergyCounterHit::GetS()
00116 {return S;}
00117 
00118 inline G4double BDSEnergyCounterHit::Getx()
00119 {return x;}
00120 
00121 inline G4double BDSEnergyCounterHit::Gety()
00122 {return y;}
00123 
00124 inline G4double BDSEnergyCounterHit::Getz()
00125 {return z;}
00126 
00127 inline G4double BDSEnergyCounterHit::GetEnergyWeightedX()
00128 {return energyWeightedX;}
00129 
00130 inline G4double BDSEnergyCounterHit::GetEnergyWeightedY()
00131 {return energyWeightedY;}
00132 
00133 inline G4double BDSEnergyCounterHit::GetEnergyWeightedZ()
00134 {return energyWeightedZ;}
00135 
00136 inline G4double BDSEnergyCounterHit::GetEnergyWeightedS()
00137 {return energyWeightedS;}
00138 
00139 inline G4double BDSEnergyCounterHit::GetWeight()
00140 {return weight;}
00141 
00142 inline G4int BDSEnergyCounterHit::GetCopyNumber()
00143 {return copyNumber;}
00144 
00145 inline G4int BDSEnergyCounterHit::GetPartID()
00146 {return partID;}
00147 
00148 inline G4String BDSEnergyCounterHit::GetName()
00149 {return name;}
00150 
00151 inline void BDSEnergyCounterHit::SetEnergy(G4double energyIn)
00152 {energy = energyIn;}   
00153 
00154 inline void BDSEnergyCounterHit::AddEnergy(G4double energyIn, G4double weightIn)
00155 {energy += energyIn * weightIn;}   
00156 
00157 inline void BDSEnergyCounterHit::AddEnergyWeightedPosition(G4double energyIn,
00158                                                            G4double XIn,
00159                                                            G4double YIn,
00160                                                            G4double ZIn,
00161                                                            G4double SIn,
00162                                                            G4double weightIn)
00163 {
00164   energyWeightedX += energyIn * XIn * weightIn;
00165   energyWeightedY += energyIn * YIn * weightIn;
00166   energyWeightedZ += energyIn * ZIn * weightIn;
00167   energyWeightedS += energyIn * SIn * weightIn;
00168   energy          += energyIn * weightIn;
00169 }
00170 
00171 inline G4bool BDSEnergyCounterHit::GetPrecisionRegion()
00172 {return precisionRegion;}
00173 
00174 inline void BDSEnergyCounterHit::SetPrecisionRegion(G4bool precisionRegionIn)
00175 {precisionRegion = precisionRegionIn;}
00176 
00177 inline G4int BDSEnergyCounterHit::GetTurnsTaken()
00178 {return turnsTaken;}
00179 
00180 inline void  BDSEnergyCounterHit::SetTurnsTaken(G4int turnstakenIn)
00181 {turnsTaken = turnstakenIn;}
00182 
00183 inline G4int BDSEnergyCounterHit::GetEventNo()
00184 {return eventNo;}
00185 
00186 inline void BDSEnergyCounterHit::SetEventNo(G4int eventNoIn)
00187 {eventNo = eventNoIn;}
00188 
00189 typedef G4THitsCollection<BDSEnergyCounterHit> BDSEnergyCounterHitsCollection;
00190 extern G4Allocator<BDSEnergyCounterHit> BDSEnergyCounterHitAllocator;
00191 
00192 inline void* BDSEnergyCounterHit::operator new(size_t)
00193 {
00194   void* aHit;
00195   aHit=(void*) BDSEnergyCounterHitAllocator.MallocSingle();
00196   return aHit;
00197 }
00198 
00199 inline void BDSEnergyCounterHit::operator delete(void *aHit)
00200 {
00201  BDSEnergyCounterHitAllocator.FreeSingle((BDSEnergyCounterHit*) aHit);
00202 }
00203 
00204 
00205 namespace BDS {
00206   BDSEnergyCounterHit* LowestSPosPrimaryHit (BDSEnergyCounterHitsCollection* HC);
00207   BDSEnergyCounterHit* HighestSPosPrimaryHit(BDSEnergyCounterHitsCollection* HC);
00208 }
00209 
00210 #endif
00211 

Generated on 28 Jun 2015 for BDSIM by  doxygen 1.4.7