137{
138 std::map<SimBarCode,SimHitList>::iterator itHitList;
139
140 theclass->message(
"Entered addHitCollections " + QString(
typeid(collT).
name()));
141 VP1SGAccessHelper sgaccess(
theclass->systemBase());
142
143 for (
const QString& key : VP1SGContentsHelper(
theclass->systemBase()).getKeys<collT>()) {
144 const collT * hitColl;
145 theclass->message(
"Try to retrieve "+QString(
typeid(collT).
name())+
" collection with key = "+key);
146 if (!sgaccess.retrieve(hitColl, key)) {
147 theclass->message(
"Error: Could not retrieve "+QString(
typeid(collT).
name())+
" collection with key = "+key);
148 continue;
149 }
150 theclass->messageVerbose(
"Retrieved hit collection of type "+QString(
typeid(collT).
name())+
" with key = "+key);
151 typename collT::const_iterator
it,
itE(hitColl->end());
152 int itot(0), iadded(0);
153 for (it=hitColl->begin();it!=itE;++it) {
154 ++itot;
161 continue;
162 }
163
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;
169 } else {
170 itHitList->second.emplace_back(handle->
hitTime(),handle);
171 }
172 ++iadded;
173 }
174 theclass->messageVerbose(
" => used "+
str(iadded)+
" of "+
str(itot)+
" hits");
175 }
176
177}
std::vector< std::pair< double, SimHitHandleBase * > > SimHitList
virtual double hitTime() const =0
SimBarCode simBarCode() const
const QString & name() const
static const int maxPdgCode
TrackCollHandle_SimulationTracks * theclass
static SimHitHandleBase * createHitHandle(const SimulationHit &h)
l
Printing final latex table to .tex output file.