-
Notifications
You must be signed in to change notification settings - Fork 445
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ZDC - Tower intercalibration workflow (#8526)
* ZDC tower and ZEM intercalibration * Correct squashing mistake * Fix test on CreateInterCalibConfig.C * clang-format * Fix test on CreateInterCalibConfig.C * Fix build errors
- Loading branch information
Showing
42 changed files
with
2,516 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
DataFormats/Detectors/ZDC/include/DataFormatsZDC/InterCalibData.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// Copyright 2019-2020 CERN and copyright holders of ALICE O2. | ||
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. | ||
// All rights not expressly granted are reserved. | ||
// | ||
// This software is distributed under the terms of the GNU General Public | ||
// License v3 (GPL Version 3), copied verbatim in the file "COPYING". | ||
// | ||
// In applying this license CERN does not waive the privileges and immunities | ||
// granted to it by virtue of its status as an Intergovernmental Organization | ||
// or submit itself to any jurisdiction. | ||
|
||
#ifndef _ZDC_INTERCALIB_DATA_H_ | ||
#define _ZDC_INTERCALIB_DATA_H_ | ||
|
||
#include "ZDCBase/Constants.h" | ||
#include <array> | ||
#include <Rtypes.h> | ||
|
||
/// \file InterCalibData.h | ||
/// \brief Intercalibration intermediate data | ||
/// \author [email protected] | ||
|
||
namespace o2 | ||
{ | ||
namespace zdc | ||
{ | ||
|
||
struct InterCalibData { | ||
static constexpr int NPAR = 6; /// Dimension of matrix (1 + 4 coefficients + offset) | ||
static constexpr int NH = 5; /// ZNA, ZPA, ZNC, ZPC, ZEM | ||
double mSum[NH][NPAR][NPAR] = {0}; /// Cumulated sums | ||
uint64_t mCTimeBeg = 0; /// Time of processed time frame | ||
uint64_t mCTimeEnd = 0; /// Time of processed time frame | ||
static constexpr const char* DN[NH] = {"ZNA", "ZPA", "ZNC", "ZPC", "ZEM"}; | ||
InterCalibData& operator+=(const InterCalibData& other); | ||
int getEntries(int ih) const; | ||
void print() const; | ||
void setCreationTime(uint64_t ctime); | ||
ClassDefNV(InterCalibData, 1); | ||
}; | ||
|
||
} // namespace zdc | ||
} // namespace o2 | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
// Copyright 2019-2020 CERN and copyright holders of ALICE O2. | ||
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. | ||
// All rights not expressly granted are reserved. | ||
// | ||
// This software is distributed under the terms of the GNU General Public | ||
// License v3 (GPL Version 3), copied verbatim in the file "COPYING". | ||
// | ||
// In applying this license CERN does not waive the privileges and immunities | ||
// granted to it by virtue of its status as an Intergovernmental Organization | ||
// or submit itself to any jurisdiction. | ||
|
||
#include "Framework/Logger.h" | ||
#include "DataFormatsZDC/InterCalibData.h" | ||
|
||
using namespace o2::zdc; | ||
|
||
void InterCalibData::print() const | ||
{ | ||
for (int i = 0; i < NH; i++) { | ||
LOGF(info, "%s", DN[i]); | ||
for (int j = 0; j < NPAR; j++) { | ||
for (int k = 0; k < NPAR; k++) { | ||
if (k == 0) { | ||
printf("%e", mSum[i][j][k]); | ||
} else { | ||
printf(" %e", mSum[i][j][k]); | ||
} | ||
} | ||
printf("\n"); | ||
} | ||
} | ||
} | ||
|
||
InterCalibData& InterCalibData::operator+=(const InterCalibData& other) | ||
{ | ||
for (int32_t ih = 0; ih < NH; ih++) { | ||
for (int32_t i = 0; i < NPAR; i++) { | ||
for (int32_t j = 0; j < NPAR; j++) { | ||
mSum[ih][i][j] += other.mSum[ih][i][j]; | ||
} | ||
} | ||
} | ||
if (mCTimeBeg == 0 || other.mCTimeBeg < mCTimeBeg) { | ||
mCTimeBeg = other.mCTimeBeg; | ||
} | ||
if (other.mCTimeEnd > mCTimeEnd) { | ||
mCTimeEnd = other.mCTimeEnd; | ||
} | ||
//#ifdef O2_ZDC_DEBUG | ||
LOGF(info, "InterCalibData [%llu : %llu]: %s=%d %s=%d %s=%d %s=%d %s=%d", mCTimeBeg, mCTimeEnd, DN[0], getEntries(0), DN[1], getEntries(1), | ||
DN[2], getEntries(2), DN[3], getEntries(3), DN[4], getEntries(4)); | ||
//#endif | ||
return *this; | ||
} | ||
|
||
void InterCalibData::setCreationTime(uint64_t ctime) | ||
{ | ||
mCTimeBeg = ctime; | ||
mCTimeEnd = ctime; | ||
#ifdef O2_ZDC_DEBUG | ||
LOGF(info, "InterCalibData::setCreationTime %llu", ctime); | ||
#endif | ||
} | ||
|
||
int InterCalibData::getEntries(int ih) const | ||
{ | ||
if (ih < 0 || ih >= NH) { | ||
LOGF(error, "InterCalibData::getEntries ih = %d is out of range", ih); | ||
return 0; | ||
} | ||
return mSum[ih][5][5]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.