5 #include <StMuDSTMaker/COMMON/StMuDstMaker.h>
6 #include <StMuDSTMaker/COMMON/StMuDst.h>
7 #include <StMuDSTMaker/COMMON/StMuEvent.h>
8 #include <StEvent/StEventInfo.h>
9 #include "StSpinPool/StSpinDbMaker/StSpinDbMaker.h"
11 #include "St2009WMaker.h"
13 #include "St2009pubSpinMaker.h"
28 par_leptonEta1=-1.; par_leptonEta2=1.;
36 St2009pubSpinMaker::Init(){
42 return StMaker::Init();
49 St2009pubSpinMaker::FinishRun (
int runNo){
51 sprintf(txt,
"events T= %d %d",Tfirst,Tlast);
52 printf(
"Finish run=%d , events time range %s\n",runNo,txt);
53 hbxIdeal->GetYaxis()->SetTitle(txt);
60 St2009pubSpinMaker::InitRun (
int runNo){
61 assert(runNo>= 10081007);
62 assert(runNo<=10103046);
64 char txt[1000],txt0[100];
65 sprintf(txt0,
"bxIdeal%d",nRun);
66 sprintf(txt,
"intended fill pattern R%d-%d vs. bXing; %s", runNo,nRun,spinDb->getV124comment());
68 Tfirst=int(2e9); Tlast=-Tfirst;
69 hbxIdeal=
new TH1F(core+txt0,txt,128,-0.5,127.5);
70 hbxIdeal->SetFillColor(kYellow);
74 for(
int bx=0;bx<120;bx++){
78 sprintf(txt,
"bXing= bx48+off=%d",spinDb->
BX48offset());
79 hA[3]->GetXaxis()->SetTitle(txt);
81 sprintf(txt,
"bXing= bx7+off=%d",spinDb->
BX7offset());
82 hA[4]->GetXaxis()->SetTitle(txt);
84 LOG_INFO<<Form(
"::InitRun(%d) done, W-spin sorting params: exclude |Q/PT| < %.2f OR |Q/PT| above line %.3f*(ET-%.1f)-%6e if ET<%.1f, for AL use leptonEta in[%.1f,%.1f] useNoEEMC=%d", runNo,
85 par_QPTlow,par_QPThighET0, par_QPThighA ,par_QPThighB,par_QPThighET1,par_leptonEta1, par_leptonEta2,par_useNoEEMC
94 int T=wMK->mMuDstMaker->
muDst()->
event()->eventInfo().time();
96 if(Tfirst>T) Tfirst=T;
105 St2009pubSpinMaker::bXingSort(){
108 hA[0]->Fill(
"inp",1.);
113 if(wMK->wEve.vertex.size()<=0)
return;
116 int bx48=wMK->wEve.bx48;
117 int bx7=wMK->wEve.bx7;
118 if(spinDb->offsetBX48minusBX7(bx48,bx7)) {
119 printf(
"BAD bx7=%d bx48=%d del=%d\n",bx7,bx48,spinDb->offsetBX48minusBX7(bx48,bx7));
120 hA[0]->Fill(
"badBx48",1.);
125 if(wMK->wEve.zTag)
return;
126 hA[0]->Fill(
"noZ",1.);
132 int bxStar48= spinDb->BXstarUsingBX48(bx48);
134 hA[3]->Fill(bxStar48);
135 hA[4]->Fill(bxStar7);
138 hA[5]->Fill(bxStar7,spin4);
140 float par_maxDsmThr=58;
142 if( wMK->wEve.l2bitRnd) {
145 for (
int m=0;m<300;m++) {
146 int val=muEve->emcTriggerDetector().highTower(m);
150 if(max<par_maxDsmThr) { hA[6]->Fill(spin4); hA[0]->Fill(
"BG1",1.);}
154 if( wMK->wEve.l2bitET==0)
return;
159 for(
unsigned int iv=0;iv<wMK->wEve.vertex.size();iv++) {
161 for(
unsigned int it=0;it<V.eleTrack.size();it++) {
163 if(T.pointTower.id==0)
continue;
166 float frac24=T.cluster.ET/(T.cl4x4.ET);
167 if(iv==0 && it==0 && frac24<wMK->par_clustFrac24) {
168 hA[31]->Fill(T.cluster.ET);
169 if( T.cluster.ET <20. ) { hA[7]->Fill(spin4); hA[0]->Fill(
"BG2",1.);}
172 if(T.isMatch2Cl==
false)
continue;
173 assert(T.cluster.nTower>0);
174 assert(T.nearTotET>0);
177 float p_Q=T.prMuTrack->
charge();
179 float ET=T.cluster.ET;
183 bool isW= T.cluster.ET /T.nearTotET> wMK->par_nearTotEtFrac;
185 isW=isW && T.sPtBalance_noEEMC>wMK->par_ptBalance;
187 isW=isW && T.sPtBalance>wMK->par_ptBalance;
190 if(ET>15 &&ET<20 ) hA[16+iQ]->Fill(spin4);
194 hA[0]->Fill(
"Wcut",1.);
196 hA[30]->Fill(T.prMuTrack->
eta());
197 if(fabs(T.primP.Eta()) > wMK->par_leptonEta)
continue;
199 if(T.prMuTrack->
eta()<par_leptonEta1)
continue;
200 if(T.prMuTrack->
eta()>par_leptonEta2)
continue;
201 hA[0]->Fill(
"eta",1.);
207 if(ET>par_myET) hA[0]->Fill(
"W25",1.);
208 float q2pt=T.prMuTrack->
charge()/T.prMuTrack->
pt();
209 if(ET>par_myET) hA[8]->Fill(q2pt);
210 hA[9]->Fill(ET,q2pt);
213 if( fabs(q2pt)< par_QPTlow)
continue;
214 if(ET>par_myET) hA[0]->Fill(
"Qlow",1.);
217 if( fabs(q2pt)< par_QPTlow)
continue;
218 float highCut=par_QPThighA - (ET-par_QPThighET0)*par_QPThighB;
220 if( ET>par_myET && ET<par_QPThighET1 && fabs(q2pt)>highCut)
continue;
224 hA[0]->Fill(
"Qhigh",1.);
225 if(p_Q>0) hA[0]->Fill(
"Q +",1.);
226 else hA[0]->Fill(
"Q -",1.);
231 if(ET>25 &&ET<50 ) hA[12+iQ]->Fill(spin4);
232 if(ET>32 &&ET<44 ) hA[14+iQ]->Fill(spin4);
234 hA[18+iQ]->Fill(spin4,ET);
bool isBXfilledUsingInternalBX(int bx)
defined only for 2005 run by CAD , based on first 4 filled bunches in both rings. Note...
bool isValid()
dump spinDb content for current time stamp
Double_t pt() const
Returns pT at point of dca to primary vertex.
int spin4usingBX48(int bx48)
8bit spin information
Short_t charge() const
Returns charge.
int BX7offset()
bXing at STAR IP, [0,119]
Double_t eta() const
Returns pseudo rapidity at point of dca to primary vertex.
void print(int level=0)
vs. STAR==yellow bXing
static StMuEvent * event()
returns pointer to current StMuEvent (class holding the event wise information, e.g. event number, run number)
int BX48offset()
bXing at STAR IP, [0,119]
int BXstarUsingBX7(int bx7)
bXing at STAR IP, [0,119]
bool isPolDirLong()
Returns true if beams are transversely polarized, false otherwise.