@@ -76,7 +76,7 @@ DECLARE_SOA_COLUMN(ZncEnergyCommon, zncEnergyCommon, float);
7676DECLARE_SOA_COLUMN (ZnaEnergy, znaEnergy, std::vector<float >);
7777DECLARE_SOA_COLUMN (ZncEnergy, zncEnergy, std::vector<float >);
7878} // namespace colspcalib
79- DECLARE_SOA_TABLE (ColSpCalib , " AOD" , " COLSPCALIB" , o2::soa::Index<>,
79+ DECLARE_SOA_TABLE (ColSpCalibs , " AOD" , " COLSPCALIB" , o2::soa::Index<>,
8080 colspcalib::RunNumber,
8181 colspcalib::Timestamp,
8282 colspcalib::Cent,
@@ -88,6 +88,18 @@ DECLARE_SOA_TABLE(ColSpCalib, "AOD", "COLSPCALIB", o2::soa::Index<>,
8888 colspcalib::ZnaEnergy,
8989 colspcalib::ZncEnergy);
9090
91+ using ColSpCalib = ColSpCalibs::iterator;
92+
93+ namespace trackspcalib
94+ {
95+ DECLARE_SOA_INDEX_COLUMN (ColSpCalib, colSpCalib);
96+ } // namespace trackspcalib
97+ DECLARE_SOA_TABLE (TrackSpCalib, " AOD" , " TRACKSPCALIB" , o2::soa::Index<>,
98+ trackspcalib::ColSpCalibId,
99+ aod::track::Pt,
100+ aod::track::Eta,
101+ aod::track::Phi);
102+
91103namespace colspext
92104{
93105DECLARE_SOA_COLUMN (SelColFlag, selColFlag, bool );
@@ -159,7 +171,8 @@ enum V0Type {
159171
160172struct SpCalibTableProducer {
161173 // Table producer
162- Produces<aod::ColSpCalib> colSpCalibTable;
174+ Produces<aod::ColSpCalibs> colSpCalibTable;
175+ Produces<aod::TrackSpCalib> trackSPCalibTable;
163176
164177 // Configurables
165178 // Collisions
@@ -171,13 +184,23 @@ struct SpCalibTableProducer {
171184 Configurable<bool > cSel8Trig{" cSel8Trig" , true , " Sel8 (T0A + T0C) Selection Run3" };
172185 Configurable<bool > cPileupReject{" cPileupReject" , true , " Pileup rejection" };
173186 Configurable<bool > cZVtxTimeDiff{" cZVtxTimeDiff" , true , " z-vtx time diff selection" };
187+ Configurable<bool > cNoCollInTimeRangeStd{" cNoCollInTimeRangeStd" , true , " No of collision in time range standard" };
188+ Configurable<bool > cIsITSTPCVtx{" cIsITSTPCVtx" , true , " ITS-TPC Vertex" };
174189 Configurable<bool > cIsGoodITSLayers{" cIsGoodITSLayers" , true , " Good ITS Layers All" };
175190 Configurable<float > cMinOccupancy{" cMinOccupancy" , 0 , " Minimum FT0C Occupancy" };
176- Configurable<float > cMaxOccupancy{" cMaxOccupancy" , 1e6 , " Maximum FT0C Occupancy" };
191+ Configurable<float > cMaxOccupancy{" cMaxOccupancy" , 1e4 , " Maximum FT0C Occupancy" };
177192 Configurable<bool > capplyTdcCut{" capplyTdcCut" , false , " Flag for TDC cut" };
178193 Configurable<float > ctdcZnMin{" ctdcZnMin" , -2.5 , " Min ZN TDC cut" };
179194 Configurable<float > ctdcZnMax{" ctdcZnMax" , 2.5 , " Max ZN TDC cut" };
180195
196+ // Tracks
197+ Configurable<float > cTrackMinPt{" cTrackMinPt" , 0.1 , " p_{T} minimum" };
198+ Configurable<float > cTrackMaxPt{" cTrackMaxPt" , 10.0 , " p_{T} maximum" };
199+ Configurable<float > cTrackEtaCut{" cTrackEtaCut" , 0.8 , " Pseudorapidity cut" };
200+ Configurable<bool > cTrackGlobal{" cTrackGlobal" , true , " Global Track" };
201+ Configurable<float > cTrackDcaXYCut{" cTrackDcaXYCut" , 0.1 , " DcaXY Cut" };
202+ Configurable<float > cTrackDcaZCut{" cTrackDcaZCut" , 1 ., " DcaXY Cut" };
203+
181204 // Histogram Registry.
182205 HistogramRegistry histos{" histos" , {}, OutputObjHandlingPolicy::AnalysisObject};
183206
@@ -187,9 +210,10 @@ struct SpCalibTableProducer {
187210
188211 void init (InitContext const &)
189212 {
190- // Histogram collision
213+ // Histogram collisions and tracks
191214 histos.add (" hCent" , " Centrality" , kTH1F , {{cCentBins, 0 ., 100 ., " FT0C%" }});
192215 histos.add (" hVz" , " V_{z}" , kTH1F , {{100 , -10 ., 10 ., " V_{z}(cm)" }});
216+ histos.add (" hPt" , " pT" , kTH1F , {{200 , 0 , 20 , " p_{T}(GeV/#it{c})" }});
193217 }
194218
195219 template <typename C>
@@ -208,7 +232,7 @@ struct SpCalibTableProducer {
208232 return false ;
209233 }
210234
211- if (col.ft0cOccupancyInTimeRange () < cMinOccupancy || col.ft0cOccupancyInTimeRange () > cMaxOccupancy) { // Occupancy cut
235+ if (col.trackOccupancyInTimeRange () < cMinOccupancy || col.trackOccupancyInTimeRange () > cMaxOccupancy) { // Occupancy cut
212236 return false ;
213237 }
214238
@@ -220,6 +244,14 @@ struct SpCalibTableProducer {
220244 return false ;
221245 }
222246
247+ if (cNoCollInTimeRangeStd && !col.selection_bit (aod::evsel::kNoCollInTimeRangeStandard )) { // No collision in standard time range
248+ return false ;
249+ }
250+
251+ if (cIsITSTPCVtx && !col.selection_bit (aod::evsel::kIsVertexITSTPC )) { // ITS+TPC vertex
252+ return false ;
253+ }
254+
223255 if (cIsGoodITSLayers && !col.selection_bit (aod::evsel::kIsGoodITSLayersAll )) { // All ITS layer active
224256 return false ;
225257 }
@@ -244,8 +276,27 @@ struct SpCalibTableProducer {
244276 return true ;
245277 }
246278
247- template <typename B, typename C>
248- void analyzeCollision (B const & bc, C const & collision)
279+ // Track Selection
280+ template <typename T>
281+ bool selectTrack (T const & track)
282+ {
283+ if (track.pt () <= cTrackMinPt || track.pt () >= cTrackMaxPt || std::abs (track.eta ()) >= cTrackEtaCut) {
284+ return false ;
285+ }
286+
287+ if (cTrackGlobal && !track.isGlobalTrackWoDCA ()) {
288+ return false ;
289+ }
290+
291+ if (std::abs (track.dcaXY ()) >= cTrackDcaXYCut || std::abs (track.dcaZ ()) >= cTrackDcaZCut) {
292+ return false ;
293+ }
294+
295+ return true ;
296+ }
297+
298+ template <typename B, typename C, typename T>
299+ void analyzeCollision (B const & bc, C const & collision, T const & tracks)
249300 {
250301 // Check zdc
251302 if (!bc.has_zdc ()) {
@@ -282,22 +333,31 @@ struct SpCalibTableProducer {
282333 histos.fill (HIST (" hCent" ), cent);
283334 histos.fill (HIST (" hVz" ), posZ);
284335 colSpCalibTable (runNum, timestamp, cent, posX, posY, posZ, znaEnergyCommon, zncEnergyCommon, znaEnergy, zncEnergy);
336+
337+ for (auto const & track : tracks) {
338+ if (!selectTrack (track)) {
339+ continue ;
340+ }
341+ histos.fill (HIST (" hPt" ), track.pt ());
342+ trackSPCalibTable (colSpCalibTable.lastIndex (), track.pt (), track.eta (), track.phi ());
343+ }
285344 }
286345
287346 using BCsRun3 = soa::Join<aod::BCsWithTimestamps, aod::Run3MatchedToBCSparse>;
288347 using CollisionsRun3 = soa::Join<aod::Collisions, aod::EvSels, aod::CentFT0Cs, aod::CentFT0Ms, aod::CentFV0As, aod::TPCMults, aod::PVMults, aod::MultsGlobal, aod::MultsExtra>;
348+ using Tracks = soa::Join<aod::Tracks, aod::TrackSelection, aod::TracksExtra, aod::TracksDCA, aod::TOFSignal, aod::pidTPCEl, aod::pidTPCPi, aod::pidTOFPi, aod::pidTPCKa, aod::pidTOFKa, aod::pidTPCPr, aod::pidTOFPr>;
289349
290350 void processDummy (CollisionsRun3::iterator const &) {}
291351
292352 PROCESS_SWITCH (SpCalibTableProducer, processDummy, " Dummy process" , true );
293353
294- void processFEP (CollisionsRun3::iterator const & collision, BCsRun3 const &, aod::Zdcs const &)
354+ void processFEP (CollisionsRun3::iterator const & collision, BCsRun3 const &, aod::Zdcs const &, Tracks const & tracks )
295355 {
296356 // Get bunch crossing
297357 auto bc = collision.template foundBC_as <BCsRun3>();
298358 runNum = collision.template foundBC_as <BCsRun3>().runNumber ();
299359 timestamp = collision.template foundBC_as <BCsRun3>().timestamp ();
300- analyzeCollision (bc, collision);
360+ analyzeCollision (bc, collision, tracks );
301361 }
302362
303363 PROCESS_SWITCH (SpCalibTableProducer, processFEP, " Flow Event Plane Table Producer" , false );
@@ -318,9 +378,11 @@ struct SpectatorPlaneTableProducer {
318378 Configurable<bool > cSel8Trig{" cSel8Trig" , true , " Sel8 (T0A + T0C) Selection Run3" };
319379 Configurable<bool > cPileupReject{" cPileupReject" , true , " Pileup rejection" };
320380 Configurable<bool > cZVtxTimeDiff{" cZVtxTimeDiff" , true , " z-vtx time diff selection" };
381+ Configurable<bool > cNoCollInTimeRangeStd{" cNoCollInTimeRangeStd" , true , " No of collision in time range standard" };
382+ Configurable<bool > cIsITSTPCVtx{" cIsITSTPCVtx" , true , " ITS-TPC Vertex" };
321383 Configurable<bool > cIsGoodITSLayers{" cIsGoodITSLayers" , true , " Good ITS Layers All" };
322384 Configurable<float > cMinOccupancy{" cMinOccupancy" , 0 , " Minimum FT0C Occupancy" };
323- Configurable<float > cMaxOccupancy{" cMaxOccupancy" , 1e6 , " Maximum FT0C Occupancy" };
385+ Configurable<float > cMaxOccupancy{" cMaxOccupancy" , 1e4 , " Maximum FT0C Occupancy" };
324386 Configurable<bool > capplyTdcCut{" capplyTdcCut" , false , " Flag for TDC cut" };
325387 Configurable<float > ctdcZnMin{" ctdcZnMin" , -2.5 , " Min ZN TDC cut" };
326388 Configurable<float > ctdcZnMax{" ctdcZnMax" , 2.5 , " Max ZN TDC cut" };
@@ -516,7 +578,7 @@ struct SpectatorPlaneTableProducer {
516578 return false ;
517579 }
518580
519- if (col.ft0cOccupancyInTimeRange () < cMinOccupancy || col.ft0cOccupancyInTimeRange () > cMaxOccupancy) { // Occupancy cut
581+ if (col.trackOccupancyInTimeRange () < cMinOccupancy || col.trackOccupancyInTimeRange () > cMaxOccupancy) { // Occupancy cut
520582 return false ;
521583 }
522584
@@ -528,6 +590,14 @@ struct SpectatorPlaneTableProducer {
528590 return false ;
529591 }
530592
593+ if (cNoCollInTimeRangeStd && !col.selection_bit (aod::evsel::kNoCollInTimeRangeStandard )) { // No collision in standard time range
594+ return false ;
595+ }
596+
597+ if (cIsITSTPCVtx && !col.selection_bit (aod::evsel::kIsVertexITSTPC )) { // ITS+TPC vertex
598+ return false ;
599+ }
600+
531601 if (cIsGoodITSLayers && !col.selection_bit (aod::evsel::kIsGoodITSLayersAll )) { // All ITS layer active
532602 return false ;
533603 }
0 commit comments