Go to the documentation of this file.00001 #ifndef FastSimulation_TrackingRecHitProducer_SiTrackerGaussianSmearingRecHitConverter_h
00002 #define FastSimulation_TrackingRecHitProducer_SiTrackerGaussianSmearingRecHitConverter_h
00003
00004
00009
00010
00011
00012 #include "FWCore/Framework/interface/EDProducer.h"
00013 #include "FWCore/Utilities/interface/InputTag.h"
00014 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00015
00016
00017 #include "SimDataFormats/TrackingHit/interface/PSimHit.h"
00018 #include "SimDataFormats/TrackingHit/interface/PSimHitContainer.h"
00019
00020
00021 #include "SimDataFormats/CrossingFrame/interface/MixCollection.h"
00022 #include "FastSimDataFormats/External/interface/FastTrackerClusterCollection.h"
00023 #include "DataFormats/TrackerRecHit2D/interface/SiTrackerGSRecHit2DCollection.h"
00024 #include "DataFormats/TrackerRecHit2D/interface/SiTrackerGSMatchedRecHit2DCollection.h"
00025 #include "DataFormats/GeometryVector/interface/Point3DBase.h"
00026 #include "DataFormats/GeometrySurface/interface/LocalError.h"
00027
00028
00029 #include <vector>
00030 #include <map>
00031 #include <string>
00032
00033 class TFile;
00034 class TH1F;
00035 class TrackerGeometry;
00036 class SiPixelGaussianSmearingRecHitConverterAlgorithm;
00037 class SiStripGaussianSmearingRecHitConverterAlgorithm;
00038 class RandomEngine;
00039
00040 namespace edm {
00041 class ParameterSet;
00042 class Event;
00043 class EventSetup;
00044 }
00045
00046
00047 class SiTrackerGaussianSmearingRecHitConverter : public edm::EDProducer
00048 {
00049 public:
00050
00051 explicit SiTrackerGaussianSmearingRecHitConverter(const edm::ParameterSet& conf);
00052 virtual ~SiTrackerGaussianSmearingRecHitConverter();
00053
00054
00055 virtual void produce(edm::Event& e, const edm::EventSetup& c);
00056
00057
00058 virtual void beginRun(edm::Run & run, const edm::EventSetup & es);
00059
00060 void smearHits(MixCollection<PSimHit>& input,
00061 std::map<unsigned, edm::OwnVector<SiTrackerGSRecHit2D> >& theRecHits,
00062 std::map<unsigned, edm::OwnVector<FastTrackerCluster> >& theClusters);
00063
00064 void matchHits( std::map<unsigned, edm::OwnVector<SiTrackerGSRecHit2D> >& theRecHits,
00065 std::map<unsigned, edm::OwnVector<SiTrackerGSMatchedRecHit2D> >& matchedMap,
00066 MixCollection<PSimHit>& simhits);
00067
00068 void loadRecHits(std::map<unsigned,edm::OwnVector<SiTrackerGSRecHit2D> >& theRecHits,
00069 SiTrackerGSRecHit2DCollection& theRecHitCollection) const;
00070
00071 void loadMatchedRecHits(std::map<unsigned,edm::OwnVector<SiTrackerGSMatchedRecHit2D> >& theRecHits,
00072 SiTrackerGSMatchedRecHit2DCollection& theRecHitCollection) const;
00073
00074 void loadClusters(std::map<unsigned,edm::OwnVector<FastTrackerCluster> >& theClusterMap,
00075 FastTrackerClusterCollection& theClusterCollection) const;
00076
00077
00078
00079 private:
00080
00081 bool gaussianSmearing(const PSimHit& simHit,
00082 Local3DPoint& position ,
00083 LocalError& error,
00084 unsigned& alphaMult,
00085 unsigned& betaMult);
00086
00087 void loadPixelData();
00088
00089 void loadPixelData(TFile* pixelDataFile, unsigned int nMultiplicity, std::string histName,
00090 std::vector<TH1F*>& theMultiplicityCumulativeProbabilities, bool bigPixels = false);
00091
00092
00093
00094 std::vector<edm::InputTag> trackerContainers;
00095 edm::ParameterSet pset_;
00096 double deltaRaysPCut;
00097 bool trackingPSimHits;
00098
00099 bool doMatching;
00100
00101 bool useCMSSWPixelParameterization;
00102 double ElectronsPerADC;
00103 double GevPerElectron;
00104
00105 const TrackerGeometry* geometry;
00106 const TrackerGeometry* misAlignedGeometry;
00107
00108
00109 std::string thePixelMultiplicityFileName;
00110 std::string thePixelBarrelResolutionFileName;
00111 std::string thePixelForwardResolutionFileName;
00112 TFile* thePixelDataFile;
00113 TFile* thePixelBarrelResolutionFile;
00114 TFile* thePixelForwardResolutionFile;
00115
00116
00117 unsigned int nAlphaBarrel, nBetaBarrel, nAlphaForward, nBetaForward;
00118
00119 std::vector<TH1F*> theBarrelMultiplicityAlphaCumulativeProbabilities;
00120 std::vector<TH1F*> theBarrelMultiplicityBetaCumulativeProbabilities;
00121 std::vector<TH1F*> theForwardMultiplicityAlphaCumulativeProbabilities;
00122 std::vector<TH1F*> theForwardMultiplicityBetaCumulativeProbabilities;
00123
00124 double resAlphaBarrel_binMin , resAlphaBarrel_binWidth;
00125 unsigned int resAlphaBarrel_binN;
00126 double resBetaBarrel_binMin , resBetaBarrel_binWidth;
00127 unsigned int resBetaBarrel_binN;
00128 double resAlphaForward_binMin , resAlphaForward_binWidth;
00129 unsigned int resAlphaForward_binN;
00130 double resBetaForward_binMin , resBetaForward_binWidth;
00131 unsigned int resBetaForward_binN;
00132
00133 double theHitFindingProbability_PXB;
00134 double theHitFindingProbability_PXF;
00135
00136
00137
00138 double localPositionResolution_TIB1x;
00139 double localPositionResolution_TIB1y;
00140 double localPositionResolution_TIB2x;
00141 double localPositionResolution_TIB2y;
00142 double localPositionResolution_TIB3x;
00143 double localPositionResolution_TIB3y;
00144 double localPositionResolution_TIB4x;
00145 double localPositionResolution_TIB4y;
00146
00147 double theHitFindingProbability_TIB1;
00148 double theHitFindingProbability_TIB2;
00149 double theHitFindingProbability_TIB3;
00150 double theHitFindingProbability_TIB4;
00151
00152
00153 double localPositionResolution_TID1x;
00154 double localPositionResolution_TID1y;
00155 double localPositionResolution_TID2x;
00156 double localPositionResolution_TID2y;
00157 double localPositionResolution_TID3x;
00158 double localPositionResolution_TID3y;
00159
00160 double theHitFindingProbability_TID1;
00161 double theHitFindingProbability_TID2;
00162 double theHitFindingProbability_TID3;
00163
00164
00165 double localPositionResolution_TOB1x;
00166 double localPositionResolution_TOB1y;
00167 double localPositionResolution_TOB2x;
00168 double localPositionResolution_TOB2y;
00169 double localPositionResolution_TOB3x;
00170 double localPositionResolution_TOB3y;
00171 double localPositionResolution_TOB4x;
00172 double localPositionResolution_TOB4y;
00173 double localPositionResolution_TOB5x;
00174 double localPositionResolution_TOB5y;
00175 double localPositionResolution_TOB6x;
00176 double localPositionResolution_TOB6y;
00177
00178 double theHitFindingProbability_TOB1;
00179 double theHitFindingProbability_TOB2;
00180 double theHitFindingProbability_TOB3;
00181 double theHitFindingProbability_TOB4;
00182 double theHitFindingProbability_TOB5;
00183 double theHitFindingProbability_TOB6;
00184
00185
00186 double localPositionResolution_TEC1x;
00187 double localPositionResolution_TEC1y;
00188 double localPositionResolution_TEC2x;
00189 double localPositionResolution_TEC2y;
00190 double localPositionResolution_TEC3x;
00191 double localPositionResolution_TEC3y;
00192 double localPositionResolution_TEC4x;
00193 double localPositionResolution_TEC4y;
00194 double localPositionResolution_TEC5x;
00195 double localPositionResolution_TEC5y;
00196 double localPositionResolution_TEC6x;
00197 double localPositionResolution_TEC6y;
00198 double localPositionResolution_TEC7x;
00199 double localPositionResolution_TEC7y;
00200
00201 double theHitFindingProbability_TEC1;
00202 double theHitFindingProbability_TEC2;
00203 double theHitFindingProbability_TEC3;
00204 double theHitFindingProbability_TEC4;
00205 double theHitFindingProbability_TEC5;
00206 double theHitFindingProbability_TEC6;
00207 double theHitFindingProbability_TEC7;
00208
00209
00210 double localPositionResolution_z;
00211
00212
00213
00214
00215 SiPixelGaussianSmearingRecHitConverterAlgorithm* thePixelBarrelParametrization;
00216
00217 SiPixelGaussianSmearingRecHitConverterAlgorithm* thePixelEndcapParametrization;
00218
00219 SiStripGaussianSmearingRecHitConverterAlgorithm* theSiStripErrorParametrization;
00220
00221
00222
00223
00224
00225 typedef MixCollection<PSimHit>::iterator SimHiterator;
00226 std::vector<SimHiterator> correspondingSimHit;
00227
00228
00229 const RandomEngine* random;
00230
00231 typedef SiTrackerGSRecHit2D::ClusterRef ClusterRef;
00232 typedef SiTrackerGSRecHit2D::ClusterRefProd ClusterRefProd;
00233
00234 ClusterRefProd FastTrackerClusterRefProd;
00235
00236 };
00237
00238
00239 #endif