Skip to content

Commit 0858d04

Browse files
authored
Merge pull request #76 from alibuild/alibot-cleanup-12956
[PWGCF] Please consider the following formatting changes to AliceO2Group#12956
2 parents 3dc6900 + 1261bc0 commit 0858d04

2 files changed

Lines changed: 146 additions & 107 deletions

File tree

PWGCF/Flow/TableProducer/zdcQVectors.cxx

Lines changed: 54 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ struct ZdcQVectors {
109109

110110
struct : ConfigurableGroup {
111111
Configurable<bool> cfgEvtUseRCTFlagChecker{"cfgEvtUseRCTFlagChecker", false, "Evt sel: use RCT flag checker"};
112-
Configurable<std::string> cfgEvtRCTFlagCheckerLabel{"cfgEvtRCTFlagCheckerLabel", "CBT_hadronPID", "Evt sel: RCT flag checker label (CBT, CBT_hadronPID)"}; //all Labels can be found in Common/CCDB/RCTSelectionFlags.h
112+
Configurable<std::string> cfgEvtRCTFlagCheckerLabel{"cfgEvtRCTFlagCheckerLabel", "CBT_hadronPID", "Evt sel: RCT flag checker label (CBT, CBT_hadronPID)"}; // all Labels can be found in Common/CCDB/RCTSelectionFlags.h
113113
Configurable<bool> cfgEvtRCTFlagCheckerZDCCheck{"cfgEvtRCTFlagCheckerZDCCheck", false, "Evt sel: RCT flag checker ZDC check"};
114114
Configurable<bool> cfgEvtRCTFlagCheckerLimitAcceptAsBad{"cfgEvtRCTFlagCheckerLimitAcceptAsBad", false, "Evt sel: RCT flag checker treat Limited Acceptance As Bad"};
115115
} rctFlags;
@@ -161,7 +161,7 @@ struct ZdcQVectors {
161161

162162
enum SelectionCriteria {
163163
evSel_FilteredEvent,
164-
evSel_RCTFlagsZDC,
164+
evSel_RCTFlagsZDC,
165165
evSel_Zvtx,
166166
evSel_sel8,
167167
evSel_occupancy,
@@ -255,8 +255,8 @@ struct ZdcQVectors {
255255
registry.add<TProfile>("QA/ZNA_Energy", "ZNA_Energy", kTProfile, {{8, 0, 8}});
256256
registry.add<TProfile>("QA/ZNC_Energy", "ZNC_Energy", kTProfile, {{8, 0, 8}});
257257

258-
registry.add<TProfile3D>("QA/ShiftZDCC", "ShiftZDCC", kTProfile3D, {{100,0,100}, {2,0,2}, {10,0,10}});
259-
registry.add<TProfile3D>("QA/ShiftZDCA", "ShiftZDCA", kTProfile3D, {{100,0,100}, {2,0,2}, {10,0,10}});
258+
registry.add<TProfile3D>("QA/ShiftZDCC", "ShiftZDCC", kTProfile3D, {{100, 0, 100}, {2, 0, 2}, {10, 0, 10}});
259+
registry.add<TProfile3D>("QA/ShiftZDCA", "ShiftZDCA", kTProfile3D, {{100, 0, 100}, {2, 0, 2}, {10, 0, 10}});
260260
registry.add<TH1>("QA/psiZDCA", "psiZDCA", kTH1D, {{100, -4, 4}});
261261
registry.add<TH1>("QA/psiZDCA_shift", "psiZDCA_shift", kTH1D, {{100, -4, 4}});
262262
registry.add<TH1>("QA/psiZDCC", "psiZDCC", kTH1D, {{100, -4, 4}});
@@ -854,7 +854,7 @@ struct ZdcQVectors {
854854
spTableZDC(runnumber, centrality, v[0], v[1], v[2], q[0], q[1], q[2], q[3], isSelected, 0, 0);
855855
counter++;
856856
lastRunNumber = runnumber;
857-
return;
857+
return;
858858
} else {
859859
if (cfgFillCommonRegistry)
860860
fillCommonRegistry<kBefore>(q[0], q[1], q[2], q[3], v, centrality);
@@ -907,69 +907,69 @@ struct ZdcQVectors {
907907
registry.get<TProfile>(HIST("QA/after/ZNC_Qy"))->Fill(Form("%d", runnumber), qRec[3]);
908908
}
909909

910-
// do shift for psi.
911-
double psiZDCA = 1.0 * std::atan2(qRec[1], qRec[0]);
912-
double psiZDCC = 1.0 * std::atan2(qRec[3], qRec[2]);
910+
// do shift for psi.
911+
double psiZDCA = 1.0 * std::atan2(qRec[1], qRec[0]);
912+
double psiZDCC = 1.0 * std::atan2(qRec[3], qRec[2]);
913913

914-
int nshift = 10; // no. of iterations
914+
int nshift = 10; // no. of iterations
915915

916-
if(cfgFillCommonRegistry) {
917-
for (int ishift = 1; ishift <= nshift; ishift++) {
918-
registry.fill(HIST("QA/ShiftZDCC"), centrality, 0.5, ishift - 0.5, TMath::Sin(ishift * 1.0 * psiZDCC));
919-
registry.fill(HIST("QA/ShiftZDCC"), centrality, 1.5, ishift - 0.5, TMath::Cos(ishift * 1.0 * psiZDCC));
920-
registry.fill(HIST("QA/ShiftZDCA"), centrality, 0.5, ishift - 0.5, TMath::Sin(ishift * 1.0 * psiZDCA));
921-
registry.fill(HIST("QA/ShiftZDCA"), centrality, 1.5, ishift - 0.5, TMath::Cos(ishift * 1.0 * psiZDCA));
916+
if (cfgFillCommonRegistry) {
917+
for (int ishift = 1; ishift <= nshift; ishift++) {
918+
registry.fill(HIST("QA/ShiftZDCC"), centrality, 0.5, ishift - 0.5, TMath::Sin(ishift * 1.0 * psiZDCC));
919+
registry.fill(HIST("QA/ShiftZDCC"), centrality, 1.5, ishift - 0.5, TMath::Cos(ishift * 1.0 * psiZDCC));
920+
registry.fill(HIST("QA/ShiftZDCA"), centrality, 0.5, ishift - 0.5, TMath::Sin(ishift * 1.0 * psiZDCA));
921+
registry.fill(HIST("QA/ShiftZDCA"), centrality, 1.5, ishift - 0.5, TMath::Cos(ishift * 1.0 * psiZDCA));
922+
}
922923
}
923-
}
924924

925-
double psiZDCAshift = psiZDCA;
926-
double psiZDCCshift = psiZDCC;
925+
double psiZDCAshift = psiZDCA;
926+
double psiZDCCshift = psiZDCC;
927+
928+
double deltaPsiZDCA = 0;
929+
double deltaPsiZDCC = 0;
930+
931+
if (cfgUseShift && !cfgCCDBdir_Shift.value.empty()) {
932+
if (lastRunNumber != runnumber) {
933+
TList* hcorrList = ccdb->getForTimeStamp<TList>(cfgCCDBdir_Shift.value, foundBC.timestamp());
934+
shiftprofileC = reinterpret_cast<TProfile3D*>(hcorrList->FindObject("ShiftZDCC"));
935+
shiftprofileA = reinterpret_cast<TProfile3D*>(hcorrList->FindObject("ShiftZDCA"));
936+
}
927937

928-
double deltaPsiZDCA = 0;
929-
double deltaPsiZDCC = 0;
938+
auto deltaPsiZDCC = 0.0;
939+
auto deltaPsiZDCA = 0.0;
930940

931-
if (cfgUseShift && !cfgCCDBdir_Shift.value.empty()) {
932-
if(lastRunNumber != runnumber){
933-
TList* hcorrList = ccdb->getForTimeStamp<TList>(cfgCCDBdir_Shift.value, foundBC.timestamp());
934-
shiftprofileC = reinterpret_cast<TProfile3D*>(hcorrList->FindObject("ShiftZDCC"));
935-
shiftprofileA = reinterpret_cast<TProfile3D*>(hcorrList->FindObject("ShiftZDCA"));
941+
for (int ishift = 1; ishift <= nshift; ishift++) {
942+
auto coeffshiftxZDCC = shiftprofileC->GetBinContent(shiftprofileC->FindBin(centrality, 0.5, ishift - 0.5));
943+
auto coeffshiftyZDCC = shiftprofileC->GetBinContent(shiftprofileC->FindBin(centrality, 1.5, ishift - 0.5));
944+
auto coeffshiftxZDCA = shiftprofileA->GetBinContent(shiftprofileA->FindBin(centrality, 0.5, ishift - 0.5));
945+
auto coeffshiftyZDCA = shiftprofileA->GetBinContent(shiftprofileA->FindBin(centrality, 1.5, ishift - 0.5));
946+
deltaPsiZDCC += deltaPsiZDCC + ((2 / (1.0 * ishift)) * (-coeffshiftxZDCC * TMath::Cos(ishift * 1.0 * psiZDCC) + coeffshiftyZDCC * TMath::Sin(ishift * 1.0 * psiZDCC)));
947+
deltaPsiZDCA += deltaPsiZDCA + ((2 / (1.0 * ishift)) * (-coeffshiftxZDCA * TMath::Cos(ishift * 1.0 * psiZDCA) + coeffshiftyZDCA * TMath::Sin(ishift * 1.0 * psiZDCA)));
948+
}
936949
}
937950

938-
auto deltaPsiZDCC = 0.0;
939-
auto deltaPsiZDCA = 0.0;
951+
psiZDCCshift += deltaPsiZDCC;
952+
psiZDCAshift += deltaPsiZDCA;
940953

941-
for (int ishift = 1; ishift <= nshift; ishift++) {
942-
auto coeffshiftxZDCC = shiftprofileC->GetBinContent(shiftprofileC->FindBin(centrality, 0.5, ishift - 0.5));
943-
auto coeffshiftyZDCC = shiftprofileC->GetBinContent(shiftprofileC->FindBin(centrality, 1.5, ishift - 0.5));
944-
auto coeffshiftxZDCA = shiftprofileA->GetBinContent(shiftprofileA->FindBin(centrality, 0.5, ishift - 0.5));
945-
auto coeffshiftyZDCA = shiftprofileA->GetBinContent(shiftprofileA->FindBin(centrality, 1.5, ishift - 0.5));
946-
deltaPsiZDCC += deltaPsiZDCC + ((2 / (1.0 * ishift)) * (-coeffshiftxZDCC * TMath::Cos(ishift * 1.0 * psiZDCC) + coeffshiftyZDCC * TMath::Sin(ishift * 1.0 * psiZDCC)));
947-
deltaPsiZDCA += deltaPsiZDCA + ((2 / (1.0 * ishift)) * (-coeffshiftxZDCA * TMath::Cos(ishift * 1.0 * psiZDCA) + coeffshiftyZDCA * TMath::Sin(ishift * 1.0 * psiZDCA)));
954+
if (cfgFillCommonRegistry) {
955+
registry.fill(HIST("QA/psiZDCA"), psiZDCAshift);
956+
registry.fill(HIST("QA/psiZDCC"), psiZDCCshift);
957+
registry.fill(HIST("QA/psiZDCA_shift"), psiZDCAshift);
958+
registry.fill(HIST("QA/psiZDCC_shift"), psiZDCCshift);
948959
}
949-
}
950-
951-
psiZDCCshift += deltaPsiZDCC;
952-
psiZDCAshift += deltaPsiZDCA;
953-
954-
if(cfgFillCommonRegistry) {
955-
registry.fill(HIST("QA/psiZDCA"), psiZDCAshift);
956-
registry.fill(HIST("QA/psiZDCC"), psiZDCCshift);
957-
registry.fill(HIST("QA/psiZDCA_shift"), psiZDCAshift);
958-
registry.fill(HIST("QA/psiZDCC_shift"), psiZDCCshift);
959-
}
960960

961-
double qXaShift = std::hypot(qRec[1], qRec[0]) * TMath::Cos(psiZDCAshift);
962-
double qYaShift = std::hypot(qRec[1], qRec[0]) * TMath::Sin(psiZDCAshift);
963-
double qXcShift = std::hypot(qRec[2], qRec[3]) * TMath::Cos(psiZDCCshift);
964-
double qYcShift = std::hypot(qRec[2], qRec[3]) * TMath::Sin(psiZDCCshift);
961+
double qXaShift = std::hypot(qRec[1], qRec[0]) * TMath::Cos(psiZDCAshift);
962+
double qYaShift = std::hypot(qRec[1], qRec[0]) * TMath::Sin(psiZDCAshift);
963+
double qXcShift = std::hypot(qRec[2], qRec[3]) * TMath::Cos(psiZDCCshift);
964+
double qYcShift = std::hypot(qRec[2], qRec[3]) * TMath::Sin(psiZDCCshift);
965965

966-
spTableZDC(runnumber, centrality, v[0], v[1], v[2], qXaShift, qYaShift, qXcShift, qYcShift, isSelected, cal.atIteration, cal.atStep);
966+
spTableZDC(runnumber, centrality, v[0], v[1], v[2], qXaShift, qYaShift, qXcShift, qYcShift, isSelected, cal.atIteration, cal.atStep);
967967

968-
qRec.clear();
968+
qRec.clear();
969969

970-
counter++;
971-
lastRunNumber = runnumber;
972-
return;
970+
counter++;
971+
lastRunNumber = runnumber;
972+
return;
973973
}
974974
LOGF(warning, "We return without saving table... -> THis is a problem");
975975
lastRunNumber = runnumber;

0 commit comments

Comments
 (0)