test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Static Public Member Functions | Private Member Functions | Static Private Member Functions
SiStripFineDelayTOF Class Reference

#include <SiStripFineDelayTOF.h>

Static Public Member Functions

static double timeOfFlight (bool cosmics, bool field, double *trackParameters, double *hit, double *phit, bool onDisk)
 
static void trackParameters (const reco::Track &tk, double *trackParameters)
 

Private Member Functions

 SiStripFineDelayTOF ()
 
virtual ~SiStripFineDelayTOF ()
 

Static Private Member Functions

static double getPhi (double *trackParameters, double *hit, bool onDisk)
 
static double timeOfFlightBeam (double *hit, double *phit)
 
static double timeOfFlightBeamB (double *trackParameters, double *hit, double *phit, bool onDisk)
 
static double timeOfFlightCosmic (double *hit, double *phit)
 
static double timeOfFlightCosmicB (double *trackParameters, double *hit, double *phit, bool onDisk)
 
static double x (double *trackParameters, double phi)
 
static double y (double *trackParameters, double phi)
 
static double z (double *trackParameters, double phi)
 

Detailed Description

Definition at line 10 of file SiStripFineDelayTOF.h.

Constructor & Destructor Documentation

SiStripFineDelayTOF::SiStripFineDelayTOF ( )
private
virtual SiStripFineDelayTOF::~SiStripFineDelayTOF ( )
privatevirtual

Member Function Documentation

double SiStripFineDelayTOF::getPhi ( double *  trackParameters,
double *  hit,
bool  onDisk 
)
staticprivate

Definition at line 119 of file SiStripFineDelayTOF.cc.

References funct::cos(), phi, Pi, funct::sin(), funct::tan(), x(), and y().

Referenced by timeOfFlightCosmicB().

120 {
121  if(onDisk) //use z coordinate to find phi
123  else // use x,y coordinate to find phi
124  {
125  double phi =0;
126  if(trackParameters[2]>-2.35 && trackParameters[2]<-0.78) {
127  // first use y
128  phi = acos(-trackParameters[0]*(hit[1]-(trackParameters[3]-1/trackParameters[0])*(-cos(trackParameters[2]))));
129  // use x to resolve the ambiguity
130  if(fabs(x(trackParameters,phi)-hit[0])>fabs(x(trackParameters,-phi)-hit[0])) phi *= -1.;
131  } else {
132  // first use x
133  phi = asin(trackParameters[0]*(hit[0]-(trackParameters[3]-1/trackParameters[0])*sin(trackParameters[2])));
134  // use y to resolve the ambiguity
135  if((fabs(y(trackParameters,phi)-hit[1])>fabs(y(trackParameters,TMath::Pi()-phi)-hit[1])))
136  phi = phi>0 ? TMath::Pi()-phi: -TMath::Pi()-phi;
137  }
138  return phi;
139  }
140  return 0.;
141 }
const double Pi
static double x(double *trackParameters, double phi)
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
static void trackParameters(const reco::Track &tk, double *trackParameters)
static double y(double *trackParameters, double phi)
double SiStripFineDelayTOF::timeOfFlight ( bool  cosmics,
bool  field,
double *  trackParameters,
double *  hit,
double *  phit,
bool  onDisk 
)
static

Definition at line 10 of file SiStripFineDelayTOF.cc.

References timeOfFlightBeam(), timeOfFlightBeamB(), timeOfFlightCosmic(), and timeOfFlightCosmicB().

Referenced by SiStripFineDelayHit::detId().

11 {
12 
13  // case 1: cosmics with no field.
14  if(cosmics && !field) {
15  return timeOfFlightCosmic(hit,phit);
16  }
17  // case 2: cosmics with field.
18  else if(cosmics && field) {
19  return timeOfFlightCosmicB(trackParameters,hit,phit,onDisk);
20  }
21  // case 3: beam with no field.
22  else if(!cosmics && !field) {
23  return timeOfFlightBeam(hit,phit);
24  }
25  // case 4: beam with field.
26  else {
27  return timeOfFlightBeamB(trackParameters,hit,phit,onDisk);
28  }
29 }
static double timeOfFlightBeamB(double *trackParameters, double *hit, double *phit, bool onDisk)
static double timeOfFlightCosmicB(double *trackParameters, double *hit, double *phit, bool onDisk)
static void trackParameters(const reco::Track &tk, double *trackParameters)
static double timeOfFlightCosmic(double *hit, double *phit)
static double timeOfFlightBeam(double *hit, double *phit)
double SiStripFineDelayTOF::timeOfFlightBeam ( double *  hit,
double *  phit 
)
staticprivate

Definition at line 86 of file SiStripFineDelayTOF.cc.

References EnergyCorrector::c.

Referenced by timeOfFlight().

87 {
88  // constants
89  const double c = 30; // cm/ns
90  TVector3 r0(hit[0],hit[1],hit[2]);
91  return r0.Mag()/c;
92 }
double SiStripFineDelayTOF::timeOfFlightBeamB ( double *  trackParameters,
double *  hit,
double *  phit,
bool  onDisk 
)
staticprivate

Definition at line 94 of file SiStripFineDelayTOF.cc.

References EnergyCorrector::c, funct::cos(), funct::sin(), mathSSE::sqrt(), and theta().

Referenced by timeOfFlight().

95 {
96  // constants
97  const double c = 30; // cm/ns
98  // track parameters
99  double& theta = trackParameters[1];
100  // returns the time of flight from the origin
101  return onDisk? fabs(hit[2]/(c*cos(theta))) : fabs(sqrt(hit[0]*hit[0]+hit[1]*hit[1])/(c*sin(theta)));
102 }
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Geom::Theta< T > theta() const
T sqrt(T t)
Definition: SSEVec.h:18
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
static void trackParameters(const reco::Track &tk, double *trackParameters)
double SiStripFineDelayTOF::timeOfFlightCosmic ( double *  hit,
double *  phit 
)
staticprivate

Definition at line 31 of file SiStripFineDelayTOF.cc.

References EnergyCorrector::c, AlCaHLTBitMon_ParallelJobs::p, and mathSSE::sqrt().

Referenced by timeOfFlight().

32 {
33  // constants
34  const double c = 30; // cm/ns
35 #ifndef TIF_COSMIC_SETUP
36  const double Rmu = 385; // cm
37  const double zmu = 560; // cm
38  // estimate the time for crossing the barrel
39  TVector3 r0(hit[0],hit[1],hit[2]);
40  TVector3 pr(phit[0],phit[1],phit[2]);
41  TVector2 r0_xy = r0.XYvector();
42  TVector2 pr_xy = pr.Unit().XYvector();
43  double t_barrel = ((r0_xy*pr_xy)+sqrt( (r0_xy*pr_xy)*(r0_xy*pr_xy) - r0_xy.Mod2() + Rmu*Rmu ))/c*pr.Mag()/pr.Perp();
44  // estimate the time for crossing endcaps
45  double t_endcap = fabs(((phit[2]/fabs(phit[2])*zmu)+hit[2])/c*pr.Mag()/pr.Pz());
46  // take the minimum
47  return t_barrel<t_endcap ? t_barrel : t_endcap;
48 #else
49  const double y_trigger = 100; //cm
50  double p = sqrt(phit[0]*phit[0]+phit[1]*phit[1]+phit[2]*phit[2]);
51 // LogDebug("TOF") << "momentum:" << phit[0] << " " << phit[1] << " " << phit[2];
52 // LogDebug("TOF") << "p/py=" << p/phit[1] << " Y0,Y,dY = " << y_trigger << " " << hit[1] << " " << (y_trigger-hit[1]);
53 // LogDebug("TOF") << "d, t=d/c : " << ((y_trigger-hit[1])*(p/phit[1])) << " " << ((y_trigger-hit[1])*(p/phit[1])/c);
54  return fabs((y_trigger-hit[1])*(p/phit[1])/c);
55 #endif
56 }
T sqrt(T t)
Definition: SSEVec.h:18
double SiStripFineDelayTOF::timeOfFlightCosmicB ( double *  trackParameters,
double *  hit,
double *  phit,
bool  onDisk 
)
staticprivate

Definition at line 58 of file SiStripFineDelayTOF.cc.

References EnergyCorrector::c, getPhi(), kappa, phi, funct::sin(), funct::tan(), and theta().

Referenced by timeOfFlight().

59 {
60  // constants
61  const double Rmu = 385; // cm
62  const double zmu = 560; // cm
63  const double c = 30; // cm/ns
64  // track parameters
65  double& kappa = trackParameters[0];
66  double& theta = trackParameters[1];
67  double& phi_0 = trackParameters[2];
68  double& d_0 = trackParameters[3];
69  double& z_0 = trackParameters[4];
70  double invkappa = 1/kappa;
71  // computes the value of the track parameter that correspond to the hit, relative to phi_0
72  //double phi = kappa*tan(theta)*(hit[2]-z_0);
73  double phi = getPhi(trackParameters,hit,onDisk) - phi_0;
74  // computes the value of the track parameter that correspond to the muon system, relative to phi_0
75  // phi_mu = phi_mu0 - phi_0
76  double phi_mu_b = (kappa>0 ? -1 : 1 ) * acos((Rmu*Rmu-d_0*d_0-2*invkappa*invkappa+2*invkappa*d_0)/(2*invkappa*d_0-2*invkappa*invkappa));
77  double phi_mu_e = kappa*tan(theta)*((phit[2]<0 ? 1 : -1)*zmu-z_0);
78  // estimate the time for crossing the barrel
79  double t_barrel = fabs(invkappa/(c*sin(theta))*(phi-phi_mu_b));
80  // estimate the time for crossing endcaps
81  double t_endcap = fabs(invkappa/(c*sin(theta))*(phi-phi_mu_e));
82  // take the minimum
83  return t_barrel<t_endcap ? t_barrel : t_endcap;
84 }
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Geom::Theta< T > theta() const
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
static void trackParameters(const reco::Track &tk, double *trackParameters)
static double getPhi(double *trackParameters, double *hit, bool onDisk)
static const G4double kappa
void SiStripFineDelayTOF::trackParameters ( const reco::Track tk,
double *  trackParameters 
)
static

Definition at line 143 of file SiStripFineDelayTOF.cc.

References reco::Track::innerPosition(), LogDebug, reco::Track::outerMomentum(), reco::Track::outerPosition(), Pi, position, and CosmicsPD_Skims::radius.

Referenced by SiStripFineDelayHit::detId().

144 {
146  math::XYZVector momentum = tk.outerMomentum();
147  LogDebug("trackParameters") << "outer position: " << position.x() << " " << position.y() << " " << position.z();
148  LogDebug("trackParameters") << "outer momentum: " << momentum.x() << " " << momentum.y() << " " << momentum.z();
149  math::XYZVector fieldDirection(0,0,1);
150  // computes the center of curvature
151  math::XYZVector radius = momentum.Cross(fieldDirection).Unit();
152  position -= radius / trackParameters[0];
153  LogDebug("trackParameters") << "center of curvature: " << position.x() << " " << position.y() << " " << position.z();
154  // the transverse IP
155  trackParameters[3] = position.rho() - fabs(1/trackParameters[0]);
156  if(trackParameters[0]>0) trackParameters[3] *= -1.;
157  // phi_0
158  double phi_out = trackParameters[2];
159  double phi_0 = position.phi() - TMath::Pi()/2;
160  if(trackParameters[0]<0) phi_0 -= TMath::Pi();
161  if(phi_0<-2*TMath::Pi()) phi_0 += 2*TMath::Pi();
162  if(phi_0>2*TMath::Pi()) phi_0 -= 2*TMath::Pi();
163  if(phi_0 > 0) phi_0 -= 2*TMath::Pi();
164  LogDebug("trackParameters") << "phi_0: " << phi_0;
165  trackParameters[2] = phi_0;
166  // z_0
167  trackParameters[4] = tk.outerPosition().z() - (phi_out-phi_0)/TMath::Tan(trackParameters[1])/trackParameters[0];
168  LogDebug("trackParameters") << "z_0: " << tk.outerPosition().z() << " " << trackParameters[4] << " " << tk.innerPosition().z();
169 }
#define LogDebug(id)
const double Pi
const math::XYZPoint & outerPosition() const
position of the outermost hit
Definition: Track.h:65
const math::XYZPoint & innerPosition() const
position of the innermost hit
Definition: Track.h:55
static void trackParameters(const reco::Track &tk, double *trackParameters)
const math::XYZVector & outerMomentum() const
momentum vector at the outermost hit position
Definition: Track.h:70
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:30
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
static int position[264][3]
Definition: ReadPGInfo.cc:509
double SiStripFineDelayTOF::x ( double *  trackParameters,
double  phi 
)
staticprivate
double SiStripFineDelayTOF::y ( double *  trackParameters,
double  phi 
)
staticprivate
double SiStripFineDelayTOF::z ( double *  trackParameters,
double  phi 
)
staticprivate

Definition at line 114 of file SiStripFineDelayTOF.cc.

References funct::tan().

Referenced by geometryXMLparser.Alignable::pos().

115 {
117 }
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
static void trackParameters(const reco::Track &tk, double *trackParameters)