CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC2/src/RecoTracker/RoadSearchCloudMaker/plugins/RoadSearchCloudMakerAlgorithm.h

Go to the documentation of this file.
00001 #ifndef CloudMakerAlgorithm_h
00002 #define CloudMakerAlgorithm_h
00003 
00004 //
00005 // Package:         RecoTracker/RoadSearchCloudMaker
00006 // Class:           RoadSearchCloudMakerAlgorithm
00007 // 
00008 // Description:     
00009 //                  Road categories determined by outer Seed RecHit
00010 //                      RPhi: outer Seed RecHit in the Barrel
00011 //                      ZPhi: outer Seed RecHit in the Disks
00012 //                  use inner and outer Seed RecHit and BeamSpot to calculate extrapolation
00013 //                      RPhi: phi = phi0 + asin(k r)
00014 //                      ZPhi: phi = phi0 + C z
00015 //                  Loop over RoadSet, access Rings of Road
00016 //                      get average radius of Ring
00017 //                      use extrapolation to calculate phi_ref at average Ring radius
00018 //                      determine window in phi for DetId lookup in the Ring
00019 //                              phi_ref ± phi_window
00020 //                                      PARAMETER: phi_window = pi/24
00021 //                      loop over DetId's in phi window in Ring
00022 //                              two cases (problem of phi = 0/2pi):
00023 //                                      lower window border < upper window border
00024 //                                      upper window border < lower window border
00025 //                  Loop over RecHits of DetId
00026 //                      check compatibility of RecHit with extrapolation (delta phi cut)
00027 //                      single layer sensor treatment
00028 //                              RPhi:
00029 //                                      stereo and barrel single layer sensor
00030 //                                              calculate delta-phi
00031 //                                      disk single layer sensor (r coordinate not well defined)
00032 //                                              calculate delta phi between global positions of maximal strip extension and reference
00033 //                              ZPhi:
00034 //                                      stereo sensor
00035 //                                              calculate delta-phi
00036 //                                      barrel single layer sensor (z coordinate not well defined)
00037 //                                              calculate delta phi between global positions of maximal strip extension and reference
00038 //                                      disk single layer sensor (tilted strips relative to local coordinate system of sensor
00039 //                                              calculate delta phi between global positions of maximal strip extension and reference
00040 //                  Check delta phi cut
00041 //                      cut value can be calculated based on extrapolation and Seed (pT dependent delta phi cut)
00042 //                      currently: constant delta phi cut (PARAMETER)
00043 //                              fill RecHit into Cloud
00044 //                                      do not fill more than 32 RecHits per DetID into cloud (PARAMETER)
00045 //                  first stage of Cloud cleaning cuts:
00046 //                      number of layers with hits in cloud (PARAMETER)
00047 //                      number of layers with no hits in cloud (PARAMETER)
00048 //                      number of consecutive layers with no hits in cloud (PARAMETER)
00049 //
00050 // Original Author: Oliver Gutsche, gutsche@fnal.gov
00051 // Created:         Sat Jan 14 22:00:00 UTC 2006
00052 //
00053 // $Author: eulisse $
00054 // $Date: 2012/10/24 08:10:40 $
00055 // $Revision: 1.1 $
00056 //
00057 
00058 #include <string>
00059 #include <sstream>
00060 
00061 #include "DataFormats/Common/interface/Handle.h"
00062 #include "FWCore/Framework/interface/ESHandle.h"
00063 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00064 #include "FWCore/Framework/interface/EventSetup.h"
00065 
00066 #include "DataFormats/DetId/interface/DetId.h"
00067 #include "DataFormats/RoadSearchSeed/interface/RoadSearchSeedCollection.h"
00068 #include "DataFormats/TrackerRecHit2D/interface/SiStripRecHit2DCollection.h"
00069 #include "DataFormats/TrackerRecHit2D/interface/SiPixelRecHitCollection.h"
00070 #include "DataFormats/TrackerRecHit2D/interface/SiStripMatchedRecHit2DCollection.h"
00071 
00072 #include "DataFormats/RoadSearchCloud/interface/RoadSearchCloudCollection.h"
00073 #include "DataFormats/RoadSearchCloud/interface/RoadSearchCloud.h"
00074 #include "RecoTracker/RoadMapRecord/interface/Roads.h"
00075 
00076 #include "TrackingTools/RoadSearchHitAccess/interface/DetHitAccess.h"
00077 
00078 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
00079 
00080 #include "RecoLocalTracker/SiStripRecHitConverter/interface/SiStripRecHitMatcher.h"
00081  
00082 class RoadSearchCloudMakerAlgorithm 
00083 {
00084  public:
00085   
00086   RoadSearchCloudMakerAlgorithm(const edm::ParameterSet& conf);
00087   ~RoadSearchCloudMakerAlgorithm();
00088 
00090   void run(edm::Handle<RoadSearchSeedCollection> input,
00091            const SiStripRecHit2DCollection* rphiRecHits,
00092            const SiStripRecHit2DCollection* stereoRecHits,
00093            const SiStripMatchedRecHit2DCollection* matchedRecHits,
00094            const SiPixelRecHitCollection *pixRecHits,
00095            const edm::EventSetup& es,
00096            RoadSearchCloudCollection &output);
00097 
00098   unsigned int FillRecHitsIntoCloudGeneral(DetId id, double d0, double phi0, double k0, double phi1, double k1,
00099                                            Roads::type roadType, double ringPhi,
00100                                            const TrackerGeometry *tracker, const SiStripRecHitMatcher* theHitMatcher, RoadSearchCloud &cloud);
00101 
00102   unsigned int FillRecHitsIntoCloud(DetId id, const SiStripRecHit2DCollection* inputRecHits, 
00103                                     double d0, double phi0, double k0, Roads::type roadType, double ringPhi,
00104                                     const TrackerGeometry *tracker, RoadSearchCloud &cloud);
00105 
00106   
00107   unsigned int FillPixRecHitsIntoCloud(DetId id, 
00108                                        const SiPixelRecHitCollection *inputRecHits, 
00109                                        double d0, double phi0, double k0, Roads::type roadType, double ringPhi,
00110                                        const TrackerGeometry *tracker, RoadSearchCloud &cloud);
00111 
00112   bool isSingleLayer(DetId id);
00113 
00114   bool isBarrelSensor(DetId id);
00115 
00116   double phiFromExtrapolation(double d0, double phi0, double k0, double ringRadius, Roads::type roadType);
00117 
00118   double phiMax(Roads::type roadType, double phi0, double k0);
00119 
00120   double map_phi(double phi);
00121   double map_phi2(double phi);
00122 
00123   void makecircle(double x1_cs, double y1_cs,double x2_cs, double y2_cs,
00124                                              double x3_cs, double y3_cs);
00125 
00126   double CheckXYIntersection(LocalPoint& ip1, LocalPoint& op1, LocalPoint& ip2, LocalPoint& op2);
00127 
00128   double CheckZPhiIntersection(double iPhi1, double iZ1, double oPhi1, double oZ1,
00129                                double iPhi2, double iZ2, double oPhi2, double oZ2);
00130 
00131   double ZPhiDeltaPhi(double phi1, double phi2, double phiExpect);
00132 
00133   RoadSearchCloudCollection Clean(RoadSearchCloudCollection *rawColl);
00134 
00135   SiStripMatchedRecHit2D*  CorrectMatchedHit(const TrackingRecHit* originalRH,
00136                                              const GluedGeomDet* gluedDet,
00137                                              const TrackerGeometry *tracker,
00138                                              const SiStripRecHitMatcher* theHitMatcher,
00139                                              double k0, double phi0);
00140 
00141  private:
00142 
00143   edm::ParameterSet conf_;
00144   static double epsilon;
00145   double d0h, phi0h, omegah;
00146   double rphicsq;
00147   int rphinhits;
00148   const SiPixelRecHitCollection thePixRecHits;
00149   
00150   // general hit access for road search
00151   DetHitAccess recHitVectorClass;
00152   
00153   double theRPhiRoadSize;
00154   double theZPhiRoadSize;
00155   double theMinimumHalfRoad;
00156   bool UsePixels;
00157   bool NoFieldCosmic;
00158   unsigned int maxDetHitsInCloudPerDetId;
00159   double       minFractionOfUsedLayersPerCloud;
00160   double       maxFractionOfMissedLayersPerCloud;
00161   double       maxFractionOfConsecutiveMissedLayersPerCloud;
00162   unsigned int increaseMaxNumberOfConsecutiveMissedLayersPerCloud;
00163   unsigned int increaseMaxNumberOfMissedLayersPerCloud;
00164 
00165   bool doCleaning_;
00166   double mergingFraction_;
00167   unsigned int maxRecHitsInCloud_;
00168 
00169   std::ostringstream output_;
00170   double scalefactorRoadSeedWindow_;
00171 
00172   std::string roadsLabel_;
00173 
00174 };
00175 
00176 #endif