Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:28:50

0001 #include "RecoTracker/TkHitPairs/interface/CosmicLayerPairs.h"
0002 #include "RecoTracker/TkDetLayers/interface/GeometricSearchTracker.h"
0003 #include "RecoTracker/Record/interface/TrackerRecoGeometryRecord.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 
0012 #include "DataFormats/TrackerCommon/interface/TrackerTopology.h"
0013 #include "Geometry/Records/interface/TrackerTopologyRcd.h"
0014 std::vector<SeedLayerPairs::LayerPair> CosmicLayerPairs::operator()() {
0015   std::vector<SeedLayerPairs::LayerPair> result;
0016 
0017   if (_geometry == "STANDARD") {
0018     //      result.push_back( SeedLayerPairs::LayerPair(&TIBLayerWithHits[1], &TIBLayerWithHits[0]));
0019     //      result.push_back( SeedLayerPairs::LayerPair(&TIBLayerWithHits[2], &TIBLayerWithHits[0]));
0020 
0021     result.push_back(SeedLayerPairs::LayerPair(&TOBLayerWithHits[3], &TOBLayerWithHits[5]));
0022     result.push_back(SeedLayerPairs::LayerPair(&TOBLayerWithHits[4], &TOBLayerWithHits[5]));
0023     result.push_back(SeedLayerPairs::LayerPair(&TOBLayerWithHits[3], &TOBLayerWithHits[4]));
0024 
0025     result.push_back(SeedLayerPairs::LayerPair(&TECPlusLayerWithHits[7], &TECPlusLayerWithHits[8]));
0026     result.push_back(SeedLayerPairs::LayerPair(&TECPlusLayerWithHits[6], &TECPlusLayerWithHits[8]));
0027 
0028     result.push_back(SeedLayerPairs::LayerPair(&TECPlusLayerWithHits[6], &TECPlusLayerWithHits[7]));
0029     result.push_back(SeedLayerPairs::LayerPair(&TECPlusLayerWithHits[5], &TECPlusLayerWithHits[7]));
0030 
0031     result.push_back(SeedLayerPairs::LayerPair(&TECPlusLayerWithHits[5], &TECPlusLayerWithHits[6]));
0032     result.push_back(SeedLayerPairs::LayerPair(&TECPlusLayerWithHits[4], &TECPlusLayerWithHits[6]));
0033 
0034     result.push_back(SeedLayerPairs::LayerPair(&TECPlusLayerWithHits[4], &TECPlusLayerWithHits[5]));
0035     result.push_back(SeedLayerPairs::LayerPair(&TECPlusLayerWithHits[3], &TECPlusLayerWithHits[5]));
0036 
0037     result.push_back(SeedLayerPairs::LayerPair(&TECPlusLayerWithHits[3], &TECPlusLayerWithHits[4]));
0038     result.push_back(SeedLayerPairs::LayerPair(&TECPlusLayerWithHits[2], &TECPlusLayerWithHits[4]));
0039 
0040     result.push_back(SeedLayerPairs::LayerPair(&TECPlusLayerWithHits[2], &TECPlusLayerWithHits[3]));
0041     result.push_back(SeedLayerPairs::LayerPair(&TECPlusLayerWithHits[1], &TECPlusLayerWithHits[3]));
0042 
0043     result.push_back(SeedLayerPairs::LayerPair(&TECPlusLayerWithHits[1], &TECPlusLayerWithHits[2]));
0044     result.push_back(SeedLayerPairs::LayerPair(&TECPlusLayerWithHits[0], &TECPlusLayerWithHits[2]));
0045 
0046     result.push_back(SeedLayerPairs::LayerPair(&TECPlusLayerWithHits[0], &TECPlusLayerWithHits[1]));
0047 
0048     result.push_back(SeedLayerPairs::LayerPair(&TECMinusLayerWithHits[7], &TECMinusLayerWithHits[8]));
0049     result.push_back(SeedLayerPairs::LayerPair(&TECMinusLayerWithHits[6], &TECMinusLayerWithHits[8]));
0050 
0051     result.push_back(SeedLayerPairs::LayerPair(&TECMinusLayerWithHits[6], &TECMinusLayerWithHits[7]));
0052     result.push_back(SeedLayerPairs::LayerPair(&TECMinusLayerWithHits[5], &TECMinusLayerWithHits[7]));
0053 
0054     result.push_back(SeedLayerPairs::LayerPair(&TECMinusLayerWithHits[5], &TECMinusLayerWithHits[6]));
0055     result.push_back(SeedLayerPairs::LayerPair(&TECMinusLayerWithHits[4], &TECMinusLayerWithHits[6]));
0056 
0057     result.push_back(SeedLayerPairs::LayerPair(&TECMinusLayerWithHits[4], &TECMinusLayerWithHits[5]));
0058     result.push_back(SeedLayerPairs::LayerPair(&TECMinusLayerWithHits[3], &TECMinusLayerWithHits[5]));
0059 
0060     result.push_back(SeedLayerPairs::LayerPair(&TECMinusLayerWithHits[3], &TECMinusLayerWithHits[4]));
0061     result.push_back(SeedLayerPairs::LayerPair(&TECMinusLayerWithHits[2], &TECMinusLayerWithHits[4]));
0062 
0063     result.push_back(SeedLayerPairs::LayerPair(&TECMinusLayerWithHits[2], &TECMinusLayerWithHits[3]));
0064     result.push_back(SeedLayerPairs::LayerPair(&TECMinusLayerWithHits[1], &TECMinusLayerWithHits[3]));
0065 
0066     result.push_back(SeedLayerPairs::LayerPair(&TECMinusLayerWithHits[1], &TECMinusLayerWithHits[2]));
0067     result.push_back(SeedLayerPairs::LayerPair(&TECMinusLayerWithHits[0], &TECMinusLayerWithHits[2]));
0068 
0069     result.push_back(SeedLayerPairs::LayerPair(&TECMinusLayerWithHits[0], &TECMinusLayerWithHits[1]));
0070 
0071   } else if (_geometry == "TECPAIRS_TOBTRIPLETS") {
0072     result.push_back(SeedLayerPairs::LayerPair(&TECPlusLayerWithHits[7], &TECPlusLayerWithHits[8]));
0073     result.push_back(SeedLayerPairs::LayerPair(&TECPlusLayerWithHits[6], &TECPlusLayerWithHits[8]));
0074 
0075     result.push_back(SeedLayerPairs::LayerPair(&TECPlusLayerWithHits[6], &TECPlusLayerWithHits[7]));
0076     result.push_back(SeedLayerPairs::LayerPair(&TECPlusLayerWithHits[5], &TECPlusLayerWithHits[7]));
0077 
0078     result.push_back(SeedLayerPairs::LayerPair(&TECPlusLayerWithHits[5], &TECPlusLayerWithHits[6]));
0079     result.push_back(SeedLayerPairs::LayerPair(&TECPlusLayerWithHits[4], &TECPlusLayerWithHits[6]));
0080 
0081     result.push_back(SeedLayerPairs::LayerPair(&TECPlusLayerWithHits[4], &TECPlusLayerWithHits[5]));
0082     result.push_back(SeedLayerPairs::LayerPair(&TECPlusLayerWithHits[3], &TECPlusLayerWithHits[5]));
0083 
0084     result.push_back(SeedLayerPairs::LayerPair(&TECPlusLayerWithHits[3], &TECPlusLayerWithHits[4]));
0085     result.push_back(SeedLayerPairs::LayerPair(&TECPlusLayerWithHits[2], &TECPlusLayerWithHits[4]));
0086 
0087     result.push_back(SeedLayerPairs::LayerPair(&TECPlusLayerWithHits[2], &TECPlusLayerWithHits[3]));
0088     result.push_back(SeedLayerPairs::LayerPair(&TECPlusLayerWithHits[1], &TECPlusLayerWithHits[3]));
0089 
0090     result.push_back(SeedLayerPairs::LayerPair(&TECPlusLayerWithHits[1], &TECPlusLayerWithHits[2]));
0091     result.push_back(SeedLayerPairs::LayerPair(&TECPlusLayerWithHits[0], &TECPlusLayerWithHits[2]));
0092 
0093     result.push_back(SeedLayerPairs::LayerPair(&TECPlusLayerWithHits[0], &TECPlusLayerWithHits[1]));
0094 
0095     result.push_back(SeedLayerPairs::LayerPair(&TECMinusLayerWithHits[7], &TECMinusLayerWithHits[8]));
0096     result.push_back(SeedLayerPairs::LayerPair(&TECMinusLayerWithHits[6], &TECMinusLayerWithHits[8]));
0097 
0098     result.push_back(SeedLayerPairs::LayerPair(&TECMinusLayerWithHits[6], &TECMinusLayerWithHits[7]));
0099     result.push_back(SeedLayerPairs::LayerPair(&TECMinusLayerWithHits[5], &TECMinusLayerWithHits[7]));
0100 
0101     result.push_back(SeedLayerPairs::LayerPair(&TECMinusLayerWithHits[5], &TECMinusLayerWithHits[6]));
0102     result.push_back(SeedLayerPairs::LayerPair(&TECMinusLayerWithHits[4], &TECMinusLayerWithHits[6]));
0103 
0104     result.push_back(SeedLayerPairs::LayerPair(&TECMinusLayerWithHits[4], &TECMinusLayerWithHits[5]));
0105     result.push_back(SeedLayerPairs::LayerPair(&TECMinusLayerWithHits[3], &TECMinusLayerWithHits[5]));
0106 
0107     result.push_back(SeedLayerPairs::LayerPair(&TECMinusLayerWithHits[3], &TECMinusLayerWithHits[4]));
0108     result.push_back(SeedLayerPairs::LayerPair(&TECMinusLayerWithHits[2], &TECMinusLayerWithHits[4]));
0109 
0110     result.push_back(SeedLayerPairs::LayerPair(&TECMinusLayerWithHits[2], &TECMinusLayerWithHits[3]));
0111     result.push_back(SeedLayerPairs::LayerPair(&TECMinusLayerWithHits[1], &TECMinusLayerWithHits[3]));
0112 
0113     result.push_back(SeedLayerPairs::LayerPair(&TECMinusLayerWithHits[1], &TECMinusLayerWithHits[2]));
0114     result.push_back(SeedLayerPairs::LayerPair(&TECMinusLayerWithHits[0], &TECMinusLayerWithHits[2]));
0115 
0116     result.push_back(SeedLayerPairs::LayerPair(&TECMinusLayerWithHits[0], &TECMinusLayerWithHits[1]));
0117 
0118   } else if (_geometry == "MTCC") {
0119     result.push_back(SeedLayerPairs::LayerPair(&MTCCLayerWithHits[1], &MTCCLayerWithHits[0]));
0120     result.push_back(SeedLayerPairs::LayerPair(&MTCCLayerWithHits[2], &MTCCLayerWithHits[3]));
0121     //IMPORTANT
0122     // The seed from overlaps must be at the end
0123     result.push_back(SeedLayerPairs::LayerPair(&MTCCLayerWithHits[0], &MTCCLayerWithHits[0]));
0124     result.push_back(SeedLayerPairs::LayerPair(&MTCCLayerWithHits[1], &MTCCLayerWithHits[1]));
0125   } else if (_geometry == "CRACK") {
0126     //TODO: clean all this. Now this is a random choice of layers
0127     result.push_back(SeedLayerPairs::LayerPair(&CRACKLayerWithHits[1], &CRACKLayerWithHits[0]));
0128     result.push_back(SeedLayerPairs::LayerPair(&CRACKLayerWithHits[2], &CRACKLayerWithHits[0]));
0129     result.push_back(SeedLayerPairs::LayerPair(&CRACKLayerWithHits[2], &CRACKLayerWithHits[1]));
0130     result.push_back(SeedLayerPairs::LayerPair(&CRACKLayerWithHits[3], &CRACKLayerWithHits[2]));
0131     result.push_back(SeedLayerPairs::LayerPair(&CRACKLayerWithHits[5], &CRACKLayerWithHits[4]));
0132     result.push_back(SeedLayerPairs::LayerPair(&CRACKLayerWithHits[6], &CRACKLayerWithHits[4]));
0133     result.push_back(SeedLayerPairs::LayerPair(&CRACKLayerWithHits[6], &CRACKLayerWithHits[5]));
0134     result.push_back(SeedLayerPairs::LayerPair(&CRACKLayerWithHits[7], &CRACKLayerWithHits[6]));
0135     result.push_back(SeedLayerPairs::LayerPair(&CRACKLayerWithHits[8], &CRACKLayerWithHits[5]));
0136     result.push_back(SeedLayerPairs::LayerPair(&CRACKLayerWithHits[9], &CRACKLayerWithHits[5]));
0137     result.push_back(SeedLayerPairs::LayerPair(&CRACKLayerWithHits[10], &CRACKLayerWithHits[5]));
0138     result.push_back(SeedLayerPairs::LayerPair(&CRACKLayerWithHits[11], &CRACKLayerWithHits[5]));
0139     result.push_back(SeedLayerPairs::LayerPair(&CRACKLayerWithHits[12], &CRACKLayerWithHits[5]));
0140     result.push_back(SeedLayerPairs::LayerPair(&CRACKLayerWithHits[13], &CRACKLayerWithHits[5]));
0141   } else if (_geometry == "TIBD+") {
0142     result.push_back(SeedLayerPairs::LayerPair(&TIBLayerWithHits[1], &TIBLayerWithHits[0]));
0143     result.push_back(SeedLayerPairs::LayerPair(&TIBLayerWithHits[2], &TIBLayerWithHits[3]));
0144     result.push_back(SeedLayerPairs::LayerPair(&TIBLayerWithHits[0], &TIBLayerWithHits[0]));
0145     result.push_back(SeedLayerPairs::LayerPair(&TIBLayerWithHits[1], &TIBLayerWithHits[1]));
0146   } else if (_geometry == "TOB") {
0147     result.push_back(SeedLayerPairs::LayerPair(&TOBLayerWithHits[3], &TOBLayerWithHits[5]));
0148     result.push_back(SeedLayerPairs::LayerPair(&TOBLayerWithHits[4], &TOBLayerWithHits[5]));
0149     result.push_back(SeedLayerPairs::LayerPair(&TOBLayerWithHits[3], &TOBLayerWithHits[4]));
0150 
0151   } else if (_geometry == "TIBTOB") {
0152     result.push_back(SeedLayerPairs::LayerPair(&TIBLayerWithHits[1], &TIBLayerWithHits[0]));
0153     result.push_back(SeedLayerPairs::LayerPair(&TIBLayerWithHits[2], &TIBLayerWithHits[0]));
0154 
0155     result.push_back(SeedLayerPairs::LayerPair(&TOBLayerWithHits[3], &TOBLayerWithHits[5]));
0156     result.push_back(SeedLayerPairs::LayerPair(&TOBLayerWithHits[4], &TOBLayerWithHits[5]));
0157     result.push_back(SeedLayerPairs::LayerPair(&TOBLayerWithHits[3], &TOBLayerWithHits[4]));
0158 
0159   } else if (_geometry == "TEC+") {
0160     result.push_back(SeedLayerPairs::LayerPair(&TECPlusLayerWithHits[7], &TECPlusLayerWithHits[8]));
0161     result.push_back(SeedLayerPairs::LayerPair(&TECPlusLayerWithHits[6], &TECPlusLayerWithHits[8]));
0162 
0163     result.push_back(SeedLayerPairs::LayerPair(&TECPlusLayerWithHits[6], &TECPlusLayerWithHits[7]));
0164     result.push_back(SeedLayerPairs::LayerPair(&TECPlusLayerWithHits[5], &TECPlusLayerWithHits[7]));
0165 
0166     result.push_back(SeedLayerPairs::LayerPair(&TECPlusLayerWithHits[5], &TECPlusLayerWithHits[6]));
0167     result.push_back(SeedLayerPairs::LayerPair(&TECPlusLayerWithHits[4], &TECPlusLayerWithHits[6]));
0168 
0169     result.push_back(SeedLayerPairs::LayerPair(&TECPlusLayerWithHits[4], &TECPlusLayerWithHits[5]));
0170     result.push_back(SeedLayerPairs::LayerPair(&TECPlusLayerWithHits[3], &TECPlusLayerWithHits[5]));
0171 
0172     result.push_back(SeedLayerPairs::LayerPair(&TECPlusLayerWithHits[3], &TECPlusLayerWithHits[4]));
0173     result.push_back(SeedLayerPairs::LayerPair(&TECPlusLayerWithHits[2], &TECPlusLayerWithHits[4]));
0174 
0175     result.push_back(SeedLayerPairs::LayerPair(&TECPlusLayerWithHits[2], &TECPlusLayerWithHits[3]));
0176     result.push_back(SeedLayerPairs::LayerPair(&TECPlusLayerWithHits[1], &TECPlusLayerWithHits[3]));
0177 
0178     result.push_back(SeedLayerPairs::LayerPair(&TECPlusLayerWithHits[2], &TECPlusLayerWithHits[1]));
0179     result.push_back(SeedLayerPairs::LayerPair(&TECPlusLayerWithHits[2], &TECPlusLayerWithHits[0]));
0180 
0181     result.push_back(SeedLayerPairs::LayerPair(&TECPlusLayerWithHits[1], &TECPlusLayerWithHits[0]));
0182 
0183   } else if (_geometry == "CkfTIBD+") {
0184     result.push_back(SeedLayerPairs::LayerPair(&TIBLayerWithHits[0], &TIBLayerWithHits[1]));
0185     result.push_back(SeedLayerPairs::LayerPair(&TIBLayerWithHits[2], &TIBLayerWithHits[3]));
0186   } else if (_geometry == "CkfTIBTOB") {
0187     result.push_back(SeedLayerPairs::LayerPair(&TIBLayerWithHits[0], &TIBLayerWithHits[1]));
0188     result.push_back(SeedLayerPairs::LayerPair(&TIBLayerWithHits[0], &TIBLayerWithHits[2]));
0189 
0190     result.push_back(SeedLayerPairs::LayerPair(&TOBLayerWithHits[3], &TOBLayerWithHits[5]));
0191     result.push_back(SeedLayerPairs::LayerPair(&TOBLayerWithHits[4], &TOBLayerWithHits[5]));
0192     result.push_back(SeedLayerPairs::LayerPair(&TOBLayerWithHits[3], &TOBLayerWithHits[4]));
0193   } else if (_geometry == "CkfTIF3") {
0194     result.push_back(SeedLayerPairs::LayerPair(&TIBLayerWithHits[0], &TIBLayerWithHits[1]));
0195     result.push_back(SeedLayerPairs::LayerPair(&TIBLayerWithHits[0], &TIBLayerWithHits[2]));
0196 
0197     result.push_back(SeedLayerPairs::LayerPair(&TOBLayerWithHits[3], &TOBLayerWithHits[5]));
0198     result.push_back(SeedLayerPairs::LayerPair(&TOBLayerWithHits[4], &TOBLayerWithHits[5]));
0199     result.push_back(SeedLayerPairs::LayerPair(&TOBLayerWithHits[3], &TOBLayerWithHits[4]));
0200 
0201     result.push_back(SeedLayerPairs::LayerPair(&TECPlusLayerWithHits[7], &TECPlusLayerWithHits[8]));
0202     result.push_back(SeedLayerPairs::LayerPair(&TECPlusLayerWithHits[6], &TECPlusLayerWithHits[8]));
0203 
0204     result.push_back(SeedLayerPairs::LayerPair(&TECPlusLayerWithHits[6], &TECPlusLayerWithHits[7]));
0205     result.push_back(SeedLayerPairs::LayerPair(&TECPlusLayerWithHits[5], &TECPlusLayerWithHits[7]));
0206 
0207     result.push_back(SeedLayerPairs::LayerPair(&TECPlusLayerWithHits[5], &TECPlusLayerWithHits[6]));
0208     result.push_back(SeedLayerPairs::LayerPair(&TECPlusLayerWithHits[4], &TECPlusLayerWithHits[6]));
0209 
0210     result.push_back(SeedLayerPairs::LayerPair(&TECPlusLayerWithHits[4], &TECPlusLayerWithHits[5]));
0211     result.push_back(SeedLayerPairs::LayerPair(&TECPlusLayerWithHits[3], &TECPlusLayerWithHits[5]));
0212 
0213     result.push_back(SeedLayerPairs::LayerPair(&TECPlusLayerWithHits[3], &TECPlusLayerWithHits[4]));
0214     result.push_back(SeedLayerPairs::LayerPair(&TECPlusLayerWithHits[2], &TECPlusLayerWithHits[4]));
0215 
0216     result.push_back(SeedLayerPairs::LayerPair(&TECPlusLayerWithHits[2], &TECPlusLayerWithHits[3]));
0217     result.push_back(SeedLayerPairs::LayerPair(&TECPlusLayerWithHits[1], &TECPlusLayerWithHits[3]));
0218 
0219     result.push_back(SeedLayerPairs::LayerPair(&TECPlusLayerWithHits[1], &TECPlusLayerWithHits[2]));
0220     result.push_back(SeedLayerPairs::LayerPair(&TECPlusLayerWithHits[0], &TECPlusLayerWithHits[2]));
0221 
0222     result.push_back(SeedLayerPairs::LayerPair(&TECPlusLayerWithHits[0], &TECPlusLayerWithHits[1]));
0223 
0224   } else if (_geometry == "CkfTOB") {
0225     result.push_back(SeedLayerPairs::LayerPair(&TOBLayerWithHits[0], &TOBLayerWithHits[1]));
0226     result.push_back(SeedLayerPairs::LayerPair(&TOBLayerWithHits[0], &TOBLayerWithHits[2]));
0227 
0228     result.push_back(SeedLayerPairs::LayerPair(&TOBLayerWithHits[3], &TOBLayerWithHits[4]));
0229     result.push_back(SeedLayerPairs::LayerPair(&TOBLayerWithHits[4], &TOBLayerWithHits[5]));
0230     result.push_back(SeedLayerPairs::LayerPair(&TOBLayerWithHits[3], &TOBLayerWithHits[5]));
0231   } else {
0232     throw cms::Exception("CosmicLayerPairs") << "The geometry " << _geometry << " is not implemented ";
0233   }
0234   return result;
0235 }
0236 CosmicLayerPairs::~CosmicLayerPairs() {}
0237 
0238 void CosmicLayerPairs::init(const SiStripRecHit2DCollection &collrphi,
0239                             const SiStripMatchedRecHit2DCollection &collmatched,
0240                             const GeometricSearchTracker &track,
0241                             const TrackerTopology &ttopo) {
0242   ////std::cout << "initializing geometry " << geometry << std::endl;
0243   //std::cout << "about to take barrel" << std::endl;
0244   bl = track.barrelLayers();
0245   //std::cout << "barrel taken" << std::endl;
0246   fpos = track.posTecLayers();
0247   //std::cout << "pos forw taken" << std::endl;
0248   fneg = track.negTecLayers();
0249   //std::cout << "neg forw taken" << std::endl;
0250   //isFirstCall=false;
0251 
0252   if (_geometry ==
0253       "MTCC") {  //we have to distinguish the MTCC and CRACK case because they have special geometries with different neumbering of layers
0254     MTCCLayerWithHits.push_back(new LayerWithHits(bl[0], selectTIBHit(collrphi, ttopo, 1)));
0255     MTCCLayerWithHits.push_back(new LayerWithHits(bl[1], selectTIBHit(collrphi, ttopo, 2)));
0256     MTCCLayerWithHits.push_back(new LayerWithHits(bl[2], selectTOBHit(collrphi, ttopo, 1)));
0257     MTCCLayerWithHits.push_back(new LayerWithHits(bl[3], selectTOBHit(collrphi, ttopo, 2)));
0258     return;
0259   }
0260   if (_geometry == "CRACK") {
0261     CRACKLayerWithHits.push_back(new LayerWithHits(bl[6], selectTOBHit(collmatched, ttopo, 7)));
0262     CRACKLayerWithHits.push_back(new LayerWithHits(bl[5], selectTOBHit(collmatched, ttopo, 6)));
0263     CRACKLayerWithHits.push_back(new LayerWithHits(bl[3], selectTOBHit(collmatched, ttopo, 4)));
0264     CRACKLayerWithHits.push_back(new LayerWithHits(bl[2], selectTOBHit(collmatched, ttopo, 3)));
0265     CRACKLayerWithHits.push_back(new LayerWithHits(bl[6], selectTOBHit(collrphi, ttopo, 7)));
0266     CRACKLayerWithHits.push_back(new LayerWithHits(bl[5], selectTOBHit(collrphi, ttopo, 6)));
0267     CRACKLayerWithHits.push_back(new LayerWithHits(bl[3], selectTOBHit(collrphi, ttopo, 4)));
0268     CRACKLayerWithHits.push_back(new LayerWithHits(bl[2], selectTOBHit(collrphi, ttopo, 3)));
0269     CRACKLayerWithHits.push_back(new LayerWithHits(bl[4], selectTOBHit(collrphi, ttopo, 5)));
0270     CRACKLayerWithHits.push_back(new LayerWithHits(bl[1], selectTOBHit(collrphi, ttopo, 2)));
0271     CRACKLayerWithHits.push_back(new LayerWithHits(bl[0], selectTOBHit(collrphi, ttopo, 1)));
0272     CRACKLayerWithHits.push_back(new LayerWithHits(bl[4], selectTOBHit(collmatched, ttopo, 5)));
0273     CRACKLayerWithHits.push_back(new LayerWithHits(bl[1], selectTOBHit(collmatched, ttopo, 2)));
0274     CRACKLayerWithHits.push_back(new LayerWithHits(bl[0], selectTOBHit(collmatched, ttopo, 1)));
0275     return;
0276   }
0277 
0278   TIBLayerWithHits.push_back(new LayerWithHits(bl[3], selectTIBHit(collrphi, ttopo, 1)));  //layer
0279       //std::cout << "TIB 0" << std::endl;
0280   TIBLayerWithHits.push_back(new LayerWithHits(bl[4], selectTIBHit(collrphi, ttopo, 2)));
0281   //std::cout << "TIB 1" << std::endl;
0282   TIBLayerWithHits.push_back(new LayerWithHits(bl[5], selectTIBHit(collrphi, ttopo, 3)));
0283   //std::cout << "TIB 2" << std::endl;
0284   TIBLayerWithHits.push_back(new LayerWithHits(bl[6], selectTIBHit(collrphi, ttopo, 4)));
0285   //std::cout << "TIB 3" << std::endl;
0286 
0287   TOBLayerWithHits.push_back(new LayerWithHits(bl[7], selectTOBHit(collrphi, ttopo, 1)));
0288   //std::cout << "TOB 0" << std::endl;
0289   TOBLayerWithHits.push_back(new LayerWithHits(bl[8], selectTOBHit(collrphi, ttopo, 2)));
0290   //std::cout << "TOB 1" << std::endl;
0291   TOBLayerWithHits.push_back(new LayerWithHits(bl[9], selectTOBHit(collrphi, ttopo, 3)));
0292   //std::cout << "TOB 2" << std::endl;
0293   TOBLayerWithHits.push_back(new LayerWithHits(bl[10], selectTOBHit(collrphi, ttopo, 4)));
0294   //std::cout << "TOB 3" << std::endl;
0295   TOBLayerWithHits.push_back(new LayerWithHits(bl[11], selectTOBHit(collrphi, ttopo, 5)));
0296   //std::cout << "TOB 4" << std::endl;
0297   TOBLayerWithHits.push_back(new LayerWithHits(bl[12], selectTOBHit(collrphi, ttopo, 6)));
0298   //std::cout << "TOB 5" << std::endl;
0299 
0300   TECPlusLayerWithHits.push_back(new LayerWithHits(fpos[0], selectTECHit(collrphi, ttopo, 2, 1)));  //side, disk
0301       //std::cout << "wheel 0" << std::endl;
0302   TECPlusLayerWithHits.push_back(new LayerWithHits(fpos[1], selectTECHit(collrphi, ttopo, 2, 2)));
0303   //std::cout << "wheel 1" << std::endl;
0304   TECPlusLayerWithHits.push_back(new LayerWithHits(fpos[2], selectTECHit(collrphi, ttopo, 2, 3)));
0305   //std::cout << "wheel 2" << std::endl;
0306   TECPlusLayerWithHits.push_back(new LayerWithHits(fpos[3], selectTECHit(collrphi, ttopo, 2, 4)));
0307   //std::cout << "wheel 3" << std::endl;
0308   TECPlusLayerWithHits.push_back(new LayerWithHits(fpos[4], selectTECHit(collrphi, ttopo, 2, 5)));
0309   //std::cout << "wheel 4" << std::endl;
0310   TECPlusLayerWithHits.push_back(new LayerWithHits(fpos[5], selectTECHit(collrphi, ttopo, 2, 6)));
0311   //std::cout << "wheel 5" << std::endl;
0312   TECPlusLayerWithHits.push_back(new LayerWithHits(fpos[6], selectTECHit(collrphi, ttopo, 2, 7)));
0313   //std::cout << "wheel 6" << std::endl;
0314   TECPlusLayerWithHits.push_back(new LayerWithHits(fpos[7], selectTECHit(collrphi, ttopo, 2, 8)));
0315   //std::cout << "wheel 7" << std::endl;
0316   TECPlusLayerWithHits.push_back(new LayerWithHits(fpos[8], selectTECHit(collrphi, ttopo, 2, 9)));
0317   //std::cout << "wheel 8" << std::endl;
0318 
0319   TECMinusLayerWithHits.push_back(new LayerWithHits(fneg[0], selectTECHit(collrphi, ttopo, 1, 1)));  //side, disk
0320       //std::cout << "wheel 0" << std::endl;
0321   TECMinusLayerWithHits.push_back(new LayerWithHits(fneg[1], selectTECHit(collrphi, ttopo, 1, 2)));
0322   //std::cout << "wheel 1" << std::endl;
0323   TECMinusLayerWithHits.push_back(new LayerWithHits(fneg[2], selectTECHit(collrphi, ttopo, 1, 3)));
0324   //std::cout << "wheel 2" << std::endl;
0325   TECMinusLayerWithHits.push_back(new LayerWithHits(fneg[3], selectTECHit(collrphi, ttopo, 1, 4)));
0326   //std::cout << "wheel 3" << std::endl;
0327   TECMinusLayerWithHits.push_back(new LayerWithHits(fneg[4], selectTECHit(collrphi, ttopo, 1, 5)));
0328   //std::cout << "wheel 4" << std::endl;
0329   TECMinusLayerWithHits.push_back(new LayerWithHits(fneg[5], selectTECHit(collrphi, ttopo, 1, 6)));
0330   //std::cout << "wheel 5" << std::endl;
0331   TECMinusLayerWithHits.push_back(new LayerWithHits(fneg[6], selectTECHit(collrphi, ttopo, 1, 7)));
0332   //std::cout << "wheel 6" << std::endl;
0333   TECMinusLayerWithHits.push_back(new LayerWithHits(fneg[7], selectTECHit(collrphi, ttopo, 1, 8)));
0334   //std::cout << "wheel 7" << std::endl;
0335   TECMinusLayerWithHits.push_back(new LayerWithHits(fneg[8], selectTECHit(collrphi, ttopo, 1, 9)));
0336   //std::cout << "wheel 8" << std::endl;
0337 }
0338 
0339 std::vector<const TrackingRecHit *> CosmicLayerPairs::selectTECHit(const SiStripRecHit2DCollection &collrphi,
0340                                                                    const TrackerTopology &ttopo,
0341                                                                    int side,
0342                                                                    int disk) {
0343   std::vector<const TrackingRecHit *> theChoosedHits;
0344   edmNew::copyDetSetRange(collrphi, theChoosedHits, ttopo.tecDetIdWheelComparator(side, disk));
0345   return theChoosedHits;
0346 }
0347 
0348 std::vector<const TrackingRecHit *> CosmicLayerPairs::selectTIBHit(const SiStripRecHit2DCollection &collrphi,
0349                                                                    const TrackerTopology &ttopo,
0350                                                                    int layer) {
0351   std::vector<const TrackingRecHit *> theChoosedHits;
0352   //std::cout << "in selectTIBHit" << std::endl;
0353   edmNew::copyDetSetRange(collrphi, theChoosedHits, ttopo.tibDetIdLayerComparator(layer));
0354   return theChoosedHits;
0355 }
0356 
0357 std::vector<const TrackingRecHit *> CosmicLayerPairs::selectTOBHit(const SiStripRecHit2DCollection &collrphi,
0358                                                                    const TrackerTopology &ttopo,
0359                                                                    int layer) {
0360   std::vector<const TrackingRecHit *> theChoosedHits;
0361   //std::cout << "in selectTOBHit" << std::endl;
0362   edmNew::copyDetSetRange(collrphi, theChoosedHits, ttopo.tobDetIdLayerComparator(layer));
0363   return theChoosedHits;
0364 }
0365 
0366 std::vector<const TrackingRecHit *> CosmicLayerPairs::selectTECHit(const SiStripMatchedRecHit2DCollection &collmatch,
0367                                                                    const TrackerTopology &ttopo,
0368                                                                    int side,
0369                                                                    int disk) {
0370   std::vector<const TrackingRecHit *> theChoosedHits;
0371   //std::cout << "in selectTECHit" << std::endl;
0372   edmNew::copyDetSetRange(collmatch, theChoosedHits, ttopo.tecDetIdWheelComparator(side, disk));
0373   return theChoosedHits;
0374 }
0375 
0376 std::vector<const TrackingRecHit *> CosmicLayerPairs::selectTIBHit(const SiStripMatchedRecHit2DCollection &collmatch,
0377                                                                    const TrackerTopology &ttopo,
0378                                                                    int layer) {
0379   std::vector<const TrackingRecHit *> theChoosedHits;
0380   //std::cout << "in selectTIBHit" << std::endl;
0381   edmNew::copyDetSetRange(collmatch, theChoosedHits, ttopo.tibDetIdLayerComparator(layer));
0382   return theChoosedHits;
0383 }
0384 
0385 std::vector<const TrackingRecHit *> CosmicLayerPairs::selectTOBHit(const SiStripMatchedRecHit2DCollection &collmatch,
0386                                                                    const TrackerTopology &ttopo,
0387                                                                    int layer) {
0388   std::vector<const TrackingRecHit *> theChoosedHits;
0389   //std::cout << "in selectTOBHit" << std::endl;
0390   edmNew::copyDetSetRange(collmatch, theChoosedHits, ttopo.tobDetIdLayerComparator(layer));
0391   return theChoosedHits;
0392 }