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.
5 
9 
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(isFirstCall){
68  iSetup.get<TrackerRecoGeometryRecord>().get( track );
69  bl=track->barrelLayers();
70  isFirstCall=false;
71  }
72  for(vector<LayerWithHits*>::const_iterator it=allLayersWithHits.begin();
73  it!=allLayersWithHits.end();it++){
74  delete *it;
75  }
76 
77  allLayersWithHits.clear();
78  LogDebug("CosmicSeedFinder") <<"Reconstruction for geometry "<<_geometry;
79  if (_geometry=="STANDARD" || _geometry=="TECPAIRS_TOBTRIPLETS"){
80  const DetLayer* bl1=dynamic_cast<DetLayer const*>(bl[10]);
81  const DetLayer* bl2=dynamic_cast<DetLayer const*>(bl[11]);
82  const DetLayer* bl3=dynamic_cast<DetLayer const*>(bl[12]);
83  // //LayersWithHits
84  lh1=new LayerWithHits(bl1,collrphi,acc.stripTOBLayer(4)); allLayersWithHits.push_back(lh1);
85  lh2=new LayerWithHits(bl2,collrphi,acc.stripTOBLayer(5)); allLayersWithHits.push_back(lh2);
86  lh3=new LayerWithHits(bl3,collrphi,acc.stripTOBLayer(6)); allLayersWithHits.push_back(lh3);
87  }
88  if(_geometry=="MTCC"){
89 
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,acc.stripTIBLayer(1)); allLayersWithHits.push_back(lh1);
96  lh2=new LayerWithHits(bl2,collrphi,acc.stripTIBLayer(2)); allLayersWithHits.push_back(lh2);
97  lh3=new LayerWithHits(bl3,collrphi,acc.stripTOBLayer(1)); allLayersWithHits.push_back(lh3);
98  lh4=new LayerWithHits(bl4,collrphi,acc.stripTOBLayer(2)); allLayersWithHits.push_back(lh4);
99  }
100 }
#define LogDebug(id)
std::pair< SeedLayerPairs::LayerPair, std::vector< const LayerWithHits * > > LayerPairAndLayers
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
std::vector< BarrelDetLayer const * > bl
const T & get() const
Definition: EventSetup.h:55
string const
Definition: compareJSON.py:14
ESHandle< TrackerGeometry > geometry
std::pair< const LayerWithHits *, const LayerWithHits * > LayerPair
std::vector< LayerWithHits * > allLayersWithHits
TrackerLayerIdAccessor acc