Skip to content

Commit c6e20e7

Browse files
committed
reintroduced neutron classes into derived data, first steps towards selecting specific generator IDs in MC
1 parent 3e189ca commit c6e20e7

File tree

1 file changed

+19
-6
lines changed

1 file changed

+19
-6
lines changed

PWGUD/Tasks/upcRhoAnalysis.cxx

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ DECLARE_SOA_COLUMN(EnergyCommonZNA, energyCommonZNA, float);
6666
DECLARE_SOA_COLUMN(EnergyCommonZNC, energyCommonZNC, float);
6767
DECLARE_SOA_COLUMN(TimeZNA, timeZNA, float);
6868
DECLARE_SOA_COLUMN(TimeZNC, timeZNC, float);
69+
DECLARE_SOA_COLUMN(NeutronClass, neutronClass, int);
6970
// pion tracks
7071
DECLARE_SOA_COLUMN(PhiRandom, phiRandom, float);
7172
DECLARE_SOA_COLUMN(PhiCharge, phiCharge, float);
@@ -84,7 +85,7 @@ DECLARE_SOA_TABLE(RecoTree, "AOD", "RECOTREE",
8485
reco_tree::RunNumber, reco_tree::LocalBC, reco_tree::NumContrib, reco_tree::PosX, reco_tree::PosY, reco_tree::PosZ,
8586
reco_tree::TotalFT0AmplitudeA, reco_tree::TotalFT0AmplitudeC, reco_tree::TotalFV0AmplitudeA, reco_tree::TotalFDDAmplitudeA, reco_tree::TotalFDDAmplitudeC,
8687
reco_tree::TimeFT0A, reco_tree::TimeFT0C, reco_tree::TimeFV0A, reco_tree::TimeFDDA, reco_tree::TimeFDDC,
87-
reco_tree::EnergyCommonZNA, reco_tree::EnergyCommonZNC, reco_tree::TimeZNA, reco_tree::TimeZNC,
88+
reco_tree::EnergyCommonZNA, reco_tree::EnergyCommonZNC, reco_tree::TimeZNA, reco_tree::TimeZNC, reco_tree::NeutronClass,
8889
reco_tree::PhiRandom, reco_tree::PhiCharge, reco_tree::TrackSign, reco_tree::TrackPt, reco_tree::TrackEta, reco_tree::TrackPhi, reco_tree::TrackPiPID, reco_tree::TrackElPID, reco_tree::TrackKaPID, reco_tree::TrackDcaXY, reco_tree::TrackDcaZ, reco_tree::TrackTpcSignal);
8990

9091
namespace mc_tree
@@ -119,6 +120,7 @@ struct UpcRhoAnalysis {
119120

120121
float pcEtaCut = 0.9; // physics coordination recommendation
121122
Configurable<bool> requireTof{"requireTof", false, "require TOF signal"};
123+
// Configurable<int> selectedMcGeneratorId{"selectedMcGeneratorId", 0, "flag for selected MC process ID"};
122124

123125
Configurable<float> collisionsPosZMaxCut{"collisionsPosZMaxCut", 10.0, "max Z position cut on collisions"};
124126
Configurable<int> collisionsNumContribsMaxCut{"collisionsNumContribsMaxCut", 4, "max number of contributors cut on collisions"};
@@ -523,16 +525,25 @@ struct UpcRhoAnalysis {
523525
if (!collisionPassesCuts(collision))
524526
return;
525527

528+
int neutronClass = -1;
526529
bool xnxn = false, onon = false, xnon = false, onxn = false; // note: On == 0n...
527-
if (collision.energyCommonZNA() < znCommonEnergyCut && collision.energyCommonZNC() < znCommonEnergyCut)
530+
if (collision.energyCommonZNA() < znCommonEnergyCut && collision.energyCommonZNC() < znCommonEnergyCut){
528531
onon = true;
529-
if (collision.energyCommonZNA() > znCommonEnergyCut && std::abs(collision.timeZNA()) < znTimeCut && collision.energyCommonZNC() < znCommonEnergyCut)
532+
neutronClass = 0;
533+
}
534+
if (collision.energyCommonZNA() > znCommonEnergyCut && std::abs(collision.timeZNA()) < znTimeCut && collision.energyCommonZNC() < znCommonEnergyCut){
530535
xnon = true;
531-
if (collision.energyCommonZNA() < znCommonEnergyCut && collision.energyCommonZNC() > znCommonEnergyCut && std::abs(collision.timeZNC()) < znTimeCut)
536+
neutronClass = 1;
537+
}
538+
if (collision.energyCommonZNA() < znCommonEnergyCut && collision.energyCommonZNC() > znCommonEnergyCut && std::abs(collision.timeZNC()) < znTimeCut){
532539
onxn = true;
540+
neutronClass = 2;
541+
}
533542
if (collision.energyCommonZNA() > znCommonEnergyCut && std::abs(collision.timeZNA()) < znTimeCut &&
534-
collision.energyCommonZNC() > znCommonEnergyCut && std::abs(collision.timeZNC()) < znTimeCut)
543+
collision.energyCommonZNC() > znCommonEnergyCut && std::abs(collision.timeZNC()) < znTimeCut){
535544
xnxn = true;
545+
neutronClass = 3;
546+
}
536547

537548
std::vector<decltype(tracks.begin())> cutTracks; // store selected tracks
538549
for (const auto& track : tracks) {
@@ -596,7 +607,7 @@ struct UpcRhoAnalysis {
596607
recoTree(collision.runNumber(), localBc, collision.numContrib(), collision.posX(), collision.posY(), collision.posZ(),
597608
collision.totalFT0AmplitudeA(), collision.totalFT0AmplitudeC(), collision.totalFV0AmplitudeA(), collision.totalFDDAmplitudeA(), collision.totalFDDAmplitudeC(),
598609
collision.timeFT0A(), collision.timeFT0C(), collision.timeFV0A(), collision.timeFDDA(), collision.timeFDDC(),
599-
collision.energyCommonZNA(), collision.energyCommonZNC(), collision.timeZNA(), collision.timeZNC(),
610+
collision.energyCommonZNA(), collision.energyCommonZNC(), collision.timeZNA(), collision.timeZNC(), neutronClass,
600611
phiRandom, phiCharge, trackSigns, trackPts, trackEtas, trackPhis, trackPiPIDs, trackElPIDs, trackKaPIDs, trackDcaXYs, trackDcaZs, trackTpcSignals);
601612

602613
if (!tracksPassPiPID(cutTracks)) // apply PID cut
@@ -683,6 +694,8 @@ struct UpcRhoAnalysis {
683694
template <typename C, typename T>
684695
void processMC(C const& mcCollision, T const& mcParticles)
685696
{
697+
// if (mcCollision.getGeneratorId() != selectedMcGeneratorId)
698+
// return;
686699
rMC.fill(HIST("MC/collisions/hPosXY"), mcCollision.posX(), mcCollision.posY());
687700
rMC.fill(HIST("MC/collisions/hPosZ"), mcCollision.posZ());
688701

0 commit comments

Comments
 (0)