13 #include <StMuDSTMaker/COMMON/StMuTrack.h>
18 #include "WtpcFilter.h"
19 #include "WanaConst.h"
23 WtpcFilter::WtpcFilter() {
34 WtpcFilter::init(
const char *core,
int sec, TObjArray *HListX) {
37 name=core; name+=secID; name+=
"_";
40 assert(par_nFitPts>0);
42 LOG_INFO<<Form(
"::InitTPC filter (sec=%d) done, name=%s= nFit>%d, hitFrac>%.2f Rin<%.1fcm, Rout>%.1fcm",secID,name.Data(),par_nFitPts, par_nHitFrac, par_Rmin, par_Rmax)<<endm;
50 WtpcFilter::accept(
const StMuTrack *prTr){
52 hA[0]->Fill(
"inp",1.);
55 if(prTr->
nHitsFit()<=par_nFitPts)
return false;
57 hA[0]->Fill(
"nHit",1.);
60 if(hitFrac<par_nHitFrac)
return false;
62 hA[0]->Fill(
"Hfrac",1.);
64 hA[4]->Fill(ri.perp());
65 if(ri.perp()>par_Rmin)
return false;
67 hA[0]->Fill(
"Rin",1.);
69 hA[5]->Fill(ro.perp());
70 if(ro.perp()<par_Rmax)
return false;
74 hA[0]->Fill(
"Rout",1.);
75 hA[1]->Fill(ro.pseudoRapidity(),ro.phi());
76 float dedx=prTr->
dEdx()*1e6;
77 hA[6]->Fill(prTr->
p().mag(),dedx);
85 WtpcFilter::getTpcSec(
float phiRad,
float etaDet){
86 const float PI=TMath::Pi();
88 float phi=phiRad/PI*180;
100 assert(sec<=mxTpcSec);
108 WtpcFilter::initHistos() {
109 int myCol=2+ secID%6;
112 memset(hA,0,
sizeof(hA));
113 TList *Lx; TLine *ln;TH1 *h;
115 TString sufix=
", TPC sec="; sufix+=secID;
117 hA[0]=h=
new TH1F(name+
"Stat",
"track counter"+sufix+
"; Cases",nCase,0,nCase);
118 h->SetLineColor(myCol );
120 hA[1]=h=
new TH2F(name+
"Tr2D1",
"lastHit, accepted"+sufix+
"; detector eta ; detector phi (rad)",100,-1.1,1.1,200,-3.2,3.2);
121 h->SetLineColor(myCol );
123 hA[2]=h=
new TH1F(name+
"TrNfit",
"prim tr nFitP"+sufix+
"; nFitPoints",50,0,50);
124 Lx=h->GetListOfFunctions();
125 ln=
new TLine(par_nFitPts,0,par_nFitPts,1.e6); ln->SetLineColor(kRed); Lx->Add(ln);
128 hA[3]=h=
new TH1F(name+
"TrFitFrac",
"prim tr nFitFrac"+sufix+
"; nFit/nPoss ",50,0,1.1);
129 Lx=h->GetListOfFunctions();
130 ln=
new TLine(par_nHitFrac,0,par_nHitFrac,1.e6); ln->SetLineColor(kRed); Lx->Add(ln);
132 hA[4]=h=
new TH1F(name+
"TrRxyIn",
"prim tr 1st hit filter"+sufix+
"; Rxy (cm)",60,50,170.);
133 Lx=h->GetListOfFunctions();
134 ln=
new TLine(par_Rmin,0,par_Rmin,1.e6); ln->SetLineColor(kRed); Lx->Add(ln);
136 hA[5]=h=
new TH1F(name+
"TrRxyOut",
"prim tr last hit filter"+sufix+
"; Rxy (cm)",60,100,220.);
137 Lx=h->GetListOfFunctions();
138 ln=
new TLine(par_Rmax,0,par_Rmax,1.e6); ln->SetLineColor(kRed); Lx->Add(ln);
141 hA[6]=h=
new TH2F(name+
"TrdEdX",
" dEdX vs. P, accpted "+sufix+
"; track P (GeV); dE/dx (keV)",20,0,10,100,0,10);
145 for(
int i=0;i<mxHA;i++) {
146 if( hA[i]==0)
continue;
UShort_t nHitsFit() const
Return total number of hits used in fit.
const StThreeVectorF & p() const
Returns 3-momentum at dca to primary vertex.
const StThreeVectorF & firstPoint() const
Returns positions of first measured point.
UShort_t nHitsPoss() const
Return number of possible hits on track.
const StThreeVectorF & lastPoint() const
Returns positions of last measured point.
Double_t dEdx() const
Returns measured dE/dx value.
const StMuTrack * globalTrack() const
Returns pointer to associated global track. Null pointer if no global track available.