CMS 3D CMS Logo

Public Member Functions | Private Member Functions

TrajectoryCleanerMerger Class Reference

#include <TrajectoryCleanerMerger.h>

Inheritance diagram for TrajectoryCleanerMerger:
TrajectoryCleaner

List of all members.

Public Member Functions

virtual void clean (TrajectoryPointerContainer &) const
void clean (TrajectoryContainer &trajs) const
 TrajectoryCleanerMerger (const edm::ParameterSet &iConfig)
virtual ~TrajectoryCleanerMerger ()

Private Member Functions

int getLayer (const DetId &id) const
void reOrderMeasurements (Trajectory &traj) const
bool sameSeed (const TrajectorySeed &s1, const TrajectorySeed &s2) const

Detailed Description

Definition at line 6 of file TrajectoryCleanerMerger.h.


Constructor & Destructor Documentation

TrajectoryCleanerMerger::TrajectoryCleanerMerger ( const edm::ParameterSet iConfig) [inline]

Definition at line 9 of file TrajectoryCleanerMerger.h.

{};
virtual TrajectoryCleanerMerger::~TrajectoryCleanerMerger ( ) [inline, virtual]

Definition at line 10 of file TrajectoryCleanerMerger.h.

{};

Member Function Documentation

void TrajectoryCleanerMerger::clean ( TrajectoryPointerContainer ) const [virtual]

Implements TrajectoryCleaner.

Definition at line 131 of file TrajectoryCleanerMerger.cc.

{
}
void TrajectoryCleanerMerger::clean ( TrajectoryContainer trajs) const [virtual]

Reimplemented from TrajectoryCleaner.

Definition at line 39 of file DTSegmentCleaner.cc.

References query::result.

                                                                                      {
  if (inputCands.size()<2) return inputCands;
  //   cout << "[DTSegmentCleaner] # of candidates: " << inputCands.size() << endl;
  vector<DTSegmentCand*> result = solveConflict(inputCands);

  result = ghostBuster(result);
  
  return result;
}
int TrajectoryCleanerMerger::getLayer ( const DetId id) const [private]

Definition at line 196 of file TrajectoryCleanerMerger.cc.

References PXFDetId::disk(), PXBDetId::ladder(), TIBDetId::layer(), TOBDetId::layer(), PXBDetId::layer(), TOBDetId::module(), TIBDetId::module(), PXFDetId::panel(), evf::utils::pid, PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, TIDDetId::ring(), TECDetId::ring(), sistripsummary::TEC, sistripsummary::TIB, sistripsummary::TID, sistripsummary::TOB, TIDDetId::wheel(), and TECDetId::wheel().

{
  // PXB layer, ladder -> (layer - 1)<<2 + (ladder-1)%2
  // PXF disk , panel
  // TIB layer, module 
  // TOB layer, module
  // TID wheel, ring
  // TEC wheel, ring

  if(id.subdetId() == (unsigned int) PixelSubdetector::PixelBarrel)
  { PXBDetId pid(id); return (100 * id.subdetId()+ ((pid.layer() - 1)<<1) + (pid.ladder() - 1)%2); }

  if(id.subdetId() == (unsigned int) PixelSubdetector::PixelEndcap)
  { PXFDetId pid(id); return (100 * id.subdetId()+ ((pid.disk()  - 1)<<1) + (pid.panel()  - 1)%2); }

  if(id.subdetId() == StripSubdetector::TIB)
  { TIBDetId pid(id); return (100 * id.subdetId()+ ((pid.layer() - 1)<<1) + (pid.module() - 1)%2); }
  if(id.subdetId() == StripSubdetector::TOB)
  { TOBDetId pid(id); return (100 * id.subdetId()+ ((pid.layer() - 1)<<1) + (pid.module() - 1)%2); }

  if(id.subdetId() == StripSubdetector::TID)
  { TIDDetId pid(id); return (100 * id.subdetId()+ ((pid.wheel() - 1)<<1) + (pid.ring()   - 1)%2); }
  if(id.subdetId() == StripSubdetector::TEC)
  { TECDetId pid(id); return (100 * id.subdetId()+ ((pid.wheel() - 1)<<1) + (pid.ring()   - 1)%2); }

  return 0;
}
void TrajectoryCleanerMerger::reOrderMeasurements ( Trajectory traj) const [private]

Definition at line 136 of file TrajectoryCleanerMerger.cc.

References i, Trajectory::measurements(), Trajectory::pop(), Trajectory::push(), and std::swap().

{
  std::vector<TrajectoryMeasurement> meas_ = traj.measurements();
  std::vector<TrajectoryMeasurement> meas;

  for(std::vector<TrajectoryMeasurement>::iterator
       im = meas_.begin();
       im!= meas_.end(); im++)
    if(im->recHit()->isValid())
       meas.push_back(*im);

  bool changed;

  do
  {
    changed = false;

    for(std::vector<TrajectoryMeasurement>::iterator im = meas.begin();
                                                im!= meas.end()-1; im++)
    if(    (*im).recHit()->globalPosition().mag2() >
       (*(im+1)).recHit()->globalPosition().mag2() + 1e-6)
    {
      swap(*im,*(im+1));
      changed = true;
    }
  }
  while(changed);

  for(unsigned int i = 0 ; i < meas.size(); i++)
     traj.pop();

  for(std::vector<TrajectoryMeasurement>::iterator im = meas.begin();
                                              im!= meas.end(); im++)
    traj.push(*im);
}
bool TrajectoryCleanerMerger::sameSeed ( const TrajectorySeed s1,
const TrajectorySeed s2 
) const [private]

Definition at line 172 of file TrajectoryCleanerMerger.cc.

References TrackingRecHit::all, TrajectorySeed::nHits(), and TrajectorySeed::recHits().

{
  if(s1.nHits() != s2.nHits()) return false;

  TrajectorySeed::range r1 = s1.recHits();
  TrajectorySeed::range r2 = s2.recHits();

  TrajectorySeed::const_iterator h1 = r1.first;
  TrajectorySeed::const_iterator h2 = r2.first;

  do
  {
    if(!(h1->sharesInput(&(*h2),TrackingRecHit::all)))
      return false;

    h1++; h2++;
  }
  while(h1 != s1.recHits().second && 
        h2 != s2.recHits().second);

  return true;
}