32 if (i!=
m_items.end()) tid=i->tower;
58 throw cms::Exception(
"CaloTowers") <<
"Cell with id " << std::hex << cell.
rawId() <<
std::dec <<
" is already mapped to a CaloTower " <<
m_items.find(cell)->tower << std::endl;
74 <<
" ID " <<
id <<
" ieta " <<
id.ieta() << std::endl;
76 std::vector<DetId>
items;
77 if (
id.ieta() == 0)
return items;
81 std::unique_ptr<std::multimap<CaloTowerDetId,DetId>> ptr{
new std::multimap<CaloTowerDetId,DetId>};
83 ptr->insert(std::pair<CaloTowerDetId,DetId>(m_item.tower,m_item.cell));
84 std::multimap<CaloTowerDetId,DetId>* expected =
nullptr;
85 if(
m_reverseItems.compare_exchange_strong(expected, ptr.get(), std::memory_order_acq_rel)) {
91 std::multimap<CaloTowerDetId,DetId>::const_iterator j;
92 auto range=(*
m_reverseItems.load(std::memory_order_acquire)).equal_range(
id);
93 for (j=range.first; j!=range.second; j++)
94 items.emplace_back(j->second);
104 for (
int i=0;
i<nd;
i++) {
107 if (
std::find(items.begin(),items.end(),hid) == items.end()) {
108 items.emplace_back(hid);
110 std::cout <<
id <<
" Depth " <<
i <<
":" <<
i+sd <<
" " << hid <<
"\n";
115 items.emplace_back(hid);
117 std::cout <<
id <<
" Depth " <<
i <<
":" <<
i+sd <<
" " << hid <<
"\n";
126 for (
int i=0;
i<nd;
i++) {
128 items.emplace_back(hid);
130 std::cout <<
id <<
" Depth " <<
i <<
":" <<
i+sd <<
" " << hid <<
"\n";
138 for (
int i=0;
i<nd;
i++) {
141 if (
std::find(items.begin(),items.end(),hid) == items.end()) {
142 items.emplace_back(hid);
144 std::cout <<
id <<
" Depth " <<
i <<
":" <<
i+sd <<
" " << hid <<
"\n";
149 items.emplace_back(hid);
151 std::cout <<
id <<
" Depth " <<
i <<
":" <<
i+sd <<
" " << hid <<
"\n";
160 for (
int i=0;
i<nd;
i++) {
162 items.emplace_back(hid);
164 std::cout <<
id <<
" Depth " <<
i <<
":" <<
i+sd <<
" " << hid <<
"\n";
169 int hcal_ieta2 = hcal_ieta-1;
171 for (
int i=0;
i<nd;
i++) {
173 items.emplace_back(hid);
175 std::cout <<
id <<
" Depth " <<
i <<
":" <<
i+sd <<
" " << hid <<
"\n";
184 if (hid.
zside() == -1) {
191 for (
int ie=etaMin; ie<=
etaMax; ie++)
193 items.emplace_back(
EBDetId(ie,ip));
void useStandardHE(bool use=true)
add standard (hardcoded) HE items?
HcalSubdetector subdet() const
get the subdetector
int convertHcaltoCT(int hcal_ieta, HcalSubdetector subdet) const
constexpr bool null() const
is this a null id ?
int tower_ieta() const
get the HCAL/trigger ieta of this crystal
int zside() const
get the z-side of the cell (1/-1)
int tower_iphi() const
get the HCAL/trigger iphi of this crystal
int crystal_iphi_low() const
get the smallest crystal_iphi of the crystal in front of this tower (HB and HE tower 17 only) ...
constexpr uint32_t rawId() const
get the raw id
std::vector< T >::const_iterator const_iterator
void useStandardEB(bool use=true)
add standard (hardcoded) EB items?
const CaloTowerTopology * m_cttopo
void sort()
done adding to the association
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
bool getMergePositionFlag() const
void useStandardHB(bool use=true)
add standard (hardcoded) HB items?
std::vector< DetId > constituentsOf(const CaloTowerDetId &id) const
Get the constituent detids for this tower id ( not yet implemented )
HcalDetId mergedDepthDetId(const HcalDetId &id) const
void depthBinInformation(HcalSubdetector subdet, int etaRing, int iphi, int zside, int &nDepthBins, int &startingBin) const
finds the number of depth bins and which is the number to start with
CaloTowerDetId towerOf(const DetId &id) const
Get the tower id for this det id (or null if not known)
int crystal_ieta_low() const
get the smallest crystal_ieta of the crystal in front of this tower (HB and HE tower 17 only) ...
const HcalTopology * m_hcaltopo
~CaloTowerConstituentsMap()
CaloTowerConstituentsMap()=delete
void assign(const DetId &cell, const CaloTowerDetId &tower)
set the association between a DetId and a tower
int ietaAbs() const
get the absolute value of the cell ieta
int iphi() const
get the cell iphi
void useStandardHO(bool use=true)
add standard (hardcoded) HO items?
int crystal_ieta_high() const
get the largest crystal_ieta of the crystal in front of this tower (HB and HE tower 17 only) ...
static const int MAX_IETA
std::atomic< std::multimap< CaloTowerDetId, DetId > * > m_reverseItems
int convertCTtoHcal(int ct_ieta) const
int crystal_iphi_high() const
get the largest crystal_iphi of the crystal in front of this tower (HB and HE tower 17 only) ...
void useStandardHF(bool use=true)
add standard (hardcoded) HF items?
edm::SortedCollection< MapItem > m_items