|
32 | 32 | #include "MFTBase/GeometryTGeo.h" |
33 | 33 | #include "ITSBase/GeometryTGeo.h" |
34 | 34 | #include "PHOSBase/Geometry.h" |
| 35 | +#include "EMCALBase/Geometry.h" |
35 | 36 | #include <TGeoBBox.h> |
36 | 37 | #include <tuple> |
37 | 38 | #include <gsl/span> |
@@ -175,6 +176,7 @@ void EveWorkflowHelper::selectTracks(const CalibObjectsConst* calib, |
175 | 176 | void EveWorkflowHelper::draw() |
176 | 177 | { |
177 | 178 | this->drawPHOS(); |
| 179 | + this->drawEMCAL(); |
178 | 180 |
|
179 | 181 | for (size_t it = 0; it < mTrackSet.trackGID.size(); it++) { |
180 | 182 | const auto& gid = mTrackSet.trackGID[it]; |
@@ -370,6 +372,62 @@ void EveWorkflowHelper::drawPHOS() |
370 | 372 | } |
371 | 373 | } |
372 | 374 |
|
| 375 | +void EveWorkflowHelper::drawEMCAL() |
| 376 | +{ |
| 377 | + // LOG(info) << mRecoCont.getEMCALCells().size() << "----------------------------------------------------------------------------- !mRecoCont.getEMCALCells().size()"; |
| 378 | + auto triggers = mRecoCont.getEMCALTriggers(); |
| 379 | + for (auto trigger : triggers) { |
| 380 | + // trigger.getBCData().toLong() // timestamp in ns |
| 381 | + // trigger.getFirstEntry() |
| 382 | + // trigger.getFirstEntry() range in the emcal cell vector in RecoContainer |
| 383 | + // this will be towers belongs to BC (the same for emcal/phos) ++mattermost |
| 384 | + } |
| 385 | + |
| 386 | + for (auto emcal : mRecoCont.getEMCALCells()) { |
| 387 | + int id = emcal.getTower(); |
| 388 | + // supermodule ID, module number, index of cell in module in phi, index of cell in module in eta |
| 389 | + auto index = this->mEMCALGeom->GetCellIndex(id); |
| 390 | + // Point3D with x,y,z coordinates of cell with absId inside SM |
| 391 | + auto relPosCell = this->mEMCALGeom->RelPosCellInSModule(id); |
| 392 | + TGeoNode* node = gGeoManager->GetTopVolume()->FindNode("XEN1"); |
| 393 | + auto nSupermodules = this->mEMCALGeom->GetNumberOfSuperModules(); |
| 394 | + auto fPhiTileSize = this->mEMCALGeom->GetPhiTileSize(); |
| 395 | + auto fEtaTileSize = this->mEMCALGeom->GetEtaTileSize(); |
| 396 | + auto sm = std::get<0>(index); |
| 397 | + auto module_number = std::get<1>(index); |
| 398 | + auto index_module_phi = std::get<2>(index); |
| 399 | + auto index_module_eta = std::get<3>(index); |
| 400 | + |
| 401 | + const TGeoHMatrix* matrix = this->mEMCALGeom->GetMatrixForSuperModuleFromGeoManager(sm); |
| 402 | + const Double_t* translation = matrix->GetTranslation(); |
| 403 | + /* |
| 404 | + LOG(info) << "EMCAL -----------------------------------------------------------------------------------------------"; |
| 405 | + LOG(info) << "EMCAL id: "<< id << " emcal.getTower()"; |
| 406 | + LOG(info) << "EMCAL relPosCell: "<< relPosCell << " this->mEMCALGeom->RelPosCellInSModule(id);"; |
| 407 | + LOG(info) << "EMCAL nSupermodules: "<< nSupermodules << " this->mEMCALGeom->GetNumberOfSuperModules()"; |
| 408 | + LOG(info) << "EMCAL fPhiTileSize: "<< fPhiTileSize << " this->mEMCALGeom->GetPhiTileSize()"; |
| 409 | + LOG(info) << "EMCAL fEtaTileSize: "<< fEtaTileSize << " this->mEMCALGeom->GetEtaTileSize();" ; |
| 410 | + LOG(info) << "EMCAL node: "<< node ; |
| 411 | + LOG(info) << "EMCAL sm: "<< sm ; |
| 412 | + LOG(info) << "EMCAL module_number: "<< module_number ; |
| 413 | + LOG(info) << "EMCAL index_module_phi: "<< index_module_phi ; |
| 414 | + LOG(info) << "EMCAL index_module_eta: "<< index_module_eta ; |
| 415 | + LOG(info) << "EMCAL translation: "<< "["<<translation[0]<<","<<translation[1]<<","<<translation[2]<<"]" ; |
| 416 | + */ |
| 417 | + TVector3 gPos; |
| 418 | + gPos[0] = translation[0] + relPosCell.X(); |
| 419 | + gPos[1] = translation[1] + relPosCell.Y(); |
| 420 | + gPos[2] = translation[2] + relPosCell.Z(); |
| 421 | + auto vCalo = mEvent.addCalo({.time = static_cast<float>(emcal.getTimeStamp()), |
| 422 | + .energy = emcal.getEnergy(), |
| 423 | + .phi = (float)gPos.Phi(), |
| 424 | + .eta = (float)gPos.Eta(), |
| 425 | + .PID = 0, |
| 426 | + .gid = GID::getSourceName(GID::EMC), |
| 427 | + .source = GID::EMC}); |
| 428 | + } |
| 429 | +} |
| 430 | + |
373 | 431 | void EveWorkflowHelper::drawITSTPC(GID gid, float trackTime, GID::Source source) |
374 | 432 | { |
375 | 433 | // LOG(info) << "EveWorkflowHelper::drawITSTPC " << gid; |
@@ -723,6 +781,7 @@ EveWorkflowHelper::EveWorkflowHelper(const FilterSet& enabledFilters, std::size_ |
723 | 781 | this->mMFTGeom->fillMatrixCache(o2::math_utils::bit2Mask(o2::math_utils::TransformType::T2L, o2::math_utils::TransformType::L2G)); |
724 | 782 | this->mITSGeom = o2::its::GeometryTGeo::Instance(); |
725 | 783 | this->mITSGeom->fillMatrixCache(o2::math_utils::bit2Mask(o2::math_utils::TransformType::T2L, o2::math_utils::TransformType::T2GRot, o2::math_utils::TransformType::L2G)); |
| 784 | + this->mEMCALGeom = o2::emcal::Geometry::GetInstance(""); |
726 | 785 | this->mPHOSGeom = o2::phos::Geometry::GetInstance(""); |
727 | 786 | this->mTPCFastTransform = (o2::tpc::TPCFastTransformHelperO2::instance()->create(0)); |
728 | 787 | const auto& elParams = o2::tpc::ParameterElectronics::Instance(); |
|
0 commit comments