diff --git a/PWGUD/DataModel/UDTables.h b/PWGUD/DataModel/UDTables.h index d7720138e56..46f379c24d5 100644 --- a/PWGUD/DataModel/UDTables.h +++ b/PWGUD/DataModel/UDTables.h @@ -385,17 +385,17 @@ DECLARE_SOA_TABLE(UDFwdTracksExtra_000, "AOD", "UDFWDTRACKEXTRA", // Version with global tracks DECLARE_SOA_TABLE_VERSIONED(UDFwdTracksExtra_001, "AOD", "UDFWDTRACKEXTRA", 1, - fwdtrack::TrackType, - fwdtrack::NClusters, - fwdtrack::PDca, - fwdtrack::RAtAbsorberEnd, - fwdtrack::Chi2, - fwdtrack::Chi2MatchMCHMID, - fwdtrack::Chi2MatchMCHMFT, - fwdtrack::MCHBitMap, - fwdtrack::MIDBitMap, - fwdtrack::MIDBoards); - + fwdtrack::TrackType, + fwdtrack::NClusters, + fwdtrack::PDca, + fwdtrack::RAtAbsorberEnd, + fwdtrack::Chi2, + fwdtrack::Chi2MatchMCHMID, + fwdtrack::Chi2MatchMCHMFT, + fwdtrack::MCHBitMap, + fwdtrack::MIDBitMap, + fwdtrack::MIDBoards); + using UDFwdTracksExtra = UDFwdTracksExtra_001; using UDFwdTrack = UDFwdTracks::iterator; diff --git a/PWGUD/TableProducer/Converters/UDFwdTracksExtraConverter.cxx b/PWGUD/TableProducer/Converters/UDFwdTracksExtraConverter.cxx index b6cfdf94dc8..f9e7564a8cd 100644 --- a/PWGUD/TableProducer/Converters/UDFwdTracksExtraConverter.cxx +++ b/PWGUD/TableProducer/Converters/UDFwdTracksExtraConverter.cxx @@ -32,28 +32,28 @@ using namespace o2::framework; // Converts UDFwdTracksExtra for version 000 to 001 // v_000 only MID-MCH tracks // v_001 global tracks -struct UDFwdTracksExtraConverter{ +struct UDFwdTracksExtraConverter { Produces udFwdTracksExtra_001; - void process(o2::aod::UDFwdTracksExtra_000 const & tracks){ - - for(const auto &track : tracks){ - + void process(o2::aod::UDFwdTracksExtra_000 const& tracks) + { + + for (const auto& track : tracks) { + udFwdTracksExtra_001(3, // trackType of MCH-MID trakcs is 3 - track.nClusters(), - track.pDca(), - track.rAtAbsorberEnd(), - track.chi2(), - track.chi2MatchMCHMID(), + track.nClusters(), + track.pDca(), + track.rAtAbsorberEnd(), + track.chi2(), + track.chi2MatchMCHMID(), 0.0f, // dummy mchmftChi2, not available in version 000 - track.mchBitMap(), - track.midBitMap(), + track.mchBitMap(), + track.midBitMap(), track.midBoards()); } } }; - WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{ diff --git a/PWGUD/Tasks/fwdMuonsUPC.cxx b/PWGUD/Tasks/fwdMuonsUPC.cxx index f7f0ddb13ba..9a62dc794c1 100644 --- a/PWGUD/Tasks/fwdMuonsUPC.cxx +++ b/PWGUD/Tasks/fwdMuonsUPC.cxx @@ -21,45 +21,45 @@ #include "TSystem.h" #include "math.h" - - -namespace dimu { - // dimuon - DECLARE_SOA_COLUMN(M, m, float); - DECLARE_SOA_COLUMN(Pt, pt, float); - DECLARE_SOA_COLUMN(Rap, rap, float); - DECLARE_SOA_COLUMN(Phi, phi, float); - // tracks positive (p) and negative (n) - DECLARE_SOA_COLUMN(Ptp, ptp, float); - DECLARE_SOA_COLUMN(Etap, etap, float); - DECLARE_SOA_COLUMN(Phip, phip, float); - DECLARE_SOA_COLUMN(Ptn, ptn, float); - DECLARE_SOA_COLUMN(Etan, etan, float); - DECLARE_SOA_COLUMN(Phin, phin, float); - // zn - DECLARE_SOA_COLUMN(Tzna, tzna, float); - DECLARE_SOA_COLUMN(Ezna, ezna, float); - DECLARE_SOA_COLUMN(Tznc, tznc, float); - DECLARE_SOA_COLUMN(Eznc, eznc, float); - DECLARE_SOA_COLUMN(Nclass, nclass, int); -} - -namespace o2::aod { - DECLARE_SOA_TABLE(DiMu, "AOD", "DIMU", - dimu::M, dimu::Pt, dimu::Rap, dimu::Phi, - dimu::Ptp, dimu::Etap, dimu::Phip, - dimu::Ptn, dimu::Etan, dimu::Phin, - dimu::Tzna, dimu::Ezna, dimu::Tznc, dimu::Eznc, dimu::Nclass); +namespace dimu +{ +// dimuon +DECLARE_SOA_COLUMN(M, m, float); +DECLARE_SOA_COLUMN(Pt, pt, float); +DECLARE_SOA_COLUMN(Rap, rap, float); +DECLARE_SOA_COLUMN(Phi, phi, float); +// tracks positive (p) and negative (n) +DECLARE_SOA_COLUMN(Ptp, ptp, float); +DECLARE_SOA_COLUMN(Etap, etap, float); +DECLARE_SOA_COLUMN(Phip, phip, float); +DECLARE_SOA_COLUMN(Ptn, ptn, float); +DECLARE_SOA_COLUMN(Etan, etan, float); +DECLARE_SOA_COLUMN(Phin, phin, float); +// zn +DECLARE_SOA_COLUMN(Tzna, tzna, float); +DECLARE_SOA_COLUMN(Ezna, ezna, float); +DECLARE_SOA_COLUMN(Tznc, tznc, float); +DECLARE_SOA_COLUMN(Eznc, eznc, float); +DECLARE_SOA_COLUMN(Nclass, nclass, int); +} // namespace dimu + +namespace o2::aod +{ +DECLARE_SOA_TABLE(DiMu, "AOD", "DIMU", + dimu::M, dimu::Pt, dimu::Rap, dimu::Phi, + dimu::Ptp, dimu::Etap, dimu::Phip, + dimu::Ptn, dimu::Etan, dimu::Phin, + dimu::Tzna, dimu::Ezna, dimu::Tznc, dimu::Eznc, dimu::Nclass); } using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; -//defining constants -double mMu = 0.10566; //mass of muon +// defining constants +double mMu = 0.10566; // mass of muon -//constants used in the track selection +// constants used in the track selection const float kRAbsMin = 17.6; const float kRAbsMid = 26.5; const float kRAbsMax = 89.5; @@ -69,61 +69,60 @@ const float kEtaMin = -4.0; const float kEtaMax = -2.5; const float kPtMin = 0.; - struct fwdMuonsUPC { using CandidatesFwd = soa::Join; using ForwardTracks = soa::Join; Produces dimuSel; - + // defining histograms using histogram registry HistogramRegistry registry{"registry", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; HistogramRegistry reg0n0n{"reg0n0n", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; HistogramRegistry regXn0n{"regXn0n", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; HistogramRegistry regXnXn{"regXnXn", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; - //CONFIGURABLES - //pT of muon pairs + // CONFIGURABLES + // pT of muon pairs Configurable nBinsPt{"nBinsPt", 250, "N bins in pT histo"}; Configurable lowPt{"lowPt", 0., "lower limit in pT histo"}; Configurable highPt{"highPt", 0.5, "upper limit in pT histo"}; - //mass of muon pairs + // mass of muon pairs Configurable nBinsMass{"nBinsMass", 500, "N bins in mass histo"}; Configurable lowMass{"lowMass", 0., "lower limit in mass histo"}; Configurable highMass{"highMass", 10., "upper limit in mass histo"}; - //eta of muon pairs + // eta of muon pairs Configurable nBinsEta{"nBinsEta", 600, "N bins in eta histo"}; Configurable lowEta{"lowEta", -10., "lower limit in eta histo"}; Configurable highEta{"highEta", -2., "upper limit in eta histo"}; - //rapidity of muon pairs + // rapidity of muon pairs Configurable nBinsRapidity{"nBinsRapidity", 250, "N bins in rapidity histo"}; Configurable lowRapidity{"lowRapidity", -4.5, "lower limit in rapidity histo"}; Configurable highRapidity{"highRapidity", -2., "upper limit in rapidity histo"}; - //phi of muon pairs + // phi of muon pairs Configurable nBinsPhi{"nBinsPhi", 600, "N bins in phi histo"}; Configurable lowPhi{"lowPhi", -TMath::Pi(), "lower limit in phi histo"}; Configurable highPhi{"highPhi", TMath::Pi(), "upper limit in phi histo"}; - //pT of single muons + // pT of single muons Configurable nBinsPtSingle{"nBinsPtSingle", 500, "N bins in pT histo single muon"}; Configurable lowPtSingle{"lowPtSingle", 0., "lower limit in pT histo single muon"}; Configurable highPtSingle{"highPtSingle", 2., "upper limit in pT histo single muon"}; - //eta of single muons + // eta of single muons Configurable nBinsEtaSingle{"nBinsEtaSingle", 250, "N bins in eta histo single muon"}; Configurable lowEtaSingle{"lowEtaSingle", -4.5, "lower limit in eta histo single muon"}; Configurable highEtaSingle{"highEtaSingle", -2., "upper limit in eta histo single muon"}; - //phi of single muons + // phi of single muons Configurable nBinsPhiSingle{"nBinsPhiSingle", 600, "N bins in phi histo single muon"}; Configurable lowPhiSingle{"lowPhiSingle", -TMath::Pi(), "lower limit in phi histo single muon"}; Configurable highPhiSingle{"highPhiSingle", TMath::Pi(), "upper limit in phi histo single muon"}; - //ZDC - Configurable nBinsZDCen{"nBinsZDCen",200,"N bins in ZN energy"}; - Configurable lowEnZN{"lowEnZN",-50.,"lower limit in ZN energy histo"}; - Configurable highEnZN{"highEnZN",250.,"upper limit in ZN energy histo"}; + // ZDC + Configurable nBinsZDCen{"nBinsZDCen", 200, "N bins in ZN energy"}; + Configurable lowEnZN{"lowEnZN", -50., "lower limit in ZN energy histo"}; + Configurable highEnZN{"highEnZN", 250., "upper limit in ZN energy histo"}; - //configuarble rapidity cuts + // configuarble rapidity cuts Configurable yCutLow{"yCutLow", -4, "Lower cut in pair rapidity"}; - Configurable yCutUp{"yCutUp", -2.5, "Upper cut in pair rapidity"}; + Configurable yCutUp{"yCutUp", -2.5, "Upper cut in pair rapidity"}; void init(InitContext&) { @@ -132,10 +131,9 @@ struct fwdMuonsUPC { 0.00, 0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.10, 0.11, 0.12, 0.13, 0.14, 0.15, 0.175, 0.20, 0.25, 0.30, 0.40, 0.50, 0.60, 0.70, 0.80, 0.90, 1.00, 1.20, 1.40, 1.60, 1.80, 2.00, 2.50, - 3.00, 3.50 - }; + 3.00, 3.50}; - //axis + // axis const AxisSpec axisPt{nBinsPt, lowPt, highPt, "#it{p}_{T} GeV/#it{c}"}; const AxisSpec axisPtFit = {ptFitBinning, "#it{p}_{T} (GeV/c)"}; const AxisSpec axisMass{nBinsMass, lowMass, highMass, "m_{#mu#mu} GeV/#it{c}^{2}"}; @@ -143,13 +141,13 @@ struct fwdMuonsUPC { const AxisSpec axisRapidity{nBinsRapidity, lowRapidity, highRapidity, "Rapidity"}; const AxisSpec axisPhi{nBinsPhi, lowPhi, highPhi, "#varphi"}; const AxisSpec axisPtSingle{nBinsPtSingle, lowPtSingle, highPtSingle, "#it{p}_{T}_{ trk} GeV/#it{c}"}; - const AxisSpec axisTimeZN{200,-10,10,"ZDC time (ns)"}; - const AxisSpec axisEnergyZNA{nBinsZDCen,lowEnZN,highEnZN,"ZNA energy (TeV)"}; - const AxisSpec axisEnergyZNC{nBinsZDCen,lowEnZN,highEnZN,"ZNC energy (TeV)"}; + const AxisSpec axisTimeZN{200, -10, 10, "ZDC time (ns)"}; + const AxisSpec axisEnergyZNA{nBinsZDCen, lowEnZN, highEnZN, "ZNA energy (TeV)"}; + const AxisSpec axisEnergyZNC{nBinsZDCen, lowEnZN, highEnZN, "ZNC energy (TeV)"}; const AxisSpec axisEtaSingle{nBinsEtaSingle, lowEtaSingle, highEtaSingle, "#eta_{trk}"}; const AxisSpec axisPhiSingle{nBinsPhiSingle, lowPhiSingle, highPhiSingle, "#varphi_{trk}"}; - - //histos + + // histos registry.add("hMass", "Ivariant mass of muon pairs;;#counts", kTH1D, {axisMass}); registry.add("hPt", "Transverse momentum mass of muon pairs;;#counts", kTH1D, {axisPt}); registry.add("hPtFit", "Transverse momentum mass of muon pairs;;#counts", kTH1D, {axisPtFit}); @@ -157,18 +155,18 @@ struct fwdMuonsUPC { registry.add("hRapidity", "Rapidty of muon pairs;;#counts", kTH1D, {axisRapidity}); registry.add("hPhi", "#varphi of muon pairs;;#counts", kTH1D, {axisPhi}); registry.add("hCharge", "Charge;#it{charge};;#counts", kTH1D, {{5, -2.5, 2.5}}); - registry.add("hContrib", "hContrib;;#counts",kTH1D,{{6,-0.5,5.5}}); - registry.add("hEvSign","Sum of the charges of all the tracks in each event;;#counts",kTH1D,{{5,-2.5,2.5}}); + registry.add("hContrib", "hContrib;;#counts", kTH1D, {{6, -0.5, 5.5}}); + registry.add("hEvSign", "Sum of the charges of all the tracks in each event;;#counts", kTH1D, {{5, -2.5, 2.5}}); registry.add("hPtTrkPos", "Pt of positive muons;;#counts", kTH1D, {axisPtSingle}); registry.add("hPtTrkNeg", "Pt of negative muons;;#counts", kTH1D, {axisPtSingle}); registry.add("hEtaTrkPos", "#eta of positive muons;;#counts", kTH1D, {axisEtaSingle}); registry.add("hEtaTrkNeg", "#eta of negative muons;;#counts", kTH1D, {axisEtaSingle}); registry.add("hPhiTrkPos", "#varphi of positive muons;;#counts", kTH1D, {axisPhiSingle}); registry.add("hPhiTrkNeg", "#varphi of negative muons;;#counts", kTH1D, {axisPhiSingle}); - registry.add("hTimeZNA","ZNA Times;;#counts",kTH1D,{axisTimeZN}); - registry.add("hTimeZNC","ZNC Times;;#counts",kTH1D,{axisTimeZN}); - registry.add("hEnergyZN","ZNA vs ZNC energy",kTH2D,{axisEnergyZNA,axisEnergyZNC}); - registry.add("hSameSign","hSameSign;;#counts",kTH1D,{{6,-0.5,5.5}}); + registry.add("hTimeZNA", "ZNA Times;;#counts", kTH1D, {axisTimeZN}); + registry.add("hTimeZNC", "ZNC Times;;#counts", kTH1D, {axisTimeZN}); + registry.add("hEnergyZN", "ZNA vs ZNC energy", kTH2D, {axisEnergyZNA, axisEnergyZNC}); + registry.add("hSameSign", "hSameSign;;#counts", kTH1D, {{6, -0.5, 5.5}}); reg0n0n.add("hMass", "Ivariant mass of muon pairs - 0n0n;;#counts", kTH1D, {axisMass}); reg0n0n.add("hPt", "Transverse momentum mass of muon pairs - 0n0n;;#counts", kTH1D, {axisPt}); @@ -176,7 +174,6 @@ struct fwdMuonsUPC { reg0n0n.add("hRapidity", "Rapidty of muon pairs - 0n0n;;#counts", kTH1D, {axisRapidity}); reg0n0n.add("hPtFit", "Transverse momentum mass of muon pairs - 0n0n;;#counts", kTH1D, {axisPtFit}); - regXn0n.add("hMass", "Ivariant mass of muon pairs - Xn0n;;#counts", kTH1D, {axisMass}); regXn0n.add("hPt", "Transverse momentum mass of muon pairs - Xn0n;;#counts", kTH1D, {axisPt}); regXn0n.add("hEta", "Pseudorapidty of muon pairs - Xn0n;;#counts", kTH1D, {axisEta}); @@ -190,12 +187,11 @@ struct fwdMuonsUPC { regXnXn.add("hPtFit", "Transverse momentum mass of muon pairs - XnXn;;#counts", kTH1D, {axisPtFit}); } + // FUNCTIONS - //FUNCTIONS - - //template function that fills a map with the collision id of each udcollision as key - //and a vector with the tracks - //map == (key, element) == (udCollisionId, vector of trks) + // template function that fills a map with the collision id of each udcollision as key + // and a vector with the tracks + // map == (key, element) == (udCollisionId, vector of trks) template void collectCandIDs(std::unordered_map>& tracksPerCand, TTracks& tracks) { @@ -209,7 +205,7 @@ struct fwdMuonsUPC { } // struct used to store the ZDC info in a map - struct ZDCinfo{ + struct ZDCinfo { float timeA; float timeC; float enA; @@ -217,11 +213,12 @@ struct fwdMuonsUPC { int32_t id; }; - //function that fills a map with the collision id of each udcollision as key - //and a ZDCinfo struct with the ZDC information - void collectCandZDCInfo(std::unordered_map& zdcPerCand, o2::aod::UDZdcsReduced& ZDCs){ - - for(auto &zdc: ZDCs){ + // function that fills a map with the collision id of each udcollision as key + // and a ZDCinfo struct with the ZDC information + void collectCandZDCInfo(std::unordered_map& zdcPerCand, o2::aod::UDZdcsReduced& ZDCs) + { + + for (auto& zdc : ZDCs) { int32_t candId = zdc.udCollisionId(); if (candId < 0) { continue; @@ -229,19 +226,21 @@ struct fwdMuonsUPC { zdcPerCand[candId].timeA = zdc.timeZNA(); zdcPerCand[candId].timeC = zdc.timeZNC(); - zdcPerCand[candId].enA = zdc.energyCommonZNA(); - zdcPerCand[candId].enC = zdc.energyCommonZNC(); - - //take care of the infinity - if(std::isinf(zdcPerCand[candId].timeA)) zdcPerCand[candId].timeA = -999; - if(std::isinf(zdcPerCand[candId].timeC)) zdcPerCand[candId].timeC = -999; - if(std::isinf(zdcPerCand[candId].enA )) zdcPerCand[candId].enA = -999; - if(std::isinf(zdcPerCand[candId].enC )) zdcPerCand[candId].enC = -999; - + zdcPerCand[candId].enA = zdc.energyCommonZNA(); + zdcPerCand[candId].enC = zdc.energyCommonZNC(); + + // take care of the infinity + if (std::isinf(zdcPerCand[candId].timeA)) + zdcPerCand[candId].timeA = -999; + if (std::isinf(zdcPerCand[candId].timeC)) + zdcPerCand[candId].timeC = -999; + if (std::isinf(zdcPerCand[candId].enA)) + zdcPerCand[candId].enA = -999; + if (std::isinf(zdcPerCand[candId].enC)) + zdcPerCand[candId].enC = -999; } } - // function to select muon tracks bool isMuonSelected(const ForwardTracks::iterator& fwdTrack) { @@ -252,7 +251,7 @@ struct fwdMuonsUPC { float eta = p.Eta(); float pt = p.Pt(); float pDcaMax = rAbs < kRAbsMid ? kPDca1 : kPDca2; - + if (eta < kEtaMin || eta > kEtaMax) return false; if (pt < kPtMin) @@ -264,22 +263,23 @@ struct fwdMuonsUPC { return true; } - - //function that processes the candidates: - //it applies V0 selection, trk selection, and fills the histograms + // function that processes the candidates: + // it applies V0 selection, trk selection, and fills the histograms void processCand(CandidatesFwd::iterator const& cand, const ForwardTracks::iterator& tr1, const ForwardTracks::iterator& tr2, - ZDCinfo& zdc){ - //V0 selection + ZDCinfo& zdc) + { + // V0 selection const auto& ampsV0A = cand.amplitudesV0A(); const auto& ampsRelBCsV0A = cand.ampRelBCsV0A(); for (unsigned int i = 0; i < ampsV0A.size(); ++i) { - if (std::abs(ampsRelBCsV0A[i]) <= 1){ - if(ampsV0A[i] > 100.) return; + if (std::abs(ampsRelBCsV0A[i]) <= 1) { + if (ampsV0A[i] > 100.) + return; } } - //track selection + // track selection TLorentzVector p1, p2; p1.SetXYZM(tr1.px(), tr1.py(), tr1.pz(), mMu); p2.SetXYZM(tr2.px(), tr2.py(), tr2.pz(), mMu); @@ -289,7 +289,7 @@ struct fwdMuonsUPC { if (!isMuonSelected(tr2)) return; - //MCH-MID match selection + // MCH-MID match selection int nMIDs = 0; if (tr1.chi2MatchMCHMID() > 0) nMIDs++; @@ -297,67 +297,78 @@ struct fwdMuonsUPC { nMIDs++; if (nMIDs != 2) return; - + // cuts on pair kinematics - if (!(p.M() > 2 && p.M() < 6 && p.Pt() < 5)) return; + if (!(p.M() > 2 && p.M() < 6 && p.Pt() < 5)) + return; - //select opposite charge events only - if(cand.netCharge()!=0){ + // select opposite charge events only + if (cand.netCharge() != 0) { registry.fill(HIST("hSameSign"), cand.numContrib()); return; } - //select rapidity ranges - if(p.Rapidity()yCutUp) return; + // select rapidity ranges + if (p.Rapidity() < yCutLow) + return; + if (p.Rapidity() > yCutUp) + return; - //zdc info - if(TMath::Abs(zdc.timeA)<10) registry.fill(HIST("hTimeZNA"), zdc.timeA); - if(TMath::Abs(zdc.timeC)<10) registry.fill(HIST("hTimeZNC"), zdc.timeC); - registry.fill(HIST("hEnergyZN"),zdc.enA,zdc.enC); + // zdc info + if (TMath::Abs(zdc.timeA) < 10) + registry.fill(HIST("hTimeZNA"), zdc.timeA); + if (TMath::Abs(zdc.timeC) < 10) + registry.fill(HIST("hTimeZNC"), zdc.timeC); + registry.fill(HIST("hEnergyZN"), zdc.enA, zdc.enC); - //divide the events in neutron classes + // divide the events in neutron classes bool neutron_A = false; bool neutron_C = false; int znClass = -1; - if(TMath::Abs(zdc.timeA)<2) neutron_A = true; - if(TMath::Abs(zdc.timeC)<2) neutron_C = true; + if (TMath::Abs(zdc.timeA) < 2) + neutron_A = true; + if (TMath::Abs(zdc.timeC) < 2) + neutron_C = true; - if(std::isinf(zdc.timeC)) neutron_C = false; - if(std::isinf(zdc.timeA)) neutron_A = false; + if (std::isinf(zdc.timeC)) + neutron_C = false; + if (std::isinf(zdc.timeA)) + neutron_A = false; - //fill the histos in neutron classes and assign neutron class label - //0n0n - if(neutron_C==false && neutron_A==false){ + // fill the histos in neutron classes and assign neutron class label + // 0n0n + if (neutron_C == false && neutron_A == false) { znClass = 0; reg0n0n.fill(HIST("hMass"), p.M()); - reg0n0n.fill(HIST("hPt"), p.Pt()); - reg0n0n.fill(HIST("hPtFit"), p.Pt()); + reg0n0n.fill(HIST("hPt"), p.Pt()); + reg0n0n.fill(HIST("hPtFit"), p.Pt()); reg0n0n.fill(HIST("hEta"), p.Eta()); reg0n0n.fill(HIST("hRapidity"), p.Rapidity()); } - //Xn0n + 0nXn - else if(neutron_A ^ neutron_C){ - if(neutron_A) znClass = 1; - else if(neutron_C) znClass = 2; + // Xn0n + 0nXn + else if (neutron_A ^ neutron_C) { + if (neutron_A) + znClass = 1; + else if (neutron_C) + znClass = 2; regXn0n.fill(HIST("hMass"), p.M()); - regXn0n.fill(HIST("hPt"), p.Pt()); - regXn0n.fill(HIST("hPtFit"), p.Pt()); + regXn0n.fill(HIST("hPt"), p.Pt()); + regXn0n.fill(HIST("hPtFit"), p.Pt()); regXn0n.fill(HIST("hEta"), p.Eta()); regXn0n.fill(HIST("hRapidity"), p.Rapidity()); } - //XnXn - else if(neutron_A && neutron_C){ + // XnXn + else if (neutron_A && neutron_C) { znClass = 3; regXnXn.fill(HIST("hMass"), p.M()); - regXnXn.fill(HIST("hPt"), p.Pt()); - regXnXn.fill(HIST("hPtFit"), p.Pt()); + regXnXn.fill(HIST("hPt"), p.Pt()); + regXnXn.fill(HIST("hPtFit"), p.Pt()); regXnXn.fill(HIST("hEta"), p.Eta()); regXnXn.fill(HIST("hRapidity"), p.Rapidity()); } - //fill the histos without looking at neutron emission + // fill the histos without looking at neutron emission registry.fill(HIST("hContrib"), cand.numContrib()); registry.fill(HIST("hPtTrkPos"), p1.Pt()); registry.fill(HIST("hPtTrkNeg"), p2.Pt()); @@ -365,34 +376,31 @@ struct fwdMuonsUPC { registry.fill(HIST("hEtaTrkNeg"), p2.Eta()); registry.fill(HIST("hPhiTrkPos"), p1.Phi()); registry.fill(HIST("hPhiTrkNeg"), p2.Phi()); - registry.fill(HIST("hEvSign"),cand.netCharge()); + registry.fill(HIST("hEvSign"), cand.netCharge()); registry.fill(HIST("hMass"), p.M()); - registry.fill(HIST("hPt"), p.Pt()); - registry.fill(HIST("hPtFit"), p.Pt()); + registry.fill(HIST("hPt"), p.Pt()); + registry.fill(HIST("hPtFit"), p.Pt()); registry.fill(HIST("hEta"), p.Eta()); registry.fill(HIST("hRapidity"), p.Rapidity()); registry.fill(HIST("hPhi"), p.Phi()); - registry.fill(HIST("hCharge"),tr1.sign()); - registry.fill(HIST("hCharge"),tr2.sign()); + registry.fill(HIST("hCharge"), tr1.sign()); + registry.fill(HIST("hCharge"), tr2.sign()); - // store the event to save it into a tree - if(tr1.sign() > 0) { - dimuSel(p.M(),p.Pt(),p.Rapidity(),p.Phi(), - p1.Pt(),p1.PseudoRapidity(),p1.Phi(), - p2.Pt(),p2.PseudoRapidity(),p2.Phi(), - zdc.timeA, zdc.enA, zdc.timeC, zdc.enC, znClass); + if (tr1.sign() > 0) { + dimuSel(p.M(), p.Pt(), p.Rapidity(), p.Phi(), + p1.Pt(), p1.PseudoRapidity(), p1.Phi(), + p2.Pt(), p2.PseudoRapidity(), p2.Phi(), + zdc.timeA, zdc.enA, zdc.timeC, zdc.enC, znClass); } else { - dimuSel(p.M(),p.Pt(),p.Rapidity(),p.Phi(), - p2.Pt(),p2.PseudoRapidity(),p2.Phi(), - p1.Pt(),p1.PseudoRapidity(),p1.Phi(), - zdc.timeA, zdc.enA, zdc.timeC, zdc.enC, znClass); + dimuSel(p.M(), p.Pt(), p.Rapidity(), p.Phi(), + p2.Pt(), p2.PseudoRapidity(), p2.Phi(), + p1.Pt(), p1.PseudoRapidity(), p1.Phi(), + zdc.timeA, zdc.enA, zdc.timeC, zdc.enC, znClass); }; - } - - //PROCESS FUNCTION + // PROCESS FUNCTION void process(CandidatesFwd const& eventCandidates, o2::aod::UDZdcsReduced& ZDCs, ForwardTracks const& fwdTracks) @@ -402,14 +410,14 @@ struct fwdMuonsUPC { std::unordered_map> tracksPerCand; collectCandIDs(tracksPerCand, fwdTracks); - //map with the ZDC info + // map with the ZDC info std::unordered_map zdcPerCand; collectCandZDCInfo(zdcPerCand, ZDCs); int match = 0; int tot = 0; - //loop over the candidates + // loop over the candidates for (const auto& item : tracksPerCand) { int32_t trId1 = item.second[0]; int32_t trId2 = item.second[1]; @@ -424,21 +432,20 @@ struct fwdMuonsUPC { ZDCinfo zdc; - if(zdcPerCand.count(candID)!=0) zdc = zdcPerCand.at(candID); - else{ + if (zdcPerCand.count(candID) != 0) + zdc = zdcPerCand.at(candID); + else { zdc.timeA = -999; zdc.timeC = -999; - zdc.enA = -999; - zdc.enC = -999; + zdc.enA = -999; + zdc.enC = -999; } processCand(cand, tr1, tr2, zdc); - } - //LOGP(info,"my matches = {}",match); - //LOGP(info,"tot = {}",tot); - + // LOGP(info,"my matches = {}",match); + // LOGP(info,"tot = {}",tot); } PROCESS_SWITCH(fwdMuonsUPC, process, "", false);