Skip to content

Commit d966bc2

Browse files
plexoosklendathu2k
andauthored
refactor: do not inline map accessor (#641)
Resolves #620 Co-authored-by: klendathu2k <[email protected]>
1 parent 4298c80 commit d966bc2

File tree

11 files changed

+23
-9
lines changed

11 files changed

+23
-9
lines changed

StarVMC/StarAgmlLib/AgBlock.cxx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@ void AgBlock::AddGroup( const Char_t *name )
9898
;//{ mGroups.push_back( name ); }
9999

100100

101+
void AgBlock::AddCut( TString cut, double value ){ mGstpar[cut] = value; }
102+
103+
101104
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> WHY IS THIS COMMENTED OUT???
102105
void AgBlock::Inherit()
103106
{

StarVMC/StarAgmlLib/AgBlock.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ class AgBlock : public TNamed
153153
int numberBranches() const { return mNumberBranches; }
154154
void branch(){ mNumberBranches++; }
155155

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

159159
private:

StarVMC/StarAgmlLib/AgMLExtension.cxx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,5 @@ AgMLExtension::AgMLExtension() : TGeoRCExtension(),
1313
{
1414
Grab();
1515
}
16+
17+
void AgMLExtension::AddCut( TString cut, double value ){ mGstpar[cut] = value; }

StarVMC/StarAgmlLib/AgMLExtension.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class AgMLExtension : public TGeoRCExtension {
5757

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

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

6363

StarVMC/StarAgmlLib/AgModule.cxx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ TDataSet *AgModule::Geom()
2525
else return mGeomSet;
2626
};
2727

28+
void AgModule::AddHitScoring( TString name, AgMLScoring* sc ){ mHitScoring[name] = sc; }
29+
2830
// ---------------------------------------------------------------------------------------------
2931
AgBlock *AgModule::AddBlock( const Char_t *name, AgBlock *_block )
3032
{

StarVMC/StarAgmlLib/AgModule.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class AgModule : public AgBlock
4040
void SetTrackingFlag( int flag ){ mTrackingFlag = flag; }
4141
int GetTrackingFlag(){ return mTrackingFlag; }
4242

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

4646
private:

StarVMC/StarAgmlLib/AgShape.cxx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -626,6 +626,8 @@ Bool_t AgShape::morphed()
626626
return true; // No shapes match
627627
}
628628

629+
std::vector< TString > &AgShape::parList(){ return mParList[mId]; }
630+
629631
// =============================================================================================================
630632
Bool_t AgShape::parameterized()
631633
{

StarVMC/StarAgmlLib/AgShape.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class AgShape : public TNamed, public AgParameterList<double>
6767
Bool_t morphed();
6868

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

7272
/// Returns true if the shape's parameters are to be set
7373
/// when positioned

StarVMC/StarAgmlLib/StarAgmlStacker.cxx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,12 @@ TString StarAgmlStacker::realname( TString nname )
129129
return mRealnames[nname];
130130
}
131131

132+
133+
const std::vector<TString> &StarAgmlStacker::nicknames(const Char_t *name)
134+
{
135+
return mNicknames[ TString(name) ];
136+
}
137+
132138
// ---------------------------------------------------------------------------------------------------
133139
void StarAgmlStacker::Debug( const Char_t *name, const Char_t *flag )
134140
{

StarVMC/StarAgmlLib/StarAgmlStacker.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,7 @@ class StarAgmlStacker : public TNamed
3535

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

38-
const std::vector<TString> &nicknames(const Char_t *name)
39-
{
40-
return mNicknames[ TString(name) ];
41-
}
38+
const std::vector<TString> &nicknames(const Char_t *name);
4239

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

0 commit comments

Comments
 (0)