3030#include " Common/DataModel/PIDResponse.h"
3131
3232#include " PWGJE/DataModel/EMCALClusters.h"
33+ #include " PWGHF/Core/HfHelper.h"
3334
3435using namespace o2 ;
3536using namespace o2 ::framework;
@@ -54,6 +55,7 @@ struct HfTaskElectronWeakBoson {
5455 Configurable<float > nclItsMin{" nclItsMin" , 2 .0f , " its # of cluster cut" };
5556 Configurable<float > nclTpcMin{" nclTpcMin" , 100 .0f , " tpc # if cluster cut" };
5657 Configurable<float > nclcrossTpcMin{" nclcrossTpcMin" , 100 .0f , " tpc # of crossedRows cut" };
58+ Configurable<float > nsigTpcMinLose{" nsigTpcMinLose" , -3.0 , " tpc Nsig lose lower cut" };
5759 Configurable<float > nsigTpcMin{" nsigTpcMin" , -1.0 , " tpc Nsig lower cut" };
5860 Configurable<float > nsigTpcMax{" nsigTpcMax" , 3.0 , " tpc Nsig upper cut" };
5961
@@ -72,10 +74,25 @@ struct HfTaskElectronWeakBoson {
7274 Configurable<float > energyIsolationMax{" energyIsolationMax" , 0.1 , " isolation cut on energy" };
7375 Configurable<int > trackIsolationMax{" trackIsolationMax" , 3 , " Maximum number of tracks in isolation cone" };
7476
77+ struct ElectronCandidate {
78+ float pt, eta, phi, energy;
79+ ElectronCandidate (float p, float e, float ph, float en)
80+ : pt(p), eta(e), phi(ph), energy(en) {}
81+
82+ // 運動量成分を計算する関数を追加
83+ float px () const { return pt * std::cos (phi); }
84+ float py () const { return pt * std::sin (phi); }
85+ float pz () const { return pt * std::sinh (eta); }
86+ };
87+ std::vector<ElectronCandidate> selectedElectrons_Iso;
88+ std::vector<ElectronCandidate> selectedElectrons_Ass;
89+
7590 using SelectedClusters = o2::aod::EMCALClusters;
7691 // PbPb
7792 using TrackEle = o2::soa::Join<o2::aod::Tracks, o2::aod::FullTracks, o2::aod::TracksExtra, o2::aod::TracksDCA, o2::aod::TrackSelection, o2::aod::pidTPCFullEl>;
7893
94+ HfHelper hfHelper;
95+
7996 // pp
8097 // using TrackEle = o2::soa::Filtered<o2::soa::Join<o2::aod::Tracks, o2::aod::FullTracks, o2::aod::TracksDCA, o2::aod::TrackSelection, o2::aod::pidTPCEl, o2::aod::pidTOFEl>>;
8198
@@ -118,6 +135,8 @@ struct HfTaskElectronWeakBoson {
118135 const AxisSpec axisEMCtime{200 , -100.0 , 100 , " EMC time" };
119136 const AxisSpec axisIsoEnergy{100 , 0 , 1 , " Isolation energy(GeV/C)" };
120137 const AxisSpec axisIsoTrack{20 , -0.5 , 19.5 , " Isolation Track" };
138+ const AxisSpec axisInvMassZ{200 , 0 , 200 , " M_{ee} (GeV/c^{2})" };
139+ const AxisSpec axisInvMassDy{200 , 0 , 2 , " M_{ee} (GeV/c^{2})" };
121140
122141 // create registrygrams
123142 registry.add (" hZvtx" , " Z vertex" , kTH1F , {axisZvtx});
@@ -144,6 +163,8 @@ struct HfTaskElectronWeakBoson {
144163 registry.add (" hEMCtime" , " EMC timing" , kTH1F , {axisEMCtime});
145164 registry.add (" hIsolationEnergy" , " Isolation Energy" , kTH2F , {{axisE}, {axisIsoEnergy}});
146165 registry.add (" hIsolationTrack" , " Isolation Track" , kTH2F , {{axisE}, {axisIsoTrack}});
166+ registry.add (" hInvMassZee" , " invariant mass for Z" , kTH2F , {{axisPt}, {axisInvMassZ}});
167+ registry.add (" hInvMassDy" , " invariant mass for DY" , kTH2F , {{axisPt}, {axisInvMassDy}});
147168 }
148169 bool isIsolatedCluster (const o2::aod::EMCALCluster& cluster,
149170 const SelectedClusters& clusters)
@@ -247,6 +268,16 @@ struct HfTaskElectronWeakBoson {
247268 registry.fill (HIST (" hPt" ), track.pt ());
248269 registry.fill (HIST (" hTPCNsigma" ), track.p (), track.tpcNSigmaEl ());
249270
271+ float energyTrk = 0.0 ;
272+
273+ if (track.tpcNSigmaEl () > nsigTpcMinLose && track.tpcNSigmaEl () < nsigTpcMax) {
274+ selectedElectrons_Ass.emplace_back (
275+ track.pt (),
276+ track.eta (),
277+ track.phi (),
278+ energyTrk);
279+ }
280+
250281 // track - match
251282
252283 // continue;
@@ -279,6 +310,7 @@ struct HfTaskElectronWeakBoson {
279310 // LOG(info) << "tr phi0 = " << match.track_as<TrackEle>().phi();
280311 // LOG(info) << "tr phi1 = " << track.phi();
281312 // LOG(info) << "emc phi = " << phiEmc;
313+
282314 if (nMatch == 0 ) {
283315 double dEta = match.track_as <TrackEle>().trackEtaEmcal () - etaEmc;
284316 double dPhi = match.track_as <TrackEle>().trackPhiEmcal () - phiEmc;
@@ -303,6 +335,7 @@ struct HfTaskElectronWeakBoson {
303335 const auto & cluster = match.emcalcluster_as <SelectedClusters>();
304336
305337 double eop = energyEmc / match.track_as <TrackEle>().p ();
338+
306339 // LOG(info) << "E/p" << eop;
307340 registry.fill (HIST (" hEopNsigTPC" ), match.track_as <TrackEle>().tpcNSigmaEl (), eop);
308341 registry.fill (HIST (" hM02" ), match.track_as <TrackEle>().tpcNSigmaEl (), m02Emc);
@@ -317,6 +350,12 @@ struct HfTaskElectronWeakBoson {
317350
318351 if (isIsolated) {
319352 registry.fill (HIST (" hEopIsolation" ), match.track_as <TrackEle>().pt (), eop);
353+
354+ selectedElectrons_Iso.emplace_back (
355+ match.track_as <TrackEle>().pt (),
356+ match.track_as <TrackEle>().eta (),
357+ match.track_as <TrackEle>().phi (),
358+ energyEmc);
320359 }
321360
322361 if (isIsolatedTr) {
@@ -335,6 +374,26 @@ struct HfTaskElectronWeakBoson {
335374 }
336375
337376 } // end of track loop
377+
378+ // calculate inv. mass
379+ if (selectedElectrons_Iso.size () > 1 ) {
380+ for (size_t i = 0 ; i < selectedElectrons_Iso.size () - 1 ; ++i) {
381+ const auto & e1 = selectedElectrons_Iso[i];
382+ for (size_t j = 0 ; j < selectedElectrons_Ass.size () - 1 ; ++j) {
383+ const auto & e2 = selectedElectrons_Ass[j];
384+
385+ if (e1 .px () == e2 .px ())
386+ continue ;
387+ auto mass = hfHelper.invMassZtoEE (e1 , e2 );
388+ double ptIso = sqrt (pow (e1 .px (), 2 ) + pow (e1 .py (), 2 ));
389+ double ptAss = sqrt (pow (e2 .px (), 2 ) + pow (e2 .py (), 2 ));
390+ registry.fill (HIST (" hInvMassDy" ), ptIso, mass);
391+ if (ptAss < 20.0 && ptIso < 20.0 )
392+ continue ;
393+ registry.fill (HIST (" hInvMassZee" ), ptIso, mass);
394+ }
395+ }
396+ } // end of inv. mass calculation
338397 }
339398};
340399
0 commit comments