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 "RecoTracker/TkHitPairs/interface/SeedLayerPairs.h"
0003 #include "RecoTracker/TkDetLayers/interface/GeometricSearchTracker.h"
0004 
0005 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0006 
0007 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
0008 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
0009 #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h"
0010 #include "FWCore/Framework/interface/ESHandle.h"
0011 #include "TrackingTools/DetLayers/interface/BarrelDetLayer.h"
0012 
0013 #include "DataFormats/TrackerCommon/interface/TrackerTopology.h"
0014 #include "Geometry/Records/interface/TrackerTopologyRcd.h"
0015 
0016 using std::vector;
0017 vector<CosmicLayerTriplets::LayerPairAndLayers> CosmicLayerTriplets::layers() {
0018   vector<LayerPairAndLayers> result;
0019 
0020   if (_geometry == "STANDARD") {
0021     vector<const LayerWithHits*> third;
0022     third.push_back(lh3);
0023     result.push_back(LayerPairAndLayers(SeedLayerPairs::LayerPair(lh1, lh2), third));
0024   }
0025   if (_geometry == "TECPAIRS_TOBTRIPLETS") {
0026     vector<const LayerWithHits*> third;
0027     third.push_back(lh3);
0028     result.push_back(LayerPairAndLayers(SeedLayerPairs::LayerPair(lh1, lh2), third));
0029   }
0030   if (_geometry == "MTCC") {
0031     vector<const LayerWithHits*> third1;
0032     vector<const LayerWithHits*> third2;
0033     vector<const LayerWithHits*> third3;
0034     vector<const LayerWithHits*> third4;
0035     third1.clear();
0036     third2.clear();
0037     third3.clear();
0038     third4.clear();
0039     third1.push_back(lh1);
0040     result.push_back(LayerPairAndLayers(SeedLayerPairs::LayerPair(lh3, lh2), third1));
0041     third2.push_back(lh1);
0042     result.push_back(LayerPairAndLayers(SeedLayerPairs::LayerPair(lh2, lh1), third2));
0043     third3.push_back(lh2);
0044     result.push_back(LayerPairAndLayers(SeedLayerPairs::LayerPair(lh3, lh2), third3));
0045     third4.push_back(lh4);
0046     result.push_back(LayerPairAndLayers(SeedLayerPairs::LayerPair(lh2, lh3), third4));
0047   }
0048   return result;
0049 }
0050 CosmicLayerTriplets::~CosmicLayerTriplets() {
0051   for (vector<LayerWithHits*>::const_iterator it = allLayersWithHits.begin(); it != allLayersWithHits.end(); it++) {
0052     delete *it;
0053   }
0054 }
0055 
0056 void CosmicLayerTriplets::init(const SiStripRecHit2DCollection& collrphi,
0057                                std::string geometry,
0058                                const GeometricSearchTracker& track,
0059                                const TrackerTopology& ttopo) {
0060   _geometry = std::move(geometry);
0061   bl = track.barrelLayers();
0062   for (vector<LayerWithHits*>::const_iterator it = allLayersWithHits.begin(); it != allLayersWithHits.end(); it++) {
0063     delete *it;
0064   }
0065 
0066   allLayersWithHits.clear();
0067   LogDebug("CosmicSeedFinder") << "Reconstruction for geometry  " << _geometry;
0068   if (_geometry == "STANDARD" || _geometry == "TECPAIRS_TOBTRIPLETS") {
0069     const DetLayer* bl1 = dynamic_cast<DetLayer const*>(bl[10]);
0070     const DetLayer* bl2 = dynamic_cast<DetLayer const*>(bl[11]);
0071     const DetLayer* bl3 = dynamic_cast<DetLayer const*>(bl[12]);
0072     //   //LayersWithHits
0073     lh1 = new LayerWithHits(bl1, collrphi, ttopo.tobDetIdLayerComparator(4));
0074     allLayersWithHits.push_back(lh1);
0075     lh2 = new LayerWithHits(bl2, collrphi, ttopo.tobDetIdLayerComparator(5));
0076     allLayersWithHits.push_back(lh2);
0077     lh3 = new LayerWithHits(bl3, collrphi, ttopo.tobDetIdLayerComparator(6));
0078     allLayersWithHits.push_back(lh3);
0079   }
0080   if (_geometry == "MTCC") {
0081     const DetLayer* bl1 = dynamic_cast<DetLayer const*>(bl[0]);
0082     const DetLayer* bl2 = dynamic_cast<DetLayer const*>(bl[1]);
0083     const DetLayer* bl3 = dynamic_cast<DetLayer const*>(bl[2]);
0084     const DetLayer* bl4 = dynamic_cast<DetLayer const*>(bl[3]);
0085 
0086     lh1 = new LayerWithHits(bl1, collrphi, ttopo.tibDetIdLayerComparator(1));
0087     allLayersWithHits.push_back(lh1);
0088     lh2 = new LayerWithHits(bl2, collrphi, ttopo.tibDetIdLayerComparator(2));
0089     allLayersWithHits.push_back(lh2);
0090     lh3 = new LayerWithHits(bl3, collrphi, ttopo.tobDetIdLayerComparator(1));
0091     allLayersWithHits.push_back(lh3);
0092     lh4 = new LayerWithHits(bl4, collrphi, ttopo.tobDetIdLayerComparator(2));
0093     allLayersWithHits.push_back(lh4);
0094   }
0095 }