91 std::cout <<
"SiTrackerGaussianSmearingRecHitConverter instantiated" << std::endl;
98 <<
"SiTrackerGaussianSmearingRecHitConverter requires the RandomGeneratorService\n"
99 "which is not present in the configuration file.\n"
100 "You must add the service in the configuration file\n"
101 "or remove the module that requires it";
106 produces<FastTrackerClusterCollection>(
"TrackerClusters");
108 produces<SiTrackerGSRecHit2DCollection>(
"TrackerGSRecHits");
109 produces<SiTrackerGSMatchedRecHit2DCollection>(
"TrackerGSMatchedRecHits");
119 if(trackingPSimHits)
std::cout <<
"### trackingPSimHits chosen " << trackingPSimHits << std::endl;
130 std::cout << (useCMSSWPixelParameterization?
"CMSSW" :
"ORCA") <<
" pixel parametrization chosen in config file." << std::endl;
189 std::cout <<
"RecHit local position error set to" <<
"\n"
190 <<
"\tTIB1\tx = " << localPositionResolution_TIB1x
191 <<
" cm\ty = " << localPositionResolution_TIB1y <<
" cm" <<
"\n"
192 <<
"\tTIB2\tx = " << localPositionResolution_TIB2x
193 <<
" cm\ty = " << localPositionResolution_TIB2y <<
" cm" <<
"\n"
194 <<
"\tTIB3\tx = " << localPositionResolution_TIB3x
195 <<
" cm\ty = " << localPositionResolution_TIB3y <<
" cm" <<
"\n"
196 <<
"\tTIB4\tx = " << localPositionResolution_TIB4x
197 <<
" cm\ty = " << localPositionResolution_TIB4y <<
" cm" <<
"\n"
198 <<
"\tTID1\tx = " << localPositionResolution_TID1x
199 <<
" cm\ty = " << localPositionResolution_TID1y <<
" cm" <<
"\n"
200 <<
"\tTID2\tx = " << localPositionResolution_TID2x
201 <<
" cm\ty = " << localPositionResolution_TID2y <<
" cm" <<
"\n"
202 <<
"\tTID3\tx = " << localPositionResolution_TID3x
203 <<
" cm\ty = " << localPositionResolution_TID3y <<
" cm" <<
"\n"
204 <<
"\tTOB1\tx = " << localPositionResolution_TOB1x
205 <<
" cm\ty = " << localPositionResolution_TOB1y <<
" cm" <<
"\n"
206 <<
"\tTOB2\tx = " << localPositionResolution_TOB2x
207 <<
" cm\ty = " << localPositionResolution_TOB2y <<
" cm" <<
"\n"
208 <<
"\tTOB3\tx = " << localPositionResolution_TOB3x
209 <<
" cm\ty = " << localPositionResolution_TOB3y <<
" cm" <<
"\n"
210 <<
"\tTOB4\tx = " << localPositionResolution_TOB4x
211 <<
" cm\ty = " << localPositionResolution_TOB4y <<
" cm" <<
"\n"
212 <<
"\tTOB5\tx = " << localPositionResolution_TOB5x
213 <<
" cm\ty = " << localPositionResolution_TOB5y <<
" cm" <<
"\n"
214 <<
"\tTOB6\tx = " << localPositionResolution_TOB6x
215 <<
" cm\ty = " << localPositionResolution_TOB6y <<
" cm" <<
"\n"
216 <<
"\tTEC1\tx = " << localPositionResolution_TEC1x
217 <<
" cm\ty = " << localPositionResolution_TEC1y <<
" cm" <<
"\n"
218 <<
"\tTEC2\tx = " << localPositionResolution_TEC2x
219 <<
" cm\ty = " << localPositionResolution_TEC2y <<
" cm" <<
"\n"
220 <<
"\tTEC3\tx = " << localPositionResolution_TEC3x
221 <<
" cm\ty = " << localPositionResolution_TEC3y <<
" cm" <<
"\n"
222 <<
"\tTEC4\tx = " << localPositionResolution_TEC4x
223 <<
" cm\ty = " << localPositionResolution_TEC4y <<
" cm" <<
"\n"
224 <<
"\tTEC5\tx = " << localPositionResolution_TEC5x
225 <<
" cm\ty = " << localPositionResolution_TEC5y <<
" cm" <<
"\n"
226 <<
"\tTEC6\tx = " << localPositionResolution_TEC6x
227 <<
" cm\ty = " << localPositionResolution_TEC6y <<
" cm" <<
"\n"
228 <<
"\tTEC7\tx = " << localPositionResolution_TEC7x
229 <<
" cm\ty = " << localPositionResolution_TEC7y <<
" cm" <<
"\n"
230 <<
"\tAll:\tz = " << localPositionResolution_z <<
" cm"
235 if(useCMSSWPixelParameterization) {
247 std::cout <<
"Pixel maximum multiplicity set to "
256 if(useCMSSWPixelParameterization) {
273 if(useCMSSWPixelParameterization) {
314 std::cout <<
"RecHit finding probability set to" <<
"\n"
316 <<
"\tPXF = " << theHitFindingProbability_PXF <<
"\n"
317 <<
"\tTIB1 = " << theHitFindingProbability_TIB1 <<
"\n"
318 <<
"\tTIB2 = " << theHitFindingProbability_TIB2 <<
"\n"
319 <<
"\tTIB3 = " << theHitFindingProbability_TIB3 <<
"\n"
320 <<
"\tTIB4 = " << theHitFindingProbability_TIB4 <<
"\n"
321 <<
"\tTID1 = " << theHitFindingProbability_TID1 <<
"\n"
322 <<
"\tTID2 = " << theHitFindingProbability_TID2 <<
"\n"
323 <<
"\tTID3 = " << theHitFindingProbability_TID3 <<
"\n"
324 <<
"\tTOB1 = " << theHitFindingProbability_TOB1 <<
"\n"
325 <<
"\tTOB2 = " << theHitFindingProbability_TOB2 <<
"\n"
326 <<
"\tTOB3 = " << theHitFindingProbability_TOB3 <<
"\n"
327 <<
"\tTOB4 = " << theHitFindingProbability_TOB4 <<
"\n"
328 <<
"\tTOB5 = " << theHitFindingProbability_TOB5 <<
"\n"
329 <<
"\tTOB6 = " << theHitFindingProbability_TOB6 <<
"\n"
330 <<
"\tTEC1 = " << theHitFindingProbability_TEC1 <<
"\n"
331 <<
"\tTEC2 = " << theHitFindingProbability_TEC2 <<
"\n"
332 <<
"\tTEC3 = " << theHitFindingProbability_TEC3 <<
"\n"
333 <<
"\tTEC4 = " << theHitFindingProbability_TEC4 <<
"\n"
334 <<
"\tTEC5 = " << theHitFindingProbability_TEC5 <<
"\n"
335 <<
"\tTEC6 = " << theHitFindingProbability_TEC6 <<
"\n"
336 <<
"\tTEC7 = " << theHitFindingProbability_TEC7 <<
"\n"
360 std::string(
"hist_alpha_barrel") ,
366 std::string(
"hist_beta_barrel") ,
372 std::string(
"hist_alpha_forward") ,
378 std::string(
"hist_beta_forward") ,
389 std::string(
"hist_alpha_barrel_big") ,
396 std::string(
"hist_beta_barrel_big") ,
403 std::string(
"hist_alpha_forward_big") ,
410 std::string(
"hist_beta_forward_big") ,
418 TFile* pixelDataFile,
419 unsigned int nMultiplicity,
420 std::string histName,
421 std::vector<TH1F*>& theMultiplicityCumulativeProbabilities,
425 std::string histName_i = histName +
"_%u";
427 theMultiplicityCumulativeProbabilities.clear();
431 for(
unsigned int i = 0;
i<nMultiplicity; ++
i) {
432 TH1F addHist = *((TH1F*) pixelDataFile->Get( Form( histName_i.c_str() ,
i+1 )));
434 theMultiplicityCumulativeProbabilities.push_back(
new TH1F(addHist) );
438 sumHist = *(theMultiplicityCumulativeProbabilities[nMultiplicity+
i-1]);
440 sumHist = *(theMultiplicityCumulativeProbabilities[
i-1]);
441 sumHist.Add(&addHist);
442 theMultiplicityCumulativeProbabilities.push_back(
new TH1F(sumHist) );
448 const unsigned int maxMult = theMultiplicityCumulativeProbabilities.size();
449 unsigned int iMult, multSize;
462 std::cout <<
" Multiplicity cumulated probability " << histName << std::endl;
463 for(; iMult<multSize; ++iMult) {
464 for(
int iBin = 1; iBin<=theMultiplicityCumulativeProbabilities[iMult]->GetNbinsX(); ++iBin) {
466 <<
" Multiplicity " << iMult+1
469 << theMultiplicityCumulativeProbabilities[iMult]->GetBinLowEdge(iBin)
471 << (theMultiplicityCumulativeProbabilities[iMult])->GetBinContent(iBin)
516 magfield=&(*magField);
518 double magFieldAtCenter = magfield->
inTesla(center).
mag();
522 if(magFieldAtCenter > 3.9) {
543 disabledModules =
new std::vector<SiPixelQuality::disabledModuleType> ( siPixelBadModule->getBadComponentList() );
545 size_t numberOfRecoverableModules = 0;
553 if ( (*
disabledModules)[
id-numberOfRecoverableModules].errorType != 0 ){
556 numberOfRecoverableModules++;
567 std::cout <<
"Pixel maximum multiplicity set to "
574 std::cout <<
"Barrel Pixel resolution data are taken from file "
585 std::cout <<
"Forward Pixel resolution data are taken from file "
626 std::vector<const CrossingFrame<PSimHit> *> cf_simhitvec;
629 cf_simhitvec.push_back(cf_simhit.product());
636 std::map<unsigned, edm::OwnVector<SiTrackerGSRecHit2D> > temporaryRecHits;
637 std::map<unsigned, edm::OwnVector<FastTrackerCluster> > theClusters ;
639 smearHits( *allTrackerHits, temporaryRecHits, theClusters);
642 std::map<unsigned, edm::OwnVector<SiTrackerGSMatchedRecHit2D> > temporaryMatchedRecHits ;
665 e.
put(recHitCollection,
"TrackerGSRecHits");
666 e.
put(recHitCollectionMatched,
"TrackerGSMatchedRecHits");
671 e.
put(clusterCollection,
"TrackerClusters");
681 int numberOfPSimHits = 0;
691 int simHitCounter = -1;
692 int recHitCounter = 0;
696 for ( ; isim != lastSimHit; ++isim ) {
699 DetId det((*isim).detUnitId());
700 unsigned trackID = (*isim).trackId();
701 uint32_t eeID = (*isim).eventId().
rawId();
716 unsigned int geoId = det.rawId();
743 unsigned int alphaMult = 0;
744 unsigned int betaMult = 0;
745 bool isCreated =
gaussianSmearing(*isim, position, error, alphaMult, betaMult);
748 unsigned int subdet = det.subdetId();
791 if( !specDetId.
glued() ){
795 else{
if(subdet>2) position =
Local3DPoint(position.
x(),0.,0.); }
804 error.
xy()+lape.
xy(),
805 error.
yy()+lape.
yy() );
811 if(subdet > 2) theClusters[trackID].push_back(
813 simHitCounter, trackID,
818 else theClusters[trackID].push_back(
820 simHitCounter, trackID,
831 temporaryRecHits[trackID].push_back(
833 simHitCounter, trackID,
863 double boundX = theBounds.
width()/2.;
864 double boundY = theBounds.
length()/2.;
868 <<
" rawid " << detid
876 localPositionResolution_z * localPositionResolution_z );
890 std::cout <<
" Hit finding probability draw: " << hitFindingProbability << std::endl;;
899 unsigned int theLayer = module.
layer();
900 std::cout <<
"\tPixel Barrel Layer " << theLayer << std::endl;
918 unsigned int theDisk = module.
disk();
919 std::cout <<
"\tPixel Forward Disk " << theDisk << std::endl;
936 unsigned int theLayer = module.
layer();
938 std::cout <<
"\tTIB Layer " << theLayer << std::endl;
941 double resolutionX, resolutionY, resolutionZ;
976 <<
"\tTIB Layer not valid " << theLayer << std::endl;
996 unsigned int theRing = module.
ring();
997 double resolutionFactorY =
1001 std::cout <<
"\tTID Ring " << theRing << std::endl;
1003 double resolutionX, resolutionY, resolutionZ;
1031 <<
"\tTID Ring not valid " << theRing << std::endl;
1037 boundX *= resolutionFactorY;
1052 unsigned int theLayer = module.
layer();
1054 std::cout <<
"\tTOB Layer " << theLayer << std::endl;
1056 double resolutionX, resolutionY, resolutionZ;
1105 <<
"\tTOB Layer not valid " << theLayer << std::endl;
1123 unsigned int theRing = module.
ring();
1124 double resolutionFactorY =
1128 std::cout <<
"\tTEC Ring " << theRing << std::endl;
1130 double resolutionX, resolutionY, resolutionZ;
1186 <<
"\tTEC Ring not valid " << theRing << std::endl;
1192 boundX *= resolutionFactorY;
1204 edm::LogError (
"SiTrackerGaussianSmearingRecHits") <<
"\tTracker subdetector not valid " << subdet << std::endl;
1220 std::map<unsigned,edm::OwnVector<FastTrackerCluster> >::const_iterator
1221 it = theClusterMap.begin();
1222 std::map<unsigned,edm::OwnVector<FastTrackerCluster> >::const_iterator
1223 lastCluster = theClusterMap.end();
1225 for( ; it != lastCluster ; ++it ) {
1226 theClusterCollection.
put(it->first,(it->second).begin(),(it->second).
end());
1237 std::map<unsigned,edm::OwnVector<SiTrackerGSRecHit2D> >::const_iterator
1238 it = theRecHits.begin();
1239 std::map<unsigned,edm::OwnVector<SiTrackerGSRecHit2D> >::const_iterator
1240 lastRecHit = theRecHits.end();
1242 for( ; it != lastRecHit ; ++it ) {
1243 theRecHitCollection.
put(it->first,(it->second).begin(),(it->second).
end());
1253 std::map<unsigned,edm::OwnVector<SiTrackerGSMatchedRecHit2D> >::const_iterator
1254 it = theRecHits.begin();
1255 std::map<unsigned,edm::OwnVector<SiTrackerGSMatchedRecHit2D> >::const_iterator
1256 lastRecHit = theRecHits.end();
1258 for( ; it != lastRecHit ; ++it ) {
1259 theRecHitCollection.
put(it->first,(it->second).begin(),(it->second).
end());
1271 std::map<unsigned, edm::OwnVector<SiTrackerGSRecHit2D> >::iterator it = theRecHits.begin();
1272 std::map<unsigned, edm::OwnVector<SiTrackerGSRecHit2D> >::iterator lastTrack = theRecHits.end();
1275 int recHitCounter = 0;
1278 for( ; it != lastTrack; ++it ) {
1285 for ( ; rit != lastRecHit; ++rit,++recHitCounter){
1288 unsigned int subdet = detid.
subdetId();
1295 if(specDetId.
glued()){
1311 partnerNext++; partnerPrev--;
1314 if( specDetId.
stereo() ) {
1316 int partnersFound = 0;
1319 if(partnerNext != it->second.end() )
1321 partner= partnerNext;
1325 if( rit != it->second.begin())
1328 partner= partnerPrev;
1334 if(partnersFound==0){
1343 if(partnersFound == 1) {
1350 matchedMap[it->first].push_back( theMatchedHit );
1355 matchedMap[it->first].push_back( theProjectedHit );
1362 int partnersFound = 0;
1365 if(partnerNext != it->second.end() )
1370 if( rit != it->second.begin())
1375 if(partnersFound==0){
1384 if(partnersFound==0){
1392 matchedMap[it->first].push_back( theProjectedHit );
1400 rit->geographicalId(),
1401 rit->simhitId(), rit->simtrackId(), rit->eeId(),
1403 rit->simMultX(), rit->simMultY());
1407 matchedMap[it->first].push_back( rit_copy );
1415 rit->geographicalId(),
1416 rit->simhitId(), rit->simtrackId(), rit->eeId(),
1418 rit->simMultX(), rit->simMultY());
1422 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
void smearHits(MixCollection< PSimHit > &input, std::map< unsigned, edm::OwnVector< SiTrackerGSRecHit2D > > &theRecHits, std::map< unsigned, edm::OwnVector< FastTrackerCluster > > &theClusters)
unsigned int layer() const
layer id
unsigned int getPixelMultiplicityAlpha()
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
double resAlphaBarrel_binMin
double theHitFindingProbability_TEC3
double localPositionResolution_z
double theHitFindingProbability_TEC5
double localPositionResolution_TEC1y
double theHitFindingProbability_TIB2
double theHitFindingProbability_TID2
const RandomEngine * random
double resBetaBarrel_binWidth
double localPositionResolution_TEC6y
virtual void produce(edm::Event &e, const edm::EventSetup &c)
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
double theHitFindingProbability_PXF
std::vector< TH1F * > theForwardMultiplicityBetaCumulativeProbabilities
static int position[TOTALCHAMBERS][3]
unsigned int layer() const
layer id
double localPositionResolution_TID1y
double localPositionResolution_TOB3y
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
unsigned int ring() const
ring id
double localPositionResolution_TOB5x
bool gaussianSmearing(const PSimHit &simHit, Local3DPoint &position, LocalError &error, unsigned &alphaMult, unsigned &betaMult)
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
unsigned int disk() const
disk id
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
Point3DBase< float, LocalTag > Local3DPoint
double resAlphaForward_binMin
unsigned int stereo() const
stereo
const Bounds & bounds() const
std::string thePixelForwardResolutionFileName
SiTrackerGSRecHit2D::ClusterRef ClusterRef
double resAlphaBarrel_binWidth
double theHitFindingProbability_TOB1
SiTrackerGSMatchedRecHit2D * projectOnly(const SiTrackerGSRecHit2D *monoRH, const GeomDet *monoDet, const GluedGeomDet *gluedDet, LocalVector &ldir) const
AlignmentPositionError * alignmentPositionError() const
Return pointer to alignment errors.
std::vector< edm::InputTag > trackerContainers
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
unsigned int layer() const
layer id
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
const BoundPlane & surface() const
The nominal surface of the GeomDet.
double localPositionResolution_TEC2x
unsigned int ring() const
ring id
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
double theHitFindingProbability_TEC4
double localPositionResolution_TEC7y
void matchHits(std::map< unsigned, edm::OwnVector< SiTrackerGSRecHit2D > > &theRecHits, std::map< unsigned, edm::OwnVector< SiTrackerGSMatchedRecHit2D > > &matchedMap, MixCollection< PSimHit > &simhits)
double theHitFindingProbability_PXB
double theHitFindingProbability_TOB4
unsigned int numberOfDisabledModules
double theHitFindingProbability_TOB6
virtual void beginRun(edm::Run &run, const edm::EventSetup &es)
double localPositionResolution_TIB4y
ClusterRefProd FastTrackerClusterRefProd
double localPositionResolution_TIB3x
virtual float width() const =0
const PositionType & position() const
double localPositionResolution_TEC3x
double localPositionResolution_TEC3y
const GeomDetUnit * stereoDet() const
unsigned int detUnitId() const
Local3DPoint getPosition()
double theHitFindingProbability_TID1
double localPositionResolution_TEC6x