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
46 changes: 26 additions & 20 deletions PWGUD/Core/SGSelector.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,15 @@
namespace o2::aod::sgselector
{
enum TrueGap : int {
NoGap = -1,
SingleGapA = 0,
SingleGapC = 1,
DoubleGap = 2
NoGap = -1, // no gap due to change of threshold(s) in any of FV0, FT0A, ZNA, FT0C, ZNC
SingleGapA = 0, // initially single gap at A side event
SingleGapC = 1, // initially single gap at C side event
DoubleGap = 2, // initially double gap event
NoUpc = 3, // initially no UPC event with default thresholds (FT0A=150, FT0C=50)
TrkOutOfRange = 4, // to many tracks (>100 default)
BadDoubleGap = 5 // unknows status of double gap check with changed thresholds
};
}
} // namespace o2::aod::sgselector

class SGSelector
{
Expand All @@ -51,21 +54,21 @@
SGSelector() : myRCTChecker{"CBT"}, myRCTCheckerHadron{"CBT_hadronPID"}, myRCTCheckerZDC{"CBT", true}, myRCTCheckerHadronZDC{"CBT_hadronPID", true} {}

template <typename CC, typename BCs, typename TCs, typename FWs>
int Print(SGCutParHolder /*diffCuts*/, CC& collision, BCs& /*bcRange*/, TCs& /*tracks*/, FWs& /*fwdtracks*/)

Check failure on line 57 in PWGUD/Core/SGSelector.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.
{
LOGF(info, "Size of array %i", collision.size());
return 1;
}

template <typename CC, typename BCs, typename BC>
SelectionResult<BC> IsSelected(SGCutParHolder diffCuts, CC& collision, BCs& bcRange, BC& oldbc)

Check failure on line 64 in PWGUD/Core/SGSelector.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.
{
// LOGF(info, "Collision %f", collision.collisionTime());
// LOGF(info, "Number of close BCs: %i", bcRange.size());
SelectionResult<BC> result;
result.bc = &oldbc;
if (collision.numContrib() < diffCuts.minNTracks() || collision.numContrib() > diffCuts.maxNTracks()) {
result.value = 4;
result.value = o2::aod::sgselector::TrkOutOfRange; // 4
return result;
}
auto newbc = oldbc;
Expand All @@ -91,9 +94,9 @@
newbc = bc;
gC = false;
}
}
} // end of loop over bc range
if (!gA && !gC) {
result.value = 3;
result.value = o2::aod::sgselector::NoUpc; // gap = 3
return result;
}
if (gA && gC) { // loop once again for so-called DG events to get the most active FT0 BC
Expand All @@ -120,11 +123,12 @@
result.bc = &newbc;
// LOGF(info, "Old BC: %i, New BC: %i",oldbc.globalBC(), newbc.globalBC());
result.bc = &newbc;
result.value = gA && gC ? 2 : (gA ? 0 : 1);
// result.value = gA && gC ? 2 : (gA ? 0 : 1);
result.value = gA && gC ? o2::aod::sgselector::DoubleGap : (gA ? o2::aod::sgselector::SingleGapA : o2::aod::sgselector::SingleGapC);
return result;
}
template <typename TFwdTrack>
int FwdTrkSelector(TFwdTrack const& fwdtrack)

Check failure on line 131 in PWGUD/Core/SGSelector.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.
{
// if (fwdtrack.trackType() == 0 || fwdtrack.trackType() == 3)
if (fwdtrack.trackType() == o2::aod::fwdtrack::ForwardTrackTypeEnum::GlobalMuonTrack || fwdtrack.trackType() == o2::aod::fwdtrack::ForwardTrackTypeEnum::MuonStandaloneTrack)
Expand All @@ -136,32 +140,34 @@
template <typename CC>
int trueGap(CC& collision, float fv0, float ft0a, float ft0c, float zdc_cut)
{
float fit_cut[3] = {fv0, ft0a, ft0c};

Check failure on line 143 in PWGUD/Core/SGSelector.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.
int gap = collision.gapSide();
int true_gap = gap;

Check failure on line 145 in PWGUD/Core/SGSelector.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.
float FV0A, FT0A, FT0C, ZNA, ZNC;
FV0A = collision.totalFV0AmplitudeA();
FT0A = collision.totalFT0AmplitudeA();
FT0C = collision.totalFT0AmplitudeC();
ZNA = collision.energyCommonZNA();
ZNC = collision.energyCommonZNC();
// float FV0A, FT0A, FT0C, ZNA, ZNC;
const float FV0A = collision.totalFV0AmplitudeA();

Check failure on line 147 in PWGUD/Core/SGSelector.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.
const float FT0A = collision.totalFT0AmplitudeA();

Check failure on line 148 in PWGUD/Core/SGSelector.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.
const float FT0C = collision.totalFT0AmplitudeC();

Check failure on line 149 in PWGUD/Core/SGSelector.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.
const float ZNA = collision.energyCommonZNA();

Check failure on line 150 in PWGUD/Core/SGSelector.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.
const float ZNC = collision.energyCommonZNC();

Check failure on line 151 in PWGUD/Core/SGSelector.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.
if (gap == o2::aod::sgselector::SingleGapA) { // gap == 0
if (FV0A > fit_cut[0] || FT0A > fit_cut[1] || ZNA > zdc_cut)
true_gap = o2::aod::sgselector::NoGap; // -1
} else if (gap == o2::aod::sgselector::SingleGapC) { // gap == 1
if (FT0C > fit_cut[2] || ZNC > zdc_cut)
true_gap = o2::aod::sgselector::NoGap; // -1
} else if (gap == o2::aod::sgselector::DoubleGap) { // gap == 2
if ((FV0A > fit_cut[0] || FT0A > fit_cut[1] || ZNA > zdc_cut) && (FT0C > fit_cut[2] || ZNC > zdc_cut))
if ((FV0A > fit_cut[0] || FT0A > fit_cut[1] || ZNA > zdc_cut) && (FT0C > fit_cut[2] || ZNC > zdc_cut)) {
true_gap = o2::aod::sgselector::NoGap; // -1
else if ((FV0A > fit_cut[0] || FT0A > fit_cut[1] || ZNA > zdc_cut) && (FT0C <= fit_cut[2] && ZNC <= zdc_cut))
} else if ((FV0A > fit_cut[0] || FT0A > fit_cut[1] || ZNA > zdc_cut) && (FT0C <= fit_cut[2] && ZNC <= zdc_cut)) {
true_gap = o2::aod::sgselector::SingleGapC; // 1
else if ((FV0A <= fit_cut[0] && FT0A <= fit_cut[1] && ZNA <= zdc_cut) && (FT0C > fit_cut[2] || ZNC > zdc_cut))
} else if ((FV0A <= fit_cut[0] && FT0A <= fit_cut[1] && ZNA <= zdc_cut) && (FT0C > fit_cut[2] || ZNC > zdc_cut)) {
true_gap = o2::aod::sgselector::SingleGapA; // 0
else if (FV0A <= fit_cut[0] && FT0A <= fit_cut[1] && ZNA <= zdc_cut && FT0C <= fit_cut[2] && ZNC <= zdc_cut)
} else if (FV0A <= fit_cut[0] && FT0A <= fit_cut[1] && ZNA <= zdc_cut && FT0C <= fit_cut[2] && ZNC <= zdc_cut) {
true_gap = o2::aod::sgselector::DoubleGap; // 2
else
} else {
LOGF(info, "Something wrong with DG");
true_gap = o2::aod::sgselector::BadDoubleGap; // 5
}
}
return true_gap;
}
Expand Down
34 changes: 17 additions & 17 deletions PWGUD/TableProducer/SGCandProducer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,8 @@ struct SGCandProducer {

// Cross sections in ub. Using dummy -1 if lumi estimator is not reliable
float csTCE = 10.36e6;
float csZEM = 415.2e6; // see AN: https://alice-notes.web.cern.ch/node/1515
float csZNC = 214.5e6; // see AN: https://alice-notes.web.cern.ch/node/1515
const float csZEM = 415.2e6; // see AN: https://alice-notes.web.cern.ch/node/1515
const float csZNC = 214.5e6; // see AN: https://alice-notes.web.cern.ch/node/1515
if (runNumber > 543437 && runNumber < 543514) {
csTCE = 8.3e6;
}
Expand Down Expand Up @@ -326,14 +326,14 @@ struct SGCandProducer {
getHist(TH1, histdir + "/Stat")->Fill(8., 1.);

//
int trs = collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard) ? 1 : 0;
int trofs = collision.selection_bit(o2::aod::evsel::kNoCollInRofStandard) ? 1 : 0;
int hmpr = collision.selection_bit(o2::aod::evsel::kNoHighMultCollInPrevRof) ? 1 : 0;
int tfb = collision.selection_bit(o2::aod::evsel::kNoTimeFrameBorder) ? 1 : 0;
int itsROFb = collision.selection_bit(o2::aod::evsel::kNoITSROFrameBorder) ? 1 : 0;
int sbp = collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup) ? 1 : 0;
int zVtxFT0vPv = collision.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV) ? 1 : 0;
int vtxITSTPC = collision.selection_bit(o2::aod::evsel::kIsVertexITSTPC) ? 1 : 0;
const int trs = collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard) ? 1 : 0;
const int trofs = collision.selection_bit(o2::aod::evsel::kNoCollInRofStandard) ? 1 : 0;
const int hmpr = collision.selection_bit(o2::aod::evsel::kNoHighMultCollInPrevRof) ? 1 : 0;
const int tfb = collision.selection_bit(o2::aod::evsel::kNoTimeFrameBorder) ? 1 : 0;
const int itsROFb = collision.selection_bit(o2::aod::evsel::kNoITSROFrameBorder) ? 1 : 0;
const int sbp = collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup) ? 1 : 0;
const int zVtxFT0vPv = collision.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV) ? 1 : 0;
const int vtxITSTPC = collision.selection_bit(o2::aod::evsel::kIsVertexITSTPC) ? 1 : 0;
auto bc = collision.template foundBC_as<BCs>();
double ir = 0.;
const uint64_t ts = bc.timestamp();
Expand Down Expand Up @@ -363,14 +363,14 @@ struct SGCandProducer {
return;
}
upchelpers::FITInfo fitInfo{};
uint8_t chFT0A = 0;
uint8_t chFT0C = 0;
uint8_t chFDDA = 0;
uint8_t chFDDC = 0;
uint8_t chFV0A = 0;
int occ = collision.trackOccupancyInTimeRange();
const uint8_t chFT0A = 0;
const uint8_t chFT0C = 0;
const uint8_t chFDDA = 0;
const uint8_t chFDDC = 0;
const uint8_t chFV0A = 0;
const int occ = collision.trackOccupancyInTimeRange();
udhelpers::getFITinfo(fitInfo, newbc, bcs, ft0s, fv0as, fdds);
int upc_flag = (collision.flags() & dataformats::Vertex<o2::dataformats::TimeStamp<int>>::Flags::UPCMode) ? 1 : 0;
const int upc_flag = (collision.flags() & dataformats::Vertex<o2::dataformats::TimeStamp<int>>::Flags::UPCMode) ? 1 : 0;
// update SG candidates tables
outputCollisions(bc.globalBC(), bc.runNumber(),
collision.posX(), collision.posY(), collision.posZ(), upc_flag,
Expand Down
Loading
Loading