forked from AliceO2Group/AliceO2
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Digit class extension for simple drawing
- Loading branch information
Showing
4 changed files
with
98 additions
and
1 deletion.
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
39 changes: 39 additions & 0 deletions
39
Detectors/TPC/calibration/include/TPCCalibration/DigitAdd.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,39 @@ | ||
// 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 DigitAdd.h | ||
/// \brief Extension of TPC Digit adding draw query functions for simple drawing | ||
/// \author Jens Wiechula ([email protected]) | ||
|
||
#ifndef ALICEO2_TPC_DIGITADD_H_ | ||
#define ALICEO2_TPC_DIGITADD_H_ | ||
|
||
#include "DataFormatsTPC/Digit.h" | ||
|
||
namespace o2::tpc | ||
{ | ||
/// \class Digit | ||
class DigitAdd : public Digit | ||
{ | ||
public: | ||
int sector() const; | ||
float lx() const; | ||
float ly() const; | ||
float gx() const; | ||
float gy() const; | ||
float cpad() const; | ||
|
||
ClassDefNV(DigitAdd, 1) | ||
}; | ||
|
||
} // namespace o2::tpc | ||
|
||
#endif // ALICEO2_TPC_DIGITADD_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,54 @@ | ||
// 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 "GPUTPCGeometry.h" | ||
#include "TPCBase/Mapper.h" | ||
#include "TPCBase/CRU.h" | ||
#include "TPCCalibration/DigitAdd.h" | ||
|
||
using namespace o2::tpc; | ||
|
||
int DigitAdd::sector() const | ||
{ | ||
return CRU(mCRU).sector(); | ||
} | ||
|
||
float DigitAdd::lx() const | ||
{ | ||
const GPUCA_NAMESPACE::gpu::GPUTPCGeometry gpuGeom; | ||
return gpuGeom.Row2X(mRow); | ||
} | ||
|
||
float DigitAdd::ly() const | ||
{ | ||
const GPUCA_NAMESPACE::gpu::GPUTPCGeometry gpuGeom; | ||
return gpuGeom.LinearPad2Y(sector(), mRow, getPad()); | ||
} | ||
|
||
float DigitAdd::gx() const | ||
{ | ||
const LocalPosition2D l2D{lx(), ly()}; | ||
const auto g2D = Mapper::LocalToGlobal(l2D, Sector(sector())); | ||
return g2D.x(); | ||
} | ||
|
||
float DigitAdd::gy() const | ||
{ | ||
const LocalPosition2D l2D{lx(), ly()}; | ||
const auto g2D = Mapper::LocalToGlobal(l2D, Sector(sector())); | ||
return g2D.y(); | ||
} | ||
|
||
float DigitAdd::cpad() const | ||
{ | ||
const GPUCA_NAMESPACE::gpu::GPUTPCGeometry gpuGeom; | ||
return getPad() - gpuGeom.NPads(mRow) / 2.f; | ||
} |
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