Skip to content

Commit

Permalink
Castor Shower Library changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Sunanda Banerjee committed Oct 5, 2009
1 parent 2fe3354 commit 83aef70
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 25 deletions.
51 changes: 30 additions & 21 deletions SimDataFormats/CaloHit/interface/CastorShowerLibraryInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,32 @@

#include <vector>
#include <string>
class SLBin: public TObject {
public:
SLBin() {};
~SLBin() {};
// Setters
void Clear() {NEvts=NBins=NEvtPerBin=0;Bins.clear();};
void setNEvts(unsigned int n) {NEvts = n;};
void setNBins(unsigned int n) {NBins = n;};
void setNEvtPerBin(unsigned int n) {NEvtPerBin=n;};
void setBin(double val) {Bins.push_back(val);};
void setBin(const std::vector<double>& b) {Bins=b;};
// getters
unsigned int getNEvts() { return NEvts;};
unsigned int getNBins() { return NBins;};
unsigned int getNEvtPerBin() { return NEvtPerBin;};
double getBin(int i) { return Bins.at(i);};
std::vector<double>& getBin() { return Bins;};
private:
unsigned int NEvts;
unsigned int NBins;
unsigned int NEvtPerBin;
std::vector<double> Bins;
ClassDef(SLBin,1);
};

class CastorShowerLibraryInfo : public TObject {
class CastorShowerLibraryInfo : public TObject {

public:

Expand All @@ -20,26 +44,11 @@
void Clear();

// Data members
unsigned int NEv;
unsigned int NEnBins;
unsigned int NEvPerBin;
std::vector<double> Energies;

// Setters
void setNEv(unsigned int n) { NEv = n; };
void setNEnBins(unsigned int n) { NEnBins = n; };
void setNEvPerBin(unsigned int n) { NEvPerBin = n; };
void setEnergies(double en) { Energies.push_back(en); };
void setEnergies(std::vector<double> en) { Energies=en; };

// Accessors
unsigned int getNEv() { return NEv; };
unsigned int getNEnBins() { return NEnBins; };
unsigned int getNEvPerBin() { return NEvPerBin; };
double getEnergies(int i) { return Energies[i]; };
std::vector<double> getEnergies() { return Energies; };

ClassDef(CastorShowerLibraryInfo,1)
SLBin Energy;
SLBin Eta;
SLBin Phi;

ClassDef(CastorShowerLibraryInfo,1);

};

Expand Down
1 change: 1 addition & 0 deletions SimDataFormats/CaloHit/src/CastorEventLinkDef.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@

#pragma link C++ class CastorShowerEvent+;
#pragma link C++ class CastorShowerLibraryInfo+;
#pragma link C++ class SLBin+;
#endif
7 changes: 3 additions & 4 deletions SimDataFormats/CaloHit/src/CastorShowerLibraryInfo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ CastorShowerLibraryInfo::~CastorShowerLibraryInfo() {}


void CastorShowerLibraryInfo::Clear() {
NEv = 0;
NEnBins = 0;
NEvPerBin = 0;
Energies.clear();
Energy.Clear();
Eta.Clear();
Phi.Clear();
}

0 comments on commit 83aef70

Please sign in to comment.