300 std::map<const SiStripRecHit2D*,std::pair<float,float>,DetIdLess> hitangleassociation;
301 std::list<SiStripRecHit2D>
cache;
304 trajsize=TrajectoryCollection->size();
307 edm::LogInfo(
"SiStripLAProfileBooker::analyze") <<
" Number of trajectories in event = "<<
trajsize<<
"\n";
311 for(TrajTrackIter = TrajTrackMap->
begin(); TrajTrackIter!= TrajTrackMap->
end(); TrajTrackIter++){
313 if(TrajTrackIter->key->foundHits()>=5){
326 pt = TrajTrackIter->val->pt();
328 chi2norm = TrajTrackIter->val->normalizedChi2();
329 EtaTrack = TrajTrackIter->val->eta();
330 PhiTrack = TrajTrackIter->val->phi();
333 std::vector<TrajectoryMeasurement> TMeas=TrajTrackIter->key->measurements();
334 std::vector<TrajectoryMeasurement>::iterator itm;
336 for (itm=TMeas.begin();itm!=TMeas.end();itm++){
371 if(phit) {lhit = phit->
originalHit(); hit = &lhit;}
384 cache.push_back(matchedhit->
monoHit());
399 const auto & amplitudes = monocluster->amplitudes();
402 uint16_t FirstStrip = monocluster->firstStrip();
403 auto begin=amplitudes.begin();
405 for(
auto idigi=
begin; idigi!=amplitudes.end(); idigi++){
445 if(monotkdir.
z()!=0){
448 float tanangle = monotkdir.
x()/monotkdir.
z();
451 detparmap::iterator TheDet=
detmap.find(detid.
rawId());
453 if(TheDet!=
detmap.end())localmagdir=TheDet->second->magfield;
457 float signcorrection = (localmagdir * monoylocal)/(
MagField);
461 std::map<const SiStripRecHit2D *,std::pair<float,float>,DetIdLess>::iterator alreadystored=hitangleassociation.find(monohit);
464 if(alreadystored != hitangleassociation.end()){
465 if(itm->estimate() > alreadystored->second.first){
467 if(itm->estimate() < alreadystored->second.first){
469 hitangleassociation.insert(std::make_pair(monohit, std::make_pair(itm->estimate(),tanangle)));
473 hitangleassociation.insert(make_pair(monohit, std::make_pair(itm->estimate(),tanangle)));
480 cache.push_back(matchedhit->
stereoHit());
493 ClSize = (stereocluster->amplitudes()).
size();
495 const auto & amplitudes = stereocluster->amplitudes();
497 barycenter = stereocluster->barycenter()- 0.5;
498 uint16_t FirstStrip = stereocluster->firstStrip();
499 auto begin=amplitudes.begin();
501 for(
auto idigi=
begin; idigi!=amplitudes.end(); idigi++){
540 if(stereotkdir.
z()!=0){
543 float tanangle = stereotkdir.
x()/stereotkdir.
z();
546 detparmap::iterator TheDet=
detmap.find(detid.
rawId());
548 if(TheDet!=
detmap.end())localmagdir=TheDet->second->magfield;
552 float signcorrection = (localmagdir * stereoylocal)/(
MagField);
555 std::map<const SiStripRecHit2D *,std::pair<float,float>,DetIdLess>::iterator alreadystored=hitangleassociation.find(stereohit);
557 if(alreadystored != hitangleassociation.end()){
558 if(itm->estimate() > alreadystored->second.first){
560 if(itm->estimate() < alreadystored->second.first){
562 hitangleassociation.insert(std::make_pair(stereohit, std::make_pair(itm->estimate(),tanangle)));
566 hitangleassociation.insert(std::make_pair(stereohit, std::make_pair(itm->estimate(),tanangle)));
591 const auto & amplitudes = cluster->amplitudes();
594 uint16_t FirstStrip = cluster->firstStrip();
596 auto begin =amplitudes.begin();
597 for(
auto idigi=amplitudes.begin(); idigi!=amplitudes.end(); idigi++){
633 if(trackdirection.
z()!=0){
636 float tanangle = trackdirection.
x()/trackdirection.
z();
639 detparmap::iterator TheDet=
detmap.find(detid.
rawId());
641 if(TheDet!=
detmap.end())localmagdir=TheDet->second->magfield;
645 float signcorrection = (localmagdir * ylocal)/(
MagField);
648 std::map<const SiStripRecHit2D *,std::pair<float,float>, DetIdLess>::iterator alreadystored=hitangleassociation.find(hit);
650 if(alreadystored != hitangleassociation.end()){
651 if(itm->estimate() > alreadystored->second.first){
653 if(itm->estimate() < alreadystored->second.first){
655 hitangleassociation.insert(std::make_pair(hit, std::make_pair(itm->estimate(),tanangle)));
659 hitangleassociation.insert(std::make_pair(hit,std::make_pair(itm->estimate(), tanangle) ) );
670 std::map<const SiStripRecHit2D *,std::pair<float,float>,DetIdLess>::iterator hitsiter;
673 for(hitsiter=hitangleassociation.begin();hitsiter!=hitangleassociation.end();hitsiter++){
680 size=(cluster->amplitudes()).
size();
684 float tangent = hitsiter->second.second;
688 detparmap::iterator thedet=
detmap.find(detid.
rawId());
690 if(thedet!=
detmap.end())localmagdir=thedet->second->magfield;
691 float localmagfield = localmagdir.
mag();
693 if(localmagfield != 0.){
697 float normprojection = (localmagdir * ylocal)/(localmagfield);
699 if(normprojection == 0.)
LogDebug(
"SiStripLAProfileBooker::analyze")<<
"Error: YBprojection = 0";
702 float signprojcorrection = 1/normprojection;
703 tangent*=signprojcorrection;
709 histomap::iterator thehisto=
histos.find(detid.
rawId());
711 if(thehisto==
histos.end())
edm::LogError(
"SiStripLAProfileBooker::analyze")<<
"Error: the profile associated to"<<detid.
rawId()<<
"does not exist! ";
712 else thehisto->second->Fill(tangent,
size);
716 unsigned int layerid;
718 histomap::iterator thesummaryhisto=
summaryhisto.find(layerid);
719 if(thesummaryhisto==
summaryhisto.end())
edm::LogError(
"SiStripLAProfileBooker::analyze")<<
"Error: the profile associated to subdet "<<name<<
"does not exist! ";
720 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