Skip to content

Commit 99b5f02

Browse files
rolavickalibuild
andauthored
[PWGUD] Study of nContribs per ITSROFs vs nCollisions per ITSROF (#10065)
Co-authored-by: ALICE Action Bot <alibuild@cern.ch>
1 parent c8a31ac commit 99b5f02

File tree

1 file changed

+49
-10
lines changed

1 file changed

+49
-10
lines changed

PWGUD/Tasks/upcEventITSROFcounter.cxx

Lines changed: 49 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,23 @@
99
// granted to it by virtue of its status as an Intergovernmental Organization
1010
// or submit itself to any jurisdiction.
1111

12+
/// \file upcEventITSROFcounter.cxx
13+
/// \brief Personal task to analyze tau events from UPC collisions
14+
///
15+
/// \author Roman Lavicka <roman.lavicka@cern.ch>, Austrian Academy of Sciences & SMI
16+
/// \since 09.08.2024
17+
18+
#include <utility>
19+
#include <vector>
20+
1221
#include "Framework/runDataProcessing.h"
1322
#include "Framework/AnalysisTask.h"
1423
#include "Framework/AnalysisDataModel.h"
1524
#include "ITSMFTBase/DPLAlpideParam.h"
1625
#include "CCDB/BasicCCDBManager.h"
26+
#include "ReconstructionDataFormats/Vertex.h"
1727

28+
#include "Common/CCDB/EventSelectionParams.h"
1829
#include "Common/DataModel/EventSelection.h"
1930

2031
#include "PWGUD/DataModel/UDTables.h"
@@ -25,6 +36,7 @@
2536
using namespace o2;
2637
using namespace o2::framework;
2738
using namespace o2::framework::expressions;
39+
using namespace o2::dataformats;
2840

2941
using BCsWithRun3Matchings = soa::Join<aod::BCs, aod::Timestamps, aod::Run3MatchedToBCSparse>;
3042
using CCs = soa::Join<aod::Collisions, aod::EvSels>;
@@ -39,10 +51,10 @@ struct UpcEventITSROFcounter {
3951
Configurable<int> nTracksForUPCevent{"nTracksForUPCevent", 16, {"Maximum of tracks defining a UPC collision"}};
4052

4153
Configurable<bool> useTrueGap{"useTrueGap", true, {"Calculate gapSide for a given FV0/FT0/ZDC thresholds"}};
42-
Configurable<float> cutMyGapSideFV0{"FV0", -1, "FV0A threshold for SG selector"};
43-
Configurable<float> cutMyGapSideFT0A{"FT0A", 150., "FT0A threshold for SG selector"};
44-
Configurable<float> cutMyGapSideFT0C{"FT0C", 50., "FT0C threshold for SG selector"};
45-
Configurable<float> cutMyGapSideZDC{"ZDC", 10., "ZDC threshold for SG selector"};
54+
Configurable<float> cutMyGapSideFV0{"cutMyGapSideFV0", -1, "FV0A threshold for SG selector"};
55+
Configurable<float> cutMyGapSideFT0A{"cutMyGapSideFT0A", 150., "FT0A threshold for SG selector"};
56+
Configurable<float> cutMyGapSideFT0C{"cutMyGapSideFT0C", 50., "FT0C threshold for SG selector"};
57+
Configurable<float> cutMyGapSideZDC{"cutMyGapSideZDC", 10., "ZDC threshold for SG selector"};
4658
ConfigurableAxis axisRunNumbers{"axisRunNumbers", {1400, 544000.5, 545400.5}, "Range of run numbers"};
4759

4860
void init(InitContext&)
@@ -53,6 +65,9 @@ struct UpcEventITSROFcounter {
5365
histos.add("Events/hCountCollisionsInROFborderMatching", ";;Number of collision (-)", HistType::kTH1D, {{11, -0.5, 10.5}});
5466
histos.add("Events/hCountUPCcollisionsInROFborderMatching", ";;Number of UPC (mult < 17) collision (-)", HistType::kTH1D, {{11, -0.5, 10.5}});
5567

68+
histos.add("Events/hPVcontribsVsCollisionsPerITSROFstd", "Collisions reconstructed with standard mode;Number of vertex contributors (-); Number of collisions in one ITSROF (-)", HistType::kTH2D, {{101, -0.5, 100.5}, {11, -0.5, 10.5}});
69+
histos.add("Events/hPVcontribsVsCollisionsPerITSROFupc", "Collisions reconstructed with upc mode;Number of vertex contributors (-); Number of collisions in one ITSROF (-)", HistType::kTH2D, {{101, -0.5, 100.5}, {11, -0.5, 10.5}});
70+
5671
histos.add("Runs/hStdModeCollDG", ";Run number;Number of events (-)", HistType::kTH1D, {axisRunNumbers});
5772
histos.add("Runs/hUpcModeCollDG", ";Run number;Number of events (-)", HistType::kTH1D, {axisRunNumbers});
5873
histos.add("Runs/hStdModeCollSG1", ";Run number;Number of events (-)", HistType::kTH1D, {axisRunNumbers});
@@ -78,7 +93,7 @@ struct UpcEventITSROFcounter {
7893
int64_t ts = bcs.iteratorAt(0).timestamp();
7994
auto alppar = ccdb->getForTimeStamp<o2::itsmft::DPLAlpideParam<0>>("ITS/Config/AlpideParam", ts);
8095

81-
for (auto bc : bcs) {
96+
for (const auto& bc : bcs) {
8297
uint64_t globalBC = bc.globalBC();
8398
uint64_t globalIndex = bc.globalIndex();
8499
if (isFirst) {
@@ -98,7 +113,7 @@ struct UpcEventITSROFcounter {
98113
previousBCinITSROF = bcInITSROF;
99114
previousBCglobalIndex = globalIndex;
100115
// next is based on exact matching of bc and collision
101-
for (auto& collision : collisions) {
116+
for (const auto& collision : collisions) {
102117
if (collision.has_foundBC()) {
103118
if (collision.foundBCId() == bc.globalIndex()) {
104119
nAllColls++;
@@ -113,16 +128,16 @@ struct UpcEventITSROFcounter {
113128
}
114129
}
115130
} // end loop over collisions
116-
} // end loop over bcs
131+
} // end loop over bcs
117132

118133
int arrAllColls[1000] = {0};
119134
int arrUPCcolls[1000] = {0};
120135

121136
// next is based on matching of collision bc within ITSROF range in bcs
122-
for (auto& itsrofBorder : vecITSROFborders) {
137+
for (const auto& itsrofBorder : vecITSROFborders) {
123138
int nAllCollsInROF = 0;
124139
int nUpcCollsInROF = 0;
125-
for (auto& collision : collisions) {
140+
for (const auto& collision : collisions) {
126141
if ((itsrofBorder.first < collision.bcId()) && (collision.bcId() < itsrofBorder.second)) {
127142
nAllCollsInROF++;
128143
if (collision.numContrib() < nTracksForUPCevent + 1) {
@@ -138,6 +153,30 @@ struct UpcEventITSROFcounter {
138153
histos.get<TH1>(HIST("Events/hCountCollisionsInROFborderMatching"))->Fill(ncol, arrAllColls[ncol]);
139154
histos.get<TH1>(HIST("Events/hCountUPCcollisionsInROFborderMatching"))->Fill(ncol, arrUPCcolls[ncol]);
140155
}
156+
157+
// TEST vertex contributors per reconstruction flag (std vs upc)
158+
// matching of collision bc within ITSROF range in bcs
159+
for (const auto& itsrofBorder : vecITSROFborders) {
160+
std::vector<int> vecNumContribsStd;
161+
std::vector<int> vecNumContribsUpc;
162+
for (const auto& collision : collisions) {
163+
if ((itsrofBorder.first < collision.bcId()) && (collision.bcId() < itsrofBorder.second)) {
164+
if (collision.flags() & dataformats::Vertex<o2::dataformats::TimeStamp<int>>::Flags::UPCMode) {
165+
vecNumContribsUpc.push_back(collision.numContrib());
166+
} else {
167+
vecNumContribsStd.push_back(collision.numContrib());
168+
}
169+
}
170+
} // end loop over collisions
171+
172+
for (const auto& numContribs : vecNumContribsStd) {
173+
histos.get<TH2>(HIST("Events/hPVcontribsVsCollisionsPerITSROFstd"))->Fill(numContribs, vecNumContribsStd.size());
174+
}
175+
for (const auto& numContribs : vecNumContribsUpc) {
176+
histos.get<TH2>(HIST("Events/hPVcontribsVsCollisionsPerITSROFupc"))->Fill(numContribs, vecNumContribsUpc.size());
177+
}
178+
179+
} // end loop over ITSROFs
141180
}
142181

143182
void processCounterPerRun(FullSGUDCollision const& coll)
@@ -179,5 +218,5 @@ struct UpcEventITSROFcounter {
179218
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
180219
{
181220
return WorkflowSpec{
182-
adaptAnalysisTask<UpcEventITSROFcounter>(cfgc, TaskName{"upc-event-itsrof-counter"})};
221+
adaptAnalysisTask<UpcEventITSROFcounter>(cfgc)};
183222
}

0 commit comments

Comments
 (0)