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,
bool barrel=
true) {
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){
51 hA[0]->Fill(
"inp",1.);
54 if(prTr->
nHitsFit()<=par_nFitPts)
return false;
56 hA[0]->Fill(
"nHit",1.);
59 if(hitFrac<par_nHitFrac)
return false;
61 hA[0]->Fill(
"Hfrac",1.);
63 hA[4]->Fill(ri.perp());
64 if(ri.perp()>par_Rmin)
return false;
66 hA[0]->Fill(
"Rin",1.);
68 hA[5]->Fill(ro.perp());
69 if(ro.perp()<par_Rmax)
return false;
73 hA[0]->Fill(
"Rout",1.);
74 hA[1]->Fill(ro.pseudoRapidity(),ro.phi());
75 float dedx=prTr->
dEdx()*1e6;
76 hA[6]->Fill(prTr->
p().mag(),dedx);
84 WtpcFilter::getTpcSec(
float phiRad,
float etaDet){
85 const float PI=TMath::Pi();
87 float phi=phiRad/PI*180;
99 assert(sec<=mxTpcSec);
107 WtpcFilter::initHistos(
bool barrel) {
108 int myCol=2+ secID%6;
111 memset(hA,0,
sizeof(hA));
112 TList *Lx; TLine *ln;TH1 *h;
114 TString sufix=
", TPC sec="; sufix+=secID;
116 hA[0]=h=
new TH1F(name+
"Stat",
"track counter"+sufix+
"; Cases",nCase,0,nCase);
117 h->SetLineColor(myCol );
118 char key[][200]={
"inp",
"nHit",
"Hfrac",
"Rin",
"Rout"};
119 for(
int i=0;i<5;i++) h->Fill(key[i],0.);
122 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);
123 h->SetLineColor(myCol );
126 hA[1]=h=
new TH2F(name+
"Tr2D1",
"lastHit, accepted"+sufix+
"; detector eta ; detector phi (rad)",100,-0.2,1.8,200,-3.2,3.2);
127 h->SetLineColor(myCol );
130 hA[2]=h=
new TH1F(name+
"TrNfit",
"prim tr nFitP"+sufix+
"; nFitPoints",50,0,50);
131 Lx=h->GetListOfFunctions();
132 ln=
new TLine(par_nFitPts,0,par_nFitPts,1.e6); ln->SetLineColor(kRed); Lx->Add(ln);
135 hA[3]=h=
new TH1F(name+
"TrFitFrac",
"prim tr nFitFrac"+sufix+
"; nFit/nPoss ",50,0,1.1);
136 Lx=h->GetListOfFunctions();
137 ln=
new TLine(par_nHitFrac,0,par_nHitFrac,1.e6); ln->SetLineColor(kRed); Lx->Add(ln);
139 hA[4]=h=
new TH1F(name+
"TrRxyIn",
"prim tr 1st hit filter"+sufix+
"; Rxy (cm)",60,50,170.);
140 Lx=h->GetListOfFunctions();
141 ln=
new TLine(par_Rmin,0,par_Rmin,1.e6); ln->SetLineColor(kRed); Lx->Add(ln);
143 hA[5]=h=
new TH1F(name+
"TrRxyOut",
"prim tr last hit filter"+sufix+
"; Rxy (cm)",60,100,220.);
144 Lx=h->GetListOfFunctions();
145 ln=
new TLine(par_Rmax,0,par_Rmax,1.e6); ln->SetLineColor(kRed); Lx->Add(ln);
148 hA[6]=h=
new TH2F(name+
"TrdEdX",
" dEdX vs. P, accpted "+sufix+
"; track P (GeV); dE/dx (keV)",20,0,10,100,0,10);
152 for(
int i=0;i<mxHA;i++) {
153 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.