Skip to content

Commit fb6f373

Browse files
arvindkhuntiaArvindiitialibuild
authored
[PWGLF] [PWGMM] FV0 info added to Lumi task (#12101)
Co-authored-by: Arvind Khuntia <arvind.khuntia@cern.ch> Co-authored-by: ALICE Action Bot <alibuild@cern.ch>
1 parent a1e030f commit fb6f373

File tree

1 file changed

+96
-53
lines changed

1 file changed

+96
-53
lines changed

PWGMM/Lumi/Tasks/LumiFDDFT0.cxx

Lines changed: 96 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -10,41 +10,39 @@
1010
// or submit itself to any jurisdiction.
1111
// author: akhuntia@cern.ch
1212

13-
#include <array>
14-
#include <cmath>
15-
#include <iostream>
16-
#include <vector>
17-
1813
#include "Common/Core/TrackSelection.h"
1914
#include "Common/Core/trackUtilities.h"
2015
#include "Common/DataModel/EventSelection.h"
21-
#include "Common/DataModel/TrackSelectionTables.h"
2216
#include "Common/DataModel/Multiplicity.h"
23-
#include "CommonUtils/NameConf.h"
17+
#include "Common/DataModel/TrackSelectionTables.h"
2418

19+
#include "CCDB/BasicCCDBManager.h"
20+
#include "CCDB/CcdbApi.h"
21+
#include "CommonConstants/GeomConstants.h"
22+
#include "CommonUtils/NameConf.h"
23+
#include "DataFormatsCalibration/MeanVertexObject.h"
24+
#include "DataFormatsFDD/Digit.h"
25+
#include "DataFormatsFIT/Triggers.h"
26+
#include "DataFormatsParameters/GRPMagField.h"
27+
#include "DataFormatsParameters/GRPObject.h"
28+
#include "DetectorsBase/GeometryManager.h"
29+
#include "DetectorsBase/Propagator.h"
30+
#include "DetectorsVertexing/PVertexer.h"
2531
#include "Framework/ASoAHelpers.h"
32+
#include "Framework/AnalysisDataModel.h"
2633
#include "Framework/AnalysisTask.h"
2734
#include "Framework/HistogramRegistry.h"
2835
#include "Framework/RunningWorkflowInfo.h"
2936
#include "Framework/runDataProcessing.h"
30-
#include "Framework/AnalysisDataModel.h"
31-
32-
#include "DetectorsVertexing/PVertexer.h"
3337
#include "ReconstructionDataFormats/DCA.h"
3438
#include "ReconstructionDataFormats/PrimaryVertex.h"
3539
#include "ReconstructionDataFormats/Vertex.h"
3640

37-
#include "DataFormatsFDD/Digit.h"
38-
#include "DataFormatsFIT/Triggers.h"
39-
#include "DataFormatsParameters/GRPObject.h"
40-
#include "DataFormatsParameters/GRPMagField.h"
41-
42-
#include "DetectorsBase/GeometryManager.h"
43-
#include "DetectorsBase/Propagator.h"
44-
#include "CommonConstants/GeomConstants.h"
45-
#include "CCDB/BasicCCDBManager.h"
46-
#include "CCDB/CcdbApi.h"
47-
#include "DataFormatsCalibration/MeanVertexObject.h"
41+
#include <array>
42+
#include <cmath>
43+
#include <iostream>
44+
#include <map>
45+
#include <vector>
4846

4947
using namespace o2;
5048
using namespace o2::framework;
@@ -85,6 +83,12 @@ DECLARE_SOA_COLUMN(TimeCFT0, timeCft0, double);
8583
DECLARE_SOA_COLUMN(ChargeAFT0, chargeAft0, double);
8684
DECLARE_SOA_COLUMN(ChargeCFT0, chargeCft0, double);
8785

86+
// information for FV0
87+
DECLARE_SOA_COLUMN(isFV0, isfv0, bool);
88+
DECLARE_SOA_COLUMN(TCMTriggerFV0, tcmTriggerfv0, uint8_t);
89+
DECLARE_SOA_COLUMN(TimeAFV0, timeAfv0, double); // Only FV0-A time
90+
DECLARE_SOA_COLUMN(ChargeAFV0, chargeAfv0, double); // Only FV0-A charge
91+
8892
} // namespace full
8993
DECLARE_SOA_TABLE(EventInfo, "AOD", "EventInfo", full::TimeStamp, full::VertexX,
9094
full::VertexY, full::VertexZ, full::GlobalBC,
@@ -94,7 +98,8 @@ DECLARE_SOA_TABLE(EventInfo, "AOD", "EventInfo", full::TimeStamp, full::VertexX,
9498
full::ChargeAFDD, full::ChargeCFDD,
9599
full::isFT0, full::TCMTriggerFT0,
96100
full::TimeAFT0, full::TimeCFT0,
97-
full::ChargeAFT0, full::ChargeCFT0);
101+
full::ChargeAFT0, full::ChargeCFT0, full::isFV0,
102+
full::TCMTriggerFV0, full::TimeAFV0, full::ChargeAFV0);
98103

99104
DECLARE_SOA_TABLE(EventInfoFDD, "AOD", "EventInfoFDD",
100105
full::TimeStamp, full::GlobalBC,
@@ -109,12 +114,18 @@ DECLARE_SOA_TABLE(EventInfoFT0, "AOD", "EventInfoFT0",
109114
full::TimeCFT0, full::ChargeAFT0,
110115
full::ChargeCFT0);
111116

117+
DECLARE_SOA_TABLE(EventInfoFV0, "AOD", "EventInfoFV0",
118+
full::TimeStamp, full::GlobalBC,
119+
full::TCMTriggerFV0, full::TimeAFV0,
120+
full::ChargeAFV0);
121+
112122
} // namespace o2::aod
113123

114124
struct LumiFDDFT0 {
115125
Produces<o2::aod::EventInfo> rowEventInfo;
116126
Produces<o2::aod::EventInfoFDD> rowEventInfofdd;
117127
Produces<o2::aod::EventInfoFT0> rowEventInfoft0;
128+
Produces<o2::aod::EventInfoFV0> rowEventInfofv0;
118129
Service<o2::ccdb::BasicCCDBManager> ccdb;
119130
const char* ccdbpath_grp = "GLO/Config/GRPMagField";
120131
const char* ccdburl = "http://alice-ccdb.cern.ch";
@@ -147,10 +158,10 @@ struct LumiFDDFT0 {
147158
{
148159
{"BCFDD", "", {HistType::kTH1F, {{nBCsPerOrbit + 1, -0.5f, nBCsPerOrbit + 0.5f, "x"}}}}, //
149160
{"BCFT0", "", {HistType::kTH1F, {{nBCsPerOrbit + 1, -0.5f, nBCsPerOrbit + 0.5f, "x"}}}}, //
161+
{"BCFV0", "", {HistType::kTH1F, {{nBCsPerOrbit + 1, -0.5f, nBCsPerOrbit + 0.5f, "x"}}}}, //
150162
}};
151163

152164
bool doPVrefit = true;
153-
154165
void init(InitContext&)
155166
{
156167
if (doprocessLite == true && doprocessFull == true) {
@@ -165,7 +176,7 @@ struct LumiFDDFT0 {
165176
mRunNumber = 0;
166177
}
167178

168-
void processFull(soa::Join<aod::Collisions, aod::EvSels>::iterator const& collision, aod::FDDs const& /*fdds*/, aod::FT0s const& /*ft0s*/, aod::BCsWithTimestamps const&,
179+
void processFull(soa::Join<aod::Collisions, aod::EvSels>::iterator const& collision, aod::FDDs const& /*fdds*/, aod::FT0s const& /*ft0s*/, aod::FV0As const& /*fv0s*/, aod::BCsWithTimestamps const&,
169180
o2::soa::Join<o2::aod::Tracks, o2::aod::TracksCov,
170181
o2::aod::TracksExtra> const& unfiltered_tracks)
171182
{
@@ -239,6 +250,10 @@ struct LumiFDDFT0 {
239250
double chargecFT0 = 0.;
240251
uint8_t mTriggerFT0 = 0;
241252

253+
double timeaFV0 = -999.;
254+
double chargeaFV0 = 0.;
255+
uint8_t mTriggerFV0 = 0;
256+
242257
if (doPVrefit && PVrefit_doable) {
243258
auto Pvtx_refitted = vertexer.refitVertex(vec_useTrk_PVrefit, Pvtx);
244259
chi2 = Pvtx_refitted.getChi2();
@@ -249,38 +264,49 @@ struct LumiFDDFT0 {
249264
// refitYY = Pvtx_refitted.getSigmaY2();
250265
// refitXY = Pvtx_refitted.getSigmaXY();
251266

252-
// now get information for FDD
253-
if (collision.has_foundFDD()) {
254-
auto fdd = collision.foundFDD();
255-
mTriggerFDD = fdd.triggerMask();
256-
timeaFDD = fdd.timeA();
257-
timecFDD = fdd.timeC();
258-
for (auto amplitude : fdd.chargeA()) {
259-
chargeaFDD += amplitude;
260-
}
261-
for (auto amplitude : fdd.chargeC()) {
262-
chargecFDD += amplitude;
263-
}
264-
} // fdd
265-
266-
if (collision.has_foundFT0()) {
267-
auto ft0 = collision.foundFT0();
268-
mTriggerFT0 = ft0.triggerMask();
269-
timeaFT0 = ft0.timeA();
270-
timecFT0 = ft0.timeC();
271-
for (auto amplitude : ft0.amplitudeA()) {
272-
chargeaFT0 += amplitude;
273-
}
267+
} // pv refit
274268

275-
for (auto amplitude : ft0.amplitudeC()) {
276-
chargecFT0 += amplitude;
277-
}
278-
} // ft0
269+
// now get information for FDD
270+
if (collision.has_foundFDD()) {
271+
auto fdd = collision.foundFDD();
272+
mTriggerFDD = fdd.triggerMask();
273+
timeaFDD = fdd.timeA();
274+
timecFDD = fdd.timeC();
275+
for (auto amplitude : fdd.chargeA()) {
276+
chargeaFDD += amplitude;
277+
}
278+
for (auto amplitude : fdd.chargeC()) {
279+
chargecFDD += amplitude;
280+
}
281+
} // fdd
282+
283+
if (collision.has_foundFT0()) {
284+
auto ft0 = collision.foundFT0();
285+
mTriggerFT0 = ft0.triggerMask();
286+
timeaFT0 = ft0.timeA();
287+
timecFT0 = ft0.timeC();
288+
for (auto amplitude : ft0.amplitudeA()) {
289+
chargeaFT0 += amplitude;
290+
}
291+
292+
for (auto amplitude : ft0.amplitudeC()) {
293+
chargecFT0 += amplitude;
294+
}
295+
} // ft0
296+
297+
// FV0
298+
if (collision.has_foundFV0()) {
299+
auto fv0 = collision.foundFV0();
300+
mTriggerFV0 = fv0.triggerMask();
301+
timeaFV0 = fv0.time();
302+
for (auto amplitude : fv0.amplitude()) {
303+
chargeaFV0 += amplitude;
304+
}
305+
} // fv0
279306

280-
} // pv refit
281307
rowEventInfo(relTS, refitX, refitY, refitZ, globalBC, chi2, nContrib, collision.has_foundFDD(),
282308
mTriggerFDD, timeaFDD, timecFDD, chargeaFDD, chargecFDD, collision.has_foundFT0(), mTriggerFT0, timeaFT0,
283-
timecFT0, chargeaFT0, chargecFT0);
309+
timecFT0, chargeaFT0, chargecFT0, collision.has_foundFV0(), mTriggerFV0, timeaFV0, chargeaFV0);
284310

285311
histos.fill(HIST("chisquare_Refitted"), chi2);
286312
if (nContrib > nContribMin && nContrib < nContribMax &&
@@ -313,7 +339,7 @@ struct LumiFDDFT0 {
313339
};
314340
PROCESS_SWITCH(LumiFDDFT0, processFull, "Process FDD", true);
315341

316-
void processLite(aod::FDDs const& fdds, aod::FT0s const& ft0s, aod::BCsWithTimestamps const&)
342+
void processLite(aod::FDDs const& fdds, aod::FT0s const& ft0s, aod::FV0As const& fv0s, aod::BCsWithTimestamps const&)
317343
{
318344

319345
// Scan over the FDD table and store charge and time along with globalBC
@@ -384,6 +410,23 @@ struct LumiFDDFT0 {
384410
}
385411
rowEventInfoft0(relTS, globalBC, ft0.triggerMask(), ft0.timeA(), ft0.timeC(), chargeaFT0, chargecFT0);
386412
} // end of ft0 table
413+
414+
// Scan over the FV0 table and store charge and time along with globalBC
415+
for (auto& fv0 : fv0s) {
416+
auto bc = fv0.bc_as<BCsWithTimestamps>();
417+
if (!bc.timestamp())
418+
continue;
419+
Long64_t relTS = bc.timestamp() - fttimestamp;
420+
Long64_t globalBC = bc.globalBC();
421+
int localBC = globalBC % nBCsPerOrbit;
422+
histoslite.fill(HIST("BCFV0"), localBC);
423+
424+
double chargeaFV0 = 0.;
425+
for (auto amplitude : fv0.amplitude()) {
426+
chargeaFV0 += amplitude;
427+
}
428+
rowEventInfofv0(relTS, globalBC, fv0.triggerMask(), fv0.time(), chargeaFV0);
429+
} // end of fv0 table
387430
};
388431
PROCESS_SWITCH(LumiFDDFT0, processLite, "Process FDD and FT0 info", false);
389432

0 commit comments

Comments
 (0)