Skip to content

Commit

Permalink
Make static data member non-static
Browse files Browse the repository at this point in the history
  • Loading branch information
wmtan committed Oct 25, 2013
1 parent deef120 commit a7b160e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Mixing/Base/interface/BMixingModule.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ namespace edm {
virtual void endJob() override;
// std::string type_;
int bunchSpace_;
static int vertexoffset;
int vertexOffset_;
bool checktof_;
int minBunch_;
int maxBunch_;
Expand Down
16 changes: 7 additions & 9 deletions Mixing/Base/src/BMixingModule.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
#include "TFile.h"
#include "TH1F.h"

using namespace std;

int edm::BMixingModule::vertexoffset = 0;
const unsigned int edm::BMixingModule::maxNbSources_ =4;

namespace
Expand All @@ -37,8 +34,8 @@ namespace
std::string histoFileName=" ";
std::string histoName =" ";
TH1F * h = new TH1F("h","h",10,0,10);
vector<int> dataProbFunctionVar;
vector<double> dataProb;
std::vector<int> dataProbFunctionVar;
std::vector<double> dataProb;


const edm::ParameterSet & psin=ps.getParameter<edm::ParameterSet>(sourceName);
Expand Down Expand Up @@ -91,15 +88,15 @@ namespace
type_="probFunction";
}

dataProbFunctionVar = psin_average.getParameter<vector<int> >("probFunctionVariable");
dataProb = psin_average.getParameter<vector<double> >("probValue");
dataProbFunctionVar = psin_average.getParameter<std::vector<int> >("probFunctionVariable");
dataProb = psin_average.getParameter<std::vector<double> >("probValue");
histoFileName = psin_average.getUntrackedParameter<std::string>("histoFileName");

int varSize = (int) dataProbFunctionVar.size();
int probSize = (int) dataProb.size();

if ((dataProbFunctionVar[0] != 0) || (dataProbFunctionVar[varSize - 1] != (varSize - 1)))
throw cms::Exception("BadProbFunction") << "Please, check the variables of the probability function! The first variable should be 0 and the difference between two variables should be 1." << endl;
throw cms::Exception("BadProbFunction") << "Please, check the variables of the probability function! The first variable should be 0 and the difference between two variables should be 1." << std::endl;

// Complete the vector containing the probability function data
// with the values "0"
Expand Down Expand Up @@ -130,7 +127,7 @@ namespace

// Check if the histogram is normalized
if ( ((hprob->Integral() - 1) > 1.0e-02) && ((hprob->Integral() - 1) < -1.0e-02)){
throw cms::Exception("BadProbFunction") << "The probability function should be normalized!!! " << endl;
throw cms::Exception("BadProbFunction") << "The probability function should be normalized!!! " << std::endl;
}

averageNumber = hprob->GetMean();
Expand Down Expand Up @@ -168,6 +165,7 @@ namespace edm {
// Constructor
BMixingModule::BMixingModule(const edm::ParameterSet& pset) :
bunchSpace_(pset.getParameter<int>("bunchspace")),
vertexOffset_(0),
minBunch_((pset.getParameter<int>("minBunch")*25)/pset.getParameter<int>("bunchspace")),
maxBunch_((pset.getParameter<int>("maxBunch")*25)/pset.getParameter<int>("bunchspace")),
mixProdStep1_(pset.getParameter<bool>("mixProdStep1")),
Expand Down
2 changes: 1 addition & 1 deletion SimGeneral/MixingModule/plugins/MixingModule.cc
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ namespace edm {
LogDebug("MixingModule") <<" merging Event: id " << eventPrincipal.id();
// std::cout <<"PILEALLWORKERS merging Event: id " << eventPrincipal.id() << std::endl;

workers_[ii]->addPileups(bunchCrossing,eventPrincipal, &moduleCallingContext, eventId, vertexoffset);
workers_[ii]->addPileups(bunchCrossing,eventPrincipal, &moduleCallingContext, eventId, vertexOffset_);
}
}

Expand Down

0 comments on commit a7b160e

Please sign in to comment.