@@ -42,6 +42,7 @@ 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" );
4546 }
4647
4748 void finaliseCCDB (ConcreteDataMatcher& matcher, void * obj) final { o2::base::GRPGeomHelper::instance ().finaliseCCDB (matcher, obj); }
@@ -82,9 +83,9 @@ class TPCIntegrateClustersDevice : public o2::framework::Task
8283 const float time = cl.getTime ();
8384 const unsigned int sliceInTF = time / mNTSPerSlice ;
8485 if (sliceInTF < mNSlicesTF ) {
85- const float qMax = cl.getQmax ();
86+ const float charge = mUseQMax ? cl.getQmax () : cl. getQtot ();
8687 const unsigned int padInCRU = Mapper::OFFSETCRUGLOBAL [irow] + static_cast <int >(cl.getPad () + 0 .5f );
87- mICCS [cru][sliceInTF * Mapper::PADSPERREGION [cru.region ()] + padInCRU] += qMax ;
88+ mICCS [cru][sliceInTF * Mapper::PADSPERREGION [cru.region ()] + padInCRU] += charge ;
8889 } else {
8990 LOGP (info, " slice in TF of ICC {} is larger than max slice {} with nTSPerSlice {}" , sliceInTF, mNSlicesTF , mNTSPerSlice );
9091 }
@@ -99,6 +100,7 @@ class TPCIntegrateClustersDevice : public o2::framework::Task
99100 private:
100101 std::shared_ptr<o2::base::GRPGeomRequest> mCCDBRequest ; // /< for accessing the b-field
101102 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
102104 int mContinuousMaxTimeBin {-1 }; // /< max time bin of clusters
103105 std::array<std::vector<float >, o2::tpc::CRU ::MaxCRU> mICCS ; // /< buffer for ICCs
104106 bool mInitICCBuffer {true }; // /< flag for initializing ICCs only once
@@ -141,6 +143,7 @@ DataProcessorSpec getTPCIntegrateClustersSpec()
141143 outputs,
142144 AlgorithmSpec{adaptFromTask<TPCIntegrateClustersDevice>(ccdbRequest)},
143145 Options{
146+ {" use-qMax" , VariantType::Bool, false , {" Using qMax instead of qTot as cluster current" }},
144147 {" nSlicesTF" , VariantType::Int, 2 , {" Divide the TF into n slices" }}}}; // end DataProcessorSpec
145148}
146149
0 commit comments