MarlinTPC  1.2.0
HitDistributor.h
1 #ifndef HITDISTRIBUTOR_H
2 #define HITDISTRIBUTOR_H 1
3 
4 //MARLINTPC
5 #include "TPCVoxel.h"
6 
7 //C++
8 #include <list>
9 #include <stdexcept>
10 
11 //LCIO
12 #include <EVENT/SimTrackerHit.h>
13 
14 //GEAR
15 #include <gearimpl/RectangularPadRowLayout.h>
16 #include <gearimpl/FixedPadSizeDiskLayout.h>
17 #include <gearimpl/GlobalPadIndex.h>
18 #include <gear/TPCParameters.h>
19 #include <gear/TPCModule.h>
20 
21 
22 namespace marlintpc{
23 
24 class GlobalPadIndex : public gear::GlobalPadIndex
25 {
26 public:
27  GlobalPadIndex(int padIndex, int moduleID)
28  :gear::GlobalPadIndex(padIndex, moduleID)
29  {}
30 
31  bool operator == (const GlobalPadIndex & cmp) const
32  {
33  return (_moduleID==cmp._moduleID && _padIndex==cmp._padIndex);
34  }
35 
36  inline void setPadIndex(int padindex){_padIndex = padindex;}
37  inline void setModuleID(int moduleID){_moduleID = moduleID;}
38 };
39 
40 
42 
43  public:
44 
47  HitDistributor(const gear::TPCParameters*, double zBinLength, double inductionFactor=0);
48 
52 
56  std::list<TPCVoxel> distributeHit(SimTrackerHit* hit, double sigmaTrans, double sigmaLong = 0);
57 
58  protected:
59 
62  std::list<GlobalPadIndex> getPads( double sigmaTrans );
63 
68  void getPadsOnTheLeft( std::list<GlobalPadIndex> & padList, GlobalPadIndex centerIndex, double sigmaTrans);
69  void getPadsOnTheRight( std::list<GlobalPadIndex> & padList, GlobalPadIndex centerIndex, double sigmaTrans );
70 
73  bool checkDistance( GlobalPadIndex globalPadIndex, double sigmaTrans );
74 
78  std::list<TPCVoxel> distributeHitOnPadsPolar( std::list<GlobalPadIndex> padIndexList, SimTrackerHit* hit, double sigmaTrans, double sigmaLong );
79  std::list<TPCVoxel> distributeHitOnPadsRect( std::list<GlobalPadIndex> padIndexList, SimTrackerHit* hit, double sigmaTrans, double sigmaLong );
80 
82  double CalculateGausIntegral(double sigma, double start, double end, double center);
84  void ApplyInduction(double hitTime, double sigmaLong,double charge,GlobalPadIndex gpadIndex, std::list<TPCVoxel> &voxelList);
86  void FillZBins(double hitTime, double sigmaLong,double charge,GlobalPadIndex padIndex, std::list<TPCVoxel> &voxelList );
87 
90  const gear::TPCParameters* _tpcParameters;
91 
94  double _zBinLength;
95 
99  double _sigmaTrans,_sigmaLong;
100 
103  double _c0Hit, _c1Hit;
104 
115 };
116 
117 } //end of namespace marlintpc
118 
119 
120 
121 #endif // HITDISTRIBUTOR_H
int _padLayoutType
Type of the pad layout.
Definition: HitDistributor.h:108
int _tpcCoordinateType
Type of the globale coordinate system for the TPC.
Definition: HitDistributor.h:111
void FillZBins(double hitTime, double sigmaLong, double charge, GlobalPadIndex padIndex, std::list< TPCVoxel > &voxelList)
Helper function to fill charge on pad in z bins.
Definition: HitDistributor.cc:460
void ApplyInduction(double hitTime, double sigmaLong, double charge, GlobalPadIndex gpadIndex, std::list< TPCVoxel > &voxelList)
Helper function to carry out induction of charge on neighbouring pads.
Definition: HitDistributor.cc:442
void getPadsOnTheLeft(std::list< GlobalPadIndex > &padList, GlobalPadIndex centerIndex, double sigmaTrans)
Called by getPads().
Definition: HitDistributor.cc:205
const gear::TPCParameters * _tpcParameters
Pointer on the gear pad layout.
Definition: HitDistributor.h:90
bool checkDistance(GlobalPadIndex globalPadIndex, double sigmaTrans)
Check if the distance between the input pad and the hit is within the distribution range...
Definition: HitDistributor.cc:186
double _sigmaTrans
Diffusion parameters.
Definition: HitDistributor.h:99
std::list< TPCVoxel > distributeHitOnPadsPolar(std::list< GlobalPadIndex > padIndexList, SimTrackerHit *hit, double sigmaTrans, double sigmaLong)
Distributes the charge of the hit on the pads in the input list by integration over a 2D gaussian...
Definition: HitDistributor.cc:349
Definition: HitDistributor.h:24
double _zBinLength
Initilazation parameter.
Definition: HitDistributor.h:94
std::list< GlobalPadIndex > getPads(double sigmaTrans)
Methods to determine the pads on which the charge of the hit is distributed on.
Definition: HitDistributor.cc:91
Definition: HitDistributor.h:41
double _c0Hit
Coordinates of the hit.
Definition: HitDistributor.h:103
std::list< TPCVoxel > distributeHit(SimTrackerHit *hit, double sigmaTrans, double sigmaLong=0)
Only function accessible from the outside.
Definition: HitDistributor.cc:30
double CalculateGausIntegral(double sigma, double start, double end, double center)
Helper function to perform integration of gaussian in 1D.
Definition: HitDistributor.cc:436
~HitDistributor()
Destructor.
Definition: HitDistributor.cc:25
HitDistributor(const gear::TPCParameters *, double zBinLength, double inductionFactor=0)
Constructors for the class.
Definition: HitDistributor.cc:15
double _inductionFactor
Size of induction on neighbour pads in percent of charge on central pad.
Definition: HitDistributor.h:114