|
ATLAS Offline Software
|
|
bool | loadHitLists (std::map< SimBarCode, SimHitList > &hitLists) |
|
void | loadGenParticles (std::map< SimBarCode, HepMC::ConstGenParticlePtr > &genParticles, const HepMC::ConstGenVertexPtr &vtx) |
|
bool | loadGenParticles (std::map< SimBarCode, HepMC::ConstGenParticlePtr > &genParticles, const QString &hepMcCollKey) |
|
template<class collT > |
void | addHitCollections (std::map< SimBarCode, SimHitList > &hitLists) |
|
void | createSecondaryHitLists (const SimBarCode &origSimBarCode, const SimHitList &origHitList, std::map< SimBarCode, SimHitList > &outlists, int &newBarCode) |
|
std::list< SimHitHandleBase * >::iterator | closestCompatibleHandleItr (SimHitHandleBase *handle, const std::list< SimHitHandleBase * >::iterator &itFirst, std::list< SimHitHandleBase * > &handleList, const double &massSquared) const |
|
void | possiblyUpdateGUI () |
|
void | updateVisibleAssociatedObjects () const |
|
bool | fixMomentumInfoInSimHits (HepMC::ConstGenParticlePtr p, SimHitList &hitlist) const |
|
◆ addHitCollections()
template<class collT >
void TrackCollHandle_TruthTracks::Imp::addHitCollections |
( |
std::map< SimBarCode, SimHitList > & |
hitLists | ) |
|
Definition at line 206 of file TrackCollHandle_TruthTracks.cxx.
213 const collT * hitColl;
214 if (!sgaccess.retrieve(hitColl,
key)) {
215 theclass->
message(
"Error: Could not retrieve "+QString(
typeid(collT).
name())+
" collection with key = "+
key);
219 typename collT::const_iterator
it,
itE(hitColl->end());
220 int itot(0), iadded(0);
240 itHitList = hitLists.find(trackID);
241 if ( itHitList == hitLists.end() ) {
243 l.push_back(std::pair<double,SimHitHandleBase*>(handle->
hitTime(),handle));
244 hitLists[trackID] =
l;
246 itHitList->second.emplace_back(handle->
hitTime(),handle);
◆ closestCompatibleHandleItr()
Definition at line 640 of file TrackCollHandle_TruthTracks.cxx.
647 const double momSq =
mom*
mom;
648 const double betaSqMax = ( (
mom < 0 || massSquared<=0 ? 1 : (momSq/(momSq+massSquared)) ));
655 unsigned ichecked(0);
656 unsigned maxchecked(50);
660 double mom2, flightTime;
676 mom2 = (*it)->momentum();
678 if (
mom>=0&&mom2>=0) {
686 const double distSquared = ((*it)->posStart()-
pos).
mag2();
689 if (distSquared>=minDistSq)
692 flightTime = (*it)->hitTime() -
hitTime;
693 if (flightTime<=0||flightTime>100*
CLHEP::ns) {
699 if (distSquared>flightTime*flightTime*speedSqMax)
705 double mindotproduct = -0.5;
707 mindotproduct = -0.1;
711 mindotproduct = 0.80;
715 if (mindotproduct>-1.0)
732 minDistSq = distSquared;
738 maxchecked = ichecked + 5;
740 maxchecked = ichecked + 15;
743 if (ichecked>maxchecked)
◆ createHitHandle() [1/3]
◆ createHitHandle() [2/3]
◆ createHitHandle() [3/3]
◆ createSecondaryHitLists()
Definition at line 539 of file TrackCollHandle_TruthTracks.cxx.
546 " ERROR: Unexpected input");
550 unsigned ntothitinput = origHitList.size();
552 int pdgCode = origSimBarCode.
pdgCode();
558 SimHitList::const_iterator itOrig(origHitList.begin()),itOrigE(origHitList.end());
559 std::list<SimHitHandleBase*> handleList;
560 for(;itOrig!=itOrigE;++itOrig)
561 handleList.push_back(itOrig->second);
567 std::set<std::list<SimHitHandleBase*> > outHandleLists;
572 while (!handleList.empty()) {
573 std::list<SimHitHandleBase*>
list;
577 list.push_back(handle);
579 handleList.erase(itTemp);
581 if (
it==handleList.end())
585 if (itNext == handleList.end())
588 list.push_back(handle);
590 handleList.erase(itNext);
591 if (
it == handleList.end())
594 if (
list.size()==1) {
600 outHandleLists.insert(
list);
613 std::set<std::list<SimHitHandleBase*> >
::iterator itOutList(outHandleLists.begin()), itOutListE(outHandleLists.end());
615 for (;itOutList!=itOutListE;++itOutList) {
616 const SimBarCode fakeBarCode(newBarCode--,evtIndex,pdgCode);
618 const unsigned n = itOutList->size();
622 itActualOutList->second.reserve(
n);
624 std::list<SimHitHandleBase*>::const_iterator itHandle(itOutList->begin()),itHandleE(itOutList->end());
625 for (;itHandle!=itHandleE;++itHandle)
626 itActualOutList->second.emplace_back((*itHandle)->hitTime(),*itHandle);
629 sort(itActualOutList->second.begin(),itActualOutList->second.end());
634 +
str(pdgCode)+
" into "+
str(outHandleLists.size())
635 +
" tracks ("+
str(ntothitinput-totused)+
" went unused).");
◆ fixMomentumInfoInSimHits()
Definition at line 751 of file TrackCollHandle_TruthTracks.cxx.
758 static double unknown = -1.0e99;
773 bool sawhitwithoutmominfo(
false);
777 const bool hasinfo =
it->second->momentum()>=0.0;
779 sawhitwithmominfo =
true;
781 sawhitwithoutmominfo =
true;
782 if (sawhitwithoutmominfo&&sawhitwithmominfo)
786 if (!sawhitwithoutmominfo) {
790 if (!sawhitwithmominfo) {
815 if (hitlist.at(0).second->momentum()<0.0) {
818 if (
it->second->momentum()>=0.0) {
819 hitlist.at(0).second->setFakeMomentum(
it->second->momentum()*1.00001);
823 if (hitlist.at(0).second->momentum()<0.0) {
829 mom = hitlist.at(0).second->momentum();
830 time = hitlist.at(0).second->hitTime();
838 unsigned ilast = hitlist.size()-1;
839 if (hitlist.at(ilast).second->momentum()<0.0) {
840 for (
int iLastWithMom = ilast-1;iLastWithMom>=0;--iLastWithMom) {
841 if (hitlist.at(iLastWithMom).second->momentum()>0.0) {
842 hitlist.at(ilast).second->setFakeMomentum(hitlist.at(iLastWithMom).second->momentum()*0.99999);
846 if (hitlist.at(ilast).second->momentum()<0.0) {
853 hitlist.at(ilast).second->setFakeMomentum(
mom*0.99999);
860 mom = hitlist.at(0).second->momentum();
861 time = hitlist.at(0).second->hitTime();
864 unsigned iNextWithMom(0);
865 for (
unsigned i = 0;
i < hitlist.size(); ++
i) {
866 if (hitlist.at(
i).second->momentum()>=0.0) {
867 mom = hitlist.at(
i).second->momentum();
868 time = hitlist.at(
i).second->hitTime();
871 if (iNextWithMom<=
i) {
872 for (
unsigned j =
i+1;j<hitlist.size();++j) {
873 if (hitlist.at(j).second->momentum()>=0.0) {
878 if (iNextWithMom<=
i) {
885 double time2 = hitlist.at(iNextWithMom).second->hitTime();
886 double mom2 = hitlist.at(iNextWithMom).second->momentum();
887 double t = hitlist.at(
i).second->hitTime();
890 if (t<=time||t>=time2||time2<=
time)
896 hitlist.at(
i).second->setFakeMomentum(
mom);
◆ loadGenParticles() [1/2]
Definition at line 320 of file TrackCollHandle_TruthTracks.cxx.
325 for (
const auto&
p: *vtx){
329 const HepMC::GenEvent*
evt =
p->parent_event();
334 genParticles[simBarCode] =
p;
335 if (!simBarCode.isNonUniqueSecondary())
◆ loadGenParticles() [2/2]
Definition at line 343 of file TrackCollHandle_TruthTracks.cxx.
357 for (;itEvt!=itEvtEnd;++itEvt) {
359 const HepMC::GenEvent *
evt = *itEvt;
365 HepMC::GenEvent::vertex_const_iterator itVtx(
evt->vertices_begin()), itVtxEnd(
evt->vertices_end());
366 for(;itVtx!=itVtxEnd;++itVtx) {
◆ loadHitLists()
bool TrackCollHandle_TruthTracks::Imp::loadHitLists |
( |
std::map< SimBarCode, SimHitList > & |
hitLists | ) |
|
Definition at line 256 of file TrackCollHandle_TruthTracks.cxx.
259 addHitCollections<TrackRecordCollection>(hitLists);
263 addHitCollections<TRTUncompressedHitCollection>(hitLists);
266 addHitCollections<SiHitCollection>(hitLists);
273 for (
it = hitLists.begin();
it!=
itE; ++
it) {
274 if (
it->first.unknownPdgCode())
281 for (;itHit!=itHitE;++itHit)
282 itHit->second->setCharge(
charge);
289 for (
it = hitLists.begin();
it!=
itE; ++
it) {
290 sort(
it->second.begin(),
it->second.end());
◆ mag()
static double TrackCollHandle_TruthTracks::Imp::mag |
( |
const HepMC::FourVector & |
v | ) |
|
|
inlinestatic |
◆ possiblyUpdateGUI()
void TrackCollHandle_TruthTracks::Imp::possiblyUpdateGUI |
( |
| ) |
|
|
inline |
◆ updateVisibleAssociatedObjects()
void TrackCollHandle_TruthTracks::Imp::updateVisibleAssociatedObjects |
( |
| ) |
const |
◆ cut_excludeBarcodeZero
bool TrackCollHandle_TruthTracks::Imp::cut_excludeBarcodeZero = false |
◆ cut_excludeNeutrals
bool TrackCollHandle_TruthTracks::Imp::cut_excludeNeutrals = false |
◆ cut_fromIROnly
bool TrackCollHandle_TruthTracks::Imp::cut_fromIROnly = false |
◆ displayAscObjs
bool TrackCollHandle_TruthTracks::Imp::displayAscObjs = false |
◆ extBarCode2pdg
◆ maxPdgCode
const int TrackCollHandle_TruthTracks::Imp::maxPdgCode = 1000000000 |
|
static |
◆ nameAugmentedOnly
QString TrackCollHandle_TruthTracks::Imp::nameAugmentedOnly = "Sim hits/trk rec." |
|
static |
◆ nameHepMCAugmentedEnd
QString TrackCollHandle_TruthTracks::Imp::nameHepMCAugmentedEnd = " [augmented]" |
|
static |
◆ theclass
◆ updateGUICounter
int TrackCollHandle_TruthTracks::Imp::updateGUICounter = 0 |
The documentation for this class was generated from the following file:
JetConstituentVector::iterator iterator
bool isNonUniqueSecondary() const
Const iterator class for DataVector/DataList.
SimBarCode simBarCode() const
std::map< SimBarCode::ExtBarCode, int > extBarCode2pdg
void messageVerbose(const QString &) const
virtual void largeChangesBegin()
std::vector< std::pair< double, SimHitHandleBase * > > SimHitList
static QString str(const QString &s)
void messageDebug(const QString &) const
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
virtual Amg::Vector3D momentumDirection() const =0
void fixPDGCode(SimHitHandleBase *) const
QStringList getKeys() const
virtual Amg::Vector3D posStart() const =0
static SimHitHandleBase * createHitHandle(const TrackRecord &h)
static const int maxPdgCode
void loadGenParticles(std::map< SimBarCode, HepMC::ConstGenParticlePtr > &genParticles, const HepMC::ConstGenVertexPtr &vtx)
static double mag(const HepMC::FourVector &v)
static bool hasSCTGeometry()
static double particleCharge(const int &pdgcode, bool &ok)
virtual double hitTime() const =0
This defines the McEventCollection, which is really just an ObjectVector of McEvent objects.
TrackCollHandle_TruthTracks * theclass
static bool hasTRTGeometry()
bool retrieve(const T *&, const QString &key) const
void setAscObjsVisible(bool)
IVP1System * systemBase() const
double charge(const T &p)
std::list< SimHitHandleBase * >::iterator closestCompatibleHandleItr(SimHitHandleBase *handle, const std::list< SimHitHandleBase * >::iterator &itFirst, std::list< SimHitHandleBase * > &handleList, const double &massSquared) const
Eigen::Matrix< double, 3, 1 > Vector3D
void trackHandleIterationBegin()
virtual void largeChangesEnd()
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
def time(flags, cells_name, *args, **kw)
static double particleMass(const int &pdgcode, bool &ok)
void message(const QString &) const
const HepMC::GenVertex * ConstGenVertexPtr
static bool hasPixelGeometry()
float hitTime(const AFP_SIDSimHit &hit)
TrackHandleBase * getNextTrackHandle()
Scalar mag2() const
mag2 method - forward to squaredNorm()
HepMcParticleLink::index_type evtIndex() const
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.