742 {
743
744 Double_t field = -f_Magnetic;
745 Double_t
kvC = 3.0e8;
746 Int_t charge = recTrack->
charge();
747 Double_t pt = recTrack->
pxy();
748 Double_t pz = recTrack->
pz();
749 Double_t
pi = TMath::Pi();
750
751
752 Double_t orgx = recTrack->
x()*10;
753 Double_t orgy = recTrack->
y()*10;
754 Double_t orgz = recTrack->
z()*10;
755
756
759
760 Double_t radius,zStep;
761 if (charge == 0) {
762 radius = 1e9 ;
763 zStep = 1e9;
764 }
765 else {
766 radius = (pt * 1.0e9 /
kvC * 1e3) / fabs(charge * field) ;
767 zStep = 2*
pi*radius * fabs(pz/pt);
768 }
769 Double_t curvature = 1.0/radius;
770 Double_t step = 10.0;
771 Double_t delt = step*(1.0e-3)/
kvC;
772
773 mdcTrack->
AddPoint(orgx, orgy, orgz, 0.0);
774 const Double_t *p;
775 Int_t nStep = 0;
776
779 y = orgy;
780 z = orgz;
781
782 if (charge == 0){
783 do {
784 x = recTrack->
helix(0)* 10 *
786 - nStep * step *
sin(recTrack->
helix(1));
787 y = recTrack->
helix(0)* 10 *
789 + nStep * step *
cos(recTrack->
helix(1));
790 z = recTrack->
helix(3)* 10 +
791 nStep * step * recTrack->
helix(4);
792
793 mdcTrack->
AddPoint(x, y, z, delt*nStep);
798 mdcTrack->PaintMarker(
mp);
799 mdcTrack->SetMarkerColor(kBlack);
800 mdcTrack->SetMarkerSize(10);
801 mdcTrack->SetLineColor(kBlack);
802
803 nStep++;
804 }
805 while ( (x*x + y*y) < mdcR*mdcR && fabs(z) < mdcZ );
806
807 nStep = 0;
808 do {
809 x = recTrack->
helix(0)* 10 *
811 - nStep * step *
sin(recTrack->
helix(1));
812 y = recTrack->
helix(0)* 10 *
814 + nStep * step *
cos(recTrack->
helix(1));
815 z = recTrack->
helix(3)* 10 +
816 nStep * step * recTrack->
helix(4);
817
818 mdcTrack->
AddPoint(x, y, z, delt*nStep);
823 mdcTrack->PaintMarker(
mp);
824 mdcTrack->SetMarkerColor(kBlack);
825 mdcTrack->SetMarkerSize(10);
826 mdcTrack->SetLineColor(kRed);
827
828 }
829 while ( (x*x + y*y) < mdcR*mdcR && fabs(z) < mdcZ );
830 }
831 else{
832 TGeoHelix helix(curvature, zStep, charge);
833 helix.InitPoint(orgx, orgy, orgz);
834
835 helix.InitDirection(recTrack->
px(), recTrack->
py(), recTrack->
pz(), kFALSE);
836
837 helix.SetField(0.0, 0.0, field, kFALSE);
838
839 do {
840
841 helix.Step(step);
842 p = helix.GetCurrentPoint();
843
844 mdcTrack->
AddPoint(p[0], p[1], p[2], delt*nStep);
849 mdcTrack->PaintMarker(
mp);
850 mdcTrack->SetMarkerColor(kBlack);
851 mdcTrack->SetMarkerSize(10);
852 nStep++;
853 }
854 while ( (p[0]*p[0] + p[1]*p[1]) < mdcR*mdcR && fabs(p[2]) < mdcZ );
855
856 }
857
858
859 vector<UInt_t> vecHits(0);
860 const TObjArray *recMdcHitCol = fRecEvent->getRecMdcHitCol();
861 for (Int_t i = 0; i < recMdcHitCol->GetEntriesFast(); i++){
863 Int_t recHitId = recMdcHit->
getTrkId();
864 Int_t recTrkId = recTrack->
trackId();
865 if (recHitId == recTrkId) vecHits.push_back(recMdcHit->
getMdcId());
866 }
867 for (Int_t i = 0; i < (Int_t)vecHits.size(); i++) {
871
874
877 }
878
879
880 Int_t n2DCluster(0);
882
883 for (Int_t j = 0; j < fCgemClusterCol->GetEntries(); ++j)
884 {
886
887
888
890 if( std::find(vecClusterId.begin(), vecClusterId.end(), clusterId) != vecClusterId.end() )
891 {
893 n2DCluster++;
894 }
895 }
896
898
899
901 TString info;
902
903 info = TString("MdcTrack ");
906
907 sprintf(
data,
"charge=%i, status=%i", recTrack->
charge(), recTrack->
stat());
909
910 sprintf(
data,
"P=%-.3f GeV, Pt=%-.3f GeV", recTrack->
p(), recTrack->
pxy());
912
913
914
915
916 sprintf(
data,
"Pxyz=(%-.3f,%-.3f,%-.3f) GeV", recTrack->
px(),recTrack->
py(),recTrack->
pz());
918
919 sprintf(
data,
"#phi=%-.3f #theta=%-.3f cos#theta=%-.3f", recTrack->
phi(),recTrack->
theta(),
cos(recTrack->
theta()));
921
922 sprintf(
data,
"Origin (%-.3f, %-.3f, %-.3f) cm, dr=%-.3f", orgx/10, orgy/10, orgz/10, sqrt(orgx*orgx+orgy*orgy)/10);
924
925 sprintf(
data,
"helix(%-.3f,%-.3f,%-.3f,%-.3f,%-.3f)", recTrack->
helix(0),recTrack->
helix(1),recTrack->
helix(2),recTrack->
helix(3), recTrack->
helix(4));
927
928 sprintf(
data,
"nHit=%i, nClu=%i, #chi^{2}= %-.3f",recTrack->
ndof()+5, n2DCluster, recTrack->
chi2());
929
931
932
933
934
935
936
937
938
939
940
942}
double sin(const BesAngle a)
double cos(const BesAngle a)
virtual void AddCluster(TObject *obj)
virtual Int_t GetTrackID() const
virtual void SetCharge(Int_t charge)
static int layer(const Identifier &id)
Values of different levels (failure returns 0)
static int wire(const Identifier &id)
Mdc2DWire * Get2DWire(Int_t layer, Int_t replica)
Get Mdc2DWire;.
TGeoPhysicalNode * GetPhysicalReplica(int layer, int replica)
Get replica physical node;.
const UInt_t getMdcId() const
const Int_t getTrkId(void) const
const Double_t phi() const
const Double_t pz() const
const Double_t px() const
const Double_t chi2() const
const Int_t trackId() const
const Double_t pxy() const
const Double_t theta() const
vector< Int_t > vecClusterId() const
const Int_t charge() const
const Double_t py() const
const Double_t helix(Int_t i) const