@@ -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