7 #include "St2009WMaker.h"
8 #include "WeventDisplay.h"
9 #include "St2009ZMaker.h"
12 #include <StMuDSTMaker/COMMON/StMuDstMaker.h>
13 #include <StMuDSTMaker/COMMON/StMuDst.h>
14 #include <StMuDSTMaker/COMMON/StMuEvent.h>
28 Int_t St2009ZMaker::Init(){
32 return StMaker::Init();
38 Int_t St2009ZMaker::InitRun (
int runumber){
39 LOG_INFO<<Form(
"::InitRun(%d) done, Z-algo params: nearTotEtFrac=%.2f, clusterEt=%.1f GeV, delPhi12>%.2f rad, Zmass in[%.1f,%.1f]\n",
40 runumber, par_nearTotEtFracZ,par_clusterEtZ,par_delPhi12,par_minMassZ,par_maxMassZ)<<endm;
46 Int_t St2009ZMaker::FinishRun (
int runnumber){
68 float adc= wMK->wEve.bemc.adcTile[ibp][
id-1];
69 float frac= adc/4096*60 /cl.ET;
70 printf(
"Ztower Q=%d pointTw: id=%d ADC=%.0f 2x2ET=%.1f frac=%.2f\n",T->prMuTrack->
charge(),id,adc,cl.ET,frac);
78 St2009ZMaker::find_Z_boson(){
79 const float PI=TMath::Pi();
81 float zdcRate=wMK->mMuDstMaker->
muDst()->
event()->runInfo().zdcCoincidenceRate();
84 hA[31]->Fill(wEve.vertex.size());
85 hA[0]->Fill(
"inp",1.);
88 for(
unsigned int iv=0;iv<wEve.vertex.size();iv++) {
89 hA[0]->Fill(
"vert",1.);
91 hA[32]->Fill(V.eleTrack.size());
92 if(V.eleTrack.size()<2)
continue;
96 for(
unsigned int itStack=0;itStack<V.eleTrack.size()-1;itStack++) {
100 if(stackT1.pointTower.id==0)
continue;
101 for (
unsigned int itStack2=itStack+1;itStack2<V.eleTrack.size();itStack2++) {
103 if(stackT2.pointTower.id==0)
continue;
105 if(stackT1.prMuTrack->
charge()*stackT2.prMuTrack->
charge()<0) hA[40]->Fill(calcMass(stackT1,stackT2));
106 else hA[50]->Fill(calcMass(stackT1,stackT2));
110 if(stackT1.cluster.ET<par_clusterEtZ)
continue;
111 TVector3 stackD1=stackT1.pointTower.R-stackT1.cluster.position;
112 if(stackD1.Mag()>par_delR3DZ)
continue;
113 for (
unsigned int itStack2=itStack+1;itStack2<V.eleTrack.size();itStack2++) {
115 if(stackT2.cluster.ET<par_clusterEtZ)
continue;
116 TVector3 stackD2=stackT2.pointTower.R-stackT2.cluster.position;
117 if(stackD2.Mag()>par_delR3DZ)
continue;
119 if(stackT1.prMuTrack->
charge()*stackT2.prMuTrack->
charge()<0) hA[41]->Fill(calcMass(stackT1,stackT2));
120 else hA[51]->Fill(calcMass(stackT1,stackT2));
124 if(stackT1.cluster.ET/stackT1.cl4x4.ET < par_clustFrac24Z)
continue;
125 for (
unsigned int itStack2=itStack+1;itStack2<V.eleTrack.size();itStack2++) {
127 if(stackT2.cluster.ET<par_clusterEtZ)
continue;
128 TVector3 stackD2=stackT2.pointTower.R-stackT2.cluster.position;
129 if(stackD2.Mag()>par_delR3DZ)
continue;
130 if(stackT2.cluster.ET/stackT2.cl4x4.ET < par_clustFrac24Z)
continue;
132 if(stackT1.prMuTrack->
charge()*stackT2.prMuTrack->
charge()<0) hA[42]->Fill(calcMass(stackT1,stackT2));
133 else hA[52]->Fill(calcMass(stackT1,stackT2));
137 if(stackT1.cluster.ET/stackT1.nearTotET < par_nearTotEtFracZ)
continue;
138 for (
unsigned int itStack2=itStack+1;itStack2<V.eleTrack.size();itStack2++) {
140 if(stackT2.cluster.ET<par_clusterEtZ)
continue;
141 if(stackT2.cluster.ET/stackT2.cl4x4.ET < par_clustFrac24Z)
continue;
142 TVector3 stackD2=stackT2.pointTower.R-stackT2.cluster.position;
143 if(stackD2.Mag()>par_delR3DZ)
continue;
144 if(stackT2.cluster.ET/stackT2.nearTotET < par_nearTotEtFracZ)
continue;
146 if(stackT1.prMuTrack->
charge()*stackT2.prMuTrack->
charge()<0) hA[43]->Fill(calcMass(stackT1,stackT2));
147 else hA[53]->Fill(calcMass(stackT1,stackT2));
155 for(
unsigned int it=0;it<V.eleTrack.size()-1;it++) {
157 if(T1.isMatch2Cl==
false)
continue;
158 assert(T1.cluster.nTower>0);
159 assert(T1.nearTotET>0);
161 float isoET1=T1.cluster.ET /T1.cl4x4.ET;
162 hA[29]->Fill(isoET1);
164 hA[23]->Fill(T1.cluster.ET);
165 hA[0]->Fill(
"tr1",1.);
166 if(T1.cluster.ET<par_clusterEtZ)
continue;
167 hA[0]->Fill(
"et1",1.);
169 float fracET1=T1.cluster.ET /T1.nearTotET;
170 hA[24]->Fill(fracET1);
171 if(fracET1< par_nearTotEtFracZ)
continue;
172 hA[0]->Fill(
"con1",1.);
174 for (
unsigned int it2=it+1;it2<V.eleTrack.size();it2++) {
176 if(T2.isMatch2Cl==
false)
continue;
177 assert(T2.cluster.nTower>0);
178 assert(T2.nearTotET>0);
180 float isoET2=T2.cluster.ET /T2.cl4x4.ET;
181 hA[30]->Fill(isoET2);
183 hA[25]->Fill(T2.cluster.ET);
184 hA[0]->Fill(
"tr2",1.);
185 if(T2.cluster.ET<par_clusterEtZ)
continue;
186 hA[0]->Fill(
"et2",1.);
188 float fracET2=T2.cluster.ET /T2.nearTotET;
189 hA[26]->Fill(fracET2);
190 if(fracET2< par_nearTotEtFracZ)
continue;
191 hA[0]->Fill(
"con2",1.);
193 float e1=T1.cluster.energy;
194 float e2=T2.cluster.energy;
195 TVector3 p1=T1.primP; p1.SetMag(e1);
196 TVector3 p2=T2.primP; p2.SetMag(e2);
198 float del_phi=p1.DeltaPhi(p2);
201 if(xx<-PI+1) xx+=2*PI;
203 if(fabs(del_phi)<par_delPhi12)
continue;
204 hA[0]->Fill(
"phi12",1.);
207 float mass2=(e1+e2)*(e1+e2)-(psum.Dot(psum));
208 if(mass2<1.)
continue;
209 hA[0]->Fill(
"m2",1.);
211 float mass=sqrt(mass2);
215 hA[54]->Fill(calcMass(T1,T2));
216 hA[61]->Fill(zdcRate,calcMass(T1,T2));
221 hA[0]->Fill(
"QQ",1.);
223 hA[33]->Fill(T1.cluster.ET,T1.prMuTrack->
charge()/T1.prMuTrack->
pt());
224 hA[33]->Fill(T2.cluster.ET,T2.prMuTrack->
charge()/T2.prMuTrack->
pt());
225 hA[34]->Fill(T1.pointTower.iEta ,T1.cluster.energy);
226 hA[34]->Fill(T2.pointTower.iEta ,T2.cluster.energy);
227 hA[44]->Fill(calcMass(T1,T2));
228 hA[60]->Fill(zdcRate,calcMass(T1,T2));
231 printf(
"RCC: Found Z w/ invmass=%f\n",mass);
236 if (!wMK->isMC || (wMK->isMC&& wEve.id<500) )
237 { printf(
"\n ZZZZZZZZZZZZZZZZZZZ\n");
238 if(mass<par_minMassZ)
239 wMK->wDisaply->exportEvent(
"Zlow",V,T1);
241 wMK->wDisaply->exportEvent(
"Zgood",V,T1);
242 printf(
"RCC: Found Z w/ invmass=%f\n",mass);
248 if (mass<par_minMassZ)
continue;
249 hA[0]->Fill(
"Zlow",1.);
251 if (mass>par_maxMassZ)
continue;
252 hA[0]->Fill(
"Zhigh",1.);
256 float fmax1=T1.cluster.ET/T1.cl4x4.ET;
257 float fmax2=T2.cluster.ET/T2.cl4x4.ET;
259 hA[21]->Fill(fmax1,fmax2);
260 hA[22]->Fill(T1.cluster.ET,T2.cluster.ET);
263 hA[2]->Fill(T1.prMuTrack->
charge(),T2.prMuTrack->
charge());
264 hA[3]->Fill(T1.prMuTrack->
charge()*T2.prMuTrack->
charge());
265 hA[4]->Fill(p1.Phi(),p2.Phi());
266 hA[5]->Fill(del_phi);
267 hA[6]->Fill(mass,T1.prMuTrack->
charge()/T1.primP.Perp()*T2.prMuTrack->
charge()/T1.primP.Perp());
268 hA[7]->Fill(mass,T1.prMuTrack->
charge()*T2.prMuTrack->
charge());
269 hA[8]->Fill(T1.cluster.ET);
270 if (T1.prMuTrack->
charge()>0)
272 hA[9]->Fill(p1.Eta(),p1.Phi());
273 hA[10]->Fill(p2.Eta(),p2.Phi());
277 hA[10]->Fill(p1.Eta(),p1.Phi());
278 hA[9]->Fill(p2.Eta(),p2.Phi());
281 hA[11]->Fill(fmax1,fmax2);
282 hA[12]->Fill(T1.cluster.ET,T2.cluster.ET);
283 hA[13]->Fill(mass,del_phi);
299 float e1=T1.cluster.energy;
300 float e2=T2.cluster.energy;
301 TVector3 p1=T1.primP; p1.SetMag(e1);
302 TVector3 p2=T2.primP; p2.SetMag(e2);
304 float mass2=(e1+e2)*(e1+e2)-(psum.Dot(psum));
305 if(mass2<1.)
return 0;
306 float mass=sqrt(mass2);
Double_t pt() const
Returns pT at point of dca to primary vertex.
uses tree from W-algo to find Zs
Short_t charge() const
Returns charge.
static StMuEvent * event()
returns pointer to current StMuEvent (class holding the event wise information, e.g. event number, run number)