87 std::cout <<
"SiTrackerGaussianSmearingRecHitConverter instantiated" << std::endl;
94 <<
"SiTrackerGaussianSmearingRecHitConverter requires the RandomGeneratorService\n"
95 "which is not present in the configuration file.\n"
96 "You must add the service in the configuration file\n"
97 "or remove the module that requires it";
102 produces<FastTrackerClusterCollection>(
"TrackerClusters");
104 produces<SiTrackerGSRecHit2DCollection>(
"TrackerGSRecHits");
105 produces<SiTrackerGSMatchedRecHit2DCollection>(
"TrackerGSMatchedRecHits");
116 if(trackingPSimHits)
std::cout <<
"### trackingPSimHits chosen " << trackingPSimHits << std::endl;
127 std::cout << (useCMSSWPixelParameterization?
"CMSSW" :
"ORCA") <<
" pixel parametrization chosen in config file." << std::endl;
186 std::cout <<
"RecHit local position error set to" <<
"\n"
187 <<
"\tTIB1\tx = " << localPositionResolution_TIB1x
188 <<
" cm\ty = " << localPositionResolution_TIB1y <<
" cm" <<
"\n"
189 <<
"\tTIB2\tx = " << localPositionResolution_TIB2x
190 <<
" cm\ty = " << localPositionResolution_TIB2y <<
" cm" <<
"\n"
191 <<
"\tTIB3\tx = " << localPositionResolution_TIB3x
192 <<
" cm\ty = " << localPositionResolution_TIB3y <<
" cm" <<
"\n"
193 <<
"\tTIB4\tx = " << localPositionResolution_TIB4x
194 <<
" cm\ty = " << localPositionResolution_TIB4y <<
" cm" <<
"\n"
195 <<
"\tTID1\tx = " << localPositionResolution_TID1x
196 <<
" cm\ty = " << localPositionResolution_TID1y <<
" cm" <<
"\n"
197 <<
"\tTID2\tx = " << localPositionResolution_TID2x
198 <<
" cm\ty = " << localPositionResolution_TID2y <<
" cm" <<
"\n"
199 <<
"\tTID3\tx = " << localPositionResolution_TID3x
200 <<
" cm\ty = " << localPositionResolution_TID3y <<
" cm" <<
"\n"
201 <<
"\tTOB1\tx = " << localPositionResolution_TOB1x
202 <<
" cm\ty = " << localPositionResolution_TOB1y <<
" cm" <<
"\n"
203 <<
"\tTOB2\tx = " << localPositionResolution_TOB2x
204 <<
" cm\ty = " << localPositionResolution_TOB2y <<
" cm" <<
"\n"
205 <<
"\tTOB3\tx = " << localPositionResolution_TOB3x
206 <<
" cm\ty = " << localPositionResolution_TOB3y <<
" cm" <<
"\n"
207 <<
"\tTOB4\tx = " << localPositionResolution_TOB4x
208 <<
" cm\ty = " << localPositionResolution_TOB4y <<
" cm" <<
"\n"
209 <<
"\tTOB5\tx = " << localPositionResolution_TOB5x
210 <<
" cm\ty = " << localPositionResolution_TOB5y <<
" cm" <<
"\n"
211 <<
"\tTOB6\tx = " << localPositionResolution_TOB6x
212 <<
" cm\ty = " << localPositionResolution_TOB6y <<
" cm" <<
"\n"
213 <<
"\tTEC1\tx = " << localPositionResolution_TEC1x
214 <<
" cm\ty = " << localPositionResolution_TEC1y <<
" cm" <<
"\n"
215 <<
"\tTEC2\tx = " << localPositionResolution_TEC2x
216 <<
" cm\ty = " << localPositionResolution_TEC2y <<
" cm" <<
"\n"
217 <<
"\tTEC3\tx = " << localPositionResolution_TEC3x
218 <<
" cm\ty = " << localPositionResolution_TEC3y <<
" cm" <<
"\n"
219 <<
"\tTEC4\tx = " << localPositionResolution_TEC4x
220 <<
" cm\ty = " << localPositionResolution_TEC4y <<
" cm" <<
"\n"
221 <<
"\tTEC5\tx = " << localPositionResolution_TEC5x
222 <<
" cm\ty = " << localPositionResolution_TEC5y <<
" cm" <<
"\n"
223 <<
"\tTEC6\tx = " << localPositionResolution_TEC6x
224 <<
" cm\ty = " << localPositionResolution_TEC6y <<
" cm" <<
"\n"
225 <<
"\tTEC7\tx = " << localPositionResolution_TEC7x
226 <<
" cm\ty = " << localPositionResolution_TEC7y <<
" cm" <<
"\n"
227 <<
"\tAll:\tz = " << localPositionResolution_z <<
" cm"
232 if(useCMSSWPixelParameterization) {
244 std::cout <<
"Pixel maximum multiplicity set to "
253 if(useCMSSWPixelParameterization) {
270 if(useCMSSWPixelParameterization) {
311 std::cout <<
"RecHit finding probability set to" <<
"\n"
313 <<
"\tPXF = " << theHitFindingProbability_PXF <<
"\n"
314 <<
"\tTIB1 = " << theHitFindingProbability_TIB1 <<
"\n"
315 <<
"\tTIB2 = " << theHitFindingProbability_TIB2 <<
"\n"
316 <<
"\tTIB3 = " << theHitFindingProbability_TIB3 <<
"\n"
317 <<
"\tTIB4 = " << theHitFindingProbability_TIB4 <<
"\n"
318 <<
"\tTID1 = " << theHitFindingProbability_TID1 <<
"\n"
319 <<
"\tTID2 = " << theHitFindingProbability_TID2 <<
"\n"
320 <<
"\tTID3 = " << theHitFindingProbability_TID3 <<
"\n"
321 <<
"\tTOB1 = " << theHitFindingProbability_TOB1 <<
"\n"
322 <<
"\tTOB2 = " << theHitFindingProbability_TOB2 <<
"\n"
323 <<
"\tTOB3 = " << theHitFindingProbability_TOB3 <<
"\n"
324 <<
"\tTOB4 = " << theHitFindingProbability_TOB4 <<
"\n"
325 <<
"\tTOB5 = " << theHitFindingProbability_TOB5 <<
"\n"
326 <<
"\tTOB6 = " << theHitFindingProbability_TOB6 <<
"\n"
327 <<
"\tTEC1 = " << theHitFindingProbability_TEC1 <<
"\n"
328 <<
"\tTEC2 = " << theHitFindingProbability_TEC2 <<
"\n"
329 <<
"\tTEC3 = " << theHitFindingProbability_TEC3 <<
"\n"
330 <<
"\tTEC4 = " << theHitFindingProbability_TEC4 <<
"\n"
331 <<
"\tTEC5 = " << theHitFindingProbability_TEC5 <<
"\n"
332 <<
"\tTEC6 = " << theHitFindingProbability_TEC6 <<
"\n"
333 <<
"\tTEC7 = " << theHitFindingProbability_TEC7 <<
"\n"
415 TFile* pixelDataFile,
416 unsigned int nMultiplicity,
418 std::vector<TH1F*>& theMultiplicityCumulativeProbabilities,
424 theMultiplicityCumulativeProbabilities.clear();
428 for(
unsigned int i = 0;
i<nMultiplicity; ++
i) {
429 TH1F addHist = *((TH1F*) pixelDataFile->Get( Form( histName_i.c_str() ,
i+1 )));
431 theMultiplicityCumulativeProbabilities.push_back(
new TH1F(addHist) );
435 sumHist = *(theMultiplicityCumulativeProbabilities[nMultiplicity+
i-1]);
437 sumHist = *(theMultiplicityCumulativeProbabilities[
i-1]);
438 sumHist.Add(&addHist);
439 theMultiplicityCumulativeProbabilities.push_back(
new TH1F(sumHist) );
445 const unsigned int maxMult = theMultiplicityCumulativeProbabilities.size();
446 unsigned int iMult, multSize;
459 std::cout <<
" Multiplicity cumulated probability " << histName << std::endl;
460 for(; iMult<multSize; ++iMult) {
461 for(
int iBin = 1; iBin<=theMultiplicityCumulativeProbabilities[iMult]->GetNbinsX(); ++iBin) {
463 <<
" Multiplicity " << iMult+1
466 << theMultiplicityCumulativeProbabilities[iMult]->GetBinLowEdge(iBin)
468 << (theMultiplicityCumulativeProbabilities[iMult])->GetBinContent(iBin)
513 magfield=&(*magField);
515 double magFieldAtCenter = magfield->
inTesla(center).
mag();
519 if(magFieldAtCenter > 3.9) {
540 disabledModules =
new std::vector<SiPixelQuality::disabledModuleType> ( siPixelBadModule->getBadComponentList() );
542 size_t numberOfRecoverableModules = 0;
550 if ( (*
disabledModules)[
id-numberOfRecoverableModules].errorType != 0 ){
553 numberOfRecoverableModules++;
564 std::cout <<
"Pixel maximum multiplicity set to "
571 std::cout <<
"Barrel Pixel resolution data are taken from file "
582 std::cout <<
"Forward Pixel resolution data are taken from file "
643 std::map<unsigned, edm::OwnVector<SiTrackerGSRecHit2D> > temporaryRecHits;
644 std::map<unsigned, edm::OwnVector<FastTrackerCluster> > theClusters ;
646 smearHits( allTrackerHits, temporaryRecHits, theClusters, tTopo);
649 std::map<unsigned, edm::OwnVector<SiTrackerGSMatchedRecHit2D> > temporaryMatchedRecHits ;
672 e.
put(recHitCollection,
"TrackerGSRecHits");
673 e.
put(recHitCollectionMatched,
"TrackerGSMatchedRecHits");
678 e.
put(clusterCollection,
"TrackerClusters");
690 int numberOfPSimHits = 0;
695 edm::PSimHitContainer::const_iterator isim = input.begin();
696 edm::PSimHitContainer::const_iterator lastSimHit = input.end();
705 int simHitCounter = -1;
706 int recHitCounter = 0;
711 for ( ; isim != lastSimHit; ++isim ) {
714 DetId det((*isim).detUnitId());
715 unsigned trackID = (*isim).trackId();
716 uint32_t eeID = (*isim).eventId().
rawId();
731 unsigned int geoId = det.rawId();
745 unsigned int alphaMult = 0;
746 unsigned int betaMult = 0;
747 bool isCreated =
gaussianSmearing(*isim, position, error, alphaMult, betaMult, tTopo);
750 unsigned int subdet = det.subdetId();
793 if( !specDetId.
glued() ){
797 else{
if(subdet>2) position =
Local3DPoint(position.
x(),0.,0.); }
806 error.
xy()+lape.
xy(),
807 error.
yy()+lape.
yy() );
813 if(subdet > 2) theClusters[trackID].push_back(
815 simHitCounter, trackID,
820 else theClusters[trackID].push_back(
822 simHitCounter, trackID,
833 temporaryRecHits[trackID].push_back(
835 simHitCounter, trackID,
866 const Bounds& theBounds = theDetPlane.bounds();
867 double boundX = theBounds.
width()/2.;
868 double boundY = theBounds.
length()/2.;
872 <<
" rawid " << detid
880 localPositionResolution_z * localPositionResolution_z );
894 std::cout <<
" Hit finding probability draw: " << hitFindingProbability << std::endl;;
903 unsigned int theLayer = tTopo->
pxbLayer(detid);
904 std::cout <<
"\tPixel Barrel Layer " << theLayer << std::endl;
922 unsigned int theDisk = tTopo->
pxfDisk(detid);
923 std::cout <<
"\tPixel Forward Disk " << theDisk << std::endl;
940 unsigned int theLayer = tTopo->
tibLayer(detid);
942 std::cout <<
"\tTIB Layer " << theLayer << std::endl;
945 double resolutionX, resolutionY, resolutionZ;
980 <<
"\tTIB Layer not valid " << theLayer << std::endl;
1000 unsigned int theRing = tTopo->
tidRing(detid);
1001 double resolutionFactorY =
1005 std::cout <<
"\tTID Ring " << theRing << std::endl;
1007 double resolutionX, resolutionY, resolutionZ;
1035 <<
"\tTID Ring not valid " << theRing << std::endl;
1041 boundX *= resolutionFactorY;
1056 unsigned int theLayer = tTopo->
tobLayer(detid);
1058 std::cout <<
"\tTOB Layer " << theLayer << std::endl;
1060 double resolutionX, resolutionY, resolutionZ;
1109 <<
"\tTOB Layer not valid " << theLayer << std::endl;
1127 unsigned int theRing = tTopo->
tecRing(detid);
1128 double resolutionFactorY =
1132 std::cout <<
"\tTEC Ring " << theRing << std::endl;
1134 double resolutionX, resolutionY, resolutionZ;
1190 <<
"\tTEC Ring not valid " << theRing << std::endl;
1196 boundX *= resolutionFactorY;
1208 edm::LogError (
"SiTrackerGaussianSmearingRecHits") <<
"\tTracker subdetector not valid " << subdet << std::endl;
1224 std::map<unsigned,edm::OwnVector<FastTrackerCluster> >::const_iterator
1225 it = theClusterMap.begin();
1226 std::map<unsigned,edm::OwnVector<FastTrackerCluster> >::const_iterator
1227 lastCluster = theClusterMap.end();
1229 for( ; it != lastCluster ; ++it ) {
1230 theClusterCollection.
put(it->first,(it->second).begin(),(it->second).
end());
1241 std::map<unsigned,edm::OwnVector<SiTrackerGSRecHit2D> >::const_iterator
1242 it = theRecHits.begin();
1243 std::map<unsigned,edm::OwnVector<SiTrackerGSRecHit2D> >::const_iterator
1244 lastRecHit = theRecHits.end();
1246 for( ; it != lastRecHit ; ++it ) {
1247 theRecHitCollection.
put(it->first,(it->second).begin(),(it->second).
end());
1257 std::map<unsigned,edm::OwnVector<SiTrackerGSMatchedRecHit2D> >::const_iterator
1258 it = theRecHits.begin();
1259 std::map<unsigned,edm::OwnVector<SiTrackerGSMatchedRecHit2D> >::const_iterator
1260 lastRecHit = theRecHits.end();
1262 for( ; it != lastRecHit ; ++it ) {
1263 theRecHitCollection.
put(it->first,(it->second).begin(),(it->second).
end());
1277 std::map<unsigned, edm::OwnVector<SiTrackerGSRecHit2D> >::iterator it = theRecHits.begin();
1278 std::map<unsigned, edm::OwnVector<SiTrackerGSRecHit2D> >::iterator lastTrack = theRecHits.end();
1281 int recHitCounter = 0;
1285 for( ; it != lastTrack; ++it ) {
1292 for ( ; rit != lastRecHit; ++rit,++recHitCounter){
1295 unsigned int subdet = detid.
subdetId();
1302 if(specDetId.
glued()){
1318 partnerNext++; partnerPrev--;
1321 if( specDetId.
stereo() ) {
1323 int partnersFound = 0;
1326 if(partnerNext != it->second.end() )
1328 partner= partnerNext;
1332 if( rit != it->second.begin())
1335 partner= partnerPrev;
1341 if(partnersFound==0){
1350 if(partnersFound == 1) {
1357 matchedMap[it->first].push_back( theMatchedHit );
1362 matchedMap[it->first].push_back( theProjectedHit );
1369 int partnersFound = 0;
1372 if(partnerNext != it->second.end() )
1377 if( rit != it->second.begin())
1382 if(partnersFound==0){
1391 if(partnersFound==0){
1399 matchedMap[it->first].push_back( theProjectedHit );
1407 rit->geographicalId(),
1408 rit->simhitId(), rit->simtrackId(), rit->eeId(),
1410 rit->simMultX(), rit->simMultY());
1414 matchedMap[it->first].push_back( rit_copy );
1422 rit->geographicalId(),
1423 rit->simhitId(), rit->simtrackId(), rit->eeId(),
1425 rit->simMultX(), rit->simMultY());
1429 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
SiPixelGaussianSmearingRecHitConverterAlgorithm * thePixelEndcapParametrization
void smearHit(const PSimHit &simHit, double localPositionResolutionX, double localPositionResolutionY, double localPositionResolutionZ, double boundX, double boundY)
unsigned int nBetaForward
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
const RandomEngine * random
double resBetaBarrel_binWidth
double localPositionResolution_TEC6y
double theHitFindingProbability_TEC1
double theHitFindingProbability_TEC7
unsigned int resBetaForward_binN
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
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
void smearHits(const edm::PSimHitContainer &input, std::map< unsigned, edm::OwnVector< SiTrackerGSRecHit2D > > &theRecHits, std::map< unsigned, edm::OwnVector< FastTrackerCluster > > &theClusters, const TrackerTopology *tTopo)
TFile * thePixelForwardResolutionFile
Local3DPoint localPosition() const
double localPositionResolution_TOB2x
bool gaussianSmearing(const PSimHit &simHit, Local3DPoint &position, LocalError &error, unsigned &alphaMult, unsigned &betaMult, const TrackerTopology *tTopo)
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.
T const * product() 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)
const GlobalError & globalError() const
double localPositionResolution_TID3y
double theHitFindingProbability_TIB1
double flatShoot(double xmin=0.0, double xmax=1.0) 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
double localPositionResolution_TEC7x
double localPositionResolution_TOB1y
void smearHit(const PSimHit &simHit, const PixelGeomDetUnit *detUnit, const double boundX, const double boundY)
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()
double theHitFindingProbability_TID1
double localPositionResolution_TEC6x