StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
NonId3DCorrFctn.cxx
1 /***************************************************************************
2  *
3  * $Id: NonId3DCorrFctn.cxx,v 1.6 2004/02/17 19:03:15 jeromel Exp $
4  *
5  * Author: Adam Kisiel, Warsaw University of Technology
6  ***************************************************************************
7  *
8  * Description: part of STAR HBT FRAMEWORK
9  * The correlation function for non-identical particle
10  * correlations. Uses selection on pair kinematics
11  * to perform a "3D-like" analysis.
12  *
13  ***************************************************************************
14  *
15  * $Log: NonId3DCorrFctn.cxx,v $
16  * Revision 1.6 2004/02/17 19:03:15 jeromel
17  * Assignement of float to int is unpredictable
18  *
19  * Revision 1.5 2004/02/02 20:19:15 kisiel
20  * Properly initialize variables in NonId3DCorrFctn
21  *
22  * Revision 1.4 2003/02/02 21:52:49 magestro
23  * small changes to remove compiler warnings
24  *
25  * Revision 1.3 2002/12/12 17:02:49 kisiel
26  * Use KStar instead of 2*KStar for non-identical particles
27  *
28  * Revision 1.2 2001/04/05 22:05:59 kisiel
29  *
30  *
31  * Fix for the Insure++ warnings,
32  * and change the name of the developer, so that
33  * it is clear who to blame :)
34  *
35  * Revision 1.1 2001/04/03 21:02:50 kisiel
36  *
37  *
38  * The correlation function for non-identical particle
39  * correlations. Uses selection on pair kinematics
40  * to perform a "3D-like" analysis.
41  *
42  * Revision 1.4 2000/01/25 17:34:45 laue
43  * I. In order to run the stand alone version of the StHbtMaker the following
44  * changes have been done:
45  * a) all ClassDefs and ClassImps have been put into #ifdef __ROOT__ statements
46  * b) unnecessary includes of StMaker.h have been removed
47  * c) the subdirectory StHbtMaker/doc/Make has been created including everything
48  * needed for the stand alone version
49  *
50  * II. To reduce the amount of compiler warning
51  * a) some variables have been type casted
52  * b) some destructors have been declared as virtual
53  *
54  * Revision 1.3 1999/07/29 02:47:09 lisa
55  * 1) add OpeningAngle correlation function 2) add StHbtMcEventReader 3) make histos in CorrFctns do errors correctly
56  *
57  * Revision 1.2 1999/07/06 22:33:20 lisa
58  * Adjusted all to work in pro and new - dev itself is broken
59  *
60  * Revision 1.1.1.1 1999/06/29 16:02:57 lisa
61  * Installation of StHbtMaker
62  *
63  **************************************************************************/
64 
65 #include "StHbtMaker/CorrFctn/NonId3DCorrFctn.h"
66 #include <cstdio>
67 
68 #ifdef __ROOT__
69 ClassImp(NonId3DCorrFctn)
70 #endif
71 
72 //____________________________
73 NonId3DCorrFctn::NonId3DCorrFctn(char* title, const int& nbins, const float& QinvLo, const float& QinvHi){
74  makeHistos(title, nbins, QinvLo, QinvHi);
75 }
76 
77 //____________________________
78 void NonId3DCorrFctn::makeHistos(char* title, const int& nbins, const float& QinvLo, const float& QinvHi){
79  // set up numerator
80  char TitNumOutP[100] = "NumOutP";
81  strcat(TitNumOutP,title);
82  mNumOutP = new StHbt1DHisto(TitNumOutP,title,nbins,QinvLo,QinvHi);
83  // set up denominator
84  char TitDenOutP[100] = "DenOutP";
85  strcat(TitDenOutP,title);
86  mDenOutP = new StHbt1DHisto(TitDenOutP,title,nbins,QinvLo,QinvHi);
87  // set up ratio
88  char TitRatOutP[100] = "RatOutP";
89  strcat(TitRatOutP,title);
90  mRatOutP = new StHbt1DHisto(TitRatOutP,title,nbins,QinvLo,QinvHi);
91  // set up numerator
92  char TitNumOutN[100] = "NumOutN";
93  strcat(TitNumOutN,title);
94  mNumOutN = new StHbt1DHisto(TitNumOutN,title,nbins,QinvLo,QinvHi);
95  // set up denominator
96  char TitDenOutN[100] = "DenOutN";
97  strcat(TitDenOutN,title);
98  mDenOutN = new StHbt1DHisto(TitDenOutN,title,nbins,QinvLo,QinvHi);
99  // set up ratio
100  char TitRatOutN[100] = "RatOutN";
101  strcat(TitRatOutN,title);
102  mRatOutN = new StHbt1DHisto(TitRatOutN,title,nbins,QinvLo,QinvHi);
103  // set up ratio
104  char TitRatOut[100] = "RatOut";
105  strcat(TitRatOut,title);
106  mRatOut = new StHbt1DHisto(TitRatOut,title,nbins,QinvLo,QinvHi);
107  // set up
108  char TitRatOutNOverP[100] = "RatOutNOverP";
109  strcat(TitRatOutNOverP,title);
110  mRatOutNOverP = new StHbt1DHisto(TitRatOutNOverP,title,nbins,QinvLo,QinvHi);
111 
112  // set up numerator
113  char TitNumSideP[100] = "NumSideP";
114  strcat(TitNumSideP,title);
115  mNumSideP = new StHbt1DHisto(TitNumSideP,title,nbins,QinvLo,QinvHi);
116  // set up denominator
117  char TitDenSideP[100] = "DenSideP";
118  strcat(TitDenSideP,title);
119  mDenSideP = new StHbt1DHisto(TitDenSideP,title,nbins,QinvLo,QinvHi);
120  // set up ratio
121  char TitRatSideP[100] = "RatSideP";
122  strcat(TitRatSideP,title);
123  mRatSideP = new StHbt1DHisto(TitRatSideP,title,nbins,QinvLo,QinvHi);
124  // set up numerator
125  char TitNumSideN[100] = "NumSideN";
126  strcat(TitNumSideN,title);
127  mNumSideN = new StHbt1DHisto(TitNumSideN,title,nbins,QinvLo,QinvHi);
128  // set up denominator
129  char TitDenSideN[100] = "DenSideN";
130  strcat(TitDenSideN,title);
131  mDenSideN = new StHbt1DHisto(TitDenSideN,title,nbins,QinvLo,QinvHi);
132  // set up ratio
133  char TitRatSideN[100] = "RatSideN";
134  strcat(TitRatSideN,title);
135  mRatSideN = new StHbt1DHisto(TitRatSideN,title,nbins,QinvLo,QinvHi);
136  // set up ratio
137  char TitRatSide[100] = "RatSide";
138  strcat(TitRatSide,title);
139  mRatSide = new StHbt1DHisto(TitRatSide,title,nbins,QinvLo,QinvHi);
140  // set up
141  char TitRatSideNOverP[100] = "RatSideNOverP";
142  strcat(TitRatSideNOverP,title);
143  mRatSideNOverP = new StHbt1DHisto(TitRatSideNOverP,
144  title,nbins,QinvLo,QinvHi);
145 
146  // set up numerator
147  char TitNumLongP[100] = "NumLongP";
148  strcat(TitNumLongP,title);
149  mNumLongP = new StHbt1DHisto(TitNumLongP,title,nbins,QinvLo,QinvHi);
150  // set up denominator
151  char TitDenLongP[100] = "DenLongP";
152  strcat(TitDenLongP,title);
153  mDenLongP = new StHbt1DHisto(TitDenLongP,title,nbins,QinvLo,QinvHi);
154  // set up ratio
155  char TitRatLongP[100] = "RatLongP";
156  strcat(TitRatLongP,title);
157  mRatLongP = new StHbt1DHisto(TitRatLongP,title,nbins,QinvLo,QinvHi);
158  // set up numerator
159  char TitNumLongN[100] = "NumLongN";
160  strcat(TitNumLongN,title);
161  mNumLongN = new StHbt1DHisto(TitNumLongN,title,nbins,QinvLo,QinvHi);
162  // set up denominator
163  char TitDenLongN[100] = "DenLongN";
164  strcat(TitDenLongN,title);
165  mDenLongN = new StHbt1DHisto(TitDenLongN,title,nbins,QinvLo,QinvHi);
166  // set up ratio
167  char TitRatLongN[100] = "RatLongN";
168  strcat(TitRatLongN,title);
169  mRatLongN = new StHbt1DHisto(TitRatLongN,title,nbins,QinvLo,QinvHi);
170  // set up ratio
171  char TitRatLong[100] = "RatLong";
172  strcat(TitRatLong,title);
173  mRatLong = new StHbt1DHisto(TitRatLong,title,nbins,QinvLo,QinvHi);
174  // set up
175  char TitRatLongNOverP[100] = "RatLongNOverP";
176  strcat(TitRatLongNOverP,title);
177  mRatLongNOverP = new StHbt1DHisto(TitRatLongNOverP,title,nbins,QinvLo,QinvHi);
178 
179  // to enable error bar calculation...
180  mNumOutP->Sumw2();
181  mDenOutP->Sumw2();
182  mRatOutP->Sumw2();
183  mNumOutN->Sumw2();
184  mDenOutN->Sumw2();
185  mRatOutN->Sumw2();
186  mRatOut->Sumw2();
187  mRatOutNOverP->Sumw2();
188 
189  mNumSideP->Sumw2();
190  mDenSideP->Sumw2();
191  mRatSideP->Sumw2();
192  mNumSideN->Sumw2();
193  mDenSideN->Sumw2();
194  mRatSideN->Sumw2();
195  mRatSide->Sumw2();
196  mRatSideNOverP->Sumw2();
197 
198  mNumLongP->Sumw2();
199  mDenLongP->Sumw2();
200  mRatLongP->Sumw2();
201  mNumLongN->Sumw2();
202  mDenLongN->Sumw2();
203  mRatLongN->Sumw2();
204  mRatLong->Sumw2();
205  mRatLongNOverP->Sumw2();
206 
207  float kstarlim = 0.5;
208  float klim = 0.6 * kstarlim;
209 
210  char htitle[200];
211  strcpy(htitle,"HOutKSame");
212  mHOutKSame = new StHbt2DHisto(strcat(htitle,title),htitle,
213  100,-klim,klim,nbins,QinvLo,kstarlim);
214  strcpy(htitle,"HOutKDiff");
215  mHOutKDiff = new StHbt2DHisto(strcat(htitle,title),htitle,
216  100,-klim,klim,nbins,QinvLo,kstarlim);
217  strcpy(htitle,"HSideKSame");
218  mHSideKSame = new StHbt2DHisto(strcat(htitle,title),htitle,
219  100,-klim,klim,nbins,QinvLo,kstarlim);
220  strcpy(htitle,"HSideKDiff");
221  mHSideKDiff = new StHbt2DHisto(strcat(htitle,title),htitle,
222  100,-klim,klim,nbins,QinvLo,kstarlim);
223  strcpy(htitle,"HLongKSame");
224  mHLongKSame = new StHbt2DHisto(strcat(htitle,title),htitle,
225  100,-klim,klim,nbins,QinvLo,kstarlim);
226  strcpy(htitle,"HLongKDiff");
227  mHLongKDiff = new StHbt2DHisto(strcat(htitle,title),htitle,
228  100,-klim,klim,nbins,QinvLo,kstarlim);
229 // strcpy(htitle,"HQSideExitNum");
230 // mHQSideExitNum = new StHbt2DHisto(strcat(htitle,title),htitle,
231 // 100,-klim2,klim2,nbins,0.0,exitlim);
232 // strcpy(htitle,"HKStarExitNumSideP");
233 // mHKStarExitNumSideP = new StHbt2DHisto(strcat(htitle,title),htitle,
234 // nbins,QinvLo,QinvHi,100,0.0,exitlim);
235 // strcpy(htitle,"HKStarExitNumSideN");
236 // mHKStarExitNumSideN = new StHbt2DHisto(strcat(htitle,title),htitle,
237 // nbins,QinvLo,QinvHi,100,0.0,exitlim);
238 // strcpy(htitle,"HQOutExitNum");
239 // mHQOutExitNum = new StHbt2DHisto(strcat(htitle,title),htitle,
240 // 100,-klim2,klim2,nbins,0.0,exitlim);
241 // strcpy(htitle,"HKStarExitNumOutP");
242 // mHKStarExitNumOutP = new StHbt2DHisto(strcat(htitle,title),htitle,
243 // nbins,QinvLo,QinvHi,100,0.0,exitlim);
244 // strcpy(htitle,"HKStarExitNumOutN");
245 // mHKStarExitNumOutN = new StHbt2DHisto(strcat(htitle,title),htitle,
246 // nbins,QinvLo,QinvHi,100,0.0,exitlim);
247 // strcpy(htitle,"HQSideExitDen");
248 // mHQSideExitDen = new StHbt2DHisto(strcat(htitle,title),htitle,
249 // 100,-klim2,klim2,nbins,0.0,exitlim);
250 // strcpy(htitle,"HKStarExitDenSideP");
251 // mHKStarExitDenSideP = new StHbt2DHisto(strcat(htitle,title),htitle,
252 // nbins,QinvLo,QinvHi,100,0.0,exitlim);
253 // strcpy(htitle,"HKStarExitDenSideN");
254 // mHKStarExitDenSideN = new StHbt2DHisto(strcat(htitle,title),htitle,
255 // nbins,QinvLo,QinvHi,100,0.0,exitlim);
256 // strcpy(htitle,"HQOutExitDen");
257 // mHQOutExitDen = new StHbt2DHisto(strcat(htitle,title),htitle,
258 // 100,-klim2,klim2,nbins,0.0,exitlim);
259 // strcpy(htitle,"HKStarExitDenOutP");
260 // mHKStarExitDenOutP = new StHbt2DHisto(strcat(htitle,title),htitle,
261 // nbins,QinvLo,QinvHi,100,0.0,exitlim);
262 // strcpy(htitle,"HKStarExitDenOutN");
263 // mHKStarExitDenOutN = new StHbt2DHisto(strcat(htitle,title),htitle,
264 // nbins,QinvLo,QinvHi,100,0.0,exitlim);
265 
266  mKCompCut = -1000.0;
267  mqSideSel = 0;
268 }
269 
270 //____________________________
271 NonId3DCorrFctn::NonId3DCorrFctn(char* title, const int& nbins, const float& QinvLo,
272  const float& QinvHi, const int aqSideSel){
273  makeHistos(title, nbins, QinvLo, QinvHi);
274  mqSideSel = aqSideSel;
275  mKCompCut = -1000.0;
276 }
277 
278 
279 NonId3DCorrFctn::NonId3DCorrFctn(char* title, const int& nbins, const float& QinvLo,
280  const float& QinvHi, const float KCompCut)
281 {
282  makeHistos(title, nbins, QinvLo, QinvHi);
283  mKCompCut = KCompCut;
284  mqSideSel = 0;
285 }
286 
287 
288 //____________________________
289 NonId3DCorrFctn::~NonId3DCorrFctn(){
290  delete mNumOutP;
291  delete mDenOutP;
292  delete mRatOutP;
293  delete mNumOutN;
294  delete mDenOutN;
295  delete mRatOutN;
296  delete mRatOut;
297  delete mRatOutNOverP;
298 
299  delete mNumSideP;
300  delete mDenSideP;
301  delete mRatSideP;
302  delete mNumSideN;
303  delete mDenSideN;
304  delete mRatSideN;
305  delete mRatSide;
306  delete mRatSideNOverP;
307 
308  delete mNumLongP;
309  delete mDenLongP;
310  delete mRatLongP;
311  delete mNumLongN;
312  delete mDenLongN;
313  delete mRatLongN;
314  delete mRatLong;
315  delete mRatLongNOverP;
316 
317  delete mHOutKSame;
318  delete mHOutKDiff;
319  delete mHSideKSame;
320  delete mHSideKDiff;
321  delete mHLongKSame;
322  delete mHLongKDiff;
323 
324 // delete mHQSideExitNum;
325 // delete mHKStarExitNumSideP;
326 // delete mHKStarExitNumSideN;
327 // delete mHQOutExitNum;
328 // delete mHKStarExitNumOutP;
329 // delete mHKStarExitNumOutN;
330 // delete mHQSideExitDen;
331 // delete mHKStarExitDenSideP;
332 // delete mHKStarExitDenSideN;
333 // delete mHQOutExitDen;
334 // delete mHKStarExitDenOutP;
335 // delete mHKStarExitDenOutN;
336 
337 // delete mHPt1KStarOutNum;
338 // delete mHPt1KStarOutDen;
339 // delete mHPt2KStarOutNum;
340 // delete mHPt2KStarOutDen;
341 }
342 //_________________________
343 void NonId3DCorrFctn::Finish(){
344  double tScale;
345  int tLastNormBin = mNumOutP->GetNbinsX();
346  int tFirstNormBin = tLastNormBin/2+1;
347 
348 // >>> Out
349  // Make cvk dependant correlation function
350  mRatOutP->Divide(mNumOutP,mDenOutP,1.0,1.0);
351  tScale = mRatOutP->Integral(tFirstNormBin,tLastNormBin);
352  tScale/= (tLastNormBin-tFirstNormBin+1);
353  mRatOutP->Scale(1./tScale);
354  mRatOutN->Divide(mNumOutN,mDenOutN,1.0,1.0);
355  tScale = mRatOutN->Integral(tFirstNormBin,tLastNormBin);
356  tScale/= (tLastNormBin-tFirstNormBin+1);
357  mRatOutN->Scale(1./tScale);
358  mRatOutNOverP->Divide(mRatOutN,mRatOutP,1.0,1.0);
359  // Regular correlation function
360  TH1D tHNumOut(*mNumOutP);
361  tHNumOut.SetName("tHNumOut");
362  tHNumOut.Add(mNumOutN);
363  TH1D tHDenOut(*mDenOutP);
364  tHDenOut.SetName("tHDenOut");
365  tHDenOut.Add(mDenOutN);
366  mRatOut->Divide(&tHNumOut,&tHDenOut);
367  tScale = mRatOut->Integral(tFirstNormBin,tLastNormBin);
368  tScale/= (tLastNormBin-tFirstNormBin+1);
369  mRatOut->Scale(1./tScale);
370 
371 // >>> Side
372  // Make cvk dependant correlation function
373  mRatSideP->Divide(mNumSideP,mDenSideP,1.0,1.0);
374  tScale = mRatSideP->Integral(tFirstNormBin,tLastNormBin);
375  tScale/= (tLastNormBin-tFirstNormBin+1);
376  mRatSideP->Scale(1./tScale);
377  mRatSideN->Divide(mNumSideN,mDenSideN,1.0,1.0);
378  tScale = mRatSideN->Integral(tFirstNormBin,tLastNormBin);
379  tScale/= (tLastNormBin-tFirstNormBin+1);
380  mRatSideN->Scale(1./tScale);
381  mRatSideNOverP->Divide(mRatSideN,mRatSideP,1.0,1.0);
382  // Regular correlation function
383  TH1D tHNumSide(*mNumSideP);
384  tHNumSide.SetName("tHNumSide");
385  tHNumSide.Add(mNumSideN);
386  TH1D tHDenSide(*mDenSideP);
387  tHDenSide.SetName("tHDenSide");
388  tHDenSide.Add(mDenSideN);
389  mRatSide->Divide(&tHNumSide,&tHDenSide);
390  tScale = mRatSide->Integral(tFirstNormBin,tLastNormBin);
391  tScale/= (tLastNormBin-tFirstNormBin+1);
392  mRatSide->Scale(1./tScale);
393 
394 // >>> Long
395  // Make cvk dependant correlation function
396  mRatLongP->Divide(mNumLongP,mDenLongP,1.0,1.0);
397  tScale = mRatLongP->Integral(tFirstNormBin,tLastNormBin);
398  tScale/= (tLastNormBin-tFirstNormBin+1);
399  mRatLongP->Scale(1./tScale);
400  mRatLongN->Divide(mNumLongN,mDenLongN,1.0,1.0);
401  tScale = mRatLongN->Integral(tFirstNormBin,tLastNormBin);
402  tScale/= (tLastNormBin-tFirstNormBin+1);
403  mRatLongN->Scale(1./tScale);
404  mRatLongNOverP->Divide(mRatLongN,mRatLongP,1.0,1.0);
405  // Regular correlation function
406  TH1D tHNumLong(*mNumLongP);
407  tHNumLong.SetName("tHNumLong");
408  tHNumLong.Add(mNumLongN);
409  TH1D tHDenLong(*mDenLongP);
410  tHDenLong.SetName("tHDenLong");
411  tHDenLong.Add(mDenLongN);
412  mRatLong->Divide(&tHNumLong,&tHDenLong);
413  tScale = mRatLong->Integral(tFirstNormBin,tLastNormBin);
414  tScale/= (tLastNormBin-tFirstNormBin+1);
415  mRatLong->Scale(1./tScale);
416 }
417 
418 void NonId3DCorrFctn::Write(){
419  mNumOutP->Write();
420  mDenOutP->Write();
421  mRatOutP->Write();
422  mNumOutN->Write();
423  mDenOutN->Write();
424  mRatOutN->Write();
425  mRatOut->Write();
426  mRatOutNOverP->Write();
427 
428  mNumSideP->Write();
429  mDenSideP->Write();
430  mRatSideP->Write();
431  mNumSideN->Write();
432  mDenSideN->Write();
433  mRatSideN->Write();
434  mRatSide->Write();
435  mRatSideNOverP->Write();
436 
437  mNumLongP->Write();
438  mDenLongP->Write();
439  mRatLongP->Write();
440  mNumLongN->Write();
441  mDenLongN->Write();
442  mRatLongN->Write();
443  mRatLong->Write();
444  mRatLongNOverP->Write();
445 
446  mHOutKSame->Write();
447  mHOutKDiff->Write();
448  mHSideKSame->Write();
449  mHSideKDiff->Write();
450  mHLongKSame->Write();
451  mHLongKDiff->Write();
452 
453 // mHQSideExitNum->Write();
454 // mHKStarExitNumSideP->Write();
455 // mHKStarExitNumSideN->Write();
456 // mHQOutExitNum->Write();
457 // mHKStarExitNumOutP->Write();
458 // mHKStarExitNumOutN->Write();
459 // mHQSideExitDen->Write();
460 // mHKStarExitDenSideP->Write();
461 // mHKStarExitDenSideN->Write();
462 // mHQOutExitDen->Write();
463 // mHKStarExitDenOutP->Write();
464 // mHKStarExitDenOutN->Write();
465 
466 // mHPt1KStarOutNum->Write();
467 // mHPt1KStarOutDen->Write();
468 // mHPt2KStarOutNum->Write();
469 // mHPt2KStarOutDen->Write();
470 }
471 
472 //____________________________
473 StHbtString NonId3DCorrFctn::Report(){
474  string stemp = "Non-Identical 3D Correlation Function Report:\n";
475  char ctemp[1000];
476  sprintf(ctemp,"Number of entries in out numerator:\t%E\n",mHOutKSame->GetEntries());
477  stemp += ctemp;
478  sprintf(ctemp,"Number of entries in out denominator:\t%E\n",mHOutKDiff->GetEntries());
479  stemp += ctemp;
480  sprintf(ctemp,"Number of entries in out ratio:\t%E\n",mRatOut->GetEntries());
481  stemp += ctemp;
482  sprintf(ctemp,"Number of entries in side numerator:\t%E\n",mHSideKSame->GetEntries());
483  stemp += ctemp;
484  sprintf(ctemp,"Number of entries in side denominator:\t%E\n",mHSideKDiff->GetEntries());
485  stemp += ctemp;
486  sprintf(ctemp,"Number of entries in side ratio:\t%E\n",mRatSide->GetEntries());
487  stemp += ctemp;
488  sprintf(ctemp,"Number of entries in long numerator:\t%E\n",mHLongKSame->GetEntries());
489  stemp += ctemp;
490  sprintf(ctemp,"Number of entries in long denominator:\t%E\n",mHLongKDiff->GetEntries());
491  stemp += ctemp;
492  sprintf(ctemp,"Number of entries in long ratio:\t%E\n",mRatLong->GetEntries());
493  stemp += ctemp;
494  StHbtString returnThis = stemp;
495  return returnThis;
496 }
497 //____________________________
498 void NonId3DCorrFctn::AddRealPair(const StHbtPair* pair){
499  double tKStar = fabs(pair->KStar());
500  double tKOut = pair->dKOut();
501  double tKSide = pair->dKSide();
502  double tKLong = pair->dKLong();
503  //double exitsep = pair->NominalTpcExitSeparation();
504 
505  if (mKCompCut <= 0.0)
506  {
507  if ((!mqSideSel) || (mqSideSel * tKSide > 0)) {
508  if(tKOut>0.){
509  mNumOutP->Fill(tKStar);
510 // mHKStarExitNumOutP->Fill(tKStar,exitsep,1.0);
511  }
512  else{
513  mNumOutN->Fill(tKStar);
514 // mHKStarExitNumOutN->Fill(tKStar,exitsep,1.0);
515  }
516  if(tKSide>0.){
517  mNumSideP->Fill(tKStar);
518 // mHKStarExitNumSideP->Fill(tKStar,exitsep,1.0);
519  }
520  else{
521  mNumSideN->Fill(tKStar);
522 // mHKStarExitNumSideN->Fill(tKStar,exitsep,1.0);
523  }
524  if(tKLong>0.){
525  mNumLongP->Fill(tKStar);
526  }
527  else{
528  mNumLongN->Fill(tKStar);
529  }
530  }
531  }
532  else
533  {
534  if ((fabs(tKLong) < mKCompCut) && (fabs(tKSide) < mKCompCut))
535  {
536  if(tKOut>0.){
537  mNumOutP->Fill(tKStar);
538 // mHKStarExitNumOutP->Fill(tKStar,exitsep,1.0);
539  }
540  else{
541  mNumOutN->Fill(tKStar);
542 // mHKStarExitNumOutN->Fill(tKStar,exitsep,1.0);
543  }
544  }
545  if ((fabs(tKOut) < mKCompCut) && (fabs(tKLong) < mKCompCut))
546  {
547  if(tKSide>0.){
548  mNumSideP->Fill(tKStar);
549 // mHKStarExitNumSideP->Fill(tKStar,exitsep,1.0);
550  }
551  else{
552  mNumSideN->Fill(tKStar);
553 // mHKStarExitNumSideN->Fill(tKStar,exitsep,1.0);
554  }
555  }
556  if ((fabs(tKOut) < mKCompCut) && (fabs(tKSide) < mKCompCut))
557  {
558  if(tKLong>0.){
559  mNumLongP->Fill(tKStar);
560  }
561  else{
562  mNumLongN->Fill(tKStar);
563  }
564  }
565  }
566  mHOutKSame->Fill(tKOut, tKStar, 1.);
567  mHSideKSame->Fill(tKSide, tKStar, 1.);
568  mHLongKSame->Fill(tKLong, tKStar, 1.);
569 
570 // mHPt1KStarOutNum->Fill(pair->track1()->FourMomentum().perp(),tKStar*((tKOut>0)*2-1),1.0);
571 // mHPt2KStarOutNum->Fill(pair->track2()->FourMomentum().perp(),tKStar*((tKOut>0)*2-1),1.0);
572 
573 // mHQSideExitNum->Fill(tKSide,exitsep,1.0);
574 // mHQOutExitNum->Fill(tKOut,exitsep,1.0);
575 }
576 //____________________________
577 void NonId3DCorrFctn::AddMixedPair(const StHbtPair* pair){
578  double tKStar = fabs(pair->KStar());
579  double tKOut = pair->dKOut();
580  double tKSide = pair->dKSide();
581  double tKLong = pair->dKLong();
582  //double exitsep = pair->NominalTpcExitSeparation();
583 
584  if (mKCompCut <= 0.0)
585  {
586  if ((!mqSideSel) || (mqSideSel * tKSide > 0)) {
587  if(tKOut>0.){
588  mDenOutP->Fill(tKStar);
589 // mHKStarExitDenOutP->Fill(tKStar,exitsep,1.0);
590  }
591  else{
592  mDenOutN->Fill(tKStar);
593 // mHKStarExitDenSideP->Fill(tKStar,exitsep,1.0);
594  }
595  if(tKSide>0.){
596  mDenSideP->Fill(tKStar);
597 // mHKStarExitDenSideP->Fill(tKStar,exitsep,1.0);
598  }
599  else{
600  mDenSideN->Fill(tKStar);
601 // mHKStarExitDenSideN->Fill(tKStar,exitsep,1.0);
602  }
603  if(tKLong>0.){
604  mDenLongP->Fill(tKStar);
605  }
606  else{
607  mDenLongN->Fill(tKStar);
608  }
609  }
610  }
611  else
612  {
613  if ((fabs(tKLong) < mKCompCut) && (fabs(tKSide) < mKCompCut))
614  {
615  if(tKOut>0.){
616  mDenOutP->Fill(tKStar);
617 // mHKStarExitDenOutP->Fill(tKStar,exitsep,1.0);
618  }
619  else{
620  mDenOutN->Fill(tKStar);
621 // mHKStarExitDenOutN->Fill(tKStar,exitsep,1.0);
622  }
623  }
624  if ((fabs(tKOut) < mKCompCut) && (fabs(tKLong) < mKCompCut))
625  {
626  if(tKSide>0.){
627  mDenSideP->Fill(tKStar);
628 // mHKStarExitDenSideP->Fill(tKStar,exitsep,1.0);
629  }
630  else{
631  mDenSideN->Fill(tKStar);
632 // mHKStarExitDenSideN->Fill(tKStar,exitsep,1.0);
633  }
634  }
635  if ((fabs(tKOut) < mKCompCut) && (fabs(tKSide) < mKCompCut))
636  {
637  if(tKLong>0.){
638  mDenLongP->Fill(tKStar);
639  }
640  else{
641  mDenLongN->Fill(tKStar);
642  }
643  }
644  }
645 
646  mHOutKDiff->Fill(tKOut, tKStar, 1.);
647  mHSideKDiff->Fill(tKSide, tKStar, 1.);
648  mHLongKDiff->Fill(tKLong, tKStar, 1.);
649 
650 // mHQSideExitDen->Fill(tKSide,exitsep,1.0);
651 // mHQOutExitDen->Fill(tKOut,exitsep,1.0);
652 // mHPt1KStarOutDen->Fill(pair->track1()->FourMomentum().perp(),tKStar*((tKOut>0)*2-1),1.0);
653 // mHPt2KStarOutDen->Fill(pair->track2()->FourMomentum().perp(),tKStar*((tKOut>0)*2-1),1.0);
654 }
655 
656