00001 00009 #include "Alignment/LaserAlignment/interface/LaserHitPairGenerator.h" 00010 #include "Alignment/LaserAlignment/interface/LaserHitPairGeneratorFromLayerPair.h" 00011 00012 #include "Alignment/LaserAlignment/interface/SeedLayerPairs.h" 00013 00014 LaserHitPairGenerator::LaserHitPairGenerator(SeedLayerPairs & layers, const edm::EventSetup & iSetup) 00015 { 00016 std::vector<SeedLayerPairs::LayerPair> layerPairs = layers(); 00017 00018 for (std::vector<SeedLayerPairs::LayerPair>::const_iterator it = layerPairs.begin(); it != layerPairs.end(); it++) 00019 { 00020 add((*it).first, (*it).second, iSetup); 00021 } 00022 } 00023 00024 LaserHitPairGenerator::~LaserHitPairGenerator() 00025 { 00026 for (Container::const_iterator it = theGenerators.begin(); it != theGenerators.end(); it++) 00027 { 00028 delete (*it); 00029 } 00030 } 00031 00032 void LaserHitPairGenerator::add(const LayerWithHits * inner, const LayerWithHits * outer, const edm::EventSetup & iSetup) 00033 { 00034 theGenerators.push_back(new LaserHitPairGeneratorFromLayerPair(inner, outer, iSetup)); 00035 } 00036 00037 void LaserHitPairGenerator::hitPairs(const TrackingRegion & region, OrderedLaserHitPairs & pairs, const edm::EventSetup & iSetup) 00038 { 00039 for (Container::const_iterator it = theGenerators.begin(); it != theGenerators.end(); it++) 00040 { 00041 (**it).hitPairs(region, pairs, iSetup); 00042 } 00043 00044 theLayerCache.clear(); 00045 } 00046 00047 const OrderedLaserHitPairs & LaserHitPairGenerator::run(const TrackingRegion& region, const edm::Event & iEvent, const edm::EventSetup& iSetup) 00048 { 00049 thePairs.clear(); 00050 hitPairs(region, thePairs, iEvent, iSetup); 00051 return thePairs; 00052 }