CMS 3D CMS Logo

CosmicLayerTriplets.cc
Go to the documentation of this file.
4 
6 
12 
15 
16 using std::vector;
17 vector<CosmicLayerTriplets::LayerPairAndLayers> CosmicLayerTriplets::layers() {
18  vector<LayerPairAndLayers> result;
19 
20  if (_geometry == "STANDARD") {
21  vector<const LayerWithHits*> third;
22  third.push_back(lh3);
23  result.push_back(LayerPairAndLayers(SeedLayerPairs::LayerPair(lh1, lh2), third));
24  }
25  if (_geometry == "TECPAIRS_TOBTRIPLETS") {
26  vector<const LayerWithHits*> third;
27  third.push_back(lh3);
28  result.push_back(LayerPairAndLayers(SeedLayerPairs::LayerPair(lh1, lh2), third));
29  }
30  if (_geometry == "MTCC") {
31  vector<const LayerWithHits*> third1;
32  vector<const LayerWithHits*> third2;
33  vector<const LayerWithHits*> third3;
34  vector<const LayerWithHits*> third4;
35  third1.clear();
36  third2.clear();
37  third3.clear();
38  third4.clear();
39  third1.push_back(lh1);
40  result.push_back(LayerPairAndLayers(SeedLayerPairs::LayerPair(lh3, lh2), third1));
41  third2.push_back(lh1);
42  result.push_back(LayerPairAndLayers(SeedLayerPairs::LayerPair(lh2, lh1), third2));
43  third3.push_back(lh2);
44  result.push_back(LayerPairAndLayers(SeedLayerPairs::LayerPair(lh3, lh2), third3));
45  third4.push_back(lh4);
46  result.push_back(LayerPairAndLayers(SeedLayerPairs::LayerPair(lh2, lh3), third4));
47  }
48  return result;
49 }
51  for (vector<LayerWithHits*>::const_iterator it = allLayersWithHits.begin(); it != allLayersWithHits.end(); it++) {
52  delete *it;
53  }
54 }
55 
57  const SiStripRecHit2DCollection& collrphi,
58  const SiStripMatchedRecHit2DCollection& collmatched,
60  const edm::EventSetup& iSetup) {
62  if (watchTrackerGeometry_.check(iSetup)) {
64  iSetup.get<TrackerRecoGeometryRecord>().get(track);
65  bl = track->barrelLayers();
66  }
68  iSetup.get<TrackerTopologyRcd>().get(httopo);
69  const TrackerTopology& ttopo = *httopo;
70 
71  for (vector<LayerWithHits*>::const_iterator it = allLayersWithHits.begin(); it != allLayersWithHits.end(); it++) {
72  delete *it;
73  }
74 
75  allLayersWithHits.clear();
76  LogDebug("CosmicSeedFinder") << "Reconstruction for geometry " << _geometry;
77  if (_geometry == "STANDARD" || _geometry == "TECPAIRS_TOBTRIPLETS") {
78  const DetLayer* bl1 = dynamic_cast<DetLayer const*>(bl[10]);
79  const DetLayer* bl2 = dynamic_cast<DetLayer const*>(bl[11]);
80  const DetLayer* bl3 = dynamic_cast<DetLayer const*>(bl[12]);
81  // //LayersWithHits
82  lh1 = new LayerWithHits(bl1, collrphi, ttopo.tobDetIdLayerComparator(4));
83  allLayersWithHits.push_back(lh1);
84  lh2 = new LayerWithHits(bl2, collrphi, ttopo.tobDetIdLayerComparator(5));
85  allLayersWithHits.push_back(lh2);
86  lh3 = new LayerWithHits(bl3, collrphi, ttopo.tobDetIdLayerComparator(6));
87  allLayersWithHits.push_back(lh3);
88  }
89  if (_geometry == "MTCC") {
90  const DetLayer* bl1 = dynamic_cast<DetLayer const*>(bl[0]);
91  const DetLayer* bl2 = dynamic_cast<DetLayer const*>(bl[1]);
92  const DetLayer* bl3 = dynamic_cast<DetLayer const*>(bl[2]);
93  const DetLayer* bl4 = dynamic_cast<DetLayer const*>(bl[3]);
94 
95  lh1 = new LayerWithHits(bl1, collrphi, ttopo.tibDetIdLayerComparator(1));
96  allLayersWithHits.push_back(lh1);
97  lh2 = new LayerWithHits(bl2, collrphi, ttopo.tibDetIdLayerComparator(2));
98  allLayersWithHits.push_back(lh2);
99  lh3 = new LayerWithHits(bl3, collrphi, ttopo.tobDetIdLayerComparator(1));
100  allLayersWithHits.push_back(lh3);
101  lh4 = new LayerWithHits(bl4, collrphi, ttopo.tobDetIdLayerComparator(2));
102  allLayersWithHits.push_back(lh4);
103  }
104 }
#define LogDebug(id)
std::vector< LayerWithHits * > allLayersWithHits
void init(const SiStripRecHit2DCollection &collstereo, const SiStripRecHit2DCollection &collrphi, const SiStripMatchedRecHit2DCollection &collmatched, std::string geometry, const edm::EventSetup &iSetup)
std::vector< LayerPairAndLayers > layers()
std::pair< DetId, SameLayerComparator > tobDetIdLayerComparator(uint32_t layer) const
std::vector< BarrelDetLayer const * > bl
std::pair< DetId, SameLayerComparator > tibDetIdLayerComparator(uint32_t layer) const
std::pair< SeedLayerPairs::LayerPair, std::vector< const LayerWithHits * > > LayerPairAndLayers
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:52
ESHandle< TrackerGeometry > geometry
T get() const
Definition: EventSetup.h:73
std::pair< const LayerWithHits *, const LayerWithHits * > LayerPair
edm::ESWatcher< TrackerRecoGeometryRecord > watchTrackerGeometry_
std::vector< BarrelDetLayer const * > const & barrelLayers() const