Skip to content

Commit

Permalink
fixes for tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
sophieMu2e committed Mar 12, 2024
1 parent 60852c2 commit 8fa0118
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 14 deletions.
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,24 @@ Things can be added and removed on the GUI once set to "true" in the FCL.

NOTE: you should run this from your working directory, not inside of REve.

# The GDML

Recently we upgraded the code to use the newest GDML. To get this built you need to run

```
muse build GDML
``
# The Browser
The user is advised to add the following to their .rootrc:
```
WebEve.DisableShow: 1
WebEve.DisableShow: 0
WebGui.HttpPort: 1234
WebEve.GLViewer: Three
```
The first line disables the forefox window pop up on the Mu2e machines. The second line sets port number to 1234, this can then be used in your local machine. Assuming you have access to the Fermilab network (either on site or using VPN):
The first line enables the forefox window pop up on the Mu2e machines IGNORE THAT DISPLAY AND USE YOUR LOCAL BROWSER. The second line sets port number to 1234, this can then be used in your local machine. Assuming you have access to the Fermilab network (either on site or using VPN):
```
mu2egpvm01.fnal.gov:1234/win1/
Expand Down
3 changes: 2 additions & 1 deletion config/drawutils.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// draw options

int TRKtrans = 90;
int CALtrans = 90;
int CALtrans = 100;
int CRYtrans = 90;
int CRVtrans = 98;
int BLtrans = 90;//BL = beamline elements

Expand Down
31 changes: 31 additions & 0 deletions examples/extmom_example.fcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# author : Sophie Middleton
# purpose : example for ext mon
#include "Offline/fcl/minimalMessageService.fcl"
#include "Offline/fcl/standardProducers.fcl"
#include "Offline/fcl/standardServices.fcl"
#include "REve/fcl/prolog.fcl"

services : @local::Services.Reco

process_name : SolED

source : { module_type : RootInput }

physics :
{
analyzers : { @table::REveDis.analyzers}
}
physics.analyzers.REveEventDisplay.showCRV : false
physics.analyzers.REveEventDisplay.showPS : false
physics.analyzers.REveEventDisplay.showTS : false
physics.analyzers.REveEventDisplay.showDS : false
physics.analyzers.REveEventDisplay.showTracker : false
physics.analyzers.REveEventDisplay.showCalo : false
physics.analyzers.REveEventDisplay.showST : false
physics.analyzers.REveEventDisplay.showSTM : false
physics.analyzers.REveEventDisplay.showEM : true
physics.analyzers.REveEventDisplay.filler.addMCTraj : true
physics.EndPath : [ @sequence::REveDis.seqBase]

services.TFileService.fileName: "nts.owner.REve.version.sequencer.root"

9 changes: 6 additions & 3 deletions inc/REveMainWindow.hh
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,11 @@ namespace mu2e {
bool showCalo = true;
bool showTracker = true;
bool showCaloCrystals = true;
bool showEM = false;
GeomOptions(){};
GeomOptions(bool crv, bool ps, bool ts, bool ds, bool twodim, bool cVST, bool st, bool ext, bool stm, bool calo, bool trk, bool crys)
: showCRV(crv), showPS(ps), showTS(ts), showDS(ds), show2D(twodim), caloVST(cVST), showST(st), extracted(ext), showSTM(stm), showCalo(calo), showTracker(trk), showCaloCrystals(crys) {};
void fill(bool crv, bool ps, bool ts, bool ds, bool twodim, bool cVST, bool st, bool ext, bool stm, bool cal, bool trk, bool crys) {
GeomOptions(bool crv, bool ps, bool ts, bool ds, bool twodim, bool cVST, bool st, bool ext, bool stm, bool calo, bool trk, bool crys, bool em)
: showCRV(crv), showPS(ps), showTS(ts), showDS(ds), show2D(twodim), caloVST(cVST), showST(st), extracted(ext), showSTM(stm), showCalo(calo), showTracker(trk), showCaloCrystals(crys), showEM(em) {};
void fill(bool crv, bool ps, bool ts, bool ds, bool twodim, bool cVST, bool st, bool ext, bool stm, bool cal, bool trk, bool crys, bool em) {
showCRV = (crv);
showPS = (ps);
showTS = (ts);
Expand All @@ -80,6 +81,7 @@ namespace mu2e {
showCalo = (cal);
showTracker = (trk);
showCaloCrystals = (crys);
showEM = (em);
}
void print(){
std::cout<<"***** Geom Options ****** "<<'\n'
Expand All @@ -94,6 +96,7 @@ namespace mu2e {
<<" show Trk : "<<showTracker <<'\n'
<<" show crystals : "<<showCaloCrystals <<'\n'
<<" show Extracted : "<<extracted <<'\n'
<<" show Ext Mon : "<<showEM <<'\n'
<<"************************ "<<std::endl;
}
};
Expand Down
8 changes: 5 additions & 3 deletions src/REveEventDisplay_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ namespace mu2e
fhicl::Atom<std::string>gdmlname{Name("gdmlname"),Comment("gdmlname")};
fhicl::Atom<bool> strawdisplay{Name("strawdisplay"), Comment(""),true};
fhicl::Atom<bool> extracted{Name("extracted"), Comment(""),false};
fhicl::Atom<bool> showEM{Name("showEM"), Comment(""),false};
fhicl::Atom<bool> seqMode{Name("seqMode"), Comment("turn off for go to any event functionality"),true};
};

Expand Down Expand Up @@ -177,6 +178,7 @@ namespace mu2e
bool addTrkCaloHits_;
bool useBTrk_;


bool specifyTag_ = false;
TDirectory* directory_ = nullptr;
CollectionFiller filler_;
Expand All @@ -188,6 +190,7 @@ namespace mu2e
std::string gdmlname_;
bool strawdisplay_;
bool extracted_;
bool showEM_;

// Setup Custom GUI
REveMu2eGUI *fGui{nullptr};
Expand Down Expand Up @@ -233,6 +236,7 @@ namespace mu2e
gdmlname_(configFile(conf().gdmlname())),
strawdisplay_(conf().strawdisplay()),
extracted_(conf().extracted()),
showEM_(conf().showEM()),
seqMode_(conf().seqMode())
{
std::cout<<"GDML file "<<gdmlname_<<std::endl;
Expand All @@ -245,7 +249,7 @@ namespace mu2e
std::cout<<" Run Number : "<<std::endl;
cin>>runn;
}
geomOpts.fill(showCRV_,showPS_, showTS_, showDS_, show2D_, caloVST_, showST_, extracted_, showSTM_, showCalo_, showTracker_, showCaloCrystals_ );
geomOpts.fill(showCRV_,showPS_, showTS_, showDS_, show2D_, caloVST_, showST_, extracted_, showSTM_, showCalo_, showTracker_, showCaloCrystals_, showEM_ );
}

REveEventDisplay::~REveEventDisplay() {}
Expand Down Expand Up @@ -347,9 +351,7 @@ namespace mu2e
if(filler_.addClusters_) {
if(specifyTag_) filler_.FillRecoCollections(event, data, CaloClusters);
else { FillAnyCollection<CaloClusterCollection, const CaloClusterCollection*>(event, _chits, data.calocluster_tuple);}

}

if(filler_.addCaloDigis_) {
if(specifyTag_) filler_.FillRecoCollections(event, data, CaloDigis);
else { FillAnyCollection<CaloDigiCollection, const CaloDigiCollection*>(event, _chits, data.calodigi_tuple);}
Expand Down
28 changes: 23 additions & 5 deletions src/REveMainWindow.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ void REveMainWindow::makeEveGeoShape(TGeoNode* n, REX::REveTrans& trans, REX::RE
int transpar = drawconfigf.getInt("BLtrans");
if(name.find("CRS") != string::npos) transpar = drawconfigf.getInt("CRVtrans");
if(name.find("Tracker") != string::npos) transpar = drawconfigf.getInt("TRKtrans") ;
if(name.find("calo") != string::npos) transpar = drawconfigf.getInt("CALtrans") ;
if(name.find("caloDisk") != string::npos) transpar = drawconfigf.getInt("CALtrans") ;
if(name.find("caloCrystal") != string::npos) transpar = drawconfigf.getInt("CRYtrans") ;

b1s->SetMainTransparency(transpar);
b1s->SetMainColor(color);
Expand Down Expand Up @@ -122,14 +123,14 @@ void REveMainWindow::showNodesByName(TGeoNode* n, const std::string& str, bool o
t(3,1) = rm[6]; t(3,2) = rm[7]; t(3,3) = rm[8];
t(1,4) = tv[0] + shift[0]; t(2,4) = tv[1] + shift[1]; t(3,4) = tv[2] + shift[2];
//std::cout<<name<<" "<<tv[0] + shift[0]<<" "<<tv[1] + shift[1] << " "<< tv[2] + shift[2]<<std::endl;
if(name == "TrackerPlaneEnvelope_000x362fdc0" or name== "TrackerPlaneEnvelope_000x4ce11c0") { // latter for extracted.
if(name == "TrackerPlaneEnvelope_000x4141f00" or name== "TrackerPlaneEnvelope_000x4ce10b0") { // latter for extracted.
FrontTracker_gdmltag = j;

}
if(name == "caloDisk_00x37aa0a0" or name == "caloDisk_00x4f89e50") { // latter for extracted.
if(name == "caloDisk_00x42bc1e0" or name == "caloDisk_00x4f89d60") { // latter for extracted.
disk1_center = tv[2] ;
}
if(name == "caloDisk_10x3881840" or name == "caloDisk_10x4fef6e0") {// latter for extracted.
if(name == "caloDisk_10x4307a00" or name == "caloDisk_10x4fef5f0") {// latter for extracted.
disk2_center = tv[2] ;
}
if(caloshift){
Expand Down Expand Up @@ -161,6 +162,23 @@ void REveMainWindow::showNodesByName(TGeoNode* n, const std::string& str, bool o
shift.push_back(0);
shift.push_back(0);
//geomOpt.print();

if(geomOpt.showEM){
static std::vector <std::string> substrings_em {"ExtMon"};
shift.at(0) = geomconfig.getDouble("psts_x")/10;
shift.at(1) = geomconfig.getDouble("psts_y")/10;
shift.at(2) = geomconfig.getDouble("psts_z")/10;
for(auto& i: substrings_em){
showNodesByName(node,i,kFALSE, 0, trans, beamlineholder, maxlevel, level, false, false, shift, false, true, drawconfigf.getInt("CRVColor"));
}
static std::vector <std::string> substrings_ps {"ProductionTarget"};
shift.at(0) = 780.85; //GDML
shift.at(1) = -0.06; //GDML
shift.at(2) = 1*PTz/10 -1*trackerz0/10 + PTHL/10;
for(auto& i: substrings_ps){
showNodesByName(node,i,kFALSE, 0, trans, beamlineholder, maxlevel, level, false, false, shift, false, true, drawconfigf.getInt("CRVColor"));
}
}
if(geomOpt.showTS){
static std::vector <std::string> substrings_ts {"TS"};
shift.at(0) = geomconfig.getDouble("psts_x")/10; //TODO these numbers need to be better defined
Expand All @@ -171,7 +189,7 @@ void REveMainWindow::showNodesByName(TGeoNode* n, const std::string& str, bool o
}
}
if(geomOpt.showPS){
static std::vector <std::string> substrings_ps {"ExtMon","PSVacuum"};//,"PS"};
static std::vector <std::string> substrings_ps {"PSVacuum"};
shift.at(0) = geomconfig.getDouble("psts_x")/10;
shift.at(1) = geomconfig.getDouble("psts_y")/10;
shift.at(2) = geomconfig.getDouble("psts_z")/10;
Expand Down

0 comments on commit 8fa0118

Please sign in to comment.