@@ -139,8 +139,9 @@ struct UpcPhotonuclearAnalysisJMG {
139139 Configurable<float > cutMyTPCChi2NclMax{" cutMyTPCChi2NclMax" , 4 .f , {" My Track cut" }};
140140 Configurable<float > myWeightMin{" myWeightMin" , 0 .2f , {" My Track cut" }};
141141 Configurable<float > myWeightMax{" myWeightMax" , 5 .f , {" My Track cut" }};
142- Configurable<float > myEpsilonToWeight{" myEpsilonToWeight" , 1e-6f , {" My Track cut" }};
143- Configurable<bool > useEpsilon{" useEpsilon" , false , {" My Track cut" }};
142+ Configurable<float > myEpsilonToWeight{" myEpsilonToWeight" , 1e-6f , {" NUA correction" }};
143+ Configurable<bool > useEpsilon{" useEpsilon" , false , {" NUA correction" }};
144+ Configurable<bool > useNMax{" useNMax" , true , {" NUA correction" }};
144145 Configurable<LabeledArray<float >> cfgPairCut{" cfgPairCut" ,
145146 {CFGPairCutDefaults[0 ],
146147 5 ,
@@ -434,11 +435,15 @@ struct UpcPhotonuclearAnalysisJMG {
434435 template <typename TTarget, typename TTracks>
435436 void fillCorrelationsUD (TTarget target, const TTracks tracks1, const TTracks tracks2, float multiplicity, float posZ)
436437 {
437- multiplicity = tracks1.size ();
438+ // multiplicity = tracks1.size();
438439 for (const auto & track1 : tracks1) {
439440 if (isTrackCut (track1) == false ) {
440441 return ;
441442 }
443+ // weight NUA for track1
444+ float phi1 = phi (track1.px (), track1.py ());
445+ float eta1 = eta (track1.px (), track1.py (), track1.pz ());
446+ float w1 = getNUAWeight (posZ, eta1, phi1);
442447 target->getTriggerHist ()->Fill (CorrelationContainer::kCFStepReconstructed , track1.pt (), multiplicity, posZ, 1.0 );
443448 for (const auto & track2 : tracks2) {
444449 if (track1 == track2) {
@@ -447,12 +452,24 @@ struct UpcPhotonuclearAnalysisJMG {
447452 if (isTrackCut (track2) == false ) {
448453 return ;
449454 }
455+ // weight NUA for track 2
456+ float phi2 = phi (track2.px (), track2.py ());
457+ float eta2 = eta (track2.px (), track2.py (), track2.pz ());
458+ float w2 = getNUAWeight (posZ, eta2, phi2);
459+ // total weight
460+ float wPair = w1 * w2;
450461 /* if (doPairCuts && mPairCuts.conversionCuts(track1, track2)) {
451462 continue;
452463 }*/
453464 float deltaPhi = phi (track1.px (), track1.py ()) - phi (track2.px (), track2.py ());
454465 deltaPhi = RecoDecay::constrainAngle (deltaPhi, -PIHalf);
455- target->getPairHist ()->Fill (CorrelationContainer::kCFStepReconstructed , eta (track1.px (), track1.py (), track1.pz ()) - eta (track2.px (), track2.py (), track2.pz ()), track2.pt (), track1.pt (), multiplicity, deltaPhi, posZ, 1.0 );
466+ target->getPairHist ()->Fill (CorrelationContainer::kCFStepReconstructed ,
467+ eta (track1.px (), track1.py (), track1.pz ()) - eta (track2.px (), track2.py (), track2.pz ()),
468+ track2.pt (), track1.pt (),
469+ multiplicity,
470+ deltaPhi,
471+ posZ,
472+ wPair);
456473 }
457474 }
458475 }
@@ -466,12 +483,23 @@ struct UpcPhotonuclearAnalysisJMG {
466483 for (int jEtha = 1 ; jEtha <= nEta; ++jEtha) {
467484 for (int iVtxZ = 1 ; iVtxZ <= nVz; ++iVtxZ) {
468485 // average on phi to (eta_jEtha, vz_iVtxZ)
469- double sum = 0 , count = 0 ;
486+ double sum = 0.0 ;
487+ double nMax = 0.0 ;
488+ int count = 0 ;
470489 for (int kPhi = 1 ; kPhi <= nPhi; ++kPhi ) {
471- sum += histoRaw3D->GetBinContent (iVtxZ, jEtha, kPhi );
490+ double nEntry = histoRaw3D->GetBinContent (iVtxZ, jEtha, kPhi );
491+ sum += nEntry;
472492 count += 1.0 ;
493+ if (nEntry > nMax) {
494+ nMax = nEntry;
495+ }
496+ }
497+ double nMean;
498+ if (useNMax) {
499+ nMean = nMax;
500+ } else {
501+ double nMean = (count > 0 ) ? sum / count : 0.0 ;
473502 }
474- const double nMean = (count > 0 ) ? sum / count : 0.0 ;
475503
476504 for (int kPhi = 1 ; kPhi <= nPhi; ++kPhi ) {
477505 double nEntry = histoRaw3D->GetBinContent (iVtxZ, jEtha, kPhi );
0 commit comments