+
+ //cout << "done with track" << endl;
+ } //iTrack
+ } //aod
+ }
+
+
+ //cout << "Filling histograms now" << endl;
+ _m0->Fill(_mult0);
+ _m1->Fill(_mult1);
+ _m2->Fill(_mult2);
+ _m3->Fill(_mult3);
+ _m4->Fill(_mult4);
+ _m5->Fill(_mult5);
+ _m6->Fill(_mult6);
+ _vertexZ->Fill(vertexZ);
+
+ if (_singlesOnly)
+ {
+ // nothing to do here.
+ }
+ else
+ {
+ if (_sameFilter)
+ {
+ _n1_1_vsM->Fill(centrality, __n1_1);
+ _s1pt_1_vsM->Fill(centrality, __s1pt_1);
+ _n1Nw_1_vsM->Fill(centrality, __n1Nw_1);
+ _s1ptNw_1_vsM->Fill(centrality, __s1ptNw_1);
+ _n1_2_vsM->Fill(centrality, __n1_1);
+ _s1pt_2_vsM->Fill(centrality, __s1pt_1);
+ _n1Nw_2_vsM->Fill(centrality, __n1Nw_1);
+ _s1ptNw_2_vsM->Fill(centrality, __s1ptNw_1);
+ // reset pair counters
+ __n2_12 = __s2ptpt_12 = __s2NPt_12 = __s2PtN_12 = 0;
+ __n2Nw_12 = __s2ptptNw_12 = __s2NPtNw_12 = __s2PtNNw_12 = 0;
+ if (_field>0)
+ {
+ for (int i1=0; i1<k1; i1++)
+ {
+ ////cout << " i1:" << i1 << endl;
+ id_1 = _id_1[i1]; ////cout << " id_1:" << id_1 << endl;
+ q_1 = _charge_1[i1]; ////cout << " q_1:" << q_1 << endl;
+ iEtaPhi_1 = _iEtaPhi_1[i1]; ////cout << " iEtaPhi_1:" << iEtaPhi_1 << endl;
+ iPt_1 = _iPt_1[i1]; ////cout << " iPt_1:" << iPt_1 << endl;
+ corr_1 = _correction_1[i1]; ////cout << " corr_1:" << corr_1 << endl;
+ pt_1 = _pt_1[i1]; ////cout << " pt_1:" << pt_1 << endl;
+ dedx_1 = _dedx_1[i1]; ////cout << " dedx_1:" << dedx_1 << endl;
+ //1 and 2
+ for (int i2=i1+1; i2<k1; i2++)
+ {
+ ////cout << " i2:" << i2 << endl;
+ id_2 = _id_1[i2]; ////cout << " id_2:" << id_2 << endl;
+ if (id_1!=id_2)
+ {
+ q_2 = _charge_1[i2]; ////cout << " q_1:" << q_1 << endl;
+ iEtaPhi_2 = _iEtaPhi_1[i2]; ////cout << " iEtaPhi_1:" << iEtaPhi_1 << endl;
+ iPt_2 = _iPt_1[i2]; ////cout << " iPt_1:" << iPt_1 << endl;
+ corr_2 = _correction_1[i2]; ////cout << " corr_1:" << corr_1 << endl;
+ pt_2 = _pt_1[i2]; ////cout << " pt_1:" << pt_1 << endl;
+ dedx_2 = _dedx_1[i2]; ////cout << " dedx_2:" << dedx_2 << endl;
+ corr = corr_1*corr_2;
+ if (q_2>q_1 || (q_1>0 && q_2>0 && pt_2<=pt_1) || (q_1<0 && q_2<0 && pt_2>=pt_1))
+ {
+ ij = iEtaPhi_1*_nBins_etaPhi_1 + iEtaPhi_2; ////cout << " ij:" << ij<< endl;
+ }
+ else // swap particles
+ {
+ ij = iEtaPhi_2*_nBins_etaPhi_1 + iEtaPhi_1; ////cout << " ij:" << ij<< endl;
+ }
+
+ __n2_12 += corr;
+ __n2_12_vsEtaPhi[ij] += corr;
+ ptpt = pt_1*pt_2;
+ __s2ptpt_12 += corr*ptpt;
+ __s2PtN_12 += corr*pt_1;
+ __s2NPt_12 += corr*pt_2;
+ __s2ptpt_12_vsEtaPhi[ij] += corr*ptpt;
+ __s2PtN_12_vsEtaPhi[ij] += corr*pt_1;
+ __s2NPt_12_vsEtaPhi[ij] += corr*pt_2;
+ __n2_12_vsPtPt[iPt_1*_nBins_pt_2 + iPt_2] += corr;
+
+ __n2Nw_12 += 1;
+ __s2ptptNw_12 += ptpt;
+ __s2PtNNw_12 += pt_1;
+ __s2NPtNw_12 += pt_2;
+
+ }
+ } //i2
+ } //i1
+ }
+ else // field<0
+ {
+ for (int i1=0; i1<k1; i1++)
+ {
+ ////cout << " i1:" << i1 << endl;
+ id_1 = _id_1[i1]; ////cout << " id_1:" << id_1 << endl;
+ q_1 = _charge_1[i1]; ////cout << " q_1:" << q_1 << endl;
+ iEtaPhi_1 = _iEtaPhi_1[i1]; ////cout << " iEtaPhi_1:" << iEtaPhi_1 << endl;
+ iPt_1 = _iPt_1[i1]; ////cout << " iPt_1:" << iPt_1 << endl;
+ corr_1 = _correction_1[i1]; ////cout << " corr_1:" << corr_1 << endl;
+ pt_1 = _pt_1[i1]; ////cout << " pt_1:" << pt_1 << endl;
+ dedx_1 = _dedx_1[i1]; ////cout << " dedx_1:" << dedx_1 << endl;
+ //1 and 2
+ for (int i2=i1+1; i2<k1; i2++)
+ {
+ ////cout << " i2:" << i2 << endl;
+ id_2 = _id_1[i2]; ////cout << " id_2:" << id_2 << endl;
+ if (id_1!=id_2)
+ {
+ q_2 = _charge_1[i2]; ////cout << " q_2:" << q_2 << endl;
+ iEtaPhi_2 = _iEtaPhi_1[i2]; ////cout << " iEtaPhi_2:" << iEtaPhi_2 << endl;
+ iPt_2 = _iPt_1[i2]; ////cout << " iPt_2:" << iPt_2 << endl;
+ corr_2 = _correction_1[i2]; ////cout << " corr_2:" << corr_2 << endl;
+ pt_2 = _pt_1[i2]; ////cout << " pt_2:" << pt_2 << endl;
+ dedx_2 = _dedx_1[i2]; ////cout << " dedx_2:" << dedx_2 << endl;
+ corr = corr_1*corr_2;
+ if ( q_2<q_1 || (q_1>0 && q_2>0 && pt_2>=pt_1) || (q_1<0 && q_2<0 && pt_2<=pt_1))
+ {
+ ij = iEtaPhi_1*_nBins_etaPhi_1 + iEtaPhi_2; ////cout << " ij:" << ij<< endl;
+ }
+ else // swap particles
+ {
+ ij = iEtaPhi_2*_nBins_etaPhi_1 + iEtaPhi_1; ////cout << " ij:" << ij<< endl;
+ }
+
+ __n2_12 += corr;
+ __n2_12_vsEtaPhi[ij] += corr;
+ ptpt = pt_1*pt_2;
+ __s2ptpt_12 += corr*ptpt;
+ __s2PtN_12 += corr*pt_1;
+ __s2NPt_12 += corr*pt_2;
+ __s2ptpt_12_vsEtaPhi[ij] += corr*ptpt;
+ __s2PtN_12_vsEtaPhi[ij] += corr*pt_1;
+ __s2NPt_12_vsEtaPhi[ij] += corr*pt_2;
+ __n2_12_vsPtPt[iPt_1*_nBins_pt_2 + iPt_2] += corr;
+
+ __n2Nw_12 += 1;
+ __s2ptptNw_12 += ptpt;
+ __s2PtNNw_12 += pt_1;
+ __s2NPtNw_12 += pt_2;
+
+ }
+ } //i2
+ } //i1
+ }
+ }
+ else // filter 1 and 2 are different -- must do all particle pairs...
+ {
+ _n1_1_vsM->Fill(centrality, __n1_1);
+ _s1pt_1_vsM->Fill(centrality, __s1pt_1);
+ _n1Nw_1_vsM->Fill(centrality, __n1Nw_1);
+ _s1ptNw_1_vsM->Fill(centrality, __s1ptNw_1);
+ _n1_2_vsM->Fill(centrality, __n1_2);
+ _s1pt_2_vsM->Fill(centrality, __s1pt_2);
+ _n1Nw_2_vsM->Fill(centrality, __n1Nw_2);
+ _s1ptNw_2_vsM->Fill(centrality, __s1ptNw_2);
+ // reset pair counters
+ __n2_12 = __s2ptpt_12 = __s2NPt_12 = __s2PtN_12 = 0;
+ __n2Nw_12 = __s2ptptNw_12 = __s2NPtNw_12 = __s2PtNNw_12 = 0;
+ for (int i1=0; i1<k1; i1++)
+ {
+ ////cout << " i1:" << i1 << endl;
+ id_1 = _id_1[i1]; ////cout << " id_1:" << id_1 << endl;
+ q_1 = _charge_1[i1]; ////cout << " q_1:" << q_1 << endl;
+ iEtaPhi_1 = _iEtaPhi_1[i1]; ////cout << " iEtaPhi_1:" << iEtaPhi_1 << endl;
+ iPt_1 = _iPt_1[i1]; ////cout << " iPt_1:" << iPt_1 << endl;
+ corr_1 = _correction_1[i1]; ////cout << " corr_1:" << corr_1 << endl;
+ pt_1 = _pt_1[i1]; ////cout << " pt_1:" << pt_1 << endl;
+ px_1 = _px_1[i1]; ////cout << " px_1:" << px_1 << endl;
+ py_1 = _py_1[i1]; ////cout << " py_1:" << py_1 << endl;
+ pz_1 = _pz_1[i1]; ////cout << " pz_1:" << pz_1 << endl;
+ dedx_1 = _dedx_1[i1]; ////cout << " dedx_1:" << dedx_1 << endl;
+
+ //1 and 2
+ for (int i2=0; i2<k2; i2++)
+ {
+ ////cout << " i2:" << i2 << endl;
+ id_2 = _id_2[i2]; ////cout << " id_2:" << id_2 << endl;
+ if (id_1!=id_2) // exclude auto correlation
+ {
+ q_2 = _charge_2[i2]; ////cout << " q_2:" << q_2 << endl;
+ iEtaPhi_2 = _iEtaPhi_2[i2]; ////cout << " iEtaPhi_2:" << iEtaPhi_2 << endl;
+ iPt_2 = _iPt_2[i2]; ////cout << " iPt_2:" << iPt_2 << endl;
+ corr_2 = _correction_2[i2]; ////cout << " corr_2:" << corr_2 << endl;
+ pt_2 = _pt_2[i2]; ////cout << " pt_2:" << pt_2 << endl;
+ px_2 = _px_2[i2]; ////cout << " px_2:" << px_2 << endl;
+ py_2 = _py_2[i2]; ////cout << " py_2:" << py_2 << endl;
+ pz_2 = _pz_2[i2]; ////cout << " pz_2:" << pz_2 << endl;
+ dedx_2 = _dedx_2[i2]; ////cout << " dedx_2:" << dedx_2 << endl;
+ if (_rejectPairConversion)
+ {
+ float e1Sq = massElecSq + pt_1*pt_1 + pz_1*pz_1;
+ float e2Sq = massElecSq + pt_2*pt_2 + pz_2*pz_2;
+ float mInvSq = 2*(massElecSq + sqrt(e1Sq*e2Sq) - px_1*px_2 - py_1*py_2 - pz_1*pz_2 );
+ float mInv = sqrt(mInvSq);
+ _invMass->Fill(mInv);
+ if (mInv<0.5)
+ {
+ if (dedx_1>75. && dedx_2>75.)
+ {
+ _invMassElec->Fill(mInv);
+ if (mInv<0.05) continue;
+ }
+ }
+ }
+ corr = corr_1*corr_2;
+ ij = iEtaPhi_1*_nBins_etaPhi_1 + iEtaPhi_2; ////cout << " ij:" << ij<< endl;
+ __n2_12 += corr;
+ __n2_12_vsEtaPhi[ij] += corr;
+ ptpt = pt_1*pt_2;
+ __s2ptpt_12 += corr*ptpt;
+ __s2PtN_12 += corr*pt_1;
+ __s2NPt_12 += corr*pt_2;
+ __s2ptpt_12_vsEtaPhi[ij] += corr*ptpt;
+ __s2PtN_12_vsEtaPhi[ij] += corr*pt_1;
+ __s2NPt_12_vsEtaPhi[ij] += corr*pt_2;
+ __n2_12_vsPtPt[iPt_1*_nBins_pt_2 + iPt_2] += corr;
+ __n2Nw_12 += 1;
+ __s2ptptNw_12 += ptpt;
+ __s2PtNNw_12 += pt_1;
+ __s2NPtNw_12 += pt_2;
+
+ }
+ } //i2
+ } //i1
+ }
+
+ _n2_12_vsM->Fill(centrality, __n2_12);
+ _s2PtPt_12_vsM->Fill(centrality, __s2ptpt_12);
+ _s2PtN_12_vsM->Fill(centrality, __s2NPt_12);
+ _s2NPt_12_vsM->Fill(centrality, __s2PtN_12);
+
+ _n2Nw_12_vsM->Fill(centrality, __n2Nw_12);
+ _s2PtPtNw_12_vsM->Fill(centrality, __s2ptptNw_12);
+ _s2PtNNw_12_vsM->Fill(centrality, __s2NPtNw_12);
+ _s2NPtNw_12_vsM->Fill(centrality, __s2PtNNw_12);
+
+ }
+
+
+ cout << "AliAnalysisTaskDptDptQA::UserExec() -----------------Event Done " << endl;
+ PostData(0,_outputHistoList);