test
CMS 3D CMS Logo

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