6 #include "St2011WMaker.h"
8 #include "St2011pubSpinMaker.h"
21 par_leptonEta1=-1.; par_leptonEta2=1.;
24 parE_leptonEta1=0.7; parE_leptonEta2=2.5;
32 St2011pubSpinMaker::Init(){
36 return StMaker::Init();
43 St2011pubSpinMaker::FinishRun (
int runNo){
50 St2011pubSpinMaker::InitRun (
int runNo){
52 LOG_INFO<<Form(
"::InitRun(%d) done, W-spin sorting params: exclude |Q*ET/PT| < %.2f OR |Q*ET/PT| > %.2f, for AL use leptonEta in[%.1f,%.1f] useNoEEMC=%d", runNo,
53 wMK->par_QET2PTlow,wMK->par_QET2PThigh,par_leptonEta1, par_leptonEta2,par_useNoEEMC
71 St2011pubSpinMaker::bXingSort(){
76 hA[0]->Fill(
"inp",1.);
78 if((wMK->wEve->l2bitRnd || wMK->wEve->l2bitET)==0)
return;
79 if(wMK->wEve->vertex.size()<=0)
return;
82 int bx48=wMK->wEve->bx48;
83 int bx7=wMK->wEve->bx7;
84 int bxStar48=wMK->wEve->bxStar48;
85 int bxStar7=wMK->wEve->bxStar7;
87 if(bxStar48!=bxStar7) {
88 printf(
"BAD bx7=%d bx48=%d del=%d\n",bx7,bx48,bxStar48-bxStar7);
89 hA[0]->Fill(
"badBx48",1.);
94 if(wMK->wEve->zTag)
return;
95 hA[0]->Fill(
"noZ",1.);
100 hA[3]->Fill(bxStar48);
101 hA[4]->Fill(bxStar7);
103 int spin4=wMK->wEve->spin4;
104 hA[5]->Fill(bxStar7,spin4);
106 float par_maxDsmThr=58;
108 if( wMK->wEve->l2bitRnd) {
110 if(wMK-> wEve->bemc.maxHtDsm<par_maxDsmThr) {
111 hA[6]->Fill(spin4); hA[0]->Fill(
"BG1",1.);}
115 if( wMK->wEve->l2bitET==0)
return;
120 for(
unsigned int iv=0;iv<wMK->wEve->vertex.size();iv++) {
122 for(
unsigned int it=0;it<V.eleTrack.size();it++) {
124 if(T.pointTower.id<=0)
continue;
127 float frac24=T.cluster.ET/(T.cl4x4.ET);
128 if(iv==0 && it==0 && frac24<wMK->par_clustFrac24) {
129 hA[31]->Fill(T.cluster.ET);
130 if( T.cluster.ET <20. ) { hA[7]->Fill(spin4); hA[0]->Fill(
"BG2",1.);}
134 float p_Q=T.prMuTrack->
charge();
136 float ET=T.cluster.ET;
139 if( frac24 < wMK->par_clustFrac24 && T.cluster.ET/T.nearTotET < wMK->par_nearTotEtFrac && T.sPtBalance2 < wMK->par_ptBalance)
141 hA[22+iQ]->Fill(spin4,ET);
142 if(T.prMuTrack->
eta()>par_leptonEta1 && T.prMuTrack->
eta()<par_leptonEta2 && ET>25 && ET<50)
143 hA[20+iQ]->Fill(spin4);
146 if(T.isMatch2Cl==
false)
continue;
147 assert(T.cluster.nTower>0);
148 assert(T.nearTotET>0);
151 bool isW= T.cluster.ET /T.nearTotET> wMK->par_nearTotEtFrac;
153 isW=isW && T.sPtBalance_noEEMC2>wMK->par_ptBalance;
155 isW=isW && T.sPtBalance2>wMK->par_ptBalance;
158 if(ET>15 &&ET<20 ) hA[16+iQ]->Fill(spin4);
162 hA[0]->Fill(
"Wcut",1.);
165 if(T.prMuTrack->
eta()<par_leptonEta1)
continue;
166 if(T.prMuTrack->
eta()>par_leptonEta2)
continue;
167 hA[0]->Fill(
"eta",1.);
173 if(ET>par_myET) hA[0]->Fill(
"W25",1.);
174 float q2pt=T.prMuTrack->
charge()/T.prMuTrack->
pt();
177 hA[32]->Fill(q2pt,T.prMuTrack->
nHitsFit());
181 hA[9]->Fill(ET,q2pt);
184 float hypCorr = q2pt*(T.cluster.ET);
186 if( fabs(hypCorr) < wMK->par_QET2PTlow)
continue;
187 if(ET>par_myET) hA[0]->Fill(
"Qlow",1.);
188 if( fabs(hypCorr) > wMK->par_QET2PThigh)
continue;
192 hA[0]->Fill(
"Qhigh",1.);
193 if(p_Q>0) hA[0]->Fill(
"Q +",1.);
194 else hA[0]->Fill(
"Q -",1.);
199 if(ET>25 && ET<50 ) {
200 hA[12+iQ]->Fill(spin4);
201 hA[29+iQ]->Fill(T.prMuTrack->
eta());
204 if(ET>32 &&ET<44 ) hA[14+iQ]->Fill(spin4);
206 hA[18+iQ]->Fill(spin4,ET);
211 if(nIsW>1) hA[0]->Fill(
"multiW",1.);
218 St2011pubSpinMaker::bXingSortEndcap(){
223 hE[0]->Fill(
"inp",1.);
225 if((wMK->wEve->l2EbitRnd || wMK->wEve->l2EbitET)==0)
return;
226 if(wMK->wEve->vertex.size()<=0)
return;
229 int bx48=wMK->wEve->bx48;
230 int bx7=wMK->wEve->bx7;
231 int bxStar48=wMK->wEve->bxStar48;
232 int bxStar7=wMK->wEve->bxStar7;
234 if(bxStar48!=bxStar7) {
235 printf(
"BAD bx7=%d bx48=%d del=%d\n",bx7,bx48,bxStar48-bxStar7);
236 hE[0]->Fill(
"badBx48",1.);
241 if(wMK->wEve->zTag)
return;
242 hE[0]->Fill(
"noZ",1.);
247 hE[3]->Fill(bxStar48);
248 hE[4]->Fill(bxStar7);
250 int spin4=wMK->wEve->spin4;
251 hE[5]->Fill(bxStar7,spin4);
253 float par_maxDsmThr=58;
255 if( wMK->wEve->l2EbitRnd) {
257 if(wMK-> wEve->etow.maxHtDsm<par_maxDsmThr) {
258 hE[6]->Fill(spin4); hE[0]->Fill(
"BG1",1.);}
261 if( wMK->wEve->l2EbitET==0)
return;
264 for(
unsigned int iv=0;iv<wMK->wEve->vertex.size();iv++) {
266 for(
unsigned int it=0;it<V.eleTrack.size();it++) {
268 if(T.pointTower.id>=0)
continue;
271 float frac24=T.cluster.ET/(T.cl4x4.ET);
272 if(iv==0 && it==0 && frac24<wMK->parE_clustFrac24) {
273 hE[31]->Fill(T.cluster.ET);
274 if( T.cluster.ET <20. ) { hE[7]->Fill(spin4); hE[0]->Fill(
"BG2",1.);}
277 if(T.isMatch2Cl==
false)
continue;
278 assert(T.cluster.nTower>0);
279 assert(T.nearTotET>0);
282 float p_Q=T.prMuTrack->
charge();
284 float ET=T.cluster.ET;
287 bool isW= T.cluster.ET/T.nearTotET > wMK->parE_nearTotEtFrac;
288 isW=isW && ((T.esmdPeakSumE[0]+T.esmdPeakSumE[1])/(T.esmdE[0]+T.esmdE[1]) > wMK->parE_smdRatio);
289 isW=isW && T.sPtBalance2>wMK->parE_ptBalance;
292 if(ET>15 && ET<20 ) hE[16+iQ]->Fill(spin4);
296 hE[0]->Fill(
"Wcut",1.);
299 if(T.prMuTrack->
eta()<parE_leptonEta1)
continue;
300 if(T.prMuTrack->
eta()>parE_leptonEta2)
continue;
301 hE[0]->Fill(
"eta",1.);
307 if(ET>par_myET) hE[0]->Fill(
"W25",1.);
308 float q2pt=T.prMuTrack->
charge()/T.prMuTrack->
pt();
311 hE[32]->Fill(q2pt,T.prMuTrack->
nHitsFit());
315 hE[9]->Fill(ET,q2pt);
318 float hypCorr = q2pt*(T.cluster.ET);
320 if( fabs(hypCorr) < wMK->parE_QET2PTlow)
continue;
321 if(ET>par_myET) hE[0]->Fill(
"Qlow",1.);
322 if( fabs(hypCorr) > wMK->parE_QET2PThigh)
continue;
326 hE[0]->Fill(
"Qhigh",1.);
327 if(p_Q>0) hE[0]->Fill(
"Q +",1.);
328 else hE[0]->Fill(
"Q -",1.);
332 if(ET>25 && ET<50 ) {
333 hE[12+iQ]->Fill(spin4);
334 hE[29+iQ]->Fill(T.prMuTrack->
eta());
337 if(ET>32 &&ET<44 ) hE[14+iQ]->Fill(spin4);
339 hE[18+iQ]->Fill(spin4,ET);
344 if(nIsW>1) hE[0]->Fill(
"multiW",1.);
Double_t pt() const
Returns pT at point of dca to primary vertex.
UShort_t nHitsFit() const
Return total number of hits used in fit.
Short_t charge() const
Returns charge.
Double_t eta() const
Returns pseudo rapidity at point of dca to primary vertex.
UShort_t nHitsPoss() const
Return number of possible hits on track.