80 std::cout <<
"SiTrackerGaussianSmearingRecHitConverter instantiated" << std::endl;
84 produces<FastTrackerClusterCollection>(
"TrackerClusters");
86 produces<SiTrackerGSRecHit2DCollection>(
"TrackerGSRecHits");
87 produces<SiTrackerGSMatchedRecHit2DCollection>(
"TrackerGSMatchedRecHits");
99 if(trackingPSimHits)
std::cout <<
"### trackingPSimHits chosen " << trackingPSimHits << std::endl;
110 std::cout << (useCMSSWPixelParameterization?
"CMSSW" :
"ORCA") <<
" pixel parametrization chosen in config file." << std::endl;
169 std::cout <<
"RecHit local position error set to" <<
"\n"
170 <<
"\tTIB1\tx = " << localPositionResolution_TIB1x
171 <<
" cm\ty = " << localPositionResolution_TIB1y <<
" cm" <<
"\n"
172 <<
"\tTIB2\tx = " << localPositionResolution_TIB2x
173 <<
" cm\ty = " << localPositionResolution_TIB2y <<
" cm" <<
"\n"
174 <<
"\tTIB3\tx = " << localPositionResolution_TIB3x
175 <<
" cm\ty = " << localPositionResolution_TIB3y <<
" cm" <<
"\n"
176 <<
"\tTIB4\tx = " << localPositionResolution_TIB4x
177 <<
" cm\ty = " << localPositionResolution_TIB4y <<
" cm" <<
"\n"
178 <<
"\tTID1\tx = " << localPositionResolution_TID1x
179 <<
" cm\ty = " << localPositionResolution_TID1y <<
" cm" <<
"\n"
180 <<
"\tTID2\tx = " << localPositionResolution_TID2x
181 <<
" cm\ty = " << localPositionResolution_TID2y <<
" cm" <<
"\n"
182 <<
"\tTID3\tx = " << localPositionResolution_TID3x
183 <<
" cm\ty = " << localPositionResolution_TID3y <<
" cm" <<
"\n"
184 <<
"\tTOB1\tx = " << localPositionResolution_TOB1x
185 <<
" cm\ty = " << localPositionResolution_TOB1y <<
" cm" <<
"\n"
186 <<
"\tTOB2\tx = " << localPositionResolution_TOB2x
187 <<
" cm\ty = " << localPositionResolution_TOB2y <<
" cm" <<
"\n"
188 <<
"\tTOB3\tx = " << localPositionResolution_TOB3x
189 <<
" cm\ty = " << localPositionResolution_TOB3y <<
" cm" <<
"\n"
190 <<
"\tTOB4\tx = " << localPositionResolution_TOB4x
191 <<
" cm\ty = " << localPositionResolution_TOB4y <<
" cm" <<
"\n"
192 <<
"\tTOB5\tx = " << localPositionResolution_TOB5x
193 <<
" cm\ty = " << localPositionResolution_TOB5y <<
" cm" <<
"\n"
194 <<
"\tTOB6\tx = " << localPositionResolution_TOB6x
195 <<
" cm\ty = " << localPositionResolution_TOB6y <<
" cm" <<
"\n"
196 <<
"\tTEC1\tx = " << localPositionResolution_TEC1x
197 <<
" cm\ty = " << localPositionResolution_TEC1y <<
" cm" <<
"\n"
198 <<
"\tTEC2\tx = " << localPositionResolution_TEC2x
199 <<
" cm\ty = " << localPositionResolution_TEC2y <<
" cm" <<
"\n"
200 <<
"\tTEC3\tx = " << localPositionResolution_TEC3x
201 <<
" cm\ty = " << localPositionResolution_TEC3y <<
" cm" <<
"\n"
202 <<
"\tTEC4\tx = " << localPositionResolution_TEC4x
203 <<
" cm\ty = " << localPositionResolution_TEC4y <<
" cm" <<
"\n"
204 <<
"\tTEC5\tx = " << localPositionResolution_TEC5x
205 <<
" cm\ty = " << localPositionResolution_TEC5y <<
" cm" <<
"\n"
206 <<
"\tTEC6\tx = " << localPositionResolution_TEC6x
207 <<
" cm\ty = " << localPositionResolution_TEC6y <<
" cm" <<
"\n"
208 <<
"\tTEC7\tx = " << localPositionResolution_TEC7x
209 <<
" cm\ty = " << localPositionResolution_TEC7y <<
" cm" <<
"\n"
210 <<
"\tAll:\tz = " << localPositionResolution_z <<
" cm"
215 if(useCMSSWPixelParameterization) {
227 std::cout <<
"Pixel maximum multiplicity set to "
236 if(useCMSSWPixelParameterization) {
253 if(useCMSSWPixelParameterization) {
294 std::cout <<
"RecHit finding probability set to" <<
"\n"
296 <<
"\tPXF = " << theHitFindingProbability_PXF <<
"\n"
297 <<
"\tTIB1 = " << theHitFindingProbability_TIB1 <<
"\n"
298 <<
"\tTIB2 = " << theHitFindingProbability_TIB2 <<
"\n"
299 <<
"\tTIB3 = " << theHitFindingProbability_TIB3 <<
"\n"
300 <<
"\tTIB4 = " << theHitFindingProbability_TIB4 <<
"\n"
301 <<
"\tTID1 = " << theHitFindingProbability_TID1 <<
"\n"
302 <<
"\tTID2 = " << theHitFindingProbability_TID2 <<
"\n"
303 <<
"\tTID3 = " << theHitFindingProbability_TID3 <<
"\n"
304 <<
"\tTOB1 = " << theHitFindingProbability_TOB1 <<
"\n"
305 <<
"\tTOB2 = " << theHitFindingProbability_TOB2 <<
"\n"
306 <<
"\tTOB3 = " << theHitFindingProbability_TOB3 <<
"\n"
307 <<
"\tTOB4 = " << theHitFindingProbability_TOB4 <<
"\n"
308 <<
"\tTOB5 = " << theHitFindingProbability_TOB5 <<
"\n"
309 <<
"\tTOB6 = " << theHitFindingProbability_TOB6 <<
"\n"
310 <<
"\tTEC1 = " << theHitFindingProbability_TEC1 <<
"\n"
311 <<
"\tTEC2 = " << theHitFindingProbability_TEC2 <<
"\n"
312 <<
"\tTEC3 = " << theHitFindingProbability_TEC3 <<
"\n"
313 <<
"\tTEC4 = " << theHitFindingProbability_TEC4 <<
"\n"
314 <<
"\tTEC5 = " << theHitFindingProbability_TEC5 <<
"\n"
315 <<
"\tTEC6 = " << theHitFindingProbability_TEC6 <<
"\n"
316 <<
"\tTEC7 = " << theHitFindingProbability_TEC7 <<
"\n"
398 TFile* pixelDataFile,
399 unsigned int nMultiplicity,
401 std::vector<TH1F*>& theMultiplicityCumulativeProbabilities,
407 theMultiplicityCumulativeProbabilities.clear();
411 for(
unsigned int i = 0;
i<nMultiplicity; ++
i) {
412 TH1F addHist = *((TH1F*) pixelDataFile->Get( Form( histName_i.c_str() ,
i+1 )));
414 theMultiplicityCumulativeProbabilities.push_back(
new TH1F(addHist) );
418 sumHist = *(theMultiplicityCumulativeProbabilities[nMultiplicity+
i-1]);
420 sumHist = *(theMultiplicityCumulativeProbabilities[
i-1]);
421 sumHist.Add(&addHist);
422 theMultiplicityCumulativeProbabilities.push_back(
new TH1F(sumHist) );
428 const unsigned int maxMult = theMultiplicityCumulativeProbabilities.size();
429 unsigned int iMult, multSize;
442 std::cout <<
" Multiplicity cumulated probability " << histName << std::endl;
443 for(; iMult<multSize; ++iMult) {
444 for(
int iBin = 1; iBin<=theMultiplicityCumulativeProbabilities[iMult]->GetNbinsX(); ++iBin) {
446 <<
" Multiplicity " << iMult+1
449 << theMultiplicityCumulativeProbabilities[iMult]->GetBinLowEdge(iBin)
451 << (theMultiplicityCumulativeProbabilities[iMult])->GetBinContent(iBin)
493 magfield=&(*magField);
495 double magFieldAtCenter = magfield->
inTesla(center).
mag();
499 if(magFieldAtCenter > 3.9) {
520 disabledModules =
new std::vector<SiPixelQuality::disabledModuleType> ( siPixelBadModule->getBadComponentList() );
522 size_t numberOfRecoverableModules = 0;
530 if ( (*
disabledModules)[
id-numberOfRecoverableModules].errorType != 0 ){
533 numberOfRecoverableModules++;
544 std::cout <<
"Pixel maximum multiplicity set to "
551 std::cout <<
"Barrel Pixel resolution data are taken from file "
562 std::cout <<
"Forward Pixel resolution data are taken from file "
622 std::map<unsigned, edm::OwnVector<SiTrackerGSRecHit2D> > temporaryRecHits;
623 std::map<unsigned, edm::OwnVector<FastTrackerCluster> > theClusters ;
625 smearHits( allTrackerHits, temporaryRecHits, theClusters, tTopo, &
random);
628 std::map<unsigned, edm::OwnVector<SiTrackerGSMatchedRecHit2D> > temporaryMatchedRecHits ;
651 e.
put(recHitCollection,
"TrackerGSRecHits");
652 e.
put(recHitCollectionMatched,
"TrackerGSMatchedRecHits");
657 e.
put(clusterCollection,
"TrackerClusters");
670 int numberOfPSimHits = 0;
675 edm::PSimHitContainer::const_iterator isim = input.begin();
676 edm::PSimHitContainer::const_iterator lastSimHit = input.end();
685 int simHitCounter = -1;
686 int recHitCounter = 0;
691 for ( ; isim != lastSimHit; ++isim ) {
694 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() );
793 if(subdet > 2) theClusters[trackID].push_back(
795 simHitCounter, trackID,
800 else theClusters[trackID].push_back(
802 simHitCounter, trackID,
813 temporaryRecHits[trackID].push_back(
815 simHitCounter, trackID,
847 const Bounds& theBounds = theDetPlane.bounds();
848 double boundX = theBounds.
width()/2.;
849 double boundY = theBounds.
length()/2.;
853 <<
" rawid " << detid
861 localPositionResolution_z * localPositionResolution_z );
873 double hitFindingProbability = random->
flatShoot();
875 std::cout <<
" Hit finding probability draw: " << hitFindingProbability << std::endl;;
884 unsigned int theLayer = tTopo->
pxbLayer(detid);
885 std::cout <<
"\tPixel Barrel Layer " << theLayer << std::endl;
903 unsigned int theDisk = tTopo->
pxfDisk(detid);
904 std::cout <<
"\tPixel Forward Disk " << theDisk << std::endl;
921 unsigned int theLayer = tTopo->
tibLayer(detid);
923 std::cout <<
"\tTIB Layer " << theLayer << std::endl;
926 double resolutionX, resolutionY, resolutionZ;
961 <<
"\tTIB Layer not valid " << theLayer << std::endl;
981 unsigned int theRing = tTopo->
tidRing(detid);
982 double resolutionFactorY =
986 std::cout <<
"\tTID Ring " << theRing << std::endl;
988 double resolutionX, resolutionY, resolutionZ;
1016 <<
"\tTID Ring not valid " << theRing << std::endl;
1022 boundX *= resolutionFactorY;
1037 unsigned int theLayer = tTopo->
tobLayer(detid);
1039 std::cout <<
"\tTOB Layer " << theLayer << std::endl;
1041 double resolutionX, resolutionY, resolutionZ;
1090 <<
"\tTOB Layer not valid " << theLayer << std::endl;
1108 unsigned int theRing = tTopo->
tecRing(detid);
1109 double resolutionFactorY =
1113 std::cout <<
"\tTEC Ring " << theRing << std::endl;
1115 double resolutionX, resolutionY, resolutionZ;
1171 <<
"\tTEC Ring not valid " << theRing << std::endl;
1177 boundX *= resolutionFactorY;
1189 edm::LogError (
"SiTrackerGaussianSmearingRecHits") <<
"\tTracker subdetector not valid " << subdet << std::endl;
1205 std::map<unsigned,edm::OwnVector<FastTrackerCluster> >::const_iterator
1206 it = theClusterMap.begin();
1207 std::map<unsigned,edm::OwnVector<FastTrackerCluster> >::const_iterator
1208 lastCluster = theClusterMap.end();
1210 for( ; it != lastCluster ; ++it ) {
1211 theClusterCollection.
put(it->first,(it->second).begin(),(it->second).
end());
1222 std::map<unsigned,edm::OwnVector<SiTrackerGSRecHit2D> >::const_iterator
1223 it = theRecHits.begin();
1224 std::map<unsigned,edm::OwnVector<SiTrackerGSRecHit2D> >::const_iterator
1225 lastRecHit = theRecHits.end();
1227 for( ; it != lastRecHit ; ++it ) {
1228 theRecHitCollection.
put(it->first,(it->second).begin(),(it->second).
end());
1238 std::map<unsigned,edm::OwnVector<SiTrackerGSMatchedRecHit2D> >::const_iterator
1239 it = theRecHits.begin();
1240 std::map<unsigned,edm::OwnVector<SiTrackerGSMatchedRecHit2D> >::const_iterator
1241 lastRecHit = theRecHits.end();
1243 for( ; it != lastRecHit ; ++it ) {
1244 theRecHitCollection.
put(it->first,(it->second).begin(),(it->second).
end());
1258 std::map<unsigned, edm::OwnVector<SiTrackerGSRecHit2D> >::iterator it = theRecHits.begin();
1259 std::map<unsigned, edm::OwnVector<SiTrackerGSRecHit2D> >::iterator lastTrack = theRecHits.end();
1262 int recHitCounter = 0;
1266 for( ; it != lastTrack; ++it ) {
1273 for ( ; rit != lastRecHit; ++rit,++recHitCounter){
1276 unsigned int subdet = detid.
subdetId();
1283 if(specDetId.
glued()){
1299 partnerNext++; partnerPrev--;
1302 if( specDetId.
stereo() ) {
1304 int partnersFound = 0;
1307 if(partnerNext != it->second.end() )
1309 partner= partnerNext;
1313 if( rit != it->second.begin())
1316 partner= partnerPrev;
1322 if(partnersFound==0){
1331 if(partnersFound == 1) {
1338 matchedMap[it->first].push_back( theMatchedHit );
1343 matchedMap[it->first].push_back( theProjectedHit );
1350 int partnersFound = 0;
1353 if(partnerNext != it->second.end() )
1358 if( rit != it->second.begin())
1363 if(partnersFound==0){
1372 if(partnersFound==0){
1380 matchedMap[it->first].push_back( theProjectedHit );
1389 rit->simhitId(), rit->simtrackId(), rit->eeId(),
1391 rit->simMultX(), rit->simMultY());
1395 matchedMap[it->first].push_back( rit_copy );
1404 rit->simhitId(), rit->simtrackId(), rit->eeId(),
1406 rit->simMultX(), rit->simMultY());
1410 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
virtual const TrackerGeomDet * idToDetUnit(DetId) const
Return the pointer to the GeomDetUnit corresponding to a given DetId.
std::string thePixelBarrelResolutionFileName
double localPositionResolution_TOB5y
void loadRecHits(std::map< unsigned, edm::OwnVector< SiTrackerGSRecHit2D > > &theRecHits, SiTrackerGSRecHit2DCollection &theRecHitCollection) const
double localPositionResolution_TIB2y
edm::EDGetTokenT< edm::PSimHitContainer > simHitToken
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
bool getByToken(EDGetToken token, Handle< PROD > &result) 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
double localPositionResolution_TID1y
double localPositionResolution_TOB3y
static std::string const input
uint32_t rawId() const
get the raw id
double theHitFindingProbability_TEC2
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
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
void matchHits(std::map< unsigned, edm::OwnVector< SiTrackerGSRecHit2D > > &theRecHits, std::map< unsigned, edm::OwnVector< SiTrackerGSMatchedRecHit2D > > &matchedMap)
double localPositionResolution_TEC5y
SiTrackerGaussianSmearingRecHitConverter(const edm::ParameterSet &conf)
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
double resBetaBarrel_binMin
double resBetaForward_binMin
std::vector< TH1F * > theBarrelMultiplicityBetaCumulativeProbabilities
unsigned int nAlphaBarrel
double theHitFindingProbability_TIB4
TFile * thePixelBarrelResolutionFile
static int position[264][3]
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
LocalError const & localAlignmentError() const
Return local alligment error.
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
virtual const TrackerGeomDet * idToDet(DetId) const
edm::InputTag simHitLabel