CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Attributes
CosmicLayerTriplets Class Reference

#include <CosmicLayerTriplets.h>

Public Types

typedef std::pair
< SeedLayerPairs::LayerPair,
std::vector< const
LayerWithHits * > > 
LayerPairAndLayers
 

Public Member Functions

 CosmicLayerTriplets ()
 
void init (const SiStripRecHit2DCollection &collstereo, const SiStripRecHit2DCollection &collrphi, const SiStripMatchedRecHit2DCollection &collmatched, std::string geometry, const edm::EventSetup &iSetup)
 
std::vector< LayerPairAndLayerslayers ()
 
 ~CosmicLayerTriplets ()
 

Private Attributes

std::string _geometry
 
TrackerLayerIdAccessor acc
 
std::vector< LayerWithHits * > allLayersWithHits
 
std::vector< BarrelDetLayer * > bl
 
std::vector< ForwardDetLayer * > fneg
 
std::vector< ForwardDetLayer * > fpos
 
bool isFirstCall
 
LayerWithHitslh1
 
LayerWithHitslh2
 
LayerWithHitslh3
 
LayerWithHitslh4
 

Detailed Description

find all (resonable) pairs of pixel layers

Definition at line 23 of file CosmicLayerTriplets.h.

Member Typedef Documentation

Definition at line 28 of file CosmicLayerTriplets.h.

Constructor & Destructor Documentation

CosmicLayerTriplets::CosmicLayerTriplets ( )
inline

Definition at line 25 of file CosmicLayerTriplets.h.

25 :isFirstCall(true){};
CosmicLayerTriplets::~CosmicLayerTriplets ( )

Definition at line 50 of file CosmicLayerTriplets.cc.

References allLayersWithHits.

51 {
52  for(vector<LayerWithHits*>::const_iterator it=allLayersWithHits.begin(); it!=allLayersWithHits.end();it++){
53  delete *it;
54  }
55 }
std::vector< LayerWithHits * > allLayersWithHits

Member Function Documentation

void CosmicLayerTriplets::init ( const SiStripRecHit2DCollection collstereo,
const SiStripRecHit2DCollection collrphi,
const SiStripMatchedRecHit2DCollection collmatched,
std::string  geometry,
const edm::EventSetup iSetup 
)

Definition at line 59 of file CosmicLayerTriplets.cc.

References _geometry, acc, allLayersWithHits, bl, geometry, edm::EventSetup::get(), isFirstCall, lh1, lh2, lh3, lh4, LogDebug, TrackerLayerIdAccessor::stripTIBLayer(), and TrackerLayerIdAccessor::stripTOBLayer().

Referenced by SeedGeneratorForCosmics::init().

63  {
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*>(bl[10]);
81  const DetLayer* bl2=dynamic_cast<DetLayer*>(bl[11]);
82  const DetLayer* bl3=dynamic_cast<DetLayer*>(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*>(bl[0]);
91  const DetLayer* bl2=dynamic_cast<DetLayer*>(bl[1]);
92  const DetLayer* bl3=dynamic_cast<DetLayer*>(bl[2]);
93  const DetLayer* bl4=dynamic_cast<DetLayer*>(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::vector< BarrelDetLayer * > bl
std::pair< DetId, DetIdTIBSameLayerComparator > stripTIBLayer(int layer)
std::pair< DetId, DetIdTOBSameLayerComparator > stripTOBLayer(int layer)
const T & get() const
Definition: EventSetup.h:55
ESHandle< TrackerGeometry > geometry
std::vector< LayerWithHits * > allLayersWithHits
TrackerLayerIdAccessor acc
vector< CosmicLayerTriplets::LayerPairAndLayers > CosmicLayerTriplets::layers ( )

Definition at line 17 of file CosmicLayerTriplets.cc.

References _geometry, lh1, lh2, lh3, lh4, and query::result.

Referenced by CosmicHitTripletGenerator::CosmicHitTripletGenerator().

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 }
std::pair< SeedLayerPairs::LayerPair, std::vector< const LayerWithHits * > > LayerPairAndLayers
tuple result
Definition: query.py:137
std::pair< const LayerWithHits *, const LayerWithHits * > LayerPair

Member Data Documentation

std::string CosmicLayerTriplets::_geometry
private

Definition at line 62 of file CosmicLayerTriplets.h.

Referenced by init(), and layers().

TrackerLayerIdAccessor CosmicLayerTriplets::acc
private

Definition at line 40 of file CosmicLayerTriplets.h.

Referenced by init().

std::vector<LayerWithHits*> CosmicLayerTriplets::allLayersWithHits
private

Definition at line 51 of file CosmicLayerTriplets.h.

Referenced by init(), and ~CosmicLayerTriplets().

std::vector<BarrelDetLayer*> CosmicLayerTriplets::bl
private

Definition at line 47 of file CosmicLayerTriplets.h.

Referenced by init().

std::vector<ForwardDetLayer*> CosmicLayerTriplets::fneg
private

Definition at line 49 of file CosmicLayerTriplets.h.

std::vector<ForwardDetLayer*> CosmicLayerTriplets::fpos
private

Definition at line 48 of file CosmicLayerTriplets.h.

bool CosmicLayerTriplets::isFirstCall
private

Definition at line 52 of file CosmicLayerTriplets.h.

Referenced by init().

LayerWithHits* CosmicLayerTriplets::lh1
private

Definition at line 42 of file CosmicLayerTriplets.h.

Referenced by init(), and layers().

LayerWithHits* CosmicLayerTriplets::lh2
private

Definition at line 43 of file CosmicLayerTriplets.h.

Referenced by init(), and layers().

LayerWithHits* CosmicLayerTriplets::lh3
private

Definition at line 44 of file CosmicLayerTriplets.h.

Referenced by init(), and layers().

LayerWithHits* CosmicLayerTriplets::lh4
private

Definition at line 45 of file CosmicLayerTriplets.h.

Referenced by init(), and layers().