1717#include " Framework/ConfigParamRegistry.h"
1818#include " Framework/Task.h"
1919#include " Framework/Logger.h"
20- #include " ITSWorkflow /IRFrameReaderSpec.h"
20+ #include " GlobalTrackingWorkflowReaders /IRFrameReaderSpec.h"
2121#include " CommonDataFormat/IRFrame.h"
2222#include " CommonUtils/StringUtils.h"
2323#include " TFile.h"
2424#include " TTree.h"
2525
2626using namespace o2 ::framework;
27- using namespace o2 ::its;
2827
2928namespace o2
3029{
31- namespace its
30+ namespace globaltracking
3231{
3332
3433class IRFrameReaderSpec : public o2 ::framework::Task
3534{
3635 public:
37- IRFrameReaderSpec () = default ;
36+ IRFrameReaderSpec (o2::header::DataOrigin origin, uint32_t subSpec) : mDataOrigin (origin), mSubSpec (subSpec) {}
3837 ~IRFrameReaderSpec () override = default ;
3938 void init (o2::framework::InitContext& ic) final ;
4039 void run (o2::framework::ProcessingContext& pc) final ;
4140
4241 protected:
4342 void connectTree (const std::string& filename);
44-
43+ o2::header::DataOrigin mDataOrigin = o2::header::gDataOriginInvalid ;
44+ uint32_t mSubSpec = 0 ;
4545 std::vector<o2::dataformats::IRFrame> mIRF , *mIRFInp = &mIRF ;
4646 std::unique_ptr<TFile> mFile ;
4747 std::unique_ptr<TTree> mTree ;
@@ -53,7 +53,7 @@ class IRFrameReaderSpec : public o2::framework::Task
5353void IRFrameReaderSpec::init (InitContext& ic)
5454{
5555 mInputFileName = o2::utils::Str::concat_string (o2::utils::Str::rectifyDirectory (ic.options ().get <std::string>(" input-dir" )),
56- ic.options ().get <std::string>(" its- irframe-infile" ));
56+ ic.options ().get <std::string>(" irframe-infile" ));
5757 connectTree (mInputFileName );
5858}
5959
@@ -62,8 +62,8 @@ void IRFrameReaderSpec::run(ProcessingContext& pc)
6262 auto ent = mTree ->GetReadEntry () + 1 ;
6363 assert (ent < mTree ->GetEntries ()); // this should not happen
6464 mTree ->GetEntry (ent);
65- LOG (info ) << " Pushing " << mIRF .size () << " IR-frames in at entry " << ent;
66- pc.outputs ().snapshot (Output{" ITS " , " IRFRAMES" , 0 , Lifetime::Timeframe}, mIRF );
65+ LOG (debug ) << " Pushing " << mIRF .size () << " IR-frames in at entry " << ent;
66+ pc.outputs ().snapshot (Output{mDataOrigin , " IRFRAMES" , mSubSpec , Lifetime::Timeframe}, mIRF );
6767
6868 if (mTree ->GetReadEntry () + 1 >= mTree ->GetEntries ()) {
6969 pc.services ().get <ControlService>().endOfStream ();
@@ -84,19 +84,19 @@ void IRFrameReaderSpec::connectTree(const std::string& filename)
8484 LOG (info) << " Loaded tree from " << filename << " with " << mTree ->GetEntries () << " entries" ;
8585}
8686
87- DataProcessorSpec getIRFrameReaderSpec ()
87+ DataProcessorSpec getIRFrameReaderSpec (o2::header::DataOrigin origin, uint32_t subSpec, const std::string& devName, const std::string& defFileName )
8888{
8989 std::vector<OutputSpec> outputSpec;
9090
9191 return DataProcessorSpec{
92- " its-irframe-reader " ,
92+ devName ,
9393 Inputs{},
94- Outputs{{" ITS " , " IRFRAMES" , 0 , Lifetime::Timeframe}},
95- AlgorithmSpec{adaptFromTask<IRFrameReaderSpec>()},
94+ Outputs{{origin , " IRFRAMES" , subSpec , Lifetime::Timeframe}},
95+ AlgorithmSpec{adaptFromTask<IRFrameReaderSpec>(origin, subSpec )},
9696 Options{
97- {" its- irframe-infile" , VariantType::String, " o2_its_irframe.root " , {" Name of the input IRFrames file" }},
97+ {" irframe-infile" , VariantType::String, defFileName , {" Name of the input IRFrames file" }},
9898 {" input-dir" , VariantType::String, " none" , {" Input directory" }}}};
9999}
100100
101- } // namespace its
101+ } // namespace globaltracking
102102} // namespace o2
0 commit comments