Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11121 from lveldere/fastsim-newrechits-rebaseSep4
Fastsim newrechits rebase sep4
- Loading branch information
Showing
85 changed files
with
1,799 additions
and
2,700 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
DataFormats/TrackerRecHit2D/interface/FastMatchedTrackerRecHit.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
#ifndef FastMatchedTrackerRecHit_H | ||
#define FastMatchedTrackerRecHit_H | ||
|
||
#include "DataFormats/TrackerRecHit2D/interface/FastTrackerRecHit.h" | ||
#include "DataFormats/TrackerRecHit2D/interface/FastSingleTrackerRecHit.h" | ||
|
||
class FastMatchedTrackerRecHit : public FastTrackerRecHit{ | ||
|
||
public: | ||
|
||
FastMatchedTrackerRecHit() | ||
: stereoHitFirst_(false) | ||
{} | ||
|
||
~FastMatchedTrackerRecHit() {} | ||
|
||
FastMatchedTrackerRecHit( const LocalPoint & pos, | ||
const LocalError & err, | ||
const GeomDet & idet, | ||
const FastSingleTrackerRecHit & rMono, | ||
const FastSingleTrackerRecHit & rStereo, | ||
bool stereoHitFirst = false) | ||
: FastTrackerRecHit(pos,err,idet,fastTrackerRecHitType::siStripMatched2D) | ||
, stereoHitFirst_(stereoHitFirst) | ||
, componentMono_(rMono) | ||
, componentStereo_(rStereo) | ||
{}; | ||
|
||
virtual FastMatchedTrackerRecHit * clone() const {FastMatchedTrackerRecHit * p = new FastMatchedTrackerRecHit( * this); p->load(); return p;} | ||
|
||
size_t nIds() const { return 2;} | ||
int32_t id(size_t i = 0) const { return i==0 ? monoHit().id() : stereoHit().id(); } | ||
int32_t eventId(size_t i = 0) const { return i==0 ? monoHit().eventId() : stereoHit().eventId(); } | ||
|
||
size_t nSimTrackIds() const { return componentMono_.nSimTrackIds() + componentStereo_.nSimTrackIds();} ///< see addSimTrackId(int32_t simTrackId) | ||
int32_t simTrackId(size_t i) const { return i < componentMono_.nSimTrackIds() ? componentMono_.simTrackId(i) : componentStereo_.simTrackId(i-componentMono_.nSimTrackIds()); } | ||
int32_t simTrackEventId(size_t i) const { return i < componentMono_.nSimTrackIds() ? componentMono_.simTrackEventId(i) : componentStereo_.simTrackEventId(i-componentMono_.nSimTrackIds()); } | ||
|
||
const FastSingleTrackerRecHit & monoHit() const { return componentMono_;} | ||
const FastSingleTrackerRecHit & stereoHit() const { return componentStereo_;} | ||
const FastSingleTrackerRecHit & firstHit() const { return stereoHitFirst_ ? componentStereo_ : componentMono_;} | ||
const FastSingleTrackerRecHit & secondHit() const { return stereoHitFirst_ ? componentMono_ : componentStereo_;} | ||
|
||
|
||
void setStereoLayerFirst(bool stereoHitFirst = true){stereoHitFirst_ = stereoHitFirst;} | ||
void setEventId(int32_t eventId){componentMono_.setEventId(eventId);componentStereo_.setEventId(eventId);} | ||
|
||
void setRecHitCombinationIndex(int32_t recHitCombinationIndex) { | ||
FastTrackerRecHit::setRecHitCombinationIndex(recHitCombinationIndex); | ||
componentMono_.setRecHitCombinationIndex(recHitCombinationIndex); | ||
componentStereo_.setRecHitCombinationIndex(recHitCombinationIndex); | ||
} | ||
|
||
private: | ||
|
||
bool stereoHitFirst_; | ||
FastSingleTrackerRecHit componentMono_; | ||
FastSingleTrackerRecHit componentStereo_; | ||
}; | ||
|
||
#endif |
49 changes: 49 additions & 0 deletions
49
DataFormats/TrackerRecHit2D/interface/FastProjectedTrackerRecHit.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#ifndef FastProjectedTrackerRecHit_H | ||
#define FastProjectedTrackerRecHit_H | ||
|
||
#include "DataFormats/TrackerRecHit2D/interface/FastTrackerRecHit.h" | ||
#include "DataFormats/TrackerRecHit2D/interface/FastSingleTrackerRecHit.h" | ||
#include "DataFormats/TrackerRecHit2D/interface/ProjectedSiStripRecHit2D.h" | ||
|
||
class FastProjectedTrackerRecHit : public FastTrackerRecHit { | ||
|
||
public : | ||
|
||
FastProjectedTrackerRecHit() {}; | ||
|
||
~FastProjectedTrackerRecHit() {}; | ||
|
||
FastProjectedTrackerRecHit( const LocalPoint& pos, | ||
const LocalError& err, | ||
GeomDet const & idet, | ||
FastSingleTrackerRecHit const & originalHit) | ||
: FastTrackerRecHit(pos, err, idet, | ||
ProjectedSiStripRecHit2D::isMono(idet,*originalHit.det()) | ||
? fastTrackerRecHitType::siStripProjectedMono2D | ||
: fastTrackerRecHitType::siStripProjectedStereo2D ) | ||
, originalHit_(originalHit) | ||
{} | ||
|
||
const FastSingleTrackerRecHit & originalHit() const {return originalHit_;} | ||
virtual FastProjectedTrackerRecHit * clone() const {FastProjectedTrackerRecHit * p = new FastProjectedTrackerRecHit( * this); p->load(); return p;} | ||
size_t nIds() const { return 1;} | ||
int32_t id(size_t i = 0) const { return originalHit().id(i);} | ||
int32_t eventId(size_t i = 0) const { return originalHit().eventId(i);} | ||
size_t nSimTrackIds() const { return originalHit_.nSimTrackIds();} ///< see addSimTrackId(int32_t simTrackId) | ||
int32_t simTrackId(size_t i) const { return originalHit_.simTrackId(i);} ///< see addSimTrackId(int32_t simTrackId) | ||
int32_t simTrackEventId(size_t i) const { return originalHit_.simTrackEventId(i);;} ///< see addSimTrackId(int32_t simTrackId) | ||
|
||
void setEventId(int32_t eventId){originalHit_.setEventId(eventId);} | ||
|
||
void setRecHitCombinationIndex(int32_t recHitCombinationIndex) { | ||
FastTrackerRecHit::setRecHitCombinationIndex(recHitCombinationIndex); | ||
originalHit_.setRecHitCombinationIndex(recHitCombinationIndex); | ||
} | ||
|
||
private: | ||
|
||
FastSingleTrackerRecHit originalHit_; | ||
|
||
}; | ||
|
||
#endif |
56 changes: 56 additions & 0 deletions
56
DataFormats/TrackerRecHit2D/interface/FastSingleTrackerRecHit.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#ifndef FastSingleTrackerRecHit_H | ||
#define FastSingleTrackerRecHit_H | ||
|
||
#include "DataFormats/TrackerRecHit2D/interface/FastTrackerRecHit.h" | ||
#include "stdint.h" | ||
|
||
class FastSingleTrackerRecHit : public FastTrackerRecHit { | ||
|
||
public: | ||
|
||
FastSingleTrackerRecHit () | ||
: FastTrackerRecHit() | ||
, id_(-1) | ||
, eventId_(0) {} | ||
|
||
|
||
FastSingleTrackerRecHit (const LocalPoint& p, const LocalError&e, GeomDet const & idet,fastTrackerRecHitType::HitType hitType) | ||
: FastTrackerRecHit(p,e,idet,hitType) | ||
, id_(-1) | ||
, eventId_(0) {} | ||
|
||
public: | ||
|
||
virtual FastSingleTrackerRecHit * clone() const GCC11_OVERRIDE {FastSingleTrackerRecHit * p = new FastSingleTrackerRecHit( * this); p->load(); return p;} | ||
|
||
size_t nIds() const { return 1;} | ||
int32_t id(size_t i =0) const { return i == 0 ? id_ : -1;} | ||
int32_t eventId(size_t i = 0) const { return i == 0 ? eventId_ : -1;} | ||
size_t nSimTrackIds() const { return simTrackIds_.size();} ///< see addSimTrackId(int32_t simTrackId) | ||
int32_t simTrackId(size_t i) const { return i < simTrackIds_.size() ? simTrackIds_[i] : -1;} ///< see addSimTrackId(int32_t simTrackId) | ||
int32_t simTrackEventId(size_t i) const { return i < simTrackIds_.size() ? eventId_ : -1;} ///< see addSimTrackId(int32_t simTrackId) | ||
|
||
|
||
/// add an id number to the list of id numbers of SimTracks from which the hit originates | ||
/// the SimTrack id numbers are the indices of the SimTracks in the SimTrack collection | ||
void addSimTrackId(int32_t simTrackId) {simTrackIds_.push_back(simTrackId);} | ||
|
||
/// set the hit id number | ||
/// for any particular hit in any particular event, | ||
// the hit id number must be unique within the list of hits in the event | ||
void setId(int32_t id) {id_ = id;} | ||
|
||
/// set the hit's event number | ||
/// there is in principle no reason to play with this variable outside the PU mixing modules | ||
/// see Adjuster::doTheOffset(int bunchSpace, int bcr, TrackingRecHitCollection & trackingrechits, unsigned int evtNr, int vertexOffset) | ||
void setEventId(int32_t eventId) {eventId_ = eventId;} | ||
|
||
private: | ||
|
||
int32_t id_; ///< see setId(int32_t id) | ||
int32_t eventId_; ///< see setEeId(int32_t eeid) | ||
std::vector<int32_t> simTrackIds_; ///< see addSimTrackIds(int32_t) | ||
|
||
}; | ||
|
||
#endif |
Oops, something went wrong.