16#include "CaloDetDescr/CaloDetDescrElement.h"
22#include "GaudiKernel/Bootstrap.h"
23#include "GaudiKernel/ISvcLocator.h"
24#include "GaudiKernel/IMessageSvc.h"
41 if (i >= tile_min && i < tile_max)
continue;
71 for(
int i = 0; i < nb; i++) {
81 std::cout <<
" CaloDetDescrManager_Base: \n";
83 std::cout <<
" Number of Calo descriptors : " <<
m_descr_vec.size() <<
"\n";
86 for(
int i=0 ; i<ntot; i++ )
88 std::cout <<
"\n ------ Calo descriptor number " << i <<
"\n";
139 int sCal = (int)subCalo;
146 int sCal = (int) subCalo;
153 int sCal = (int) subCalo;
178 int sCal = (int) subCalo;
181 else return nullptr ;
186 int sampling_or_module,
199 double deltabest=9999.;
203 while (!inCell && niter<3) {
206 if (!reg)
return nullptr;
210 int ieta = reg->eta_channel(eta2);
211 int iphi = reg->phi_channel(phi2);
214 if(ieta < 0)
return elt;
215 if(iphi < 0)
return elt;
221 if (
m_cell_id->cell_id (caloCellHash) != cellId)
return elt;
224 double deta=std::fabs(
eta-elt->
eta())-0.5*elt->
deta();
226 if (deta>0. || dphi > 0.) {
229 eta2=eta2 + (
eta-elt->
eta());
230 delta = delta + deta;
234 delta = delta + dphi;
237 if (delta<deltabest) {
264 if ( sample != CaloCell_ID::TileBar0 && sample != CaloCell_ID::TileBar1 &&
265 sample != CaloCell_ID::TileBar2 && sample != CaloCell_ID::TileGap1 &&
266 sample != CaloCell_ID::TileGap2 && sample != CaloCell_ID::TileGap3 &&
267 sample != CaloCell_ID::TileExt0 && sample != CaloCell_ID::TileExt1 &&
268 sample != CaloCell_ID::TileExt2 ) {
276 double deltabest=9999.;
278 while (!inCell && niter<3) {
281 if ( ! reg )
return elt;
285 int ieta = reg->eta_channel(eta2);
286 int iphi = reg->phi_channel(phi2);
288 if(ieta < 0)
return elt;
289 if(iphi < 0)
return elt;
295 if (
m_cell_id->cell_id (caloCellHash) != cellId)
return elt;
297 double deta=std::fabs(
eta-elt->
eta())-0.5*elt->
deta();
299 if (deta>0. || dphi > 0.) {
302 eta2=eta2 + (
eta-elt->
eta());
303 delta = delta + deta;
307 delta = delta + dphi;
309 if (delta<deltabest) {
333 if ( pt->getSampling() == sample &&
334 pt->eta()+pt->deta()/2 >=
eta &&
335 pt->eta()-pt->deta()/2 <=
eta &&
336 dphi <= pt->dphi()/2 )
358 if ( sample != CaloCell_ID::TileBar0 && sample != CaloCell_ID::TileBar1 &&
359 sample != CaloCell_ID::TileBar2 && sample != CaloCell_ID::TileGap1 &&
360 sample != CaloCell_ID::TileGap2 && sample != CaloCell_ID::TileGap3 &&
361 sample != CaloCell_ID::TileExt0 && sample != CaloCell_ID::TileExt1 &&
362 sample != CaloCell_ID::TileExt2 ) {
370 double deltabest=9999.;
372 while (!inCell && niter<3) {
375 if ( ! reg )
return elt;
380 int ieta = reg->eta_channel_raw(eta2);
381 int iphi = reg->phi_channel_raw(phi2);
383 if(ieta < 0)
return elt;
384 if(iphi < 0)
return elt;
390 if (
m_cell_id->cell_id (caloCellHash) != cellId)
return elt;
395 if (deta>0. || dphi > 0.) {
399 delta = delta + deta;
403 delta = delta + dphi;
405 if (delta<deltabest) {
430 if ( pt->getSampling() == sample &&
431 pt->eta()+pt->deta()/2 <=
eta &&
432 pt->eta()-pt->deta()/2 >=
eta &&
433 pt->phi()+pt->phi()/2 <=
phi &&
434 pt->phi()-pt->phi()/2 >=
phi ) elt = pt ;
450 if (
eta < (descr->reg_min()-0.01) ||
eta > (descr->reg_max()+0.01) )
return elt;
457 for (
int ieta=0; ieta<descr->n_eta(); ieta++) {
458 for (
int iphi=0; iphi<descr->n_phi(); iphi++) {
459 cellId =
m_cell_id->cell_id(regId, ieta, iphi);
460 caloCellHash =
m_cell_id->calo_cell_hash(cellId);
462 double deta = (
eta-elt2->
eta());
464 double dr = (deta*deta+dphi*dphi);
486 if (std::fabs(
eta) < (descr->calo_eta_min()-0.01) || std::fabs(
eta) > (descr->calo_eta_max()+0.01) )
return elt;
493 for (
int ieta=0; ieta<descr->n_eta(); ieta++) {
494 for (
int iphi=0; iphi<descr->n_phi(); iphi++) {
495 cellId =
m_cell_id->cell_id(regId, ieta, iphi);
496 caloCellHash =
m_cell_id->calo_cell_hash(cellId);
500 double dr = (deta*deta+dphi*dphi);
600 int sampling_or_module,
623 || (!
barrel && reg->is_lar_em_endcap())
624 || (
barrel && reg->is_lar_em_barrel())
633 if(reg->eta_channel(
eta) >=0 && reg->phi_channel(
phi) >=0)
637 int reg_sampl = reg->getSampling(0);
640 if(reg->is_lar_em_barrel())
642 if(reg_sampl == CaloCell_ID::PreSamplerB) desc0 = reg;
643 else if(reg_sampl == CaloCell_ID::EMB1) desc1 = reg;
644 else if(reg_sampl == CaloCell_ID::EMB2) desc2 = reg;
645 else if(reg_sampl == CaloCell_ID::EMB3) desc3 = reg;
647 else if(reg->is_lar_em_endcap())
649 if(reg_sampl == CaloCell_ID::PreSamplerE) desc0 = reg;
650 else if(reg_sampl == CaloCell_ID::EME1) desc1 = reg;
651 else if(reg_sampl == CaloCell_ID::EME2) desc2 = reg;
652 else if(reg_sampl == CaloCell_ID::EME3) desc3 = reg;
654 else if(reg->is_lar_hec())
656 if(reg_sampl == CaloCell_ID::HEC0) desc0 = reg;
657 else if(reg_sampl == CaloCell_ID::HEC1) desc1 = reg;
658 else if(reg_sampl == CaloCell_ID::HEC2) desc2 = reg;
659 else if(reg_sampl == CaloCell_ID::HEC3) desc3 = reg;
661 else if(reg->is_lar_fcal())
663 if(reg_sampl == CaloCell_ID::FCAL0) desc0 = reg;
664 else if(reg_sampl == CaloCell_ID::FCAL1) desc1 = reg;
665 else if(reg_sampl == CaloCell_ID::FCAL2) desc2 = reg;
672 if(sampling_or_module == 0)
return desc0;
673 else if(sampling_or_module == 1)
return desc1;
674 else if(sampling_or_module == 2)
return desc2;
675 else if(sampling_or_module == 3)
return desc3;
681 double eta,
double phi)
const
688 if ( sample == CaloCell_ID::TileBar0 ||
689 sample == CaloCell_ID::TileBar1 ||
690 sample == CaloCell_ID::TileBar2 ||
691 sample == CaloCell_ID::TileGap1 ||
692 sample == CaloCell_ID::TileGap2 ||
693 sample == CaloCell_ID::TileGap3 ||
694 sample == CaloCell_ID::TileExt0 ||
695 sample == CaloCell_ID::TileExt1 ||
696 sample == CaloCell_ID::TileExt2 )
return desc;
698 for (
unsigned int i=0; i<
m_descr_vec.size(); i++ ) {
702 if ( reg->eta_channel(
eta) >=0 && reg->phi_channel(
phi) >=0) {
705 int reg_sampl = reg->getSampling(0);
706 if ( reg_sampl == sample ) desc = reg;
716 double eta,
double phi)
const
725 if ( sample == CaloCell_ID::TileBar0 ||
726 sample == CaloCell_ID::TileBar1 ||
727 sample == CaloCell_ID::TileBar2 ||
728 sample == CaloCell_ID::TileGap1 ||
729 sample == CaloCell_ID::TileGap2 ||
730 sample == CaloCell_ID::TileGap3 ||
731 sample == CaloCell_ID::TileExt0 ||
732 sample == CaloCell_ID::TileExt1 ||
733 sample == CaloCell_ID::TileExt2 )
return desc;
735 for (
unsigned int i=0; i<
m_descr_vec.size(); i++ ) {
739 int reg_sampl = reg->getSampling(0);
740 if ( reg_sampl == sample ) {
741 if ( reg->eta_channel_raw(
eta) >=0 && reg->phi_channel_raw(
phi) >=0) {
794 double phi_min,
double phi_max,
795 std::vector<IdentifierHash> & cell_list )
const
798 if ( eta_min >= eta_max )
return;
799 if ( phi_min >= phi_max )
return;
801 std::vector<IdentifierHash> one_list;
804 for (
unsigned int i=0; i<
m_descr_vec.size(); i++ ) {
807 cellsInZone(eta_min, eta_max, phi_min, phi_max, reg, one_list);
808 if (cell_list.empty())
809 cell_list.swap (one_list);
811 cell_list.insert (cell_list.end(), one_list.begin(), one_list.end());
817 cell_list.insert (cell_list.end(), one_list.begin(), one_list.end());
821 double phi_min,
double phi_max,
823 std::vector<IdentifierHash> & cell_list)
const
826 if ( eta_min >= eta_max )
return;
827 if ( phi_min >= phi_max )
return;
829 std::vector<IdentifierHash> one_list;
834 for (
unsigned int i=0; i<
m_descr_vec.size(); i++ ) {
837 if ( subCalo == reg->getSubCalo() ) {
838 cellsInZone(eta_min, eta_max, phi_min, phi_max, reg, one_list);
839 if (cell_list.empty())
840 cell_list.swap (one_list);
842 cell_list.insert (cell_list.end(),
843 one_list.begin(), one_list.end());
856 if ( tile_elt->
eta()+tile_elt->
deta()/2. > eta_min &&
857 tile_elt->
eta()-tile_elt->
deta()/2. < eta_max) {
862 if(dphi1 >=0. && dphi2 >= 0.) {
863 if (cell_list.empty()) {
865 cell_list.reserve (
static_cast<int>(
866 ((eta_max-eta_min) / tile_elt->
deta()) *
867 ((phi_max-phi_min) / tile_elt->
dphi()) * 3));
869 cell_list.push_back(tile_elt->
calo_hash());
878 double phi_min,
double phi_max,
880 std::vector<IdentifierHash> & cell_list)
const
883 if ( eta_min >= eta_max )
return;
884 if ( phi_min >= phi_max )
return;
886 std::vector<IdentifierHash> one_list;
888 if ( sample != CaloCell_ID::TileBar0 &&
889 sample != CaloCell_ID::TileBar1 &&
890 sample != CaloCell_ID::TileBar2 &&
891 sample != CaloCell_ID::TileGap1 &&
892 sample != CaloCell_ID::TileGap2 &&
893 sample != CaloCell_ID::TileGap3 &&
894 sample != CaloCell_ID::TileExt0 &&
895 sample != CaloCell_ID::TileExt1 &&
896 sample != CaloCell_ID::TileExt2 ) {
898 for (
unsigned int i=0; i<
m_descr_vec.size(); i++ ) {
903 if ( sample == reg->getSampling(0) ) {
904 cellsInZone(eta_min, eta_max, phi_min, phi_max, reg, one_list);
905 if (cell_list.empty())
906 cell_list.swap (one_list);
908 cell_list.insert (cell_list.end(),
909 one_list.begin(), one_list.end());
924 if ( tile_elt->
eta()+tile_elt->
deta()/2. > eta_min &&
925 tile_elt->
eta()-tile_elt->
deta()/2. < eta_max) {
930 if(dphi1 >=0. && dphi2 >= 0.) {
931 if (cell_list.empty()) {
933 cell_list.reserve (
static_cast<int>(
934 ((eta_max-eta_min) / tile_elt->
deta()) *
935 ((phi_max-phi_min) / tile_elt->
dphi()) * 3));
937 cell_list.push_back(tile_elt->
calo_hash());
947 double phi_min,
double phi_max,
949 int sampling_or_module,
950 std::vector<IdentifierHash> & cell_list)
const
953 if ( eta_min >= eta_max )
return;
954 if ( phi_min >= phi_max )
return;
959 std::vector<IdentifierHash> one_list;
961 for (
unsigned int i=0; i<
m_descr_vec.size(); i++ ) {
965 if ( subCalo == reg->getSubCalo() &&
966 m_cell_id->sampling(regId) == sampling_or_module ) {
967 cellsInZone(eta_min, eta_max, phi_min, phi_max, reg, one_list);
968 if (cell_list.empty())
969 cell_list.swap (one_list);
971 cell_list.insert (cell_list.end(),
972 one_list.begin(), one_list.end());
981 int sampling_or_module,
983 std::vector<IdentifierHash> & cell_list)
const
987 double eta_min, eta_max, phi_min, phi_max;
988 double weta = (ncell_eta-1)/2.;
989 double wphi = (ncell_phi-1)/2.;
991 std::vector<IdentifierHash> one_list;
995 for (
unsigned int i=0; i<
m_descr_vec.size(); i++ ) {
999 if ( subCalo == reg->getSubCalo() &&
1000 m_cell_id->sampling(regId) == sampling_or_module) {
1002 double eta_gran =
m_cell_id->etaGranularity(regId);
1003 double phi_gran =
m_cell_id->phiGranularity(regId);
1005 eta_min =
eta-weta*eta_gran;
1006 eta_max =
eta+weta*eta_gran;
1007 phi_min =
phi-wphi*phi_gran;
1008 phi_max =
phi+wphi*phi_gran;
1009 cellsInZone(eta_min, eta_max, phi_min, phi_max, reg, one_list);
1010 cell_list.reserve (cell_list.size() + one_list.size());
1011 for (
unsigned int i = 0; i<one_list.size(); i++ ){
1015 double elt_eta = elt->
eta();
1016 double elt_phi = elt->
phi();
1018 if ( std::abs(
eta - elt_eta) <= weta )
1019 if ( std::abs(
phi - elt_phi) <= wphi )
1020 cell_list.push_back(one_list[i]);
1036 eta_min =
eta-weta*tile_elt->
deta();
1037 eta_max =
eta+weta*tile_elt->
deta();
1039 if ( tile_elt->
eta()+tile_elt->
deta()/2. > eta_min &&
1040 tile_elt->
eta()-tile_elt->
deta()/2. < eta_max) {
1041 phi_min =
phi-wphi*tile_elt->
dphi();
1042 phi_max =
phi+wphi*tile_elt->
dphi();
1046 if(dphi1 >=0. && dphi2 >= 0. ) {
1047 if (cell_list.empty()) {
1049 cell_list.reserve (
static_cast<int> (
1050 ((eta_max-eta_min) / tile_elt->
deta()) *
1051 ((phi_max-phi_min) / tile_elt->
dphi()) * 3));
1053 cell_list.push_back(tile_elt->
calo_hash());
1063 double phi_min,
double phi_max,
1065 std::vector<IdentifierHash> & cell_list)
const
1070 if ( ! descr )
return;
1071 if ( eta_min >= eta_max )
return;
1075 if (descr->is_lar_fcal()) {
1078 if (descr->reg_min() > eta_max || descr->reg_max() < eta_min)
return;
1085 for (
int ieta=0; ieta<descr->n_eta(); ieta++) {
1086 for (
int iphi=0; iphi<descr->n_phi(); iphi++) {
1087 cellId =
m_cell_id->cell_id(regId, ieta, iphi);
1088 caloCellHash =
m_cell_id->calo_cell_hash(cellId);
1090 if (caloCellHash != prevHash) {
1091 prevHash=caloCellHash;
1094 if ( elt->
eta()+elt->
deta()/2. > eta_min &&
1095 elt->
eta()-elt->
deta()/2. < eta_max) {
1100 if(dphi1 >=0. && dphi2 >= 0.) {
1101 cell_list.push_back(caloCellHash);
1116 if ( ! descr->is_in(eta_min,eta_max,phi_min,phi_max))
return;
1118 double zone_min = eta_min;
1119 double zone_max = eta_max;
1126 if ( descr->calo_sign() > 0 ) {
1128 if ( descr->reg_min() >= zone_min ){
1129 zone_min = descr->reg_min();
1134 ieta_min = descr->eta_channel(zone_min);
1139 if ( descr->reg_max() <= zone_max ) {
1140 zone_max = descr->reg_max();
1141 ieta_max = descr->n_eta() -1;
1145 ieta_max = descr->eta_channel(zone_max);
1147 ieta_max = descr->n_eta() - 1;
1153 if ( descr->reg_min() >= zone_min ){
1154 zone_min = descr->reg_min();
1155 ieta_max = descr->n_eta() - 1;
1159 ieta_max = descr->eta_channel(zone_min);
1161 ieta_max = descr->n_eta() - 1;
1164 if ( descr->reg_max() <= zone_max ) {
1165 zone_max = descr->reg_max();
1170 ieta_min = descr->eta_channel(zone_max - 0.0001);
1196 double margin = descr->dphi()*0.1;
1200 if ( descr->calo_phi_min() > zone_phi_min) zone_phi_min = descr->calo_phi_min() + margin;
1201 if ( descr->calo_phi_max() < zone_phi_max) zone_phi_max = descr->calo_phi_max() - margin;
1204 int iphi_min = descr->phi_channel(zone_phi_min);
1205 int iphi_max = descr->phi_channel(zone_phi_max);
1208 int reg_sampl=descr->getSampling(0);
1209 if (reg_sampl == CaloCell_ID::EMB1 || reg_sampl == CaloCell_ID::EME1) {
1210 ieta_min = ieta_min -1;
1211 ieta_max = ieta_max +1;
1232 int reg_EtaMin =
m_cell_id->eta_min (regId);
1233 int reg_EtaMax =
m_cell_id->eta_max (regId);
1234 int reg_PhiMin =
m_cell_id->phi_min (regId);
1235 if (reg_PhiMin<0) reg_PhiMin=0;
1236 int reg_PhiMax =
m_cell_id->phi_max (regId);
1239 if ( iphi_min <= iphi_max && zone_phi_min <= zone_phi_max ) {
1243 for (
int ieta = ieta_min-1 ; ieta <= ieta_max+1; ieta++ )
1244 for (
int iphi = iphi_min-1 ; iphi <= iphi_max+1; iphi++ )
1246 if (ieta>=reg_EtaMin && ieta <=reg_EtaMax && iphi>=reg_PhiMin && iphi<=reg_PhiMax) {
1247 cellId =
m_cell_id->cell_id(regId, ieta, iphi);
1248 caloCellHash =
m_cell_id->calo_cell_hash(cellId);
1252 && ( (elt->
eta()+elt->
deta()/2.) > zone_min + 0.00001 )
1253 && ( (elt->
eta()-elt->
deta()/2.) + 0.00001 < zone_max )
1254 && ( (elt->
phi()+elt->
dphi()/2.) > zone_phi_min + 0.00001 )
1255 && ( (elt->
phi()-elt->
dphi()/2.) + 0.00001 < zone_phi_max ) )
1257 cell_list.push_back(caloCellHash);
1265 else if ( iphi_min <= iphi_max && zone_phi_min > zone_phi_max ) {
1269 for (
int ieta = ieta_min-1 ; ieta <= ieta_max+1; ieta++ )
1270 for (
int iphi = iphi_min-1 ; iphi <= iphi_max+1; iphi++ )
1272 if (ieta>=reg_EtaMin && ieta <=reg_EtaMax && iphi>=reg_PhiMin && iphi<=reg_PhiMax) {
1273 cellId =
m_cell_id->cell_id(regId, ieta, iphi);
1274 caloCellHash =
m_cell_id->calo_cell_hash(cellId);
1278 && ( (elt->
eta()+elt->
deta()/2.) > zone_min + 0.00001 )
1279 && ( (elt->
eta()-elt->
deta()/2.) + 0.00001 < zone_max )
1280 && ( ( (elt->
phi()+elt->
dphi()/2.) > zone_phi_min + 0.00001 )
1281 || ( (elt->
phi()-elt->
dphi()/2.) + 0.00001 < zone_phi_max ) )
1284 cell_list.push_back(caloCellHash);
1299 for (
int ieta = ieta_min-1 ; ieta <= ieta_max+1; ieta++ ) {
1302 for (
int iphi = iphi_min-1 ; iphi <= nchmax; iphi++ )
1304 if (ieta>=reg_EtaMin && ieta <=reg_EtaMax && iphi>=reg_PhiMin && iphi<=reg_PhiMax) {
1305 cellId =
m_cell_id->cell_id(regId, ieta, iphi);
1306 caloCellHash =
m_cell_id->calo_cell_hash(cellId);
1310 && ( (elt->
eta()+elt->
deta()/2.) > zone_min + 0.00001 )
1311 && ( (elt->
eta()-elt->
deta()/2.) + 0.00001 < zone_max )
1312 && ( (elt->
phi()+elt->
dphi()/2.) > zone_phi_min + 0.00001 )
1313 && ( (elt->
phi()-elt->
dphi()/2.) + 0.00001 < zone_phi_max ) )
1315 cell_list.push_back(caloCellHash);
1323 for (
int iphi = 0 ; iphi <= iphi_max+1; iphi++ )
1325 if (ieta>=reg_EtaMin && ieta <=reg_EtaMax && iphi>=reg_PhiMin && iphi<=reg_PhiMax) {
1326 cellId =
m_cell_id->cell_id(regId, ieta, iphi);
1327 caloCellHash =
m_cell_id->calo_cell_hash(cellId);
1331 && ( (elt->
eta()+elt->
deta()/2.) > zone_min + 0.00001 )
1332 && ( (elt->
eta()-elt->
deta()/2.) + 0.00001 < zone_max )
1333 && ( (elt->
phi()+elt->
dphi()/2.) > zone_phi_min + 0.00001 )
1334 && ( (elt->
phi()-elt->
dphi()/2.) + 0.00001 < zone_phi_max ) )
1336 cell_list.push_back(caloCellHash);
1359 double aeta = std::abs(
eta);
1364 if(sample == CaloCell_ID::TileBar0 ||
1365 sample == CaloCell_ID::TileBar1 ||
1366 sample == CaloCell_ID::TileBar2)
1372 if(reg && reg->getSampling(0) == sample)
1374 etadist = std::abs(aeta - reg->calo_eta_max());
1375 if(aeta <= reg->calo_eta_max())
result =
true;
1381 else if(sample == CaloCell_ID::TileExt0 ||
1382 sample == CaloCell_ID::TileExt1 ||
1383 sample == CaloCell_ID::TileExt2 ||
1384 sample == CaloCell_ID::TileGap1 ||
1385 sample == CaloCell_ID::TileGap2 ||
1386 sample == CaloCell_ID::TileGap3)
1392 if(reg && reg->getSampling(0) == sample)
1394 double edgemin = std::abs(aeta - reg->calo_eta_min());
1395 double edgemax = std::abs(aeta - reg->calo_eta_max());
1396 if(edgemin < etadist) etadist = edgemin;
1397 if(edgemax < etadist) etadist = edgemax;
1399 if(aeta >= reg->calo_eta_min() &&
1400 aeta <= reg->calo_eta_max())
result =
true;
1406 for (
unsigned int i=0; i<
m_descr_vec.size(); i++ ) {
1409 if ( reg->getSampling(0) == sample ) {
1410 if ( reg->eta_channel(
eta) >=0 && reg->phi_channel(
phi) >=0)
result =
true;
1411 double edgemin = std::abs( aeta - reg->reg_min() );
1412 double edgemax = std::abs( aeta - reg->reg_max() );
1413 if ( edgemin < etadist ) etadist = edgemin;
1414 if ( edgemax < etadist ) etadist = edgemax;
1420 if (
result) etadist = etadist*(-1.);
1427 const int sampling_or_module,
1432 if (sampling_or_module == 0) sample = CaloCell_ID::PreSamplerB;
1433 if (sampling_or_module == 1) sample = CaloCell_ID::EMB1;
1434 if (sampling_or_module == 2) sample = CaloCell_ID::EMB2;
1435 if (sampling_or_module == 3) sample = CaloCell_ID::EMB3;
1437 if (sampling_or_module == 0) sample = CaloCell_ID::PreSamplerE;
1438 if (sampling_or_module == 1) sample = CaloCell_ID::EME1;
1439 if (sampling_or_module == 2) sample = CaloCell_ID::EME2;
1440 if (sampling_or_module == 3) sample = CaloCell_ID::EME3;
1445 if (sampling_or_module == 0) sample = CaloCell_ID::HEC0;
1446 if (sampling_or_module == 1) sample = CaloCell_ID::HEC1;
1447 if (sampling_or_module == 2) sample = CaloCell_ID::HEC2;
1448 if (sampling_or_module == 3) sample = CaloCell_ID::HEC3;
1451 if (sampling_or_module == 0) sample = CaloCell_ID::FCAL0;
1452 if (sampling_or_module == 1) sample = CaloCell_ID::FCAL1;
1453 if (sampling_or_module == 2) sample = CaloCell_ID::FCAL2;
1459 sample = CaloCell_ID::TileBar0;
1461 sample = CaloCell_ID::TileExt0;
1464 sample = CaloCell_ID::Unknown;
1470 int& sampling_or_module,
1473 if ( sample == CaloCell_ID::PreSamplerB) {
1476 sampling_or_module = 0;
1479 else if ( sample == CaloCell_ID::EMB1) {
1482 sampling_or_module = 1;
1485 else if ( sample == CaloCell_ID::EMB2) {
1488 sampling_or_module = 2;
1491 else if ( sample == CaloCell_ID::EMB3) {
1494 sampling_or_module = 3;
1497 else if ( sample == CaloCell_ID::PreSamplerE) {
1500 sampling_or_module = 0;
1503 else if ( sample == CaloCell_ID::EME1) {
1506 sampling_or_module = 1;
1509 else if ( sample == CaloCell_ID::EME2) {
1512 sampling_or_module = 2;
1515 else if ( sample == CaloCell_ID::EME3) {
1518 sampling_or_module = 3;
1521 else if ( sample == CaloCell_ID::HEC0) {
1524 sampling_or_module = 0;
1527 else if ( sample == CaloCell_ID::HEC1) {
1530 sampling_or_module = 1;
1533 else if ( sample == CaloCell_ID::HEC2) {
1536 sampling_or_module = 2;
1539 else if ( sample == CaloCell_ID::HEC3) {
1542 sampling_or_module = 3;
1545 else if ( sample == CaloCell_ID::FCAL0) {
1548 sampling_or_module = 0;
1551 else if ( sample == CaloCell_ID::FCAL1) {
1554 sampling_or_module = 1;
1557 else if ( sample == CaloCell_ID::FCAL2) {
1560 sampling_or_module = 2;
1563 else if ( sample == CaloCell_ID::TileBar0 ||
1564 sample == CaloCell_ID::TileBar1 ||
1565 sample == CaloCell_ID::TileBar2 ||
1566 sample == CaloCell_ID::TileGap1 ||
1567 sample == CaloCell_ID::TileGap2 ||
1568 sample == CaloCell_ID::TileGap3 ) {
1571 sampling_or_module = 0;
1574 else if ( sample == CaloCell_ID::TileExt0 ||
1575 sample == CaloCell_ID::TileExt1 ||
1576 sample == CaloCell_ID::TileExt2 ) {
1579 sampling_or_module = 0;
1585 sampling_or_module = 0;
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
Helper class for offline supercell identifiers.
Definition of CaloDetDescrManager.
Definition of CaloDetDescriptor.
CaloPhiRange class declaration.
Helper base class for offline cell identifiers.
Helper class for offline cell identifiers.
CaloCell_Base_ID::SUBCALO SUBCALO
CaloSampling::CaloSample CaloSample
Helper class for offline supercell identifiers.
This class groups all DetDescr information related to a CaloCell.
IdentifierHash calo_hash() const
cell calo hash
float eta_raw() const
cell eta_raw
float dphi() const
cell dphi
CaloCell_ID::CaloSample getSampling() const
cell sampling
float eta() const
cell eta
float phi() const
cell phi
float phi_raw() const
cell phi_raw
float deta() const
cell deta
bool is_lar_em_barrel() const
cell belongs to EM barrel
const CaloDetDescrElement * get_element_FCAL_raw(const CaloDetDescriptor *reg, double eta, double phi) const
LArFCAl private methode to get element from raw eta,phi.
static void build_sample(CaloCell_ID::SUBCALO subCalo, bool barrel, int sampling_or_module, CaloCell_ID::CaloSample &sample)
translate between the 2 ways to label a sub-detector:
CaloDetDescriptor * get_descriptor_nonconst(const Identifier ®ionId)
get descriptor by region identifier, non-const version.
CaloDetDescrElement * get_element_nonconst(const Identifier &cellId)
get element by its identifier, non-const version.
calo_element_const_iterator element_begin() const
first element
std::ranges::subrange< calo_nonconst_element_const_iterator > calo_nonconst_element_range
calo_descr_const_iterator calo_descriptors_end() const
end of descriptors vector
calo_descr_const_iterator tile_descriptors_end() const
end of tile descriptors vector
const CaloDetDescrElement * get_element(const Identifier &cellId) const
get element by its identifier
calo_nonconst_element_range element_range_nonconst()
Range over element vector, with non-const elements.
std::string m_lar_geometry
LAr geometry label (full atlas/TB) for backwards compatibility.
std::vector< calo_element_const_iterator > m_subCalo_begin
offsets for subcalo's elements
void add_tile(CaloDetDescriptor *descr)
add tile descriptor to the tile descriptors vector
calo_descr_const_iterator tile_descriptors_begin() const
first tile descriptor (they are in separate vector)
CaloConstIteratorAdaptor< calo_element_vec::const_iterator > calo_element_const_iterator
std::vector< IdentifierHash > m_subCalo_min
offsets for subcalo's elements
const CaloDetDescriptor * get_descriptor_raw(CaloCell_ID::CaloSample sample, double eta, double phi) const
get descriptor by sample, eta and phi raw
CaloDetDescrElement * release_element(IdentifierHash hash)
calo_element_const_iterator element_end() const
end of element vector
void set_helper(const CaloCell_Base_ID *idHelper)
set calo Cell ID helper
std::vector< calo_element_const_iterator > m_subCalo_end
offsets for subcalo's elements
std::ranges::subrange< calo_element_const_iterator > calo_element_range
const CaloDetDescrElement * get_element_FCAL(const CaloDetDescriptor *reg, double eta, double phi) const
LArFCAl private methode to get element.
const CaloIdManager * m_calo_mgr
Calo ID Manager helper.
calo_descr_size tile_descriptors_size() const
number of tile descriptors
const CaloCell_Base_ID * getCaloCell_ID() const
get calo cell ID helper
calo_nonconst_descr_range calo_descriptors_range_nonconst()
Range over descriptors, with non-const elements.
void add(CaloDetDescrElement *element)
add Calo DD element to the elements vector
calo_descr_size calo_descriptors_size() const
number of descriptors
calo_descr_vec m_descr_vec
vector of descriptors
const CaloIdManager * getCalo_Mgr() const
get calo ID manager
void initialize()
initialization of the manager, used by the Converter when it creates the Manager
calo_nonconst_descr_range tile_descriptors_range_nonconst()
Range over tile descriptors, with non-const elements.
const CaloDetDescriptor * get_descriptor(const Identifier ®ionId) const
get descriptor by region identifier
calo_element_vec::size_type calo_element_vec_size
static void decode_sample(CaloCell_ID::SUBCALO &subCalo, bool &barrel, int &sampling_or_module, CaloCell_ID::CaloSample sample)
translate between the 2 ways to label a sub-detector:
calo_element_range element_range() const
Range over element vector.
calo_descr_const_iterator calo_descriptors_begin() const
first descriptor in the vector
std::ranges::subrange< calo_nonconst_descr_const_iterator > calo_nonconst_descr_range
calo_element_vec m_element_vec
vector of Calo DD elements
const CaloDetDescrElement * get_element_raw(CaloCell_ID::CaloSample sample, double eta, double phi) const
Get element from raw quantities (to build real fixed size clusters)
calo_descr_vec::size_type calo_descr_size
const CaloCell_Base_ID * m_cell_id
Calo Cell ID helper.
void cellsInZone(double eta_min, double eta_max, double phi_min, double phi_max, std::vector< IdentifierHash > &cell_list) const
the only client is CaloCellList class
calo_descr_range calo_descriptors_range() const
Range over descriptors.
calo_element_vec_size element_size() const
total number of elements
void print() const
print out the contents
CaloConstIteratorAdaptor< calo_descr_vec::const_iterator > calo_descr_const_iterator
calo_descr_vec m_tile_descr_vec
vector of descriptors
std::ranges::subrange< calo_descr_const_iterator > calo_descr_range
calo_descr_range tile_descriptors_range() const
Range over tile descriptors.
CaloDetDescrManager_Base()
Default Constructor.
bool is_in(double eta, double phi, CaloCell_ID::CaloSample sample, double &etadist) const
return true if direction eta,phi crosses ANY of the corresponding descriptors
std::vector< IdentifierHash > m_subCalo_max
offsets for subcalo's elements
~CaloDetDescrManager_Base()
destructor
const CaloCell_ID * getCaloCell_ID() const
get calo cell ID helper
void set_helper(const CaloCell_ID *idHelper)
set calo Cell ID helper
This is a base class for LAr and Tile Descriptors The primary goal is to speed up loops over all the ...
This class initializes the Calo (LAr and Tile) offline identifiers.
static double fix(double phi)
static double diff(double phi1, double phi2)
simple phi1 - phi2 calculation, but result is fixed to respect range.
void set_helper(const CaloCell_SuperCell_ID *idHelper)
set calo Cell ID helper
virtual ~CaloSuperCellDetDescrManager()
const CaloCell_SuperCell_ID * getCaloCell_ID() const
get calo cell ID helper
This is a "hash" representation of an Identifier.