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
2 changes: 1 addition & 1 deletion ALICE3/Tools/handleParamTOFResoALICE3.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ int main(int argc, char* argv[])
const unsigned int mode = vm["mode"].as<unsigned int>();
const std::string path = vm["ccdb-path"].as<std::string>();
std::map<std::string, std::string> metadata;
std::map<std::string, std::string>* headers;
std::map<std::string, std::string>* headers = nullptr;
o2::ccdb::CcdbApi api;
const std::string url = vm["url"].as<std::string>();
api.init(url);
Expand Down
4 changes: 2 additions & 2 deletions Common/Core/EventMixing.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ static int getMixingBin(const T1& vtxBins, const T1& multBins, const T2& vtx, co
return -1;
}

for (int i = 1; i < vtxBins.size(); i++) {
for (unsigned int i = 1; i < vtxBins.size(); i++) {
if (vtx < vtxBins.at(i)) {
for (int j = 1; j < multBins.size(); j++) {
for (unsigned int j = 1; j < multBins.size(); j++) {
if (mult < multBins.at(j)) {
return i + j * (vtxBins.size() + 1);
}
Expand Down
12 changes: 6 additions & 6 deletions Common/TableProducer/eventSelection.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -431,25 +431,25 @@ struct EventSelectionTask {
int64_t foundFT0 = bc.foundFT0();

if (foundFT0 < 0) { // search in +/-4 sigma around meanBC
uint64_t apprBC = bc.globalBC();
uint64_t meanBC = apprBC - std::lround(col.collisionTime() / o2::constants::lhc::LHCBunchSpacingNS);
int64_t apprBC = bc.globalBC();
int64_t meanBC = apprBC - std::lround(col.collisionTime() / o2::constants::lhc::LHCBunchSpacingNS);
int64_t deltaBC = std::ceil(col.collisionTimeRes() / o2::constants::lhc::LHCBunchSpacingNS * 4);
// search forward
int forwardMoveCount = 0;
int64_t forwardBcDist = deltaBC + 1;
for (; bc != bcs.end() && bc.globalBC() - meanBC <= deltaBC; ++bc, ++forwardMoveCount) {
for (; bc != bcs.end() && apprBC - meanBC <= deltaBC; ++bc, ++forwardMoveCount) {
if (bc.foundFT0() >= 0) {
forwardBcDist = bc.globalBC() - meanBC;
forwardBcDist = apprBC - meanBC;
break;
}
}
bc.moveByIndex(-forwardMoveCount);
// search backward
int backwardMoveCount = 0;
int64_t backwardBcDist = deltaBC + 1;
for (; bc != bcs.begin() && bc.globalBC() - meanBC >= -deltaBC; --bc, --backwardMoveCount) {
for (; bc != bcs.begin() && apprBC - meanBC >= -deltaBC; --bc, --backwardMoveCount) {
if (bc.foundFT0() >= 0) {
backwardBcDist = meanBC - bc.globalBC();
backwardBcDist = meanBC - apprBC;
break;
}
}
Expand Down
2 changes: 1 addition & 1 deletion Common/Tools/handleParamTOFReso.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ int main(int argc, char* argv[])
const unsigned int mode = vm["mode"].as<unsigned int>();
const std::string path = vm["ccdb-path"].as<std::string>();
std::map<std::string, std::string> metadata;
std::map<std::string, std::string>* headers;
std::map<std::string, std::string>* headers = nullptr;
o2::ccdb::CcdbApi api;
const std::string url = vm["url"].as<std::string>();
api.init(url);
Expand Down
26 changes: 13 additions & 13 deletions PWGLF/TableProducer/cascadebuilder.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ struct cascadebuilder {
OutputObj<TH1F> hCascFiltered{TH1F("hCascFiltered", "", 15, 0, 15)};
OutputObj<TH1F> hCascCandidate{TH1F("hCascCandidate", "", 10, 0, 10)};

//Configurables
// Configurables
Configurable<double> d_bz{"d_bz", -5.0, "bz field"};
Configurable<bool> d_UseAbsDCA{"d_UseAbsDCA", true, "Use Abs DCAs"};

Expand All @@ -92,7 +92,7 @@ struct cascadebuilder {

void process(aod::MatchedV0Cascades const& MatchedV0Cascades, aod::V0Datas const&, aod::Cascades const&, aod::Collisions const&, soa::Join<aod::FullTracks, aod::TracksExtended> const&)
{
//Define o2 fitter, 2-prong
// Define o2 fitter, 2-prong
o2::vertexing::DCAFitterN<2> fitterV0, fitterCasc;
fitterV0.setBz(d_bz);
fitterV0.setPropagateToPCA(true);
Expand Down Expand Up @@ -120,19 +120,19 @@ struct cascadebuilder {

std::array<float, 3> pVtx = {v0.collision().posX(), v0.collision().posY(), v0.collision().posZ()};

auto b = casc.bachelor_as<FullTracksExt>();
// auto b = casc.bachelor_as<FullTracksExt>();

if (tpcrefit) {
if (!(v0.posTrack_as<FullTracksExt>().trackType() & o2::aod::track::TPCrefit)) {
continue; //TPC refit
continue; // TPC refit
}
hCascFiltered->Fill(1.5);
if (!(v0.negTrack_as<FullTracksExt>().trackType() & o2::aod::track::TPCrefit)) {
continue; //TPC refit
continue; // TPC refit
}
hCascFiltered->Fill(2.5);
if (!(casc.bachelor_as<FullTracksExt>().trackType() & o2::aod::track::TPCrefit)) {
continue; //TPC refit
continue; // TPC refit
}
hCascFiltered->Fill(3.5);
}
Expand Down Expand Up @@ -161,7 +161,7 @@ struct cascadebuilder {
}
hCascFiltered->Fill(9.5);

//V0 selections
// V0 selections
if (fabs(v0.mLambda() - 1.116) > lambdamasswindow && fabs(v0.mAntiLambda() - 1.116) > lambdamasswindow) {
continue;
}
Expand Down Expand Up @@ -192,7 +192,7 @@ struct cascadebuilder {

hCascCandidate->Fill(0.5);

//Acquire basic tracks
// Acquire basic tracks
auto pTrack = getTrackParCov(v0.posTrack_as<FullTracksExt>());
auto nTrack = getTrackParCov(v0.negTrack_as<FullTracksExt>());
auto bTrack = getTrackParCov(casc.bachelor_as<FullTracksExt>());
Expand All @@ -213,7 +213,7 @@ struct cascadebuilder {
std::array<float, 21> cov1 = {0};
std::array<float, 21> covV0 = {0};

//Covariance matrix calculation
// Covariance matrix calculation
const int momInd[6] = {9, 13, 14, 18, 19, 20}; // cov matrix elements for momentum component
fitterV0.getTrack(0).getPxPyPzGlo(pvecpos);
fitterV0.getTrack(1).getPxPyPzGlo(pvecneg);
Expand All @@ -235,7 +235,7 @@ struct cascadebuilder {
const std::array<float, 3> momentum = {pvecpos[0] + pvecneg[0], pvecpos[1] + pvecneg[1], pvecpos[2] + pvecneg[2]};

auto tV0 = o2::track::TrackParCov(vertex, momentum, covV0, 0);
tV0.setQ2Pt(0); //No bending, please
tV0.setQ2Pt(0); // No bending, please
int nCand2 = fitterCasc.process(tV0, bTrack);
if (nCand2 != 0) {
fitterCasc.propagateTracksToVertex();
Expand All @@ -245,9 +245,9 @@ struct cascadebuilder {
posXi[i] = cascvtx[i];
}
fitterCasc.getTrack(1).getPxPyPzGlo(pvecbach);
} //end if cascade recoed
} //end if v0 recoed
//Fill table, please
} // end if cascade recoed
} // end if v0 recoed
// Fill table, please
cascdata(
v0.globalIndex(),
casc.bachelor_as<FullTracksExt>().globalIndex(),
Expand Down
70 changes: 35 additions & 35 deletions PWGLF/TableProducer/cascadefinder.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ struct cascadeprefilter {
{
for (auto& t0 : goodPosTracks) {
if (!(t0.trackType() & o2::aod::track::TPCrefit)) {
continue; //TPC refit
continue; // TPC refit
}
if (t0.tpcNClsCrossedRows() < mincrossedrows) {
continue;
Expand All @@ -131,7 +131,7 @@ struct cascadeprefilter {
}
for (auto& t0 : goodNegTracks) {
if (!(t0.trackType() & o2::aod::track::TPCrefit)) {
continue; //TPC refit
continue; // TPC refit
}
if (t0.tpcNClsCrossedRows() < mincrossedrows) {
continue;
Expand Down Expand Up @@ -167,16 +167,16 @@ struct cascadefinder {

OutputObj<TH1F> hCandPerEvent{TH1F("hCandPerEvent", "", 100, 0, 100)};

//Configurables
// Configurables
Configurable<double> d_bz{"d_bz", +5.0, "bz field"};
Configurable<double> d_UseAbsDCA{"d_UseAbsDCA", kTRUE, "Use Abs DCAs"};

//Selection criteria
Configurable<double> v0cospa{"casccospa", 0.998, "Casc CosPA"}; //double -> N.B. dcos(x)/dx = 0 at x=0)
// Selection criteria
Configurable<double> v0cospa{"casccospa", 0.998, "Casc CosPA"}; // double -> N.B. dcos(x)/dx = 0 at x=0)
Configurable<float> dcav0dau{"dcacascdau", 1.0, "DCA Casc Daughters"};
Configurable<float> v0radius{"cascradius", 1.0, "cascradius"};

//Process: subscribes to a lot of things!
// Process: subscribes to a lot of things!
void process(aod::Collision const& collision,
soa::Join<aod::FullTracks, aod::TracksCov> const& tracks,
aod::V0Datas const& V0s,
Expand All @@ -185,7 +185,7 @@ struct cascadefinder {
aod::CascGoodPosTracks const& pBachtracks,
aod::CascGoodNegTracks const& nBachtracks)
{
//Define o2 fitter, 2-prong
// Define o2 fitter, 2-prong
o2::vertexing::DCAFitterN<2> fitterV0, fitterCasc;
fitterV0.setBz(d_bz);
fitterV0.setPropagateToPCA(true);
Expand All @@ -207,20 +207,20 @@ struct cascadefinder {

Long_t lNCand = 0;

std::array<float, 3> pVtx = {collision.posX(), collision.posY(), collision.posZ()};
// std::array<float, 3> pVtx = {collision.posX(), collision.posY(), collision.posZ()};
std::array<float, 3> pos = {0.};
std::array<float, 3> posXi = {0.};
std::array<float, 3> pvecpos = {0.};
std::array<float, 3> pvecneg = {0.};
std::array<float, 3> pvecbach = {0.};

//Cascades first
// Cascades first
for (auto& v0id : lambdas) {
//required: de-reference the tracks for cascade building
// required: de-reference the tracks for cascade building
auto v0 = v0id.goodLambda();
auto pTrack = getTrackParCov(v0.posTrack_as<soa::Join<aod::FullTracks, aod::TracksCov>>());
auto nTrack = getTrackParCov(v0.negTrack_as<soa::Join<aod::FullTracks, aod::TracksCov>>());
//Let's do the slow part first: the V0 recalculation from scratch
// Let's do the slow part first: the V0 recalculation from scratch
int nCand = fitterV0.process(pTrack, nTrack);
if (nCand != 0) {
fitterV0.propagateTracksToVertex();
Expand All @@ -233,7 +233,7 @@ struct cascadefinder {
std::array<float, 21> cov1 = {0};
std::array<float, 21> covV0 = {0};

//Covariance matrix calculation
// Covariance matrix calculation
const int momInd[6] = {9, 13, 14, 18, 19, 20}; // cov matrix elements for momentum component
fitterV0.getTrack(0).getPxPyPzGlo(pvecpos);
fitterV0.getTrack(1).getPxPyPzGlo(pvecneg);
Expand All @@ -255,7 +255,7 @@ struct cascadefinder {
const std::array<float, 3> momentum = {pvecpos[0] + pvecneg[0], pvecpos[1] + pvecneg[1], pvecpos[2] + pvecneg[2]};

auto tV0 = o2::track::TrackParCov(vertex, momentum, covV0, 0);
tV0.setQ2Pt(0); //No bending, please
tV0.setQ2Pt(0); // No bending, please

for (auto& t0id : nBachtracks) {
auto t0 = t0id.goodNegTrack_as<soa::Join<aod::FullTracks, aod::TracksCov>>();
Expand All @@ -271,7 +271,7 @@ struct cascadefinder {
fitterCasc.getTrack(1).getPxPyPzGlo(pvecbach);

lNCand++;
//If we got here, it means this is a good candidate!
// If we got here, it means this is a good candidate!
cascdata(v0.globalIndex(), v0.posTrack().globalIndex(), v0.negTrack().collisionId(),
-1, posXi[0], posXi[1], posXi[2], pos[0], pos[1], pos[2],
pvecpos[0], pvecpos[1], pvecpos[2],
Expand All @@ -281,18 +281,18 @@ struct cascadefinder {
v0.dcapostopv(),
v0.dcanegtopv(),
t0id.dcaXY());
} //end if cascade recoed
} //end loop over bachelor
} //end if v0 recoed
} //end loop over cascades
} // end if cascade recoed
} // end loop over bachelor
} // end if v0 recoed
} // end loop over cascades

//Anticascades
// Anticascades
for (auto& v0id : antiLambdas) {
//required: de-reference the tracks for cascade building
// required: de-reference the tracks for cascade building
auto v0 = v0id.goodAntiLambda();
auto pTrack = getTrackParCov(v0.posTrack_as<soa::Join<aod::FullTracks, aod::TracksCov>>());
auto nTrack = getTrackParCov(v0.negTrack_as<soa::Join<aod::FullTracks, aod::TracksCov>>());
//Let's do the slow part first: the V0 recalculation from scratch
// Let's do the slow part first: the V0 recalculation from scratch
int nCand = fitterV0.process(pTrack, nTrack);
if (nCand != 0) {
fitterV0.propagateTracksToVertex();
Expand All @@ -305,7 +305,7 @@ struct cascadefinder {
std::array<float, 21> cov1 = {0};
std::array<float, 21> covV0 = {0};

//Covariance matrix calculation
// Covariance matrix calculation
const int momInd[6] = {9, 13, 14, 18, 19, 20}; // cov matrix elements for momentum component
fitterV0.getTrack(0).getPxPyPzGlo(pvecpos);
fitterV0.getTrack(1).getPxPyPzGlo(pvecneg);
Expand All @@ -327,7 +327,7 @@ struct cascadefinder {
const std::array<float, 3> momentum = {pvecpos[0] + pvecneg[0], pvecpos[1] + pvecneg[1], pvecpos[2] + pvecneg[2]};

auto tV0 = o2::track::TrackParCov(vertex, momentum, covV0, 0);
tV0.setQ2Pt(0); //No bending, please
tV0.setQ2Pt(0); // No bending, please

for (auto& t0id : pBachtracks) {
auto t0 = t0id.goodPosTrack_as<soa::Join<aod::FullTracks, aod::TracksCov>>();
Expand All @@ -343,7 +343,7 @@ struct cascadefinder {
fitterCasc.getTrack(1).getPxPyPzGlo(pvecbach);

lNCand++;
//If we got here, it means this is a good candidate!
// If we got here, it means this is a good candidate!
cascdata(v0.globalIndex(), v0.posTrack().globalIndex(), v0.negTrack().collisionId(),
+1, posXi[0], posXi[1], posXi[2], pos[0], pos[1], pos[2],
pvecpos[0], pvecpos[1], pvecpos[2],
Expand All @@ -353,25 +353,25 @@ struct cascadefinder {
v0.dcapostopv(),
v0.dcanegtopv(),
t0id.dcaXY());
} //end if cascade recoed
} //end loop over bachelor
} //end if v0 recoed
} //end loop over anticascades
} // end if cascade recoed
} // end loop over bachelor
} // end if v0 recoed
} // end loop over anticascades

hCandPerEvent->Fill(lNCand);
}
};

struct cascadefinderQA {
//Basic checks
// Basic checks
OutputObj<TH3F> h3dMassXiMinus{TH3F("h3dMassXiMinus", "", 20, 0, 100, 200, 0, 10, 200, 1.322 - 0.100, 1.322 + 0.100)};
OutputObj<TH3F> h3dMassXiPlus{TH3F("h3dMassXiPlus", "", 20, 0, 100, 200, 0, 10, 200, 1.322 - 0.100, 1.322 + 0.100)};
OutputObj<TH3F> h3dMassOmegaMinus{TH3F("h3dMassOmegaMinus", "", 20, 0, 100, 200, 0, 10, 200, 1.672 - 0.100, 1.672 + 0.100)};
OutputObj<TH3F> h3dMassOmegaPlus{TH3F("h3dMassOmegaPlus", "", 20, 0, 100, 200, 0, 10, 200, 1.672 - 0.100, 1.672 + 0.100)};

//Selection criteria
Configurable<double> v0cospa{"v0cospa", 0.999, "V0 CosPA"}; //double -> N.B. dcos(x)/dx = 0 at x=0)
Configurable<double> casccospa{"casccospa", 0.999, "Casc CosPA"}; //double -> N.B. dcos(x)/dx = 0 at x=0)
// Selection criteria
Configurable<double> v0cospa{"v0cospa", 0.999, "V0 CosPA"}; // double -> N.B. dcos(x)/dx = 0 at x=0)
Configurable<double> casccospa{"casccospa", 0.999, "Casc CosPA"}; // double -> N.B. dcos(x)/dx = 0 at x=0)
Configurable<float> dcav0dau{"dcav0dau", 1.0, "DCA V0 Daughters"};
Configurable<float> dcacascdau{"dcacascdau", .3, "DCA Casc Daughters"};
Configurable<float> dcanegtopv{"dcanegtopv", .1, "DCA Neg To PV"};
Expand All @@ -387,7 +387,7 @@ struct cascadefinderQA {
aod::cascdata::dcabachtopv > dcabachtopv&&
aod::cascdata::dcaV0daughters < dcav0dau&& aod::cascdata::dcacascdaughters < dcacascdau;

///Connect to CascFinderData: newly indexed, note: CascDataExt table incompatible with standard V0 table!
/// Connect to CascFinderData: newly indexed, note: CascDataExt table incompatible with standard V0 table!
void process(soa::Join<aod::Collisions, aod::EvSels, aod::CentV0Ms>::iterator const& collision, soa::Filtered<aod::CascDataExt> const& Cascades)
{
if (!collision.alias()[kINT7]) {
Expand All @@ -397,13 +397,13 @@ struct cascadefinderQA {
return;
}
for (auto& casc : Cascades) {
//FIXME: dynamic columns cannot be filtered on?
// FIXME: dynamic columns cannot be filtered on?
if (casc.v0radius() > v0radius &&
casc.cascradius() > cascradius &&
casc.v0cosPA(collision.posX(), collision.posY(), collision.posZ()) > v0cospa &&
casc.casccosPA(collision.posX(), collision.posY(), collision.posZ()) > casccospa &&
casc.dcav0topv(collision.posX(), collision.posY(), collision.posZ()) > dcav0topv) {
if (casc.sign() < 0) { //FIXME: could be done better...
if (casc.sign() < 0) { // FIXME: could be done better...
if (TMath::Abs(casc.yXi()) < 0.5) {
h3dMassXiMinus->Fill(collision.centV0M(), casc.pt(), casc.mXi());
}
Expand Down
Loading