82 std::cout <<
"SiTrackerGaussianSmearingRecHitConverter instantiated" << std::endl;
86 produces<FastTrackerClusterCollection>(
"TrackerClusters");
88 produces<SiTrackerGSRecHit2DCollection>(
"TrackerGSRecHits");
89 produces<SiTrackerGSMatchedRecHit2DCollection>(
"TrackerGSMatchedRecHits");
100 if(trackingPSimHits)
std::cout <<
"### trackingPSimHits chosen " << trackingPSimHits << std::endl;
111 std::cout << (useCMSSWPixelParameterization?
"CMSSW" :
"ORCA") <<
" pixel parametrization chosen in config file." << std::endl;
170 std::cout <<
"RecHit local position error set to" <<
"\n"
171 <<
"\tTIB1\tx = " << localPositionResolution_TIB1x
172 <<
" cm\ty = " << localPositionResolution_TIB1y <<
" cm" <<
"\n"
173 <<
"\tTIB2\tx = " << localPositionResolution_TIB2x
174 <<
" cm\ty = " << localPositionResolution_TIB2y <<
" cm" <<
"\n"
175 <<
"\tTIB3\tx = " << localPositionResolution_TIB3x
176 <<
" cm\ty = " << localPositionResolution_TIB3y <<
" cm" <<
"\n"
177 <<
"\tTIB4\tx = " << localPositionResolution_TIB4x
178 <<
" cm\ty = " << localPositionResolution_TIB4y <<
" cm" <<
"\n"
179 <<
"\tTID1\tx = " << localPositionResolution_TID1x
180 <<
" cm\ty = " << localPositionResolution_TID1y <<
" cm" <<
"\n"
181 <<
"\tTID2\tx = " << localPositionResolution_TID2x
182 <<
" cm\ty = " << localPositionResolution_TID2y <<
" cm" <<
"\n"
183 <<
"\tTID3\tx = " << localPositionResolution_TID3x
184 <<
" cm\ty = " << localPositionResolution_TID3y <<
" cm" <<
"\n"
185 <<
"\tTOB1\tx = " << localPositionResolution_TOB1x
186 <<
" cm\ty = " << localPositionResolution_TOB1y <<
" cm" <<
"\n"
187 <<
"\tTOB2\tx = " << localPositionResolution_TOB2x
188 <<
" cm\ty = " << localPositionResolution_TOB2y <<
" cm" <<
"\n"
189 <<
"\tTOB3\tx = " << localPositionResolution_TOB3x
190 <<
" cm\ty = " << localPositionResolution_TOB3y <<
" cm" <<
"\n"
191 <<
"\tTOB4\tx = " << localPositionResolution_TOB4x
192 <<
" cm\ty = " << localPositionResolution_TOB4y <<
" cm" <<
"\n"
193 <<
"\tTOB5\tx = " << localPositionResolution_TOB5x
194 <<
" cm\ty = " << localPositionResolution_TOB5y <<
" cm" <<
"\n"
195 <<
"\tTOB6\tx = " << localPositionResolution_TOB6x
196 <<
" cm\ty = " << localPositionResolution_TOB6y <<
" cm" <<
"\n"
197 <<
"\tTEC1\tx = " << localPositionResolution_TEC1x
198 <<
" cm\ty = " << localPositionResolution_TEC1y <<
" cm" <<
"\n"
199 <<
"\tTEC2\tx = " << localPositionResolution_TEC2x
200 <<
" cm\ty = " << localPositionResolution_TEC2y <<
" cm" <<
"\n"
201 <<
"\tTEC3\tx = " << localPositionResolution_TEC3x
202 <<
" cm\ty = " << localPositionResolution_TEC3y <<
" cm" <<
"\n"
203 <<
"\tTEC4\tx = " << localPositionResolution_TEC4x
204 <<
" cm\ty = " << localPositionResolution_TEC4y <<
" cm" <<
"\n"
205 <<
"\tTEC5\tx = " << localPositionResolution_TEC5x
206 <<
" cm\ty = " << localPositionResolution_TEC5y <<
" cm" <<
"\n"
207 <<
"\tTEC6\tx = " << localPositionResolution_TEC6x
208 <<
" cm\ty = " << localPositionResolution_TEC6y <<
" cm" <<
"\n"
209 <<
"\tTEC7\tx = " << localPositionResolution_TEC7x
210 <<
" cm\ty = " << localPositionResolution_TEC7y <<
" cm" <<
"\n"
211 <<
"\tAll:\tz = " << localPositionResolution_z <<
" cm"
216 if(useCMSSWPixelParameterization) {
228 std::cout <<
"Pixel maximum multiplicity set to "
237 if(useCMSSWPixelParameterization) {
254 if(useCMSSWPixelParameterization) {
295 std::cout <<
"RecHit finding probability set to" <<
"\n"
297 <<
"\tPXF = " << theHitFindingProbability_PXF <<
"\n"
298 <<
"\tTIB1 = " << theHitFindingProbability_TIB1 <<
"\n"
299 <<
"\tTIB2 = " << theHitFindingProbability_TIB2 <<
"\n"
300 <<
"\tTIB3 = " << theHitFindingProbability_TIB3 <<
"\n"
301 <<
"\tTIB4 = " << theHitFindingProbability_TIB4 <<
"\n"
302 <<
"\tTID1 = " << theHitFindingProbability_TID1 <<
"\n"
303 <<
"\tTID2 = " << theHitFindingProbability_TID2 <<
"\n"
304 <<
"\tTID3 = " << theHitFindingProbability_TID3 <<
"\n"
305 <<
"\tTOB1 = " << theHitFindingProbability_TOB1 <<
"\n"
306 <<
"\tTOB2 = " << theHitFindingProbability_TOB2 <<
"\n"
307 <<
"\tTOB3 = " << theHitFindingProbability_TOB3 <<
"\n"
308 <<
"\tTOB4 = " << theHitFindingProbability_TOB4 <<
"\n"
309 <<
"\tTOB5 = " << theHitFindingProbability_TOB5 <<
"\n"
310 <<
"\tTOB6 = " << theHitFindingProbability_TOB6 <<
"\n"
311 <<
"\tTEC1 = " << theHitFindingProbability_TEC1 <<
"\n"
312 <<
"\tTEC2 = " << theHitFindingProbability_TEC2 <<
"\n"
313 <<
"\tTEC3 = " << theHitFindingProbability_TEC3 <<
"\n"
314 <<
"\tTEC4 = " << theHitFindingProbability_TEC4 <<
"\n"
315 <<
"\tTEC5 = " << theHitFindingProbability_TEC5 <<
"\n"
316 <<
"\tTEC6 = " << theHitFindingProbability_TEC6 <<
"\n"
317 <<
"\tTEC7 = " << theHitFindingProbability_TEC7 <<
"\n"
399 TFile* pixelDataFile,
400 unsigned int nMultiplicity,
402 std::vector<TH1F*>& theMultiplicityCumulativeProbabilities,
408 theMultiplicityCumulativeProbabilities.clear();
412 for(
unsigned int i = 0;
i<nMultiplicity; ++
i) {
413 TH1F addHist = *((TH1F*) pixelDataFile->Get( Form( histName_i.c_str() ,
i+1 )));
415 theMultiplicityCumulativeProbabilities.push_back(
new TH1F(addHist) );
419 sumHist = *(theMultiplicityCumulativeProbabilities[nMultiplicity+
i-1]);
421 sumHist = *(theMultiplicityCumulativeProbabilities[
i-1]);
422 sumHist.Add(&addHist);
423 theMultiplicityCumulativeProbabilities.push_back(
new TH1F(sumHist) );
429 const unsigned int maxMult = theMultiplicityCumulativeProbabilities.size();
430 unsigned int iMult, multSize;
443 std::cout <<
" Multiplicity cumulated probability " << histName << std::endl;
444 for(; iMult<multSize; ++iMult) {
445 for(
int iBin = 1; iBin<=theMultiplicityCumulativeProbabilities[iMult]->GetNbinsX(); ++iBin) {
447 <<
" Multiplicity " << iMult+1
450 << theMultiplicityCumulativeProbabilities[iMult]->GetBinLowEdge(iBin)
452 << (theMultiplicityCumulativeProbabilities[iMult])->GetBinContent(iBin)
494 magfield=&(*magField);
496 double magFieldAtCenter = magfield->
inTesla(center).
mag();
500 if(magFieldAtCenter > 3.9) {
521 disabledModules =
new std::vector<SiPixelQuality::disabledModuleType> ( siPixelBadModule->getBadComponentList() );
523 size_t numberOfRecoverableModules = 0;
531 if ( (*
disabledModules)[
id-numberOfRecoverableModules].errorType != 0 ){
534 numberOfRecoverableModules++;
545 std::cout <<
"Pixel maximum multiplicity set to "
552 std::cout <<
"Barrel Pixel resolution data are taken from file "
563 std::cout <<
"Forward Pixel resolution data are taken from file "
623 std::map<unsigned, edm::OwnVector<SiTrackerGSRecHit2D> > temporaryRecHits;
624 std::map<unsigned, edm::OwnVector<FastTrackerCluster> > theClusters ;
626 smearHits( allTrackerHits, temporaryRecHits, theClusters, tTopo, &
random);
629 std::map<unsigned, edm::OwnVector<SiTrackerGSMatchedRecHit2D> > temporaryMatchedRecHits ;
652 e.
put(recHitCollection,
"TrackerGSRecHits");
653 e.
put(recHitCollectionMatched,
"TrackerGSMatchedRecHits");
658 e.
put(clusterCollection,
"TrackerClusters");
671 int numberOfPSimHits = 0;
676 edm::PSimHitContainer::const_iterator isim = input.begin();
677 edm::PSimHitContainer::const_iterator lastSimHit = input.end();
686 int simHitCounter = -1;
687 int recHitCounter = 0;
692 for ( ; isim != lastSimHit; ++isim ) {
695 DetId det((*isim).detUnitId());
696 unsigned trackID = (*isim).trackId();
697 uint32_t eeID = (*isim).eventId().
rawId();
712 unsigned int geoId = det.rawId();
726 unsigned int alphaMult = 0;
727 unsigned int betaMult = 0;
728 bool isCreated =
gaussianSmearing(*isim, position, error, alphaMult, betaMult, tTopo, random);
731 unsigned int subdet = det.subdetId();
774 if( !specDetId.
glued() ){
778 else{
if(subdet>2) position =
Local3DPoint(position.
x(),0.,0.); }
787 error.
xy()+lape.
xy(),
788 error.
yy()+lape.
yy() );
794 if(subdet > 2) theClusters[trackID].push_back(
796 simHitCounter, trackID,
801 else theClusters[trackID].push_back(
803 simHitCounter, trackID,
814 temporaryRecHits[trackID].push_back(
816 simHitCounter, trackID,
848 const Bounds& theBounds = theDetPlane.bounds();
849 double boundX = theBounds.
width()/2.;
850 double boundY = theBounds.
length()/2.;
854 <<
" rawid " << detid
862 localPositionResolution_z * localPositionResolution_z );
874 double hitFindingProbability = random->
flatShoot();
876 std::cout <<
" Hit finding probability draw: " << hitFindingProbability << std::endl;;
885 unsigned int theLayer = tTopo->
pxbLayer(detid);
886 std::cout <<
"\tPixel Barrel Layer " << theLayer << std::endl;
904 unsigned int theDisk = tTopo->
pxfDisk(detid);
905 std::cout <<
"\tPixel Forward Disk " << theDisk << std::endl;
922 unsigned int theLayer = tTopo->
tibLayer(detid);
924 std::cout <<
"\tTIB Layer " << theLayer << std::endl;
927 double resolutionX, resolutionY, resolutionZ;
962 <<
"\tTIB Layer not valid " << theLayer << std::endl;
982 unsigned int theRing = tTopo->
tidRing(detid);
983 double resolutionFactorY =
987 std::cout <<
"\tTID Ring " << theRing << std::endl;
989 double resolutionX, resolutionY, resolutionZ;
1017 <<
"\tTID Ring not valid " << theRing << std::endl;
1023 boundX *= resolutionFactorY;
1038 unsigned int theLayer = tTopo->
tobLayer(detid);
1040 std::cout <<
"\tTOB Layer " << theLayer << std::endl;
1042 double resolutionX, resolutionY, resolutionZ;
1091 <<
"\tTOB Layer not valid " << theLayer << std::endl;
1109 unsigned int theRing = tTopo->
tecRing(detid);
1110 double resolutionFactorY =
1114 std::cout <<
"\tTEC Ring " << theRing << std::endl;
1116 double resolutionX, resolutionY, resolutionZ;
1172 <<
"\tTEC Ring not valid " << theRing << std::endl;
1178 boundX *= resolutionFactorY;
1190 edm::LogError (
"SiTrackerGaussianSmearingRecHits") <<
"\tTracker subdetector not valid " << subdet << std::endl;
1206 std::map<unsigned,edm::OwnVector<FastTrackerCluster> >::const_iterator
1207 it = theClusterMap.begin();
1208 std::map<unsigned,edm::OwnVector<FastTrackerCluster> >::const_iterator
1209 lastCluster = theClusterMap.end();
1211 for( ; it != lastCluster ; ++it ) {
1212 theClusterCollection.
put(it->first,(it->second).begin(),(it->second).
end());
1223 std::map<unsigned,edm::OwnVector<SiTrackerGSRecHit2D> >::const_iterator
1224 it = theRecHits.begin();
1225 std::map<unsigned,edm::OwnVector<SiTrackerGSRecHit2D> >::const_iterator
1226 lastRecHit = theRecHits.end();
1228 for( ; it != lastRecHit ; ++it ) {
1229 theRecHitCollection.
put(it->first,(it->second).begin(),(it->second).
end());
1239 std::map<unsigned,edm::OwnVector<SiTrackerGSMatchedRecHit2D> >::const_iterator
1240 it = theRecHits.begin();
1241 std::map<unsigned,edm::OwnVector<SiTrackerGSMatchedRecHit2D> >::const_iterator
1242 lastRecHit = theRecHits.end();
1244 for( ; it != lastRecHit ; ++it ) {
1245 theRecHitCollection.
put(it->first,(it->second).begin(),(it->second).
end());
1259 std::map<unsigned, edm::OwnVector<SiTrackerGSRecHit2D> >::iterator it = theRecHits.begin();
1260 std::map<unsigned, edm::OwnVector<SiTrackerGSRecHit2D> >::iterator lastTrack = theRecHits.end();
1263 int recHitCounter = 0;
1267 for( ; it != lastTrack; ++it ) {
1274 for ( ; rit != lastRecHit; ++rit,++recHitCounter){
1277 unsigned int subdet = detid.
subdetId();
1284 if(specDetId.
glued()){
1300 partnerNext++; partnerPrev--;
1303 if( specDetId.
stereo() ) {
1305 int partnersFound = 0;
1308 if(partnerNext != it->second.end() )
1310 partner= partnerNext;
1314 if( rit != it->second.begin())
1317 partner= partnerPrev;
1323 if(partnersFound==0){
1332 if(partnersFound == 1) {
1339 matchedMap[it->first].push_back( theMatchedHit );
1344 matchedMap[it->first].push_back( theProjectedHit );
1351 int partnersFound = 0;
1354 if(partnerNext != it->second.end() )
1359 if( rit != it->second.begin())
1364 if(partnersFound==0){
1373 if(partnersFound==0){
1381 matchedMap[it->first].push_back( theProjectedHit );
1389 rit->geographicalId(),
1390 rit->simhitId(), rit->simtrackId(), rit->eeId(),
1392 rit->simMultX(), rit->simMultY());
1396 matchedMap[it->first].push_back( rit_copy );
1404 rit->geographicalId(),
1405 rit->simhitId(), rit->simtrackId(), rit->eeId(),
1407 rit->simMultX(), rit->simMultY());
1411 matchedMap[it->first].push_back( rit_copy );
std::vector< TH1F * > theBarrelMultiplicityAlphaCumulativeProbabilities
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
T getParameter(std::string const &) const
const TrackerGeometry * misAlignedGeometry
std::string thePixelBarrelResolutionFileName
double localPositionResolution_TOB5y
void loadRecHits(std::map< unsigned, edm::OwnVector< SiTrackerGSRecHit2D > > &theRecHits, SiTrackerGSRecHit2DCollection &theRecHitCollection) const
double localPositionResolution_TIB2y
double localPositionResolution_TOB2y
SiStripGaussianSmearingRecHitConverterAlgorithm * theSiStripErrorParametrization
unsigned int nAlphaForward
virtual float length() const =0
unsigned int getPixelMultiplicityAlpha()
unsigned int tibLayer(const DetId &id) const
unsigned int tidRing(const DetId &id) const
bool gaussianSmearing(const PSimHit &simHit, Local3DPoint &position, LocalError &error, unsigned &alphaMult, unsigned &betaMult, const TrackerTopology *tTopo, RandomEngineAndDistribution const *)
SiPixelGaussianSmearingRecHitConverterAlgorithm * thePixelEndcapParametrization
unsigned int nBetaForward
double flatShoot(double xmin=0.0, double xmax=1.0) const
SiTrackerGSMatchedRecHit2D * match(const SiTrackerGSRecHit2D *monoRH, const SiTrackerGSRecHit2D *stereoRH, const GluedGeomDet *gluedDet, LocalVector &trackdirection) const
double localPositionResolution_TIB3y
std::vector< TH1F * > theForwardMultiplicityAlphaCumulativeProbabilities
const Local3DPoint & getPosition() const
unsigned int resAlphaBarrel_binN
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
double localPositionResolution_TOB4x
bool useCMSSWPixelParameterization
unsigned int pxfDisk(const DetId &id) const
double resAlphaBarrel_binMin
double theHitFindingProbability_TEC3
unsigned int tecRing(const DetId &id) const
ring id
double localPositionResolution_z
double theHitFindingProbability_TEC5
double localPositionResolution_TEC1y
double theHitFindingProbability_TIB2
double theHitFindingProbability_TID2
double resBetaBarrel_binWidth
double localPositionResolution_TEC6y
double theHitFindingProbability_TEC1
double theHitFindingProbability_TEC7
unsigned int resBetaForward_binN
void smearHits(const edm::PSimHitContainer &input, std::map< unsigned, edm::OwnVector< SiTrackerGSRecHit2D > > &theRecHits, std::map< unsigned, edm::OwnVector< FastTrackerCluster > > &theClusters, const TrackerTopology *tTopo, RandomEngineAndDistribution const *)
double theHitFindingProbability_TOB5
double theHitFindingProbability_TOB3
void loadClusters(std::map< unsigned, edm::OwnVector< FastTrackerCluster > > &theClusterMap, FastTrackerClusterCollection &theClusterCollection) const
std::vector< SimHiterator > correspondingSimHit
double resAlphaForward_binWidth
double localPositionResolution_TID2x
double localPositionResolution_TOB3x
const Plane & surface() const
The nominal surface of the GeomDet.
double theHitFindingProbability_PXF
std::vector< TH1F * > theForwardMultiplicityBetaCumulativeProbabilities
static int position[TOTALCHAMBERS][3]
double localPositionResolution_TID1y
double localPositionResolution_TOB3y
static std::string const input
uint32_t rawId() const
get the raw id
double theHitFindingProbability_TEC2
edm::InputTag inputSimHits
double localPositionResolution_TEC4y
double localPositionResolution_TID2y
unsigned int glued() const
glued
double theHitFindingProbability_TIB3
unsigned int resAlphaForward_binN
TFile * thePixelForwardResolutionFile
Local3DPoint localPosition() const
double localPositionResolution_TOB2x
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
double localPositionResolution_TOB1x
LocalPoint toLocal(const GlobalPoint &gp) const
virtual ~SiTrackerGaussianSmearingRecHitConverter()
double localPositionResolution_TOB6y
void loadMatchedRecHits(std::map< unsigned, edm::OwnVector< SiTrackerGSMatchedRecHit2D > > &theRecHits, SiTrackerGSMatchedRecHit2DCollection &theRecHitCollection) const
double localPositionResolution_TOB5x
double localPositionResolution_TEC1x
double theHitFindingProbability_TID3
double localPositionResolution_TIB1y
double localPositionResolution_TIB4x
double theHitFindingProbability_TEC6
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
SiPixelGaussianSmearingRecHitConverterAlgorithm * thePixelBarrelParametrization
std::vector< SiPixelQuality::disabledModuleType > * disabledModules
virtual const GeomDet * idToDet(DetId) const
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
double theHitFindingProbability_TOB2
double resBetaForward_binWidth
const LocalError & getError() const
double localPositionResolution_TEC2y
unsigned int resBetaBarrel_binN
RefProd< PROD > getRefBeforePut()
double localPositionResolution_TEC4x
void put(ID id, CI begin, CI end)
insert an object range with specified identifier
std::string thePixelMultiplicityFileName
const TrackerGeometry * geometry
unsigned int pxbLayer(const DetId &id) const
Point3DBase< float, LocalTag > Local3DPoint
double resAlphaForward_binMin
unsigned int stereo() const
stereo
std::string thePixelForwardResolutionFileName
SiTrackerGSRecHit2D::ClusterRef ClusterRef
double resAlphaBarrel_binWidth
virtual void produce(edm::Event &e, const edm::EventSetup &c) override
double theHitFindingProbability_TOB1
virtual void beginRun(edm::Run const &run, const edm::EventSetup &es) override
SiTrackerGSMatchedRecHit2D * projectOnly(const SiTrackerGSRecHit2D *monoRH, const GeomDet *monoDet, const GluedGeomDet *gluedDet, LocalVector &ldir) const
AlignmentPositionError * alignmentPositionError() const
Return pointer to alignment errors.
void matchHits(std::map< unsigned, edm::OwnVector< SiTrackerGSRecHit2D > > &theRecHits, std::map< unsigned, edm::OwnVector< SiTrackerGSMatchedRecHit2D > > &matchedMap)
double localPositionResolution_TEC5y
SiTrackerGaussianSmearingRecHitConverter(const edm::ParameterSet &conf)
const GlobalError & globalError() const
double localPositionResolution_TID3y
double theHitFindingProbability_TIB1
void smearHit(const PSimHit &simHit, const PixelGeomDetUnit *detUnit, const double boundX, const double boundY, RandomEngineAndDistribution const *)
double localPositionResolution_TOB4y
double localPositionResolution_TID1x
virtual const GeomDetUnit * idToDetUnit(DetId) const
Return the pointer to the GeomDetUnit corresponding to a given DetId.
double resBetaBarrel_binMin
double resBetaForward_binMin
std::vector< TH1F * > theBarrelMultiplicityBetaCumulativeProbabilities
unsigned int nAlphaBarrel
double theHitFindingProbability_TIB4
TFile * thePixelBarrelResolutionFile
double localPositionResolution_TEC2x
double localPositionResolution_TOB6x
StreamID streamID() const
double localPositionResolution_TEC7x
double localPositionResolution_TOB1y
double localPositionResolution_TIB2x
double localPositionResolution_TID3x
double localPositionResolution_TIB1x
unsigned int getPixelMultiplicityBeta()
double localPositionResolution_TEC5x
std::vector< PSimHit > PSimHitContainer
double theHitFindingProbability_TEC4
double localPositionResolution_TEC7y
double theHitFindingProbability_PXB
double theHitFindingProbability_TOB4
unsigned int numberOfDisabledModules
double theHitFindingProbability_TOB6
double localPositionResolution_TIB4y
ClusterRefProd FastTrackerClusterRefProd
double localPositionResolution_TIB3x
virtual float width() const =0
double localPositionResolution_TEC3x
double localPositionResolution_TEC3y
const GeomDetUnit * stereoDet() const
unsigned int detUnitId() const
unsigned int tobLayer(const DetId &id) const
Local3DPoint getPosition()
void smearHit(const PSimHit &simHit, double localPositionResolutionX, double localPositionResolutionY, double localPositionResolutionZ, double boundX, double boundY, RandomEngineAndDistribution const *)
double theHitFindingProbability_TID1
double localPositionResolution_TEC6x