Skip to content

Commit

Permalink
Merge branch 'AliceO2Group:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
bghanley1995 authored Mar 29, 2024
2 parents 43a20c9 + 13388af commit 580b854
Show file tree
Hide file tree
Showing 78 changed files with 2,130 additions and 684 deletions.
30 changes: 27 additions & 3 deletions Common/Core/trackUtilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@
///
/// \author Vít Kučera <[email protected]>, CERN

#ifndef O2_ANALYSIS_TRACKUTILITIES_H_
#define O2_ANALYSIS_TRACKUTILITIES_H_
#ifndef COMMON_CORE_TRACKUTILITIES_H_
#define COMMON_CORE_TRACKUTILITIES_H_

#include <utility> // std::move
#include "CommonConstants/MathConstants.h"
#include "ReconstructionDataFormats/Track.h"
#include "ReconstructionDataFormats/Vertex.h"
#include "Common/Core/RecoDecay.h"
Expand Down Expand Up @@ -128,4 +130,26 @@ void getPxPyPz(T const& trackPars, U& pVec)
pVec[2] = pt * trackPars.getTgl();
}

#endif // O2_ANALYSIS_TRACKUTILITIES_H_
/// Calculates DCA XYZ of a track w.r.t. the primary vertex and its uncertainty if required.
/// \param track track from a table containing `o2::aod::TracksCov, o2::aod::TracksDCA`.
/// \param sigmaDcaXYZ2 pointer to the sigma^2 of the impact parameter in XYZ to be calculated
/// \return impact parameter in XYZ of the track w.r.t the primary vertex
template <typename T>
float getDcaXYZ(T const& track, float* sigmaDcaXYZ2 = nullptr)
{
float dcaXY = track.dcaXY();
float dcaZ = track.dcaZ();
float dcaXYZ = std::sqrt(dcaXY * dcaXY + dcaZ * dcaZ);
if (sigmaDcaXYZ2) {
if (dcaXYZ < o2::constants::math::Almost0) {
*sigmaDcaXYZ2 = o2::constants::math::VeryBig; // Protection against division by zero
} else {
float dFdxy = 2.f * dcaXY / dcaXYZ;
float dFdz = 2.f * dcaZ / dcaXYZ;
*sigmaDcaXYZ2 = track.cYY() * dFdxy * dFdxy + track.cZZ() * dFdz * dFdz + 2.f * track.cZY() * dFdxy * dFdz;
}
}
return dcaXYZ;
}

#endif // COMMON_CORE_TRACKUTILITIES_H_
6 changes: 3 additions & 3 deletions Common/TableProducer/qVectorsTable.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ struct qVectorsTable {
struct : ConfigurableGroup {
Configurable<std::string> cfgURL{"cfgURL",
"http://alice-ccdb.cern.ch", "Address of the CCDB to browse"};
Configurable<int> nolaterthan{"ccdb-no-later-than",
std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count(),
"Latest acceptable timestamp of creation for the object"};
Configurable<int64_t> nolaterthan{"ccdb-no-later-than",
std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count(),
"Latest acceptable timestamp of creation for the object"};
} cfgCcdbParam;

Configurable<int> cfgCentEsti{"cfgCentEsti",
Expand Down
14 changes: 7 additions & 7 deletions Common/Tasks/ft0Qa.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ struct ft0QaTask {

histos.fill(HIST("hBcCounterAll"), 1);

float multFV0A = 0.f;
// float multFV0A = 0.f;
float multFT0A = 0.f;
float multFT0C = 0.f;
float multFT0M = 0.f;
Expand Down Expand Up @@ -503,12 +503,12 @@ struct ft0QaTask {
}
}

if (bc.has_fv0a()) {
auto fv0a = bc.fv0a();
for (auto amplitude : fv0a.amplitude()) {
multFV0A += amplitude;
}
}
// if (bc.has_fv0a()) {
// auto fv0a = bc.fv0a();
// for (auto amplitude : fv0a.amplitude()) {
// multFV0A += amplitude;
// }
// }
}
PROCESS_SWITCH(ft0QaTask, processBCs, "per-BC analysis", true);

Expand Down
56 changes: 54 additions & 2 deletions DPG/Tasks/AOTEvent/lumiQa.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#include "Framework/AnalysisDataModel.h"
#include "CCDB/BasicCCDBManager.h"
#include "Framework/HistogramRegistry.h"
#include "DataFormatsParameters/GRPLHCIFData.h"
#include "DataFormatsFT0/Digit.h"
#include "TList.h"
#include "TH1.h"

Expand All @@ -26,39 +28,89 @@ struct LumiQaTask {
HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject};
int lastRunNumber = -1;
TH1* hCalibT0C = nullptr;
static const int nBCsPerOrbit = o2::constants::lhc::LHCMaxBunches;
std::bitset<nBCsPerOrbit> bcPatternB;

void init(InitContext&)
{
ccdb->setURL("http://alice-ccdb.cern.ch");
ccdb->setCaching(true);
ccdb->setLocalObjectValidityChecking();
const AxisSpec axisMultT0C{1000, 0., 70000., "T0C multiplicity"};
const AxisSpec axisCentT0C{1000, 0., 100., "T0C centrality"};
const AxisSpec axisCentT0C{100, 0., 100., "T0C centrality"};
histos.add("hMultT0C", "", kTH1F, {axisMultT0C});
histos.add("hCentT0C", "", kTH1F, {axisCentT0C});
histos.add("hMultT0CselTCE", "", kTH1F, {axisMultT0C});
histos.add("hCentT0CselTCE", "", kTH1F, {axisCentT0C});
histos.add("hMultT0CselTVXTCE", "", kTH1F, {axisMultT0C});
histos.add("hCentT0CselTVXTCE", "", kTH1F, {axisCentT0C});
histos.add("hMultT0CselTVXTCEB", "", kTH1F, {axisMultT0C});
histos.add("hCentT0CselTVXTCEB", "", kTH1F, {axisCentT0C});

histos.add("hCounterTCE", "", kTH1D, {{1, 0., 1.}});
histos.add("hCounterZNC", "", kTH1D, {{1, 0., 1.}});
histos.add("hCounterZEM", "", kTH1D, {{1, 0., 1.}});
}

void process(BCsRun3 const& bcs, aod::Zdcs const& zdcs, aod::FT0s const& ft0s)
{
int runNumber = bcs.iteratorAt(0).runNumber();
LOGP(info, "runNumber={}", runNumber);
const char* srun = Form("%d", runNumber);

if (runNumber != lastRunNumber) {
TList* callst = ccdb->getForTimeStamp<TList>("Centrality/Estimators", bcs.iteratorAt(0).timestamp());
lastRunNumber = runNumber;
int64_t ts = bcs.iteratorAt(0).timestamp();

auto grplhcif = ccdb->getForTimeStamp<o2::parameters::GRPLHCIFData>("GLO/Config/GRPLHCIF", ts);
bcPatternB = grplhcif->getBunchFilling().getBCPattern();

TList* callst = ccdb->getForTimeStamp<TList>("Centrality/Estimators", ts);
hCalibT0C = reinterpret_cast<TH1*>(callst->FindObject("hCalibZeqFT0C"));
}
if (!hCalibT0C) {
return;
}

for (const auto& bc : bcs) {
if (bc.has_zdc()) {
float timeZNA = bc.zdc().timeZNA();
float timeZNC = bc.zdc().timeZNC();
if (fabs(timeZNC) < 2) {
histos.get<TH1>(HIST("hCounterZNC"))->Fill(srun, 1);
}
if (fabs(timeZNA) < 2 || fabs(timeZNC) < 2) {
histos.get<TH1>(HIST("hCounterZEM"))->Fill(srun, 1);
}
}

if (!bc.has_ft0()) {
continue;
}
float multT0C = bc.ft0().sumAmpC();
float centT0C = hCalibT0C->GetBinContent(hCalibT0C->FindFixBin(multT0C));
histos.fill(HIST("hMultT0C"), multT0C);
histos.fill(HIST("hCentT0C"), centT0C);

if (!TESTBIT(bc.ft0().triggerMask(), o2::ft0::Triggers::bitCen)) { // TCE
continue;
}
histos.fill(HIST("hMultT0CselTCE"), multT0C);
histos.fill(HIST("hCentT0CselTCE"), centT0C);

if (!TESTBIT(bc.ft0().triggerMask(), o2::ft0::Triggers::bitVertex)) { // TVX
continue;
}
histos.fill(HIST("hMultT0CselTVXTCE"), multT0C);
histos.fill(HIST("hCentT0CselTVXTCE"), centT0C);

if (!bcPatternB[bc.globalBC() % nBCsPerOrbit]) { // B-mask
continue;
}
histos.fill(HIST("hMultT0CselTVXTCEB"), multT0C);
histos.fill(HIST("hCentT0CselTVXTCEB"), centT0C);

histos.get<TH1>(HIST("hCounterTCE"))->Fill(srun, 1);
}
}
};
Expand Down
4 changes: 2 additions & 2 deletions EventFiltering/PWGHF/HFFilter.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ struct HfFilter { // Main struct for HF triggers
helper.setPtDeltaMassRangeSigmaC(cutsPtDeltaMassCharmReso->get(0u, 6u), cutsPtDeltaMassCharmReso->get(1u, 6u), cutsPtDeltaMassCharmReso->get(0u, 7u), cutsPtDeltaMassCharmReso->get(1u, 7u), cutsPtDeltaMassCharmReso->get(2u, 6u), cutsPtDeltaMassCharmReso->get(2u, 7u));
helper.setPtRangeSoftKaonXicResoToSigmaC(ptCuts->get(0u, 5u), ptCuts->get(1u, 5u));

hProcessedEvents = registry.add<TH1>("fProcessedEvents", "HF - event filtered;;counts", HistType::kTH1F, {{kNtriggersHF + 2, -0.5, kNtriggersHF + 1.5}});
hProcessedEvents = registry.add<TH1>("fProcessedEvents", "HF - event filtered;;counts", HistType::kTH1F, {{kNtriggersHF + 2, -0.5, +kNtriggersHF + 1.5}});
for (auto iBin = 0; iBin < kNtriggersHF + 2; ++iBin) {
hProcessedEvents->GetXaxis()->SetBinLabel(iBin + 1, eventTitles[iBin].data());
}
Expand Down Expand Up @@ -252,7 +252,7 @@ struct HfFilter { // Main struct for HF triggers
if (activateQA > 1) {
hProtonTPCPID = registry.add<TH2>("fProtonTPCPID", "#it{N}_{#sigma}^{TPC} vs. #it{p} for selected protons;#it{p} (GeV/#it{c});#it{N}_{#sigma}^{TPC}", HistType::kTH2F, {pAxis, nSigmaAxis});
hProtonTOFPID = registry.add<TH2>("fProtonTOFPID", "#it{N}_{#sigma}^{TOF} vs. #it{p} for selected protons;#it{p} (GeV/#it{c});#it{N}_{#sigma}^{TOF}", HistType::kTH2F, {pAxis, nSigmaAxis});
hV0Selected = registry.add<TH2>("fV0Selected", "Selections for V0s;;counts", HistType::kTH2F, {{10, -0.5, 9.5}, {kNV0, -0.5, kNV0 - 0.5}});
hV0Selected = registry.add<TH2>("fV0Selected", "Selections for V0s;;counts", HistType::kTH2F, {{10, -0.5, 9.5}, {kNV0, -0.5, +kNV0 - 0.5}});

for (int iV0{kPhoton}; iV0 < kNV0; ++iV0) {
hV0Selected->GetYaxis()->SetBinLabel(iV0 + 1, v0Labels[iV0].data());
Expand Down
2 changes: 1 addition & 1 deletion EventFiltering/PWGJE/fullJetFilter.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ struct fullJetFilter {
Float_t kMinEta = -1.;
Float_t kMaxEta = 1.;

hProcessedEvents.setObject(new TH1D("hProcessedEvents", ";;Number of filtered events", kCategories, -0.5, kCategories - 0.5));
hProcessedEvents.setObject(new TH1D("hProcessedEvents", ";;Number of filtered events", kCategories, -0.5, +kCategories - 0.5));

hEmcClusterPtEta.setObject(new TH2F("hEmcClusterPtEta", Form("Emc Clusters;%s;#eta", (f_ObservalbeGammaTrigger == 0) ? "E (GeV)" : "#it{p}_{T}"), nPtBins, kMinPt, kMaxPt / 2, nEtaBins, kMinEta, kMaxEta));
hEmcClusterPtPhi.setObject(new TH2F("hEmcClusterPtPhi", Form("Emc Clusters;%s;#phi", (f_ObservalbeGammaTrigger == 0) ? "E (GeV)" : "#it{p}_{T}"), nPtBins, kMinPt, kMaxPt / 2, nPhiBins, kMinPhi, kMaxPhi));
Expand Down
2 changes: 1 addition & 1 deletion EventFiltering/PWGJE/jetFilter.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ struct jetFilter {

auto scalers{std::get<std::shared_ptr<TH1>>(spectra.add(
"fProcessedEvents", ";;Number of filtered events", HistType::kTH1F,
{{kAllObjects, -0.5, kAllObjects - 0.5}}))};
{{kAllObjects, -0.5, +kAllObjects - 0.5}}))};
for (uint32_t iS{1}; iS <= highPtObjectsNames.size(); ++iS) {
scalers->GetXaxis()->SetBinLabel(iS, highPtObjectsNames[iS - 1].data());
}
Expand Down
4 changes: 2 additions & 2 deletions EventFiltering/PWGLF/strangenessFilter.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ struct strangenessFilter {
int omegacounter = 0;
int omegalargeRcounter = 0;
int triggcounterForEstimates = 0;
int triggcounter = 0;
// int triggcounter = 0;

for (auto& casc : fullCasc) { // loop over cascades
triggcounterForEstimates = 0;
Expand Down Expand Up @@ -593,7 +593,7 @@ struct strangenessFilter {
if (isTrackFilter && !mTrackSelector.IsSelected(track)) {
continue;
}
triggcounter++;
// triggcounter++;
keepEvent[1] = true;
} // end loop over tracks
}
Expand Down
4 changes: 2 additions & 2 deletions EventFiltering/cefpTask.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ struct centralEventFilterTask {

int64_t nEvents{collTabPtr->num_rows()};
std::vector<uint64_t> outTrigger, outDecision;
int64_t nSelected{0};
// int64_t nSelected{0};
for (auto& tableName : mDownscaling) {
if (!pc.inputs().isValid(tableName.first)) {
LOG(fatal) << tableName.first << " table is not valid.";
Expand Down Expand Up @@ -382,7 +382,7 @@ struct centralEventFilterTask {
if (mUniformGenerator(mGeneratorEngine) < downscaling) {
mFiltered->Fill(binCenter);
outDecision[entry] |= triggerBit;
nSelected++;
// nSelected++;
}
}
entry++;
Expand Down
8 changes: 4 additions & 4 deletions PWGCF/EbyEFluctuations/Tasks/IdentifiedMeanPtFluctuations.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -254,10 +254,10 @@ struct IdentifiedMeanPtFluctuations {
double Q1pi = 0, Q2pi = 0;
double Q1k = 0, Q2k = 0;
double Q1p = 0, Q2p = 0;
double var1, var2, twopar_allcharge;
double var1pi, var2pi;
double var1k, var2k;
double var1p, var2p;
double var1 = 0, var2 = 0, twopar_allcharge = 0;
double var1pi = 0, var2pi = 0;
double var1k = 0, var2k = 0;
double var1p = 0, var2p = 0;
// cent = 0;

// sampling
Expand Down
Loading

0 comments on commit 580b854

Please sign in to comment.