Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-09-22 02:39:54

0001 #include "RecoPixelVertexing/PixelTriplets/interface/CosmicLayerTriplets.h"
0002 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0003 #include "RecoPixelVertexing/PixelTriplets/interface/CosmicHitTripletGenerator.h"
0004 
0005 #include <vector>
0006 
0007 using namespace std;
0008 
0009 CosmicHitTripletGenerator::CosmicHitTripletGenerator(CosmicLayerTriplets& layers, const TrackerGeometry& trackGeom) {
0010   //  vector<LayerTriplets::LayerTriplet> layerTriplets = layers();
0011   vector<CosmicLayerTriplets::LayerPairAndLayers> layerTriplets = layers.layers();
0012   vector<CosmicLayerTriplets::LayerPairAndLayers>::const_iterator it;
0013   for (it = layerTriplets.begin(); it != layerTriplets.end(); it++) {
0014     vector<const LayerWithHits*>::const_iterator ilwh;
0015     for (ilwh = (*it).second.begin(); ilwh != (*it).second.end(); ilwh++) {
0016       //      const LayerWithHits* first=(*it).first.first;
0017       //       const LayerWithHits* second=(*it).first.second;
0018       //       const LayerWithHits* third=(*ilwh);
0019       //      add( (*it).first.first, (*it).first.second, (*it).second,iSetup);
0020       add((*it).first.first, (*it).first.second, (*ilwh), trackGeom);
0021     }
0022   }
0023 }
0024 
0025 CosmicHitTripletGenerator::~CosmicHitTripletGenerator() {}
0026 
0027 void CosmicHitTripletGenerator::add(const LayerWithHits* inner,
0028                                     const LayerWithHits* middle,
0029                                     const LayerWithHits* outer,
0030                                     const TrackerGeometry& trackGeom) {
0031   theGenerators.push_back(std::make_unique<CosmicHitTripletGeneratorFromLayerTriplet>(inner, middle, outer, trackGeom));
0032 }
0033 
0034 void CosmicHitTripletGenerator::hitTriplets(const TrackingRegion& region, OrderedHitTriplets& pairs) {
0035   Container::const_iterator i;
0036   for (i = theGenerators.begin(); i != theGenerators.end(); i++) {
0037     (**i).hitTriplets(region, pairs);
0038   }
0039 }