Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:54:49

0001 // -*- C++ -*-
0002 //
0003 // Package:     SiStripDetId
0004 // Class  :     SiStripSubStructure
0005 //
0006 // Implementation:
0007 //     <Notes on implementation>
0008 //
0009 // Original Author:  dkcira
0010 //         Created:  Wed Jan 25 07:19:38 CET 2006
0011 //
0012 #include "DataFormats/SiStripDetId/interface/StripSubdetector.h"
0013 #include "DataFormats/TrackerCommon/interface/TrackerTopology.h"
0014 #include <algorithm>
0015 
0016 #include "DataFormats/TrackerCommon/interface/SiStripSubStructure.h"
0017 
0018 void SiStripSubStructure::getTIBDetectors(const std::vector<uint32_t> &inputDetRawIds,
0019                                           std::vector<uint32_t> &tibDetRawIds,
0020                                           const TrackerTopology *tTopo,
0021                                           uint32_t rq_layer,
0022                                           uint32_t rq_bkw_frw,
0023                                           uint32_t rq_int_ext,
0024                                           uint32_t rq_string) {
0025   std::copy_if(std::begin(inputDetRawIds),
0026                std::end(inputDetRawIds),
0027                std::back_inserter(tibDetRawIds),
0028                [tTopo, rq_layer, rq_bkw_frw, rq_int_ext, rq_string](DetId det) {
0029                  return ((StripSubdetector::TIB == det.subdetId())
0030                          // check if TIB is from the ones requested
0031                          // take everything if default value is 0
0032                          && ((rq_layer == 0) || (rq_layer == tTopo->tibLayer(det))) &&
0033                          ((rq_bkw_frw == 0) || (rq_bkw_frw == tTopo->tibSide(det))) &&
0034                          ((rq_int_ext == 0) || (rq_int_ext == tTopo->tibOrder(det))) &&
0035                          ((rq_string == 0) || (rq_string == tTopo->tibString(det))));
0036                });
0037 }
0038 
0039 void SiStripSubStructure::getTIDDetectors(const std::vector<uint32_t> &inputDetRawIds,
0040                                           std::vector<uint32_t> &tidDetRawIds,
0041                                           const TrackerTopology *tTopo,
0042                                           uint32_t rq_side,
0043                                           uint32_t rq_wheel,
0044                                           uint32_t rq_ring,
0045                                           uint32_t rq_ster) {
0046   std::copy_if(std::begin(inputDetRawIds),
0047                std::end(inputDetRawIds),
0048                std::back_inserter(tidDetRawIds),
0049                [tTopo, rq_side, rq_wheel, rq_ring, rq_ster](DetId det) {
0050                  return ((StripSubdetector::TID == det.subdetId())
0051                          // check if TID is from the ones requested
0052                          // take everything if default value is 0
0053                          && ((rq_side == 0) || (rq_side == tTopo->tidSide(det))) &&
0054                          ((rq_wheel == 0) || (rq_wheel == tTopo->tidWheel(det))) &&
0055                          ((rq_ring == 0) || (rq_ring == tTopo->tidRing(det))) &&
0056                          ((rq_ster == 0) || (rq_ster == tTopo->tidStereo(det))));
0057                });
0058 }
0059 
0060 void SiStripSubStructure::getTOBDetectors(const std::vector<uint32_t> &inputDetRawIds,
0061                                           std::vector<uint32_t> &tobDetRawIds,
0062                                           const TrackerTopology *tTopo,
0063                                           uint32_t rq_layer,
0064                                           uint32_t rq_bkw_frw,
0065                                           uint32_t rq_rod) {
0066   std::copy_if(std::begin(inputDetRawIds),
0067                std::end(inputDetRawIds),
0068                std::back_inserter(tobDetRawIds),
0069                [tTopo, rq_layer, rq_bkw_frw, rq_rod](DetId det) {
0070                  return ((StripSubdetector::TOB == det.subdetId())
0071                          // check if TOB is from the ones requested
0072                          // take everything if default value is 0
0073                          && ((rq_layer == 0) || (rq_layer == tTopo->tobLayer(det))) &&
0074                          ((rq_bkw_frw == 0) || (rq_bkw_frw == tTopo->tobSide(det))) &&
0075                          ((rq_rod == 0) || (rq_rod == tTopo->tobRod(det))));
0076                });
0077 }
0078 
0079 void SiStripSubStructure::getTECDetectors(const std::vector<uint32_t> &inputDetRawIds,
0080                                           std::vector<uint32_t> &tecDetRawIds,
0081                                           const TrackerTopology *tTopo,
0082                                           uint32_t rq_side,
0083                                           uint32_t rq_wheel,
0084                                           uint32_t rq_petal_bkw_frw,
0085                                           uint32_t rq_petal,
0086                                           uint32_t rq_ring,
0087                                           uint32_t rq_ster) {
0088   std::copy_if(std::begin(inputDetRawIds),
0089                std::end(inputDetRawIds),
0090                std::back_inserter(tecDetRawIds),
0091                [tTopo, rq_side, rq_wheel, rq_petal_bkw_frw, rq_petal, rq_ring, rq_ster](DetId det) {
0092                  return ((StripSubdetector::TEC == det.subdetId())
0093                          // check if TEC is from the ones requested
0094                          // take everything if default value is 0
0095                          && ((rq_side == 0) || (rq_side == tTopo->tecSide(det))) &&
0096                          ((rq_wheel == 0) || (rq_wheel == tTopo->tecWheel(det))) &&
0097                          ((rq_petal_bkw_frw == 0) || (rq_petal_bkw_frw - 1 == tTopo->tecOrder(det))) &&
0098                          ((rq_petal == 0) || (rq_petal == tTopo->tecPetalNumber(det))) &&
0099                          ((rq_ring == 0) || (rq_ring == tTopo->tecRing(det))) &&
0100                          ((rq_ster == 0) || (rq_ster == tTopo->tecStereo(det))));
0101                });
0102 }