299 std::map<const SiStripRecHit2D*,std::pair<float,float>,DetIdLess> hitangleassociation;
300 std::list<SiStripRecHit2D>
cache;
303 trajsize=TrajectoryCollection->size();
306 edm::LogInfo(
"SiStripLAProfileBooker::analyze") <<
" Number of trajectories in event = "<<
trajsize<<
"\n";
310 for(TrajTrackIter = TrajTrackMap->
begin(); TrajTrackIter!= TrajTrackMap->
end(); TrajTrackIter++){
312 if(TrajTrackIter->key->foundHits()>=5){
325 pt = TrajTrackIter->val->pt();
327 chi2norm = TrajTrackIter->val->normalizedChi2();
328 EtaTrack = TrajTrackIter->val->eta();
329 PhiTrack = TrajTrackIter->val->phi();
332 std::vector<TrajectoryMeasurement> TMeas=TrajTrackIter->key->measurements();
333 std::vector<TrajectoryMeasurement>::iterator itm;
335 for (itm=TMeas.begin();itm!=TMeas.end();itm++){
370 if(phit) {lhit = phit->
originalHit(); hit = &lhit;}
383 cache.push_back(matchedhit->
monoHit());
398 const auto & amplitudes = monocluster->amplitudes();
401 uint16_t FirstStrip = monocluster->firstStrip();
402 auto begin=amplitudes.begin();
404 for(
auto idigi=
begin; idigi!=amplitudes.end(); idigi++){
444 if(monotkdir.
z()!=0){
447 float tanangle = monotkdir.
x()/monotkdir.
z();
450 detparmap::iterator TheDet=
detmap.find(detid.
rawId());
452 if(TheDet!=
detmap.end())localmagdir=TheDet->second->magfield;
456 float signcorrection = (localmagdir * monoylocal)/(
MagField);
460 std::map<const SiStripRecHit2D *,std::pair<float,float>,DetIdLess>::iterator alreadystored=hitangleassociation.find(monohit);
463 if(alreadystored != hitangleassociation.end()){
464 if(itm->estimate() > alreadystored->second.first){
466 if(itm->estimate() < alreadystored->second.first){
468 hitangleassociation.insert(std::make_pair(monohit, std::make_pair(itm->estimate(),tanangle)));
472 hitangleassociation.insert(make_pair(monohit, std::make_pair(itm->estimate(),tanangle)));
479 cache.push_back(matchedhit->
stereoHit());
492 ClSize = (stereocluster->amplitudes()).
size();
494 const auto & amplitudes = stereocluster->amplitudes();
496 barycenter = stereocluster->barycenter()- 0.5;
497 uint16_t FirstStrip = stereocluster->firstStrip();
498 auto begin=amplitudes.begin();
500 for(
auto idigi=
begin; idigi!=amplitudes.end(); idigi++){
539 if(stereotkdir.
z()!=0){
542 float tanangle = stereotkdir.
x()/stereotkdir.
z();
545 detparmap::iterator TheDet=
detmap.find(detid.
rawId());
547 if(TheDet!=
detmap.end())localmagdir=TheDet->second->magfield;
551 float signcorrection = (localmagdir * stereoylocal)/(
MagField);
554 std::map<const SiStripRecHit2D *,std::pair<float,float>,DetIdLess>::iterator alreadystored=hitangleassociation.find(stereohit);
556 if(alreadystored != hitangleassociation.end()){
557 if(itm->estimate() > alreadystored->second.first){
559 if(itm->estimate() < alreadystored->second.first){
561 hitangleassociation.insert(std::make_pair(stereohit, std::make_pair(itm->estimate(),tanangle)));
565 hitangleassociation.insert(std::make_pair(stereohit, std::make_pair(itm->estimate(),tanangle)));
590 const auto & amplitudes = cluster->amplitudes();
593 uint16_t FirstStrip = cluster->firstStrip();
595 auto begin =amplitudes.begin();
596 for(
auto idigi=amplitudes.begin(); idigi!=amplitudes.end(); idigi++){
632 if(trackdirection.
z()!=0){
635 float tanangle = trackdirection.
x()/trackdirection.
z();
638 detparmap::iterator TheDet=
detmap.find(detid.
rawId());
640 if(TheDet!=
detmap.end())localmagdir=TheDet->second->magfield;
644 float signcorrection = (localmagdir * ylocal)/(
MagField);
647 std::map<const SiStripRecHit2D *,std::pair<float,float>, DetIdLess>::iterator alreadystored=hitangleassociation.find(hit);
649 if(alreadystored != hitangleassociation.end()){
650 if(itm->estimate() > alreadystored->second.first){
652 if(itm->estimate() < alreadystored->second.first){
654 hitangleassociation.insert(std::make_pair(hit, std::make_pair(itm->estimate(),tanangle)));
658 hitangleassociation.insert(std::make_pair(hit,std::make_pair(itm->estimate(), tanangle) ) );
669 std::map<const SiStripRecHit2D *,std::pair<float,float>,DetIdLess>::iterator hitsiter;
672 for(hitsiter=hitangleassociation.begin();hitsiter!=hitangleassociation.end();hitsiter++){
679 size=(cluster->amplitudes()).
size();
683 float tangent = hitsiter->second.second;
687 detparmap::iterator thedet=
detmap.find(detid.
rawId());
689 if(thedet!=
detmap.end())localmagdir=thedet->second->magfield;
690 float localmagfield = localmagdir.
mag();
692 if(localmagfield != 0.){
696 float normprojection = (localmagdir * ylocal)/(localmagfield);
698 if(normprojection == 0.)
LogDebug(
"SiStripLAProfileBooker::analyze")<<
"Error: YBprojection = 0";
701 float signprojcorrection = 1/normprojection;
702 tangent*=signprojcorrection;
708 histomap::iterator thehisto=
histos.find(detid.
rawId());
710 if(thehisto==
histos.end())
edm::LogError(
"SiStripLAProfileBooker::analyze")<<
"Error: the profile associated to"<<detid.
rawId()<<
"does not exist! ";
711 else thehisto->second->Fill(tangent,
size);
715 unsigned int layerid;
717 histomap::iterator thesummaryhisto=
summaryhisto.find(layerid);
718 if(thesummaryhisto==
summaryhisto.end())
edm::LogError(
"SiStripLAProfileBooker::analyze")<<
"Error: the profile associated to subdet "<<name<<
"does not exist! ";
719 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