MarlinTPC  1.2.0
PadResponseFunctionGEM.h
1 #ifndef PRFGEM_H
2 #define PRFGEM_H 1
3 
4 //LCIO
5 #include "lcio.h"
6 #include <EVENT/TrackerHit.h>
7 #include <EVENT/Track.h>
8 
9 // GEAR
10 #include <gear/TPCParameters.h>
11 
12 //ROOT
13 #include "TGraph.h"
14 #include "TF1.h"
15 
16 
17 namespace marlintpc
18 {
28 {
29  public:
31  PadResponseFunctionGEM(double defocussing, double diffusion, const gear::TPCParameters& gearparameter);
33  bool EvaluateHit(lcio::TrackerHit *hit, lcio::Track *track=NULL);
35  double* GetPRFPosition();
37  double GetPRFCharge(){return _charge;}
39  double GetPRFChargeError(){return _chargeErr;}
41  bool GetPRFSucceeded(){return _fitOK;}
43  void SetPRCOnly(int value){_PRConly=value;}
44 
45 
46  protected:
50  void CalculateFixedWidth(lcio::TrackerHit *hit, lcio::Track *track=NULL);
52  void PrepareHitData(lcio::TrackerHit *hit);
54  void FitPRF(lcio::TrackerHit *hit, bool fixCharge=false);
56  void CalculatePRC(lcio::TrackerHit *hit);
58  void KeepCentreOfGravityInfo(lcio::TrackerHit *hit);
59 
60 
62  double _defocussing;
64  double _diffusion;
66  double _fixedWidth;
68  double _position;
70  double _positionRow;
72  double _prfpos[2];
76  double _charge;
77  double _chargeErr;
79  bool _status;
81  bool _fitOK;
83  TGraph *_graph;
85  double _maxCharge;
87  double _maxPos;
89  double _min,_max;
91  const gear::TPCParameters& _tpcParameters;
93  TF1 *_PRFShift;
95  TF1 *_PRF;
97  int _PRConly;
98 
99 };
100 
101 }// namespace marlintpc
102 #endif
bool _status
status of prf evaluation, true if fits have worked
Definition: PadResponseFunctionGEM.h:79
double _maxCharge
max charge filled in graph
Definition: PadResponseFunctionGEM.h:85
bool _fitOK
status of prf fit
Definition: PadResponseFunctionGEM.h:81
bool GetPRFSucceeded()
Option to check if the fit failed. A way to distinguish between the reseon the PRF was not used...
Definition: PadResponseFunctionGEM.h:41
const gear::TPCParameters & _tpcParameters
access to gear information
Definition: PadResponseFunctionGEM.h:91
double _charge
charge of the hit as given by the integral
Definition: PadResponseFunctionGEM.h:76
double _position
position of the hit along the row in global coordinates
Definition: PadResponseFunctionGEM.h:68
void CalculatePRC(lcio::TrackerHit *hit)
calculate only a position correction for the center of gravity based on parametrisation ...
Definition: PadResponseFunctionGEM.cc:218
PadResponseFunctionGEM(double defocussing, double diffusion, const gear::TPCParameters &gearparameter)
The constructor.
Definition: PadResponseFunctionGEM.cc:29
void SetPRCOnly(int value)
Option to check if the fit failed. A way to distinguish between the reseon the PRF was not used...
Definition: PadResponseFunctionGEM.h:43
void PrepareHitData(lcio::TrackerHit *hit)
prepare hit data, transfer info to fit object
Definition: PadResponseFunctionGEM.cc:115
double _min
range of graph
Definition: PadResponseFunctionGEM.h:89
int _PRConly
Switch to disable the fitting, just do the calculation of a correction (like in MultiFit) ...
Definition: PadResponseFunctionGEM.h:97
Functionality to evaluate the pad response function for a hit.
Definition: PadResponseFunctionGEM.h:27
double _prfpos[2]
position to give back
Definition: PadResponseFunctionGEM.h:72
TGraph * _graph
object for fitting or calculation in local coordinates
Definition: PadResponseFunctionGEM.h:83
double _positionRow
position of the row of the hit in global coordinates, unaffected by PRF fit
Definition: PadResponseFunctionGEM.h:70
void FitPRF(lcio::TrackerHit *hit, bool fixCharge=false)
Carry out the fit.
Definition: PadResponseFunctionGEM.cc:168
double GetPRFCharge()
Hit charge given by the integral of the PRF.
Definition: PadResponseFunctionGEM.h:37
double _maxPos
max position in graph
Definition: PadResponseFunctionGEM.h:87
double _defocussing
First paramter for the parametrisation of expected width: diffusion within gem stack sigma_0^2 [mm^2]...
Definition: PadResponseFunctionGEM.h:62
double _positionRowLocal
position of the row of the hit in local coordinates, unaffected by PRF fit
Definition: PadResponseFunctionGEM.h:74
bool EvaluateHit(lcio::TrackerHit *hit, lcio::Track *track=NULL)
returns true if a PRF correction was applied, returns false if KeepCentreOfGravityInfo was used ...
Definition: PadResponseFunctionGEM.cc:45
void CalculateFixedWidth(lcio::TrackerHit *hit, lcio::Track *track=NULL)
Calculate the width to be fixed for the PRF fit from information from the hit and/or track based on a...
Definition: PadResponseFunctionGEM.cc:97
void KeepCentreOfGravityInfo(lcio::TrackerHit *hit)
In case a PRF is not needed we keep the information of the original hit via the centre of gravity...
Definition: PadResponseFunctionGEM.cc:284
double _fixedWidth
width for the gaussian fit
Definition: PadResponseFunctionGEM.h:66
double * GetPRFPosition()
PRF improved position in global coordinates. PRF acts in rphi or xy not in z, so this is a 2D positio...
Definition: PadResponseFunctionGEM.cc:294
double GetPRFChargeError()
Error on the hit charge.
Definition: PadResponseFunctionGEM.h:39
TF1 * _PRFShift
prf parametrisation for flat region
Definition: PadResponseFunctionGEM.h:93
double _diffusion
Second paramter for the parametrisation of expected width: diffusion in drift region D^2 [mm]...
Definition: PadResponseFunctionGEM.h:64
TF1 * _PRF
prf parametrisation
Definition: PadResponseFunctionGEM.h:95