279 std::map<const SiStripRecHit2D*, std::pair<float, float>, DetIdLess> hitangleassociation;
280 std::list<SiStripRecHit2D>
cache;
283 trajsize = TrajectoryCollection->size();
286 edm::LogInfo(
"SiStripLAProfileBooker::analyze") <<
" Number of trajectories in event = " <<
trajsize <<
"\n";
290 for (TrajTrackIter = TrajTrackMap->begin(); TrajTrackIter != TrajTrackMap->end();
293 if (TrajTrackIter->key->foundHits() >= 5) {
305 pt = TrajTrackIter->val->pt();
307 chi2norm = TrajTrackIter->val->normalizedChi2();
308 EtaTrack = TrajTrackIter->val->eta();
309 PhiTrack = TrajTrackIter->val->phi();
312 std::vector<TrajectoryMeasurement> TMeas = TrajTrackIter->key->measurements();
313 std::vector<TrajectoryMeasurement>::iterator itm;
315 for (itm = TMeas.begin(); itm != TMeas.end(); itm++) {
318 for (i = 0; i < 100; i++) {
369 cache.push_back(matchedhit->
monoHit());
384 const auto& amplitudes = monocluster->amplitudes();
387 uint16_t FirstStrip = monocluster->firstStrip();
388 auto begin = amplitudes.begin();
390 for (
auto idigi =
begin; idigi != amplitudes.end(); idigi++) {
424 if (monotkdir.
z() != 0) {
426 float tanangle = monotkdir.
x() / monotkdir.
z();
429 detparmap::iterator TheDet =
detmap.find(detid.
rawId());
431 if (TheDet !=
detmap.end())
432 localmagdir = TheDet->second->magfield;
436 float signcorrection = (localmagdir * monoylocal) / (
MagField);
437 if (signcorrection != 0)
441 std::map<const SiStripRecHit2D*, std::pair<float, float>, DetIdLess>::iterator alreadystored =
442 hitangleassociation.find(monohit);
444 if (alreadystored != hitangleassociation.end()) {
445 if (itm->estimate() > alreadystored->second.first) {
448 if (itm->estimate() < alreadystored->second.first) {
450 hitangleassociation.insert(std::make_pair(monohit, std::make_pair(itm->estimate(), tanangle)));
453 hitangleassociation.insert(make_pair(monohit, std::make_pair(itm->estimate(), tanangle)));
461 cache.push_back(matchedhit->
stereoHit());
474 ClSize = (stereocluster->amplitudes()).
size();
476 const auto& amplitudes = stereocluster->amplitudes();
478 barycenter = stereocluster->barycenter() - 0.5;
479 uint16_t FirstStrip = stereocluster->firstStrip();
480 auto begin = amplitudes.begin();
482 for (
auto idigi =
begin; idigi != amplitudes.end(); idigi++) {
516 if (stereotkdir.
z() != 0) {
518 float tanangle = stereotkdir.
x() / stereotkdir.
z();
521 detparmap::iterator TheDet =
detmap.find(detid.
rawId());
523 if (TheDet !=
detmap.end())
524 localmagdir = TheDet->second->magfield;
528 float signcorrection = (localmagdir * stereoylocal) / (
MagField);
529 if (signcorrection != 0)
533 std::map<const SiStripRecHit2D*, std::pair<float, float>, DetIdLess>::iterator alreadystored =
534 hitangleassociation.find(stereohit);
536 if (alreadystored != hitangleassociation.end()) {
537 if (itm->estimate() > alreadystored->second.first) {
540 if (itm->estimate() < alreadystored->second.first) {
542 hitangleassociation.insert(std::make_pair(stereohit, std::make_pair(itm->estimate(), tanangle)));
545 hitangleassociation.insert(std::make_pair(stereohit, std::make_pair(itm->estimate(), tanangle)));
567 const auto& amplitudes = cluster->amplitudes();
570 uint16_t FirstStrip = cluster->firstStrip();
572 auto begin = amplitudes.begin();
573 for (
auto idigi = amplitudes.begin(); idigi != amplitudes.end(); idigi++) {
605 if (trackdirection.
z() != 0) {
607 float tanangle = trackdirection.
x() / trackdirection.
z();
610 detparmap::iterator TheDet =
detmap.find(detid.
rawId());
612 if (TheDet !=
detmap.end())
613 localmagdir = TheDet->second->magfield;
617 float signcorrection = (localmagdir * ylocal) / (
MagField);
618 if (signcorrection != 0)
622 std::map<const SiStripRecHit2D*, std::pair<float, float>, DetIdLess>::iterator alreadystored =
623 hitangleassociation.find(hit);
625 if (alreadystored != hitangleassociation.end()) {
626 if (itm->estimate() > alreadystored->second.first) {
629 if (itm->estimate() < alreadystored->second.first) {
631 hitangleassociation.insert(std::make_pair(hit, std::make_pair(itm->estimate(), tanangle)));
634 hitangleassociation.insert(std::make_pair(hit, std::make_pair(itm->estimate(), tanangle)));
644 std::map<const SiStripRecHit2D*, std::pair<float, float>, DetIdLess>::iterator hitsiter;
646 for (hitsiter = hitangleassociation.begin(); hitsiter != hitangleassociation.end(); hitsiter++) {
652 size = (cluster->amplitudes()).
size();
656 float tangent = hitsiter->second.second;
660 detparmap::iterator thedet =
detmap.find(detid.
rawId());
662 if (thedet !=
detmap.end())
663 localmagdir = thedet->second->magfield;
664 float localmagfield = localmagdir.
mag();
666 if (localmagfield != 0.) {
669 float normprojection = (localmagdir * ylocal) / (localmagfield);
671 if (normprojection == 0.)
672 LogDebug(
"SiStripLAProfileBooker::analyze") <<
"Error: YBprojection = 0";
675 float signprojcorrection = 1 / normprojection;
676 tangent *= signprojcorrection;
682 histomap::iterator thehisto =
histos.find(detid.
rawId());
684 if (thehisto ==
histos.end())
686 <<
"Error: the profile associated to" << detid.
rawId() <<
"does not exist! ";
688 thehisto->second->Fill(tangent,
size);
692 unsigned int layerid;
693 getlayer(detid, tTopo, name, layerid);
694 histomap::iterator thesummaryhisto =
summaryhisto.find(layerid);
697 <<
"Error: the profile associated to subdet " << name <<
"does not exist! ";
699 thesummaryhisto->second->Fill(tangent,
size);
EventNumber_t event() const
static constexpr auto TEC
unsigned int tibLayer(const DetId &id) const
const GeomDetUnit * monoDet() const
friend struct const_iterator
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
auto const & tracks
cannot be loose
std::vector< unsigned int > tibStringInfo(const DetId &id) const
const Plane & surface() const
The nominal surface of the GeomDet.
virtual float thickness() const =0
virtual float localPitch(const LocalPoint &) const =0
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
const TrackerGeomDet * idToDet(DetId) const override
SiStripRecHit2D originalHit() const
Log< level::Info, false > LogInfo
unsigned int stereo() const
stereo
static constexpr auto TIB
SiStripRecHit2D stereoHit() const
T getParameter(std::string const &) const
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
std::vector< Trajectory > TrajectoryCollection
SiStripRecHit2D monoHit() const
float TanTrackAngleParallel
LocalPoint localPosition() const override
static int position[264][3]
DetId geographicalId() const
unsigned int tecWheel(const DetId &id) const
static constexpr auto TID
const TrackerGeometry * tkGeom_
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