#include <HPDNoiseMaker.h>
Public Member Functions | |
int | addHpd (const std::string &fName) |
define new HPD instance | |
HPDNoiseMaker (const std::string &fFileName) | |
void | newHpdEvent (const std::string &mName, const HPDNoiseData &mData) |
add new HPD noise event by HPD name | |
void | newHpdEvent (size_t i, const HPDNoiseData &mData) |
add new HPD noise event by HPD index | |
void | setRate (const std::string &fName, float fDischargeRate, float fIonFeedbackFirstPeakRate, float fIonFeedbackSecondPeakRate, float fElectronEmissionRate) |
set noise rate for the instance by using different processes | |
unsigned long | totalEntries (const std::string &mName) const |
get number of stored events by HPD index | |
~HPDNoiseMaker () | |
Private Member Functions | |
HPDNoiseMaker (const HPDNoiseMaker &) | |
HPDNoiseMaker & | operator= (const HPDNoiseMaker &) |
Private Attributes | |
HPDNoiseDataCatalog * | mCatalog |
TFile * | mFile |
std::vector< std::string > | mNames |
std::vector< TTree * > | mTrees |
Definition at line 19 of file HPDNoiseMaker.h.
HPDNoiseMaker::HPDNoiseMaker | ( | const std::string & | fFileName | ) |
Definition at line 20 of file HPDNoiseMaker.cc.
References mCatalog, and mFile.
{ mFile = new TFile (fFileName.c_str(), "RECREATE"); mCatalog = new HPDNoiseDataCatalog (); }
HPDNoiseMaker::~HPDNoiseMaker | ( | ) |
Definition at line 25 of file HPDNoiseMaker.cc.
References i, mCatalog, mFile, mTrees, and HPDNoiseDataCatalog::objectName().
HPDNoiseMaker::HPDNoiseMaker | ( | const HPDNoiseMaker & | ) | [private] |
int HPDNoiseMaker::addHpd | ( | const std::string & | fName | ) |
define new HPD instance
Definition at line 35 of file HPDNoiseMaker.cc.
References HPDNoiseDataCatalog::addHpd(), HPDNoiseData::branchName(), benchmark_cfg::cerr, HPDNoiseData::className(), mCatalog, mFile, mNames, and mTrees.
{ TDirectory* currentDirectory = gDirectory; mFile->cd(); mCatalog->addHpd (fName, 0., 0.,0.,0.); mNames.push_back (fName); mTrees.push_back (new TTree (fName.c_str(), fName.c_str())); HPDNoiseData* addr = 0; TBranch* newBranch = mTrees.back()->Branch (HPDNoiseData::branchName(), HPDNoiseData::className(), &addr, 32000, 1); if (!newBranch) { std::cerr << "HPDNoiseMaker::addHpd-> Can not make branch HPDNoiseData to the tree " << fName << std::endl; } currentDirectory->cd(); return mNames.size(); }
void HPDNoiseMaker::newHpdEvent | ( | size_t | i, |
const HPDNoiseData & | mData | ||
) |
add new HPD noise event by HPD index
Definition at line 63 of file HPDNoiseMaker.cc.
References HPDNoiseData::branchName(), benchmark_cfg::cerr, runTheMatrix::data, i, and mTrees.
{ if (i < mTrees.size()) { HPDNoiseData* data = (HPDNoiseData*) &fData; TBranch* branch = mTrees[i]->GetBranch (HPDNoiseData::branchName()); if (branch) { branch->SetAddress(&data); mTrees[i]->Fill(); } else { std::cerr << "HPDNoiseMaker::newHpdEvent-> Can not find branch " << HPDNoiseData::branchName() << " in the tree" << std::endl; } } }
void HPDNoiseMaker::newHpdEvent | ( | const std::string & | mName, |
const HPDNoiseData & | mData | ||
) |
HPDNoiseMaker& HPDNoiseMaker::operator= | ( | const HPDNoiseMaker & | ) | [private] |
void HPDNoiseMaker::setRate | ( | const std::string & | fName, |
float | fDischargeRate, | ||
float | fIonFeedbackFirstPeakRate, | ||
float | fIonFeedbackSecondPeakRate, | ||
float | fElectronEmissionRate | ||
) |
set noise rate for the instance by using different processes
Definition at line 50 of file HPDNoiseMaker.cc.
References mCatalog, and HPDNoiseDataCatalog::setRate().
unsigned long HPDNoiseMaker::totalEntries | ( | const std::string & | mName | ) | const |
HPDNoiseDataCatalog* HPDNoiseMaker::mCatalog [private] |
Definition at line 42 of file HPDNoiseMaker.h.
Referenced by addHpd(), HPDNoiseMaker(), setRate(), and ~HPDNoiseMaker().
TFile* HPDNoiseMaker::mFile [private] |
Definition at line 39 of file HPDNoiseMaker.h.
Referenced by addHpd(), HPDNoiseMaker(), and ~HPDNoiseMaker().
std::vector<std::string> HPDNoiseMaker::mNames [private] |
Definition at line 41 of file HPDNoiseMaker.h.
Referenced by addHpd(), newHpdEvent(), and totalEntries().
std::vector<TTree*> HPDNoiseMaker::mTrees [private] |
Definition at line 40 of file HPDNoiseMaker.h.
Referenced by addHpd(), newHpdEvent(), totalEntries(), and ~HPDNoiseMaker().