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 Analysis/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
# submit itself to any jurisdiction.

add_subdirectory(Core)
#add_subdirectory(Tools)
add_subdirectory(DataModel)
add_subdirectory(Tasks)
add_subdirectory(Tutorials)
21 changes: 21 additions & 0 deletions Analysis/DataModel/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright CERN and copyright holders of ALICE O2. This software is distributed
# under the terms of the GNU General Public License v3 (GPL Version 3), copied
# verbatim in the file "COPYING".
#
# See http://alice-o2.web.cern.ch/license for full licensing information.
#
# In applying this license CERN does not waive the privileges and immunities
# granted to it by virtue of its status as an Intergovernmental Organization or
# submit itself to any jurisdiction.

o2_add_library(AnalysisDataModel
SOURCES src/dummy.cxx
PRIVATE_INCLUDE_DIRECTORIES ${CMAKE_CURRENT_LIST_DIR}/src
PUBLIC_LINK_LIBRARIES
O2::Framework
)

o2_add_executable(dump-aod-data-model
SOURCES src/dumpDataModel.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2::AnalysisDataModel
)
96 changes: 96 additions & 0 deletions Analysis/DataModel/include/Analysis/SecondaryVertex.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
// Copyright CERN and copyright holders of ALICE O2. This software is
// distributed under the terms of the GNU General Public License v3 (GPL
// Version 3), copied verbatim in the file "COPYING".
//
// See http://alice-o2.web.cern.ch/license for full licensing information.
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
#ifndef O2_ANALYSIS_SECONDARYVERTEX_H_
#define O2_ANALYSIS_SECONDARYVERTEX_H_

#include "Framework/AnalysisDataModel.h"

namespace o2::aod
{
namespace secvtx2prong
{
DECLARE_SOA_COLUMN(CollisionId, collisionId, int, "fCollisionsID");
DECLARE_SOA_COLUMN(Posdecayx, posdecayx, float, "fPosdecayx");
DECLARE_SOA_COLUMN(Posdecayy, posdecayy, float, "fPosdecayy");
DECLARE_SOA_COLUMN(Posdecayz, posdecayz, float, "fPosdecayz");
DECLARE_SOA_COLUMN(Index0, index0, int, "fIndex0");
DECLARE_SOA_COLUMN(Px0, px0, float, "fPx0");
DECLARE_SOA_COLUMN(Py0, py0, float, "fPy0");
DECLARE_SOA_COLUMN(Pz0, pz0, float, "fPz0");
DECLARE_SOA_COLUMN(Index1, index1, int, "fIndex1");
DECLARE_SOA_COLUMN(Px1, px1, float, "fPx1");
DECLARE_SOA_COLUMN(Py1, py1, float, "fPy1");
DECLARE_SOA_COLUMN(Pz1, pz1, float, "fPz1");
DECLARE_SOA_COLUMN(IndexDCApair, indexDCApair, int, "fIndexDCApair");
DECLARE_SOA_COLUMN(Mass, mass, float, "fMass");
DECLARE_SOA_COLUMN(Massbar, massbar, float, "fMassbar");
DECLARE_SOA_DYNAMIC_COLUMN(DecaylengthXY, decaylengthXY, [](float xvtxd, float yvtxd, float xvtxp, float yvtxp) { return sqrtf((yvtxd - yvtxp) * (yvtxd - yvtxp) + (xvtxd - xvtxp) * (xvtxd - xvtxp)); });
DECLARE_SOA_DYNAMIC_COLUMN(Decaylength, decaylength, [](float xvtxd, float yvtxd, float zvtxd, float xvtxp, float yvtxp, float zvtxp) { return sqrtf((yvtxd - yvtxp) * (yvtxd - yvtxp) + (xvtxd - xvtxp) * (xvtxd - xvtxp) + (zvtxd - zvtxp) * (zvtxd - zvtxp)); });

//old way of doing it
//DECLARE_SOA_COLUMN(Decaylength, decaylength, float, "fDecaylength");
//DECLARE_SOA_COLUMN(DecaylengthXY, decaylengthXY, float, "fDecaylengthXY");

} // namespace secvtx2prong
namespace cand2prong
{
DECLARE_SOA_COLUMN(CollisionId, collisionId, int, "fCollisionsID");
DECLARE_SOA_COLUMN(MassD0, massD0, float, "fMassD0");
DECLARE_SOA_COLUMN(MassD0bar, massD0bar, float, "fMassD0bar");
} // namespace cand2prong

DECLARE_SOA_TABLE(SecVtx2Prong, "AOD", "CAND2PRONG",
secvtx2prong::CollisionId, collision::PosX, collision::PosY, collision::PosZ,
secvtx2prong::Posdecayx, secvtx2prong::Posdecayy, secvtx2prong::Posdecayz,
secvtx2prong::Index0, secvtx2prong::Px0, secvtx2prong::Py0, secvtx2prong::Pz0,
secvtx2prong::Index1, secvtx2prong::Px1, secvtx2prong::Py1, secvtx2prong::Pz1,
secvtx2prong::IndexDCApair, secvtx2prong::Mass, secvtx2prong::Massbar,
secvtx2prong::DecaylengthXY<secvtx2prong::Posdecayx, secvtx2prong::Posdecayy, collision::PosX, collision::PosY>,
secvtx2prong::Decaylength<secvtx2prong::Posdecayx, secvtx2prong::Posdecayy, secvtx2prong::Posdecayz, collision::PosX, collision::PosY, collision::PosZ>);

DECLARE_SOA_TABLE(Cand2Prong, "AOD", "CANDDZERO",
cand2prong::CollisionId, cand2prong::MassD0, cand2prong::MassD0bar);
} // namespace o2::aod

using namespace o2;
using namespace o2::framework;

float decaylengthXY(float xvtxp, float yvtxp, float xvtxd, float yvtxd)
{
float decl_ = sqrtf((yvtxd - yvtxp) * (yvtxd - yvtxp) + (xvtxd - xvtxp) * (xvtxd - xvtxp));
return decl_;
};

float decaylength(float xvtxp, float yvtxp, float zvtxp, float xvtxd, float yvtxd, float zvtxd)
{
float decl_ = sqrtf((yvtxd - yvtxp) * (yvtxd - yvtxp) + (xvtxd - xvtxp) * (xvtxd - xvtxp) + (zvtxd - zvtxp) * (zvtxd - zvtxp));
return decl_;
};

float energy(float px, float py, float pz, float mass)
{
float en_ = sqrtf(mass * mass + px * px + py * py + pz * pz);
return en_;
};

float invmass2prongs(float px0, float py0, float pz0, float mass0,
float px1, float py1, float pz1, float mass1)
{

float energy0_ = energy(px0, py0, pz0, mass0);
float energy1_ = energy(px1, py1, pz1, mass1);
float energytot = energy0_ + energy1_;

float psum2 = (px0 + px1) * (px0 + px1) + (py0 + py1) * (py0 + py1) + (pz0 + pz1) * (pz0 + pz1);
float mass = sqrtf(energytot * energytot - psum2);
return mass;
};

#endif // O2_ANALYSIS_SECONDARYVERTEX_H_
10 changes: 10 additions & 0 deletions Analysis/DataModel/src/dummy.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Copyright CERN and copyright holders of ALICE O2. This software is
// distributed under the terms of the GNU General Public License v3 (GPL
// Version 3), copied verbatim in the file "COPYING".
//
// See http://alice-o2.web.cern.ch/license for full licensing information.
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
#include "Analysis/SecondaryVertex.h"
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
#include "Framework/AnalysisDataModel.h"
#include "Analysis/SecondaryVertex.h"
#include <fmt/printf.h>
#include <map>

Expand Down Expand Up @@ -114,5 +115,7 @@ edge[dir=back, arrowtail=empty]
dumpTable<V0s>();
dumpTable<Cascades>();
dumpTable<Timeframes>();
dumpTable<SecVtx2Prong>();
dumpTable<Cand2Prong>();
fmt::printf("%s\n", R"(})");
}
2 changes: 1 addition & 1 deletion Analysis/Tasks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ o2_add_executable(correlations-collection

o2_add_executable(vertexing-hf
SOURCES vertexerhf.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase
PUBLIC_LINK_LIBRARIES O2::Framework O2::AnalysisDataModel O2::DetectorsBase
COMPONENT_NAME Analysis)

o2_add_executable(validation
Expand Down
81 changes: 1 addition & 80 deletions Analysis/Tasks/vertexerhf.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -10,93 +10,14 @@
#include "Framework/runDataProcessing.h"
#include "Framework/AnalysisTask.h"
#include "Framework/AnalysisDataModel.h"
#include "Analysis/SecondaryVertex.h"
#include "DetectorsBase/DCAFitter.h"
#include "ReconstructionDataFormats/Track.h"

#include <TFile.h>
#include <TH1F.h>
#include <cmath>
#include <array>
namespace o2::aod
{
namespace secvtx2prong
{
DECLARE_SOA_COLUMN(CollisionId, collisionId, int, "fCollisionsID");
DECLARE_SOA_COLUMN(Posdecayx, posdecayx, float, "fPosdecayx");
DECLARE_SOA_COLUMN(Posdecayy, posdecayy, float, "fPosdecayy");
DECLARE_SOA_COLUMN(Posdecayz, posdecayz, float, "fPosdecayz");
DECLARE_SOA_COLUMN(Index0, index0, int, "fIndex0");
DECLARE_SOA_COLUMN(Px0, px0, float, "fPx0");
DECLARE_SOA_COLUMN(Py0, py0, float, "fPy0");
DECLARE_SOA_COLUMN(Pz0, pz0, float, "fPz0");
DECLARE_SOA_COLUMN(Index1, index1, int, "fIndex1");
DECLARE_SOA_COLUMN(Px1, px1, float, "fPx1");
DECLARE_SOA_COLUMN(Py1, py1, float, "fPy1");
DECLARE_SOA_COLUMN(Pz1, pz1, float, "fPz1");
DECLARE_SOA_COLUMN(IndexDCApair, indexDCApair, int, "fIndexDCApair");
DECLARE_SOA_COLUMN(Mass, mass, float, "fMass");
DECLARE_SOA_COLUMN(Massbar, massbar, float, "fMassbar");
DECLARE_SOA_DYNAMIC_COLUMN(DecaylengthXY, decaylengthXY, [](float xvtxd, float yvtxd, float xvtxp, float yvtxp) { return sqrtf((yvtxd - yvtxp) * (yvtxd - yvtxp) + (xvtxd - xvtxp) * (xvtxd - xvtxp)); });
DECLARE_SOA_DYNAMIC_COLUMN(Decaylength, decaylength, [](float xvtxd, float yvtxd, float zvtxd, float xvtxp, float yvtxp, float zvtxp) { return sqrtf((yvtxd - yvtxp) * (yvtxd - yvtxp) + (xvtxd - xvtxp) * (xvtxd - xvtxp) + (zvtxd - zvtxp) * (zvtxd - zvtxp)); });

//old way of doing it
//DECLARE_SOA_COLUMN(Decaylength, decaylength, float, "fDecaylength");
//DECLARE_SOA_COLUMN(DecaylengthXY, decaylengthXY, float, "fDecaylengthXY");

} // namespace secvtx2prong
namespace cand2prong
{
DECLARE_SOA_COLUMN(CollisionId, collisionId, int, "fCollisionsID");
DECLARE_SOA_COLUMN(MassD0, massD0, float, "fMassD0");
DECLARE_SOA_COLUMN(MassD0bar, massD0bar, float, "fMassD0bar");
} // namespace cand2prong

DECLARE_SOA_TABLE(SecVtx2Prong, "AOD", "CAND2PRONG",
secvtx2prong::CollisionId, collision::PosX, collision::PosY, collision::PosZ,
secvtx2prong::Posdecayx, secvtx2prong::Posdecayy, secvtx2prong::Posdecayz,
secvtx2prong::Index0, secvtx2prong::Px0, secvtx2prong::Py0, secvtx2prong::Pz0,
secvtx2prong::Index1, secvtx2prong::Px1, secvtx2prong::Py1, secvtx2prong::Pz1,
secvtx2prong::IndexDCApair, secvtx2prong::Mass, secvtx2prong::Massbar,
secvtx2prong::DecaylengthXY<secvtx2prong::Posdecayx, secvtx2prong::Posdecayy, collision::PosX, collision::PosY>,
secvtx2prong::Decaylength<secvtx2prong::Posdecayx, secvtx2prong::Posdecayy, secvtx2prong::Posdecayz, collision::PosX, collision::PosY, collision::PosZ>);

DECLARE_SOA_TABLE(Cand2Prong, "AOD", "CANDDZERO",
cand2prong::CollisionId, cand2prong::MassD0, cand2prong::MassD0bar);
} // namespace o2::aod

using namespace o2;
using namespace o2::framework;

float decaylengthXY(float xvtxp, float yvtxp, float xvtxd, float yvtxd)
{
float decl_ = sqrtf((yvtxd - yvtxp) * (yvtxd - yvtxp) + (xvtxd - xvtxp) * (xvtxd - xvtxp));
return decl_;
};

float decaylength(float xvtxp, float yvtxp, float zvtxp, float xvtxd, float yvtxd, float zvtxd)
{
float decl_ = sqrtf((yvtxd - yvtxp) * (yvtxd - yvtxp) + (xvtxd - xvtxp) * (xvtxd - xvtxp) + (zvtxd - zvtxp) * (zvtxd - zvtxp));
return decl_;
};

float energy(float px, float py, float pz, float mass)
{
float en_ = sqrtf(mass * mass + px * px + py * py + pz * pz);
return en_;
};

float invmass2prongs(float px0, float py0, float pz0, float mass0,
float px1, float py1, float pz1, float mass1)
{

float energy0_ = energy(px0, py0, pz0, mass0);
float energy1_ = energy(px1, py1, pz1, mass1);
float energytot = energy0_ + energy1_;

float psum2 = (px0 + px1) * (px0 + px1) + (py0 + py1) * (py0 + py1) + (pz0 + pz1) * (pz0 + pz1);
float mass = sqrtf(energytot * energytot - psum2);
return mass;
};

struct CandidateBuilding2Prong {
// secondary vertex position
Expand Down
6 changes: 0 additions & 6 deletions Framework/Core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -190,12 +190,6 @@ o2_add_executable(verify-aod-file
PUBLIC_LINK_LIBRARIES O2::Framework
COMPONENT_NAME Framework)

o2_add_executable(dump-aod-data-model
SOURCES src/dumpDataModel.cxx
PUBLIC_LINK_LIBRARIES O2::Framework
COMPONENT_NAME Framework
)

# tests with input data

o2_data_file(COPY test/test_DataSampling.json DESTINATION tests)
Expand Down