Skip to content

Conversation

@sofiatomassini
Copy link
Contributor

@github-actions
Copy link

This PR has not been updated in the last 30 days. Is it still needed? Unless further action is taken, it will be closed in 5 days.

@github-actions github-actions bot added the stale label Jul 31, 2023
Copy link
Collaborator

@victor-gonzalez victor-gonzalez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for bringing this functionality forward!!!

Apart from my in place suggested changes there is an overall structure which you have to follow.

At least for the time being, this is going to become the Femto3D framework if I'm not too wrong. Not quite sure if Femto3D is enough representative of the analyses that you will carry but for illustration purposes I will use this name. If you decide something more representative just use it instead of Femto3D.

You will need to place your code in a new directory which you will create as

O2Physics/PWGCF/Femto3D

then you have to modify the O2Physics/PWGCF/CMakeLists.txt to include your new sub-directory in the build tree.

Your sub-directory has to have the same structure as the own PWGCF. You can check the structure and replicate it by looking at the O2Physics/PWGCF/TwoParticleCorrelations or at the O2Physics/PWGCF/MultiparticleCorrelations sub-directories.

Pay special attention to the CMakeLists.txt files that you have to incorporate in each of the sub-directories that you will create. You can copy them from any of the two suggested sub-directories and modify them according to your needs/filenames.

The way to place your files in your new sub-directory structure is the same that you chose for them at the PWGCF level but now at the PWGCF/Femto3D level.

Comment on lines 49 to 68
template <typename binningType>
typename binningType::binned_t packInTableInt(const float& valueToBin)
{
if (valueToBin <= binningType::binned_min) {
return binningType::underflowBin;
} else if (valueToBin >= binningType::binned_max) {
return binningType::overflowBin;
} else {
// return static_cast<typename binningType::binned_t>(valueToBin / binningType::bin_width);
return static_cast<typename binningType::binned_t>(((valueToBin - (binningType::binned_max - binningType::binned_min) * 0.5) / binningType::bin_width));
}
}

template <typename binningType>
float unPackInt(const typename binningType::binned_t& b)
{
// return static_cast<float>(binningType::bin_width * b);
return static_cast<float>((binningType::binned_max - binningType::binned_min) * 0.5 + binningType::bin_width * b);
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't replicate code just because you have a different type, introduce an additional templating

Comment on lines 28 to 49
template <typename binningType>
typename binningType::binned_t packInTable(const float& valueToBin)
{
if (valueToBin <= binningType::binned_min) {
return binningType::underflowBin;
} else if (valueToBin >= binningType::binned_max) {
return binningType::overflowBin;
} else {
return static_cast<typename binningType::binned_t>(valueToBin / binningType::bin_width);
// return static_cast<typename binningType::binned_t>(((valueToBin - (binningType::binned_max - binningType::binned_min) * 0.5) / binningType::bin_width));
}
}

template <typename binningType>
float unPack(const typename binningType::binned_t& b)
{
return static_cast<float>(binningType::bin_width * b);

// return static_cast<float>((binningType::binned_max - binningType::binned_min) * 0.5 + binningType::bin_width * b);
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general you don't need to replicate code that has been used in other parts of O2 unless you need an additional functionality which is not there
This code has been developed by the PID team and you are free to reuse it without the need to replicate here
Just use it with the proper includes and namespaces

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed this is true but this is not completely the same, as we changed the strategy to pack and unpack. We also changed the binning and this was the rationale

Comment on lines 83 to 112
namespace storedcrossedrows
{
struct binning {
public:
typedef int8_t binned_t;
// static constexpr int nbins = 160;
//(1 << 8 * sizeof(binned_t)) - 2;
static constexpr int nbins = (1 << 8 * sizeof(binned_t)) - 2;
static constexpr binned_t overflowBin = nbins >> 1;
static constexpr binned_t underflowBin = -(nbins >> 1);
static constexpr float binned_max = 253.5;
static constexpr float binned_min = -0.5;
static constexpr float bin_width = (binned_max - binned_min) / nbins;
};
} // namespace storedcrossedrows

namespace nsigma
{
struct binning {
public:
typedef int8_t binned_t;
static constexpr int nbins = (1 << 8 * sizeof(binned_t)) - 2;
static constexpr binned_t overflowBin = nbins >> 1;
static constexpr binned_t underflowBin = -(nbins >> 1);
static constexpr float binned_max = 10.0;
static constexpr float binned_min = -10.0;
static constexpr float bin_width = (binned_max - binned_min) / nbins;
};
} // namespace nsigma
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same comment of reusing code and not replicate it
Replicating code is error prone

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for spotting this, indeed we changed the binning in order to have greater granularity. The function is different from the one reported in PIDResponse.h We changed the name to better reflect the functionality of the function

Comment on lines 113 to 151
DECLARE_SOA_INDEX_COLUMN(Collision, collision); // Index to the collision
DECLARE_SOA_COLUMN(Px, px, float); // Momentum of the track
DECLARE_SOA_COLUMN(Py, py, float); // Momentum of the track
DECLARE_SOA_COLUMN(Pz, pz, float); // Momentum of the track
DECLARE_SOA_COLUMN(P, p, float); // Momentum of the track
DECLARE_SOA_COLUMN(Pt, pt, float); // Momentum of the track
// DECLARE_SOA_COLUMN(PosZ, posZ, float); // vertex position along z
DECLARE_SOA_COLUMN(DcaXY, dcaXY, float); // impact parameter of the track
DECLARE_SOA_COLUMN(DcaZ, dcaZ, float); // impact parameter of the track
DECLARE_SOA_COLUMN(TPCNClsFound, tpcNClsFound, float); // Number of TPC clusters
DECLARE_SOA_COLUMN(TPCChi2NCl, tpcChi2NCl, float); // TPC chi2
DECLARE_SOA_COLUMN(ITSNCls, itsNCls, float); // Number of ITS clusters
DECLARE_SOA_COLUMN(ITSChi2NCl, itsChi2NCl, float); // ITS chi2
DECLARE_SOA_COLUMN(Eta, eta, float);
DECLARE_SOA_COLUMN(Phi, phi, float);
DECLARE_SOA_COLUMN(StoredCrossedRows, storedCrossedRows, storedcrossedrows::binning::binned_t);
DECLARE_SOA_COLUMN(StoredTOFNSigmaPr, storedTofNSigmaPr, nsigma::binning::binned_t);
DECLARE_SOA_COLUMN(StoredTPCNSigmaPr, storedTpcNSigmaPr, nsigma::binning::binned_t);
DECLARE_SOA_COLUMN(StoredTOFNSigmaDe, storedTofNSigmaDe, nsigma::binning::binned_t);
DECLARE_SOA_COLUMN(StoredTPCNSigmaDe, storedTpcNSigmaDe, nsigma::binning::binned_t);

DECLARE_SOA_DYNAMIC_COLUMN(CrossedRows, tpcNClsCrossedRows,
[](storedcrossedrows::binning::binned_t binned) -> float { return singletrackselector::unPackInt<storedcrossedrows::binning>(binned); });
DECLARE_SOA_DYNAMIC_COLUMN(TOFNSigmaPr, tofNSigmaPr,
[](nsigma::binning::binned_t nsigma_binned) -> float { return singletrackselector::unPack<nsigma::binning>(nsigma_binned); });
DECLARE_SOA_DYNAMIC_COLUMN(TPCNSigmaPr, tpcNSigmaPr,
[](nsigma::binning::binned_t nsigma_binned) -> float { return singletrackselector::unPack<nsigma::binning>(nsigma_binned); });
DECLARE_SOA_DYNAMIC_COLUMN(TOFNSigmaDe, tofNSigmaDe,
[](nsigma::binning::binned_t nsigma_binned) -> float { return singletrackselector::unPack<nsigma::binning>(nsigma_binned); });
DECLARE_SOA_DYNAMIC_COLUMN(TPCNSigmaDe, tpcNSigmaDe,
[](nsigma::binning::binned_t nsigma_binned) -> float { return singletrackselector::unPack<nsigma::binning>(nsigma_binned); });

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need to define again the columns that have been defined somewhere else in O2/O2Physics
For instance you need to define the Px column if you plan to create a derived table which will store Px because the already defined Px column is dynamic. But for instance for the DCAz or the DCAxy columns they are already defined and you can use them as columns in your own tables, if you need them, without the need of re-defining and suggesting that they have a different information.
Have in mind that as you will get the information from tables with the already defined columns you will have the full structure of includes to use the already defined columns as columns of your own tables

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most probably the same can be applied to your columns with PID information

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for spotting this, you have a good point, however, the strategy here is to store px, py and pz and derived p and pT from them as dynamic columns. This is different with what used centrally (where px py and pz are dynamic). For the PID the binning is different and we decided to keep greater granularity

Comment on lines 69 to 82
// Function to pack a float into a binned value in table
template <typename binningType>
typename binningType::binned_t packInTable(const float& valueToBin)
{
if (valueToBin <= binningType::binned_min) {
return binningType::underflowBin;
} else if (valueToBin >= binningType::binned_max) {
return binningType::overflowBin;
} else if (valueToBin >= 0) {
return static_cast<typename binningType::binned_t>((valueToBin / binningType::bin_width) + 0.5f);
} else {
return static_cast<typename binningType::binned_t>((valueToBin / binningType::bin_width) - 0.5f);
}*/
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't leave code commented

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, we removed the commented part

singletrackselector::packInTable<singletrackselector::nsigma::binning>(track.tpcNSigmaDe()));

if ((singletrackselector::unPackInt<singletrackselector::storedcrossedrows::binning>(singletrackselector::packInTableInt<singletrackselector::storedcrossedrows::binning>(track.tpcNClsCrossedRows())) != track.tpcNClsCrossedRows()) && (singletrackselector::unPackInt<singletrackselector::storedcrossedrows::binning>(singletrackselector::packInTableInt<singletrackselector::storedcrossedrows::binning>(track.tpcNClsCrossedRows())) != (track.tpcNClsCrossedRows() - 1))) {
LOG(info) << "crossedRows: " << track.tpcNClsCrossedRows()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check that this log will not be invoked too often

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We removed the log

if ((singletrackselector::unPackInt<singletrackselector::storedcrossedrows::binning>(singletrackselector::packInTableInt<singletrackselector::storedcrossedrows::binning>(track.tpcNClsCrossedRows())) != track.tpcNClsCrossedRows()) && (singletrackselector::unPackInt<singletrackselector::storedcrossedrows::binning>(singletrackselector::packInTableInt<singletrackselector::storedcrossedrows::binning>(track.tpcNClsCrossedRows())) != (track.tpcNClsCrossedRows() - 1))) {
LOG(info) << "crossedRows: " << track.tpcNClsCrossedRows()
<< ", Unpacked crossedRows: " << singletrackselector::unPackInt<singletrackselector::storedcrossedrows::binning>(singletrackselector::packInTableInt<singletrackselector::storedcrossedrows::binning>(track.tpcNClsCrossedRows()));
// << "deve essere uguale a" << singletrackselector::unPack<singletrackselector::nsigma::binning>;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, don't leave code commented

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment on lines 95 to 96
// LOG(info) << "UnPacked crossedRows: " << singletrackselector::unPack(o2::aod::singletrackselector::storedcrossedrows::binning::binned_t(o2::aod::singletrackselector::storedcrossedrows::binning(tpcNClsCrossedRows)) )
// LOG(info) << "Unpacked crossedRows: " << unpackedValue;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, don't leave code commented

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment on lines 47 to 141
/*
if (doprocessStandard == true) {
registry.add("eta", "eta", kTH1F, {{102, -2.01, 2.01, "eta"}}); //
registry.add("phi", "phi", kTH1F, {{100, 0., 2. * M_PI, "phi"}}); //
registry.add("pt", "pt", kTH1F, {{100, 0., 5.0, "pt"}}); //
registry.add("NsigmaTPC", "NsigmaTPC", kTH2F, {{100, 0., 5.0, "pt"}, {100, -5., 5.0, "nsigmaTPC"}}); //
registry.add("dEdxTPC", "dEdxTPC", kTH2F, {{200, 0., 5.0}, {1000, 0., 1000.0}});
registry.add("dEdxTPCinner", "dEdxTPCinner", kTH2F, {{200, 0., 5.0}, {1000, 0., 1000.0}});
registry.add("TOFSignal", "TOFSignal", kTH2F, {{200, 0., 5.0}, {100, 0., 1.5}});
registry.add("NsigmaTOF_p", "NsigmaTOF_p", kTH2F, {{100, 0., 5.0}, {100, -5., 5.0}});
registry.add("NsigmaTPCvsTOF", "n#sigma_{TPC}; n#sigma_{TOF}", kTH2F, {{100, -5., 5.}, {100, -5., 5.}}); // protons
// registry.add("NsigmaTPCvsTOF^2", "n#sigma_{TPC}; n#sigma_{TOF}", kTH2F, {{100, 0., 2}, {100, 0., 2.}}); // protons^2
registry.add("NsigmaTOF_K", "NsigmaTOF_K", kTH2F, {{100, 0., 5.0}, {100, -5., 5.0}}); // Kaons
registry.add("NsigmaTPC_K", "NsigmaTPC_K", kTH2F, {{100, 0., 5.0}, {100, -5., 5.0}}); // Kaons
registry.add("DCAxy", "#DCAxy", kTH1F, {{100, -0.2, 0.2}});
registry.add("DCAz", "#DCAz", kTH1F, {{100, -0.2, 0.2}});
registry.add("DCAxyvspt", "#DCAxyvspt", kTH2F, {{100, 0., 5.0}, {100, -0.2, 0.2}});
registry.add("DCAzvspt", "#DCAzvspt", kTH2F, {{100, 0., 5.0}, {100, -0.2, 0.2}});
registry.add("TPC_yess", "TPC_yess", kTH1F, {{100, 0., 20.}});
registry.add("TPC_yess_eta", "TPC_yess_eta", kTH2F, {{100, 0., 20.0}, {200, -1., 1.}});
//{"TOF_yess", "TOF_yess", {HistType::kTH1F, {{100, 0., 10.0}});
registry.add("TPCandTOF", "TPCandTOF", kTH1F, {{100, 0., 20.0}});
registry.add("TPCandTOF_eta", "TPCandTOF_eta", kTH2F, {{100, 0., 20.0}, {200, -1., 1.}});
registry.add("hcrossedrows", ";track crossed rows;entries", kTH1F, {{160, -0.5, 159.5}});
registry.add("charge_pt", "charge_pt", kTH2F, {{100, 0., 10.}, {10, -1.5, 1.5}});
registry.add("charge", "charge", kTH1F, {{100, -1.5, 1.5}});
registry.add("NsigmaTPC_d", "NsigmaTPC_d", kTH2F, {{100, 0., 5.0}, {100, -5., 5.0}});
registry.add("NsigmaTOF_d", "NsigmaTOF_d", kTH2F, {{100, 0., 5.0}, {100, -5., 5.0}});
registry.add("TOFSignalpr", ";TOFSignalpr", kTH2F, {{100, 0., 5.0}, {1000, 0., 1000.}});
registry.add("TOFSignalK", "TOFSignalK", kTH2F, {{1000, 0., 5.0}, {1000, 0, 1000.}});
registry.add("TOFSignald", "TOFSignald", kTH2F, {{1000, 0., 5.0}, {1000, 0., 1000.}});
//{"separation_pk", "separation_pk", {HistType::kTH2F,{{100, 0., 5.}, {}}}}
//
// definisco di nuovo gli stessi istogrammi ma _cut
registry.add("eta_cut", "#eta", kTH1F, {{102, -2.01, 2.01}}); //
registry.add("phi_cut", "#varphi", kTH1F, {{100, 0., 2. * M_PI}}); //
registry.add("pt_cut", "pt", kTH1F, {{100, 0., 5.0}}); //
registry.add("NsigmaTPC_cut", "NsigmaTPC_cut", kTH2F, {{100, 0., 5.0}, {100, -5., 5.0}}); //
registry.add("dEdxTPC_cut", "dEdxTPC_cut", kTH2F, {{200, 0., 5.0}, {1000, 0., 1000.0}});
registry.add("dEdxTPCinner_cut", "dEdxTPCinner_cut", kTH2F, {{200, 0., 5.0}, {1000, 0., 1000.0}});
registry.add("TOFSignal_cut", "TOFSignal_cut", kTH2F, {{200, 0., 5.0}, {100, 0., 1.5}});
registry.add("NsigmaTOF_p_cut", "NsigmaTOF_p_cut", kTH2F, {{100, 0., 5.0}, {100, -5., 5.0}}),
registry.add("NsigmaTPCvsTOF_cut", "n#sigma_{TPC}; n#sigma_{TOF}", kTH2F, {{100, -5., 5.}, {100, -5., 5.}}); // protons
// registry.add("NsigmaTPCvsTOF^2_cut", "n#sigma_{TPC}; n#sigma_{TOF}", kTH2F, {{100, 0., 2.}, {100, 0., 2.}}); // protons^2
registry.add("NsigmaTOF_K_cut", "NsigmaTOF_K_cut", kTH2F, {{100, 0., 5.0}, {100, -5., 5.0}}); // Kaons
registry.add("NsigmaTPC_K_cut", "NsigmaTPC_K_cut", kTH2F, {{100, 0., 5.0}, {100, -5., 5.0}}); // Kaons
registry.add("DCAxy_cut", "#DCAxy_cut", kTH1F, {{100, -0.2, 0.2}});
registry.add("DCAz_cut", "#DCAz_cut", kTH1F, {{100, -0.2, 0.2}});
registry.add("DCAxyvspt_cut", "#DCAxyvspt_cut", kTH2F, {{100, 0., 5.0}, {100, -0.2, 0.2}});
registry.add("DCAzvspt_cut", "#DCAzvspt_cut", kTH2F, {{100, 0., 5.0}, {100, -0.2, 0.2}});
registry.add("TPC_yess_cut", "TPC_yess_cut", kTH1F, {{100, 0., 20.}});
registry.add("TPC_yess_eta_cut", "TPC_yess_eta_cut", kTH2F, {{100, 0., 20.0}, {200, -1., 1.}});
//{"TOF_yess", "TOF_yess", kTH1F, {{100, 0., 10.0}});
registry.add("TPCandTOF_cut", "TPCandTOF_cut", kTH1F, {{100, 0., 20.0}});
registry.add("TPCandTOF_eta_cut", "TPCandTOF_eta_cut", kTH2F, {{100, 0., 20.0}, {200, -1., 1.}});
registry.add("hcrossedrows_cut", ";track crossed rows;entries", kTH1F, {{160, -0.5, 159.5}});
registry.add("charge_pt_cut", "charge_pt_cut", kTH2F, {{100, 0., 10.}, {10, -1.5, 1.5}});
registry.add("charge_cut", "charge_cut", kTH1F, {{100, -1.5, 1.5}});
registry.add("NsigmaTPC_d_cut", "NsigmaTPC_d_cut", kTH2F, {{100, 0., 5.0}, {100, -5., 5.0}});
registry.add("NsigmaTOF_d_cut", "NsigmaTOF_d_cut", kTH2F, {{100, 0., 5.0}, {100, -5., 5.0}});
registry.add("TOFSignalpr_cut", ";TOFSignalpr_cut", kTH2F, {{1000, 0., 5.0}, {200, 0., 200.}});
registry.add("TOFSignalK_cut", "TOFSignalK_cut", kTH2F, {{1000, 0., 5.0}, {200, 0., 200.}});
registry.add("TOFSignald_cut", "TOFSignald_cut", kTH2F, {{1000, 0., 5.0}, {200, 0., 200.}});
////standard cuts histos

registry.add("eta_stdcut", "#eta_stdcut", kTH1F, {{102, -2.01, 2.01}}); //
registry.add("phi_stdcut", "#varphi_stdcut", kTH1F, {{100, 0., 2. * M_PI}}); //
registry.add("pt_stdcut", "pt_stdcut", kTH1F, {{100, 0., 5.0}}); //
registry.add("NsigmaTPC_stdcut", "NsigmaTPC_stdcut", kTH2F, {{100, 0., 5.0}, {100, -5., 5.0}}); //
registry.add("dEdxTPC_stdcut", "dEdxTPC_stdcut", kTH2F, {{200, 0., 5.0}, {1000, 0., 1000.0}});
registry.add("dEdxTPCinner_stdcut", "dEdxTPCinner_stdcut", kTH2F, {{200, 0., 5.0}, {1000, 0., 1000.0}});
registry.add("TOFSignal_stdcut", "TOFSignal_stdcut", kTH2F, {{200, 0., 5.0}, {100, 0., 1.5}});
registry.add("NsigmaTOF_p_stdcut", "NsigmaTOF_p_stdcut", kTH2F, {{100, 0., 5.0}, {100, -5., 5.0}});
registry.add("NsigmaTPCvsTOF_stdcut", "n#sigma_{TPC}; n#sigma_{TOF}", kTH2F, {{100, -5., 5.}, {100, -5., 5.}}); // protons
// registry.add("NsigmaTPCvsTOF^2_stdcut", "n#sigma_{TPC}; n#sigma_{TOF}", kTH2F, {{100, 0., 5.}, {100, 0., 5.}}); // protons^2
registry.add("NsigmaTOF_K_stdcut", "NsigmaTOF_K_stdcut", kTH2F, {{100, 0., 5.0}, {100, -5., 5.0}}); // Kaons
registry.add("NsigmaTPC_K_stdcut", "NsigmaTPC_K_stdcut", kTH2F, {{100, 0., 5.0}, {100, -5., 5.0}}); // Kaons
registry.add("DCAxy_stdcut", "#DCAxy_stdcut", kTH1F, {{100, -0.2, 0.2}});
registry.add("DCAz_stdcut", "#DCAz_stdcut", kTH1F, {{100, -0.2, 0.2}});
registry.add("DCAxyvspt_stdcut", "#DCAxyvspt_stdcut", kTH2F, {{100, 0., 5.0}, {100, -0.2, 0.2}});
registry.add("DCAzvspt_stdcut", "#DCAzvspt_stdcut", kTH2F, {{100, 0., 5.0}, {100, -0.2, 0.2}});
registry.add("TPC_yess_stdcut", "TPC_yess_stdcut", kTH1F, {{100, 0., 20.}});
registry.add("TPC_yess_eta_stdcut", "TPC_yess_eta_stdcut", kTH2F, {{100, 0., 20.0}, {200, -1., 1.}});
//{"TOF_yess", "TOF_yess", kTH1F, {{100, 0., 10.0}});
registry.add("TPCandTOF_stdcut", "TPCandTOF_stdcut", kTH1F, {{100, 0., 20.0}});
registry.add("TPCandTOF_eta_stdcut", "TPCandTOF_eta_stdcut", kTH2F, {{100, 0., 20.0}, {200, -1., 1.}});
registry.add("hcrossedrows_stdcut", ";track crossed rows;entries", kTH1F, {{160, -0.5, 159.5}});
registry.add("charge_pt_stdcut", "charge_pt_stdcut", kTH2F, {{100, 0., 10.}, {10, -1.5, 1.5}});
registry.add("charge_stdcut", "charge_stdcut", kTH1F, {{100, -1.5, 1.5}});
registry.add("NsigmaTPC_d_stdcut", "NsigmaTPC_d_stdcut", kTH2F, {{100, 0., 5.0}, {100, -5., 5.0}});
registry.add("NsigmaTOF_d_stdcut", "NsigmaTOF_d_stdcut", kTH2F, {{100, 0., 5.0}, {100, -5., 5.0}});
registry.add("TOFSignalpr_stdcut", ";TOFSignalpr_stdcut", kTH2F, {{1000, 0., 5.0}, {200, 0., 200.}});
registry.add("TOFSignalK_stdcut", "TOFSignalK_stdcut", kTH2F, {{1000, 0., 5.0}, {200, 0., 200.}});
registry.add("TOFSignald_stdcut", "TOFSignald_stdcut", kTH2F, {{1000, 0., 5.0}, {200, 0., 200.}});
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, don't leave code commented

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment on lines 166 to 286
/*
void processStandard(allinfo const& tracks)
{
for (auto& track : tracks) {
registry.fill(HIST("eta"), track.eta());
registry.fill(HIST("phi"), track.phi());
registry.fill(HIST("pt"), track.pt());
registry.fill(HIST("dEdxTPC"), track.pt(), track.tpcSignal());
registry.fill(HIST("dEdxTPCinner"), track.tpcInnerParam(), track.tpcSignal());
registry.fill(HIST("NsigmaTPC"), track.pt(), track.tpcNSigmaPr()); // tpcNSigmaStorePr
registry.fill(HIST("TOFSignal"), track.pt(), track.beta());
registry.fill(HIST("NsigmaTOF_p"), track.pt(), track.tofNSigmaPr());
registry.fill(HIST("NsigmaTPCvsTOF"), track.tpcNSigmaPr(), track.tofNSigmaPr());
// registry.fill(HIST("NsigmaTPCvsTOF^2"), track.tpcNSigmaPr() * track.tpcNSigmaPr(), track.tofNSigmaPr() * track.tofNSigmaPr());
registry.fill(HIST("NsigmaTOF_K"), track.pt(), track.tofNSigmaKa());
registry.fill(HIST("NsigmaTPC_K"), track.pt(), track.tpcNSigmaKa());
registry.fill(HIST("DCAxy"), track.dcaXY());
registry.fill(HIST("DCAz"), track.dcaZ());
registry.fill(HIST("DCAxyvspt"), track.pt(), track.dcaXY());
registry.fill(HIST("DCAzvspt"), track.pt(), track.dcaZ());
registry.fill(HIST("hcrossedrows"), track.tpcNClsCrossedRows());
registry.fill(HIST("charge_pt"), track.pt(), track.sign());
registry.fill(HIST("charge"), track.sign());
registry.fill(HIST("NsigmaTOF_d"), track.pt(), track.tofNSigmaDe());
registry.fill(HIST("NsigmaTPC_d"), track.pt(), track.tpcNSigmaDe());
// registry.fill(HIST("TOF_yess"), track.pt(), track.hasTOF());
// registry.fill(HIST("TOFSignalK"), track.pt(), track.tofExpSignalKa());
registry.fill(HIST("TOFSignalpr"), track.pt(), track.tofExpSignalPr(track.tofSignal()));
registry.fill(HIST("TOFSignalK"), track.pt(), track.tofExpSignalKa(track.tofSignal()));
registry.fill(HIST("TOFSignald"), track.pt(), track.tofExpSignalDe(track.tofSignal()));

if (track.hasTPC()) {
registry.fill(HIST("TPC_yess"), track.pt());
registry.fill(HIST("TPC_yess_eta"), track.pt(), track.eta());
if (track.hasTOF()) {
registry.fill(HIST("TPCandTOF"), track.pt());
registry.fill(HIST("TPCandTOF_eta"), track.pt(), track.eta());
}
}

// sempre sulle tracce faccio il fill degli istogrammi dopo i cut a pt>150 MEV/c e |eta|<0.8
if (track.pt() > 0.15 && abs(track.eta()) < 0.8) {

registry.fill(HIST("eta_cut"), track.eta());
registry.fill(HIST("phi_cut"), track.phi());
registry.fill(HIST("pt_cut"), track.pt());
registry.fill(HIST("dEdxTPC_cut"), track.pt(), track.tpcSignal());
registry.fill(HIST("dEdxTPCinner_cut"), track.tpcInnerParam(), track.tpcSignal());
registry.fill(HIST("NsigmaTPC_cut"), track.pt(), track.tpcNSigmaPr()); // tpcNSigmaStorePr
registry.fill(HIST("TOFSignal_cut"), track.pt(), track.beta());
registry.fill(HIST("NsigmaTOF_p_cut"), track.pt(), track.tofNSigmaPr());
registry.fill(HIST("NsigmaTPCvsTOF_cut"), track.tpcNSigmaPr(), track.tofNSigmaPr());
// registry.fill(HIST("NsigmaTPCvsTOF^2_cut"), track.tpcNSigmaPr() * track.tpcNSigmaPr(), track.tofNSigmaPr() * track.tofNSigmaPr());
registry.fill(HIST("NsigmaTOF_K_cut"), track.pt(), track.tofNSigmaKa());
registry.fill(HIST("NsigmaTPC_K_cut"), track.pt(), track.tpcNSigmaKa());
registry.fill(HIST("DCAxy_cut"), track.dcaXY());
registry.fill(HIST("DCAz_cut"), track.dcaZ());
registry.fill(HIST("DCAxyvspt_cut"), track.pt(), track.dcaXY());
registry.fill(HIST("DCAzvspt_cut"), track.pt(), track.dcaZ());
registry.fill(HIST("hcrossedrows_cut"), track.tpcNClsCrossedRows());
registry.fill(HIST("charge_pt_cut"), track.pt(), track.sign());

registry.fill(HIST("charge_cut"), track.sign());
registry.fill(HIST("NsigmaTOF_d_cut"), track.pt(), track.tofNSigmaDe());
registry.fill(HIST("NsigmaTPC_d_cut"), track.pt(), track.tpcNSigmaDe());
registry.fill(HIST("TOFSignalpr_cut"), track.pt(), track.tofExpSignalPr(track.tofSignal()));
registry.fill(HIST("TOFSignalK_cut"), track.pt(), track.tofExpSignalKa(track.tofSignal()));
registry.fill(HIST("TOFSignald_cut"), track.pt(), track.tofExpSignalDe(track.tofSignal()));

if (track.hasTPC()) {
registry.fill(HIST("TPC_yess_cut"), track.pt());
registry.fill(HIST("TPC_yess_eta_cut"), track.pt(), track.eta());
if (track.hasTOF()) {
registry.fill(HIST("TPCandTOF_cut"), track.pt());
registry.fill(HIST("TPCandTOF_eta_cut"), track.pt(), track.eta());
}
}
}

/// filling histos after standard cuts

if (track.isPrimaryTrack() && (track.pt() > 0.15 && abs(track.eta()) < 0.8)) {
registry.fill(HIST("eta_stdcut"), track.eta());
registry.fill(HIST("phi_stdcut"), track.phi());
registry.fill(HIST("pt_stdcut"), track.pt());
registry.fill(HIST("dEdxTPC_stdcut"), track.pt(), track.tpcSignal());
registry.fill(HIST("dEdxTPCinner_stdcut"), track.tpcInnerParam(), track.tpcSignal());
registry.fill(HIST("NsigmaTPC_stdcut"), track.pt(), track.tpcNSigmaPr()); // tpcNSigmaStorePr
registry.fill(HIST("TOFSignal_stdcut"), track.pt(), track.beta());
registry.fill(HIST("NsigmaTOF_p_stdcut"), track.pt(), track.tofNSigmaPr());
registry.fill(HIST("NsigmaTPCvsTOF_stdcut"), track.tpcNSigmaPr(), track.tofNSigmaPr());
// registry.fill(HIST("NsigmaTPCvsTOF^2_stdcut"),track.tpcNSigmaPr() * track.tpcNSigmaPr(), track.tofNSigmaPr() * track.tofNSigmaPr());
registry.fill(HIST("NsigmaTOF_K_stdcut"), track.pt(), track.tofNSigmaKa());
registry.fill(HIST("NsigmaTPC_K_stdcut"), track.pt(), track.tpcNSigmaKa());
registry.fill(HIST("DCAxy_stdcut"), track.dcaXY());
registry.fill(HIST("DCAz_stdcut"), track.dcaZ());
registry.fill(HIST("DCAxyvspt_stdcut"), track.pt(), track.dcaXY());
registry.fill(HIST("DCAzvspt_stdcut"), track.pt(), track.dcaZ());
registry.fill(HIST("hcrossedrows_stdcut"), track.tpcNClsCrossedRows());
registry.fill(HIST("charge_pt_stdcut"), track.pt(), track.sign());

registry.fill(HIST("charge_stdcut"), track.sign());
registry.fill(HIST("NsigmaTOF_d_stdcut"), track.pt(), track.tofNSigmaDe());
registry.fill(HIST("NsigmaTPC_d_stdcut"), track.pt(), track.tpcNSigmaDe());
registry.fill(HIST("TOFSignalpr_stdcut"), track.pt(), track.tofExpSignalPr(track.tofSignal()));
registry.fill(HIST("TOFSignalK_stdcut"), track.pt(), track.tofExpSignalKa(track.tofSignal()));
registry.fill(HIST("TOFSignald_stdcut"), track.pt(), track.tofExpSignalDe(track.tofSignal()));

if (track.hasTPC()) {
registry.fill(HIST("TPC_yess_stdcut"), track.pt());
registry.fill(HIST("TPC_yess_eta_stdcut"), track.pt(), track.eta());
if (track.hasTOF()) {
registry.fill(HIST("TPCandTOF_stdcut"), track.pt());
registry.fill(HIST("TPCandTOF_eta_stdcut"), track.pt(), track.eta());
}
}
}
}
}
PROCESS_SWITCH(EtaPhiHistograms, processStandard, "process non filtered track", false);
*/
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, don't leave code commented

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@github-actions github-actions bot closed this Aug 10, 2023
@njacazio njacazio reopened this Sep 13, 2023
Copy link
Contributor Author

@sofiatomassini sofiatomassini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @victor-gonzalez we took into consideration your useful comments and we simplified a lot the code that we propose to have merged. Please don't hesitate in case something can still be improved!

Comment on lines 28 to 49
template <typename binningType>
typename binningType::binned_t packInTable(const float& valueToBin)
{
if (valueToBin <= binningType::binned_min) {
return binningType::underflowBin;
} else if (valueToBin >= binningType::binned_max) {
return binningType::overflowBin;
} else {
return static_cast<typename binningType::binned_t>(valueToBin / binningType::bin_width);
// return static_cast<typename binningType::binned_t>(((valueToBin - (binningType::binned_max - binningType::binned_min) * 0.5) / binningType::bin_width));
}
}

template <typename binningType>
float unPack(const typename binningType::binned_t& b)
{
return static_cast<float>(binningType::bin_width * b);

// return static_cast<float>((binningType::binned_max - binningType::binned_min) * 0.5 + binningType::bin_width * b);
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed this is true but this is not completely the same, as we changed the strategy to pack and unpack. We also changed the binning and this was the rationale

Comment on lines 83 to 112
namespace storedcrossedrows
{
struct binning {
public:
typedef int8_t binned_t;
// static constexpr int nbins = 160;
//(1 << 8 * sizeof(binned_t)) - 2;
static constexpr int nbins = (1 << 8 * sizeof(binned_t)) - 2;
static constexpr binned_t overflowBin = nbins >> 1;
static constexpr binned_t underflowBin = -(nbins >> 1);
static constexpr float binned_max = 253.5;
static constexpr float binned_min = -0.5;
static constexpr float bin_width = (binned_max - binned_min) / nbins;
};
} // namespace storedcrossedrows

namespace nsigma
{
struct binning {
public:
typedef int8_t binned_t;
static constexpr int nbins = (1 << 8 * sizeof(binned_t)) - 2;
static constexpr binned_t overflowBin = nbins >> 1;
static constexpr binned_t underflowBin = -(nbins >> 1);
static constexpr float binned_max = 10.0;
static constexpr float binned_min = -10.0;
static constexpr float bin_width = (binned_max - binned_min) / nbins;
};
} // namespace nsigma
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for spotting this, indeed we changed the binning in order to have greater granularity. The function is different from the one reported in PIDResponse.h We changed the name to better reflect the functionality of the function

Comment on lines 113 to 151
DECLARE_SOA_INDEX_COLUMN(Collision, collision); // Index to the collision
DECLARE_SOA_COLUMN(Px, px, float); // Momentum of the track
DECLARE_SOA_COLUMN(Py, py, float); // Momentum of the track
DECLARE_SOA_COLUMN(Pz, pz, float); // Momentum of the track
DECLARE_SOA_COLUMN(P, p, float); // Momentum of the track
DECLARE_SOA_COLUMN(Pt, pt, float); // Momentum of the track
// DECLARE_SOA_COLUMN(PosZ, posZ, float); // vertex position along z
DECLARE_SOA_COLUMN(DcaXY, dcaXY, float); // impact parameter of the track
DECLARE_SOA_COLUMN(DcaZ, dcaZ, float); // impact parameter of the track
DECLARE_SOA_COLUMN(TPCNClsFound, tpcNClsFound, float); // Number of TPC clusters
DECLARE_SOA_COLUMN(TPCChi2NCl, tpcChi2NCl, float); // TPC chi2
DECLARE_SOA_COLUMN(ITSNCls, itsNCls, float); // Number of ITS clusters
DECLARE_SOA_COLUMN(ITSChi2NCl, itsChi2NCl, float); // ITS chi2
DECLARE_SOA_COLUMN(Eta, eta, float);
DECLARE_SOA_COLUMN(Phi, phi, float);
DECLARE_SOA_COLUMN(StoredCrossedRows, storedCrossedRows, storedcrossedrows::binning::binned_t);
DECLARE_SOA_COLUMN(StoredTOFNSigmaPr, storedTofNSigmaPr, nsigma::binning::binned_t);
DECLARE_SOA_COLUMN(StoredTPCNSigmaPr, storedTpcNSigmaPr, nsigma::binning::binned_t);
DECLARE_SOA_COLUMN(StoredTOFNSigmaDe, storedTofNSigmaDe, nsigma::binning::binned_t);
DECLARE_SOA_COLUMN(StoredTPCNSigmaDe, storedTpcNSigmaDe, nsigma::binning::binned_t);

DECLARE_SOA_DYNAMIC_COLUMN(CrossedRows, tpcNClsCrossedRows,
[](storedcrossedrows::binning::binned_t binned) -> float { return singletrackselector::unPackInt<storedcrossedrows::binning>(binned); });
DECLARE_SOA_DYNAMIC_COLUMN(TOFNSigmaPr, tofNSigmaPr,
[](nsigma::binning::binned_t nsigma_binned) -> float { return singletrackselector::unPack<nsigma::binning>(nsigma_binned); });
DECLARE_SOA_DYNAMIC_COLUMN(TPCNSigmaPr, tpcNSigmaPr,
[](nsigma::binning::binned_t nsigma_binned) -> float { return singletrackselector::unPack<nsigma::binning>(nsigma_binned); });
DECLARE_SOA_DYNAMIC_COLUMN(TOFNSigmaDe, tofNSigmaDe,
[](nsigma::binning::binned_t nsigma_binned) -> float { return singletrackselector::unPack<nsigma::binning>(nsigma_binned); });
DECLARE_SOA_DYNAMIC_COLUMN(TPCNSigmaDe, tpcNSigmaDe,
[](nsigma::binning::binned_t nsigma_binned) -> float { return singletrackselector::unPack<nsigma::binning>(nsigma_binned); });

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for spotting this, you have a good point, however, the strategy here is to store px, py and pz and derived p and pT from them as dynamic columns. This is different with what used centrally (where px py and pz are dynamic). For the PID the binning is different and we decided to keep greater granularity

Comment on lines 69 to 82
// Function to pack a float into a binned value in table
template <typename binningType>
typename binningType::binned_t packInTable(const float& valueToBin)
{
if (valueToBin <= binningType::binned_min) {
return binningType::underflowBin;
} else if (valueToBin >= binningType::binned_max) {
return binningType::overflowBin;
} else if (valueToBin >= 0) {
return static_cast<typename binningType::binned_t>((valueToBin / binningType::bin_width) + 0.5f);
} else {
return static_cast<typename binningType::binned_t>((valueToBin / binningType::bin_width) - 0.5f);
}*/
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, we removed the commented part

singletrackselector::packInTable<singletrackselector::nsigma::binning>(track.tpcNSigmaDe()));

if ((singletrackselector::unPackInt<singletrackselector::storedcrossedrows::binning>(singletrackselector::packInTableInt<singletrackselector::storedcrossedrows::binning>(track.tpcNClsCrossedRows())) != track.tpcNClsCrossedRows()) && (singletrackselector::unPackInt<singletrackselector::storedcrossedrows::binning>(singletrackselector::packInTableInt<singletrackselector::storedcrossedrows::binning>(track.tpcNClsCrossedRows())) != (track.tpcNClsCrossedRows() - 1))) {
LOG(info) << "crossedRows: " << track.tpcNClsCrossedRows()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We removed the log

if ((singletrackselector::unPackInt<singletrackselector::storedcrossedrows::binning>(singletrackselector::packInTableInt<singletrackselector::storedcrossedrows::binning>(track.tpcNClsCrossedRows())) != track.tpcNClsCrossedRows()) && (singletrackselector::unPackInt<singletrackselector::storedcrossedrows::binning>(singletrackselector::packInTableInt<singletrackselector::storedcrossedrows::binning>(track.tpcNClsCrossedRows())) != (track.tpcNClsCrossedRows() - 1))) {
LOG(info) << "crossedRows: " << track.tpcNClsCrossedRows()
<< ", Unpacked crossedRows: " << singletrackselector::unPackInt<singletrackselector::storedcrossedrows::binning>(singletrackselector::packInTableInt<singletrackselector::storedcrossedrows::binning>(track.tpcNClsCrossedRows()));
// << "deve essere uguale a" << singletrackselector::unPack<singletrackselector::nsigma::binning>;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment on lines 95 to 96
// LOG(info) << "UnPacked crossedRows: " << singletrackselector::unPack(o2::aod::singletrackselector::storedcrossedrows::binning::binned_t(o2::aod::singletrackselector::storedcrossedrows::binning(tpcNClsCrossedRows)) )
// LOG(info) << "Unpacked crossedRows: " << unpackedValue;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment on lines 47 to 141
/*
if (doprocessStandard == true) {
registry.add("eta", "eta", kTH1F, {{102, -2.01, 2.01, "eta"}}); //
registry.add("phi", "phi", kTH1F, {{100, 0., 2. * M_PI, "phi"}}); //
registry.add("pt", "pt", kTH1F, {{100, 0., 5.0, "pt"}}); //
registry.add("NsigmaTPC", "NsigmaTPC", kTH2F, {{100, 0., 5.0, "pt"}, {100, -5., 5.0, "nsigmaTPC"}}); //
registry.add("dEdxTPC", "dEdxTPC", kTH2F, {{200, 0., 5.0}, {1000, 0., 1000.0}});
registry.add("dEdxTPCinner", "dEdxTPCinner", kTH2F, {{200, 0., 5.0}, {1000, 0., 1000.0}});
registry.add("TOFSignal", "TOFSignal", kTH2F, {{200, 0., 5.0}, {100, 0., 1.5}});
registry.add("NsigmaTOF_p", "NsigmaTOF_p", kTH2F, {{100, 0., 5.0}, {100, -5., 5.0}});
registry.add("NsigmaTPCvsTOF", "n#sigma_{TPC}; n#sigma_{TOF}", kTH2F, {{100, -5., 5.}, {100, -5., 5.}}); // protons
// registry.add("NsigmaTPCvsTOF^2", "n#sigma_{TPC}; n#sigma_{TOF}", kTH2F, {{100, 0., 2}, {100, 0., 2.}}); // protons^2
registry.add("NsigmaTOF_K", "NsigmaTOF_K", kTH2F, {{100, 0., 5.0}, {100, -5., 5.0}}); // Kaons
registry.add("NsigmaTPC_K", "NsigmaTPC_K", kTH2F, {{100, 0., 5.0}, {100, -5., 5.0}}); // Kaons
registry.add("DCAxy", "#DCAxy", kTH1F, {{100, -0.2, 0.2}});
registry.add("DCAz", "#DCAz", kTH1F, {{100, -0.2, 0.2}});
registry.add("DCAxyvspt", "#DCAxyvspt", kTH2F, {{100, 0., 5.0}, {100, -0.2, 0.2}});
registry.add("DCAzvspt", "#DCAzvspt", kTH2F, {{100, 0., 5.0}, {100, -0.2, 0.2}});
registry.add("TPC_yess", "TPC_yess", kTH1F, {{100, 0., 20.}});
registry.add("TPC_yess_eta", "TPC_yess_eta", kTH2F, {{100, 0., 20.0}, {200, -1., 1.}});
//{"TOF_yess", "TOF_yess", {HistType::kTH1F, {{100, 0., 10.0}});
registry.add("TPCandTOF", "TPCandTOF", kTH1F, {{100, 0., 20.0}});
registry.add("TPCandTOF_eta", "TPCandTOF_eta", kTH2F, {{100, 0., 20.0}, {200, -1., 1.}});
registry.add("hcrossedrows", ";track crossed rows;entries", kTH1F, {{160, -0.5, 159.5}});
registry.add("charge_pt", "charge_pt", kTH2F, {{100, 0., 10.}, {10, -1.5, 1.5}});
registry.add("charge", "charge", kTH1F, {{100, -1.5, 1.5}});
registry.add("NsigmaTPC_d", "NsigmaTPC_d", kTH2F, {{100, 0., 5.0}, {100, -5., 5.0}});
registry.add("NsigmaTOF_d", "NsigmaTOF_d", kTH2F, {{100, 0., 5.0}, {100, -5., 5.0}});
registry.add("TOFSignalpr", ";TOFSignalpr", kTH2F, {{100, 0., 5.0}, {1000, 0., 1000.}});
registry.add("TOFSignalK", "TOFSignalK", kTH2F, {{1000, 0., 5.0}, {1000, 0, 1000.}});
registry.add("TOFSignald", "TOFSignald", kTH2F, {{1000, 0., 5.0}, {1000, 0., 1000.}});
//{"separation_pk", "separation_pk", {HistType::kTH2F,{{100, 0., 5.}, {}}}}
//
// definisco di nuovo gli stessi istogrammi ma _cut
registry.add("eta_cut", "#eta", kTH1F, {{102, -2.01, 2.01}}); //
registry.add("phi_cut", "#varphi", kTH1F, {{100, 0., 2. * M_PI}}); //
registry.add("pt_cut", "pt", kTH1F, {{100, 0., 5.0}}); //
registry.add("NsigmaTPC_cut", "NsigmaTPC_cut", kTH2F, {{100, 0., 5.0}, {100, -5., 5.0}}); //
registry.add("dEdxTPC_cut", "dEdxTPC_cut", kTH2F, {{200, 0., 5.0}, {1000, 0., 1000.0}});
registry.add("dEdxTPCinner_cut", "dEdxTPCinner_cut", kTH2F, {{200, 0., 5.0}, {1000, 0., 1000.0}});
registry.add("TOFSignal_cut", "TOFSignal_cut", kTH2F, {{200, 0., 5.0}, {100, 0., 1.5}});
registry.add("NsigmaTOF_p_cut", "NsigmaTOF_p_cut", kTH2F, {{100, 0., 5.0}, {100, -5., 5.0}}),
registry.add("NsigmaTPCvsTOF_cut", "n#sigma_{TPC}; n#sigma_{TOF}", kTH2F, {{100, -5., 5.}, {100, -5., 5.}}); // protons
// registry.add("NsigmaTPCvsTOF^2_cut", "n#sigma_{TPC}; n#sigma_{TOF}", kTH2F, {{100, 0., 2.}, {100, 0., 2.}}); // protons^2
registry.add("NsigmaTOF_K_cut", "NsigmaTOF_K_cut", kTH2F, {{100, 0., 5.0}, {100, -5., 5.0}}); // Kaons
registry.add("NsigmaTPC_K_cut", "NsigmaTPC_K_cut", kTH2F, {{100, 0., 5.0}, {100, -5., 5.0}}); // Kaons
registry.add("DCAxy_cut", "#DCAxy_cut", kTH1F, {{100, -0.2, 0.2}});
registry.add("DCAz_cut", "#DCAz_cut", kTH1F, {{100, -0.2, 0.2}});
registry.add("DCAxyvspt_cut", "#DCAxyvspt_cut", kTH2F, {{100, 0., 5.0}, {100, -0.2, 0.2}});
registry.add("DCAzvspt_cut", "#DCAzvspt_cut", kTH2F, {{100, 0., 5.0}, {100, -0.2, 0.2}});
registry.add("TPC_yess_cut", "TPC_yess_cut", kTH1F, {{100, 0., 20.}});
registry.add("TPC_yess_eta_cut", "TPC_yess_eta_cut", kTH2F, {{100, 0., 20.0}, {200, -1., 1.}});
//{"TOF_yess", "TOF_yess", kTH1F, {{100, 0., 10.0}});
registry.add("TPCandTOF_cut", "TPCandTOF_cut", kTH1F, {{100, 0., 20.0}});
registry.add("TPCandTOF_eta_cut", "TPCandTOF_eta_cut", kTH2F, {{100, 0., 20.0}, {200, -1., 1.}});
registry.add("hcrossedrows_cut", ";track crossed rows;entries", kTH1F, {{160, -0.5, 159.5}});
registry.add("charge_pt_cut", "charge_pt_cut", kTH2F, {{100, 0., 10.}, {10, -1.5, 1.5}});
registry.add("charge_cut", "charge_cut", kTH1F, {{100, -1.5, 1.5}});
registry.add("NsigmaTPC_d_cut", "NsigmaTPC_d_cut", kTH2F, {{100, 0., 5.0}, {100, -5., 5.0}});
registry.add("NsigmaTOF_d_cut", "NsigmaTOF_d_cut", kTH2F, {{100, 0., 5.0}, {100, -5., 5.0}});
registry.add("TOFSignalpr_cut", ";TOFSignalpr_cut", kTH2F, {{1000, 0., 5.0}, {200, 0., 200.}});
registry.add("TOFSignalK_cut", "TOFSignalK_cut", kTH2F, {{1000, 0., 5.0}, {200, 0., 200.}});
registry.add("TOFSignald_cut", "TOFSignald_cut", kTH2F, {{1000, 0., 5.0}, {200, 0., 200.}});
////standard cuts histos

registry.add("eta_stdcut", "#eta_stdcut", kTH1F, {{102, -2.01, 2.01}}); //
registry.add("phi_stdcut", "#varphi_stdcut", kTH1F, {{100, 0., 2. * M_PI}}); //
registry.add("pt_stdcut", "pt_stdcut", kTH1F, {{100, 0., 5.0}}); //
registry.add("NsigmaTPC_stdcut", "NsigmaTPC_stdcut", kTH2F, {{100, 0., 5.0}, {100, -5., 5.0}}); //
registry.add("dEdxTPC_stdcut", "dEdxTPC_stdcut", kTH2F, {{200, 0., 5.0}, {1000, 0., 1000.0}});
registry.add("dEdxTPCinner_stdcut", "dEdxTPCinner_stdcut", kTH2F, {{200, 0., 5.0}, {1000, 0., 1000.0}});
registry.add("TOFSignal_stdcut", "TOFSignal_stdcut", kTH2F, {{200, 0., 5.0}, {100, 0., 1.5}});
registry.add("NsigmaTOF_p_stdcut", "NsigmaTOF_p_stdcut", kTH2F, {{100, 0., 5.0}, {100, -5., 5.0}});
registry.add("NsigmaTPCvsTOF_stdcut", "n#sigma_{TPC}; n#sigma_{TOF}", kTH2F, {{100, -5., 5.}, {100, -5., 5.}}); // protons
// registry.add("NsigmaTPCvsTOF^2_stdcut", "n#sigma_{TPC}; n#sigma_{TOF}", kTH2F, {{100, 0., 5.}, {100, 0., 5.}}); // protons^2
registry.add("NsigmaTOF_K_stdcut", "NsigmaTOF_K_stdcut", kTH2F, {{100, 0., 5.0}, {100, -5., 5.0}}); // Kaons
registry.add("NsigmaTPC_K_stdcut", "NsigmaTPC_K_stdcut", kTH2F, {{100, 0., 5.0}, {100, -5., 5.0}}); // Kaons
registry.add("DCAxy_stdcut", "#DCAxy_stdcut", kTH1F, {{100, -0.2, 0.2}});
registry.add("DCAz_stdcut", "#DCAz_stdcut", kTH1F, {{100, -0.2, 0.2}});
registry.add("DCAxyvspt_stdcut", "#DCAxyvspt_stdcut", kTH2F, {{100, 0., 5.0}, {100, -0.2, 0.2}});
registry.add("DCAzvspt_stdcut", "#DCAzvspt_stdcut", kTH2F, {{100, 0., 5.0}, {100, -0.2, 0.2}});
registry.add("TPC_yess_stdcut", "TPC_yess_stdcut", kTH1F, {{100, 0., 20.}});
registry.add("TPC_yess_eta_stdcut", "TPC_yess_eta_stdcut", kTH2F, {{100, 0., 20.0}, {200, -1., 1.}});
//{"TOF_yess", "TOF_yess", kTH1F, {{100, 0., 10.0}});
registry.add("TPCandTOF_stdcut", "TPCandTOF_stdcut", kTH1F, {{100, 0., 20.0}});
registry.add("TPCandTOF_eta_stdcut", "TPCandTOF_eta_stdcut", kTH2F, {{100, 0., 20.0}, {200, -1., 1.}});
registry.add("hcrossedrows_stdcut", ";track crossed rows;entries", kTH1F, {{160, -0.5, 159.5}});
registry.add("charge_pt_stdcut", "charge_pt_stdcut", kTH2F, {{100, 0., 10.}, {10, -1.5, 1.5}});
registry.add("charge_stdcut", "charge_stdcut", kTH1F, {{100, -1.5, 1.5}});
registry.add("NsigmaTPC_d_stdcut", "NsigmaTPC_d_stdcut", kTH2F, {{100, 0., 5.0}, {100, -5., 5.0}});
registry.add("NsigmaTOF_d_stdcut", "NsigmaTOF_d_stdcut", kTH2F, {{100, 0., 5.0}, {100, -5., 5.0}});
registry.add("TOFSignalpr_stdcut", ";TOFSignalpr_stdcut", kTH2F, {{1000, 0., 5.0}, {200, 0., 200.}});
registry.add("TOFSignalK_stdcut", "TOFSignalK_stdcut", kTH2F, {{1000, 0., 5.0}, {200, 0., 200.}});
registry.add("TOFSignald_stdcut", "TOFSignald_stdcut", kTH2F, {{1000, 0., 5.0}, {200, 0., 200.}});
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment on lines 166 to 286
/*
void processStandard(allinfo const& tracks)
{
for (auto& track : tracks) {
registry.fill(HIST("eta"), track.eta());
registry.fill(HIST("phi"), track.phi());
registry.fill(HIST("pt"), track.pt());
registry.fill(HIST("dEdxTPC"), track.pt(), track.tpcSignal());
registry.fill(HIST("dEdxTPCinner"), track.tpcInnerParam(), track.tpcSignal());
registry.fill(HIST("NsigmaTPC"), track.pt(), track.tpcNSigmaPr()); // tpcNSigmaStorePr
registry.fill(HIST("TOFSignal"), track.pt(), track.beta());
registry.fill(HIST("NsigmaTOF_p"), track.pt(), track.tofNSigmaPr());
registry.fill(HIST("NsigmaTPCvsTOF"), track.tpcNSigmaPr(), track.tofNSigmaPr());
// registry.fill(HIST("NsigmaTPCvsTOF^2"), track.tpcNSigmaPr() * track.tpcNSigmaPr(), track.tofNSigmaPr() * track.tofNSigmaPr());
registry.fill(HIST("NsigmaTOF_K"), track.pt(), track.tofNSigmaKa());
registry.fill(HIST("NsigmaTPC_K"), track.pt(), track.tpcNSigmaKa());
registry.fill(HIST("DCAxy"), track.dcaXY());
registry.fill(HIST("DCAz"), track.dcaZ());
registry.fill(HIST("DCAxyvspt"), track.pt(), track.dcaXY());
registry.fill(HIST("DCAzvspt"), track.pt(), track.dcaZ());
registry.fill(HIST("hcrossedrows"), track.tpcNClsCrossedRows());
registry.fill(HIST("charge_pt"), track.pt(), track.sign());
registry.fill(HIST("charge"), track.sign());
registry.fill(HIST("NsigmaTOF_d"), track.pt(), track.tofNSigmaDe());
registry.fill(HIST("NsigmaTPC_d"), track.pt(), track.tpcNSigmaDe());
// registry.fill(HIST("TOF_yess"), track.pt(), track.hasTOF());
// registry.fill(HIST("TOFSignalK"), track.pt(), track.tofExpSignalKa());
registry.fill(HIST("TOFSignalpr"), track.pt(), track.tofExpSignalPr(track.tofSignal()));
registry.fill(HIST("TOFSignalK"), track.pt(), track.tofExpSignalKa(track.tofSignal()));
registry.fill(HIST("TOFSignald"), track.pt(), track.tofExpSignalDe(track.tofSignal()));

if (track.hasTPC()) {
registry.fill(HIST("TPC_yess"), track.pt());
registry.fill(HIST("TPC_yess_eta"), track.pt(), track.eta());
if (track.hasTOF()) {
registry.fill(HIST("TPCandTOF"), track.pt());
registry.fill(HIST("TPCandTOF_eta"), track.pt(), track.eta());
}
}

// sempre sulle tracce faccio il fill degli istogrammi dopo i cut a pt>150 MEV/c e |eta|<0.8
if (track.pt() > 0.15 && abs(track.eta()) < 0.8) {

registry.fill(HIST("eta_cut"), track.eta());
registry.fill(HIST("phi_cut"), track.phi());
registry.fill(HIST("pt_cut"), track.pt());
registry.fill(HIST("dEdxTPC_cut"), track.pt(), track.tpcSignal());
registry.fill(HIST("dEdxTPCinner_cut"), track.tpcInnerParam(), track.tpcSignal());
registry.fill(HIST("NsigmaTPC_cut"), track.pt(), track.tpcNSigmaPr()); // tpcNSigmaStorePr
registry.fill(HIST("TOFSignal_cut"), track.pt(), track.beta());
registry.fill(HIST("NsigmaTOF_p_cut"), track.pt(), track.tofNSigmaPr());
registry.fill(HIST("NsigmaTPCvsTOF_cut"), track.tpcNSigmaPr(), track.tofNSigmaPr());
// registry.fill(HIST("NsigmaTPCvsTOF^2_cut"), track.tpcNSigmaPr() * track.tpcNSigmaPr(), track.tofNSigmaPr() * track.tofNSigmaPr());
registry.fill(HIST("NsigmaTOF_K_cut"), track.pt(), track.tofNSigmaKa());
registry.fill(HIST("NsigmaTPC_K_cut"), track.pt(), track.tpcNSigmaKa());
registry.fill(HIST("DCAxy_cut"), track.dcaXY());
registry.fill(HIST("DCAz_cut"), track.dcaZ());
registry.fill(HIST("DCAxyvspt_cut"), track.pt(), track.dcaXY());
registry.fill(HIST("DCAzvspt_cut"), track.pt(), track.dcaZ());
registry.fill(HIST("hcrossedrows_cut"), track.tpcNClsCrossedRows());
registry.fill(HIST("charge_pt_cut"), track.pt(), track.sign());

registry.fill(HIST("charge_cut"), track.sign());
registry.fill(HIST("NsigmaTOF_d_cut"), track.pt(), track.tofNSigmaDe());
registry.fill(HIST("NsigmaTPC_d_cut"), track.pt(), track.tpcNSigmaDe());
registry.fill(HIST("TOFSignalpr_cut"), track.pt(), track.tofExpSignalPr(track.tofSignal()));
registry.fill(HIST("TOFSignalK_cut"), track.pt(), track.tofExpSignalKa(track.tofSignal()));
registry.fill(HIST("TOFSignald_cut"), track.pt(), track.tofExpSignalDe(track.tofSignal()));

if (track.hasTPC()) {
registry.fill(HIST("TPC_yess_cut"), track.pt());
registry.fill(HIST("TPC_yess_eta_cut"), track.pt(), track.eta());
if (track.hasTOF()) {
registry.fill(HIST("TPCandTOF_cut"), track.pt());
registry.fill(HIST("TPCandTOF_eta_cut"), track.pt(), track.eta());
}
}
}

/// filling histos after standard cuts

if (track.isPrimaryTrack() && (track.pt() > 0.15 && abs(track.eta()) < 0.8)) {
registry.fill(HIST("eta_stdcut"), track.eta());
registry.fill(HIST("phi_stdcut"), track.phi());
registry.fill(HIST("pt_stdcut"), track.pt());
registry.fill(HIST("dEdxTPC_stdcut"), track.pt(), track.tpcSignal());
registry.fill(HIST("dEdxTPCinner_stdcut"), track.tpcInnerParam(), track.tpcSignal());
registry.fill(HIST("NsigmaTPC_stdcut"), track.pt(), track.tpcNSigmaPr()); // tpcNSigmaStorePr
registry.fill(HIST("TOFSignal_stdcut"), track.pt(), track.beta());
registry.fill(HIST("NsigmaTOF_p_stdcut"), track.pt(), track.tofNSigmaPr());
registry.fill(HIST("NsigmaTPCvsTOF_stdcut"), track.tpcNSigmaPr(), track.tofNSigmaPr());
// registry.fill(HIST("NsigmaTPCvsTOF^2_stdcut"),track.tpcNSigmaPr() * track.tpcNSigmaPr(), track.tofNSigmaPr() * track.tofNSigmaPr());
registry.fill(HIST("NsigmaTOF_K_stdcut"), track.pt(), track.tofNSigmaKa());
registry.fill(HIST("NsigmaTPC_K_stdcut"), track.pt(), track.tpcNSigmaKa());
registry.fill(HIST("DCAxy_stdcut"), track.dcaXY());
registry.fill(HIST("DCAz_stdcut"), track.dcaZ());
registry.fill(HIST("DCAxyvspt_stdcut"), track.pt(), track.dcaXY());
registry.fill(HIST("DCAzvspt_stdcut"), track.pt(), track.dcaZ());
registry.fill(HIST("hcrossedrows_stdcut"), track.tpcNClsCrossedRows());
registry.fill(HIST("charge_pt_stdcut"), track.pt(), track.sign());

registry.fill(HIST("charge_stdcut"), track.sign());
registry.fill(HIST("NsigmaTOF_d_stdcut"), track.pt(), track.tofNSigmaDe());
registry.fill(HIST("NsigmaTPC_d_stdcut"), track.pt(), track.tpcNSigmaDe());
registry.fill(HIST("TOFSignalpr_stdcut"), track.pt(), track.tofExpSignalPr(track.tofSignal()));
registry.fill(HIST("TOFSignalK_stdcut"), track.pt(), track.tofExpSignalKa(track.tofSignal()));
registry.fill(HIST("TOFSignald_stdcut"), track.pt(), track.tofExpSignalDe(track.tofSignal()));

if (track.hasTPC()) {
registry.fill(HIST("TPC_yess_stdcut"), track.pt());
registry.fill(HIST("TPC_yess_eta_stdcut"), track.pt(), track.eta());
if (track.hasTOF()) {
registry.fill(HIST("TPCandTOF_stdcut"), track.pt());
registry.fill(HIST("TPCandTOF_eta_stdcut"), track.pt(), track.eta());
}
}
}
}
}
PROCESS_SWITCH(EtaPhiHistograms, processStandard, "process non filtered track", false);
*/
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@sofiatomassini sofiatomassini marked this pull request as ready for review September 13, 2023 14:48
Copy link
Collaborator

@victor-gonzalez victor-gonzalez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved for the time being
Future iterations will require the move on the source code hierarchy

@victor-gonzalez victor-gonzalez enabled auto-merge (squash) September 13, 2023 15:50
@alibuild
Copy link
Collaborator

Error while checking build/O2Physics/o2 for 5379a7f at 2023-09-13 17:59:

## sw/BUILD/O2Physics-latest/log
CMake Error at cmake/O2PhysicsAddExecutable.cmake:113 (add_executable):
CMake Error at cmake/O2PhysicsAddExecutable.cmake:113 (add_executable):

Full log here.

auto-merge was automatically disabled September 13, 2023 16:10

Head branch was pushed to by a user without write access

@victor-gonzalez
Copy link
Collaborator

You shouldn't incorporate anything to a PR which has not been previously fully compiled and tested locally

@victor-gonzalez victor-gonzalez enabled auto-merge (squash) September 14, 2023 04:21
@alibuild
Copy link
Collaborator

Error while checking build/O2Physics/o2 for 4eb2cf7 at 2023-09-14 06:36:

## sw/BUILD/O2Physics-latest/log
/sw/SOURCES/O2Physics/2713-slc7_x86-64/0/PWGCF/DataModel/singletrackselector.h:19:10: fatal error: sys/_types/_int8_t.h: No such file or directory
ninja: build stopped: subcommand failed.

Full log here.

auto-merge was automatically disabled September 14, 2023 11:39

Head branch was pushed to by a user without write access

@sofiatomassini
Copy link
Contributor Author

You shouldn't incorporate anything to a PR which has not been previously fully compiled and tested locally

We tested and compiled the code locally. The only thing that is changed is the name of the file singletrackselector.cxx

The error in the build/O2Physics/o2 is due to the compiler, and I couldn't test it on my Mac.

@victor-gonzalez
Copy link
Collaborator

The change in the source filename should have been caught by a local O2Physics production
Regarding the include error, never include something which starts with '_' unless you saw it in an already existing source file in O2

@victor-gonzalez victor-gonzalez enabled auto-merge (squash) September 14, 2023 14:57
@sofiatomassini
Copy link
Contributor Author

The change in the source filename should have been caught by a local O2Physics production Regarding the include error, never include something which starts with '_' unless you saw it in an already existing source file in O2

Thank you for your comment! This is my first pull request and I will pay more attention next time.

@victor-gonzalez victor-gonzalez merged commit 09ced19 into AliceO2Group:master Sep 14, 2023
hahassan7 pushed a commit to hahassan7/O2Physics that referenced this pull request Oct 6, 2023
* Add single track selector

* Update singletrackselector.h

* Update singletrackselector.h

* Update singletrackselector.cxx

* Update singletrackselector.h

* Update singletrackselector.cxx

* Update CMakeLists.txt

* Update singletrackselector.h
hahassan7 pushed a commit to hahassan7/O2Physics that referenced this pull request Oct 7, 2023
* Add single track selector

* Update singletrackselector.h

* Update singletrackselector.h

* Update singletrackselector.cxx

* Update singletrackselector.h

* Update singletrackselector.cxx

* Update CMakeLists.txt

* Update singletrackselector.h
samrangy pushed a commit to samrangy/O2Physics that referenced this pull request Oct 11, 2023
* Add single track selector

* Update singletrackselector.h

* Update singletrackselector.h

* Update singletrackselector.cxx

* Update singletrackselector.h

* Update singletrackselector.cxx

* Update CMakeLists.txt

* Update singletrackselector.h
zconesa pushed a commit to zconesa/O2Physics that referenced this pull request Oct 27, 2023
* Add single track selector

* Update singletrackselector.h

* Update singletrackselector.h

* Update singletrackselector.cxx

* Update singletrackselector.h

* Update singletrackselector.cxx

* Update CMakeLists.txt

* Update singletrackselector.h
chengtt0406 pushed a commit to chengtt0406/O2Physics that referenced this pull request Dec 6, 2023
* Add single track selector

* Update singletrackselector.h

* Update singletrackselector.h

* Update singletrackselector.cxx

* Update singletrackselector.h

* Update singletrackselector.cxx

* Update CMakeLists.txt

* Update singletrackselector.h
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

4 participants