Skip to content

Commit 97222fd

Browse files
jmyrchashahor02
authored andcommitted
o2-eve: calorimeter fixes
1 parent c39966d commit 97222fd

4 files changed

Lines changed: 87 additions & 86 deletions

File tree

EventVisualisation/Base/include/EventVisualisationBase/ConfigurationManager.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ namespace o2
2424
namespace event_visualisation
2525
{
2626
/// Version of the software
27-
const static std::string o2_eve_version = "1.20";
27+
const static std::string o2_eve_version = "1.30";
2828

2929
/// Configuration Manager allows an easy access to the config file.
3030
///

EventVisualisation/Scripts/.o2eve_config

Lines changed: 46 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
#===============================================================#
2-
# This is o2-eve config file. #
2+
# This is Event Display config file. #
33
# #
44
# You can copy it to your home directory and set custom values. #
5-
# please remember to change paths #
65
# #
76
#===============================================================#
87

@@ -12,14 +11,29 @@ axes.show: 0
1211
fullscreen.mode: 0
1312
background.color: 1
1413

14+
emcal.barrel.radius: 500
15+
emcal.tower.color: 3
16+
emcal.tower.noise 0
17+
emcal.tower.scale: 1
18+
emcal.tower.size.eta: 0.0143
19+
emcal.tower.size.phi: 0.0143
20+
21+
phos.barrel.radius: 550
22+
phos.tower.color: 65
23+
phos.tower.noise 1
24+
phos.tower.scale: 1
25+
phos.tower.size.eta: 0.0143
26+
phos.tower.size.phi: 0.0143
27+
28+
1529
camera.3D.rotation.horizontal: -0.4
1630
camera.3D.rotation.vertical: 1.0
1731
camera.3D.zoom: 1.0
1832
camera.R-Phi.zoom: 1.0
1933
camera.Rho-Z.zoom: 1.0
2034

2135
simple.geom.default: R3
22-
simple.geom.R3.path: /home/ed/geom/O2
36+
simple.geom.R3.path: /home/jmy/CERN/alice/dev/o2-dev/O2/EventVisualisation/Geometry
2337

2438
tracks.width: 2
2539

@@ -30,67 +44,49 @@ tracks.byType.kaon: 400
3044
tracks.byType.proton: 797
3145
tracks.byType.unknown: 920
3246

33-
PHS.draw: 1
47+
ITS.draw: 1
3448
TPC.draw: 1
35-
HMP.draw: 1
3649
TRD.draw: 1
37-
MCH.draw: 1
38-
EMC.draw: 1
39-
ACO.draw: 1
40-
ITS.draw: 1
4150
TOF.draw: 1
4251
MFT.draw: 1
43-
T00.draw: 1
44-
FIT.draw: 1
45-
AD0.draw: 1
46-
FMD.draw: 1
52+
MCH.draw: 1
53+
MID.draw: 1
54+
PHS.draw: 1
55+
EMC.draw: 1
56+
CPV.draw: 1
4757

48-
PHS.color: 53
49-
TPC.color: 3
50-
HMP.color: 5
51-
TRD.color: 921
52-
MCH.color: 920
53-
EMC.color: 53
54-
ACO.color: 920
5558
ITS.color: 634
56-
TOF.color: 634
59+
TPC.color: 3
60+
TRD.color: 800
61+
TOF.color: 3
5762
MFT.color: 920
58-
T00.color: 2
59-
FIT.color: 2
60-
AD0.color: 5
61-
FMD.color: 906
63+
MCH.color: 2
64+
MID.color: 4
65+
PHS.color: 5
66+
EMC.color: 53
67+
CPV.color: 920
6268

63-
PHS.trans: 70
64-
TPC.trans: 60
65-
HMP.trans: 70
66-
TRD.trans: 80
69+
ITS.trans: 70
70+
TPC.trans: 70
71+
TRD.trans: 50
72+
TOF.trans: 50
73+
MFT.trans: 10
6774
MCH.trans: 80
68-
EMC.trans: 80
69-
ACO.trans: 50
70-
ITS.trans: 50
71-
TOF.trans: 60
72-
MFT.trans: 80
73-
T00.trans: 70
74-
FIT.trans: 40
75-
AD0.trans: 40
76-
FMD.trans: 50
75+
MID.trans: 80
76+
PHS.trans: 50
77+
EMC.trans: 50
78+
CPV.trans: 50
7779

78-
MCH.line.color: 920
80+
ITS.line.color: 1
7981
TPC.line.color: 1
80-
HMP.line.color: 1
81-
PHS.line.color: 1
8282
TRD.line.color: 1
8383
TOF.line.color: 1
84+
MFT.line.color: 1
85+
MCH.line.color: 920
86+
MID.line.color: 1
87+
PHS.line.color: 1
8488
EMC.line.color: 1
85-
ITS.line.color: 1
86-
MFT.line.color: 0
87-
T00.line.color: 1
88-
FIT.line.color: 1
89-
AD0.line.color: 1
90-
FMD.line.color: 907
91-
92-
OCDB.default.path: local:///home/ed/cdb
93-
89+
CPV.line.color: 1
9490

9591
#Gui.DefaultFont: -*-helvetica-medium-r-*-*-20-*-*-*-*-*-iso8859-1
9692
#Gui.MenuFont: -*-helvetica-medium-r-*-*-20-*-*-*-*-*-iso8859-1

EventVisualisation/View/include/EventVisualisationView/EventManager.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ class EventManager final : public TEveEventManager, public TQObject
107107
void operator=(EventManager const&) = delete;
108108

109109
void displayVisualisationEvent(VisualisationEvent& event, const std::string& detectorName);
110-
void displayCalorimeters(VisualisationEvent& event);
110+
void displayCalorimeters(VisualisationEvent& event, const std::string& detectorName);
111111
void saveVisualisationSettings();
112112
void restoreVisualisationSettings();
113113
};

EventVisualisation/View/src/EventManager.cxx

Lines changed: 39 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,11 @@ void EventManager::displayCurrentEvent()
8888
auto displayList = dataSource->getVisualisationList(no, EventManagerFrame::getInstance().getMinTimeFrameSliderValue(), EventManagerFrame::getInstance().getMaxTimeFrameSliderValue(), EventManagerFrame::MaxRange);
8989
for (auto it = displayList.begin(); it != displayList.end(); ++it) {
9090
if (it->second == EVisualisationGroup::EMC || it->second == EVisualisationGroup::PHS) {
91-
event.appendAnotherEventCalo(it->first);
91+
displayCalorimeters(it->first, gVisualisationGroupName[it->second]);
9292
} else {
9393
displayVisualisationEvent(it->first, gVisualisationGroupName[it->second]);
9494
}
9595
}
96-
displayCalorimeters(event);
9796

9897
for (int i = 0; i < EVisualisationDataType::NdataTypes; ++i) {
9998
multiView->registerElement(dataTypeLists[i]);
@@ -253,61 +252,67 @@ void EventManager::displayVisualisationEvent(VisualisationEvent& event, const st
253252
LOG(info) << "clusters: " << clusterCount << " detector: " << detectorName << ":" << dataTypeLists[EVisualisationDataType::Clusters]->NumChildren();
254253
}
255254

256-
void EventManager::displayCalorimeters(VisualisationEvent& event)
255+
void EventManager::displayCalorimeters(VisualisationEvent& event, const std::string& detectorName)
257256
{
258-
struct CaloInfo {
259-
unsigned int index;
260-
std::string name;
261-
std::string configColor;
262-
int defaultColor;
263-
float sizeEta;
264-
float sizePhi;
265-
std::string configNoise;
266-
float defaultNoise;
267-
};
268-
269-
// TODO: calculate values based on info available in O2
270-
const std::unordered_map<o2::dataformats::GlobalTrackID::Source, CaloInfo> caloInfos =
271-
{
272-
{o2::dataformats::GlobalTrackID::EMC, {0, "emcal", "emcal.tower.color", kYellow, 0.0143, 0.0143, "emcal.tower.noise", 0}},
273-
{o2::dataformats::GlobalTrackID::PHS, {1, "phos", "phos.tower.color", kYellow, 0.0046, 0.00478, "phos.tower.noise", 200}},
274-
};
275-
276257
int size = event.getCaloCount();
277258
if (size > 0) {
259+
const std::string detector = detectorName == "EMC" ? "emcal" : "phos";
260+
struct CaloInfo {
261+
std::string name;
262+
std::string configColor;
263+
int defaultColor;
264+
std::string configSizeEta;
265+
float sizeEta;
266+
std::string configSizePhi;
267+
float sizePhi;
268+
std::string configNoise;
269+
float defaultNoise;
270+
std::string configTransparency;
271+
int defaultTransparency;
272+
std::string configBarrelRadius;
273+
int defaultBarrelRadius;
274+
double scale;
275+
};
278276
TEnv settings;
279277
ConfigurationManager::getInstance().getConfig(settings);
280-
const bool showAxes = settings.GetValue("axes.show", false);
281278

282-
auto data = new TEveCaloDataVec(caloInfos.size());
279+
// TODO: calculate values based on info available in O2
280+
static const std::unordered_map<o2::dataformats::GlobalTrackID::Source, CaloInfo> caloInfos =
281+
{
282+
{o2::dataformats::GlobalTrackID::EMC, {"emcal", "emcal.tower.color", kYellow, "emcal.tower.size.eta", 0.0143, "emcal.tower.size.phi", 0.0143, "emcal.tower.noise", 0, "emcal.tower.transparency", 101, "emcal.barel.radius", 500, settings.GetValue("emcal.tower.scale", 1.0)}},
283+
{o2::dataformats::GlobalTrackID::PHS, {"phos", "phos.tower.color", kYellow, "phos.tower.size.eta", 0.0046, "phos.tower.size.eta", 0.00478, "phos.tower.noise", 200, "phos.tower.transparency", 101, "phos.barel.radius", 550, settings.GetValue("phos.tower.scale", 1.0)}},
284+
};
285+
286+
auto data = new TEveCaloDataVec(1);
283287
data->IncDenyDestroy();
288+
auto key = detectorName == "EMC" ? o2::dataformats::GlobalTrackID::EMC : o2::dataformats::GlobalTrackID::PHS;
284289

285-
for (const auto& [det, info] : caloInfos) {
286-
data->RefSliceInfo(info.index).Setup(info.name.c_str(), settings.GetValue(info.configNoise.c_str(), info.defaultNoise), settings.GetValue(info.configColor.c_str(), info.defaultColor));
287-
}
290+
const CaloInfo& info = caloInfos.at(key);
291+
data->RefSliceInfo(0).Setup(info.name.c_str(),
292+
settings.GetValue(info.configNoise.c_str(), info.defaultNoise),
293+
settings.GetValue(info.configColor.c_str(), info.defaultColor),
294+
settings.GetValue(info.configTransparency.c_str(), info.defaultTransparency));
295+
296+
const auto dEta = settings.GetValue(info.configSizeEta.c_str(), info.sizeEta) / 2.0;
297+
const auto dPhi = settings.GetValue(info.configSizePhi.c_str(), info.sizePhi) / 2.0;
298+
const float barrelRadius = settings.GetValue(info.configBarrelRadius.c_str(), info.defaultBarrelRadius);
288299

289300
for (const auto& calo : event.getCalorimetersSpan()) {
290-
const auto& info = caloInfos.at(calo.getSource());
291-
const auto dEta = info.sizeEta / 2;
292-
const auto dPhi = info.sizePhi / 2;
293301
data->AddTower(calo.getEta() - dEta, calo.getEta() + dEta, calo.getPhi() - dPhi, calo.getPhi() + dPhi);
294-
data->FillSlice(info.index, calo.getEnergy());
302+
data->FillSlice(0, info.scale * calo.getEnergy());
295303
}
296304

297305
data->DataChanged();
298306
data->SetAxisFromBins();
299307

300-
const float barrelRadius = settings.GetValue("barrel.radius", 375);
301-
302308
auto calo3d = new TEveCalo3D(data);
303-
calo3d->SetName("Calorimeters");
309+
calo3d->SetName(detectorName.c_str());
304310

305311
calo3d->SetBarrelRadius(barrelRadius);
306312
calo3d->SetEndCapPos(barrelRadius);
307313
calo3d->SetRnrFrame(false, false); // do not draw barrel grid
308314

309315
dataTypeLists[EVisualisationDataType::Calorimeters]->AddElement(calo3d);
310-
MultiView::getInstance()->registerElement(calo3d);
311316
}
312317
}
313318

0 commit comments

Comments
 (0)