2 TFile*
f =
new TFile(
"tracks_combi.root");
3 TFile*
f2 =
new TFile(
"points_combi.root");
4 TTree *
t=(TTree *) f->Get(
"pndsim") ;
5 t->AddFriend(
"pndsim",
"points_combi.root");
7 TClonesArray*
trk_array=
new TClonesArray(
"PndMdtTrk");
8 t->SetBranchAddress(
"MdtTrk",&trk_array);
10 TClonesArray*
hit_array=
new TClonesArray(
"PndMdtHit");
11 t->SetBranchAddress(
"MdtHit",&hit_array);
14 t->SetBranchAddress(
"MdtPoint",&point_array);
16 TClonesArray*
mc_array=
new TClonesArray(
"PndMCTrack");
17 t->SetBranchAddress(
"MCTrack",&mc_array);
20 TFile*
out = TFile::Open(
"reco_combi.root",
"RECREATE");
22 TNtuple *
nHit =
new TNtuple(
"nHit",
"nHit",
"evt:x:y:z:phi:theta:lay:mod:sec:xt:yt");
23 TNtuple *
nHit0 =
new TNtuple(
"nHit0",
"nHit0",
"evt:trk:x:y:z:phi:theta:lay:mod:sec:pdg:mot:xt:yt:phit:px:py:pz:y0:y1:y2:y3:y4:y5:y6:y7:y8:y9");
24 TNtuple *
ext =
new TNtuple(
"ext",
"ext",
"evt:trk:xt:yt:zt:lay:mod:sec:x:y:z:dist:angle");
27 for (Int_t j=0; j< t->GetEntriesFast(); j++)
31 for (Int_t
hh=0;
hh<hit_array->GetEntriesFast();
hh++)
34 TVector3
pos(0.,0.,0.);
35 mdtHit->Position(pos);
36 Int_t layer = int((pos.Phi()*TMath::RadToDeg()+180+22.5)/45);
37 if (layer==8) layer = 0;
41 xt =
cos(-layer*45*TMath::DegToRad())*pos.X() -
sin(-layer*45*TMath::DegToRad())*pos.Y();
42 yt =
sin(-layer*45*TMath::DegToRad())*pos.X() +
cos(-layer*45*TMath::DegToRad())*pos.Y();
45 nHit->Fill(j,pos.X(), pos.Y(), pos.Z(), pos.Phi(), pos.Theta(), mdtHit->
GetLayerID(), mdtHit.
GetModule(), mdtHit.
GetSector(), xt, yt);
48 for (Int_t tt=0; tt<trk_array->GetEntriesFast(); tt++)
62 TVector3 pos0(0.,0.,0.);
64 TVector3
mom(point0->GetPx(),point0->GetPy(),point0->GetPz());
68 xt0 = (
cos(-hit0->
GetSector()*45*TMath::DegToRad())*pos0.X() -
sin(-hit0->
GetSector()*45*TMath::DegToRad())*pos0.Y());
73 cout <<
"px == 0 errore"<< endl;
77 Float_t yproj[10], zproj[10];
78 for (Int_t yy=0; yy<10; yy++)
81 yproj[yy] = yt0 + (xlayer - xt0) *
mom.Y() /
mom.X();
82 zproj[yy] = pos0.Z() + (xlayer - xt0) *
mom.Z() /
mom.X();
85 TVector3 hpos(0.,0.,0.);
86 testhit->Position(hpos);
88 xt = (
cos(-hit0->
GetSector()*45*TMath::DegToRad())*hpos.X() -
sin(-hit0->
GetSector()*45*TMath::DegToRad())*hpos.Y());
90 Float_t dist =
sqrt(((yproj[yy]-yt0)*(yproj[yy]-yt0))+((zproj[yy]-hpos.Z())*(zproj[yy]-hpos.Z())));
91 TVector3 vext(xlayer-xlayer0,yproj[yy]-yt0,zproj[yy]-pos0.Z());
92 TVector3 vhit(xlayer-xlayer0,yt-yt0,hpos.Z()-pos0.Z());
94 ext->Fill(j, tt,xlayer, yproj[yy], zproj[yy], testhit->
GetLayerID(), hit0.
GetModule(), hit0.
GetSector(), xt, yt, hpos.Z(),dist,vext.Angle(vhit) );
97 Float_t nhit0_nt[] = {
98 j,tt,pos0.X(), pos0.Y(), pos0.Z(), pos0.Phi(), pos0.Theta(),
102 yproj[0],yproj[1],yproj[2],yproj[3],yproj[4],yproj[5],yproj[6],yproj[7],yproj[8],yproj[9],
107 nHit0->Fill(nhit0_nt);
friend F32vec4 cos(const F32vec4 &a)
Short_t GetLayerID() const
TClonesArray * point_array
friend F32vec4 sqrt(const F32vec4 &a)
Float_t GetLayerPos(Int_t mod, Int_t lay) const
friend F32vec4 sin(const F32vec4 &a)
Short_t GetSector() const
Short_t GetModule() const
Int_t GetMotherID() const
static PndEmcMapper * Instance()