90 std::cout <<
"SiTrackerGaussianSmearingRecHitConverter instantiated" << std::endl;
97 <<
"SiTrackerGaussianSmearingRecHitConverter requires the RandomGeneratorService\n"
98 "which is not present in the configuration file.\n"
99 "You must add the service in the configuration file\n"
100 "or remove the module that requires it";
105 produces<FastTrackerClusterCollection>(
"TrackerClusters");
107 produces<SiTrackerGSRecHit2DCollection>(
"TrackerGSRecHits");
108 produces<SiTrackerGSMatchedRecHit2DCollection>(
"TrackerGSMatchedRecHits");
118 if(trackingPSimHits)
std::cout <<
"### trackingPSimHits chosen " << trackingPSimHits << std::endl;
126 std::cout << (useCMSSWPixelParameterization?
"CMSSW" :
"ORCA") <<
" pixel parametrization chosen in config file." << std::endl;
185 std::cout <<
"RecHit local position error set to" <<
"\n"
186 <<
"\tTIB1\tx = " << localPositionResolution_TIB1x
187 <<
" cm\ty = " << localPositionResolution_TIB1y <<
" cm" <<
"\n"
188 <<
"\tTIB2\tx = " << localPositionResolution_TIB2x
189 <<
" cm\ty = " << localPositionResolution_TIB2y <<
" cm" <<
"\n"
190 <<
"\tTIB3\tx = " << localPositionResolution_TIB3x
191 <<
" cm\ty = " << localPositionResolution_TIB3y <<
" cm" <<
"\n"
192 <<
"\tTIB4\tx = " << localPositionResolution_TIB4x
193 <<
" cm\ty = " << localPositionResolution_TIB4y <<
" cm" <<
"\n"
194 <<
"\tTID1\tx = " << localPositionResolution_TID1x
195 <<
" cm\ty = " << localPositionResolution_TID1y <<
" cm" <<
"\n"
196 <<
"\tTID2\tx = " << localPositionResolution_TID2x
197 <<
" cm\ty = " << localPositionResolution_TID2y <<
" cm" <<
"\n"
198 <<
"\tTID3\tx = " << localPositionResolution_TID3x
199 <<
" cm\ty = " << localPositionResolution_TID3y <<
" cm" <<
"\n"
200 <<
"\tTOB1\tx = " << localPositionResolution_TOB1x
201 <<
" cm\ty = " << localPositionResolution_TOB1y <<
" cm" <<
"\n"
202 <<
"\tTOB2\tx = " << localPositionResolution_TOB2x
203 <<
" cm\ty = " << localPositionResolution_TOB2y <<
" cm" <<
"\n"
204 <<
"\tTOB3\tx = " << localPositionResolution_TOB3x
205 <<
" cm\ty = " << localPositionResolution_TOB3y <<
" cm" <<
"\n"
206 <<
"\tTOB4\tx = " << localPositionResolution_TOB4x
207 <<
" cm\ty = " << localPositionResolution_TOB4y <<
" cm" <<
"\n"
208 <<
"\tTOB5\tx = " << localPositionResolution_TOB5x
209 <<
" cm\ty = " << localPositionResolution_TOB5y <<
" cm" <<
"\n"
210 <<
"\tTOB6\tx = " << localPositionResolution_TOB6x
211 <<
" cm\ty = " << localPositionResolution_TOB6y <<
" cm" <<
"\n"
212 <<
"\tTEC1\tx = " << localPositionResolution_TEC1x
213 <<
" cm\ty = " << localPositionResolution_TEC1y <<
" cm" <<
"\n"
214 <<
"\tTEC2\tx = " << localPositionResolution_TEC2x
215 <<
" cm\ty = " << localPositionResolution_TEC2y <<
" cm" <<
"\n"
216 <<
"\tTEC3\tx = " << localPositionResolution_TEC3x
217 <<
" cm\ty = " << localPositionResolution_TEC3y <<
" cm" <<
"\n"
218 <<
"\tTEC4\tx = " << localPositionResolution_TEC4x
219 <<
" cm\ty = " << localPositionResolution_TEC4y <<
" cm" <<
"\n"
220 <<
"\tTEC5\tx = " << localPositionResolution_TEC5x
221 <<
" cm\ty = " << localPositionResolution_TEC5y <<
" cm" <<
"\n"
222 <<
"\tTEC6\tx = " << localPositionResolution_TEC6x
223 <<
" cm\ty = " << localPositionResolution_TEC6y <<
" cm" <<
"\n"
224 <<
"\tTEC7\tx = " << localPositionResolution_TEC7x
225 <<
" cm\ty = " << localPositionResolution_TEC7y <<
" cm" <<
"\n"
226 <<
"\tAll:\tz = " << localPositionResolution_z <<
" cm"
231 if(useCMSSWPixelParameterization) {
243 std::cout <<
"Pixel maximum multiplicity set to "
252 if(useCMSSWPixelParameterization) {
269 if(useCMSSWPixelParameterization) {
310 std::cout <<
"RecHit finding probability set to" <<
"\n"
312 <<
"\tPXF = " << theHitFindingProbability_PXF <<
"\n"
313 <<
"\tTIB1 = " << theHitFindingProbability_TIB1 <<
"\n"
314 <<
"\tTIB2 = " << theHitFindingProbability_TIB2 <<
"\n"
315 <<
"\tTIB3 = " << theHitFindingProbability_TIB3 <<
"\n"
316 <<
"\tTIB4 = " << theHitFindingProbability_TIB4 <<
"\n"
317 <<
"\tTID1 = " << theHitFindingProbability_TID1 <<
"\n"
318 <<
"\tTID2 = " << theHitFindingProbability_TID2 <<
"\n"
319 <<
"\tTID3 = " << theHitFindingProbability_TID3 <<
"\n"
320 <<
"\tTOB1 = " << theHitFindingProbability_TOB1 <<
"\n"
321 <<
"\tTOB2 = " << theHitFindingProbability_TOB2 <<
"\n"
322 <<
"\tTOB3 = " << theHitFindingProbability_TOB3 <<
"\n"
323 <<
"\tTOB4 = " << theHitFindingProbability_TOB4 <<
"\n"
324 <<
"\tTOB5 = " << theHitFindingProbability_TOB5 <<
"\n"
325 <<
"\tTOB6 = " << theHitFindingProbability_TOB6 <<
"\n"
326 <<
"\tTEC1 = " << theHitFindingProbability_TEC1 <<
"\n"
327 <<
"\tTEC2 = " << theHitFindingProbability_TEC2 <<
"\n"
328 <<
"\tTEC3 = " << theHitFindingProbability_TEC3 <<
"\n"
329 <<
"\tTEC4 = " << theHitFindingProbability_TEC4 <<
"\n"
330 <<
"\tTEC5 = " << theHitFindingProbability_TEC5 <<
"\n"
331 <<
"\tTEC6 = " << theHitFindingProbability_TEC6 <<
"\n"
332 <<
"\tTEC7 = " << theHitFindingProbability_TEC7 <<
"\n"
355 std::string(
"hist_alpha_barrel") ,
361 std::string(
"hist_beta_barrel") ,
367 std::string(
"hist_alpha_forward") ,
373 std::string(
"hist_beta_forward") ,
384 std::string(
"hist_alpha_barrel_big") ,
391 std::string(
"hist_beta_barrel_big") ,
398 std::string(
"hist_alpha_forward_big") ,
405 std::string(
"hist_beta_forward_big") ,
413 TFile* pixelDataFile,
414 unsigned int nMultiplicity,
415 std::string histName,
416 std::vector<TH1F*>& theMultiplicityCumulativeProbabilities,
420 std::string histName_i = histName +
"_%u";
422 theMultiplicityCumulativeProbabilities.clear();
426 for(
unsigned int i = 0;
i<nMultiplicity; ++
i) {
427 TH1F addHist = *((TH1F*) pixelDataFile->Get( Form( histName_i.c_str() ,
i+1 )));
429 theMultiplicityCumulativeProbabilities.push_back(
new TH1F(addHist) );
433 sumHist = *(theMultiplicityCumulativeProbabilities[nMultiplicity+
i-1]);
435 sumHist = *(theMultiplicityCumulativeProbabilities[
i-1]);
436 sumHist.Add(&addHist);
437 theMultiplicityCumulativeProbabilities.push_back(
new TH1F(sumHist) );
443 const unsigned int maxMult = theMultiplicityCumulativeProbabilities.size();
444 unsigned int iMult, multSize;
457 std::cout <<
" Multiplicity cumulated probability " << histName << std::endl;
458 for(; iMult<multSize; ++iMult) {
459 for(
int iBin = 1; iBin<=theMultiplicityCumulativeProbabilities[iMult]->GetNbinsX(); ++iBin) {
461 <<
" Multiplicity " << iMult+1
464 << theMultiplicityCumulativeProbabilities[iMult]->GetBinLowEdge(iBin)
466 << (theMultiplicityCumulativeProbabilities[iMult])->GetBinContent(iBin)
509 magfield=&(*magField);
511 double magFieldAtCenter = magfield->
inTesla(center).
mag();
515 if(magFieldAtCenter > 3.9) {
534 std::cout <<
"Pixel maximum multiplicity set to "
541 std::cout <<
"Barrel Pixel resolution data are taken from file "
552 std::cout <<
"Forward Pixel resolution data are taken from file "
592 std::vector<const CrossingFrame<PSimHit> *> cf_simhitvec;
595 cf_simhitvec.push_back(cf_simhit.product());
602 std::map<unsigned, edm::OwnVector<SiTrackerGSRecHit2D> > temporaryRecHits;
603 std::map<unsigned, edm::OwnVector<FastTrackerCluster> > theClusters ;
604 smearHits( *allTrackerHits, temporaryRecHits, theClusters);
607 std::map<unsigned, edm::OwnVector<SiTrackerGSMatchedRecHit2D> > temporaryMatchedRecHits ;
625 e.
put(recHitCollection,
"TrackerGSRecHits");
626 e.
put(recHitCollectionMatched,
"TrackerGSMatchedRecHits");
631 e.
put(clusterCollection,
"TrackerClusters");
642 int numberOfPSimHits = 0;
652 int simHitCounter = -1;
653 int recHitCounter = 0;
656 for ( ; isim != lastSimHit; ++isim ) {
658 DetId det((*isim).detUnitId());
659 unsigned trackID = (*isim).trackId();
660 uint32_t eeID = (*isim).eventId().
rawId();
677 unsigned int alphaMult = 0;
678 unsigned int betaMult = 0;
679 bool isCreated =
gaussianSmearing(*isim, position, error, alphaMult, betaMult);
682 unsigned int subdet = det.subdetId();
725 if( !specDetId.
glued() ){
729 else{
if(subdet>2) position =
Local3DPoint(position.
x(),0.,0.); }
738 error.
xy()+lape.
xy(),
739 error.
yy()+lape.
yy() );
745 if(subdet > 2) theClusters[trackID].push_back(
747 simHitCounter, trackID,
752 else theClusters[trackID].push_back(
754 simHitCounter, trackID,
765 temporaryRecHits[trackID].push_back(
767 simHitCounter, trackID,
796 double boundX = theBounds.
width()/2.;
797 double boundY = theBounds.
length()/2.;
801 <<
" rawid " << detid
809 localPositionResolution_z * localPositionResolution_z );
823 std::cout <<
" Hit finding probability draw: " << hitFindingProbability << std::endl;;
832 unsigned int theLayer = module.
layer();
833 std::cout <<
"\tPixel Barrel Layer " << theLayer << std::endl;
851 unsigned int theDisk = module.
disk();
852 std::cout <<
"\tPixel Forward Disk " << theDisk << std::endl;
869 unsigned int theLayer = module.
layer();
871 std::cout <<
"\tTIB Layer " << theLayer << std::endl;
874 double resolutionX, resolutionY, resolutionZ;
909 <<
"\tTIB Layer not valid " << theLayer << std::endl;
929 unsigned int theRing = module.
ring();
930 double resolutionFactorY =
934 std::cout <<
"\tTID Ring " << theRing << std::endl;
936 double resolutionX, resolutionY, resolutionZ;
964 <<
"\tTID Ring not valid " << theRing << std::endl;
970 boundX *= resolutionFactorY;
985 unsigned int theLayer = module.
layer();
987 std::cout <<
"\tTOB Layer " << theLayer << std::endl;
989 double resolutionX, resolutionY, resolutionZ;
1038 <<
"\tTOB Layer not valid " << theLayer << std::endl;
1056 unsigned int theRing = module.
ring();
1057 double resolutionFactorY =
1061 std::cout <<
"\tTEC Ring " << theRing << std::endl;
1063 double resolutionX, resolutionY, resolutionZ;
1119 <<
"\tTEC Ring not valid " << theRing << std::endl;
1125 boundX *= resolutionFactorY;
1137 edm::LogError (
"SiTrackerGaussianSmearingRecHits") <<
"\tTracker subdetector not valid " << subdet << std::endl;
1153 std::map<unsigned,edm::OwnVector<FastTrackerCluster> >::const_iterator
1154 it = theClusterMap.begin();
1155 std::map<unsigned,edm::OwnVector<FastTrackerCluster> >::const_iterator
1156 lastCluster = theClusterMap.end();
1158 for( ; it != lastCluster ; ++it ) {
1159 theClusterCollection.
put(it->first,(it->second).begin(),(it->second).
end());
1170 std::map<unsigned,edm::OwnVector<SiTrackerGSRecHit2D> >::const_iterator
1171 it = theRecHits.begin();
1172 std::map<unsigned,edm::OwnVector<SiTrackerGSRecHit2D> >::const_iterator
1173 lastRecHit = theRecHits.end();
1175 for( ; it != lastRecHit ; ++it ) {
1176 theRecHitCollection.
put(it->first,(it->second).begin(),(it->second).
end());
1186 std::map<unsigned,edm::OwnVector<SiTrackerGSMatchedRecHit2D> >::const_iterator
1187 it = theRecHits.begin();
1188 std::map<unsigned,edm::OwnVector<SiTrackerGSMatchedRecHit2D> >::const_iterator
1189 lastRecHit = theRecHits.end();
1191 for( ; it != lastRecHit ; ++it ) {
1192 theRecHitCollection.
put(it->first,(it->second).begin(),(it->second).
end());
1204 std::map<unsigned, edm::OwnVector<SiTrackerGSRecHit2D> >::iterator it = theRecHits.begin();
1205 std::map<unsigned, edm::OwnVector<SiTrackerGSRecHit2D> >::iterator lastTrack = theRecHits.end();
1208 int recHitCounter = 0;
1211 for( ; it != lastTrack; ++it ) {
1218 for ( ; rit != lastRecHit; ++rit,++recHitCounter){
1221 unsigned int subdet = detid.
subdetId();
1228 if(specDetId.
glued()){
1244 partnerNext++; partnerPrev--;
1247 if( specDetId.
stereo() ) {
1249 int partnersFound = 0;
1252 if(partnerNext != it->second.end() )
1254 partner= partnerNext;
1258 if( rit != it->second.begin())
1261 partner= partnerPrev;
1267 if(partnersFound==0){
1276 if(partnersFound == 1) {
1283 matchedMap[it->first].push_back( theMatchedHit );
1288 matchedMap[it->first].push_back( theProjectedHit );
1295 int partnersFound = 0;
1298 if(partnerNext != it->second.end() )
1303 if( rit != it->second.begin())
1308 if(partnersFound==0){
1317 if(partnersFound==0){
1325 matchedMap[it->first].push_back( theProjectedHit );
1333 rit->geographicalId(),
1334 rit->simhitId(), rit->simtrackId(), rit->eeId(),
1336 rit->simMultX(), rit->simMultY());
1340 matchedMap[it->first].push_back( rit_copy );
1348 rit->geographicalId(),
1349 rit->simhitId(), rit->simtrackId(), rit->eeId(),
1351 rit->simMultX(), rit->simMultY());
1355 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()
virtual AlignmentPositionError * alignmentPositionError() 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
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
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
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
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
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
virtual const BoundPlane & surface() const
The nominal surface of the GeomDet.
double localPositionResolution_TEC3y
const GeomDetUnit * stereoDet() const
unsigned int detUnitId() const
Local3DPoint getPosition()
double theHitFindingProbability_TID1
double localPositionResolution_TEC6x