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