00001
00002
00003
00004
00005
00006
00007
00008
00009
00011
00012 #include "CalDetPIDSR/CalDetTOFId.h"
00013 #include "MessageService/MsgService.h"
00014 #include "TMath.h"
00015 #include "Conventions/Munits.h"
00016
00017 ClassImp(CalDetTOFId)
00018
00019
00020 CVSID("$Id: CalDetTOFId.cxx,v 1.5 2006/05/22 20:59:49 rhatcher Exp $");
00021
00022
00023 CalDetTOFId::CalDetTOFId()
00024 {
00025 }
00026
00027
00028 CalDetTOFId::CalDetTOFId(Double_t paddleSeparation, Double_t tdcGain1,
00029 Double_t tdcGain2,
00030 Int_t tdcPedestal1, Int_t tdcPedestal2,
00031 Int_t , Int_t ,
00032 RawTOFDigit rtofd) :
00033 fBeta(0.),
00034 fTOFDigit(rtofd),
00035 fTOF(0.)
00036 {
00037
00038
00039
00040
00041
00042
00043
00044 Double_t tdc1=0;
00045 Double_t tdc2=0;
00046
00047
00048
00049 MSG("CalDetTOFId",Msg::kError)
00050 << "CalDetTOFId ctor code is incomplete!" << endl;
00051
00052 Double_t time1 = tdcGain1 * (tdc1 - (1.0*tdcPedestal1));
00053 Double_t time2 = tdcGain2 * (tdc2 - (1.0*tdcPedestal2));
00054
00055
00056
00057 Double_t fTOF = (time1 - time2);
00058
00059
00060
00061 fBeta = paddleSeparation / (fTOF * Munits::c_light);
00062 }
00063
00064
00065 CalDetTOFId::~CalDetTOFId()
00066 {
00067
00068 }
00069
00070
00071 Double_t CalDetTOFId::GetParticleMassSquared(Double_t momentum) const
00072 {
00073 Double_t massSquared = -1.;
00074
00075
00076 Double_t energy = 0.;
00077 if(fBeta > 0.){
00078 energy = momentum / fBeta;
00079
00080
00081 massSquared = (energy*energy) - (momentum*momentum);
00082 }
00083
00084 return massSquared;
00085
00086 }
00087
00088
00089 Double_t CalDetTOFId::GetTOF() const
00090 {
00091 return fTOF;
00092 }
00093
00094
00095 Double_t CalDetTOFId::GetBeta() const
00096 {
00097 return fBeta;
00098 }
00099
00100
00101