Skip to content

Commit dd0ad4a

Browse files
authored
Merge pull request #106 from alibuild/alibot-cleanup-17420
[PWGCF] Please consider the following formatting changes to #17420
2 parents efae2f5 + 19b7a88 commit dd0ad4a

1 file changed

Lines changed: 47 additions & 47 deletions

File tree

PWGCF/Flow/TableProducer/zdcQVectors.cxx

Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -739,61 +739,61 @@ struct ZdcQVectors {
739739
if (hist->InheritsFrom("TProfile2D")) {
740740
// needed for energy calibration!
741741
auto h = dynamic_cast<TProfile2D*>(hist);
742-
if(h){
743-
TString name = h->GetName();
744-
int binrunnumber = h->GetXaxis()->FindBin(TString::Format("%d", cal.runnumber));
745-
int bin = h->GetYaxis()->FindBin(cal.centrality);
746-
calibConstant = h->GetBinContent(binrunnumber, bin);
742+
if (h) {
743+
TString name = h->GetName();
744+
int binrunnumber = h->GetXaxis()->FindBin(TString::Format("%d", cal.runnumber));
745+
int bin = h->GetYaxis()->FindBin(cal.centrality);
746+
calibConstant = h->GetBinContent(binrunnumber, bin);
747747
}
748748
} else if (hist->InheritsFrom("TProfile")) {
749749
auto h = dynamic_cast<TProfile*>(hist);
750-
if(h){
751-
TString name = h->GetName();
752-
int bin{};
753-
if (name.Contains("mean_vx")) {
754-
bin = h->GetXaxis()->FindBin(cal.v[0]);
755-
}
756-
if (name.Contains("mean_vy")) {
757-
bin = h->GetXaxis()->FindBin(cal.v[1]);
758-
}
759-
if (name.Contains("mean_vz")) {
760-
bin = h->GetXaxis()->FindBin(cal.v[2]);
761-
}
762-
if (name.Contains("mean_cent")) {
763-
bin = h->GetXaxis()->FindBin(cal.centrality);
764-
}
765-
if (name.Contains("vertex")) {
766-
bin = h->GetXaxis()->FindBin(TString::Format("%i", cal.runnumber));
767-
}
768-
if (name.Contains("timestamp")) {
769-
bin = h->GetXaxis()->FindBin(cal.timestamp);
750+
if (h) {
751+
TString name = h->GetName();
752+
int bin{};
753+
if (name.Contains("mean_vx")) {
754+
bin = h->GetXaxis()->FindBin(cal.v[0]);
755+
}
756+
if (name.Contains("mean_vy")) {
757+
bin = h->GetXaxis()->FindBin(cal.v[1]);
758+
}
759+
if (name.Contains("mean_vz")) {
760+
bin = h->GetXaxis()->FindBin(cal.v[2]);
761+
}
762+
if (name.Contains("mean_cent")) {
763+
bin = h->GetXaxis()->FindBin(cal.centrality);
764+
}
765+
if (name.Contains("vertex")) {
766+
bin = h->GetXaxis()->FindBin(TString::Format("%i", cal.runnumber));
767+
}
768+
if (name.Contains("timestamp")) {
769+
bin = h->GetXaxis()->FindBin(cal.timestamp);
770+
}
771+
calibConstant = h->GetBinContent(bin);
770772
}
771-
calibConstant = h->GetBinContent(bin);
772-
}
773773
} else if (hist->InheritsFrom("THnSparse")) {
774774
std::vector<int> sparsePars;
775775
auto h = dynamic_cast<THnSparseD*>(hist);
776-
if(h){
777-
sparsePars.push_back(h->GetAxis(0)->FindBin(cal.centrality));
778-
sparsePars.push_back(h->GetAxis(1)->FindBin(cal.v[0]));
779-
sparsePars.push_back(h->GetAxis(2)->FindBin(cal.v[1]));
780-
sparsePars.push_back(h->GetAxis(3)->FindBin(cal.v[2]));
781-
782-
for (std::size_t i = 0; i < sparsePars.size(); i++) {
783-
h->GetAxis(i)->SetRange(sparsePars[i], sparsePars[i]);
784-
}
776+
if (h) {
777+
sparsePars.push_back(h->GetAxis(0)->FindBin(cal.centrality));
778+
sparsePars.push_back(h->GetAxis(1)->FindBin(cal.v[0]));
779+
sparsePars.push_back(h->GetAxis(2)->FindBin(cal.v[1]));
780+
sparsePars.push_back(h->GetAxis(3)->FindBin(cal.v[2]));
781+
782+
for (std::size_t i = 0; i < sparsePars.size(); i++) {
783+
h->GetAxis(i)->SetRange(sparsePars[i], sparsePars[i]);
784+
}
785785

786-
auto tempProj = h->Projection(4);
787-
calibConstant = tempProj->GetMean();
786+
auto tempProj = h->Projection(4);
787+
calibConstant = tempProj->GetMean();
788788

789-
if (tempProj->GetEntries() < cfgMinEntriesSparseBin) {
790-
LOGF(debug, "1 entry in sparse bin! Not used... (increase binsize)");
791-
calibConstant = 0;
792-
cal.isSelected = false;
793-
}
789+
if (tempProj->GetEntries() < cfgMinEntriesSparseBin) {
790+
LOGF(debug, "1 entry in sparse bin! Not used... (increase binsize)");
791+
calibConstant = 0;
792+
cal.isSelected = false;
793+
}
794794

795-
delete tempProj;
796-
}
795+
delete tempProj;
796+
}
797797
}
798798

799799
return calibConstant;
@@ -1170,11 +1170,11 @@ struct ZdcQVectors {
11701170
LOGF(info, "Getting shift profile from CCDB for runnumber: %d", runnumber);
11711171
TList* hcorrList = ccdb->getForTimeStamp<TList>(cfgCCDBdir_Shift.value, foundBC.timestamp());
11721172
auto shiftProfileC = dynamic_cast<TProfile3D*>(hcorrList->FindObject("ShiftZDCC"));
1173-
if(shiftProfileC) {
1173+
if (shiftProfileC) {
11741174
cal.shiftprofileC = shiftProfileC;
11751175
}
11761176
auto shiftProfileA = dynamic_cast<TProfile3D*>(hcorrList->FindObject("ShiftZDCA"));
1177-
if(shiftProfileA) {
1177+
if (shiftProfileA) {
11781178
cal.shiftprofileA = shiftProfileA;
11791179
}
11801180
if (!cal.shiftprofileC || !cal.shiftprofileA) {

0 commit comments

Comments
 (0)