-
Notifications
You must be signed in to change notification settings - Fork 494
TRD calibration subdirectory added #5894
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| #Copyright CERN and copyright holders of ALICE O2.This software is distributed | ||
| #under the terms of the GNU General Public License v3(GPL Version 3), copied | ||
| #verbatim in the file "COPYING". | ||
| # | ||
| #See http: //alice-o2.web.cern.ch/license for full licensing information. | ||
| # | ||
| #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. | ||
|
|
||
| o2_add_library(TRDCalibration | ||
| SOURCES src/CalibVDrift.cxx | ||
| PUBLIC_LINK_LIBRARIES O2::TRDBase | ||
| O2::DataFormatsTRD) | ||
|
|
||
| o2_target_root_dictionary(TRDCalibration | ||
| HEADERS include/TRDCalibration/CalibVDrift.h) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| // Copyright CERN and copyright holders of ALICE O2. This software is | ||
| // distributed under the terms of the GNU General Public License v3 (GPL | ||
| // Version 3), copied verbatim in the file "COPYING". | ||
| // | ||
| // See http://alice-o2.web.cern.ch/license for full licensing information. | ||
| // | ||
| // 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 ALICEO2_TRD_CALIBVDRIFT_H_ | ||
| #define ALICEO2_TRD_CALIBVDRIFT_H_ | ||
|
|
||
| /// \file CalibVDrift.h | ||
| /// \author Ole Schmidt, ole.schmidt@cern.ch | ||
|
|
||
| #include "DataFormatsTRD/Constants.h" | ||
| #include <array> | ||
|
|
||
| namespace o2 | ||
| { | ||
| namespace trd | ||
| { | ||
|
|
||
| /// \brief VDrift calibration class | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is future ccdb object, right? Better move it to DataFormats
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually this class is supposed to do the actual calibration (create profile histograms and do some fitting) and create ccdb objects using the results. I am not sure how exactly the ccdb objects will look like, but those can then go into DataFormats.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @martenole OK, I guessed it is an object since did not notice where the input data comes from. So, is this a future
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi Ruben, I am not sure what you mean. This is supposed to get its input from the global tracking. After the matching of TRD tracklets to ITS-TPC tracks a refit is done for the TRD-only part and the difference between the angle of the refits and the tracklets are stored. This is the input for this device. The processing is supposed to be done every ~15 minutes. Is this what you mean with time-slot based calibration?
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi @martenole
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @shahor02 I see. So yes, this is a future time-slot based calibration device. This PR is supposed to allow for the implementation and testing of the processing methods for calibration. Would it be OK to make the necessary modifications afterwards? |
||
| /// | ||
| /// This class is used to determine chamber-wise vDrift values | ||
| /// | ||
| /// origin: TRD | ||
| /// \author Ole Schmidt, ole.schmidt@cern.ch | ||
|
|
||
| class CalibVDrift | ||
| { | ||
| public: | ||
| /// default constructor | ||
| CalibVDrift() = default; | ||
|
|
||
| /// default destructor | ||
| ~CalibVDrift() = default; | ||
|
|
||
| /// set input angular difference sums | ||
| void setAngleDiffSums(float* input) | ||
| { | ||
| for (int i = 0; i < constants::MAXCHAMBER * constants::NBINSANGLEDIFF; ++i) { | ||
| mAngleDiffSums[i] = input[i]; | ||
| } | ||
| } | ||
|
|
||
| /// set input angular difference bin counters | ||
| void setAngleDiffCounters(short* input) | ||
| { | ||
| for (int i = 0; i < constants::MAXCHAMBER * constants::NBINSANGLEDIFF; ++i) { | ||
| mAngleDiffCounters[i] = input[i]; | ||
| } | ||
| } | ||
|
|
||
| /// main processing function | ||
| void process(); | ||
|
|
||
| private: | ||
| std::array<float, constants::MAXCHAMBER * constants::NBINSANGLEDIFF> mAngleDiffSums{}; ///< input TRD track to tracklet angular difference sums per bin | ||
| std::array<short, constants::MAXCHAMBER * constants::NBINSANGLEDIFF> mAngleDiffCounters{}; ///< input bin counters | ||
| }; | ||
|
|
||
| } // namespace trd | ||
|
|
||
| } // namespace o2 | ||
| #endif | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| // Copyright CERN and copyright holders of ALICE O2. This software is | ||
| // distributed under the terms of the GNU General Public License v3 (GPL | ||
| // Version 3), copied verbatim in the file "COPYING". | ||
| // | ||
| // See http://alice-o2.web.cern.ch/license for full licensing information. | ||
| // | ||
| // 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 CalibVDrift.cxx | ||
| /// \author Ole Schmidt, ole.schmidt@cern.ch | ||
|
|
||
| #include "TFile.h" | ||
| #include "TH2F.h" | ||
|
|
||
| #include <fairlogger/Logger.h> | ||
|
|
||
| #include "TRDCalibration/CalibVDrift.h" | ||
|
|
||
| using namespace o2::trd; | ||
| using namespace o2::trd::constants; | ||
|
|
||
| void CalibVDrift::process() | ||
| { | ||
| LOG(info) << "Started processing for vDrift calibration"; | ||
|
|
||
| for (int iDet = 0; iDet < constants::MAXCHAMBER; ++iDet) { | ||
| for (int iBin = 0; iBin < constants::NBINSANGLEDIFF; ++iBin) { // note: iBin = constants::NBINSANGLEDIFF - 1 is under-/overflow bin | ||
| short nEntries = mAngleDiffCounters[iDet * constants::NBINSANGLEDIFF + iBin]; | ||
| float angleDiffSum = mAngleDiffSums[iDet * constants::NBINSANGLEDIFF + iBin]; | ||
| if (nEntries > 0) { | ||
| LOGF(INFO, "Found %i entrie(s) in chamber %i, bin %i. Average angular deviation: %f", nEntries, iDet, iBin, angleDiffSum / nEntries); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| /* | ||
| // as an example I loop over the input, create a histogram and write it to a file | ||
| auto fOut = TFile::Open("trdcalibdummy.root", "recreate"); | ||
| auto hXY = std::make_unique<TH2F>("histDummy", "foo", 100, -60, 60, 100, 250, 400); // xy distribution of TRD space points | ||
| for (int i = 0; i < mAngulerDeviationProf.size(); ++i) { | ||
| hXY->Fill(mAngulerDeviationProf[i].mX[0], mAngulerDeviationProf[i].mR); | ||
| } | ||
| fOut->cd(); | ||
| hXY->Write(); | ||
| hXY.reset(); // delete the histogram before closing the output file | ||
| fOut->Close(); | ||
| */ | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| // Copyright CERN and copyright holders of ALICE O2. This software is | ||
| // distributed under the terms of the GNU General Public License v3 (GPL | ||
| // Version 3), copied verbatim in the file "COPYING". | ||
| // | ||
| // See http://alice-o2.web.cern.ch/license for full licensing information. | ||
| // | ||
| // 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. | ||
|
|
||
| #ifdef __CLING__ | ||
|
|
||
| #pragma link off all globals; | ||
| #pragma link off all classes; | ||
| #pragma link off all functions; | ||
|
|
||
| #pragma link C++ class o2::trd::CalibVDrift + ; | ||
|
|
||
| #endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These two sections should be outside
Constants.h. None of them are actually constants but configurable parameters, maybe in Simulation of Common parameters? One could pass the number of time bins through the steering code, then the trigger parameters are calculated based on that. So, yet another to-do.