|
22 | 22 | #include "EventVisualisationView/Options.h" |
23 | 23 | #include "EventVisualisationDataConverter/VisualisationEvent.h" |
24 | 24 | #include <EventVisualisationBase/DataSourceOnline.h> |
25 | | - |
| 25 | +#include "EventVisualisationBase/ConfigurationManager.h" |
26 | 26 | #include <TEveManager.h> |
27 | 27 | #include <TEveTrack.h> |
28 | | -#include <TEveProjectionManager.h> |
29 | 28 | #include <TEveTrackPropagator.h> |
30 | 29 | #include <TEnv.h> |
31 | 30 | #include <TEveElement.h> |
@@ -70,16 +69,22 @@ void EventManager::displayCurrentEvent() |
70 | 69 | dataTypeLists[i] = new TEveElementList(gDataTypeNames[i].c_str()); |
71 | 70 | } |
72 | 71 |
|
| 72 | + VisualisationEvent event; // collect calorimeters in one drawing step |
73 | 73 | auto displayList = getDataSource()->getVisualisationList(no, EventManagerFrame::getInstance().getMinTimeFrameSliderValue(), EventManagerFrame::getInstance().getMaxTimeFrameSliderValue(), EventManagerFrame::MaxRange); |
74 | 74 | for (auto it = displayList.begin(); it != displayList.end(); ++it) { |
75 | | - displayVisualisationEvent(it->first, gVisualisationGroupName[it->second]); |
| 75 | + if (it->second == EVisualisationGroup::EMC || it->second == EVisualisationGroup::PHS) { |
| 76 | + event.appendAnotherEventCalo(it->first); |
| 77 | + } else { |
| 78 | + displayVisualisationEvent(it->first, gVisualisationGroupName[it->second]); |
| 79 | + } |
76 | 80 | } |
| 81 | + displayCalorimeters(event); |
77 | 82 |
|
78 | 83 | for (int i = 0; i < EVisualisationDataType::NdataTypes; ++i) { |
79 | | - MultiView::getInstance()->registerElement(dataTypeLists[i]); |
| 84 | + if (i != EVisualisationGroup::EMC && i != EVisualisationGroup::PHS) { |
| 85 | + MultiView::getInstance()->registerElement(dataTypeLists[i]); |
| 86 | + } |
80 | 87 | } |
81 | | - // displayCalorimeters(displayList[0].first); |
82 | | - |
83 | 88 | MultiView::getInstance()->getAnnotation()->SetText(TString::Format("Run: %d", getDataSource()->getRunNumber())); |
84 | 89 | } |
85 | 90 | MultiView::getInstance()->redraw3D(); |
@@ -175,12 +180,9 @@ void EventManager::displayVisualisationEvent(VisualisationEvent& event, const st |
175 | 180 | for (size_t i = 0; i < trackCount; ++i) { |
176 | 181 | VisualisationTrack track = event.getTrack(i); |
177 | 182 | TEveRecTrackD t; |
178 | | - // double* p = track.getMomentum(); |
179 | | - // t.fP = {p[0], p[1], p[2]}; |
180 | 183 | t.fSign = track.getCharge() > 0 ? 1 : -1; |
181 | 184 | auto* vistrack = new TEveTrack(&t, &TEveTrackPropagator::fgDefault); |
182 | 185 | vistrack->SetLineColor(kMagenta); |
183 | | - // vistrack->SetName(detectorName + " track: " + i); |
184 | 186 | vistrack->SetName(track.getGIDAsString().c_str()); |
185 | 187 | size_t pointCount = track.getPointCount(); |
186 | 188 | vistrack->Reset(pointCount); |
@@ -226,37 +228,42 @@ void EventManager::displayVisualisationEvent(VisualisationEvent& event, const st |
226 | 228 |
|
227 | 229 | LOG(info) << "tracks: " << trackCount << " detector: " << detectorName << ":" << dataTypeLists[EVisualisationDataType::Tracks]->NumChildren(); |
228 | 230 | LOG(info) << "clusters: " << clusterCount << " detector: " << detectorName << ":" << dataTypeLists[EVisualisationDataType::Clusters]->NumChildren(); |
229 | | - |
230 | | - displayCalorimeters(event); |
231 | 231 | } |
232 | 232 |
|
233 | 233 | void EventManager::displayCalorimeters(VisualisationEvent& event) |
234 | 234 | { |
235 | 235 | int size = event.getCaloCount(); |
236 | 236 | if (size > 0) { |
237 | | - auto data = new TEveCaloDataVec(1); |
| 237 | + TEnv settings; |
| 238 | + ConfigurationManager::getInstance().getConfig(settings); |
| 239 | + const bool showAxes = settings.GetValue("axes.show", false); |
| 240 | + |
| 241 | + auto data = new TEveCaloDataVec(2); // number of detectors |
238 | 242 | data->IncDenyDestroy(); |
239 | | - data->RefSliceInfo(0).Setup("Data", 0.3, kYellow); |
| 243 | + data->RefSliceInfo(0).Setup("emcal", 0.3, settings.GetValue("emcal.tower.color", kYellow)); |
| 244 | + data->RefSliceInfo(1).Setup("phos", 0.3, settings.GetValue("phos.tower.color", kYellow)); |
240 | 245 |
|
241 | 246 | for (auto calo : event.getCalorimetersSpan()) { |
242 | 247 | const float dX = 0.173333; |
243 | | - const float dY = 0.104667; |
| 248 | + const float dY = 0.104667; // to trzeba wziac ze stałych |
244 | 249 | data->AddTower(calo.getEta(), calo.getEta() + dX, calo.getPhi(), calo.getPhi() + dY); |
245 | | - data->FillSlice(0, calo.getEnergy()); |
| 250 | + data->FillSlice(calo.getSource() == o2::dataformats::GlobalTrackID::PHS ? 1 : 0, calo.getEnergy()); // do ktorego slice |
246 | 251 | } |
247 | 252 |
|
248 | 253 | data->DataChanged(); |
249 | 254 | data->SetAxisFromBins(); |
250 | 255 |
|
251 | | - float barrelRadius = 375; |
252 | 256 | float endCalPosition = 400; |
253 | 257 |
|
254 | 258 | auto calo3d = new TEveCalo3D(data); |
| 259 | + calo3d->SetName("Calorimeters"); |
255 | 260 |
|
256 | | - calo3d->SetBarrelRadius(barrelRadius); |
257 | | - calo3d->SetEndCapPos(endCalPosition); |
| 261 | + calo3d->SetBarrelRadius(settings.GetValue("barrel.radius", 375)); // barel staring point |
| 262 | + calo3d->SetEndCapPos(endCalPosition); // scaling factor |
| 263 | + calo3d->SetRnrFrame(false, false); // do not draw barel |
258 | 264 |
|
259 | 265 | dataTypeLists[EVisualisationDataType::Calorimeters]->AddElement(calo3d); |
| 266 | + MultiView::getInstance()->registerElement(calo3d); |
260 | 267 | } |
261 | 268 | } |
262 | 269 |
|
|
0 commit comments