Skip to content

Commit

Permalink
Merge pull request #28 from jthaeder/master
Browse files Browse the repository at this point in the history
fix american "analyze"
  • Loading branch information
jthaeder committed Apr 14, 2015
2 parents 9aaf664 + 38f5b7f commit 5010c9e
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
6 changes: 3 additions & 3 deletions StRoot/StPicoHFMaker/StPicoHFMaker.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ ClassImp(StPicoHFMaker)
StPicoHFMaker::StPicoHFMaker(char const* name, StPicoDstMaker* picoMaker,
char const* outputBaseFileName, char const* inputHFListHFtree = "") :
StMaker(name), mPicoDst(NULL), mHFCuts(NULL), mPicoHFEvent(NULL), mBField(0.), mOutList(NULL),
mDecayMode(StPicoHFEvent::kTwoParticleDecay), mMakerMode(StPicoHFMaker::kAnalyse),
mDecayMode(StPicoHFEvent::kTwoParticleDecay), mMakerMode(StPicoHFMaker::kAnalyze),
mOuputFileBaseName(outputBaseFileName), mInputFileName(inputHFListHFtree),
mPicoDstMaker(picoMaker), mPicoEvent(NULL), mTree(NULL), mHFChain(NULL), mEventCounter(0),
mOutputFileTree(NULL), mOutputFileList(NULL) {
Expand Down Expand Up @@ -205,7 +205,7 @@ Int_t StPicoHFMaker::Make() {
UInt_t nTracks = mPicoDst->numberOfTracks();

// -- Fill vectors of particle types
if (mMakerMode == StPicoHFMaker::kWrite || mMakerMode == StPicoHFMaker::kAnalyse) {
if (mMakerMode == StPicoHFMaker::kWrite || mMakerMode == StPicoHFMaker::kAnalyze) {
for (unsigned short iTrack = 0; iTrack < nTracks; ++iTrack) {
StPicoTrack* trk = mPicoDst->track(iTrack);

Expand All @@ -217,7 +217,7 @@ Int_t StPicoHFMaker::Make() {
if (isProton(trk, beta)) mIdxPicoProtons.push_back(iTrack); // isProton method to be implemented by daughter class

} // .. end tracks loop
} // if (mMakerMode == StPicoHFMaker::kWrite || mMakerMode == StPicoHFMaker::kAnalyse) {
} // if (mMakerMode == StPicoHFMaker::kWrite || mMakerMode == StPicoHFMaker::kAnalyze) {

// -- call method of daughter class
iReturn = MakeHF();
Expand Down
6 changes: 3 additions & 3 deletions StRoot/StPicoHFMaker/StPicoHFMaker.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*
* - Set use mode of StPicoHFMaker class via setMakerMode(...)
* use enum of StPicoHFMaker::eMakerMode
* StPicoHFMaker::kAnalyse - don't write candidate trees, just fill histograms
* StPicoHFMaker::kAnalyze - don't write candidate trees, just fill histograms
* StPicoHFMaker::kWrite - write candidate trees
* StPicoHFMaker::kRead - read candidate trees and fill histograms
*
Expand Down Expand Up @@ -74,10 +74,10 @@ class StPicoHFMaker : public StMaker
void setDecayMode(unsigned short us);

// -- different modes to use the StPicoHFMaker class
// - kAnalyse - don't write candidate trees, just fill histograms
// - kAnalyze - don't write candidate trees, just fill histograms
// - kWrite - write candidate trees
// - kRead - read candidate trees and fill histograms
enum eMakerMode {kAnalyse, kWrite, kRead};
enum eMakerMode {kAnalyze, kWrite, kRead};

// -- TO BE IMPLEMENTED BY DAUGHTER CLASS
virtual bool isPion(StPicoTrack const*, float const & bTofBeta) const { return true; }
Expand Down
12 changes: 6 additions & 6 deletions StRoot/StPicoHFMyAnaMaker/StPicoHFMyAnaMaker.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,18 @@ int StPicoHFMyAnaMaker::MakeHF() {
// ADD YOUR PROCESSING CODE HERE
// ... it is usefull to use the methods below
// - createCandidates()
// - analyseCandidates()
// - analyzeCandidates()

if (isMakerMode() == StPicoHFMaker::kWrite) {
createCandidates();
}
else if (isMakerMode() == StPicoHFMaker::kRead) {
// -- the reading back of the perviously written trees happens in the background
analyseCandidates();
analyzeCandidates();
}
else if (isMakerMode() == StPicoHFMaker::kAnalyse) {
else if (isMakerMode() == StPicoHFMaker::kAnalyze) {
createCandidates();
analyseCandidates();
analyzeCandidates();
}

return kStOK;
Expand Down Expand Up @@ -111,8 +111,8 @@ int StPicoHFMyAnaMaker::createCandidates() {
}

// _________________________________________________________
int StPicoHFMyAnaMaker::analyseCandidates() {
// -- analyse pairs/triplet, which have been filled in arrays
int StPicoHFMyAnaMaker::analyzeCandidates() {
// -- analyze pairs/triplet, which have been filled in arrays
// (in StPicoHFEvent) before ( via createCandidates() or via reading back from trees )
// fill histograms or nTuples ... etc

Expand Down
4 changes: 2 additions & 2 deletions StRoot/StPicoHFMyAnaMaker/StPicoHFMyAnaMaker.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
*
* - Set use mode of StPicoHFMaker class via setMakerMode(...)
* use enum of StPicoHFMaker::eMakerMode
* StPicoHFMaker::kAnalyse - don't write candidate trees, just fill histograms
* StPicoHFMaker::kAnalyze - don't write candidate trees, just fill histograms
* StPicoHFMaker::kWrite - write candidate trees
* StPicoHFMaker::kRead - read candidate trees and fill histograms
*
Expand Down Expand Up @@ -87,7 +87,7 @@ class StPicoHFMyAnaMaker : public StPicoHFMaker
private:

int createCandidates();
int analyseCandidates();
int analyzeCandidates();

// -- private members --------------------------

Expand Down
8 changes: 4 additions & 4 deletions StRoot/macros/runPicoHFMyAnaMaker.C
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* --------------------------------------------------
*
* - Different modes to use the class
* - StPicoHFMaker::kAnalyse - don't write candidate trees, just fill histograms
* - StPicoHFMaker::kAnalyze - don't write candidate trees, just fill histograms
* inputFile : fileList of PicoDst files or single picoDst file
* outputFile: baseName for outfile
* - StPicoHFMaker::kWrite - write candidate trees
Expand Down Expand Up @@ -34,7 +34,7 @@ class StPicoDstMaker;

StChain *chain;

void runPicoHFMyAnaMaker(const Char_t *inputFile="test.list", const Char_t *outputFile="outputBaseName", unsigned int makerMode = 0 /*kAnalyse*/) {
void runPicoHFMyAnaMaker(const Char_t *inputFile="test.list", const Char_t *outputFile="outputBaseName", unsigned int makerMode = 0 /*kAnalyze*/) {
// -- Check STAR Library. Please set SL_version to the original star library used in the production
// from http://www.star.bnl.gov/devcgi/dbProdOptionRetrv.pl
string SL_version = "SL15c";
Expand All @@ -56,7 +56,7 @@ void runPicoHFMyAnaMaker(const Char_t *inputFile="test.list", const Char_t *outp
chain = new StChain();

// ========================================================================================
//makerMode = StPicoHFMaker::kAnalyse;
//makerMode = StPicoHFMaker::kAnalyze;
// ========================================================================================

cout << "Maker Mode " << makerMode << endl;
Expand All @@ -65,7 +65,7 @@ void runPicoHFMyAnaMaker(const Char_t *inputFile="test.list", const Char_t *outp
TString sInputFile(inputFile);
TString sInputListHF("");

if (makerMode == StPicoHFMaker::kAnalyse) {
if (makerMode == StPicoHFMaker::kAnalyze) {
if (!sInputFile.Contains(".list") && !sInputFile.Contains("picoDst.root")) {
cout << "No input list or picoDst root file provided! Exiting..." << endl;
exit(1);
Expand Down

0 comments on commit 5010c9e

Please sign in to comment.