9 #include "St2011WMaker.h"
10 #include "WeventDisplay.h"
11 #include "St2011ZMaker.h"
14 const
float PI=TMath::Pi();
26 Int_t St2011ZMaker::Init(){
30 return StMaker::Init();
36 Int_t St2011ZMaker::InitRun (
int runumber){
37 LOG_INFO<<Form(
"::InitRun(%d) done, Z-algo params: nearTotEtFrac=%.2f, clusterEt=%.1f GeV, delPhi12>%.2f rad, Zmass in[%.1f,%.1f]\n",
38 runumber, par_nearTotEtFracZ,par_clusterEtZ,par_delPhi12,par_minMassZ,par_maxMassZ)<<endm;
44 Int_t St2011ZMaker::FinishRun (
int runnumber){
67 float adc= wMK->wEve->bemc.adcTile[ibp][
id-1];
68 float frac= adc/4096*60 /cl.ET;
69 printf(
"Ztower Q=%d pointTw: id=%d ADC=%.0f 2x2ET=%.1f frac=%.2f\n",T->prMuTrack->
charge(),id,adc,cl.ET,frac);
76 St2011ZMaker::findEndcap_Z_boson(){
80 hA[50]->Fill(
"inp",1.);
83 for(
unsigned int iv=0;iv<wEve->vertex.size();iv++) {
84 hA[50]->Fill(
"vert",1.);
88 for(
unsigned int it=0;it<V.eleTrack.size();it++) {
90 if(TB.pointTower.id<=0)
continue;
91 if(TB.isMatch2Cl==
false)
continue;
92 assert(TB.cluster.nTower>0);
93 assert(TB.nearTotET>0);
96 float isoET1=TB.cluster.ET /TB.cl4x4.ET;
98 hA[52]->Fill(TB.cluster.ET);
99 hA[50]->Fill(
"trB",1.);
100 if(TB.cluster.ET<par_clusterEtZ)
continue;
101 hA[50]->Fill(
"etB",1.);
103 float fracET1=TB.cluster.ET /TB.nearTotET;
104 hA[53]->Fill(fracET1);
105 if(fracET1<par_nearTotEtFracZ)
continue;
106 hA[50]->Fill(
"conB",1.);
109 for(
unsigned int it=0;it<V.eleTrack.size();it++) {
111 if(TE.pointTower.id>=0)
continue;
112 if(TE.isMatch2Cl==
false)
continue;
113 assert(TE.cluster.nTower>0);
114 assert(TE.nearTotET>0);
116 float isoET2=TE.cluster.ET/TE.cl4x4.ET;
117 hA[71]->Fill(isoET2);
118 hA[72]->Fill(TE.cluster.ET);
119 hA[70]->Fill(
"trE",1.);
120 if(TE.cluster.ET<par_clusterEtZ)
continue;
121 hA[70]->Fill(
"etE",1.);
123 float fracET2=TE.cluster.ET/TE.nearTotET;
124 hA[73]->Fill(fracET2);
125 if(fracET2<par_nearTotEtFracZ)
continue;
126 hA[70]->Fill(
"conE",1.);
128 float e1=TB.cluster.energy;
129 float e2=TE.cluster.energy;
130 TVector3 p1=TB.primP; p1.SetMag(e1);
131 TVector3 p2=TE.primP; p2.SetMag(e2);
133 float del_phi=p1.DeltaPhi(p2);
136 if(xx<-PI+1) xx+=2*PI;
138 if(fabs(del_phi)<par_delPhi12)
continue;
139 hA[70]->Fill(
"phi12",1.);
142 float mass2=(e1+e2)*(e1+e2)-(psum.Dot(psum));
143 if(mass2<1.)
continue;
144 hA[70]->Fill(
"m2",1.);
145 hA[77]->Fill(p1.Eta(),p2.Eta());
146 hA[78]->Fill(psum.Eta());
147 hA[79]->Fill(psum.Pt());
149 float mass=sqrt(mass2);
153 hA[80]->Fill(TE.cluster.ET,TE.prMuTrack->
charge()/TE.prMuTrack->
pt());
continue;
157 hA[70]->Fill(
"QQ",1.);
159 hA[81]->Fill(TE.cluster.ET,TE.prMuTrack->
charge()/TE.prMuTrack->
pt());
165 for(
int iEta=0; iEta<12; iEta++){
166 for(
int iPhi=0; iPhi<60; iPhi++){
169 if(eclust.ET < par_clusterEtZ)
continue;
170 if(maxET > eclust.ET)
continue;
177 if(maxCluster.ET <= 1.0)
continue;
180 WeveCluster cl4x4=wMK->sumEtowPatch(maxCluster.iEta-1,maxCluster.iPhi-1,4,4,V.z);
181 hA[54]->Fill(maxCluster.ET/cl4x4.ET);
182 if(maxCluster.ET/cl4x4.ET<wMK->parE_clustFrac24)
continue;
183 hA[55]->Fill(maxCluster.ET);
184 hA[50]->Fill(
"trE",1.);
185 if(maxCluster.ET < par_clusterEtZ)
continue;
186 hA[50]->Fill(
"etE",1.);
189 float nearBtow=wMK->sumBtowCone(V.z,maxCluster.position,2);
190 float nearEtow=wMK->sumEtowCone(V.z,maxCluster.position,2);
191 float nearSum=nearBtow; nearSum+=nearEtow;
192 hA[56]->Fill(maxCluster.ET/nearSum);
193 if(maxCluster.ET/nearSum<wMK->parE_nearTotEtFrac)
continue;
194 hA[50]->Fill(
"conE",1.);
197 float e1=TB.cluster.energy;
198 float e2=maxCluster.energy;
199 TVector3 p1=TB.primP; p1.SetMag(e1);
200 TVector3 p2=maxCluster.position; p2.SetMag(e2);
201 float del_phi=p1.DeltaPhi(p2);
203 if(xx<-PI+1) xx+=2*PI;
205 if(fabs(del_phi)<par_delPhi12)
continue;
206 hA[50]->Fill(
"phi12",1.);
208 float mass2=(e1+e2)*(e1+e2)-(psum.Dot(psum));
209 if(mass2<1.)
continue;
210 hA[50]->Fill(
"m2",1.);
211 float mass=sqrt(mass2);
213 hA[59]->Fill(p1.Eta(),p2.Eta());
214 hA[60]->Fill(psum.Eta());
215 hA[61]->Fill(psum.Pt());
225 St2011ZMaker::find_Z_boson(){
229 hA[31]->Fill(wEve->vertex.size());
230 hA[0]->Fill(
"inp",1.);
233 for(
unsigned int iv=0;iv<wEve->vertex.size();iv++) {
234 hA[0]->Fill(
"vert",1.);
236 hA[32]->Fill(V.eleTrack.size());
237 if(V.eleTrack.size()<2)
continue;
238 hA[0]->Fill(
"TT",1.);
243 for(
unsigned int it=0;it<V.eleTrack.size()-1;it++) {
245 if(T1.pointTower.id<=0)
continue;
246 if(T1.isMatch2Cl==
false)
continue;
247 assert(T1.cluster.nTower>0);
248 assert(T1.nearTotET>0);
250 float isoET1=T1.cluster.ET /T1.cl4x4.ET;
251 hA[29]->Fill(isoET1);
253 hA[23]->Fill(T1.cluster.ET);
254 hA[0]->Fill(
"tr1",1.);
255 if(T1.cluster.ET<par_clusterEtZ)
continue;
256 hA[0]->Fill(
"et1",1.);
258 float fracET1=T1.cluster.ET /T1.nearTotET;
259 hA[24]->Fill(fracET1);
260 if(fracET1< par_nearTotEtFracZ)
continue;
261 hA[0]->Fill(
"con1",1.);
263 for (
unsigned int it2=it+1;it2<V.eleTrack.size();it2++) {
265 if(T2.pointTower.id<=0)
continue;
266 if(T2.isMatch2Cl==
false)
continue;
267 assert(T2.cluster.nTower>0);
268 assert(T2.nearTotET>0);
270 float isoET2=T2.cluster.ET /T2.cl4x4.ET;
271 hA[30]->Fill(isoET2);
273 hA[25]->Fill(T2.cluster.ET);
274 hA[0]->Fill(
"tr2",1.);
275 if(T2.cluster.ET<par_clusterEtZ)
continue;
276 hA[0]->Fill(
"et2",1.);
278 float fracET2=T2.cluster.ET /T2.nearTotET;
279 hA[26]->Fill(fracET2);
280 if(fracET2< par_nearTotEtFracZ)
continue;
281 hA[0]->Fill(
"con2",1.);
283 float e1=T1.cluster.energy;
284 float e2=T2.cluster.energy;
285 TVector3 p1=T1.primP; p1.SetMag(e1);
286 TVector3 p2=T2.primP; p2.SetMag(e2);
288 float del_phi=p1.DeltaPhi(p2);
291 if(xx<-PI+1) xx+=2*PI;
293 if(fabs(del_phi)<par_delPhi12)
continue;
294 hA[0]->Fill(
"phi12",1.);
297 float mass2=(e1+e2)*(e1+e2)-(psum.Dot(psum));
298 float yZ=0.5*log((e1+e2+psum.Z())/(e1+e2-psum.Z()));
299 if(mass2<1.)
continue;
300 hA[0]->Fill(
"m2",1.);
302 float mass=sqrt(mass2);
310 hA[0]->Fill(
"QQ",1.);
312 hA[33]->Fill(T1.cluster.ET,T1.prMuTrack->
charge()/T1.prMuTrack->
pt());
313 hA[33]->Fill(T2.cluster.ET,T2.prMuTrack->
charge()/T2.prMuTrack->
pt());
314 hA[34]->Fill(T1.pointTower.iEta ,T1.cluster.energy);
315 hA[34]->Fill(T2.pointTower.iEta ,T2.cluster.energy);
316 hA[35]->Fill(p1.Eta(),p2.Eta());
318 if(T1.prMuTrack->
charge()>0) hA[42]->Fill(p1.Phi(),p2.Phi());
319 else hA[42]->Fill(p2.Phi(),p1.Phi());
320 hA[43]->Fill(T1.cluster.ET,T1.prMuTrack->
charge()*T1.cluster.ET/T1.prMuTrack->
pt());
321 hA[43]->Fill(T2.cluster.ET,T2.prMuTrack->
charge()*T2.cluster.ET/T2.prMuTrack->
pt());
324 printf(
"RCC: Found Z w/ invmass=%f\n",mass);
329 if (!wMK->isMC || (wMK->isMC&& wEve->id<500) )
330 { printf(
"\n ZZZZZZZZZZZZZZZZZZZ\n");
331 if(mass<par_minMassZ)
332 wMK->wDisaply->exportEvent(
"Zlow",V,T1);
334 wMK->wDisaply->exportEvent(
"Zgood",V,T1);
335 printf(
"RCC: Found Z w/ invmass=%f\n",mass);
341 if (mass<par_minMassZ)
continue;
342 hA[0]->Fill(
"Zlow",1.);
344 if (mass>par_maxMassZ)
continue;
345 hA[0]->Fill(
"Zhigh",1.);
348 hA[37]->Fill(psum.Pt());
350 int bxStar7=wMK->wEve->bxStar7;
351 int bxStar48=wMK->wEve->bxStar48;
352 if(bxStar48!=bxStar7) {
353 hA[0]->Fill(
"badBx48",1.);
357 int spin4=wMK->wEve->spin4;
359 if(yZ<0) hA[39]->Fill(spin4);
360 else if(yZ>0) hA[40]->Fill(spin4);
365 float x1 = mZ/roots * TMath::Exp(yZ);
366 float x2 = mZ/roots * TMath::Exp(-1.*yZ);
368 hA[45]->Fill(x1*mass/mZ,x2*mass/mZ);
371 if(T1.prMuTrack->
charge()>0)
372 hA[46]->Fill( T1.prMuTrack->
charge()*T1.cluster.ET/T1.prMuTrack->
pt(),
373 T2.prMuTrack->
charge()*T2.cluster.ET/T2.prMuTrack->
pt());
375 hA[46]->Fill( T2.prMuTrack->
charge()*T2.cluster.ET/T2.prMuTrack->
pt(),
376 T1.prMuTrack->
charge()*T1.cluster.ET/T1.prMuTrack->
pt());
380 float fmax1=T1.cluster.ET/T1.cl4x4.ET;
381 float fmax2=T2.cluster.ET/T2.cl4x4.ET;
383 hA[21]->Fill(fmax1,fmax2);
384 hA[22]->Fill(T1.cluster.ET,T2.cluster.ET);
387 hA[2]->Fill(T1.prMuTrack->
charge(),T2.prMuTrack->
charge());
388 hA[3]->Fill(T1.prMuTrack->
charge()*T2.prMuTrack->
charge());
389 hA[4]->Fill(p1.Phi(),p2.Phi());
390 hA[5]->Fill(del_phi);
391 hA[6]->Fill(mass,T1.prMuTrack->
charge()/T1.primP.Perp()*T2.prMuTrack->
charge()/T1.primP.Perp());
392 hA[7]->Fill(mass,T1.prMuTrack->
charge()*T2.prMuTrack->
charge());
393 hA[8]->Fill(T1.cluster.ET);
394 if (T1.prMuTrack->
charge()>0)
396 hA[9]->Fill(p1.Eta(),p1.Phi());
397 hA[10]->Fill(p2.Eta(),p2.Phi());
401 hA[10]->Fill(p1.Eta(),p1.Phi());
402 hA[9]->Fill(p2.Eta(),p2.Phi());
405 hA[11]->Fill(fmax1,fmax2);
406 hA[12]->Fill(T1.cluster.ET,T2.cluster.ET);
407 hA[13]->Fill(mass,del_phi);
Double_t pt() const
Returns pT at point of dca to primary vertex.
Short_t charge() const
Returns charge.
uses tree from W-algo to find Zs