3838
3939using namespace o2 ::framework;
4040
41- namespace o2 ::aodproducer {
41+ namespace o2 ::aodproducer
42+ {
4243
4344void AODProducerWorkflowDPL::findMinMaxBc (gsl::span<const o2::ft0::RecPoints>& ft0RecPoints, gsl::span<const o2::dataformats::TrackTPCITS>& tracksITSTPC)
4445{
@@ -70,6 +71,49 @@ void AODProducerWorkflowDPL::fillTracksTable(const TracksType& tracks, std::vect
7071 for (int i = 0 ; i < tracks.size (); i++) {
7172 auto & track = tracks[i];
7273 int collisionID = vCollRefs[i];
74+
75+ float tpcInnerParam = 0 .f ;
76+ uint32_t flags = 0 ;
77+ uint8_t itsClusterMap = 0 ;
78+ uint8_t tpcNClsFindable = 0 ;
79+ int8_t tpcNClsFindableMinusFound = 0 ;
80+ int8_t tpcNClsFindableMinusCrossedRows = 0 ;
81+ uint8_t tpcNClsShared = 0 ;
82+ uint8_t trdPattern = 0 ;
83+ float itsChi2NCl = -999 .f ;
84+ float tpcChi2NCl = -999 .f ;
85+ float trdChi2 = -999 .f ;
86+ float tofChi2 = -999 .f ;
87+ float tpcSignal = -999 .f ;
88+ float trdSignal = -999 .f ;
89+ float tofSignal = -999 .f ;
90+ float length = -999 .f ;
91+ float tofExpMom = -999 .f ;
92+ float trackEtaEMCAL = -999 .f ;
93+ float trackPhiEMCAL = -999 .f ;
94+
95+ // filling available columns for different track types
96+ // FIXME:
97+ // is there a more nice/simple way to do this?
98+ std::variant<o2::its::TrackITS, o2::tpc::TrackTPC, o2::dataformats::TrackTPCITS> tmp = track;
99+ std::visit (
100+ overloaded{
101+ [&](o2::its::TrackITS itsTrack) {
102+ itsClusterMap = itsTrack.getPattern ();
103+ },
104+ [&](o2::tpc::TrackTPC tpcTrack) {
105+ tpcChi2NCl = tpcTrack.getChi2 ();
106+ // FIXME:
107+ // what values to fill here?
108+ tpcSignal = tpcTrack.getdEdx ().dEdxTotTPC ;
109+ tpcNClsFindable = tpcTrack.getNClusters ();
110+ },
111+ [&](o2::dataformats::TrackTPCITS itsTpcTrack) {
112+ LOG (INFO) << " check" ;
113+ }
114+ },
115+ tmp);
116+
73117 // TODO:
74118 // fill trackextra table
75119 tracksCursor (0 ,
@@ -97,25 +141,25 @@ void AODProducerWorkflowDPL::fillTracksTable(const TracksType& tracks, std::vect
97141 (Char_t)(128 . * track.getSigma1PtZ () / track.getSigma1Pt2 () / track.getSigmaZ2 ()),
98142 (Char_t)(128 . * track.getSigma1PtSnp () / track.getSigma1Pt2 () / track.getSigmaSnp2 ()),
99143 (Char_t)(128 . * track.getSigma1PtTgl () / track.getSigma1Pt2 () / track.getSigmaTgl2 ()),
100- 0 . f , // TPCInnerParam ,
101- ( uint32_t ) 0 , // Flags
102- ( uint8_t ) 0 , // ITSClusterMap
103- ( uint8_t ) 0 , // TPCNClsFindable
104- ( int8_t ) 0 , // TPCNClsFindableMinusFound
105- ( int8_t ) 0 , // TPCNClsFindableMinusCrossedRows
106- ( uint8_t ) 0 , // TPCNClsShared
107- ( uint8_t ) 0 , // TRDPattern
108- 0 . f , // ITSChi2NCl
109- 0 . f , // TPCChi2NCl
110- 0 . f , // TRDChi2
111- 0 . f , // TOFChi2
112- 0 . f , // TPCSignal
113- 0 . f , // TRDSignal
114- 0 . f , // TOFSignal
115- 0 . f , // Length
116- 0 . f , // TOFExpMom
117- 0 . f , // TrackEtaEMCAL
118- 0 . f ); // TrackPhiEMCAL
144+ tpcInnerParam ,
145+ flags,
146+ itsClusterMap,
147+ tpcNClsFindable,
148+ tpcNClsFindableMinusFound,
149+ tpcNClsFindableMinusCrossedRows,
150+ tpcNClsShared,
151+ trdPattern,
152+ itsChi2NCl,
153+ tpcChi2NCl,
154+ trdChi2,
155+ tofChi2,
156+ tpcSignal,
157+ trdSignal,
158+ tofSignal,
159+ length,
160+ tofExpMom,
161+ trackEtaEMCAL,
162+ trackPhiEMCAL);
119163 }
120164}
121165
@@ -162,10 +206,10 @@ void AODProducerWorkflowDPL::run(ProcessingContext& pc)
162206
163207 // TODO:
164208 // add FV0A, FV0C, FDD tables
165- // auto& fv0aBuilder = pc.outputs().make<TableBuilder>(Output{"AOD", "FV0A"});
166- // auto& fv0cBuilder = pc.outputs().make<TableBuilder>(Output{"AOD", "FV0C"});
167- // auto& fddBuilder = pc.outputs().make<TableBuilder>(Output{"AOD", "FDD"});
168- // auto& zdcBuilder = pc.outputs().make<TableBuilder>(Output{"AOD", "ZDC"});
209+ auto & fv0aBuilder = pc.outputs ().make <TableBuilder>(Output{" AOD" , " FV0A" });
210+ auto & fv0cBuilder = pc.outputs ().make <TableBuilder>(Output{" AOD" , " FV0C" });
211+ auto & fddBuilder = pc.outputs ().make <TableBuilder>(Output{" AOD" , " FDD" });
212+ auto & zdcBuilder = pc.outputs ().make <TableBuilder>(Output{" AOD" , " ZDC" });
169213
170214 auto bcCursor = bcBuilder.cursor <o2::aod::BCs>();
171215 auto collisionsCursor = collisionsBuilder.cursor <o2::aod::Collisions>();
@@ -175,54 +219,54 @@ void AODProducerWorkflowDPL::run(ProcessingContext& pc)
175219
176220 // TODO:
177221 // add FV0A, FV0C, FDD tables
178- // auto fv0aCursor = fv0aBuilder.cursor<o2::aod::FV0As>();
179- // auto fv0cCursor = fv0cBuilder.cursor<o2::aod::FV0Cs>();
180- // auto fddCursor = fddBuilder.cursor<o2::aod::FDDs>();
181- // auto zdcCursor = zdcBuilder.cursor<o2::aod::Zdcs>();
182-
183- // float dummyfv0AmplA[48] = {0.};
184- // float dummyfv0AmplC[32] = {0.};
185- // float dummyfddAmplA[4] = {0.};
186- // float dummyfddAmplC[4] = {0.};
187- // fv0aCursor(0,
188- // (uint64_t)0,
189- // dummyfv0AmplA,
190- // 0.f,
191- // (uint8_t)0);
192- // fv0cCursor(0,
193- // (uint64_t)0,
194- // dummyfv0AmplC,
195- // 0.f);
196- // fddCursor(0,
197- // (uint64_t)0,
198- // dummyfddAmplA,
199- // dummyfddAmplC,
200- // 0.f,
201- // 0.f,
202- // (uint8_t)0);
203-
204- // float dummyEnergySectorZNA[4] = {0.};
205- // float dummyEnergySectorZNC[4] = {0.};
206- // float dummyEnergySectorZPA[4] = {0.};
207- // float dummyEnergySectorZPC[4] = {0.};
208- // zdcCursor(0,
209- // (uint64_t)0,
210- // 0.f,
211- // 0.f,
212- // 0.f,
213- // 0.f,
214- // 0.f,
215- // 0.f,
216- // dummyEnergySectorZNA,
217- // dummyEnergySectorZNC,
218- // dummyEnergySectorZPA,
219- // dummyEnergySectorZPC,
220- // 0.f,
221- // 0.f,
222- // 0.f,
223- // 0.f,
224- // 0.f,
225- // 0.f);
222+ auto fv0aCursor = fv0aBuilder.cursor <o2::aod::FV0As>();
223+ auto fv0cCursor = fv0cBuilder.cursor <o2::aod::FV0Cs>();
224+ auto fddCursor = fddBuilder.cursor <o2::aod::FDDs>();
225+ auto zdcCursor = zdcBuilder.cursor <o2::aod::Zdcs>();
226+
227+ float dummyfv0AmplA[48 ] = {0 .};
228+ float dummyfv0AmplC[32 ] = {0 .};
229+ float dummyfddAmplA[4 ] = {0 .};
230+ float dummyfddAmplC[4 ] = {0 .};
231+ fv0aCursor (0 ,
232+ (uint64_t )0 ,
233+ dummyfv0AmplA,
234+ 0 .f ,
235+ (uint8_t )0 );
236+ fv0cCursor (0 ,
237+ (uint64_t )0 ,
238+ dummyfv0AmplC,
239+ 0 .f );
240+ fddCursor (0 ,
241+ (uint64_t )0 ,
242+ dummyfddAmplA,
243+ dummyfddAmplC,
244+ 0 .f ,
245+ 0 .f ,
246+ (uint8_t )0 );
247+
248+ float dummyEnergySectorZNA[4 ] = {0 .};
249+ float dummyEnergySectorZNC[4 ] = {0 .};
250+ float dummyEnergySectorZPA[4 ] = {0 .};
251+ float dummyEnergySectorZPC[4 ] = {0 .};
252+ zdcCursor (0 ,
253+ (uint64_t )0 ,
254+ 0 .f ,
255+ 0 .f ,
256+ 0 .f ,
257+ 0 .f ,
258+ 0 .f ,
259+ 0 .f ,
260+ dummyEnergySectorZNA,
261+ dummyEnergySectorZNC,
262+ dummyEnergySectorZPA,
263+ dummyEnergySectorZPC,
264+ 0 .f ,
265+ 0 .f ,
266+ 0 .f ,
267+ 0 .f ,
268+ 0 .f ,
269+ 0 .f );
226270
227271 o2::steer::MCKinematicsReader mcReader (" collisioncontext.root" );
228272 const auto context = mcReader.getDigitizationContext ();
@@ -395,10 +439,10 @@ DataProcessorSpec getAODProducerWorkflowSpec()
395439
396440 // TODO:
397441 // add FV0A, FV0C, FDD tables
398- // outputs.emplace_back(OutputLabel{"O2fv0a"}, "AOD", "FV0A", 0, Lifetime::Timeframe);
399- // outputs.emplace_back(OutputLabel{"O2fv0c"}, "AOD", "FV0C", 0, Lifetime::Timeframe);
400- // outputs.emplace_back(OutputLabel{"O2fdd"}, "AOD", "FDD", 0, Lifetime::Timeframe);
401- // outputs.emplace_back(OutputLabel{"O2zdc"}, "AOD", "ZDC", 0, Lifetime::Timeframe);
442+ outputs.emplace_back (OutputLabel{" O2fv0a" }, " AOD" , " FV0A" , 0 , Lifetime::Timeframe);
443+ outputs.emplace_back (OutputLabel{" O2fv0c" }, " AOD" , " FV0C" , 0 , Lifetime::Timeframe);
444+ outputs.emplace_back (OutputLabel{" O2fdd" }, " AOD" , " FDD" , 0 , Lifetime::Timeframe);
445+ outputs.emplace_back (OutputLabel{" O2zdc" }, " AOD" , " ZDC" , 0 , Lifetime::Timeframe);
402446
403447 return DataProcessorSpec{
404448 " aod-producer-workflow" ,
0 commit comments