FairRoot/PandaRoot
Public Member Functions | Private Member Functions | Private Attributes | List of all members
PndMvdCalcTot Class Reference

Class to calculate the time over threshold. More...

#include <PndMvdCalcTot.h>

Public Member Functions

 PndMvdCalcTot ()
 Default constructor. More...
 
 PndMvdCalcTot (Double_t tr, Double_t a, Double_t threshold, Double_t clockfrequency)
 Main constructor. More...
 
 ~PndMvdCalcTot ()
 Destructor. More...
 
void SetStartOffset ()
 
Double_t GetTot (Double_t fcharge)
 
void SetParameter (Double_t tr, Double_t a, Double_t threshold)
 
Double_t GetPileUpTime (Double_t fcharge)
 

Private Member Functions

Double_t GetTotWC ()
 

Private Attributes

Double_t fthreshold
 
Double_t ftr
 
Double_t fa
 
Double_t Q
 
Double_t Qt
 
Double_t t1e
 
Double_t t2e
 
Double_t fclockfrequency
 
Double_t ftimestep
 
Double_t fstarttime
 
Double_t fstoptime
 
Double_t ftimeoffset
 
TRandom2 fRand
 

Detailed Description

Class to calculate the time over threshold.

Author
D.-L.Pohl d.poh.nosp@m.l@fz.nosp@m.-juel.nosp@m.ich..nosp@m.de

This class calculates the time over threshold by using the charge of a pixel/strip. To calculate the TOT a simple capacitor model (integrator) is used. The rising time tr [ns] is assumed ti be constant. This leads to a rising straight line. A constant current unloads the capacitor with a ratio of: a [e/ns]. The distance between the points of intersection between the resulting triangle and the threshold line is the TOT.

q | | /\ a | / \ |—/-------—------------— threshold | / \ ----------------------------— q = 0 (charge) | tr| t[ns] <- TOT ->

Definition at line 31 of file PndMvdCalcTot.h.

Constructor & Destructor Documentation

PndMvdCalcTot::PndMvdCalcTot ( )
inline

Default constructor.

Definition at line 35 of file PndMvdCalcTot.h.

References fa, fclockfrequency, fthreshold, ftimestep, ftr, and SetStartOffset().

35  {
36  ftr = 100.;
37  fa = 60.;
38  fthreshold = 3000;
39  fclockfrequency = 50.;
40  ftimestep = 1. / fclockfrequency * 1000.;
42  std::cout<<"-I- <PndMvdCalcTot::PndMvdCalcTot()>: default constructor used!"<<std::endl;
43  };
Double_t fclockfrequency
Definition: PndMvdCalcTot.h:70
Double_t ftimestep
Definition: PndMvdCalcTot.h:71
Double_t fthreshold
Definition: PndMvdCalcTot.h:65
Double_t ftr
Definition: PndMvdCalcTot.h:66
void SetStartOffset()
PndMvdCalcTot::PndMvdCalcTot ( Double_t  tr,
Double_t  a,
Double_t  threshold,
Double_t  clockfrequency 
)
inline

Main constructor.

Definition at line 46 of file PndMvdCalcTot.h.

References a, fa, fclockfrequency, fthreshold, ftimestep, ftr, SetStartOffset(), threshold, and tr.

46  {
47  ftr = tr;
48  fa = a;
50  fclockfrequency = clockfrequency;
51  ftimestep = 1. / fclockfrequency * 1000.;
53  };
Double_t fclockfrequency
Definition: PndMvdCalcTot.h:70
Double_t ftimestep
Definition: PndMvdCalcTot.h:71
Double_t fthreshold
Definition: PndMvdCalcTot.h:65
Int_t a
Definition: anaLmdDigi.C:126
Double_t ftr
Definition: PndMvdCalcTot.h:66
double threshold
void SetStartOffset()
PndMvdCalcTot::~PndMvdCalcTot ( )
inline

Destructor.

Definition at line 56 of file PndMvdCalcTot.h.

56 {};

Member Function Documentation

Double_t PndMvdCalcTot::GetPileUpTime ( Double_t  fcharge)

Definition at line 58 of file PndMvdCalcTot.cxx.

References fa, and ftr.

58  { //returns the time the detector is not sensitive for other events
59  return (ftr + fcharge / fa);
60 }
Double_t ftr
Definition: PndMvdCalcTot.h:66
Double_t PndMvdCalcTot::GetTot ( Double_t  fcharge)

Definition at line 3 of file PndMvdCalcTot.cxx.

References fa, fthreshold, ftimeoffset, ftr, GetTotWC(), Q, Qt, t1e, and t2e.

3  { //returns the TOT in ns
4  if (fa <= 0){
5  std::cout<<"-W- <PndMvdCalcTot::GetTot(Double_t fcharge)>: falling ration is less or equal zero -> now set to 60 e/ns"<<std::endl;
6  fa = 60.;
7  }
8 
9  Q = fcharge;
10  Qt = fthreshold;
11 
12 //Error handling: if there is a parameter leading to a division by zero Q=Qt=1 is set to prevent this
13 
14  if (Qt < 0){
15  std::cout<<"-W- <PndMvdCalcTot::GetTot(Double_t fcharge)>: threshold is less than zero -> now set to 0 eV"<<std::endl;
16  Qt = 0.;
17  }
18 
19  if ((Q <= Qt) or (Q <= 0)){
20  std::cout<<"-W- <PndMvdCalcTot::GetTot(Double_t fcharge)>: charge is equal or less than threshold -> zero TOT"<<std::endl;
21  Q = 1.;
22  Qt = 1.;
23  }
24 
25  t1e = (ftr*Qt/Q+ftimeoffset); //exact time when signal is over threshold
26  t2e = (Q-Qt)/fa+ftimeoffset+ftr; //exact time when signal is again below threshold
27 
28  //return (t2e-t1e); //turn off clock
29  return GetTotWC();
30 }
Double_t t2e
Definition: PndMvdCalcTot.h:69
Double_t fthreshold
Definition: PndMvdCalcTot.h:65
Double_t t1e
Definition: PndMvdCalcTot.h:69
Double_t ftimeoffset
Definition: PndMvdCalcTot.h:74
Double_t ftr
Definition: PndMvdCalcTot.h:66
Double_t GetTotWC()
Double_t PndMvdCalcTot::GetTotWC ( )
private

Definition at line 32 of file PndMvdCalcTot.cxx.

References fstarttime, fstoptime, ftimestep, t1e, and t2e.

Referenced by GetTot().

32  { //calculates start time, stop time with a clock
33  fstarttime = (Int_t) ( t1e / ftimestep ) * ftimestep + ftimestep; //quantization of the start signal
34  fstoptime = (Int_t) ( t2e / ftimestep ) * ftimestep + ftimestep; //quantization of the stop signal
35 /*
36  std::cout<<" start point exact: "<<t1e<<std::endl;
37  std::cout<<" stop point exact: "<<t2e<<std::endl;
38  std::cout<<" time step is: "<<ftimestep<<" ns"<<std::endl;
39  std::cout<<" fclockfrequency is: "<<fclockfrequency<<" MHz"<<std::endl;
40  std::cout<<" time offset is: "<<ftimeoffset<<" ns"<<std::endl;
41  std::cout<<" start point is: "<<fstarttime<<" ns"<<std::endl;
42  std::cout<<" stop point is: "<<fstoptime<<" ns"<<std::endl;
43 */
44  return (fstoptime-fstarttime);
45 }
Double_t t2e
Definition: PndMvdCalcTot.h:69
Double_t ftimestep
Definition: PndMvdCalcTot.h:71
Double_t fstoptime
Definition: PndMvdCalcTot.h:73
Double_t t1e
Definition: PndMvdCalcTot.h:69
Double_t fstarttime
Definition: PndMvdCalcTot.h:72
void PndMvdCalcTot::SetParameter ( Double_t  tr,
Double_t  a,
Double_t  threshold 
)

Definition at line 51 of file PndMvdCalcTot.cxx.

References a, fa, fthreshold, ftr, threshold, and tr.

51  {
52  ftr = tr;
53  fa = a;
55 }
Double_t fthreshold
Definition: PndMvdCalcTot.h:65
Int_t a
Definition: anaLmdDigi.C:126
Double_t ftr
Definition: PndMvdCalcTot.h:66
double threshold
void PndMvdCalcTot::SetStartOffset ( )

Definition at line 47 of file PndMvdCalcTot.cxx.

References fRand, ftimeoffset, and ftimestep.

Referenced by PndMvdCalcTot().

47  { //function called for different events to set different time offsets
48  ftimeoffset = fRand.Uniform(ftimestep);
49 }
Double_t ftimestep
Definition: PndMvdCalcTot.h:71
TRandom2 fRand
Definition: PndMvdCalcTot.h:78
Double_t ftimeoffset
Definition: PndMvdCalcTot.h:74

Member Data Documentation

Double_t PndMvdCalcTot::fa
private

Definition at line 67 of file PndMvdCalcTot.h.

Referenced by GetPileUpTime(), GetTot(), PndMvdCalcTot(), and SetParameter().

Double_t PndMvdCalcTot::fclockfrequency
private

Definition at line 70 of file PndMvdCalcTot.h.

Referenced by PndMvdCalcTot().

TRandom2 PndMvdCalcTot::fRand
private

Definition at line 78 of file PndMvdCalcTot.h.

Referenced by SetStartOffset().

Double_t PndMvdCalcTot::fstarttime
private

Definition at line 72 of file PndMvdCalcTot.h.

Referenced by GetTotWC().

Double_t PndMvdCalcTot::fstoptime
private

Definition at line 73 of file PndMvdCalcTot.h.

Referenced by GetTotWC().

Double_t PndMvdCalcTot::fthreshold
private

Definition at line 65 of file PndMvdCalcTot.h.

Referenced by GetTot(), PndMvdCalcTot(), and SetParameter().

Double_t PndMvdCalcTot::ftimeoffset
private

Definition at line 74 of file PndMvdCalcTot.h.

Referenced by GetTot(), and SetStartOffset().

Double_t PndMvdCalcTot::ftimestep
private

Definition at line 71 of file PndMvdCalcTot.h.

Referenced by GetTotWC(), PndMvdCalcTot(), and SetStartOffset().

Double_t PndMvdCalcTot::ftr
private

Definition at line 66 of file PndMvdCalcTot.h.

Referenced by GetPileUpTime(), GetTot(), PndMvdCalcTot(), and SetParameter().

Double_t PndMvdCalcTot::Q
private

Definition at line 68 of file PndMvdCalcTot.h.

Referenced by GetTot().

Double_t PndMvdCalcTot::Qt
private

Definition at line 68 of file PndMvdCalcTot.h.

Referenced by GetTot().

Double_t PndMvdCalcTot::t1e
private

Definition at line 69 of file PndMvdCalcTot.h.

Referenced by GetTot(), and GetTotWC().

Double_t PndMvdCalcTot::t2e
private

Definition at line 69 of file PndMvdCalcTot.h.

Referenced by GetTot(), and GetTotWC().


The documentation for this class was generated from the following files: