539 {
540
541 const PixelID* pixelId = nullptr;
542 const SCT_ID* sctId = nullptr;
543
544 if (
m_detStore->retrieve(pixelId,
"PixelID").isFailure()) {
546 return false;
547 }
548
549 if (
m_detStore->retrieve(sctId,
"SCT_ID").isFailure()) {
551 return false;
552 }
553
554 short subdetid = 1;
555
557
558 Identifier offlineId = pixelId->
wafer_id(hash);
559
560 if(offlineId==0) continue;
561
562 short barrel_ec = pixelId->
barrel_ec(offlineId);
563 if(abs(barrel_ec)>2) continue;
564 short layer_disk = pixelId->
layer_disk(offlineId);
567 auto t = std::make_tuple(subdetid, barrel_ec, layer_disk);
568 std::map<std::tuple<short,short,short>,std::vector<PhiEtaHash> >::iterator
it = hashMap.find(t);
569 if(it==hashMap.end())
570 hashMap.insert(std::pair<std::tuple<short,short,short>,std::vector<PhiEtaHash> >(t,std::vector<PhiEtaHash>(1,
PhiEtaHash(phi_index, eta_index, hash) )));
571 else (*it).second.push_back(
PhiEtaHash(phi_index, eta_index, hash));
572 }
573 subdetid = 2;
575
576 Identifier offlineId = sctId->
wafer_id(hash);
577
578 if(offlineId==0) continue;
579
580 short barrel_ec = sctId->
barrel_ec(offlineId);
581 short layer_disk = sctId->
layer_disk(offlineId);
584
585 auto t = std::make_tuple(subdetid, barrel_ec, layer_disk);
586 std::map<std::tuple<short,short,short>,std::vector<PhiEtaHash> >::iterator
it = hashMap.find(t);
587 if(it==hashMap.end())
588 hashMap.insert(std::pair<std::tuple<short,short,short>,std::vector<PhiEtaHash> >(t,std::vector<PhiEtaHash>(1,
PhiEtaHash(phi_index, eta_index, hash))));
589 else (*it).second.push_back(
PhiEtaHash(phi_index, eta_index, hash));
590 }
591
594
595 int layerId=0;
596
597 for(std::map<std::tuple<short,short,short>,std::vector<PhiEtaHash> >::iterator it = hashMap.begin();it!=hashMap.end();++it, layerId++) {
598
599 short subdetId = std::get<0>((*it).first);
600 short barrel_ec = std::get<1>((*it).first);
601
603
604 if(subdetId == 1) {
605 for(std::vector<PhiEtaHash>::iterator hIt = (*it).second.begin();hIt != (*it).second.end();++hIt) {
607 }
608 }
609 if(subdetId == 2) {
610 for(std::vector<PhiEtaHash>::iterator hIt = (*it).second.begin();hIt != (*it).second.end();++hIt) {
612 }
613 }
614 }
615
616
617 for(std::map<std::tuple<short,short,short>,std::vector<PhiEtaHash> >::iterator it = hashMap.begin();it!=hashMap.end();++it) {
618
619
620
622
623 }
624 return true;
625}
int layer_disk(const Identifier &id) const
Identifier wafer_id(int barrel_ec, int layer_disk, int phi_module, int eta_module) const
For a single crystal.
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0).
size_type wafer_hash_max() const
int eta_module(const Identifier &id) const
int phi_module(const Identifier &id) const
size_type wafer_hash_max() const
int layer_disk(const Identifier &id) const
Identifier wafer_id(int barrel_ec, int layer_disk, int phi_module, int eta_module, int side) const
For a single side of module.
int phi_module(const Identifier &id) const
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0).
int eta_module(const Identifier &id) const
std::vector< short > m_layerInfo[3]
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.