106 QWidget* controller =
new QWidget(0);
107 Ui::SimHitControllerForm ui;
108 ui.setupUi(controller);
121 m_clockwork->checkBoxNamesMap.insert(ui.chbxITkPixelHits,
"ITkPixel");
122 m_clockwork->checkBoxNamesMap.insert(ui.chbxITkStripHits,
"ITkStrip");
124 m_clockwork->checkBoxNamesMap.insert(ui.chbxPixelHits,
"Pixel");
125 m_clockwork->checkBoxNamesMap.insert(ui.chbxSCTHits,
"SCT");
126 m_clockwork->checkBoxNamesMap.insert(ui.chbxTRTHits,
"TRT");
129 m_clockwork->checkBoxNamesMap.insert(ui.chbxHGTDHits,
"HGTD");
131 m_clockwork->checkBoxNamesMap.insert(ui.chbxMDTHits,
"MDT");
132 m_clockwork->checkBoxNamesMap.insert(ui.chbxRPCHits,
"RPC");
133 m_clockwork->checkBoxNamesMap.insert(ui.chbxTGCHits,
"TGC");
134 m_clockwork->checkBoxNamesMap.insert(ui.chbxCSCHits,
"CSC");
135 m_clockwork->checkBoxNamesMap.insert(ui.chbxMMHits,
"MM");
136 m_clockwork->checkBoxNamesMap.insert(ui.chbxsTGCHits,
"sTGC");
137 m_clockwork->checkBoxNamesMap.insert(ui.chbxLArEMBHits,
"LArEMB");
138 m_clockwork->checkBoxNamesMap.insert(ui.chbxLArEMECHits,
"LArEMEC");
139 m_clockwork->checkBoxNamesMap.insert(ui.chbxLArFCALHits,
"LArFCAL");
140 m_clockwork->checkBoxNamesMap.insert(ui.chbxLArHECHits,
"LArHEC");
141 m_clockwork->checkBoxNamesMap.insert(ui.chbxTileHits,
"Tile");
142 m_clockwork->checkBoxNamesMap.insert(ui.chbxGenericMuonHits,
"Generic Muon");
143 m_clockwork->checkBoxNamesMap.insert(ui.chbxForwardRegionHits,
"Forward Region");
146 for(QCheckBox* cb :
m_clockwork->checkBoxNamesMap.keys())
295 if(
m_clockwork->hitsThisEvent.contains(detector)) {
308 unsigned int hitCount = 0;
310 SoVertexProperty* hitVtxProperty =
new SoVertexProperty();
311 SoPointSet* hitPointSet =
new SoPointSet();
313 hitVtxProperty->enableNotify(FALSE);
314 hitPointSet->enableNotify(FALSE);
317 SoMaterial* material =
new SoMaterial();
318 material->diffuseColor.setValue(
m_clockwork->colorMap[detector]);
320 sw->addChild(material);
323 if(detector==
"ITkPixel")
327 else if(detector==
"ITkStrip")
331 else if(detector==
"Pixel")
335 else if(detector==
"SCT")
339 else if(detector==
"TRT")
345 if(sg->
retrieve(t_collection,
"TRTUncompressedHits")==StatusCode::SUCCESS)
352 hitVtxProperty->vertex.set1Value(hitCount++,u.x(),u.y(),u.z());
356 message(
"Unable to retrieve TRT Hits");
358 else if(detector==
"HGTD")
364 if(sg->
retrieve(p_collection,
"HGTD_Hits")==StatusCode::SUCCESS)
366 for (
const SiHit& hit : *p_collection)
371 hitVtxProperty->vertex.set1Value(hitCount++,u.x(),u.y(),u.z());
375 message(
"Unable to retrieve HGTD Hits");
377 else if(detector==
"LArEMB" || detector==
"LArEMEC" || detector==
"LArFCAL" || detector==
"LArHEC" )
387 std::string collName{
"LArHit"};
388 std::string suff{
""};
390 if (detector==
"LArEMB")
392 else if (detector==
"LArEMEC")
394 else if (detector==
"LArFCAL")
396 else if (detector==
"LArHEC")
400 if(sg->
retrieve(lar_collection, collName)==StatusCode::SUCCESS)
402 for (
auto hi : *lar_collection ) {
404 const LArHit* larHit = hi;
409 message(
"Unable to retrieve the CaloDetDescrElement!");
413 message(
"Unable to retrieve " + QString::fromStdString(collName) );
415 else if(detector==
"Tile")
425 if(sg->
retrieve(t_collection,
"TileHitVec")==StatusCode::SUCCESS)
427 for (
const TileHit& hit : *t_collection) {
434 message(
"Unable to retrieve the CaloDetDescrElement!");
438 message(
"Unable to retrieve Tile Hits");
440 else if(detector==
"MDT")
446 if(sg->
retrieve(mdt_collection)==StatusCode::SUCCESS)
448 for (
const MDTSimHit& hit : *mdt_collection)
453 hitVtxProperty->vertex.set1Value(hitCount++,u.x(),u.y(),u.z());
457 message(
"Unable to retrieve MDT Hits");
459 else if(detector==
"RPC")
465 if(sg->
retrieve(rpc_collection)==StatusCode::SUCCESS) {
466 for (
const RPCSimHit& hit : *rpc_collection)
471 hitVtxProperty->vertex.set1Value(hitCount++,u.x(),u.y(),u.z());
475 message(
"Unable to retrieve RPC Hits");
477 else if(detector==
"TGC")
483 if (sg->
retrieve(tgc_collection)==StatusCode::SUCCESS)
485 for (
const TGCSimHit& hit : *tgc_collection)
490 hitVtxProperty->vertex.set1Value(hitCount++,u.x(),u.y(),u.z());
494 message(
"Unable to retrieve TGC Hits");
496 else if(detector==
"CSC")
502 if(sg->
retrieve(csc_collection)==StatusCode::SUCCESS)
504 for (
const CSCSimHit& hit : *csc_collection)
509 hitVtxProperty->vertex.set1Value(hitCount++,u.x(),u.y(),u.z());
513 message(
"Unable to retrieve CSC Hits");
515 else if(detector==
"MM")
521 if(sg->
retrieve(mm_collection)==StatusCode::SUCCESS)
523 for(
const MMSimHit& hit : *mm_collection )
528 hitVtxProperty->vertex.set1Value(hitCount++,u.x(),u.y(),u.z());
532 message(
"Unable to retrieve MM Hits");
534 else if(detector==
"sTGC")
540 if(sg->
retrieve(stgc_collection)==StatusCode::SUCCESS)
542 for(
const sTGCSimHit& hit : *stgc_collection )
547 hitVtxProperty->vertex.set1Value(hitCount++,u.x(),u.y(),u.z());
551 message(
"Unable to retrieve sTGC Hits");
553 else if(detector==
"Generic Muon")
558 message(
"Trying for Generic Muon (as many collections as can be found)");
559 for(
const QString& key :
VP1SGContentsHelper(
this).getKeys<GenericMuonSimHitCollection>()) {
561 if(sg->
retrieve( generic_collection,key.toStdString().c_str() )==StatusCode::SUCCESS)
564 std::cout<<
"Got collection with size: "<<generic_collection->
size()<<std::endl;
572 hitVtxProperty->vertex.set1Value(hitCount++,u.x(),u.y(),u.z());
576 message(
"Unable to retrieve Generic Muon Hits from "+key);
578 }
else if(detector==
"Forward Region")
583 message(
"Trying for ForwardRegion (as many collections as can be found)");
586 if(sg->
retrieve( generic_collection,key.toStdString().c_str() )==StatusCode::SUCCESS)
589 std::cout<<
"Got collection with size: "<<generic_collection->
size()<<std::endl;
597 hitVtxProperty->vertex.set1Value(hitCount++,u.x(),u.y(),u.z());
601 message(
"Unable to retrieve Simulation Hits from "+key);
608 hitPointSet->numPoints=hitCount;
609 hitPointSet->vertexProperty.setValue(hitVtxProperty);
610 sw->addChild(hitPointSet);
611 hitPointSet->enableNotify(TRUE);
612 hitVtxProperty->enableNotify(TRUE);