Skip to content

Commit 1120ad9

Browse files
matthias-kleinershahor02
authored andcommitted
TPC: adding number of clusters as type for integration
- Using the number of clusters instead of the cluster charge, the resulting factorized currents are independent of the gain (possible gain fluctuations) - setting severity to debug - adding default move constructor
1 parent 74be470 commit 1120ad9

2 files changed

Lines changed: 26 additions & 5 deletions

File tree

Detectors/TPC/calibration/include/TPCCalibration/IDCFactorization.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ class IDCFactorization : public IDCGroupHelperSector
6060
/// destructor
6161
~IDCFactorization();
6262

63+
/// default move constructor
64+
IDCFactorization(IDCFactorization&&) = default;
65+
6366
/// returns sides for CRUs
6467
/// \param crus crus which will be checked for their side
6568
static std::vector<o2::tpc::Side> getSides(const std::vector<uint32_t>& crus);

Detectors/TPC/workflow/include/TPCWorkflow/TPCIntegrateClusterCurrent.h

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,17 @@ class TPCIntegrateClustersDevice : public o2::framework::Task
4242
{
4343
o2::base::GRPGeomHelper::instance().setRequest(mCCDBRequest);
4444
mNSlicesTF = ic.options().get<int>("nSlicesTF");
45-
mUseQMax = ic.options().get<bool>("use-qMax");
45+
mType = ic.options().get<int>("type");
46+
47+
if (mType == 0) {
48+
LOGP(info, "Using qTot as currents");
49+
} else if (mType == 1) {
50+
LOGP(info, "Using qMax as currents");
51+
} else if (mType == 2) {
52+
LOGP(info, "Using nCl as currents");
53+
} else {
54+
LOGP(fatal, "type should be 0, 1 or 2");
55+
}
4656
}
4757

4858
void finaliseCCDB(ConcreteDataMatcher& matcher, void* obj) final { o2::base::GRPGeomHelper::instance().finaliseCCDB(matcher, obj); }
@@ -83,11 +93,19 @@ class TPCIntegrateClustersDevice : public o2::framework::Task
8393
const float time = cl.getTime();
8494
const unsigned int sliceInTF = time / mNTSPerSlice;
8595
if (sliceInTF < mNSlicesTF) {
86-
const float charge = mUseQMax ? cl.getQmax() : cl.getQtot();
96+
float charge = 0;
97+
if (mType == 0) {
98+
charge = cl.getQtot();
99+
} else if (mType == 1) {
100+
charge = cl.getQtot();
101+
} else if (mType == 2) {
102+
charge = 1;
103+
}
104+
87105
const unsigned int padInCRU = Mapper::OFFSETCRUGLOBAL[irow] + static_cast<int>(cl.getPad() + 0.5f);
88106
mICCS[cru][sliceInTF * Mapper::PADSPERREGION[cru.region()] + padInCRU] += charge;
89107
} else {
90-
LOGP(info, "slice in TF of ICC {} is larger than max slice {} with nTSPerSlice {}", sliceInTF, mNSlicesTF, mNTSPerSlice);
108+
LOGP(debug, "slice in TF of ICC {} is larger than max slice {} with nTSPerSlice {}", sliceInTF, mNSlicesTF, mNTSPerSlice);
91109
}
92110
}
93111
}
@@ -100,7 +118,7 @@ class TPCIntegrateClustersDevice : public o2::framework::Task
100118
private:
101119
std::shared_ptr<o2::base::GRPGeomRequest> mCCDBRequest; ///< for accessing the b-field
102120
int mNSlicesTF{1}; ///< number of slices the TFs are divided into for integration of clusters currents
103-
bool mUseQMax{false}; ///< using qMax as cluster current
121+
int mType{0}; ///< type which is used as the current
104122
int mContinuousMaxTimeBin{-1}; ///< max time bin of clusters
105123
std::array<std::vector<float>, o2::tpc::CRU::MaxCRU> mICCS; ///< buffer for ICCs
106124
bool mInitICCBuffer{true}; ///< flag for initializing ICCs only once
@@ -143,7 +161,7 @@ DataProcessorSpec getTPCIntegrateClustersSpec()
143161
outputs,
144162
AlgorithmSpec{adaptFromTask<TPCIntegrateClustersDevice>(ccdbRequest)},
145163
Options{
146-
{"use-qMax", VariantType::Bool, false, {"Using qMax instead of qTot as cluster current"}},
164+
{"type", VariantType::Int, 0, {"Type of current which will be processed: 0=qTot, 1=qMax, 2=nCl"}},
147165
{"nSlicesTF", VariantType::Int, 2, {"Divide the TF into n slices"}}}}; // end DataProcessorSpec
148166
}
149167

0 commit comments

Comments
 (0)