Skip to content

Commit bdd201c

Browse files
committed
Please consider the following formatting changes
1 parent 2990d38 commit bdd201c

4 files changed

Lines changed: 30 additions & 30 deletions

File tree

DataFormats/Detectors/TOF/include/DataFormatsTOF/Diagnostic.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ class Diagnostic
4444
uint32_t fillEmptyTOF(uint32_t frequency = 1) { return fill(1, frequency); }
4545
static ULong64_t getEmptyCrateKey(int crate);
4646
static ULong64_t getNoisyChannelKey(int channel);
47-
static ULong64_t getDRMKey(int crate) { return 1000000 + crate*1000; }
48-
static ULong64_t getDRMerrorKey(int crate, int error) {return getDRMKey(crate) + error; }
47+
static ULong64_t getDRMKey(int crate) { return 1000000 + crate * 1000; }
48+
static ULong64_t getDRMerrorKey(int crate, int error) { return getDRMKey(crate) + error; }
4949
uint32_t getFrequencyDRM(int crate) const { return getFrequency(getDRMKey(crate)); }
5050
uint32_t getFrequencyDRMerror(int crate, int error) const { return getFrequency(getDRMerrorKey(crate, error)); }
5151
uint32_t fillDRM(int crate, uint32_t frequency) { return fill(getDRMKey(crate), frequency); }

Detectors/TOF/base/src/CalibTOFapi.cxx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,18 @@ o2::tof::Diagnostic CalibTOFapi::doDRMerrCalibFromQCHisto(const TH2F* histo, con
2323
// note that, differently from TRM errors, DRM ones are not stored in CTF by design (since very rare, as expected). Such an info is available only at the level of raw sync QC
2424
o2::tof::Diagnostic drmDia;
2525

26-
for(int j=1; j<=72;j++){
27-
drmDia.fillDRM(j-1, histo->GetBinContent(1,j));
28-
for(int i=2; i <= histo->GetXaxis()->GetNbins();i++){
29-
if(histo->GetBinContent(1,j)){
30-
if(histo->GetBinContent(i,j) > 0){
31-
drmDia.fillDRMerror(j-1, i-1, histo->GetBinContent(i,j));
32-
}
26+
for (int j = 1; j <= 72; j++) {
27+
drmDia.fillDRM(j - 1, histo->GetBinContent(1, j));
28+
for (int i = 2; i <= histo->GetXaxis()->GetNbins(); i++) {
29+
if (histo->GetBinContent(1, j)) {
30+
if (histo->GetBinContent(i, j) > 0) {
31+
drmDia.fillDRMerror(j - 1, i - 1, histo->GetBinContent(i, j));
32+
}
3333
}
3434
}
3535
}
3636

37-
TFile *fo = new TFile(file_output_name, "RECREATE");
37+
TFile* fo = new TFile(file_output_name, "RECREATE");
3838
fo->WriteObjectAny(&drmDia, drmDia.Class_Name(), "ccdb_object");
3939
fo->Close();
4040
LOG(info) << "DRM error ccdb object created in " << file_output_name << " with this content";

Detectors/TOF/prototyping/checkDRMobj_tof.C

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,27 @@
44
#include "TOFBase/CalibTOFapi.h"
55
#endif
66

7-
void checkDRMobj_tof(const char* fname="ccdb.root"){
8-
TFile *f = new TFile(fname);
7+
void checkDRMobj_tof(const char* fname = "ccdb.root")
8+
{
9+
TFile* f = new TFile(fname);
910

10-
TH2F *hErrors = new TH2F("hDRMerrors",";error code; frequency",30,0,30,72,0,72);
11+
TH2F* hErrors = new TH2F("hDRMerrors", ";error code; frequency", 30, 0, 30, 72, 0, 72);
1112

12-
o2::tof::Diagnostic* drmDia = (o2::tof::Diagnostic *) f->Get("ccdb_object");
13+
o2::tof::Diagnostic* drmDia = (o2::tof::Diagnostic*)f->Get("ccdb_object");
1314

14-
for(int j=1; j<=72;j++){
15-
uint32_t patternRDH = o2::tof::Diagnostic::getDRMKey(j-1);
16-
for(int i=1; i<=hErrors->GetXaxis()->GetNbins();i++){
17-
uint32_t pattern = o2::tof::Diagnostic::getDRMerrorKey(j-1, i-1);
18-
if(drmDia->getFrequency(patternRDH)){
19-
hErrors->SetBinContent(i,j,drmDia->getFrequency(pattern)*1./drmDia->getFrequency(patternRDH));
15+
for (int j = 1; j <= 72; j++) {
16+
uint32_t patternRDH = o2::tof::Diagnostic::getDRMKey(j - 1);
17+
for (int i = 1; i <= hErrors->GetXaxis()->GetNbins(); i++) {
18+
uint32_t pattern = o2::tof::Diagnostic::getDRMerrorKey(j - 1, i - 1);
19+
if (drmDia->getFrequency(patternRDH)) {
20+
hErrors->SetBinContent(i, j, drmDia->getFrequency(pattern) * 1. / drmDia->getFrequency(patternRDH));
2021
}
2122
}
2223
}
2324

24-
TCanvas *c = new TCanvas();
25+
TCanvas* c = new TCanvas();
2526
c->cd(1);
2627
hErrors->Draw("colz");
2728

2829
drmDia->print(true);
29-
3030
}

Detectors/TOF/prototyping/makeDRMobj_tof.C

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,24 @@
44
#include "TOFBase/CalibTOFapi.h"
55
#endif
66

7-
8-
void makeDRMobj_tof(const char* inputfile="TObject_1764607157510.root", bool dummy=false){
9-
TFile *f = new TFile(inputfile);
10-
TH2F *h = (TH2F *) f->Get("ccdb_object");
7+
void makeDRMobj_tof(const char* inputfile = "TObject_1764607157510.root", bool dummy = false)
8+
{
9+
TFile* f = new TFile(inputfile);
10+
TH2F* h = (TH2F*)f->Get("ccdb_object");
1111

1212
o2::tof::Diagnostic drmDia;
1313

14-
if(! dummy){
14+
if (!dummy) {
1515
drmDia = o2::tof::CalibTOFapi::doDRMerrCalibFromQCHisto(h, "ccdb.root");
1616
return;
1717
}
1818

1919
// continue if dummy
20-
for(int j=1; j<=72;j++){
21-
drmDia.fill(o2::tof::Diagnostic::getDRMKey(j-1));
20+
for (int j = 1; j <= 72; j++) {
21+
drmDia.fill(o2::tof::Diagnostic::getDRMKey(j - 1));
2222
}
2323

24-
TFile *fo = new TFile("ccdb.root","RECREATE");
24+
TFile* fo = new TFile("ccdb.root", "RECREATE");
2525
fo->WriteObjectAny(&drmDia, drmDia.Class_Name(), "ccdb_object");
2626
fo->Close();
2727
}

0 commit comments

Comments
 (0)