298 std::map<const SiStripRecHit2D*,std::pair<float,float>,DetIdLess> hitangleassociation;
299 std::list<SiStripRecHit2D>
cache;
302 trajsize=TrajectoryCollection->size();
305 edm::LogInfo(
"SiStripLAProfileBooker::analyze") <<
" Number of trajectories in event = "<<
trajsize<<
"\n";
309 for(TrajTrackIter = TrajTrackMap->
begin(); TrajTrackIter!= TrajTrackMap->
end(); TrajTrackIter++){
311 if(TrajTrackIter->key->foundHits()>=5){
324 pt = TrajTrackIter->val->pt();
326 chi2norm = TrajTrackIter->val->normalizedChi2();
327 EtaTrack = TrajTrackIter->val->eta();
328 PhiTrack = TrajTrackIter->val->phi();
331 std::vector<TrajectoryMeasurement> TMeas=TrajTrackIter->key->measurements();
332 std::vector<TrajectoryMeasurement>::iterator itm;
334 for (itm=TMeas.begin();itm!=TMeas.end();itm++){
369 if(phit) {lhit = phit->
originalHit(); hit = &lhit;}
382 cache.push_back(matchedhit->
monoHit());
397 const auto & amplitudes = monocluster->amplitudes();
400 uint16_t FirstStrip = monocluster->firstStrip();
401 auto begin=amplitudes.begin();
403 for(
auto idigi=
begin; idigi!=amplitudes.end(); idigi++){
443 if(monotkdir.
z()!=0){
446 float tanangle = monotkdir.
x()/monotkdir.
z();
449 detparmap::iterator TheDet=
detmap.find(detid.
rawId());
451 if(TheDet!=
detmap.end())localmagdir=TheDet->second->magfield;
455 float signcorrection = (localmagdir * monoylocal)/(
MagField);
459 std::map<const SiStripRecHit2D *,std::pair<float,float>,DetIdLess>::iterator alreadystored=hitangleassociation.find(monohit);
462 if(alreadystored != hitangleassociation.end()){
463 if(itm->estimate() > alreadystored->second.first){
465 if(itm->estimate() < alreadystored->second.first){
467 hitangleassociation.insert(std::make_pair(monohit, std::make_pair(itm->estimate(),tanangle)));
471 hitangleassociation.insert(make_pair(monohit, std::make_pair(itm->estimate(),tanangle)));
478 cache.push_back(matchedhit->
stereoHit());
491 ClSize = (stereocluster->amplitudes()).
size();
493 const auto & amplitudes = stereocluster->amplitudes();
495 barycenter = stereocluster->barycenter()- 0.5;
496 uint16_t FirstStrip = stereocluster->firstStrip();
497 auto begin=amplitudes.begin();
499 for(
auto idigi=
begin; idigi!=amplitudes.end(); idigi++){
538 if(stereotkdir.
z()!=0){
541 float tanangle = stereotkdir.
x()/stereotkdir.
z();
544 detparmap::iterator TheDet=
detmap.find(detid.
rawId());
546 if(TheDet!=
detmap.end())localmagdir=TheDet->second->magfield;
550 float signcorrection = (localmagdir * stereoylocal)/(
MagField);
553 std::map<const SiStripRecHit2D *,std::pair<float,float>,DetIdLess>::iterator alreadystored=hitangleassociation.find(stereohit);
555 if(alreadystored != hitangleassociation.end()){
556 if(itm->estimate() > alreadystored->second.first){
558 if(itm->estimate() < alreadystored->second.first){
560 hitangleassociation.insert(std::make_pair(stereohit, std::make_pair(itm->estimate(),tanangle)));
564 hitangleassociation.insert(std::make_pair(stereohit, std::make_pair(itm->estimate(),tanangle)));
589 const auto & amplitudes = cluster->amplitudes();
592 uint16_t FirstStrip = cluster->firstStrip();
594 auto begin =amplitudes.begin();
595 for(
auto idigi=amplitudes.begin(); idigi!=amplitudes.end(); idigi++){
631 if(trackdirection.
z()!=0){
634 float tanangle = trackdirection.
x()/trackdirection.
z();
637 detparmap::iterator TheDet=
detmap.find(detid.
rawId());
639 if(TheDet!=
detmap.end())localmagdir=TheDet->second->magfield;
643 float signcorrection = (localmagdir * ylocal)/(
MagField);
646 std::map<const SiStripRecHit2D *,std::pair<float,float>, DetIdLess>::iterator alreadystored=hitangleassociation.find(hit);
648 if(alreadystored != hitangleassociation.end()){
649 if(itm->estimate() > alreadystored->second.first){
651 if(itm->estimate() < alreadystored->second.first){
653 hitangleassociation.insert(std::make_pair(hit, std::make_pair(itm->estimate(),tanangle)));
657 hitangleassociation.insert(std::make_pair(hit,std::make_pair(itm->estimate(), tanangle) ) );
668 std::map<const SiStripRecHit2D *,std::pair<float,float>,DetIdLess>::iterator hitsiter;
671 for(hitsiter=hitangleassociation.begin();hitsiter!=hitangleassociation.end();hitsiter++){
678 size=(cluster->amplitudes()).
size();
682 float tangent = hitsiter->second.second;
686 detparmap::iterator thedet=
detmap.find(detid.
rawId());
688 if(thedet!=
detmap.end())localmagdir=thedet->second->magfield;
689 float localmagfield = localmagdir.
mag();
691 if(localmagfield != 0.){
695 float normprojection = (localmagdir * ylocal)/(localmagfield);
697 if(normprojection == 0.)
LogDebug(
"SiStripLAProfileBooker::analyze")<<
"Error: YBprojection = 0";
700 float signprojcorrection = 1/normprojection;
701 tangent*=signprojcorrection;
707 histomap::iterator thehisto=
histos.find(detid.
rawId());
709 if(thehisto==
histos.end())
edm::LogError(
"SiStripLAProfileBooker::analyze")<<
"Error: the profile associated to"<<detid.
rawId()<<
"does not exist! ";
710 else thehisto->second->Fill(tangent,
size);
714 unsigned int layerid;
716 histomap::iterator thesummaryhisto=
summaryhisto.find(layerid);
717 if(thesummaryhisto==
summaryhisto.end())
edm::LogError(
"SiStripLAProfileBooker::analyze")<<
"Error: the profile associated to subdet "<<name<<
"does not exist! ";
718 else thesummaryhisto->second->Fill(tangent,
size);
T getParameter(std::string const &) const
EventNumber_t event() const
unsigned int tibLayer(const DetId &id) const
const GeomDetUnit * monoDet() const
friend struct const_iterator
const_iterator end() const
last iterator over the map (read only)
virtual const Topology & topology() const
std::vector< unsigned int > tidModuleInfo(const DetId &id) const
LocalVector localDirection() const
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
constexpr uint32_t rawId() const
get the raw id
std::vector< Track > TrackCollection
collection of Tracks
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
const Bounds & bounds() const
unsigned int tidWheel(const DetId &id) const
std::vector< unsigned int > tibStringInfo(const DetId &id) const
const Plane & surface() const
The nominal surface of the GeomDet.
std::vector< unsigned int > tecPetalInfo(const DetId &id) const
std::vector< unsigned int > tobRodInfo(const DetId &id) const
std::shared_ptr< TrackingRecHit const > ConstRecHitPointer
void getlayer(const DetId &detid, const TrackerTopology *tTopo, std::string &name, unsigned int &layerid)
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
ClusterRef cluster() const
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
SiStripRecHit2D originalHit() const
unsigned int stereo() const
stereo
SiStripRecHit2D stereoHit() const
virtual float thickness() const =0
virtual float localPitch(const LocalPoint &) const =0
std::vector< Trajectory > TrajectoryCollection
SiStripRecHit2D monoHit() const
float TanTrackAngleParallel
static int position[264][3]
const TrackerGeomDet * idToDet(DetId) const override
LocalPoint localPosition() const final
const_iterator begin() const
first iterator over the map (read only)
DetId geographicalId() const
unsigned int tecWheel(const DetId &id) const
T const * product() const
Power< A, B >::type pow(const A &a, const B &b)
const GeomDetUnit * stereoDet() const
const Plane & specificSurface() const
Same as surface(), kept for backward compatibility.
unsigned int tobLayer(const DetId &id) const
const TrackerGeometry * tracker