290 std::map<const SiStripRecHit2D*, std::pair<float, float>, DetIdLess> hitangleassociation;
291 std::list<SiStripRecHit2D>
cache;
294 trajsize = TrajectoryCollection->size();
297 edm::LogInfo(
"SiStripLAProfileBooker::analyze") <<
" Number of trajectories in event = " <<
trajsize <<
"\n";
301 for (TrajTrackIter = TrajTrackMap->
begin(); TrajTrackIter != TrajTrackMap->
end();
304 if (TrajTrackIter->key->foundHits() >= 5) {
316 pt = TrajTrackIter->val->pt();
318 chi2norm = TrajTrackIter->val->normalizedChi2();
319 EtaTrack = TrajTrackIter->val->eta();
320 PhiTrack = TrajTrackIter->val->phi();
323 std::vector<TrajectoryMeasurement> TMeas = TrajTrackIter->key->measurements();
324 std::vector<TrajectoryMeasurement>::iterator itm;
326 for (itm = TMeas.begin(); itm != TMeas.end(); itm++) {
329 for (i = 0; i < 100; i++) {
380 cache.push_back(matchedhit->
monoHit());
395 const auto& amplitudes = monocluster->amplitudes();
398 uint16_t FirstStrip = monocluster->firstStrip();
399 auto begin = amplitudes.begin();
401 for (
auto idigi =
begin; idigi != amplitudes.end(); idigi++) {
435 if (monotkdir.
z() != 0) {
437 float tanangle = monotkdir.
x() / monotkdir.
z();
440 detparmap::iterator TheDet =
detmap.find(detid.
rawId());
442 if (TheDet !=
detmap.end())
443 localmagdir = TheDet->second->magfield;
447 float signcorrection = (localmagdir * monoylocal) / (
MagField);
448 if (signcorrection != 0)
452 std::map<const SiStripRecHit2D*, std::pair<float, float>, DetIdLess>::iterator alreadystored =
453 hitangleassociation.find(monohit);
455 if (alreadystored != hitangleassociation.end()) {
456 if (itm->estimate() > alreadystored->second.first) {
459 if (itm->estimate() < alreadystored->second.first) {
461 hitangleassociation.insert(std::make_pair(monohit, std::make_pair(itm->estimate(), tanangle)));
464 hitangleassociation.insert(make_pair(monohit, std::make_pair(itm->estimate(), tanangle)));
472 cache.push_back(matchedhit->
stereoHit());
485 ClSize = (stereocluster->amplitudes()).
size();
487 const auto& amplitudes = stereocluster->amplitudes();
489 barycenter = stereocluster->barycenter() - 0.5;
490 uint16_t FirstStrip = stereocluster->firstStrip();
491 auto begin = amplitudes.begin();
493 for (
auto idigi =
begin; idigi != amplitudes.end(); idigi++) {
527 if (stereotkdir.
z() != 0) {
529 float tanangle = stereotkdir.
x() / stereotkdir.
z();
532 detparmap::iterator TheDet =
detmap.find(detid.
rawId());
534 if (TheDet !=
detmap.end())
535 localmagdir = TheDet->second->magfield;
539 float signcorrection = (localmagdir * stereoylocal) / (
MagField);
540 if (signcorrection != 0)
544 std::map<const SiStripRecHit2D*, std::pair<float, float>, DetIdLess>::iterator alreadystored =
545 hitangleassociation.find(stereohit);
547 if (alreadystored != hitangleassociation.end()) {
548 if (itm->estimate() > alreadystored->second.first) {
551 if (itm->estimate() < alreadystored->second.first) {
553 hitangleassociation.insert(std::make_pair(stereohit, std::make_pair(itm->estimate(), tanangle)));
556 hitangleassociation.insert(std::make_pair(stereohit, std::make_pair(itm->estimate(), tanangle)));
578 const auto& amplitudes = cluster->amplitudes();
581 uint16_t FirstStrip = cluster->firstStrip();
583 auto begin = amplitudes.begin();
584 for (
auto idigi = amplitudes.begin(); idigi != amplitudes.end(); idigi++) {
616 if (trackdirection.
z() != 0) {
618 float tanangle = trackdirection.
x() / trackdirection.
z();
621 detparmap::iterator TheDet =
detmap.find(detid.
rawId());
623 if (TheDet !=
detmap.end())
624 localmagdir = TheDet->second->magfield;
628 float signcorrection = (localmagdir * ylocal) / (
MagField);
629 if (signcorrection != 0)
633 std::map<const SiStripRecHit2D*, std::pair<float, float>, DetIdLess>::iterator alreadystored =
634 hitangleassociation.find(hit);
636 if (alreadystored != hitangleassociation.end()) {
637 if (itm->estimate() > alreadystored->second.first) {
640 if (itm->estimate() < alreadystored->second.first) {
642 hitangleassociation.insert(std::make_pair(hit, std::make_pair(itm->estimate(), tanangle)));
645 hitangleassociation.insert(std::make_pair(hit, std::make_pair(itm->estimate(), tanangle)));
655 std::map<const SiStripRecHit2D*, std::pair<float, float>, DetIdLess>::iterator hitsiter;
657 for (hitsiter = hitangleassociation.begin(); hitsiter != hitangleassociation.end(); hitsiter++) {
663 size = (cluster->amplitudes()).
size();
667 float tangent = hitsiter->second.second;
671 detparmap::iterator thedet =
detmap.find(detid.
rawId());
673 if (thedet !=
detmap.end())
674 localmagdir = thedet->second->magfield;
675 float localmagfield = localmagdir.
mag();
677 if (localmagfield != 0.) {
680 float normprojection = (localmagdir * ylocal) / (localmagfield);
682 if (normprojection == 0.)
683 LogDebug(
"SiStripLAProfileBooker::analyze") <<
"Error: YBprojection = 0";
686 float signprojcorrection = 1 / normprojection;
687 tangent *= signprojcorrection;
693 histomap::iterator thehisto =
histos.find(detid.
rawId());
695 if (thehisto ==
histos.end())
697 <<
"Error: the profile associated to" << detid.
rawId() <<
"does not exist! ";
699 thehisto->second->Fill(tangent,
size);
703 unsigned int layerid;
704 getlayer(detid, tTopo, name, layerid);
705 histomap::iterator thesummaryhisto =
summaryhisto.find(layerid);
708 <<
"Error: the profile associated to subdet " << name <<
"does not exist! ";
710 thesummaryhisto->second->Fill(tangent,
size);
T getParameter(std::string const &) const
EventNumber_t event() const
static constexpr auto TEC
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
static constexpr auto TOB
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
SiStripRecHit2D originalHit() const
unsigned int stereo() const
stereo
static constexpr auto TIB
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
static constexpr auto TID
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