CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
CachingSeedCleanerByHitPosition Class Reference

#include <CachingSeedCleanerByHitPosition.h>

Inheritance diagram for CachingSeedCleanerByHitPosition:
RedundantSeedCleaner

Public Member Functions

virtual void add (const Trajectory *traj)
 
 CachingSeedCleanerByHitPosition ()
 
virtual void done ()
 Tells the cleaner that the seeds are finished, and so it can clear any cache it has. More...
 
virtual bool good (const TrajectorySeed *seed)
 Returns true if the seed is not overlapping with another trajectory. More...
 
virtual void init (const std::vector< Trajectory > *vect)
 Provides the cleaner a pointer to the vector where trajectories are stored, in case it does not want to keep a local collection of trajectories. More...
 
virtual ~CachingSeedCleanerByHitPosition ()
 
- Public Member Functions inherited from RedundantSeedCleaner
void clean (const std::vector< TrajectorySeed > &, std::vector< TrajectorySeed > &)
 clean More...
 
void define (std::vector< TrajectorySeed > &)
 collection definition More...
 
 RedundantSeedCleaner ()
 constructor More...
 
virtual ~RedundantSeedCleaner ()
 
 ~RedundantSeedCleaner ()
 destructor More...
 

Private Attributes

std::multimap< uint32_t,
unsigned int > 
theCache
 
std::vector
< Trajectory::RecHitContainer
theVault
 

Detailed Description

Definition at line 6 of file CachingSeedCleanerByHitPosition.h.

Constructor & Destructor Documentation

CachingSeedCleanerByHitPosition::CachingSeedCleanerByHitPosition ( )
inline

Definition at line 20 of file CachingSeedCleanerByHitPosition.h.

21  /*, comps_(0), tracks_(0), calls_(0)*/ {}
RedundantSeedCleaner()
constructor
std::multimap< uint32_t, unsigned int > theCache
std::vector< Trajectory::RecHitContainer > theVault
virtual CachingSeedCleanerByHitPosition::~CachingSeedCleanerByHitPosition ( )
inlinevirtual

Definition at line 22 of file CachingSeedCleanerByHitPosition.h.

References theCache, and theVault.

22 { theVault.clear(); theCache.clear(); }
std::multimap< uint32_t, unsigned int > theCache
std::vector< Trajectory::RecHitContainer > theVault

Member Function Documentation

void CachingSeedCleanerByHitPosition::add ( const Trajectory traj)
virtual

In this implementation, it does nothing

Implements RedundantSeedCleaner.

Definition at line 23 of file CachingSeedCleanerByHitPosition.cc.

References cond::rpcobgas::detid, customizeTrackingMonitorSeedNumber::idx, edmStreamStallGrapher::t, theCache, and theVault.

Referenced by counter.Counter::register().

23  {
24  typedef Trajectory::RecHitContainer::const_iterator TI;
25  unsigned int idx = theVault.size();
26  Trajectory::RecHitContainer hits = trj->recHits();
27  theVault.push_back(hits);
28 
29  uint32_t detid;
30  for (TI t = hits.begin(), te = hits.end(); t != te; ++t) {
31  if ((*t)->isValid()) {
32  detid = (*t)->geographicalId().rawId();
33  if (detid) theCache.insert(std::pair<uint32_t, unsigned int>(detid, idx));
34  }
35  }
36 }
std::multimap< uint32_t, unsigned int > theCache
ConstRecHitContainer RecHitContainer
Definition: Trajectory.h:48
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
std::vector< Trajectory::RecHitContainer > theVault
void CachingSeedCleanerByHitPosition::done ( )
virtual

Tells the cleaner that the seeds are finished, and so it can clear any cache it has.

Implements RedundantSeedCleaner.

Definition at line 11 of file CachingSeedCleanerByHitPosition.cc.

References theCache, and theVault.

11  {
12  //edm::LogInfo("CachingSeedCleanerByHitPosition") << " Calls: " << calls_ << ", Tracks: " << tracks_ <<", Comps: " << comps_ << " Vault: " << theVault.size() << ".";
13  //calls_ = comps_ = tracks_ = 0;
14 
15  theVault.clear(); theCache.clear();
16 
17  std::vector<Trajectory::RecHitContainer> swapper;
18  swapper.swap(theVault); // this should clean the vault even more
19 }
std::multimap< uint32_t, unsigned int > theCache
std::vector< Trajectory::RecHitContainer > theVault
bool CachingSeedCleanerByHitPosition::good ( const TrajectorySeed seed)
virtual

Returns true if the seed is not overlapping with another trajectory.

Implements RedundantSeedCleaner.

Definition at line 38 of file CachingSeedCleanerByHitPosition.cc.

References AlCaHLTBitMon_QueryRunRegistry::comp, cond::rpcobgas::detid, end, RecHitComparatorByPosition::equals(), plotBeamSpotDB::first, newFWLiteAna::found, prof2calltree::last, TrajectorySeed::recHits(), edmStreamStallGrapher::t, theCache, and theVault.

38  {
41  typedef Trajectory::RecHitContainer::const_iterator TI;
42  TrajectorySeed::range range = seed->recHits();
43 
44  SI first = range.first, last = range.second, curr;
45  uint32_t detid = first->geographicalId().rawId();
46 
47  std::multimap<uint32_t, unsigned int>::const_iterator it, end = theCache.end();
48 
49  //calls_++;
50  for (it = theCache.find(detid); (it != end) && (it->first == detid); ++it) {
51  //tracks_++;
52  TI ts = theVault[it->second].begin(), te = theVault[it->second].end();
53  for (curr = first; curr != last; ++curr) {
54  bool found = false;
55  for (TI t = ts; t != te; ++t) {
56  //comps_++;
57  if (comp.equals(&(*curr), &(**t))) { found = true; break; }
58  }
59  if (!found) break;
60  }
61  if (curr == last) return false;
62  }
63  return true;
64 }
bool equals(const TrackingRecHit *a, const TrackingRecHit *b) const
std::multimap< uint32_t, unsigned int > theCache
recHitContainer::const_iterator const_iterator
std::pair< const_iterator, const_iterator > range
#define end
Definition: vmac.h:37
range recHits() const
std::vector< Trajectory::RecHitContainer > theVault
void CachingSeedCleanerByHitPosition::init ( const std::vector< Trajectory > *  vect)
virtual

Provides the cleaner a pointer to the vector where trajectories are stored, in case it does not want to keep a local collection of trajectories.

Implements RedundantSeedCleaner.

Definition at line 7 of file CachingSeedCleanerByHitPosition.cc.

References theCache, and theVault.

7  {
8  theVault.clear(); theCache.clear();
9 }
std::multimap< uint32_t, unsigned int > theCache
std::vector< Trajectory::RecHitContainer > theVault

Member Data Documentation

std::multimap<uint32_t, unsigned int> CachingSeedCleanerByHitPosition::theCache
private
std::vector<Trajectory::RecHitContainer> CachingSeedCleanerByHitPosition::theVault
private