1 #ifndef ST_CTB_MATCHER_H
2 #define ST_CTB_MATCHER_H
8 #include "StEvent/StTrack.h"
9 #include "StEvent/StTrackGeometry.h"
10 #include "StarClassLibrary/StPhysicalHelixD.hh"
11 #include "StarClassLibrary/StThreeVectorD.hh"
21 unsigned int EtaAndPhiToOrriginAtCTB(
StTrack* rTrack,
22 vector<ctbHit>* ctbHits,
24 double & trackEtaInCTBFrame){
26 const double Rctb=213.6;
29 if(rTrack->geometry()->momentum().perp() < .20)
35 if(pathLength.second < 0){
36 cout <<
"pathLength is bad" << endl;
42 double phi = atan2(pos.y(),pos.x())*180/TMath::Pi();
46 double theta = atan2(pos.perp(),pos.z());
47 double eta = -::log(tan(theta/2.0));
48 trackEtaInCTBFrame = eta;
58 for(
unsigned int i = 0; i < ctbHits->size() ; i++){
59 ctbHit curHit = (*ctbHits)[i];
60 deta = fabs(curHit.eta - eta);
62 dphi = fabs(curHit.phi - phi);
63 if( dphi < 3 && deta < .25){
64 return static_cast<unsigned int>(curHit.adc);
68 if( (phi < 3 || phi > 357) && deta < .25){
69 return static_cast<unsigned int>(curHit.adc);
78 void ctb_get_slat_from_data(
int slat,
int tray,
double & ctbphi,
double & ctbeta) {
82 float phiZero2 = 108 ;
91 phi = phiZero1 - tray * deltaPhi ;
94 phi = phiZero2 + (tray-60) * deltaPhi ;
98 if ( phi < 0. ) phi += 360 ;
99 if ( phi > 360. ) phi -= 360 ;
102 ctbeta =(1-2*iz)*(1+2*slat)*0.25;
pair< double, double > pathLength(double r) const
path length at given r (cylindrical r)