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

Sim* Packages -- changes for large object passed by value #624

Merged
merged 1 commit into from Sep 10, 2013
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -24,7 +24,7 @@ class EcalFenixTcpFormat {
public:
EcalFenixTcpFormat(bool tccFormat, bool debug, bool famos, int binOfMax);
virtual ~EcalFenixTcpFormat();
virtual std::vector<int> process(std::vector<int>,std::vector<int>) { std::vector<int> v;return v;}
virtual std::vector<int> process(const std::vector<int>&,const std::vector<int>&) { std::vector<int> v;return v;}
void process(std::vector<int> &Et, std::vector<int> &fgvb, std::vector<int> &sfgvb, int eTTotShift, std::vector<EcalTriggerPrimitiveSample> & out, std::vector<EcalTriggerPrimitiveSample> & outTcc, bool isInInnerRings) ;
void setParameters(uint32_t towid,const EcalTPGLutGroup *ecaltpgLutGroup,const EcalTPGLutIdMap *ecaltpgLut, const EcalTPGTowerStatus *ecaltpgbadTT, const EcalTPGSpike * ecaltpgSpike);

Expand Down
4 changes: 2 additions & 2 deletions SimDataFormats/CaloHit/interface/CastorShowerEvent.h
Expand Up @@ -39,7 +39,7 @@
// Setters
void setNhit(unsigned int i) { nhit = i; };
void setDetID(unsigned int id) { detID.push_back(id); };
void setHitPosition(Point p) { hitPosition.push_back(p); };
void setHitPosition(const Point& p) { hitPosition.push_back(p); };
void setNphotons(float np) { nphotons.push_back(np); };
void setTime(float t) { time.push_back(t); };
void setPrimE(float e) { primaryEnergy = e; };
Expand All @@ -57,7 +57,7 @@
float getTime(int i) { return time[i]; };
float getPrimE() { return primaryEnergy; };
float getPrimEta() { return primEta; };
float getPrimPhi() { return primPhi; };
float getPrimPhi() const { return primPhi; };
float getPrimX() { return primX; };
float getPrimY() { return primY; };
float getPrimZ() { return primZ; };
Expand Down
6 changes: 3 additions & 3 deletions SimDataFormats/CrossingFrame/interface/CrossingFrame.h
Expand Up @@ -128,14 +128,14 @@ class CrossingFrame

// setters needed for step2 when using mixed secondary source
void setEventID(edm::EventID evId) { id_ = evId; }
void setPileups(std::vector<const T *> p) { pileups_ = p; }
void setPileups(const std::vector<const T *>& p) { pileups_ = p; }
void setBunchSpace(int bSpace) { bunchSpace_ = bSpace; }
void setMaxNbSources(unsigned int mNbS) { maxNbSources_ = mNbS; }
void setSubDet(std::string det) { subdet_ = det; }
void setPileupFileNr(unsigned int pFileNr) { pileupFileNr_ = pFileNr;}
void setIdFirstPileup(edm::EventID idFP) {idFirstPileup_ = idFP;}
void setPileupOffsetsBcr(std::vector<unsigned int> pOffsetsBcr) { pileupOffsetsBcr_ = pOffsetsBcr;}
void setPileupOffsetsSource(std::vector< std::vector<unsigned int> > pOffsetsS) { pileupOffsetsSource_ = pOffsetsS;} //one per source
void setPileupOffsetsBcr(const std::vector<unsigned int>& pOffsetsBcr) { pileupOffsetsBcr_ = pOffsetsBcr;}
void setPileupOffsetsSource(const std::vector< std::vector<unsigned int> >& pOffsetsS) { pileupOffsetsSource_ = pOffsetsS;} //one per source
void setBunchRange(std::pair<int,int> bunchRange) { firstCrossing_ = bunchRange.first;
lastCrossing_ = bunchRange.second;}

Expand Down
4 changes: 2 additions & 2 deletions SimDataFormats/CrossingFrame/interface/MixCollection.h
Expand Up @@ -16,7 +16,7 @@ class MixCollection {
MixCollection();
MixCollection(const CrossingFrame<T> *cf,
const range bunchRange =range(-999,999));
MixCollection(std::vector<const CrossingFrame<T> *> cfs,
MixCollection(const std::vector<const CrossingFrame<T> *>& cfs,
const range bunchRange =range(-999,999));

range bunchrange() const {return bunchRange_;}
Expand Down Expand Up @@ -152,7 +152,7 @@ MixCollection<T>::MixCollection(const CrossingFrame<T> *cf,const std::pair<int,i
}

template <class T>
MixCollection<T>::MixCollection(std::vector<const CrossingFrame<T> *> cfs, const std::pair<int,int> bunchRange) : inRegistry_(false) , nrDets_(0)
MixCollection<T>::MixCollection(const std::vector<const CrossingFrame<T> *>& cfs, const std::pair<int,int> bunchRange) : inRegistry_(false) , nrDets_(0)
{
// first, verify that all CrossingFrames have the same bunchrange
range bR=cfs[0]->getBunchRange();
Expand Down
4 changes: 2 additions & 2 deletions SimDataFormats/JetMatching/interface/JetFlavour.h
Expand Up @@ -31,9 +31,9 @@ class JetFlavour
};

JetFlavour(void) { }
JetFlavour(LorentzVector lv, const Point &pt, int fl, const Leptons &le)
JetFlavour(const LorentzVector& lv, const Point &pt, int fl, const Leptons &le)
: m_partonMomentum(lv), m_partonVertex(pt), m_flavour(fl), m_leptons(le) {}
JetFlavour(LorentzVector lv, Point pt, int fl)
JetFlavour(const LorentzVector& lv, const Point& pt, int fl)
: m_partonMomentum(lv), m_partonVertex(pt), m_flavour(fl) {}

const LorentzVector getLorentzVector() const {return m_partonMomentum;}
Expand Down
2 changes: 1 addition & 1 deletion SimG4CMS/Calo/interface/CaloG4Hit.h
Expand Up @@ -73,7 +73,7 @@ class CaloG4Hit : public G4VHit {

CaloHitID getID() const {return hitID;}
void setID (uint32_t i, double d, int j, uint16_t k=0) { hitID.setID(i,d,j,k);}
void setID (CaloHitID id) {hitID = id;}
void setID (const CaloHitID& id) {hitID = id;}

void addEnergyDeposit(double em, double hd);
void addEnergyDeposit(const CaloG4Hit& aHit);
Expand Down
6 changes: 3 additions & 3 deletions SimG4CMS/Calo/interface/CaloSD.h
Expand Up @@ -70,13 +70,13 @@ class CaloSD : public SensitiveCaloDetector,
protected:

virtual G4bool getStepInfo(G4Step* aStep);
G4ThreeVector setToLocal(G4ThreeVector, const G4VTouchable*);
G4ThreeVector setToGlobal(G4ThreeVector, const G4VTouchable*);
G4ThreeVector setToLocal(const G4ThreeVector&, const G4VTouchable*);
G4ThreeVector setToGlobal(const G4ThreeVector&, const G4VTouchable*);
G4bool hitExists();
G4bool checkHit();
CaloG4Hit* createNewHit();
void updateHit(CaloG4Hit*);
void resetForNewPrimary(G4ThreeVector, double);
void resetForNewPrimary(const G4ThreeVector&, double);
double getAttenuation(G4Step* aStep, double birk1, double birk2,
double birk3);

Expand Down
6 changes: 3 additions & 3 deletions SimG4CMS/Calo/interface/HCalSD.h
Expand Up @@ -49,7 +49,7 @@ class HCalSD : public CaloSD {

private:

uint32_t setDetUnitId(int, G4ThreeVector, int, int);
uint32_t setDetUnitId(int, const G4ThreeVector&, int, int);
std::vector<double> getDDDArray(const std::string&,
const DDsvalues_type&);
std::vector<G4String> getNames(DDFilteredView&);
Expand All @@ -69,8 +69,8 @@ class HCalSD : public CaloSD {
void getHitFibreBundle(G4Step * step, bool type);
int setTrackID(G4Step * step);
void readWeightFromFile(std::string);
double layerWeight(int, G4ThreeVector, int, int);
void plotProfile(G4Step* step, G4ThreeVector pos,
double layerWeight(int, const G4ThreeVector&, int, int);
void plotProfile(G4Step* step, const G4ThreeVector& pos,
double edep, double time, int id);
void plotHF(G4ThreeVector& pos, bool emType);

Expand Down
4 changes: 2 additions & 2 deletions SimG4CMS/Calo/interface/HFFibre.h
Expand Up @@ -26,9 +26,9 @@ class HFFibre {
~HFFibre();

double attLength(double lambda);
double tShift(G4ThreeVector point, int depth,
double tShift(const G4ThreeVector& point, int depth,
int fromEndAbs=0);
double zShift(G4ThreeVector point, int depth,
double zShift(const G4ThreeVector& point, int depth,
int fromEndAbs=0);

protected:
Expand Down
2 changes: 1 addition & 1 deletion SimG4CMS/Calo/interface/HFFibreFiducial.h
Expand Up @@ -12,7 +12,7 @@ class HFFibreFiducial {
public:
HFFibreFiducial() {}
virtual ~HFFibreFiducial() {}
static int PMTNumber(G4ThreeVector pe_effect); // M.K. HF acceptance
static int PMTNumber(const G4ThreeVector& pe_effect); // M.K. HF acceptance
};

#endif
2 changes: 1 addition & 1 deletion SimG4CMS/Calo/interface/HcalNumberingScheme.h
Expand Up @@ -15,7 +15,7 @@ class HcalNumberingScheme : public CaloNumberingScheme {
public:
HcalNumberingScheme();
virtual ~HcalNumberingScheme();
virtual uint32_t getUnitID(const HcalNumberingFromDDD::HcalID id);
virtual uint32_t getUnitID(const HcalNumberingFromDDD::HcalID& id);

};

Expand Down
4 changes: 2 additions & 2 deletions SimG4CMS/Calo/interface/HcalQie.h
Expand Up @@ -18,8 +18,8 @@ class HcalQie {
HcalQie(edm::ParameterSet const & p);
virtual ~HcalQie();

std::vector<int> getCode(int, std::vector<CaloHit>);
double getEnergy(std::vector<int>);
std::vector<int> getCode(int, const std::vector<CaloHit>&);
double getEnergy(const std::vector<int>&);

private:

Expand Down
2 changes: 1 addition & 1 deletion SimG4CMS/Calo/interface/HcalTestNumberingScheme.h
Expand Up @@ -13,7 +13,7 @@ class HcalTestNumberingScheme : public HcalNumberingScheme {
public:
HcalTestNumberingScheme(bool forTB);
virtual ~HcalTestNumberingScheme();
virtual uint32_t getUnitID(const HcalNumberingFromDDD::HcalID id);
virtual uint32_t getUnitID(const HcalNumberingFromDDD::HcalID& id);
static uint32_t packHcalIndex(int det, int z, int depth, int eta,
int phi, int lay);
static void unpackHcalIndex(const uint32_t & idx, int& det, int& z,
Expand Down
6 changes: 3 additions & 3 deletions SimG4CMS/Calo/src/CaloSD.cc
Expand Up @@ -290,14 +290,14 @@ bool CaloSD::getStepInfo(G4Step* aStep) {
return flag;
}

G4ThreeVector CaloSD::setToLocal(G4ThreeVector global, const G4VTouchable* touch) {
G4ThreeVector CaloSD::setToLocal(const G4ThreeVector& global, const G4VTouchable* touch) {

G4ThreeVector localPoint = touch->GetHistory()->GetTopTransform().TransformPoint(global);

return localPoint;
}

G4ThreeVector CaloSD::setToGlobal(G4ThreeVector local, const G4VTouchable* touch) {
G4ThreeVector CaloSD::setToGlobal(const G4ThreeVector& local, const G4VTouchable* touch) {

G4ThreeVector globalPoint = touch->GetHistory()->GetTopTransform().Inverse().TransformPoint(local);

Expand Down Expand Up @@ -448,7 +448,7 @@ void CaloSD::updateHit(CaloG4Hit* aHit) {
previousID = currentID;
}

void CaloSD::resetForNewPrimary(G4ThreeVector point, double energy) {
void CaloSD::resetForNewPrimary(const G4ThreeVector& point, double energy) {
entrancePoint = point;
entranceLocal = setToLocal(entrancePoint, preStepPoint->GetTouchable());
incidentEnergy = energy;
Expand Down
6 changes: 3 additions & 3 deletions SimG4CMS/Calo/src/HCalSD.cc
Expand Up @@ -637,7 +637,7 @@ bool HCalSD::filterHit(CaloG4Hit* aHit, double time) {
}


uint32_t HCalSD::setDetUnitId (int det, G4ThreeVector pos, int depth, int lay=1) {
uint32_t HCalSD::setDetUnitId (int det, const G4ThreeVector& pos, int depth, int lay=1) {
uint32_t id = 0;
if (numberingFromDDD) {
//get the ID's as eta, phi, depth, ... indices
Expand Down Expand Up @@ -1094,7 +1094,7 @@ void HCalSD::readWeightFromFile(std::string fName) {
if (entry <= 0) useLayerWt = false;
}

double HCalSD::layerWeight(int det, G4ThreeVector pos, int depth, int lay) {
double HCalSD::layerWeight(int det, const G4ThreeVector& pos, int depth, int lay) {

double wt = 1.;
if (numberingFromDDD) {
Expand All @@ -1115,7 +1115,7 @@ double HCalSD::layerWeight(int det, G4ThreeVector pos, int depth, int lay) {
return wt;
}

void HCalSD::plotProfile(G4Step* aStep, G4ThreeVector global, double edep,
void HCalSD::plotProfile(G4Step* aStep,const G4ThreeVector& global, double edep,
double time, int id) {

const G4VTouchable* touch = aStep->GetPreStepPoint()->GetTouchable();
Expand Down
4 changes: 2 additions & 2 deletions SimG4CMS/Calo/src/HFFibre.cc
Expand Up @@ -128,7 +128,7 @@ double HFFibre::attLength(double lambda) {
return att;
}

double HFFibre::tShift(G4ThreeVector point, int depth, int fromEndAbs) {
double HFFibre::tShift(const G4ThreeVector& point, int depth, int fromEndAbs) {

double zFibre = zShift(point, depth, fromEndAbs);
double time = zFibre/cFibre;
Expand All @@ -140,7 +140,7 @@ double HFFibre::tShift(G4ThreeVector point, int depth, int fromEndAbs) {
return time;
}

double HFFibre::zShift(G4ThreeVector point, int depth, int fromEndAbs) { // point is z-local
double HFFibre::zShift(const G4ThreeVector& point, int depth, int fromEndAbs) { // point is z-local

double zFibre = 0;
double hR = sqrt((point.x())*(point.x())+(point.y())*(point.y()));
Expand Down
2 changes: 1 addition & 1 deletion SimG4CMS/Calo/src/HFFibreFiducial.cc
Expand Up @@ -8,7 +8,7 @@
//#define DebugLog
//#define mkodebug

int HFFibreFiducial::PMTNumber(G4ThreeVector pe_effect)
int HFFibreFiducial::PMTNumber(const G4ThreeVector& pe_effect)
{
#ifdef mkodebug
static double mX=0.;
Expand Down
2 changes: 1 addition & 1 deletion SimG4CMS/Calo/src/HcalNumberingScheme.cc
Expand Up @@ -19,7 +19,7 @@ HcalNumberingScheme::~HcalNumberingScheme() {
edm::LogInfo("HcalSim") << "Deleting HcalNumberingScheme";
}

uint32_t HcalNumberingScheme::getUnitID(const HcalNumberingFromDDD::HcalID id){
uint32_t HcalNumberingScheme::getUnitID(const HcalNumberingFromDDD::HcalID& id){

int zside = 2*(id.zside) - 1;
int etaR = zside*(id.etaR);
Expand Down
8 changes: 4 additions & 4 deletions SimG4CMS/Calo/src/HcalQie.cc
Expand Up @@ -296,7 +296,7 @@ double HcalQie::getShape(double time) {
}


std::vector<int> HcalQie::getCode(int nht, std::vector<CaloHit> hitbuf) {
std::vector<int> HcalQie::getCode(int nht, const std::vector<CaloHit>& hitbuf) {

const double bunchSpace=25.;
int nmax = (bmax_ > numOfBuckets ? bmax_ : numOfBuckets);
Expand Down Expand Up @@ -328,8 +328,8 @@ std::vector<int> HcalQie::getCode(int nht, std::vector<CaloHit> hitbuf) {
if (nht>0) {

// Sort the hits
std::vector<CaloHit*> hits(nht);
std::vector<CaloHit*>::iterator k1, k2;
std::vector<const CaloHit*> hits(nht);
std::vector<const CaloHit*>::iterator k1, k2;
int kk;
for (kk = 0; kk < nht; kk++) {
hits[kk] = &hitbuf[kk];
Expand Down Expand Up @@ -400,7 +400,7 @@ std::vector<int> HcalQie::getCode(int nht, std::vector<CaloHit> hitbuf) {
}


double HcalQie::getEnergy(std::vector<int> code) {
double HcalQie::getEnergy(const std::vector<int>& code) {

std::vector<double> work(numOfBuckets);
double sum=0;
Expand Down
2 changes: 1 addition & 1 deletion SimG4CMS/Calo/src/HcalTestNumberingScheme.cc
Expand Up @@ -18,7 +18,7 @@ HcalTestNumberingScheme::~HcalTestNumberingScheme() {
edm::LogInfo("HcalSim") << "Deleting HcalTestNumberingScheme";
}

uint32_t HcalTestNumberingScheme::getUnitID(const HcalNumberingFromDDD::HcalID
uint32_t HcalTestNumberingScheme::getUnitID(const HcalNumberingFromDDD::HcalID&
id) {

//pack it into an integer
Expand Down
6 changes: 3 additions & 3 deletions SimG4CMS/FP420/interface/FP420G4Hit.h
Expand Up @@ -32,13 +32,13 @@ class FP420G4Hit : public G4VHit {
public:

G4ThreeVector getEntry() const;
void setEntry(G4ThreeVector xyz);
void setEntry(const G4ThreeVector& xyz);

G4ThreeVector getEntryLocalP() const;
void setEntryLocalP(G4ThreeVector xyz1);
void setEntryLocalP(const G4ThreeVector& xyz1);

G4ThreeVector getExitLocalP() const;
void setExitLocalP(G4ThreeVector xyz1);
void setExitLocalP(const G4ThreeVector& xyz1);

double getEM() const;
void setEM (double e);
Expand Down
4 changes: 2 additions & 2 deletions SimG4CMS/FP420/interface/FP420SD.h
Expand Up @@ -105,8 +105,8 @@ class FP420SD : public CaloSD {
// int eventno;
private:

G4ThreeVector SetToLocal(G4ThreeVector global);
G4ThreeVector SetToLocalExit(G4ThreeVector globalPoint);
G4ThreeVector SetToLocal(const G4ThreeVector& global);
G4ThreeVector SetToLocalExit(const G4ThreeVector& globalPoint);
void GetStepInfo(G4Step* aStep);
G4bool HitExists();
void CreateNewHit();
Expand Down
8 changes: 4 additions & 4 deletions SimG4CMS/FP420/interface/FP420Test.h
Expand Up @@ -64,16 +64,16 @@
class Fp420AnalysisHistManager : public TNamed {
public:

Fp420AnalysisHistManager(TString managername);
Fp420AnalysisHistManager(const TString& managername);
~Fp420AnalysisHistManager();

TH1F* GetHisto(Int_t Number);
TH1F* GetHisto(const TObjString histname);
TH1F* GetHisto(const TObjString& histname);

TH2F* GetHisto2(Int_t Number);
TH2F* GetHisto2(const TObjString histname);
TH2F* GetHisto2(const TObjString& histname);

void WriteToFile(TString fOutputFile,TString fRecreateFile);
void WriteToFile(const TString& fOutputFile,const TString& fRecreateFile);

private:

Expand Down
4 changes: 2 additions & 2 deletions SimG4CMS/FP420/plugins/FP420SD.cc
Expand Up @@ -384,15 +384,15 @@ void FP420SD::UpdateHit() {
}


G4ThreeVector FP420SD::SetToLocal(G4ThreeVector global){
G4ThreeVector FP420SD::SetToLocal(const G4ThreeVector& global){

const G4VTouchable* touch= preStepPoint->GetTouchable();
theEntryPoint = touch->GetHistory()->GetTopTransform().TransformPoint(global);
return theEntryPoint;
}


G4ThreeVector FP420SD::SetToLocalExit(G4ThreeVector globalPoint){
G4ThreeVector FP420SD::SetToLocalExit(const G4ThreeVector& globalPoint){

const G4VTouchable* touch= postStepPoint->GetTouchable();
theExitPoint = touch->GetHistory()->GetTopTransform().TransformPoint(globalPoint);
Expand Down