Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions PWGEM/Dilepton/Core/Dilepton.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,14 @@
#include <utility>
#include <vector>

using namespace o2;

Check failure on line 63 in PWGEM/Dilepton/Core/Dilepton.h

View workflow job for this annotation

GitHub Actions / O2 linter

[using-directive]

Do not put using directives at global scope in headers.
using namespace o2::aod;

Check failure on line 64 in PWGEM/Dilepton/Core/Dilepton.h

View workflow job for this annotation

GitHub Actions / O2 linter

[using-directive]

Do not put using directives at global scope in headers.
using namespace o2::framework;

Check failure on line 65 in PWGEM/Dilepton/Core/Dilepton.h

View workflow job for this annotation

GitHub Actions / O2 linter

[using-directive]

Do not put using directives at global scope in headers.
using namespace o2::framework::expressions;

Check failure on line 66 in PWGEM/Dilepton/Core/Dilepton.h

View workflow job for this annotation

GitHub Actions / O2 linter

[using-directive]

Do not put using directives at global scope in headers.
using namespace o2::soa;

Check failure on line 67 in PWGEM/Dilepton/Core/Dilepton.h

View workflow job for this annotation

GitHub Actions / O2 linter

[using-directive]

Do not put using directives at global scope in headers.
using namespace o2::aod::pwgem::dilepton::utils;

Check failure on line 68 in PWGEM/Dilepton/Core/Dilepton.h

View workflow job for this annotation

GitHub Actions / O2 linter

[using-directive]

Do not put using directives at global scope in headers.
using namespace o2::aod::pwgem::dilepton::utils::emtrackutil;

Check failure on line 69 in PWGEM/Dilepton/Core/Dilepton.h

View workflow job for this annotation

GitHub Actions / O2 linter

[using-directive]

Do not put using directives at global scope in headers.
using namespace o2::aod::pwgem::dilepton::utils::pairutil;

Check failure on line 70 in PWGEM/Dilepton/Core/Dilepton.h

View workflow job for this annotation

GitHub Actions / O2 linter

[using-directive]

Do not put using directives at global scope in headers.

using MyCollisions = soa::Join<aod::EMEvents, aod::EMEventsMult, aod::EMEventsCent, aod::EMEventsQvec>;
using MyCollision = MyCollisions::iterator;
Expand Down Expand Up @@ -449,10 +449,10 @@
}

// In case override, don't proceed, please - no CCDB access required
if (d_bz_input > -990) {

Check failure on line 452 in PWGEM/Dilepton/Core/Dilepton.h

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
d_bz = d_bz_input;
o2::parameters::GRPMagField grpmag;
if (std::fabs(d_bz) > 1e-5) {

Check failure on line 455 in PWGEM/Dilepton/Core/Dilepton.h

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
grpmag.setL3Current(30000.f / (d_bz / 5.0f));
}
o2::base::Propagator::initFieldFromGRP(&grpmag);
Expand Down Expand Up @@ -1545,7 +1545,7 @@
PROCESS_SWITCH(Dilepton, processAnalysis, "run dilepton analysis", true);

using FilteredMyCollisionsWithSWT = soa::Filtered<MyCollisionsWithSWT>;
void processTriggerAnalysis(FilteredMyCollisionsWithSWT const& collisions, aod::EMSWTriggerInfos const& cefpinfos, aod::EMSWTriggerCounters const& counters, Types const&... args)
void processTriggerAnalysis(FilteredMyCollisionsWithSWT const& collisions, aod::EMSWTriggerInfos const& cefpinfos, aod::EMSWTriggerATCounters const& countersAT, aod::EMSWTriggerTOICounters const& countersTOI, Types const&... args)
{
if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) {
auto electrons = std::get<0>(std::tie(args...));
Expand All @@ -1565,10 +1565,12 @@

// for nomalization
int emswtId = o2::aod::pwgem::dilepton::swt::aliasLabels.at(cfg_swt_name.value);
for (const auto& counter : counters) {
for (const auto& counter : countersAT) {
if (counter.isAnalyzed_bit(emswtId)) {
fRegistry.fill(HIST("NormTrigger/hTriggerCounter"), mRunNumber, 0);
}
}
for (const auto& counter : countersTOI) {
if (counter.isAnalyzedToI_bit(emswtId)) {
fRegistry.fill(HIST("NormTrigger/hTriggerCounter"), mRunNumber, 1);
}
Expand Down
6 changes: 4 additions & 2 deletions PWGEM/Dilepton/Core/DileptonHadronMPC.h
Original file line number Diff line number Diff line change
Expand Up @@ -1442,7 +1442,7 @@ struct DileptonHadronMPC {
PROCESS_SWITCH(DileptonHadronMPC, processAnalysis, "run dilepton analysis", true);

using FilteredMyCollisionsWithSWT = soa::Filtered<MyCollisionsWithSWT>;
void processTriggerAnalysis(FilteredMyCollisionsWithSWT const& collisions, FilteredRefTracks const& refTracks, aod::EMSWTriggerInfos const& cefpinfos, aod::EMSWTriggerCounters const& counters, Types const&... args)
void processTriggerAnalysis(FilteredMyCollisionsWithSWT const& collisions, FilteredRefTracks const& refTracks, aod::EMSWTriggerInfos const& cefpinfos, aod::EMSWTriggerATCounters const& countersAT, aod::EMSWTriggerTOICounters const& countersTOI, Types const&... args)
{
if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) {
auto electrons = std::get<0>(std::tie(args...));
Expand All @@ -1462,10 +1462,12 @@ struct DileptonHadronMPC {

// for nomalization
int emswtId = o2::aod::pwgem::dilepton::swt::aliasLabels.at(cfg_swt_name.value);
for (const auto& counter : counters) {
for (const auto& counter : countersAT) {
if (counter.isAnalyzed_bit(emswtId)) {
fRegistry.fill(HIST("NormTrigger/hTriggerCounter"), mRunNumber, 0);
}
}
for (const auto& counter : countersTOI) {
if (counter.isAnalyzedToI_bit(emswtId)) {
fRegistry.fill(HIST("NormTrigger/hTriggerCounter"), mRunNumber, 1);
}
Expand Down
6 changes: 4 additions & 2 deletions PWGEM/Dilepton/Core/PhotonHBT.h
Original file line number Diff line number Diff line change
Expand Up @@ -1459,7 +1459,7 @@ struct PhotonHBT {
PROCESS_SWITCH(PhotonHBT, processAnalysis, "pairing for analysis", false);

using FilteredMyCollisionsWithSWT = soa::Filtered<MyCollisionsWithSWT>;
void processTriggerAnalysis(FilteredMyCollisionsWithSWT const& collisions, aod::EMSWTriggerInfos const& cefpinfos, aod::EMSWTriggerCounters const& counters, Types const&... args)
void processTriggerAnalysis(FilteredMyCollisionsWithSWT const& collisions, aod::EMSWTriggerInfos const& cefpinfos, aod::EMSWTriggerATCounters const& countersAT, aod::EMSWTriggerTOICounters const& countersTOI, Types const&... args)
{
if constexpr (pairtype == ggHBTPairType::kPCMPCM) {
auto v0photons = std::get<0>(std::tie(args...));
Expand All @@ -1484,10 +1484,12 @@ struct PhotonHBT {

// for nomalization
int emswtId = o2::aod::pwgem::dilepton::swt::aliasLabels.at(cfg_swt_name.value);
for (const auto& counter : counters) {
for (const auto& counter : countersAT) {
if (counter.isAnalyzed_bit(emswtId)) {
fRegistry.fill(HIST("NormTrigger/hTriggerCounter"), mRunNumber, 0);
}
}
for (const auto& counter : countersTOI) {
if (counter.isAnalyzedToI_bit(emswtId)) {
fRegistry.fill(HIST("NormTrigger/hTriggerCounter"), mRunNumber, 1);
}
Expand Down
6 changes: 4 additions & 2 deletions PWGEM/Dilepton/Core/SingleTrackQC.h
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,7 @@ struct SingleTrackQC {
PROCESS_SWITCH(SingleTrackQC, processQC, "run single track QC", true);

using FilteredMyCollisionsWithSWT = soa::Filtered<MyCollisionsWithSWT>;
void processQC_TriggeredData(FilteredMyCollisionsWithSWT const& collisions, aod::EMSWTriggerInfos const& cefpinfos, aod::EMSWTriggerCounters const& counters, Types const&... args)
void processQC_TriggeredData(FilteredMyCollisionsWithSWT const& collisions, aod::EMSWTriggerInfos const& cefpinfos, aod::EMSWTriggerATCounters const& countersAT, aod::EMSWTriggerTOICounters const& countersTOI, Types const&... args)
{
if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) {
auto electrons = std::get<0>(std::tie(args...));
Expand All @@ -848,10 +848,12 @@ struct SingleTrackQC {

// for nomalization
int emswtId = o2::aod::pwgem::dilepton::swt::aliasLabels.at(cfg_swt_name.value);
for (const auto& counter : counters) {
for (const auto& counter : countersAT) {
if (counter.isAnalyzed_bit(emswtId)) {
fRegistry.fill(HIST("NormTrigger/hTriggerCounter"), mRunNumber, 0);
}
}
for (const auto& counter : countersTOI) {
if (counter.isAnalyzedToI_bit(emswtId)) {
fRegistry.fill(HIST("NormTrigger/hTriggerCounter"), mRunNumber, 1);
}
Expand Down
14 changes: 10 additions & 4 deletions PWGEM/Dilepton/DataModel/dileptonTables.h
Original file line number Diff line number Diff line change
Expand Up @@ -214,17 +214,23 @@ using EMSWTriggerBit = EMSWTriggerBits::iterator;
DECLARE_SOA_TABLE(EMSWTriggerInfos, "AOD", "EMSWTINFO", bc::RunNumber, emevent::NInspectedTVX, emevent::NScalars, emevent::NSelections, o2::soa::Marker<1>); //! independent table. Don't join anything.
using EMSWTriggerInfo = EMSWTriggerInfos::iterator;

DECLARE_SOA_TABLE(EMSWTriggerCounters, "AOD", "EMSWTCOUNTER", emevent::IsAnalyzed, emevent::IsAnalyzedToI, o2::soa::Marker<1>); //! independent table. Don't join anything.
using EMSWTriggerCounter = EMSWTriggerCounters::iterator;
DECLARE_SOA_TABLE(EMSWTriggerATCounters, "AOD", "EMSWTAT", emevent::IsAnalyzed, o2::soa::Marker<1>); //! independent table. Don't join anything.
using EMSWTriggerATCounter = EMSWTriggerATCounters::iterator;

DECLARE_SOA_TABLE(EMSWTriggerTOICounters, "AOD", "EMSWTTOI", emevent::IsAnalyzedToI, o2::soa::Marker<1>); //! independent table. Don't join anything.
using EMSWTriggerTOICounter = EMSWTriggerTOICounters::iterator;

DECLARE_SOA_TABLE(EMSWTriggerBitsTMP, "AOD", "EMSWTBITTMP", emevent::SWTAliasTmp, o2::soa::Marker<2>); //! joinable to aod::Collisions
using EMSWTriggerBitTMP = EMSWTriggerBitsTMP::iterator;

DECLARE_SOA_TABLE(EMSWTriggerInfosTMP, "AOD", "EMSWTINFOTMP", bc::RunNumber, emevent::NInspectedTVX, emevent::NScalars, emevent::NSelections, o2::soa::Marker<2>);
using EMSWTriggerInfoTMP = EMSWTriggerInfosTMP::iterator;

DECLARE_SOA_TABLE(EMSWTriggerCountersTMP, "AOD", "EMSWTCOUNTERTMP", emevent::IsAnalyzed, emevent::IsAnalyzedToI, o2::soa::Marker<2>); //! independent table. Don't join anything.
using EMSWTriggerCounterTMP = EMSWTriggerCountersTMP::iterator;
DECLARE_SOA_TABLE(EMSWTriggerATCountersTMP, "AOD", "EMSWTATTMP", emevent::IsAnalyzed, o2::soa::Marker<2>); //! independent table. Don't join anything.
using EMSWTriggerATCounterTMP = EMSWTriggerATCountersTMP::iterator;

DECLARE_SOA_TABLE(EMSWTriggerTOICountersTMP, "AOD", "EMSWTTOITMP", emevent::IsAnalyzedToI, o2::soa::Marker<2>); //! independent table. Don't join anything.
using EMSWTriggerTOICounterTMP = EMSWTriggerTOICountersTMP::iterator;

DECLARE_SOA_TABLE(EMEventsProperty, "AOD", "EMEVENTPROP", //! joinable to EMEvents
emevent::SpherocityPtWeighted, emevent::SpherocityPtUnWeighted, emevent::NtrackSpherocity);
Expand Down
30 changes: 20 additions & 10 deletions PWGEM/Dilepton/TableProducer/createEMEventDilepton.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ struct CreateEMEventDilepton {
Produces<o2::aod::EMEventsQvec> event_qvec;
Produces<o2::aod::EMSWTriggerBits> emswtbit;
Produces<o2::aod::EMSWTriggerInfos> emswtinfo;
Produces<o2::aod::EMSWTriggerCounters> emswtcounter;
Produces<o2::aod::EMSWTriggerATCounters> emswtATcounter;
Produces<o2::aod::EMSWTriggerTOICounters> emswtTOIcounter;
Produces<o2::aod::EMEventNormInfos> event_norm_info;

enum class EMEventType : int {
Expand Down Expand Up @@ -211,7 +212,7 @@ struct CreateEMEventDilepton {

//---------- for data with swt ----------

void processEvent_SWT(MyCollisionsWithSWT const& collisions, MyBCs const& bcs, aod::EMSWTriggerInfosTMP const& emswtinfostmp, aod::EMSWTriggerCountersTMP const& emswtcounterstmp)
void processEvent_SWT(MyCollisionsWithSWT const& collisions, MyBCs const& bcs, aod::EMSWTriggerInfosTMP const& emswtinfostmp, aod::EMSWTriggerATCountersTMP const& emswtATcounterstmp, aod::EMSWTriggerTOICountersTMP const& emswtTOIcounterstmp)
{
skimEvent<false, true, EMEventType::kEvent>(collisions, bcs);

Expand All @@ -225,13 +226,16 @@ struct CreateEMEventDilepton {
mRunNumber = info.runNumber();
}
}
for (const auto& counter : emswtcounterstmp) {
emswtcounter(counter.isAnalyzed_raw(), counter.isAnalyzedToI_raw());
for (const auto& counter : emswtATcounterstmp) {
emswtATcounter(counter.isAnalyzed_raw());
}
for (const auto& counter : emswtTOIcounterstmp) {
emswtTOIcounter(counter.isAnalyzedToI_raw());
}
}
PROCESS_SWITCH(CreateEMEventDilepton, processEvent_SWT, "process event info", false);

void processEvent_SWT_Cent(MyCollisionsWithSWT_Cent const& collisions, MyBCs const& bcs, aod::EMSWTriggerInfosTMP const& emswtinfostmp, aod::EMSWTriggerCountersTMP const& emswtcounterstmp)
void processEvent_SWT_Cent(MyCollisionsWithSWT_Cent const& collisions, MyBCs const& bcs, aod::EMSWTriggerInfosTMP const& emswtinfostmp, aod::EMSWTriggerATCountersTMP const& emswtATcounterstmp, aod::EMSWTriggerTOICountersTMP const& emswtTOIcounterstmp)
{
skimEvent<false, true, EMEventType::kEvent_Cent>(collisions, bcs);

Expand All @@ -245,13 +249,16 @@ struct CreateEMEventDilepton {
mRunNumber = info.runNumber();
}
}
for (const auto& counter : emswtcounterstmp) {
emswtcounter(counter.isAnalyzed_raw(), counter.isAnalyzedToI_raw());
for (const auto& counter : emswtATcounterstmp) {
emswtATcounter(counter.isAnalyzed_raw());
}
for (const auto& counter : emswtTOIcounterstmp) {
emswtTOIcounter(counter.isAnalyzedToI_raw());
}
}
PROCESS_SWITCH(CreateEMEventDilepton, processEvent_SWT_Cent, "process event info", false);

void processEvent_SWT_Cent_Qvec(MyCollisionsWithSWT_Cent_Qvec const& collisions, MyBCs const& bcs, aod::EMSWTriggerInfosTMP const& emswtinfostmp, aod::EMSWTriggerCountersTMP const& emswtcounterstmp)
void processEvent_SWT_Cent_Qvec(MyCollisionsWithSWT_Cent_Qvec const& collisions, MyBCs const& bcs, aod::EMSWTriggerInfosTMP const& emswtinfostmp, aod::EMSWTriggerATCountersTMP const& emswtATcounterstmp, aod::EMSWTriggerTOICountersTMP const& emswtTOIcounterstmp)
{
skimEvent<false, true, EMEventType::kEvent_Cent_Qvec>(collisions, bcs);

Expand All @@ -265,8 +272,11 @@ struct CreateEMEventDilepton {
mRunNumber = info.runNumber();
}
}
for (const auto& counter : emswtcounterstmp) {
emswtcounter(counter.isAnalyzed_raw(), counter.isAnalyzedToI_raw());
for (const auto& counter : emswtATcounterstmp) {
emswtATcounter(counter.isAnalyzed_raw());
}
for (const auto& counter : emswtTOIcounterstmp) {
emswtTOIcounter(counter.isAnalyzedToI_raw());
}
}
PROCESS_SWITCH(CreateEMEventDilepton, processEvent_SWT_Cent_Qvec, "process event info", false);
Expand Down
29 changes: 13 additions & 16 deletions PWGEM/Dilepton/TableProducer/skimmerOTS.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,12 @@ using namespace o2::soa;
struct skimmerOTS {
Produces<o2::aod::EMSWTriggerInfosTMP> swtinfo_tmp; // Join aod::Collision later.
Produces<o2::aod::EMSWTriggerBitsTMP> swtbit_tmp;
Produces<o2::aod::EMSWTriggerCountersTMP> swtcounter_tmp;
Produces<o2::aod::EMSWTriggerATCountersTMP> swtcounterAT_tmp;
Produces<o2::aod::EMSWTriggerTOICountersTMP> swtcounterTOI_tmp;

// CCDB options
Configurable<std::string> ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"};
Configurable<std::string> cfg_swt_names{"cfg_swt_names", "fHighTrackMult,fHighFt0Mult", "comma-separated software trigger names"}; // !trigger names have to be pre-registered in dileptonTable.h for bit operation!
Configurable<std::string> cfg_swt_names{"cfg_swt_names", "fLMeeIMR,fLMeeHMR", "comma-separated software trigger names"}; // !trigger names have to be pre-registered in dileptonTable.h for bit operation!
o2::framework::Configurable<std::string> ccdbPathSoftwareTrigger{"ccdbPathSoftwareTrigger", "EventFiltering/Zorro/", "ccdb path for ZORRO objects"};
Configurable<uint64_t> bcMarginForSoftwareTrigger{"bcMarginForSoftwareTrigger", 100, "Number of BCs of margin for software triggers"};

Expand All @@ -56,6 +57,7 @@ struct skimmerOTS {
std::vector<int> mATCounters;

HistogramRegistry registry{"registry"};

void init(o2::framework::InitContext&)
{
ccdb->setURL(ccdburl);
Expand Down Expand Up @@ -130,14 +132,13 @@ struct skimmerOTS {

void process(aod::Collisions const& collisions, aod::BCsWithTimestamps const&)
{

for (const auto& collision : collisions) {
auto bc = collision.template bc_as<aod::BCsWithTimestamps>(); // don't use foundBC.
initCCDB(bc);

uint16_t trigger_bitmap = 0;
uint16_t analyzed_bitmap = 0;
uint16_t analyzedToI_bitmap = 0;
// uint16_t analyzed_bitmap = 0;
// uint16_t analyzedToI_bitmap = 0;
registry.fill(HIST("hCollisionCounter"), 1); // all

if (zorro.isSelected(bc.globalBC(), bcMarginForSoftwareTrigger)) { // triggered event
Expand All @@ -154,28 +155,24 @@ struct skimmerOTS {
// LOGF(info, "swtname = %s is fired. swt index in original swt table = %d, swt index for EM table = %d", swtname.data(), mTOIidx[idx], o2::aod::pwgem::dilepton::swt::aliasLabels.at(swtname));
registry.fill(HIST("hCollisionCounter"), idx + 2); // fired trigger

if (ATcounters[mTOIidx[idx]] > mATCounters[emswtId]) {
analyzed_bitmap |= BIT(emswtId);
// LOGF(info, "ATcounters[mTOIidx[idx]] = %d, TOIcounters[idx] = %d", ATcounters[mTOIidx[idx]], TOIcounters[idx]);

while (ATcounters[mTOIidx[idx]] > mATCounters[emswtId]) {
mATCounters[emswtId]++;
// mATCounters[emswtId] = ATcounters[mTOIidx[idx]]; // Dont' use this line. NOT always incremented by 1 in zorro!!
swtcounterAT_tmp(BIT(emswtId));
}

if (TOIcounters[idx] > mTOICounters[emswtId]) {
analyzedToI_bitmap |= BIT(emswtId);
mTOICounters[emswtId] = TOIcounters[idx]; // always incremented by 1 in zorro!!
while (TOIcounters[idx] > mTOICounters[emswtId]) {
mTOICounters[emswtId]++; // always incremented by 1 in zorro!!
swtcounterTOI_tmp(BIT(emswtId));
}

// LOGF(info, "collision.globalIndex() = %d, bc.globalBC() = %llu, mTOICounters[%d] = %d, mATcounters[%d] = %d", collision.globalIndex(), bc.globalBC(), emswtId, mTOICounters[emswtId], emswtId, mATCounters[emswtId]);
}
} // end of TOI loop
}
swtbit_tmp(trigger_bitmap);
if (analyzed_bitmap > 0 || analyzedToI_bitmap > 0) { // storing 0 is useless.
swtcounter_tmp(analyzed_bitmap, analyzedToI_bitmap);
}

} // end of collision loop

} // end of process
};
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
Expand Down
Loading