Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please consider the following formatting changes to #9045 #3

Merged
merged 1 commit into from
Dec 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 13 additions & 19 deletions PWGCF/TwoParticleCorrelations/Tasks/neutronProtonCorrZdc.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
// Configurable<int> cfgCentralityEstimator{"cfgCentralityEstimator", 0, "Choice of centrality estimator"};//0 for FTOC, 1 for FTOA, 2 for FTOM, 3 for FVOA. //To be included at a later stage
// Configurable<bool> cfgProcessRun2{"cfgProcessRun2", false, "Analyse Run 2 converted data"};//To be included at a later stage


ConfigurableAxis cfgAxisCent{"cfgAxisCent", {VARIABLE_WIDTH, 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0, 33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0, 49.0, 50.0, 51.0, 52.0, 53.0, 54.0, 55.0, 56.0, 57.0, 58.0, 59.0, 60.0, 61.0, 62.0, 63.0, 64.0, 65.0, 66.0, 67.0, 68.0, 69.0, 70.0, 71.0, 72.0, 73.0, 74.0, 75.0, 76.0, 77.0, 78.0, 79.0, 80.0, 81.0, 82.0, 83.0, 84.0, 85.0, 86.0, 87.0, 88.0, 89.0, 90.0, 91.0, 92.0, 93.0, 94.0, 95.0, 96.0, 97.0, 98.0, 99.0, 100.0}, "Centrality [%]"};

Filter collisionVtxZ = nabs(aod::collision::posZ) < 10.f;
Expand Down Expand Up @@ -74,7 +73,6 @@
HistogramConfigSpec defaultZPSectorHist({HistType::kTH2F, {cfgAxisCent, axisZPSectorSignal}});
HistogramConfigSpec defaultZDCDiffHist({HistType::kTH2F, {cfgAxisCent, axisZDiffSignal}});


// create histograms
histos.add("eventCounter", "eventCounter", kTH1F, {axisCounter});
histos.add("CentralityPercentile", "CentralityPercentile", kTH1F, {cfgAxisCent});
Expand All @@ -94,7 +92,7 @@
histos.add("ASide/CentvsdiffZNSignal", "CentvsdiffZNSignal", defaultZDCDiffHist);
histos.add("ASide/CentvsdiffZPSignal", "CentvsdiffZPSignal", defaultZDCDiffHist);

//Cloning the folder
// Cloning the folder
histos.addClone("ASide/", "CSide/");

histos.add("CentvsZNSignalCommon", "CentvsZNSignalCommon", kTH2F, {cfgAxisCent, axisZNSignal});
Expand All @@ -105,19 +103,18 @@
histos.add("CentvsAlphaZP", "CentvsAlphaZP", kTH2F, {cfgAxisCent, axisAlphaZ});
histos.add("CentvsDiffZNSignal", "CentvsDiffZNSignal", defaultZDCDiffHist);
histos.add("CentvsDiffZPSignal", "CentvsDiffZPSignal", defaultZDCDiffHist);

}
template <int side, typename Z>
void fillZDCHistos(const float centr, const Z& zdc)
{
static constexpr std::string subDir[2] = {"ASide/", "CSide/"};

Check warning on line 110 in PWGCF/TwoParticleCorrelations/Tasks/neutronProtonCorrZdc.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/constexpr-constant]

Use UpperCamelCase for names of constexpr constants. Names of special constants may be prefixed with "k".

std::array<std::array<float, 4>, 2> znEnergyResponse = {zdc.energySectorZNA(), zdc.energySectorZNC()};
std::array<std::array<float, 4>, 2> zpEnergyResponse = {zdc.energySectorZPA(), zdc.energySectorZPC()};
std::array<float, 2> znEnergyResponseCommon = {zdc.energyCommonZNA(), zdc.energyCommonZNC()};
std::array<float, 2> zpEnergyResponseCommon = {zdc.energyCommonZPA(), zdc.energyCommonZPC()};
std::array<std::array<float, 4>, 2> zpEnergyResponse = {zdc.energySectorZPA(), zdc.energySectorZPC()};
std::array<float, 2> znEnergyResponseCommon = {zdc.energyCommonZNA(), zdc.energyCommonZNC()};
std::array<float, 2> zpEnergyResponseCommon = {zdc.energyCommonZPA(), zdc.energyCommonZPC()};

//Fill Neutron ZDC historgrams
// Fill Neutron ZDC historgrams
histos.fill(HIST(subDir[side]) + HIST("CentvsZNSector0Signal"), centr, znEnergyResponse[side][0]);
histos.fill(HIST(subDir[side]) + HIST("CentvsZNSector1Signal"), centr, znEnergyResponse[side][1]);
histos.fill(HIST(subDir[side]) + HIST("CentvsZNSector2Signal"), centr, znEnergyResponse[side][2]);
Expand All @@ -129,9 +126,7 @@
histos.fill(HIST(subDir[side]) + HIST("CentvsZNSignalCommon"), centr, znEnergyResponseCommon[side]);
histos.fill(HIST(subDir[side]) + HIST("CentvsdiffZNSignal"), centr, sumZN - znEnergyResponseCommon[side]);



//Fill Proton ZDC histograms
// Fill Proton ZDC histograms
histos.fill(HIST(subDir[side]) + HIST("CentvsZPSector0Signal"), centr, zpEnergyResponse[side][0]);
histos.fill(HIST(subDir[side]) + HIST("CentvsZPSector1Signal"), centr, zpEnergyResponse[side][1]);
histos.fill(HIST(subDir[side]) + HIST("CentvsZPSector2Signal"), centr, zpEnergyResponse[side][2]);
Expand All @@ -142,7 +137,6 @@
histos.fill(HIST(subDir[side]) + HIST("CentvsZPSignalSum"), centr, sumZP);
histos.fill(HIST(subDir[side]) + HIST("CentvsZPSignalCommon"), centr, zpEnergyResponseCommon[side]);
histos.fill(HIST(subDir[side]) + HIST("CentvsdiffZPSignal"), centr, sumZP - zpEnergyResponseCommon[side]);

}

void processRun3(soa::Filtered<soa::Join<aod::Collisions, aod::EvSels, CentralitiesRun3>>::iterator const& collision, BCsRun3 const&, aod::Zdcs const&)
Expand All @@ -151,7 +145,7 @@
histos.fill(HIST("eventCounter"), 0.25);
return;
}
if(collision.centFT0C()>cfgMaxCentrality) {
if (collision.centFT0C() > cfgMaxCentrality) {
histos.fill(HIST("eventCounter"), 0.75);
return;
}
Expand All @@ -163,14 +157,14 @@
histos.fill(HIST("eventCounter"), 1.25);
histos.fill(HIST("CentralityPercentile"), cent);

fillZDCHistos<0>(cent,zdcread);//Fill A-side
fillZDCHistos<1>(cent,zdcread);//Fill C-side
fillZDCHistos<0>(cent, zdcread); // Fill A-side
fillZDCHistos<1>(cent, zdcread); // Fill C-side

float sumZNC = (zdcread.energySectorZNC())[0] + (zdcread.energySectorZNC())[1] + (zdcread.energySectorZNC())[2] + (zdcread.energySectorZNC())[3];
float sumZNA = (zdcread.energySectorZNA())[0] + (zdcread.energySectorZNA())[1] + (zdcread.energySectorZNA())[2] + (zdcread.energySectorZNA())[3];
float sumZPC = (zdcread.energySectorZPC())[0] + (zdcread.energySectorZPC())[1] + (zdcread.energySectorZPC())[2] + (zdcread.energySectorZPC())[3];
float sumZPA = (zdcread.energySectorZPA())[0] + (zdcread.energySectorZPA())[1] + (zdcread.energySectorZPA())[2] + (zdcread.energySectorZPA())[3];

float alphaZN = (sumZNA - sumZNC) / (sumZNA + sumZNC);
float alphaZP = (sumZPA - sumZPC) / (sumZPA + sumZPC);

Expand All @@ -192,7 +186,7 @@
histos.fill(HIST("eventCounter"), 0.25);
return;
}
if(collision.centRun2V0M()>cfgMaxCentrality) {
if (collision.centRun2V0M() > cfgMaxCentrality) {
histos.fill(HIST("eventCounter"), 0.75);
return;
}
Expand All @@ -204,8 +198,8 @@
histos.fill(HIST("eventCounter"), 1.25);
histos.fill(HIST("CentralityPercentile"), cent);

fillZDCHistos<0>(cent,zdcread);//Fill A-side
fillZDCHistos<1>(cent,zdcread);//Fill C-side
fillZDCHistos<0>(cent, zdcread); // Fill A-side
fillZDCHistos<1>(cent, zdcread); // Fill C-side

float sumZNC = (zdcread.energySectorZNC())[0] + (zdcread.energySectorZNC())[1] + (zdcread.energySectorZNC())[2] + (zdcread.energySectorZNC())[3];
float sumZNA = (zdcread.energySectorZNA())[0] + (zdcread.energySectorZNA())[1] + (zdcread.energySectorZNA())[2] + (zdcread.energySectorZNA())[3];
Expand Down
Loading