-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extending SeedingHitSet & SeedGeneratorFromProtoTracksEDProducer #36184
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,10 @@ | |
#define TkSeedingLayers_SeedingHitSet_H | ||
|
||
#include "DataFormats/TrackerRecHit2D/interface/BaseTrackerRecHit.h" | ||
#include "FWCore/MessageLogger/interface/MessageLogger.h" | ||
|
||
#include <vector> | ||
#include <algorithm> | ||
|
||
class SeedingHitSet { | ||
public: | ||
|
@@ -11,40 +15,39 @@ class SeedingHitSet { | |
|
||
static ConstRecHitPointer nullPtr() { return nullptr; } | ||
|
||
SeedingHitSet() { theRecHits[0] = theRecHits[1] = theRecHits[2] = theRecHits[3] = nullptr; } | ||
SeedingHitSet() = default; | ||
|
||
SeedingHitSet(ConstRecHitPointer one, ConstRecHitPointer two) : theRecHits({one, two}) { setSize(); } | ||
|
||
SeedingHitSet(ConstRecHitPointer one, ConstRecHitPointer two) | ||
// : theRecHits{{one,two,ConstRecHitPointer()}} | ||
{ | ||
theRecHits[0] = one; | ||
theRecHits[1] = two; | ||
theRecHits[2] = theRecHits[3] = nullptr; | ||
} | ||
SeedingHitSet(ConstRecHitPointer one, ConstRecHitPointer two, ConstRecHitPointer three) | ||
// : theRecHits{{one,two,three}}, | ||
{ | ||
theRecHits[0] = one; | ||
theRecHits[1] = two; | ||
theRecHits[2] = three; | ||
theRecHits[3] = nullptr; | ||
: theRecHits({one, two, three}) { | ||
setSize(); | ||
} | ||
|
||
SeedingHitSet(ConstRecHitPointer one, ConstRecHitPointer two, ConstRecHitPointer three, ConstRecHitPointer four) { | ||
theRecHits[0] = one; | ||
theRecHits[1] = two; | ||
theRecHits[2] = three; | ||
theRecHits[3] = four; | ||
SeedingHitSet(ConstRecHitPointer one, ConstRecHitPointer two, ConstRecHitPointer three, ConstRecHitPointer four) | ||
: theRecHits({one, two, three, four}) { | ||
setSize(); | ||
} | ||
|
||
ConstRecHitPointer const *data() const { return theRecHits; } | ||
SeedingHitSet(const std::vector<ConstRecHitPointer> &hits) : theRecHits(hits) { setSize(); } | ||
|
||
unsigned int size() const { return theRecHits[3] ? 4 : (theRecHits[2] ? 3 : (theRecHits[1] ? 2 : 0)); } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @slava77 |
||
ConstRecHitPointer const *data() const { return theRecHits.data(); } | ||
|
||
unsigned int size() const { return theSize; } | ||
|
||
ConstRecHitPointer get(unsigned int i) const { return theRecHits[i]; } | ||
ConstRecHitPointer operator[](unsigned int i) const { return theRecHits[i]; } | ||
|
||
private: | ||
ConstRecHitPointer theRecHits[4]; | ||
protected: | ||
std::vector<ConstRecHitPointer> theRecHits; | ||
unsigned int theSize = 0; | ||
|
||
void setSize() { | ||
theSize = 0; | ||
while (theRecHits[++theSize] and theSize < theRecHits.size()) | ||
; | ||
theSize = theSize > 1 ? theSize : 0; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please clarify why one-hit case is set to |
||
} | ||
}; | ||
|
||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had mistakenly removed the seed initialization.