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.
5 
9 
16 
17 using std::vector;
18 vector<CosmicLayerTriplets::LayerPairAndLayers> CosmicLayerTriplets::layers()
19 {
20  vector<LayerPairAndLayers> result;
21 
22  if (_geometry=="STANDARD"){
23  vector<const LayerWithHits*> third;
24  third.push_back(lh3);
25  result.push_back(LayerPairAndLayers(SeedLayerPairs::LayerPair(lh1,lh2),third));
26 
27  }
28  if (_geometry=="TECPAIRS_TOBTRIPLETS"){
29  vector<const LayerWithHits*> third;
30  third.push_back(lh3);
31  result.push_back(LayerPairAndLayers(SeedLayerPairs::LayerPair(lh1,lh2),third));
32 
33  }
34  if (_geometry=="MTCC"){
35  vector<const LayerWithHits*> third1;
36  vector<const LayerWithHits*> third2;
37  vector<const LayerWithHits*> third3;
38  vector<const LayerWithHits*> third4;
39  third1.clear();third2.clear();third3.clear();third4.clear();
40  third1.push_back(lh1);
41  result.push_back(LayerPairAndLayers(SeedLayerPairs::LayerPair(lh3,lh2),third1));
42  third2.push_back(lh1);
43  result.push_back(LayerPairAndLayers(SeedLayerPairs::LayerPair(lh2,lh1),third2));
44  third3.push_back(lh2);
45  result.push_back(LayerPairAndLayers(SeedLayerPairs::LayerPair(lh3,lh2),third3));
46  third4.push_back(lh4);
47  result.push_back(LayerPairAndLayers(SeedLayerPairs::LayerPair(lh2,lh3),third4));
48  }
49  return result;
50 }
52 {
53  for(vector<LayerWithHits*>::const_iterator it=allLayersWithHits.begin(); it!=allLayersWithHits.end();it++){
54  delete *it;
55  }
56 }
57 
58 
59 
61  const SiStripRecHit2DCollection &collrphi,
62  const SiStripMatchedRecHit2DCollection &collmatched,
63  std::string geometry,
64  const edm::EventSetup& iSetup){
65 
67  if(isFirstCall){
69  iSetup.get<TrackerRecoGeometryRecord>().get( track );
70  bl=track->barrelLayers();
71  isFirstCall=false;
72  }
73  for(vector<LayerWithHits*>::const_iterator it=allLayersWithHits.begin();
74  it!=allLayersWithHits.end();it++){
75  delete *it;
76  }
77 
78  allLayersWithHits.clear();
79  LogDebug("CosmicSeedFinder") <<"Reconstruction for geometry "<<_geometry;
80  if (_geometry=="STANDARD" || _geometry=="TECPAIRS_TOBTRIPLETS"){
81  const TOBLayer* bl1=dynamic_cast<TOBLayer*>(bl[10]);
82  const TOBLayer* bl2=dynamic_cast<TOBLayer*>(bl[11]);
83  const TOBLayer* bl3=dynamic_cast<TOBLayer*>(bl[12]);
84  // //LayersWithHits
85  lh1=new LayerWithHits(bl1,collrphi,acc.stripTOBLayer(4)); allLayersWithHits.push_back(lh1);
86  lh2=new LayerWithHits(bl2,collrphi,acc.stripTOBLayer(5)); allLayersWithHits.push_back(lh2);
87  lh3=new LayerWithHits(bl3,collrphi,acc.stripTOBLayer(6)); allLayersWithHits.push_back(lh3);
88  }
89  if(_geometry=="MTCC"){
90 
91  const TIBLayer* bl1=dynamic_cast<TIBLayer*>(bl[0]);
92  const TIBLayer* bl2=dynamic_cast<TIBLayer*>(bl[1]);
93  const TOBLayer* bl3=dynamic_cast<TOBLayer*>(bl[2]);
94  const TOBLayer* bl4=dynamic_cast<TOBLayer*>(bl[3]);
95 
96  lh1=new LayerWithHits(bl1,collrphi,acc.stripTIBLayer(1)); allLayersWithHits.push_back(lh1);
97  lh2=new LayerWithHits(bl2,collrphi,acc.stripTIBLayer(2)); allLayersWithHits.push_back(lh2);
98  lh3=new LayerWithHits(bl3,collrphi,acc.stripTOBLayer(1)); allLayersWithHits.push_back(lh3);
99  lh4=new LayerWithHits(bl4,collrphi,acc.stripTOBLayer(2)); allLayersWithHits.push_back(lh4);
100  }
101 }
#define LogDebug(id)
std::pair< SeedLayerPairs::LayerPair, std::vector< const LayerWithHits * > > LayerPairAndLayers
std::vector< BarrelDetLayer * > bl
std::pair< DetId, DetIdTIBSameLayerComparator > stripTIBLayer(int layer)
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, DetIdTOBSameLayerComparator > stripTOBLayer(int layer)
tuple result
Definition: query.py:137
const T & get() const
Definition: EventSetup.h:55
ESHandle< TrackerGeometry > geometry
std::pair< const LayerWithHits *, const LayerWithHits * > LayerPair
std::vector< LayerWithHits * > allLayersWithHits
TrackerLayerIdAccessor acc