StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StHbtThCFManager.cxx
1 /***************************************************************************
2  *
3  *
4  *
5  * Author: Laurent Conin, Fabrice Retiere, Subatech, France
6  ***************************************************************************
7  *
8  * Description :
9  *
10  ***************************************************************************
11  *
12  *
13  *
14  ***************************************************************************/
15 
16 #include "StHbtMaker/ThCorrFctn/StHbtThCFManager.h"
17 #include "StHbtMaker/Base/StHbtThPair.hh"
18 #include "StHbtMaker/Base/StHbtThCorrFctn.hh"
19 #include "StHbtMaker/Infrastructure/StHbtTypes.hh"
20 #include <Stsstream.h>
21 
22 #ifdef __ROOT__
23 ClassImp(StHbtThCFManager)
24 #endif
25 
26 StHbtThCFManager::StHbtThCFManager() : StHbtCorrFctn() {
27  mThPair=0;
28 };
29 
30 StHbtThCFManager::~StHbtThCFManager()
31 { /* no-op */ };
32 
33 void StHbtThCFManager::AddMixedPair(const StHbtPair* aPair) {
34 
35  if (mThPair) {
36  mThPair->Set(aPair);
37  StHbtThCorrFctnIterator iter;
38  for (iter=mThCorrFctnColl.begin(); iter!=mThCorrFctnColl.end();iter++){
39  (*iter)->AddNum(mThPair);
40  (*iter)->AddDen(mThPair);
41  }
42  }
43 }
44 
45 void StHbtThCFManager::AddRealPair(const StHbtPair*)
46 {/* do nothing*/};
47 
48 void StHbtThCFManager::Finish() {
49 
50  StHbtThCorrFctnIterator iter;
51  for (iter=mThCorrFctnColl.begin(); iter!=mThCorrFctnColl.end();iter++){
52  (*iter)->Finish();
53  }
54 }
55 
56 
57 StHbtString StHbtThCFManager::Report() {
58  std::ostringstream tStr;
59  tStr << "Theoretical Correlation Function Manager Report" << endl;
60  if (!(mThPair)) {
61  tStr << "ERROR : No Theoretical Pair Plugged " << endl;
62  } else {
63  tStr << mThPair->Report() << endl;
64  };
65  tStr << mThCorrFctnColl.size() << " Correlations Functions Plugged : " << endl;
66  StHbtThCorrFctnIterator iter;
67  for (iter=mThCorrFctnColl.begin(); iter!=mThCorrFctnColl.end();iter++){
68  tStr <<(*iter)->Report() << endl;
69  }
70  StHbtString returnThis = tStr.str();
71  return returnThis;
72 }
73 
74 inline void StHbtThCFManager::AddCorrFctn(StHbtThCorrFctn* aCorrFctn){
75  mThCorrFctnColl.push_back(aCorrFctn);};
76 
77 inline void StHbtThCFManager::SetThPair(StHbtThPair* aThPair) {mThPair=aThPair;};
78