Skip to content

Commit 713d39c

Browse files
committed
backup mod. 14/01/2026 - old way to retrieve map + trapezoid hardcoding + threshold hardcoding + ...
1 parent 6350b1c commit 713d39c

18 files changed

Lines changed: 2793 additions & 29 deletions

File tree

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2+
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3+
// All rights not expressly granted are reserved.
4+
//
5+
// This software is distributed under the terms of the GNU General Public
6+
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7+
//
8+
// In applying this license CERN does not waive the privileges and immunities
9+
// granted to it by virtue of its status as an Intergovernmental Organization
10+
// or submit itself to any jurisdiction.
11+
12+
#ifndef ALICEO2_BASE_HIT_H
13+
#define ALICEO2_BASE_HIT_H
14+
#include "MathUtils/Cartesian.h"
15+
16+
namespace o2
17+
{
18+
19+
// Mother class of all hit classes for AliceO2
20+
// just defines what is absolutely necessary to have
21+
// as common interface
22+
// at the moment ony GetTrackID() used by Stack.h
23+
// eventually we could add some interfaces to retrieve
24+
// the coordinates as floats or something
25+
class BaseHit
26+
{
27+
public:
28+
BaseHit() = default;
29+
BaseHit(int id) : mTrackID{id} {}
30+
int GetTrackID() const { return mTrackID; }
31+
void SetTrackID(int id) { mTrackID = id; }
32+
33+
private:
34+
int mTrackID = 0; // track_id
35+
ClassDefNV(BaseHit, 1);
36+
};
37+
38+
// a set of configurable classes to define basic hit types
39+
// these are meant to be an alternative to FairMCPoint
40+
// which always includes the momentum and is purely based on double values
41+
42+
// Generic class to keep position, time and hit value
43+
// T is basic type for position,
44+
// E is basic type for time,
45+
// V is basic type for hit value.
46+
template <typename T, typename E, typename V = float, typename U = short int >
47+
class BasicXYZVHit : public BaseHit
48+
{
49+
math_utils::Point3D<T> mPos; // cartesian position of Hit
50+
E mTime; // time of flight
51+
V mHitValue; // hit value
52+
U mDetectorID; // the detector/sensor id
53+
54+
public:
55+
BasicXYZVHit() = default; // for ROOT IO
56+
57+
// constructor
58+
BasicXYZVHit(T x, T y, T z, E time, V val, int trackid, short did)
59+
: mPos(x, y, z), mTime(time), mHitValue(val), BaseHit(trackid), mDetectorID(did)
60+
{
61+
}
62+
63+
// getting the cartesian coordinates
64+
T GetX() const { return mPos.X(); }
65+
T GetY() const { return mPos.Y(); }
66+
T GetZ() const { return mPos.Z(); }
67+
math_utils::Point3D<T> GetPos() const { return mPos; }
68+
// getting hit value
69+
V GetHitValue() const { return mHitValue; }
70+
// getting the time
71+
E GetTime() const { return mTime; }
72+
// get detector + track information
73+
short GetDetectorID() const { return mDetectorID; }
74+
75+
// modifiers
76+
void SetTime(E time) { mTime = time; }
77+
void SetHitValue(V val) { mHitValue = val; }
78+
void SetDetectorID(U detID) { mDetectorID = detID; }
79+
void SetX(T x) { mPos.SetX(x); }
80+
void SetY(T y) { mPos.SetY(y); }
81+
void SetZ(T z) { mPos.SetZ(z); }
82+
void SetXYZ(T x, T y, T z)
83+
{
84+
SetX(x);
85+
SetY(y);
86+
SetZ(z);
87+
}
88+
void SetPos(math_utils::Point3D<T> const& p) { mPos = p; }
89+
90+
ClassDefNV(BasicXYZVHit, 1);
91+
};
92+
93+
// Class for a hit containing energy loss as hit value
94+
// T is basic type for position,
95+
// E is basic type for time (float as default),
96+
// V is basic type for hit value (float as default).
97+
template <typename T, typename E = float, typename V = float>
98+
class BasicXYZEHit : public BasicXYZVHit<T, E, V>
99+
{
100+
public:
101+
using BasicXYZVHit<T, E, V>::BasicXYZVHit;
102+
103+
V GetEnergyLoss() const { return BasicXYZVHit<T, E, V>::GetHitValue(); }
104+
void SetEnergyLoss(V val) { BasicXYZVHit<T, E, V>::SetHitValue(val); }
105+
106+
ClassDefNV(BasicXYZEHit, 1);
107+
};
108+
109+
// Class for a hit containing charge as hit value
110+
// T is basic type for position,
111+
// E is basic type for time (float as default),
112+
// V is basic type for hit value (int as default).
113+
template <typename T, typename E = float, typename V = int>
114+
class BasicXYZQHit : public BasicXYZVHit<T, E, V>
115+
{
116+
public:
117+
using BasicXYZVHit<T, E, V>::BasicXYZVHit;
118+
119+
V GetCharge() const { return BasicXYZVHit<T, E, V>::GetHitValue(); }
120+
void SetCharge(V val) { BasicXYZVHit<T, E, V>::SetHitValue(val); }
121+
122+
ClassDefNV(BasicXYZQHit, 1);
123+
};
124+
125+
} // namespace o2
126+
#endif

Detectors/ITSMFT/common/data/AlpideResponseData/AlpideResponse.cxx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ void alpideResponse(const std::string& inpath, const std::string& outpath, const
4242
resp1.setColMax(1.5e-4);
4343
resp1.setRowMax(1.5e-4);
4444
resp1.initData(1, inpath.c_str());
45+
} else if (chip_name == "ALICE3") {
46+
resp1.setColMax(1.0e-4);
47+
resp1.setRowMax(1.0e-4);
48+
resp1.initData(2, inpath.c_str());
4549
} else {
4650
throw std::invalid_argument("Unknown chip name: " + chip_name);
4751
}

Detectors/ITSMFT/common/data/AlpideResponseData/AlpideResponse_cxx.d

Lines changed: 664 additions & 0 deletions
Large diffs are not rendered by default.

Detectors/ITSMFT/common/simulation/src/AlpideSimResponse.cxx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ void AlpideSimResponse::initData(int tableNumber, std::string dataPath, const bo
4343
{
4444
const std::string newDataPath = dataPath + "Vbb-3.0V";
4545
setDataPath(newDataPath); // setting the new data path
46+
} else if (tableNumber == 2) // -4.8V back bias
47+
{
48+
const std::string newDataPath = dataPath + "Vbb-4.8V";
49+
setDataPath(newDataPath); // setting the new data path
4650
}
4751

4852
if (mData.size()) {
@@ -87,6 +91,7 @@ void AlpideSimResponse::initData(int tableNumber, std::string dataPath, const bo
8791

8892
while (inpGrid >> mStepInvRow && inpGrid.good()) {
8993
mNBinRow++;
94+
// std::cout<<"Reading grid: "<<inpfname<< " -> mStepInvRow="<<mStepInvRow<<" mNBinRow="<<mNBinRow<<std::endl;
9095
}
9196
if (!mNBinRow || mStepInvRow < kTiny) {
9297
LOG(fatal) << "Failed to read Y(row) binning from " << inpfname;
@@ -105,8 +110,10 @@ void AlpideSimResponse::initData(int tableNumber, std::string dataPath, const bo
105110
mDptMin = 2.e9;
106111
const int npix = AlpideRespSimMat::getNPix();
107112

113+
// std::cout<<"mNBinCol="<<mNBinCol<<" mNBinRow="<<mNBinRow<<std::endl;
108114
for (int ix = 0; ix < mNBinCol; ix++) {
109115
for (int iy = 0; iy < mNBinRow; iy++) {
116+
// std::cout<<"Composing data name for ix="<<ix<<" iy="<<iy<<std::endl;
110117
inpfname = composeDataName(ix, iy);
111118
inpGrid.open(inpfname, std::ifstream::in);
112119
if (inpGrid.fail()) {
@@ -205,8 +212,10 @@ string AlpideSimResponse::composeDataName(int colBin, int rowBin)
205212
* compose the file-name to read data for bin colBin,rowBin
206213
*/
207214

215+
// std::cout<<"Compose data name for colBin="<<colBin<<" rowBin="<<rowBin<<std::endl;
208216
// ugly but safe way to compose the file name
209-
float vcol = colBin / mStepInvCol, vrow = rowBin / mStepInvRow;
217+
float vcol = std::floor(colBin / mStepInvCol), vrow = std::floor(rowBin / mStepInvRow);
218+
// std::cout<<"vcol="<<vcol<<" vrow="<<vrow<<" mStepInvCol="<<mStepInvCol<<" mStepInvRow="<<mStepInvRow<<std::endl;
210219
size_t size = snprintf(nullptr, 0, mColRowDataFmt.data(), vcol, vrow) + 1;
211220
unique_ptr<char[]> tmp(new char[size]);
212221
snprintf(tmp.get(), size, mColRowDataFmt.data(), vcol, vrow);
@@ -244,6 +253,7 @@ bool AlpideSimResponse::getResponse(float vRow, float vCol, float vDepth, Alpide
244253

245254
size_t bin = getDepthBin(vDepth) + mNBinDpt * (getRowBin(vRow) + mNBinRow * getColBin(vCol));
246255
if (bin >= mData.size()) {
256+
// std::cout<<"getDepthBin: pos="<<vDepth<<" mDptMax="<<mDptMax<<" mStepInvDpt="<<mStepInvDpt<<" i="<<bin<<std::endl;
247257
// this should not happen
248258
LOG(fatal) << "requested bin " << bin << "row/col/depth: " << getRowBin(vRow) << ":" << getColBin(vCol)
249259
<< ":" << getDepthBin(vDepth) << ")"

Detectors/ITSMFT/common/simulation/src/Digitizer.cxx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,8 @@ void Digitizer::processHit(const o2::itsmft::Hit& hit, uint32_t& maxFr, int evID
289289
return;
290290
}
291291
if (isContinuous()) {
292+
// LOG(info) << "Hit time (timeInROF in continuous): " << timeInROF + mCollisionTimeWrtROF<<" ns = "<< timeInROF <<" + "<< mCollisionTimeWrtROF<<" ns";
293+
292294
timeInROF += mCollisionTimeWrtROF;
293295
}
294296
if (mIsBeforeFirstRO && timeInROF < 0) {

0 commit comments

Comments
 (0)