Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: do not inline map accessor #641

Merged
merged 1 commit into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions StarVMC/StarAgmlLib/AgBlock.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ void AgBlock::AddGroup( const Char_t *name )
;//{ mGroups.push_back( name ); }


void AgBlock::AddCut( TString cut, double value ){ mGstpar[cut] = value; }


// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> WHY IS THIS COMMENTED OUT???
void AgBlock::Inherit()
{
Expand Down
2 changes: 1 addition & 1 deletion StarVMC/StarAgmlLib/AgBlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ class AgBlock : public TNamed
int numberBranches() const { return mNumberBranches; }
void branch(){ mNumberBranches++; }

void AddCut( TString cut, double value ){ mGstpar[cut] = value; }
void AddCut( TString cut, double value );
std::map<TString, double>& GetCuts() { return mGstpar; }

private:
Expand Down
2 changes: 2 additions & 0 deletions StarVMC/StarAgmlLib/AgMLExtension.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ AgMLExtension::AgMLExtension() : TGeoRCExtension(),
{
Grab();
}

void AgMLExtension::AddCut( TString cut, double value ){ mGstpar[cut] = value; }
2 changes: 1 addition & 1 deletion StarVMC/StarAgmlLib/AgMLExtension.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class AgMLExtension : public TGeoRCExtension {

std::vector<AgMLScoring*> GetUserHits(){ return mHitScoring; }

void AddCut( TString cut, double value ){ mGstpar[cut] = value; }
void AddCut( TString cut, double value );
std::map<TString,double>& GetCuts() { return mGstpar; }


Expand Down
2 changes: 2 additions & 0 deletions StarVMC/StarAgmlLib/AgModule.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ TDataSet *AgModule::Geom()
else return mGeomSet;
};

void AgModule::AddHitScoring( TString name, AgMLScoring* sc ){ mHitScoring[name] = sc; }

// ---------------------------------------------------------------------------------------------
AgBlock *AgModule::AddBlock( const Char_t *name, AgBlock *_block )
{
Expand Down
2 changes: 1 addition & 1 deletion StarVMC/StarAgmlLib/AgModule.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class AgModule : public AgBlock
void SetTrackingFlag( int flag ){ mTrackingFlag = flag; }
int GetTrackingFlag(){ return mTrackingFlag; }

void AddHitScoring( TString name, AgMLScoring* sc ){ mHitScoring[name] = sc; }
void AddHitScoring( TString name, AgMLScoring* sc );
std::map<TString,AgMLScoring*> GetHitScoring(){ return mHitScoring; }

private:
Expand Down
2 changes: 2 additions & 0 deletions StarVMC/StarAgmlLib/AgShape.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,8 @@ Bool_t AgShape::morphed()
return true; // No shapes match
}

std::vector< TString > &AgShape::parList(){ return mParList[mId]; }

// =============================================================================================================
Bool_t AgShape::parameterized()
{
Expand Down
2 changes: 1 addition & 1 deletion StarVMC/StarAgmlLib/AgShape.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class AgShape : public TNamed, public AgParameterList<double>
Bool_t morphed();

/// Return a list of the parameters which define this shape
std::vector< TString > &parList(){ return mParList[mId]; }
std::vector< TString > &parList();

/// Returns true if the shape's parameters are to be set
/// when positioned
Expand Down
6 changes: 6 additions & 0 deletions StarVMC/StarAgmlLib/StarAgmlStacker.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,12 @@ TString StarAgmlStacker::realname( TString nname )
return mRealnames[nname];
}


const std::vector<TString> &StarAgmlStacker::nicknames(const Char_t *name)
{
return mNicknames[ TString(name) ];
}

// ---------------------------------------------------------------------------------------------------
void StarAgmlStacker::Debug( const Char_t *name, const Char_t *flag )
{
Expand Down
5 changes: 1 addition & 4 deletions StarVMC/StarAgmlLib/StarAgmlStacker.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,7 @@ class StarAgmlStacker : public TNamed

virtual Bool_t SearchVolume( const AgShape &shape, const AgAttribute &attr )=0;

const std::vector<TString> &nicknames(const Char_t *name)
{
return mNicknames[ TString(name) ];
}
const std::vector<TString> &nicknames(const Char_t *name);

void Debug( const Char_t *name, const Char_t *flag="position" );

Expand Down
4 changes: 3 additions & 1 deletion mgr/Dyson/Export/AgROOT.py
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ class StarGeometry {
/// Construct geometry with the specified tag, and return wrapped in a TDataSet
static TDataSet* Construct( const char* name = "%s");
static bool List ( const char* name = "%s");
static void Whitelist( const char* name, int value=1 ){ whitelist[name]=value; }
static void Whitelist( const char* name, int value=1 );
static void InitAgML ( const char* stacker="StarTGeoStacker");
StarGeometry(){ /* nada */ };
virtual ~StarGeometry(){ /* nada */ }
Expand Down Expand Up @@ -718,6 +718,8 @@ class Geometry : public StarGeometry {

std::map<std::string,int> StarGeometry::whitelist= {{"all",1}};

void StarGeometry::Whitelist(const char* name, int value){ whitelist[name]=value; }

TDataSet* StarGeometry::Construct( const char* name )
{
std::string tag = name;
Expand Down
Loading