38 #include "CLHEP/Units/PhysicalConstants.h"
40 #include "CLHEP/Vector/LorentzVector.h"
42 #include <QStringList>
52 bool loadHitLists(std::map<SimBarCode,SimHitList> & hitLists);
54 template <
class collT>
135 template <
class collT>
144 const collT * hitColl;
147 theclass->
message(
"Error: Could not retrieve "+QString(
typeid(collT).
name())+
" collection with key = "+
key);
151 typename collT::const_iterator
it,
itE(hitColl->end());
152 int itot(0), iadded(0);
164 itHitList = hitLists.find(trackID);
165 if ( itHitList == hitLists.end() ) {
167 l.push_back(std::pair<double,SimHitHandleBase*>(handle->
hitTime(),handle));
168 hitLists[trackID] =
l;
170 itHitList->second.emplace_back(handle->
hitTime(),handle);
183 theclass->messageVerbose(
"Searching " +
str( hitLists.size() ) +
" lists of sim. hits.");
184 addHitCollections<SimulationHitCollection>(hitLists);
187 theclass->messageVerbose(
"Found " +
str( hitLists.size() ) +
" lists of sim. hits.");
191 for (
it = hitLists.begin();
it!=
itE; ++
it) {
192 if (
it->first.unknownPdgCode())
199 for (;itHit!=itHitE;++itHit)
200 itHit->second->setCharge(
charge);
205 for (
it = hitLists.begin();
it!=
itE; ++
it) {
206 sort(
it->second.begin(),
it->second.end());
218 std::map<SimBarCode,SimHitList> hitLists;
222 +
": Found "+
str(hitLists.size())+
" truth particles from simhits");
229 for (itHitList = hitLists.begin();itHitList!=itHitListEnd;++itHitList) {
230 if (itHitList->second.empty()) {
231 message(
"load WARNING: Ignoring empty hit list.");
252 std::map<SimBarCode::ExtBarCode,int>::const_iterator
it =
m_d->
extBarCode2pdg.find(extBarCode);
257 if (isNonUniqueSecondary)
259 std::map<SimBarCode::ExtBarCode,int>::const_iterator
it =
m_d->
extBarCode2pdg.find(extBarCode);
310 theclass->message(
"updateVisibleAssociatedObjects");
311 theclass->largeChangesBegin();
312 theclass->trackHandleIterationBegin();
317 theclass->largeChangesEnd();