Skip to content

Commit e55c909

Browse files
MATTEIMATTEI
authored andcommitted
Adding output AO2D to store timestamp, ZNA time and ZNC time for every bc
1 parent cc1cc63 commit e55c909

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

PWGMM/Lumi/Tasks/lumiStabilityLightIons.cxx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
#include "DataFormatsParameters/GRPLHCIFData.h"
2525
#include "Framework/AnalysisTask.h"
2626
#include "Framework/runDataProcessing.h"
27+
#include "Framework/ASoA.h"
28+
#include "Framework/AnalysisDataModel.h"
2729

2830
#include <limits>
2931
#include <map>
@@ -36,9 +38,20 @@ using namespace o2::framework::expressions;
3638

3739
o2::common::core::MetadataHelper metadataInfo; // Metadata helper
3840

41+
namespace o2::aod {
42+
namespace myBc_aod {
43+
DECLARE_SOA_COLUMN(Timestamp, timestamp, uint64_t);
44+
DECLARE_SOA_COLUMN(TimeZNA, timeZNA, float);
45+
DECLARE_SOA_COLUMN(TimeZNC, timeZNC, float);
46+
} //namespace myBc_aod
47+
DECLARE_SOA_TABLE(MyBCaod, "AOD", "MYBCAOD", myBc_aod::Timestamp, myBc_aod::TimeZNA, myBc_aod::TimeZNC);
48+
} //namespace o2::aod
49+
3950
using MyBCs = soa::Join<aod::BCs, aod::BcSels, aod::Timestamps, aod::Run3MatchedToBCSparse>;
4051

4152
struct LumiStabilityLightIons {
53+
Produces<aod::MyBCaod> BCaod;
54+
4255
Configurable<bool> cfgDoFT0Vtx{"cfgDoFT0Vtx", true, "Create and fill histograms for the FT0 vertex trigger"};
4356
Configurable<bool> cfgDoFT0CE{"cfgDoFT0CE", true, "Create and fill histograms for the FT0 centrality trigger"};
4457
Configurable<bool> cfgDoFDD{"cfgDoFDD", true, "Create and fill histograms for the FDD trigger"};
@@ -55,6 +68,11 @@ struct LumiStabilityLightIons {
5568

5669
Configurable<int> cfgEmptyBCsBeforeLeadingBC{"cfgEmptyBCsBeforeLeadingBC", 5, "Minimum number of empty BCs before a leading BC to identify it as such"};
5770

71+
//Configurables specific to VdM analysis: output ao2d with timestamps and ZDC times
72+
Configurable<bool> cfgFillBCao2d{"cfgFillBCao2d", false, "Fill BC ao2d with timestamps and ZDC times"};
73+
Configurable<uint64_t> cfgTstampStartFillingBCao2d{"cfgTstampStartFillingBCao2d", 0, "Minimum value of timestamp for output bc ao2d to be filled"};
74+
Configurable<uint64_t> cfgTstampEndFillingBCao2d{"cfgTstampEndFillingBCao2d", 0, "Maximum value of timestamp for output bc ao2d to be filled"};
75+
5876
std::bitset<o2::constants::lhc::LHCMaxBunches> beamPatternA, beamPatternC;
5977
std::bitset<o2::constants::lhc::LHCMaxBunches> bcPatternA, bcPatternC, bcPatternB, bcPatternE, bcPatternL;
6078

@@ -252,6 +270,12 @@ struct LumiStabilityLightIons {
252270
}
253271

254272
mHistManager.fill(HIST("ZDCQA/ZDCTimes"), timeZNA, timeZNC);
273+
274+
//For VdM analysis: fill timestamps and ZDC times in output tree, if enabled
275+
uint64_t timestamp = bc.timestamp();
276+
if(cfgFillBCao2d && timestamp>=cfgTstampStartFillingBCao2d && timestamp<=cfgTstampEndFillingBCao2d) {
277+
BCaod(timestamp, timeZNA, timeZNC);
278+
}
255279
}
256280
}
257281
PROCESS_SWITCH(LumiStabilityLightIons, processZDCQA, "process QA for the ZDC triggers (light ions and PbPb)", false);

0 commit comments

Comments
 (0)