@@ -68,14 +68,14 @@ class TPCFactorizeIDCSpec : public o2::framework::Task
6868 template <bool IsEnabled = true , typename std::enable_if<(IsEnabled && (std::is_same<Type, TPCFactorizeIDCSpecNoGroup>::value)), int >::type = 0 >
6969 TPCFactorizeIDCSpec (const std::vector<uint32_t >& crus, const unsigned int timeframes, const unsigned int timeframesDeltaIDC, std::array<unsigned char , Mapper::NREGIONS> groupPads,
7070 std::array<unsigned char , Mapper::NREGIONS> groupRows, std::array<unsigned char , Mapper::NREGIONS> groupLastRowsThreshold,
71- std::array<unsigned char , Mapper::NREGIONS> groupLastPadsThreshold, const unsigned int groupPadsSectorEdges, const IDCDeltaCompression compression, const bool debug, const bool senddebug, const bool usePrecisetimeStamp)
72- : mCRUs {crus}, mIDCFactorization {groupPads, groupRows, groupLastRowsThreshold, groupLastPadsThreshold, groupPadsSectorEdges, timeframes, timeframesDeltaIDC, crus}, mCompressionDeltaIDC {compression}, mDebug {debug}, mSendOutDebug {senddebug}, mUsePrecisetimeStamp {usePrecisetimeStamp} {};
71+ std::array<unsigned char , Mapper::NREGIONS> groupLastPadsThreshold, const unsigned int groupPadsSectorEdges, const IDCDeltaCompression compression, const bool debug, const bool senddebug, const bool usePrecisetimeStamp, const bool sendOutputFFT )
72+ : mCRUs {crus}, mIDCFactorization {groupPads, groupRows, groupLastRowsThreshold, groupLastPadsThreshold, groupPadsSectorEdges, timeframes, timeframesDeltaIDC, crus}, mCompressionDeltaIDC {compression}, mDebug {debug}, mSendOutDebug {senddebug}, mUsePrecisetimeStamp {usePrecisetimeStamp}, mSendOutFFT {sendOutputFFT} {};
7373
7474 template <bool IsEnabled = true , typename std::enable_if<(IsEnabled && (std::is_same<Type, TPCFactorizeIDCSpecGroup>::value)), int >::type = 0 >
7575 TPCFactorizeIDCSpec (const std::vector<uint32_t >& crus, const unsigned int timeframes, const unsigned int timeframesDeltaIDC, std::array<unsigned char , Mapper::NREGIONS> groupPads,
7676 std::array<unsigned char , Mapper::NREGIONS> groupRows, std::array<unsigned char , Mapper::NREGIONS> groupLastRowsThreshold,
77- std::array<unsigned char , Mapper::NREGIONS> groupLastPadsThreshold, const unsigned int groupPadsSectorEdges, const IDCDeltaCompression compression, const bool debug, const bool senddebug, const bool usePrecisetimeStamp)
78- : mCRUs {crus}, mIDCFactorization {std::array<unsigned char , Mapper::NREGIONS>{1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 }, std::array<unsigned char , Mapper::NREGIONS>{1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 }, std::array<unsigned char , Mapper::NREGIONS>{1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 }, std::array<unsigned char , Mapper::NREGIONS>{1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 }, 0 , timeframes, timeframesDeltaIDC, crus}, mIDCStruct {TPCFactorizeIDCStruct<TPCFactorizeIDCSpecGroup>(groupPads, groupRows, groupLastRowsThreshold, groupLastPadsThreshold, groupPadsSectorEdges)}, mCompressionDeltaIDC {compression}, mDebug {debug}, mSendOutDebug {senddebug}, mUsePrecisetimeStamp {usePrecisetimeStamp} {};
77+ std::array<unsigned char , Mapper::NREGIONS> groupLastPadsThreshold, const unsigned int groupPadsSectorEdges, const IDCDeltaCompression compression, const bool debug, const bool senddebug, const bool usePrecisetimeStamp, const bool sendOutputFFT )
78+ : mCRUs {crus}, mIDCFactorization {std::array<unsigned char , Mapper::NREGIONS>{1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 }, std::array<unsigned char , Mapper::NREGIONS>{1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 }, std::array<unsigned char , Mapper::NREGIONS>{1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 }, std::array<unsigned char , Mapper::NREGIONS>{1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 }, 0 , timeframes, timeframesDeltaIDC, crus}, mIDCStruct {TPCFactorizeIDCStruct<TPCFactorizeIDCSpecGroup>(groupPads, groupRows, groupLastRowsThreshold, groupLastPadsThreshold, groupPadsSectorEdges)}, mCompressionDeltaIDC {compression}, mDebug {debug}, mSendOutDebug {senddebug}, mUsePrecisetimeStamp {usePrecisetimeStamp}, mSendOutFFT {sendOutputFFT} {};
7979
8080 void init (o2::framework::InitContext& ic) final
8181 {
@@ -135,6 +135,7 @@ class TPCFactorizeIDCSpec : public o2::framework::Task
135135 if (TPCDistributeIDCSpec::getDataDescriptionIDC () == descr) {
136136 const int cru = tpcCRUHeader->subSpecification - mLaneId * CRU::MaxCRU;
137137 mIDCFactorization .setIDCs (pc.inputs ().get <std::vector<float >>(ref), cru, mProcessedTFs ); // aggregate IDCs
138+ LOGP (info, " Received IDCs for CRU {} of size {}" , cru, mIDCFactorization .getIDCs ()[cru][mProcessedTFs ].size ());
138139 }
139140 }
140141 ++mProcessedTFs ;
@@ -181,6 +182,7 @@ class TPCFactorizeIDCSpec : public o2::framework::Task
181182 const bool mDebug {false }; // /< dump IDCs to tree for debugging
182183 const bool mSendOutDebug {false }; // /< flag if the output will be send (for debugging)
183184 const bool mUsePrecisetimeStamp {true }; // /< use precise time stamp when writing to CCDB
185+ const bool mSendOutFFT {false }; // /< flag if the output will be send for the FFT
184186 o2::ccdb::CcdbApi mDBapi ; // /< API for storing the IDCs in the CCDB
185187 std::map<std::string, std::string> mMetadata ; // /< meta data of the stored object in CCDB
186188 bool mWriteToDB {}; // /< flag if writing to CCDB will be done
@@ -244,11 +246,13 @@ class TPCFactorizeIDCSpec : public o2::framework::Task
244246 const auto timeStampEnd = (mTimeStampCCDB .second <= timeStampStart) ? timeStampStart + 1 : mTimeStampCCDB .second ;
245247
246248 // sending output to FFT
247- LOGP (info, " Sending output" );
248- output.snapshot (Output{gDataOriginTPC , getDataDescriptionIDC1 (), header::DataHeader::SubSpecificationType{Side::A}}, mIDCFactorization .getIDCOne (Side::A));
249- output.snapshot (Output{gDataOriginTPC , getDataDescriptionIDC1 (), header::DataHeader::SubSpecificationType{Side::C}}, mIDCFactorization .getIDCOne (Side::C));
250- output.snapshot (Output{gDataOriginTPC , getDataDescriptionTimeStamp ()}, std::vector<uint64_t >{timeStampStart, timeStampEnd});
251- output.snapshot (Output{gDataOriginTPC , getDataDescriptionIntervals ()}, mIDCFactorization .getIntegrationIntervalsPerTF ());
249+ if (mSendOutFFT ) {
250+ LOGP (info, " Sending output" );
251+ output.snapshot (Output{gDataOriginTPC , getDataDescriptionIDC1 (), header::DataHeader::SubSpecificationType{Side::A}}, mIDCFactorization .getIDCOne (Side::A));
252+ output.snapshot (Output{gDataOriginTPC , getDataDescriptionIDC1 (), header::DataHeader::SubSpecificationType{Side::C}}, mIDCFactorization .getIDCOne (Side::C));
253+ output.snapshot (Output{gDataOriginTPC , getDataDescriptionTimeStamp ()}, std::vector<uint64_t >{timeStampStart, timeStampEnd});
254+ output.snapshot (Output{gDataOriginTPC , getDataDescriptionIntervals ()}, mIDCFactorization .getIntegrationIntervalsPerTF ());
255+ }
252256
253257 if (mWriteToDB ) {
254258 LOGP (info, " Writing IDCs to CCDB" );
@@ -326,17 +330,20 @@ class TPCFactorizeIDCSpec : public o2::framework::Task
326330};
327331
328332template <class Type >
329- DataProcessorSpec getTPCFactorizeIDCSpec (const int lane, const std::vector<uint32_t >& crus, const unsigned int timeframes, const unsigned int timeframesDeltaIDC, const IDCDeltaCompression compression, const bool debug, const bool senddebug, const bool usePrecisetimeStamp)
333+ DataProcessorSpec getTPCFactorizeIDCSpec (const int lane, const std::vector<uint32_t >& crus, const unsigned int timeframes, const unsigned int timeframesDeltaIDC, const IDCDeltaCompression compression, const bool debug, const bool senddebug, const bool usePrecisetimeStamp, const bool sendOutputFFT )
330334{
331335 std::vector<OutputSpec> outputSpecs;
332336 if (senddebug) {
333337 outputSpecs.emplace_back (ConcreteDataTypeMatcher{gDataOriginTPC , TPCFactorizeIDCSpec<Type>::getDataDescriptionIDC0 ()});
334338 outputSpecs.emplace_back (ConcreteDataTypeMatcher{gDataOriginTPC , TPCFactorizeIDCSpec<Type>::getDataDescriptionIDCDelta ()});
335339 }
336- outputSpecs.emplace_back (ConcreteDataMatcher{gDataOriginTPC , TPCFactorizeIDCSpec<Type>::getDataDescriptionIDC1 (), header::DataHeader::SubSpecificationType{Side::A}});
337- outputSpecs.emplace_back (ConcreteDataMatcher{gDataOriginTPC , TPCFactorizeIDCSpec<Type>::getDataDescriptionIDC1 (), header::DataHeader::SubSpecificationType{Side::C}});
338- outputSpecs.emplace_back (ConcreteDataMatcher{gDataOriginTPC , TPCFactorizeIDCSpec<Type>::getDataDescriptionTimeStamp (), header::DataHeader::SubSpecificationType{0 }});
339- outputSpecs.emplace_back (ConcreteDataMatcher{gDataOriginTPC , TPCFactorizeIDCSpec<Type>::getDataDescriptionIntervals (), header::DataHeader::SubSpecificationType{0 }});
340+
341+ if (sendOutputFFT) {
342+ outputSpecs.emplace_back (ConcreteDataMatcher{gDataOriginTPC , TPCFactorizeIDCSpec<Type>::getDataDescriptionIDC1 (), header::DataHeader::SubSpecificationType{Side::A}});
343+ outputSpecs.emplace_back (ConcreteDataMatcher{gDataOriginTPC , TPCFactorizeIDCSpec<Type>::getDataDescriptionIDC1 (), header::DataHeader::SubSpecificationType{Side::C}});
344+ outputSpecs.emplace_back (ConcreteDataMatcher{gDataOriginTPC , TPCFactorizeIDCSpec<Type>::getDataDescriptionTimeStamp (), header::DataHeader::SubSpecificationType{0 }});
345+ outputSpecs.emplace_back (ConcreteDataMatcher{gDataOriginTPC , TPCFactorizeIDCSpec<Type>::getDataDescriptionIntervals (), header::DataHeader::SubSpecificationType{0 }});
346+ }
340347
341348 std::vector<InputSpec> inputSpecs;
342349 inputSpecs.reserve (crus.size ());
@@ -363,7 +370,7 @@ DataProcessorSpec getTPCFactorizeIDCSpec(const int lane, const std::vector<uint3
363370 fmt::format (" tpc-factorize-idc-{:02}" , lane).data (),
364371 inputSpecs,
365372 outputSpecs,
366- AlgorithmSpec{adaptFromTask<TPCFactorizeIDCSpec<Type>>(crus, timeframes, timeframesDeltaIDC, groupPads, groupRows, groupLastRowsThreshold, groupLastPadsThreshold, groupPadsSectorEdges, compression, debug, senddebug, usePrecisetimeStamp)},
373+ AlgorithmSpec{adaptFromTask<TPCFactorizeIDCSpec<Type>>(crus, timeframes, timeframesDeltaIDC, groupPads, groupRows, groupLastRowsThreshold, groupLastPadsThreshold, groupPadsSectorEdges, compression, debug, senddebug, usePrecisetimeStamp, sendOutputFFT )},
367374 Options{{" ccdb-uri" , VariantType::String, o2::base::NameConf::getCCDBServer (), {" URI for the CCDB access." }},
368375 {" gainMapFile" , VariantType::String, " " , {" file to reference gain map, which will be used for correcting the cluster charge" }},
369376 {" update-not-grouping-parameter" , VariantType::Bool, false , {" Do NOT Update/Writing grouping parameters to CCDB." }}}}; // end DataProcessorSpec
0 commit comments