Skip to content
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
104 changes: 53 additions & 51 deletions PWGLF/TableProducer/Common/epvector.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
Configurable<float> cfgCutDCAz{"cfgCutDCAz", 2.0f, "DCAz range for tracks"};
Configurable<int> cfgITScluster{"cfgITScluster", 4, "Number of ITS cluster"};
// Configurable<int> cfgTPCcluster{"cfgTPCcluster", 70, "Number of TPC cluster"};
Configurable<float> cfgHarmonic{"cfgHarmonic", 2, "Harmonic for event plane calculation"};
Configurable<bool> useGainCallib{"useGainCallib", true, "use gain calibration"};
Configurable<bool> useRecentere{"useRecentere", true, "use Recentering"};
Configurable<bool> useShift{"useShift", false, "use Shift"};
Expand Down Expand Up @@ -225,29 +226,31 @@
o2::ft0::Geometry ft0Det;
ft0Det.calculateChannelCenter();
auto chPos = ft0Det.getChannelCenter(chno);
return TMath::ATan2(chPos.Y() + offsetY, chPos.X() + offsetX);

Check failure on line 229 in PWGLF/TableProducer/Common/epvector.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

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

double GetPhiInRange(double phi)
double GetPhiInRange(double phi, double harmonic = 2)
{
double result = phi;
double period = 2. * TMath::Pi() / harmonic;
while (result < 0) {
result = result + 2. * TMath::Pi() / 2;
result = result + period;
}
while (result > 2. * TMath::Pi() / 2) {
result = result - 2. * TMath::Pi() / 2;
while (result > period) {
result = result - period;
}
return result;
}

double GetDeltaPsiSubInRange(double psi1, double psi2)
double GetDeltaPsiSubInRange(double psi1, double psi2, double harmonic = 2)
{
double delta = psi1 - psi2;
if (TMath::Abs(delta) > TMath::Pi() / 2) {
double period = TMath::Pi() / harmonic;
if (TMath::Abs(delta) > period) {

Check failure on line 249 in PWGLF/TableProducer/Common/epvector.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 (delta > 0.)
delta -= 2. * TMath::Pi() / 2;
delta -= 2. * period;
else
delta += 2. * TMath::Pi() / 2;
delta += 2. * period;
}
return delta;
}
Expand Down Expand Up @@ -297,7 +300,7 @@
auto qyTPCL = 0.0;
auto qxTPCR = 0.0;
auto qyTPCR = 0.0;
if (coll.sel8() && centrality < cfgCutCentrality && TMath::Abs(vz) < cfgCutVertex && coll.has_foundFT0() && eventSelected(coll, centrality) && coll.selection_bit(aod::evsel::kNoTimeFrameBorder) && coll.selection_bit(aod::evsel::kNoITSROFrameBorder)) {

Check failure on line 303 in PWGLF/TableProducer/Common/epvector.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<TProfile>(ConfGainPath.value, bc.timestamp());
Expand All @@ -320,36 +323,35 @@
float ampl = gainequal * ft0.amplitudeA()[iChA];
histos.fill(HIST("FT0Amp"), chanelid, ampl);
auto phiA = GetPhiFT0(chanelid, offsetFT0Ax, offsetFT0Ay);
qxFT0A = qxFT0A + ampl * TMath::Cos(2.0 * phiA);
qyFT0A = qyFT0A + ampl * TMath::Sin(2.0 * phiA);
qxFT0A = qxFT0A + ampl * TMath::Cos(cfgHarmonic.value * phiA);

Check failure on line 326 in PWGLF/TableProducer/Common/epvector.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
qyFT0A = qyFT0A + ampl * TMath::Sin(cfgHarmonic.value * phiA);

Check failure on line 327 in PWGLF/TableProducer/Common/epvector.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
}
for (std::size_t iChC = 0; iChC < ft0.channelC().size(); iChC++) {
auto chanelid = ft0.channelC()[iChC] + 96;
// printf("Offset for FT0A: x = %d y = %d\n", chanelid, chanelid-96);
auto gainequal = 1.0;
if (useGainCallib) {
gainequal = 1 / gainprofile->GetBinContent(gainprofile->FindBin(chanelid));
}
float ampl = gainequal * ft0.amplitudeC()[iChC];
histos.fill(HIST("FT0Amp"), chanelid, ampl);
auto phiC = GetPhiFT0(chanelid, offsetFT0Cx, offsetFT0Cy);
qxFT0C = qxFT0C + ampl * TMath::Cos(2.0 * phiC);
qyFT0C = qyFT0C + ampl * TMath::Sin(2.0 * phiC);
qxFT0C = qxFT0C + ampl * TMath::Cos(cfgHarmonic.value * phiC);

Check failure on line 338 in PWGLF/TableProducer/Common/epvector.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
qyFT0C = qyFT0C + ampl * TMath::Sin(cfgHarmonic.value * phiC);

Check failure on line 339 in PWGLF/TableProducer/Common/epvector.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

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

for (auto& trk : tracks) {
if (!selectionTrack(trk) || TMath::Abs(trk.eta()) > 0.8 || trk.pt() > cfgCutPTMax || TMath::Abs(trk.eta()) < cfgMinEta) {

Check failure on line 343 in PWGLF/TableProducer/Common/epvector.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
continue;
}
qxTPC = qxTPC + trk.pt() * TMath::Cos(2.0 * trk.phi());
qyTPC = qyTPC + trk.pt() * TMath::Sin(2.0 * trk.phi());
qxTPC = qxTPC + trk.pt() * TMath::Cos(cfgHarmonic.value * trk.phi());

Check failure on line 346 in PWGLF/TableProducer/Common/epvector.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[root/entity]

Replace ROOT entities with equivalents from standard C++ or from O2.
qyTPC = qyTPC + trk.pt() * TMath::Sin(cfgHarmonic.value * trk.phi());

Check failure on line 347 in PWGLF/TableProducer/Common/epvector.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 (trk.eta() < 0.0) {
qxTPCL = qxTPCL + trk.pt() * TMath::Cos(2.0 * trk.phi());
qyTPCL = qyTPCL + trk.pt() * TMath::Sin(2.0 * trk.phi());
qxTPCL = qxTPCL + trk.pt() * TMath::Cos(cfgHarmonic.value * trk.phi());
qyTPCL = qyTPCL + trk.pt() * TMath::Sin(cfgHarmonic.value * trk.phi());
}
if (trk.eta() > 0.0) {
qxTPCR = qxTPCR + trk.pt() * TMath::Cos(2.0 * trk.phi());
qyTPCR = qyTPCR + trk.pt() * TMath::Sin(2.0 * trk.phi());
qxTPCR = qxTPCR + trk.pt() * TMath::Cos(cfgHarmonic.value * trk.phi());
qyTPCR = qyTPCR + trk.pt() * TMath::Sin(cfgHarmonic.value * trk.phi());
}
}
if (useRecentere && (currentRunNumber != lastRunNumber)) {
Expand All @@ -367,11 +369,11 @@
qxTPCR = (qxTPCR - hrecentere->GetBinContent(hrecentere->FindBin(centrality, 8.5))) / hrecentere->GetBinError(hrecentere->FindBin(centrality, 8.5));
qyTPCR = (qyTPCR - hrecentere->GetBinContent(hrecentere->FindBin(centrality, 9.5))) / hrecentere->GetBinError(hrecentere->FindBin(centrality, 9.5));
}
psiFT0C = 0.5 * TMath::ATan2(qyFT0C, qxFT0C);
psiFT0A = 0.5 * TMath::ATan2(qyFT0A, qxFT0A);
psiTPC = 0.5 * TMath::ATan2(qyTPC, qxTPC);
psiTPCL = 0.5 * TMath::ATan2(qyTPCL, qxTPCL);
psiTPCR = 0.5 * TMath::ATan2(qyTPCR, qxTPCR);
psiFT0C = (1.0 / cfgHarmonic.value) * TMath::ATan2(qyFT0C, qxFT0C);
psiFT0A = (1.0 / cfgHarmonic.value) * TMath::ATan2(qyFT0A, qxFT0A);
psiTPC = (1.0 / cfgHarmonic.value) * TMath::ATan2(qyTPC, qxTPC);
psiTPCL = (1.0 / cfgHarmonic.value) * TMath::ATan2(qyTPCL, qxTPCL);
psiTPCR = (1.0 / cfgHarmonic.value) * TMath::ATan2(qyTPCR, qxTPCR);

if (useShift && (currentRunNumber != lastRunNumber)) {
shiftprofile = ccdb->getForTimeStamp<TProfile3D>(ConfShift.value, bc.timestamp());
Expand All @@ -391,7 +393,7 @@
for (int ishift = 1; ishift <= 10; ishift++) {
auto coeffshiftxFT0C = shiftprofile->GetBinContent(shiftprofile->FindBin(centrality, 0.5, ishift - 0.5));
auto coeffshiftyFT0C = shiftprofile->GetBinContent(shiftprofile->FindBin(centrality, 1.5, ishift - 0.5));
deltapsiFT0C = deltapsiFT0C + ((1 / (1.0 * ishift)) * (-coeffshiftxFT0C * TMath::Cos(ishift * 2.0 * psiFT0C) + coeffshiftyFT0C * TMath::Sin(ishift * 2.0 * psiFT0C)));
deltapsiFT0C = deltapsiFT0C + ((1 / (1.0 * ishift)) * (-coeffshiftxFT0C * TMath::Cos(ishift * cfgHarmonic.value * psiFT0C) + coeffshiftyFT0C * TMath::Sin(ishift * cfgHarmonic.value * psiFT0C)));
if (useShift2) {
auto coeffshiftxFT0A = shiftprofile2->GetBinContent(shiftprofile2->FindBin(centrality, 0.5, ishift - 0.5));
auto coeffshiftyFT0A = shiftprofile2->GetBinContent(shiftprofile2->FindBin(centrality, 1.5, ishift - 0.5));
Expand All @@ -404,10 +406,10 @@

auto coeffshiftxTPCR = shiftprofile5->GetBinContent(shiftprofile5->FindBin(centrality, 0.5, ishift - 0.5));
auto coeffshiftyTPCR = shiftprofile5->GetBinContent(shiftprofile5->FindBin(centrality, 1.5, ishift - 0.5));
deltapsiFT0A = deltapsiFT0A + ((1 / (1.0 * ishift)) * (-coeffshiftxFT0A * TMath::Cos(ishift * 2.0 * psiFT0A) + coeffshiftyFT0A * TMath::Sin(ishift * 2.0 * psiFT0A)));
deltapsiTPC = deltapsiTPC + ((1 / (1.0 * ishift)) * (-coeffshiftxTPC * TMath::Cos(ishift * 2.0 * psiTPC) + coeffshiftyTPC * TMath::Sin(ishift * 2.0 * psiTPC)));
deltapsiTPCL = deltapsiTPCL + ((1 / (1.0 * ishift)) * (-coeffshiftxTPCL * TMath::Cos(ishift * 2.0 * psiTPCL) + coeffshiftyTPCL * TMath::Sin(ishift * 2.0 * psiTPCL)));
deltapsiTPCR = deltapsiTPCR + ((1 / (1.0 * ishift)) * (-coeffshiftxTPCR * TMath::Cos(ishift * 2.0 * psiTPCR) + coeffshiftyTPCR * TMath::Sin(ishift * 2.0 * psiTPCR)));
deltapsiFT0A = deltapsiFT0A + ((1 / (1.0 * ishift)) * (-coeffshiftxFT0A * TMath::Cos(ishift * cfgHarmonic.value * psiFT0A) + coeffshiftyFT0A * TMath::Sin(ishift * cfgHarmonic.value * psiFT0A)));
deltapsiTPC = deltapsiTPC + ((1 / (1.0 * ishift)) * (-coeffshiftxTPC * TMath::Cos(ishift * cfgHarmonic.value * psiTPC) + coeffshiftyTPC * TMath::Sin(ishift * cfgHarmonic.value * psiTPC)));
deltapsiTPCL = deltapsiTPCL + ((1 / (1.0 * ishift)) * (-coeffshiftxTPCL * TMath::Cos(ishift * cfgHarmonic.value * psiTPCL) + coeffshiftyTPCL * TMath::Sin(ishift * cfgHarmonic.value * psiTPCL)));
deltapsiTPCR = deltapsiTPCR + ((1 / (1.0 * ishift)) * (-coeffshiftxTPCR * TMath::Cos(ishift * cfgHarmonic.value * psiTPCR) + coeffshiftyTPCR * TMath::Sin(ishift * cfgHarmonic.value * psiTPCR)));
}
}
psiFT0C = psiFT0C + deltapsiFT0C;
Expand All @@ -432,12 +434,12 @@
histos.fill(HIST("QyTPCR"), centrality, qyTPCR);
histos.fill(HIST("PsiTPCR"), centrality, psiTPCR);

histos.fill(HIST("ResFT0CFT0A"), centrality, TMath::Cos(2.0 * (psiFT0C - psiFT0A)), occupancy);
histos.fill(HIST("ResFT0CTPC"), centrality, TMath::Cos(2.0 * (psiFT0C - psiTPC)), occupancy);
histos.fill(HIST("ResFT0ATPC"), centrality, TMath::Cos(2.0 * (psiFT0A - psiTPC)), occupancy);
histos.fill(HIST("ResFT0CTPCL"), centrality, TMath::Cos(2.0 * (psiFT0C - psiTPCL)), occupancy);
histos.fill(HIST("ResFT0CTPCR"), centrality, TMath::Cos(2.0 * (psiFT0C - psiTPCR)), occupancy);
histos.fill(HIST("ResTPCRTPCL"), centrality, TMath::Cos(2.0 * (psiTPCR - psiTPCL)), occupancy);
histos.fill(HIST("ResFT0CFT0A"), centrality, TMath::Cos(cfgHarmonic.value * (psiFT0C - psiFT0A)), occupancy);
histos.fill(HIST("ResFT0CTPC"), centrality, TMath::Cos(cfgHarmonic.value * (psiFT0C - psiTPC)), occupancy);
histos.fill(HIST("ResFT0ATPC"), centrality, TMath::Cos(cfgHarmonic.value * (psiFT0A - psiTPC)), occupancy);
histos.fill(HIST("ResFT0CTPCL"), centrality, TMath::Cos(cfgHarmonic.value * (psiFT0C - psiTPCL)), occupancy);
histos.fill(HIST("ResFT0CTPCR"), centrality, TMath::Cos(cfgHarmonic.value * (psiFT0C - psiTPCR)), occupancy);
histos.fill(HIST("ResTPCRTPCL"), centrality, TMath::Cos(cfgHarmonic.value * (psiTPCR - psiTPCL)), occupancy);

double qFT0Cmag = TMath::Sqrt(qxFT0C * qxFT0C + qyFT0C * qyFT0C);
double qFT0Amag = TMath::Sqrt(qxFT0A * qxFT0A + qyFT0A * qyFT0A);
Expand All @@ -451,28 +453,28 @@
histos.fill(HIST("QFT0C"), centrality, qFT0Cmag, occupancy);
histos.fill(HIST("QFT0A"), centrality, qFT0Amag, occupancy);

histos.fill(HIST("ResFT0CFT0ASP"), centrality, qFT0Cmag * qFT0Amag * TMath::Cos(2.0 * (psiFT0C - psiFT0A)), occupancy);
histos.fill(HIST("ResFT0CTPCSP"), centrality, qFT0Cmag * qTPCmag * TMath::Cos(2.0 * (psiFT0C - psiTPC)), occupancy);
histos.fill(HIST("ResFT0ATPCSP"), centrality, qFT0Amag * qTPCmag * TMath::Cos(2.0 * (psiFT0A - psiTPC)), occupancy);
histos.fill(HIST("ResFT0CTPCLSP"), centrality, qFT0Cmag * qTPCLmag * TMath::Cos(2.0 * (psiFT0C - psiTPCL)), occupancy);
histos.fill(HIST("ResFT0CTPCRSP"), centrality, qFT0Cmag * qTPCRmag * TMath::Cos(2.0 * (psiFT0C - psiTPCR)), occupancy);
histos.fill(HIST("ResTPCRTPCLSP"), centrality, qTPCRmag * qTPCLmag * TMath::Cos(2.0 * (psiTPCR - psiTPCL)), occupancy);
histos.fill(HIST("ResFT0CFT0ASP"), centrality, qFT0Cmag * qFT0Amag * TMath::Cos(cfgHarmonic.value * (psiFT0C - psiFT0A)), occupancy);
histos.fill(HIST("ResFT0CTPCSP"), centrality, qFT0Cmag * qTPCmag * TMath::Cos(cfgHarmonic.value * (psiFT0C - psiTPC)), occupancy);
histos.fill(HIST("ResFT0ATPCSP"), centrality, qFT0Amag * qTPCmag * TMath::Cos(cfgHarmonic.value * (psiFT0A - psiTPC)), occupancy);
histos.fill(HIST("ResFT0CTPCLSP"), centrality, qFT0Cmag * qTPCLmag * TMath::Cos(cfgHarmonic.value * (psiFT0C - psiTPCL)), occupancy);
histos.fill(HIST("ResFT0CTPCRSP"), centrality, qFT0Cmag * qTPCRmag * TMath::Cos(cfgHarmonic.value * (psiFT0C - psiTPCR)), occupancy);
histos.fill(HIST("ResTPCRTPCLSP"), centrality, qTPCRmag * qTPCLmag * TMath::Cos(cfgHarmonic.value * (psiTPCR - psiTPCL)), occupancy);

for (int ishift = 1; ishift <= 10; ishift++) {
histos.fill(HIST("ShiftFT0C"), centrality, 0.5, ishift - 0.5, TMath::Sin(ishift * 2.0 * psiFT0C));
histos.fill(HIST("ShiftFT0C"), centrality, 1.5, ishift - 0.5, TMath::Cos(ishift * 2.0 * psiFT0C));
histos.fill(HIST("ShiftFT0C"), centrality, 0.5, ishift - 0.5, TMath::Sin(ishift * cfgHarmonic.value * psiFT0C));
histos.fill(HIST("ShiftFT0C"), centrality, 1.5, ishift - 0.5, TMath::Cos(ishift * cfgHarmonic.value * psiFT0C));

histos.fill(HIST("ShiftFT0A"), centrality, 0.5, ishift - 0.5, TMath::Sin(ishift * 2.0 * psiFT0A));
histos.fill(HIST("ShiftFT0A"), centrality, 1.5, ishift - 0.5, TMath::Cos(ishift * 2.0 * psiFT0A));
histos.fill(HIST("ShiftFT0A"), centrality, 0.5, ishift - 0.5, TMath::Sin(ishift * cfgHarmonic.value * psiFT0A));
histos.fill(HIST("ShiftFT0A"), centrality, 1.5, ishift - 0.5, TMath::Cos(ishift * cfgHarmonic.value * psiFT0A));

histos.fill(HIST("ShiftTPC"), centrality, 0.5, ishift - 0.5, TMath::Sin(ishift * 2.0 * psiTPC));
histos.fill(HIST("ShiftTPC"), centrality, 1.5, ishift - 0.5, TMath::Cos(ishift * 2.0 * psiTPC));
histos.fill(HIST("ShiftTPC"), centrality, 0.5, ishift - 0.5, TMath::Sin(ishift * cfgHarmonic.value * psiTPC));
histos.fill(HIST("ShiftTPC"), centrality, 1.5, ishift - 0.5, TMath::Cos(ishift * cfgHarmonic.value * psiTPC));

histos.fill(HIST("ShiftTPCL"), centrality, 0.5, ishift - 0.5, TMath::Sin(ishift * 2.0 * psiTPCL));
histos.fill(HIST("ShiftTPCL"), centrality, 1.5, ishift - 0.5, TMath::Cos(ishift * 2.0 * psiTPCL));
histos.fill(HIST("ShiftTPCL"), centrality, 0.5, ishift - 0.5, TMath::Sin(ishift * cfgHarmonic.value * psiTPCL));
histos.fill(HIST("ShiftTPCL"), centrality, 1.5, ishift - 0.5, TMath::Cos(ishift * cfgHarmonic.value * psiTPCL));

histos.fill(HIST("ShiftTPCR"), centrality, 0.5, ishift - 0.5, TMath::Sin(ishift * 2.0 * psiTPCR));
histos.fill(HIST("ShiftTPCR"), centrality, 1.5, ishift - 0.5, TMath::Cos(ishift * 2.0 * psiTPCR));
histos.fill(HIST("ShiftTPCR"), centrality, 0.5, ishift - 0.5, TMath::Sin(ishift * cfgHarmonic.value * psiTPCR));
histos.fill(HIST("ShiftTPCR"), centrality, 1.5, ishift - 0.5, TMath::Cos(ishift * cfgHarmonic.value * psiTPCR));
}
lastRunNumber = currentRunNumber;
}
Expand Down
Loading