Skip to content

Commit 365327f

Browse files
committed
fixes PR requests
1 parent dbf6f79 commit 365327f

4 files changed

Lines changed: 81 additions & 7 deletions

File tree

Common/DataModel/T0infoTable.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ namespace o2::aod
1717
{
1818
namespace infoFT0
1919
{
20-
DECLARE_SOA_COLUMN(T0A, t0A, float);
21-
DECLARE_SOA_COLUMN(T0C, t0C, float);
22-
DECLARE_SOA_COLUMN(T0AC, t0AC, float);
23-
DECLARE_SOA_COLUMN(T0vertex, t0vertex, float);
20+
DECLARE_SOA_COLUMN(T0A, t0A, float); //! Collision time A-side, corrected with primary vertex
21+
DECLARE_SOA_COLUMN(T0C, t0C, float); //! Collision time A-side, corrected with primary vertex
22+
DECLARE_SOA_COLUMN(T0AC, t0AC, float); //! Collision time (A+C)/2
23+
DECLARE_SOA_COLUMN(T0vertex, t0vertex, float); //! FT0 vertex
2424
} // namespace infoFT0
2525
DECLARE_SOA_TABLE(T0info, "AOD", "T0info",
2626
infoFT0::T0A, infoFT0::T0C,

Common/TableProducer/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,6 @@ o2physics_add_dpl_workflow(weak-decay-indices
4646
PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2Physics::AnalysisCore
4747
COMPONENT_NAME Analysis)
4848
o2physics_add_dpl_workflow(ft0-table
49-
SOURCES infoTableFT0producer.cxx
49+
SOURCES FT0Table.cxx
5050
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::AnalysisCCDB O2::DetectorsBase O2::CCDB O2::CommonConstants
5151
COMPONENT_NAME Analysis)

Common/TableProducer/FT0Table.cxx

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2+
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3+
// All rights not expressly granted are reserved.
4+
//
5+
// This software is distributed under the terms of the GNU General Public
6+
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7+
//
8+
// In applying this license CERN does not waive the privileges and immunities
9+
// granted to it by virtue of its status as an Intergovernmental Organization
10+
// or submit itself to any jurisdiction.
11+
#include "Framework/ConfigParamSpec.h"
12+
13+
using namespace o2;
14+
using namespace o2::framework;
15+
16+
// custom configurable for switching between run2 and run3 selection types
17+
/*void customize(std::vector<ConfigParamSpec>& workflowOptions)
18+
{
19+
workflowOptions.push_back(ConfigParamSpec{"ccdb-path-ft0", o2::framework::VariantType::String, "http://o2-ccdb.internal/", {"URL of the CCDB database"}});
20+
}*/
21+
22+
#include "Framework/runDataProcessing.h"
23+
#include "Framework/AnalysisTask.h"
24+
#include "Common/DataModel/EventSelection.h"
25+
#include "Framework/AnalysisDataModel.h"
26+
#include "CommonConstants/LHCConstants.h"
27+
#include "CommonConstants/PhysicsConstants.h"
28+
#include "Common/DataModel/T0infoTable.h"
29+
#include <string>
30+
31+
using namespace o2::aod;
32+
struct FT0Table {
33+
Produces<o2::aod::T0info> table;
34+
using BCsWithMatchings = soa::Join<aod::BCs, aod::Run3MatchedToBCSparse>;
35+
using CollisionEvSel = soa::Join<aod::Collisions, aod::EvSels>::iterator;
36+
37+
void process(BCsWithMatchings const& bcs, soa::Join<aod::Collisions, aod::EvSels> const& collisions, aod::FT0s const& ft0s)
38+
{
39+
for (auto& collision : collisions) {
40+
int64_t foundFT0 = collision.foundFT0();
41+
float vertexPV = collision.posZ();
42+
float vertex_corr = vertexPV / o2::constants::physics::LightSpeedCm2NS;
43+
float t0A, t0C, t0AC, vertexT0;
44+
t0A = t0C = t0AC = vertexT0 = 32000;
45+
if (foundFT0 != -1) {
46+
auto ft0 = ft0s.iteratorAt(foundFT0);
47+
t0A = ft0.timeA();
48+
t0C = ft0.timeC();
49+
int triggersignals = ft0.triggerMask();
50+
bool ora = (triggersignals & (1 << 0)) != 0;
51+
bool orc = (triggersignals & (1 << 1)) != 0;
52+
bool vertexTrigger = (triggersignals & (1 << 2)) != 0;
53+
LOGF(debug, "triggers OrA %i OrC %i vertexTrigger %i", ora, orc, vertexTrigger);
54+
LOGF(debug, " T0A = %f, T0C %f, vertex_corr %f, triggersignals %i", t0A, t0C, vertex_corr, triggersignals);
55+
if (vertexTrigger) {
56+
vertexT0 = o2::constants::physics::LightSpeedCm2NS * (t0C - t0A) / 2;
57+
t0AC = (t0A + t0C) / 2;
58+
}
59+
if (ora) {
60+
t0A += vertex_corr;
61+
}
62+
if (orc) {
63+
t0C -= vertex_corr;
64+
}
65+
}
66+
LOGF(debug, " T0 collision time = %f, T0A = %f, T0C = %f, T0 vertex = %f PV = %f", t0A, t0C, t0AC, vertexT0, vertexPV);
67+
table(t0A, t0C, t0AC, vertexT0);
68+
}
69+
}
70+
};
71+
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
72+
{
73+
return WorkflowSpec{adaptAnalysisTask<FT0Table>(cfgc, TaskName{"ft0-table"})};
74+
}

Common/Tasks/ft0infoQaTask.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,12 @@ struct FT0InfoQaTask {
4545
int64_t foundFT0 = col.foundFT0();
4646
if (foundFT0 != -1) {
4747
LOGF(info, "multV0A=%5.0f; multT0A=%5.0f; PV=%f; T0vertex=%f;T0A=%f; T0C=%f; T0AC=%f ", col.multV0A(), col.multT0A(), col.posZ(), col.t0A(), col.t0C(), col.t0AC(), col.t0vertex());
48-
/* hT0A->Fill(col.t0A());
48+
hT0A->Fill(col.t0A());
4949
hT0C->Fill(col.t0C());
5050
hT0AC->Fill(col.t0AC());
5151
hT0Vertex->Fill(col.t0vertex());
5252
hVertex_T0_PV->Fill(col.t0vertex(), col.posZ());
53-
hT0res->Fill((col.t0A()-col.t0C())/2.);*/
53+
hT0res->Fill((col.t0A()-col.t0C())/2.);
5454
}
5555
}
5656
};

0 commit comments

Comments
 (0)