Skip to content

Commit c2dc425

Browse files
authored
Merge pull request #460 from sophiemiddleton/NewED
Tidying up Offline Event Display
2 parents 244a330 + beb2219 commit c2dc425

36 files changed

+521
-665
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#include "JobConfig/beam/beam_g4s1MT_phase1.fcl"
2+
3+
physics.producers.g4run.TrajectoryControl: @local::mu2eg4DefaultTrajectories
4+
physics.producers.g4run.TrajectoryControl: @local::mu2eg4DefaultTrajectories
5+
6+
outputs.mubeamout.outputCommands: [
7+
@sequence::outputs.mubeamout.outputCommands,
8+
"keep mu2e::SimParticleart::Ptrmu2e::MCTrajectorystd::map_*_*_*" ]
9+
10+
outputs.dsout.outputCommands: [
11+
@sequence::outputs.dsout.outputCommands,
12+
"keep mu2e::SimParticleart::Ptrmu2e::MCTrajectorystd::map_*_*_*" ]

TEveEventDisplay/CallerFclExamples/cosmicExample.fcl

Lines changed: 0 additions & 50 deletions
This file was deleted.

TEveEventDisplay/CallerFclExamples/cosmictracks.fcl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#include "TrkHitReco/fcl/prolog.fcl"
99
#include "CosmicReco/fcl/prolog.fcl"
1010
#include "TEveEventDisplay/fcl/prolog.fcl"
11-
#include "JobConfig/reco/mcdigis_nocosmic.fcl"
11+
//#include "JobConfig/reco/mcdigis_nocosmic.fcl"
1212

1313
source : { module_type : RootInput}
1414

@@ -33,7 +33,7 @@ physics :
3333
}
3434
filters : {
3535
@table::CosmicTracking.filters
36-
@table::TEveDis.filters
36+
3737
}
3838
}
3939

TEveEventDisplay/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,4 +95,6 @@ In order to add Data Products to the Event Display you may need to add an additi
9595

9696
## Authors
9797

98-
This code is built upon the Mu2e Offline code however TEveEventDisplay is package developed within Mu2e Offline by Sophie Middleton with help from Aditi Venkatesh both from Caltech. If you have any questions/comments about TEveEventDisplay please contact: [email protected].
98+
This code is built upon the Mu2e Offline code however TEveEventDisplay is package developed within Mu2e Offline by Sophie Middleton with help from: Aditi Venkatesh both from Caltech (2020) and Namitha Chithirasee from Pisa (2021).
99+
100+
If you have any questions/comments about TEveEventDisplay please contact: [email protected].

TEveEventDisplay/fcl/prolog.fcl

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ TEveEventDisplayBase : {
1515
showBuilding : false
1616
showDSOnly : true
1717
showEvent : true
18+
isMCOnly : false
1819
filler : {
1920
ComboHitCollection : "makeSH"
2021
CrvRecoPulseCollection : "CrvRecoPulses"
@@ -34,20 +35,22 @@ TEveEventDisplayBase : {
3435
addMCTraj : true
3536

3637
}
38+
particles : [11,13,2212,2112,211,22,212]
3739
}
3840

3941
TEveEventDisplayUpstream : {
4042
module_type : TEveEventDisplay
4143
showCRV : false
4244
showDSOnly : false
45+
isMCOnly : true
4346
accumulate : false
4447
filler : {
4548
ComboHitCollection : NULL
4649
CosmicTrackSeedCollection : NULL
4750
CrvRecoPulseCollection : NULL
4851
CaloClusterCollection : NULL
4952
CaloHitCollection : NULL
50-
MCTrajectoryCollection : "g4run"
53+
MCTrajectoryCollection : "BeamFilter" #"g4run"
5154
HelixSeedCollection : NULL
5255
KalSeedCollection : [NULL]
5356
TrkExtTrajCollection : NULL
@@ -57,6 +60,8 @@ TEveEventDisplayUpstream : {
5760
addCosmicSeedFit : false
5861
addMCTraj : true
5962
}
63+
particles : [11,13,2212,2112,211,22,212]
64+
6065
}
6166

6267
TEveEventDisplayHelix : {
@@ -66,6 +71,7 @@ TEveEventDisplayHelix : {
6671
showBuilding : false
6772
showDSOnly : true
6873
showEvent : true
74+
isMCOnly : false
6975
filler : {
7076
ComboHitCollection : "makeSH"
7177
CrvRecoPulseCollection : NULL
@@ -84,6 +90,7 @@ TEveEventDisplayHelix : {
8490
addTrkExtTrajs : false
8591
addMCTraj : true
8692
}
93+
particles : [11,13,2212,2112,211,22,212]
8794
}
8895

8996
TEveEventDisplayCosmics : {
@@ -96,17 +103,18 @@ TEveEventDisplayCosmics : {
96103
CaloClusterCollection : NULL
97104
CaloHitCollection : NULL
98105
HelixSeedCollection : NULL
99-
KalSeedCollection : NULL
106+
KalSeedCollection : []
100107
TrkExtTrajCollection : NULL
101108
MCTrajectoryCollection : "compressDigiMCs"
102109
addHits : true
103110
addTracks : true
104-
addCrvHits : true
111+
addCrvHits : false
105112
addCosmicSeedFit : false
106113
addClusters : false
107114
addTrkExtTrajs : false
108-
addMCTraj : true
115+
addMCTraj : false
109116
}
117+
particles : [11,13,2212,2112,211,22,212]
110118
}
111119

112120

TEveEventDisplay/src/Collection_Filler.cc

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
#include <TObject.h>
2-
#include <TSystem.h>
3-
#include <TFile.h>
4-
#include "TEveEventDisplay/src/dict_classes/Collection_Filler.h"
5-
#include "art/Framework/Principal/SubRun.h"
61

2+
#include "TEveEventDisplay/src/dict_classes/Collection_Filler.h"
73
using namespace mu2e;
84
namespace mu2e{
95

@@ -29,15 +25,17 @@ namespace mu2e{
2925
{}
3026

3127

32-
28+
/*------------Function to turn InputTag to string for track labels:-------------*/
3329
template <typename T>
3430
std::string TurnNameToString( const T& value )
3531
{
3632
std::ostringstream ss;
3733
ss << value;
3834
return ss.str();
3935
}
40-
36+
37+
38+
/*------------Function to fill RecoDataProduct lists:-------------*/
4139
void Collection_Filler::FillRecoCollections(const art::Event& evt, Data_Collections &data, RecoDataProductName CollectionName){
4240
if(FillAll_ or RecoOnly_ or (addHits_ and CollectionName == ComboHits)){
4341
auto chH = evt.getValidHandle<mu2e::ComboHitCollection>(chTag_);
@@ -67,7 +65,7 @@ namespace mu2e{
6765
data.track_list.push_back(data.kalseedcol);
6866

6967
std::string name = TurnNameToString(tag);
70-
std::cout<<"adding "<<name<<" size "<<data.track_list.size()<<std::endl;
68+
std::cout<<"Plotting KalSeed Instance: "<<name<<std::endl;
7169
data.track_labels.push_back(name);
7270

7371
}
@@ -83,10 +81,9 @@ namespace mu2e{
8381
}
8482
}
8583

86-
84+
/*------------Function to fill MCDataProduct lists:-------------*/
8785
void Collection_Filler::FillMCCollections(const art::Event& evt, Data_Collections &data, MCDataProductName CollectionName){
8886
if(FillAll_ or MCOnly_ or (addMCTraj_ and CollectionName == MCTrajectories)){
89-
std::cout<<" Filling MC Traj "<<std::endl;
9087
auto chH = evt.getValidHandle<mu2e::MCTrajectoryCollection>(mctrajTag_);
9188
data.mctrajcol = chH.product();
9289
}

TEveEventDisplay/src/Geom_Interface.cc

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,4 @@
1-
#include <TObject.h>
2-
#include <TSystem.h>
3-
// ... libRIO
4-
#include <TFile.h>
5-
#include "art/Framework/Principal/Event.h"
6-
#include "art/Framework/Principal/Run.h"
7-
//Geom:
8-
#include "GeometryService/inc/GeomHandle.hh"
9-
#include "GeometryService/inc/DetectorSystem.hh"
10-
#include "GeometryService/inc/WorldG4.hh"
11-
#include "GeometryService/inc/WorldG4Maker.hh"
12-
#include "GeometryService/inc/TrackerMaker.hh"
13-
#include "GeometryService/inc/Mu2eHallMaker.hh"
14-
#include "GeometryService/inc/G4GeometryOptions.hh"
15-
//Mu2e Tracker Geom:
16-
#include "TrackerGeom/inc/Tracker.hh"
17-
#include "GeometryService/inc/Mu2eCoordTransform.hh"
18-
#include "BFieldGeom/inc/BFieldManager.hh"
19-
#include "Mu2eUtilities/inc/SimParticleTimeOffset.hh"
20-
#include "TrkDiag/inc/TrkMCTools.hh"
21-
//TEve
1+
222
#include "TEveEventDisplay/src/dict_classes/Geom_Interface.h"
233

244
using namespace mu2e;
@@ -95,7 +75,6 @@ namespace mu2e{
9575
static std::vector <std::string> substrings { "Ceiling",
9676
"backfill", "dirt", "concrete", "VirtualDetector",
9777
"pipeType","ExtShield", "PSShield"};
98-
//,"CRSAluminium","CRV","CRS",
9978
for(auto& i: substrings) hideNodesByName(node,i,kFALSE, 0);
10079
static std::vector <std::string> materials { "MBOverburden", "CONCRETE"};
10180
for(auto& i: materials) hideNodesByMaterial(node,i,kFALSE);
@@ -129,10 +108,11 @@ namespace mu2e{
129108
}
130109
}
131110

111+
//Useful function to extract heirarchy of tracker (not used anywhere)
132112
void Geom_Interface::TrackerVolumeHeirarchy( TGeoNode * node, std::vector<CLHEP::Hep3Vector> &TransformList ){
133113
std::string _name = (node->GetVolume()->GetName());
134114
if( _name == "HallAir") {
135-
cout<<"HallAir Origin IS "<<node->GetMotherVolume()->GetName();
115+
std::cout<<"HallAir Origin IS "<<node->GetMotherVolume()->GetName();
136116
TGeoVolume *vol = node->GetVolume();
137117
TGeoBBox *shape = (TGeoBBox*)vol->GetShape();
138118
Double_t master[3];
@@ -144,7 +124,7 @@ namespace mu2e{
144124
}
145125
}
146126
if( _name == "DS3Vacuum") {
147-
cout<<"DS3 Origin IS "<<node->GetMotherVolume()->GetName();
127+
std::cout<<"DS3 Origin IS "<<node->GetMotherVolume()->GetName();
148128
TGeoVolume *vol = node->GetVolume();
149129
TGeoBBox *shape = (TGeoBBox*)vol->GetShape();
150130
Double_t master[3];
@@ -156,7 +136,7 @@ namespace mu2e{
156136
}
157137
}
158138
if( _name == "TrackerMother") {
159-
cout<<"Tracker Origin IS "<<node->GetMotherVolume()->GetName();
139+
std::cout<<"Tracker Origin IS "<<node->GetMotherVolume()->GetName();
160140
TGeoVolume *vol = node->GetVolume();
161141
TGeoBBox *shape = (TGeoBBox*)vol->GetShape();
162142
Double_t master[3];

TEveEventDisplay/src/TEveEventDisplay_module.cc

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,11 @@ namespace mu2e
3737
fhicl::Atom<bool> showBuilding{Name("showBuilding"), Comment("set false to remove building"),false};
3838
fhicl::Atom<bool> showDSOnly{Name("showDSOnly"), Comment(""),true};
3939
fhicl::Atom<bool> showEvent{Name("showEvent"), Comment(""),true};
40-
40+
fhicl::Atom<bool> isMCOnly{Name("isMCOnly"), Comment(""),false};
4141
fhicl::Atom<bool> accumulate{Name("accumulate"), Comment(""),false};
4242
fhicl::Table<Collection_Filler::Config> filler{Name("filler"),Comment("fill collections")};
43+
//fhicl::Table<TEveMu2eMCInterface::Config> particles{Name("particles"),Comment("particles to plot")};
44+
fhicl::Sequence<int>particles{Name("particles"),Comment("PDGcodes to plot")};
4345
};
4446

4547
typedef art::EDAnalyzer::Table<Config> Parameters;
@@ -55,11 +57,13 @@ namespace mu2e
5557
bool _showBuilding;
5658
bool _showDSOnly;
5759
bool _showCRV;
58-
bool _showEvent;
60+
bool _showEvent;
61+
bool _isMCOnly;
5962
bool _accumulate;
6063
TApplication* application_;
6164
TDirectory* directory_ = nullptr;
6265
Collection_Filler _filler;
66+
std::vector<int> _particles;
6367
TEveMu2eMainWindow *_frame;
6468
fhicl::ParameterSet _pset;
6569
bool foundEvent = false;
@@ -78,8 +82,10 @@ namespace mu2e
7882
_showDSOnly(conf().showDSOnly()),
7983
_showCRV(conf().showCRV()),
8084
_showEvent(conf().showEvent()),
85+
_isMCOnly(conf().isMCOnly()),
8186
_accumulate(conf().accumulate()),
82-
_filler(conf().filler())
87+
_filler(conf().filler()),
88+
_particles(conf().particles())
8389
{}
8490

8591

@@ -95,6 +101,7 @@ namespace mu2e
95101
}
96102
_frame = new TEveMu2eMainWindow(gClient->GetRoot(), 1000,600, _pset);
97103
_frame->StartProjectionTabs();
104+
_frame->SetParticleOpts(_particles);
98105

99106
}
100107

@@ -121,7 +128,7 @@ namespace mu2e
121128
if(_filler.addTracks_)_filler.FillRecoCollections(event, data, KalSeeds);
122129
if(_filler.addClusters_)_filler.FillRecoCollections(event, data, CaloClusters);
123130
if(_filler.addMCTraj_)_filler.FillMCCollections(event, data, MCTrajectories);
124-
if(!_frame->isClosed()) _frame->setEvent(event, _firstLoop, data, -1, _accumulate, runn, eventn, eventSelected);
131+
if(!_frame->isClosed()) _frame->setEvent(event, _firstLoop, data, -1, _accumulate, runn, eventn, eventSelected, _isMCOnly);
125132
_firstLoop = false;
126133
}
127134
}

TEveEventDisplay/src/TEveMu2eCRV.cc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
#include "TEveEventDisplay/src/shape_classes/TEveMu2eCRV.h"
2-
#include "TEveEventDisplay/src/dict_classes/GeomUtils.h"
32

4-
#include <TBox.h>
5-
#include <TGeoBBox.h>
63
using namespace mu2e;
74
namespace mu2e{
85
TEveMu2eCRV::TEveMu2eCRV(){};
96

7+
/*------------Function to draw CRV geometry in 2D:-------------*/
108
void TEveMu2eCRV::DrawCRVDetector(art::Run const& run, TGeoVolume* topvol, TEveElementList *orthodetlist[]){
119
TGeoMaterial *matSi = new TGeoMaterial("Si", 28.085,14,2.33);
1210
TGeoMedium *Si = new TGeoMedium("Silicon",2, matSi);

0 commit comments

Comments
 (0)