00001 #ifndef CloudMakerAlgorithm_h
00002 #define CloudMakerAlgorithm_h
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
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
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