Skip to content

Commit

Permalink
[root6] Set attributes on StrangeMuDstMaker in StBFChain, rather than…
Browse files Browse the repository at this point in the history
… using interpreter to configure (#444)

Cling appears to have problems with using ProcessLine to get a pointer
to a maker... at least in this context and/or at least in the default
environment. So...

Refactor to use maker attributes, and set configuration options at
initialization time. (This is also cleaner and more inline with the
StMaker philosophy).
  • Loading branch information
klendathu2k authored Nov 18, 2022
1 parent 25274b6 commit c47c0a6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
12 changes: 6 additions & 6 deletions StRoot/StBFChain/StBFChain.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -638,12 +638,12 @@ Int_t StBFChain::Instantiate()
}

if (maker == "StStrangeMuDstMaker" && GetOption("CMuDST")&& GetOption("StrngMuDST") ) {
TString cmd(Form("StStrangeMuDstMaker *pSMMk = (StStrangeMuDstMaker*) %p;",mk));
cmd += "pSMMk->DoV0();"; // Set StrangeMuDstMaker parameters
cmd += "pSMMk->DoXi();";
cmd += "pSMMk->DoKink();";
cmd += "pSMMk->SetNoKeep();"; // Set flag for output OFF
ProcessLine(cmd);

mk -> SetAttr( "DoV0", 1 );
mk -> SetAttr( "DoXi", 1 );
mk -> SetAttr( "DoKink", 1 );
mk -> SetAttr( "SetNoKeep", 1 );

}

// Alex requested an option (not turned by default) to disable all
Expand Down
5 changes: 5 additions & 0 deletions StRoot/StStrangeMuDstMaker/StStrangeMuDstMaker.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ StStrangeMuDstMaker::~StStrangeMuDstMaker() {
//_____________________________________________________________________________
Int_t StStrangeMuDstMaker::Init() {

if ( 1 == IAttr( "DoV0" ) ) DoV0();
if ( 1 == IAttr( "DoXi" ) ) DoXi();
if ( 1 == IAttr( "DoKink" ) ) DoKink();
if ( 1 == IAttr( "SetNoKeep" ) ) SetNoKeep();

abortEvent = kFALSE;
firstEvent = kTRUE;
if (Debug()) gMessMgr->Debug() << "In StStrangeMuDstMaker::Init() ... "
Expand Down

0 comments on commit c47c0a6

Please # to comment.