StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
St2009pubJSMaker.cxx
1 // $Id: St2009pubJSMaker.cxx,v 1.2 2010/03/14 22:50:31 balewski Exp $
2 //
3 //*-- Author : Justin Stevens, IUCF
4 //
5 
6 #include "St2009WMaker.h"
7 #include "St2009pubJSMaker.h"
8 
9 ClassImp(St2009pubJSMaker)
10 
11 //_______________________________________________________
12 //_______________________________________________________
13 St2009pubJSMaker::St2009pubJSMaker(const char *name):StMaker(name){
14  wMK=0;HList=0;
15  par_highEtow=5; // GeV
16  par_awayNTrCut=2;
17 
18 }
19 
20 
21 //_______________________________________________________
22 //_______________________________________________________
23 St2009pubJSMaker::~St2009pubJSMaker(){
24  //
25 }
26 
27 
28 //_______________________________________________________
29 //_______________________________________________________
30 Int_t St2009pubJSMaker::Init(){
31  assert(wMK);
32  par_countTrPt=wMK->par_countTrPt;
33  par_countTowEt=wMK->par_countTowEt;
34  par_awayTotET=30; // old, clean it up, Jan
35  assert(HList);
36  initHistos();
37  return StMaker::Init();
38 }
39 
40 
41 //_______________________________________________________
42 //_______________________________________________________
43 Int_t
45  //printf("-----------in %s\n", GetName());
46 
47  doWanalysis();
48 
49  return kStOK;
50 }
51 
52 //_______________________________________________________
53 //_______________________________________________________
54 void
55 St2009pubJSMaker::doWanalysis(){
56  //has access to whole W-algo-maker data via pointer 'wMK'
57 
58  // run through W cuts to fill other histos............
59  for(unsigned int iv=0;iv<wMK->wEve.vertex.size();iv++) {
60  WeveVertex &V=wMK->wEve.vertex[iv];
61  for(unsigned int it=0;it<V.eleTrack.size();it++) {
62  if(it==0) etowQA(0,V.z); //if there is a reco track do etowQA
63  WeveEleTrack &T=V.eleTrack[it];
64  if(T.isMatch2Cl==false) continue;
65  assert(T.cluster.nTower>0); // internal logical error
66  assert(T.nearTotET>0); // internal logical error
67 
68  if(T.cluster.ET /T.nearTotET< wMK->par_nearTotEtFrac) continue; // too large nearET
69  if(T.awayTotET> par_awayTotET) continue; // too large awayET, Jan
70  //Transverse mass reco
71 
72  //hadronic recoil
73  TVector3 hadronicPt(T.hadronicRecoil.X(),T.hadronicRecoil.Y(),0); //transvers momentum vector
74  hA[25]->Fill(hadronicPt.Perp());
75  hA[26]->Fill(T.hadronicRecoil.Eta());
76  hA[27]->Fill(T.cluster.ET);
77 
78  TVector3 electronPt(T.cluster.position.X(),T.cluster.position.Y(),0); //transvers momentum vector
79  electronPt.SetMag(T.cluster.ET);
80 
81  //neutrino reco
82  TVector3 neutrinoPt=-1*(hadronicPt+electronPt);
83  hA[28]->Fill(neutrinoPt.Perp());
84 
85  float recoDeltaPhi=neutrinoPt.DeltaPhi(electronPt);
86  float Mt=sqrt(2*T.cluster.ET*neutrinoPt.Perp()*(1-cos(recoDeltaPhi)));
87  hA[29]->Fill(Mt); //real data
88  hA[30]->Fill(Mt,T.cluster.ET);
89 
90  if(T.cluster.ET < 30) continue; //enrich W sample
91  //Kinematics plots
92  float eleEta=T.primP.Eta();
93  if(eleEta < -0.8)
94  hA[31]->Fill(T.cluster.energy);
95  if(eleEta > 0.8)
96  hA[32]->Fill(T.cluster.energy);
97  if(eleEta > -0.1 && eleEta < 0.1)
98  hA[33]->Fill(T.cluster.energy);
99 
100  //Can we reco W pL?
101  float eleTheta=T.primP.Theta();
102  float ratioE=T.cluster.energy/40;
103  float pLRecoPlus=80*ratioE*((cos(eleTheta))+sqrt(cos(eleTheta)*cos(eleTheta)+sin(eleTheta)*sin(eleTheta)*(1-ratioE*ratioE)))/(ratioE*ratioE*sin(eleTheta)*sin(eleTheta));//+ solution
104  float pLRecoMinus=80*ratioE*((cos(eleTheta))+sqrt(cos(eleTheta)*cos(eleTheta)+sin(eleTheta)*sin(eleTheta)*(1-ratioE*ratioE)))/(ratioE*ratioE*sin(eleTheta)*sin(eleTheta));//+ solution
105  hA[34]->Fill(pLRecoPlus);
106  hA[35]->Fill(pLRecoMinus);
107 
108 
109  //Other stuff in pubJS
110  hA[11]->Fill(T.nearNTow);
111  hA[12]->Fill(T.nearNTr);
112 
113  hA[24]->Fill(T.cluster.ET/T.nearTotET,T.cluster.position.PseudoRapidity());
114 
115  etowQA(1,-999); //before near cut do etowQA
116  if(T.cluster.ET /T.nearTotET< wMK->par_nearTotEtFrac) continue; // too large nearET
117 
118  hA[7]->Fill(T.awayNTow);
119  hA[8]->Fill(T.awayNTr);
120 
121  etowQA(2,-999); //before away cut do etowQA
122  if(T.awayTotET> par_awayTotET) { // too large awayET, Jan
123  if(T.awayNTr > par_awayNTrCut)
124  hA[9]->Fill(T.cluster.ET);
125  else
126  hA[10]->Fill(T.cluster.ET);
127  continue;
128  }
129 
130  if(T.cluster.ET < 25){ //should be all background
131  hA[13]->Fill(V.z);
132  hA[14]->Fill(T.awayTotET);
133  hA[15]->Fill(T.nearNTow);
134  hA[16]->Fill(T.nearNTr);
135 
136  hA[18]->Fill(V.id);
137  hA[19]->Fill(V.funnyRank);
138  hA[20]->Fill(wMK->wEve.bx48);
139  hA[21]->Fill(wMK->wEve.bx7);
140  hA[22]->Fill(T.cluster.position.PseudoRapidity(),T.cluster.position.Phi());
141  hA[23]->Fill(T.cluster.nTower);
142  }
143 
144  }
145  }
146 }
147 
148 
149 //________________________________________________
150 //________________________________________________
151 void
152 St2009pubJSMaker::etowQA(int whichCut,float zVert){//whichCut gives where in algo you are calling etowQA
153 
154  //loop over all endcap towers
155  for(int iphi=0;iphi<60;iphi++){
156  for(int ieta=0;ieta<12;ieta++){
157  TVector3 towerPos=wMK->positionEtow[iphi][ieta];
158  float ene=wMK->wEve.etow.ene[iphi][ieta];
159  int etabin=abs(ieta-11);//reverse ie. now etabin[0,11] -> phys eta[1,2]
160  //if(iphi==0) cout<<"iphi = "<<iphi<<" phi = "<<towerPos.Phi()<<" ieta = "<<ieta<<" eta = "<<towerPos.Eta()<<" etabin = "<<etabin<<endl;
161 
162  //get ET for test
163  TVector3 primP=towerPos-TVector3(0,0,zVert);
164  primP.SetMag(ene); // it is 3D momentum in the event ref frame
165  float ET=primP.Perp();
166 
167  hB[whichCut]->Fill(etabin,towerPos.Phi(),ene);
168  if(ET > par_highEtow) //high tower
169  hA[whichCut]->Fill(etabin,towerPos.Phi());
170 
171  // Look at vertex Z dependence of energy for all reco vertices that have a track with pT > 10
172  if(whichCut==0 && etabin==11){//only once for all events
173  if(zVert>-100 && zVert<=-50)
174  hA[3]->Fill(ene);
175  else if(zVert>-50 && zVert<=0)
176  hA[4]->Fill(ene);
177  else if(zVert>0 && zVert<=50)
178  hA[5]->Fill(ene);
179  else if(zVert>50 && zVert<=100)
180  hA[6]->Fill(ene);
181  }
182 
183 
184  }
185  }
186  return;
187 }
188 
189 
190 
191 // $Log: St2009pubJSMaker.cxx,v $
192 // Revision 1.2 2010/03/14 22:50:31 balewski
193 // *** empty log message ***
194 //
195 // Revision 1.1 2009/11/23 23:00:18 balewski
196 // code moved spin-pool
197 //
198 // Revision 1.1 2009/11/23 21:11:18 balewski
199 // start
200 //
Definition: Stypes.h:40
virtual Int_t Make()