Skip to content
Merged
Show file tree
Hide file tree
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
68 changes: 44 additions & 24 deletions PWGLF/TableProducer/Common/spvector.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -13,54 +13,57 @@
// \email: prottay.das@cern.ch

// C++/ROOT includes.
#include <TH1F.h>
#include <chrono>
#include <string>
#include <vector>
#include "Math/Vector4D.h"
#include "TF1.h"
#include "TRandom3.h"
#include <TComplex.h>
#include <TH1F.h>
#include <TMath.h>

#include <array>
#include <chrono>
#include <cmath>
#include <iostream>

Check failure on line 26 in PWGLF/TableProducer/Common/spvector.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[include-iostream]

Do not include iostream. Use O2 logging instead.
#include "Math/Vector4D.h"
#include "TRandom3.h"
#include "TF1.h"
#include <string>
#include <vector>

// o2Physics includes.
#include "Framework/AnalysisDataModel.h"
#include "Framework/AnalysisTask.h"
#include "Framework/runDataProcessing.h"
#include "Framework/HistogramRegistry.h"
#include "Framework/StepTHn.h"
#include "Common/DataModel/Multiplicity.h"
#include "Common/DataModel/TrackSelectionTables.h"
#include "CommonConstants/PhysicsConstants.h"
#include "PWGLF/DataModel/SPCalibrationTables.h"

#include "Common/CCDB/ctpRateFetcher.h"
#include "Common/Core/EventPlaneHelper.h"
#include "Common/Core/PID/PIDTOF.h"
#include "Common/Core/TrackSelection.h"
#include "Common/DataModel/FT0Corrected.h"
#include "FT0Base/Geometry.h"
#include "FV0Base/Geometry.h"
#include "Common/Core/trackUtilities.h"
#include "Common/DataModel/Centrality.h"
#include "Common/DataModel/EventSelection.h"
#include "Common/DataModel/FT0Corrected.h"
#include "Common/DataModel/Multiplicity.h"
#include "Common/DataModel/PIDResponse.h"
#include "Common/Core/PID/PIDTOF.h"
#include "Common/TableProducer/PID/pidTOFBase.h"
#include "Common/Core/EventPlaneHelper.h"
#include "Common/DataModel/Qvectors.h"
#include "Common/CCDB/ctpRateFetcher.h"
#include "Common/DataModel/TrackSelectionTables.h"
#include "Common/TableProducer/PID/pidTOFBase.h"

#include "CommonConstants/PhysicsConstants.h"
#include "DataFormatsParameters/GRPMagField.h"
#include "DataFormatsParameters/GRPObject.h"
#include "DataFormatsTPC/BetheBlochAleph.h"
#include "DetectorsBase/GeometryManager.h"
#include "DetectorsBase/Propagator.h"
#include "FT0Base/Geometry.h"
#include "FV0Base/Geometry.h"
#include "Framework/ASoAHelpers.h"
#include "Framework/AnalysisDataModel.h"
#include "Framework/AnalysisTask.h"
#include "Framework/HistogramRegistry.h"
#include "Framework/StepTHn.h"
#include "Framework/runDataProcessing.h"
#include "ReconstructionDataFormats/Track.h"
#include "PWGLF/DataModel/SPCalibrationTables.h"
// #include "SPCalibrationTableswrite.h"

// o2 includes.
#include "CCDB/CcdbApi.h"
#include "CCDB/BasicCCDBManager.h"
#include "CCDB/CcdbApi.h"
#include "DetectorsCommonDataFormats/AlignParam.h"

using namespace o2;
Expand Down Expand Up @@ -227,6 +230,7 @@
AxisSpec basisAxis = {2, 0, 2, "basis"};
AxisSpec VxyAxis = {2, 0, 2, "Vxy"};

histos.add("hEvtSelInfo", "hEvtSelInfo", kTH1F, {{10, 0, 10.0}});
histos.add("hCentrality", "hCentrality", kTH1F, {{centfineAxis}});
histos.add("Vz", "Vz", kTH1F, {vzfineAxis});
histos.add("hpQxZDCAC", "hpQxZDCAC", kTProfile, {centfineAxis});
Expand Down Expand Up @@ -310,7 +314,7 @@

// Bool_t Correctcoarse(int64_t ts, Configurable<std::string>& ConfRecentereSpp, bool useRecentereSp, int currentRunNumber, int lastRunNumber, auto centrality, auto vx, auto vy, auto vz, auto& qxZDCA, auto& qyZDCA, auto& qxZDCC, auto& qyZDCC)
//{
Bool_t Correctcoarse(const THnF* hrecentereSp, auto centrality, auto vx, auto vy, auto vz, auto& qxZDCA, auto& qyZDCA, auto& qxZDCC, auto& qyZDCC)

Check failure on line 317 in PWGLF/TableProducer/Common/spvector.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
{

/*
Expand Down Expand Up @@ -361,7 +365,7 @@

// Bool_t Correctfine(int64_t ts, Configurable<std::string>& ConfRecenterecentSpp, Configurable<std::string>& ConfRecenterevxSpp, Configurable<std::string>& ConfRecenterevySpp, Configurable<std::string>& ConfRecenterevzSpp, bool useRecenterefineSp, int currentRunNumber, int lastRunNumber, auto centrality, auto vx, auto vy, auto vz, auto& qxZDCA, auto& qyZDCA, auto& qxZDCC, auto& qyZDCC)
//{
Bool_t Correctfine(TH2F* hrecenterecentSp, TH2F* hrecenterevxSp, TH2F* hrecenterevySp, TH2F* hrecenterevzSp, auto centrality, auto vx, auto vy, auto vz, auto& qxZDCA, auto& qyZDCA, auto& qxZDCC, auto& qyZDCC)

Check failure on line 368 in PWGLF/TableProducer/Common/spvector.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
{

if (!hrecenterecentSp || !hrecenterevxSp || !hrecenterevySp || !hrecenterevzSp) {
Expand Down Expand Up @@ -410,6 +414,7 @@
void process(MyCollisions::iterator const& collision, aod::FT0s const& /*ft0s*/, aod::FV0As const& /*fv0s*/, BCsRun3 const& bcs, aod::Zdcs const&)
{

histos.fill(HIST("hEvtSelInfo"), 0.5);
auto centrality = collision.centFT0C();
bool triggerevent = false;

Expand Down Expand Up @@ -439,6 +444,8 @@
return;
}

histos.fill(HIST("hEvtSelInfo"), 1.5);

auto zdc = bc.zdc();
auto zncEnergy = zdc.energySectorZNC();
auto znaEnergy = zdc.energySectorZNA();
Expand All @@ -451,35 +458,47 @@
return;
}

histos.fill(HIST("hEvtSelInfo"), 2.5);

if (znaEnergy[0] <= 0.0 || znaEnergy[1] <= 0.0 || znaEnergy[2] <= 0.0 || znaEnergy[3] <= 0.0) {
triggerevent = false;
spcalibrationtable(triggerevent, currentRunNumber, centrality, vx, vy, vz, znaEnergycommon, zncEnergycommon, znaEnergy[0], znaEnergy[1], znaEnergy[2], znaEnergy[3], zncEnergy[0], zncEnergy[1], zncEnergy[2], zncEnergy[3], qxZDCA, qxZDCC, qyZDCA, qyZDCC, psiZDCC, psiZDCA);
return;
}
histos.fill(HIST("hEvtSelInfo"), 3.5);

if (zncEnergy[0] <= 0.0 || zncEnergy[1] <= 0.0 || zncEnergy[2] <= 0.0 || zncEnergy[3] <= 0.0) {
triggerevent = false;
spcalibrationtable(triggerevent, currentRunNumber, centrality, vx, vy, vz, znaEnergycommon, zncEnergycommon, znaEnergy[0], znaEnergy[1], znaEnergy[2], znaEnergy[3], zncEnergy[0], zncEnergy[1], zncEnergy[2], zncEnergy[3], qxZDCA, qxZDCC, qyZDCA, qyZDCC, psiZDCC, psiZDCA);
return;
}

histos.fill(HIST("hEvtSelInfo"), 4.5);

if (rctCut.requireRCTFlagChecker && !rctChecker(collision)) {
triggerevent = false;
spcalibrationtable(triggerevent, currentRunNumber, centrality, vx, vy, vz, znaEnergycommon, zncEnergycommon, znaEnergy[0], znaEnergy[1], znaEnergy[2], znaEnergy[3], zncEnergy[0], zncEnergy[1], zncEnergy[2], zncEnergy[3], qxZDCA, qxZDCC, qyZDCA, qyZDCC, psiZDCC, psiZDCA);
return;
}

histos.fill(HIST("hEvtSelInfo"), 5.5);

if (additionalEvSel && (!collision.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV))) {
triggerevent = false;
spcalibrationtable(triggerevent, currentRunNumber, centrality, vx, vy, vz, znaEnergycommon, zncEnergycommon, znaEnergy[0], znaEnergy[1], znaEnergy[2], znaEnergy[3], zncEnergy[0], zncEnergy[1], zncEnergy[2], zncEnergy[3], qxZDCA, qxZDCC, qyZDCA, qyZDCC, psiZDCC, psiZDCA);
return;
}

histos.fill(HIST("hEvtSelInfo"), 6.5);

if (collision.sel8() && centrality > cfgCutCentralityMin && centrality < cfgCutCentralityMax && TMath::Abs(vz) < cfgCutVertex && collision.has_foundFT0() && collision.selection_bit(aod::evsel::kNoTimeFrameBorder) && collision.selection_bit(aod::evsel::kNoITSROFrameBorder)) {

Check failure on line 494 in PWGLF/TableProducer/Common/spvector.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
triggerevent = true;
if (useGainCallib && (currentRunNumber != lastRunNumber)) {
gainprofile = ccdb->getForTimeStamp<TH2D>(ConfGainPath.value, bc.timestamp());
}

histos.fill(HIST("hEvtSelInfo"), 7.5);

auto gainequal = 1.0;
auto alphaZDC = 0.395;
constexpr double x[4] = {-1.75, 1.75, -1.75, 1.75};
Expand All @@ -503,7 +522,7 @@
} else {
double ampl = gainequal * znaEnergy[iChA];
if (followpub) {
ampl = TMath::Power(ampl, alphaZDC);

Check failure on line 525 in PWGLF/TableProducer/Common/spvector.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
}
qxZDCA = qxZDCA - ampl * x[iChA];
qyZDCA = qyZDCA + ampl * y[iChA];
Expand All @@ -518,7 +537,7 @@
} else {
double ampl = gainequal * zncEnergy[iChA - 4];
if (followpub) {
ampl = TMath::Power(ampl, alphaZDC);

Check failure on line 540 in PWGLF/TableProducer/Common/spvector.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
}
qxZDCC = qxZDCC + ampl * x[iChA - 4];
qyZDCC = qyZDCC + ampl * y[iChA - 4];
Expand Down Expand Up @@ -547,6 +566,7 @@
return;
}

histos.fill(HIST("hEvtSelInfo"), 8.5);
histos.fill(HIST("hCentrality"), centrality);
histos.fill(HIST("Vz"), vz);

Expand All @@ -562,9 +582,9 @@
vy = vy - gainprofilevxy->GetBinContent(2);
}

Bool_t res = 0;

Check failure on line 585 in PWGLF/TableProducer/Common/spvector.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
Bool_t resfine = 0;

Check failure on line 586 in PWGLF/TableProducer/Common/spvector.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
Int_t check = 1;

Check failure on line 587 in PWGLF/TableProducer/Common/spvector.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.

if (coarse1) {
if (useRecentereSp && (currentRunNumber != lastRunNumber)) {
Expand Down Expand Up @@ -672,7 +692,7 @@
if (res == 0 && resfine == 0 && check == 0) {
LOG(info) << "Histograms are null";
}
psiZDCC = 1.0 * TMath::ATan2(qyZDCC, qxZDCC);

Check failure on line 695 in PWGLF/TableProducer/Common/spvector.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
psiZDCA = 1.0 * TMath::ATan2(qyZDCA, qxZDCA);

int nshift = 10; // no. of iterations
Expand Down
Loading
Loading