528 {
529
530 const PixelID* pixelId = nullptr;
531 const SCT_ID* sctId = nullptr;
532
533 if (
m_detStore->retrieve(pixelId,
"PixelID").isFailure()) {
535 return false;
536 }
537
538 if (
m_detStore->retrieve(sctId,
"SCT_ID").isFailure()) {
540 return false;
541 }
542
543 short subdetid = 1;
544
546
547 Identifier offlineId = pixelId->
wafer_id(hash);
548
549 if(offlineId==0) continue;
550
551 short barrel_ec = pixelId->
barrel_ec(offlineId);
552 if(abs(barrel_ec)>2) continue;
553 short layer_disk = pixelId->
layer_disk(offlineId);
556 auto t = std::make_tuple(subdetid, barrel_ec, layer_disk);
557 std::map<std::tuple<short,short,short>,std::vector<PhiEtaHash> >::iterator
it = hashMap.find(t);
558 if(it==hashMap.end())
559 hashMap.insert(std::pair<std::tuple<short,short,short>,std::vector<PhiEtaHash> >(t,std::vector<PhiEtaHash>(1,
PhiEtaHash(phi_index, eta_index, hash) )));
560 else (*it).second.push_back(
PhiEtaHash(phi_index, eta_index, hash));
561 }
562 subdetid = 2;
564
565 Identifier offlineId = sctId->
wafer_id(hash);
566
567 if(offlineId==0) continue;
568
569 short barrel_ec = sctId->
barrel_ec(offlineId);
570 short layer_disk = sctId->
layer_disk(offlineId);
573
574 auto t = std::make_tuple(subdetid, barrel_ec, layer_disk);
575 std::map<std::tuple<short,short,short>,std::vector<PhiEtaHash> >::iterator
it = hashMap.find(t);
576 if(it==hashMap.end())
577 hashMap.insert(std::pair<std::tuple<short,short,short>,std::vector<PhiEtaHash> >(t,std::vector<PhiEtaHash>(1,
PhiEtaHash(phi_index, eta_index, hash))));
578 else (*it).second.push_back(
PhiEtaHash(phi_index, eta_index, hash));
579 }
580
583
584 int layerId=0;
585
586 for(std::map<std::tuple<short,short,short>,std::vector<PhiEtaHash> >::iterator it = hashMap.begin();it!=hashMap.end();++it, layerId++) {
587
588 short subdetId = std::get<0>((*it).first);
589 short barrel_ec = std::get<1>((*it).first);
590
592
593 if(subdetId == 1) {
594 for(std::vector<PhiEtaHash>::iterator hIt = (*it).second.begin();hIt != (*it).second.end();++hIt) {
596 }
597 }
598 if(subdetId == 2) {
599 for(std::vector<PhiEtaHash>::iterator hIt = (*it).second.begin();hIt != (*it).second.end();++hIt) {
601 }
602 }
603 }
604
605
606 for(std::map<std::tuple<short,short,short>,std::vector<PhiEtaHash> >::iterator it = hashMap.begin();it!=hashMap.end();++it) {
607
608
609
611
612 }
613 return true;
614}
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.