forked from AliceO2Group/AliceO2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TPC: Adding possibility to correct for V-shape distortions
The time dependent distortions that we observe in the DCAs on the A-side can be similarly corrected as the space-charge distortions. For this a new model is added which we can linearly scale up or down according to current V-shape observed in DCA. Further changes: - TPC IDC scaler adding helper function to split the scalers, when writing to file - fixing timestamp in TPC time series Adding v-shape correction object to several places Adding option to recalculate the inverse correction during reconstruction Pass needed options to tpc-scalers workflow from dpl-workflow.sh connect TPCScalerSpec to dependent standalone workflows Adding option to load correction map from local macro Adding updated v-shape scaler with z-pos Updating v-shape calibration procedure temporary fix compiling Renaming V-shape tp M-shape
- Loading branch information
1 parent
d40b3a0
commit 268f071
Showing
39 changed files
with
822 additions
and
76 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
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
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
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
99 changes: 99 additions & 0 deletions
99
Detectors/TPC/calibration/include/TPCCalibration/TPCMShapeScaler.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,99 @@ | ||
// 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. | ||
|
||
/// \file TPCMShapeScaler.h | ||
/// \author Matthias Kleiner <[email protected]> | ||
|
||
#ifndef ALICEO2_TPC_TPCMShapeScaler | ||
#define ALICEO2_TPC_TPCMShapeScaler | ||
|
||
#include "DataFormatsTPC/Defs.h" | ||
#include <vector> | ||
|
||
class TTree; | ||
|
||
namespace o2::tpc | ||
{ | ||
|
||
/* | ||
Class for storing the scalers (obtained from DCAs) which are used to correct for the V-shape distortions | ||
*/ | ||
|
||
struct TPCMShape { | ||
double getEndTime(float sampling) const { return mStartTimeMS + mScalerA.size() * sampling; } | ||
double mStartTimeMS; ///< start time of the v-shape | ||
std::vector<float> mScalerA; ///< DCA or whatever | ||
std::vector<float> mZPosition; ///< z-position of the delta potential | ||
bool operator<(const TPCMShape& r) const { return mStartTimeMS < r.mStartTimeMS; } | ||
ClassDefNV(TPCMShape, 1); | ||
}; | ||
|
||
class TPCMShapeScaler | ||
{ | ||
public: | ||
/// default constructor | ||
TPCMShapeScaler() = default; | ||
|
||
/// \return returns number of stored v-shapes | ||
int getNValues() const { return mVShape.size(); } | ||
|
||
/// setting the scalers <time, value> | ||
void setScaler(const std::vector<double>& time, const std::vector<float>& scaler, const std::vector<float>& zpos); | ||
|
||
/// \return returns run number for which this object is valid | ||
void setRun(int run) { mRun = run; } | ||
|
||
/// dump this object to a file | ||
/// \param file output file | ||
void dumpToFile(const char* file, const char* name); | ||
|
||
/// load parameters from input file (which were written using the writeToFile method) | ||
/// \param inpf input file | ||
void loadFromFile(const char* inpf, const char* name); | ||
|
||
/// set this object from input tree | ||
void setFromTree(TTree& tpcScalerTree); | ||
|
||
/// set sampling time of the stored values | ||
float setSamplingTimeMS(float t) { return mSamplingTimeMS = t; } | ||
|
||
/// adding a v-shape | ||
void addVShape(const TPCMShape& vshape) { mVShape.emplace_back(); } | ||
|
||
/// \return returns run number for which this object is valid | ||
int getRun() const { return mRun; } | ||
|
||
/// \return returns V-shape scaling value for given timestamp | ||
/// \param timestamp timestamp for which the scaler is queried | ||
std::pair<float, float> getScaler(const double timestamp) const; | ||
|
||
/// \return returns sampling time of the stored values | ||
float getSamplingTimeMS() const { return mSamplingTimeMS; } | ||
|
||
/// \return returns all stored v-shapes | ||
const auto& getVShapes() const { return mVShape; } | ||
|
||
private: | ||
int mRun{}; ///< run for which this object is valid | ||
float mSamplingTimeMS = 1; ///< sampling time of the V-shape scalers | ||
std::vector<TPCMShape> mVShape; ///< vector containing the V-shapes | ||
|
||
/// if distance to neighbouring data is larger than sampling time return 0 for the scaling | ||
bool checkDeltaTime(double deltaTime) const { return deltaTime < 1.5 * mSamplingTimeMS; } | ||
|
||
/// return linear interpolated value | ||
float getVal(float x, float x0, float x1, float y0, float y1) const { return (y0 * (x1 - x) + y1 * (x - x0)) / (x1 - x0); } | ||
|
||
ClassDefNV(TPCMShapeScaler, 1); | ||
}; | ||
|
||
} // namespace o2::tpc | ||
#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
Oops, something went wrong.