2 #include "StHbtMaker/Infrastructure/StHbtCutMonitorHandler.h"
3 #include "StHbtMaker/Infrastructure/StHbtTypes.hh"
9 StHbtCutMonitorHandler::StHbtCutMonitorHandler() {
10 cout <<
" *** StHbtCutMonitorHandler::StHbtCutMonitorHandler() " << endl;
11 mCollectionsEmpty = 0;
12 mPassColl =
new StHbtCutMonitorCollection();
13 mFailColl =
new StHbtCutMonitorCollection();
16 StHbtCutMonitorHandler::~StHbtCutMonitorHandler() {
21 void StHbtCutMonitorHandler::FillCutMonitor(
const StHbtEvent* event,
bool pass) {
22 if (mCollectionsEmpty)
return;
23 StHbtCutMonitorIterator iter;
26 for (iter=mPassColl->begin(); iter!=mPassColl->end(); iter++){
31 for (iter=mFailColl->begin(); iter!=mFailColl->end(); iter++){
38 void StHbtCutMonitorHandler::FillCutMonitor(
const StHbtTrack*
track,
bool pass) {
39 if (mCollectionsEmpty)
return;
40 StHbtCutMonitorIterator iter;
43 for (iter=mPassColl->begin(); iter!=mPassColl->end(); iter++){
48 for (iter=mFailColl->begin(); iter!=mFailColl->end(); iter++){
55 void StHbtCutMonitorHandler::FillCutMonitor(
const StHbtV0* v0,
bool pass) {
56 if (mCollectionsEmpty)
return;
57 StHbtCutMonitorIterator iter;
60 for (iter=mPassColl->begin(); iter!=mPassColl->end(); iter++){
65 for (iter=mFailColl->begin(); iter!=mFailColl->end(); iter++){
72 void StHbtCutMonitorHandler::FillCutMonitor(
const StHbtKink* kink,
bool pass) {
73 if (mCollectionsEmpty)
return;
74 StHbtCutMonitorIterator iter;
77 for (iter=mPassColl->begin(); iter!=mPassColl->end(); iter++){
82 for (iter=mFailColl->begin(); iter!=mFailColl->end(); iter++){
89 void StHbtCutMonitorHandler::FillCutMonitor(
const StHbtPair* pair,
bool pass) {
90 if (mCollectionsEmpty)
return;
91 StHbtCutMonitorIterator iter;
94 for (iter=mPassColl->begin(); iter!=mPassColl->end(); iter++){
99 for (iter=mFailColl->begin(); iter!=mFailColl->end(); iter++){
106 void StHbtCutMonitorHandler::FillCutMonitor(
const StHbtParticleCollection* partColl) {
107 if (mCollectionsEmpty)
return;
108 StHbtCutMonitorIterator iter;
111 for (iter=mPassColl->begin(); iter!=mPassColl->end(); iter++){
117 void StHbtCutMonitorHandler::FillCutMonitor(
const StHbtEvent* event,
const StHbtParticleCollection* partColl) {
119 cout<<
"In StHbtCutMonitorHandler::FillCutMonitor(const StHbtEvent* event, StHbtPicoEvent* picoEvent)"<<endl;
120 if (mCollectionsEmpty)
return;
121 StHbtCutMonitorIterator iter;
124 for (iter=mPassColl->begin(); iter!=mPassColl->end(); iter++){
126 CM->Fill(event,partColl);
130 void StHbtCutMonitorHandler::Finish() {
131 StHbtCutMonitorIterator iter;
132 for (iter=mPassColl->begin(); iter!=mPassColl->end(); iter++){
135 for (iter=mFailColl->begin(); iter!=mFailColl->end(); iter++){
141 mPassColl->push_back(cutMoni1);
142 mFailColl->push_back(cutMoni2);
143 mCollectionsEmpty=
false;
147 cout <<
" make a copy of the cutmonitor and push both into the collections " << endl;
148 cout <<
" not yet implemented" << endl;
149 mPassColl->push_back(cutMoni);
150 cout <<
" only pass collection pushed" << endl;
151 mCollectionsEmpty=
false;
154 void StHbtCutMonitorHandler::AddCutMonitorPass(
StHbtCutMonitor* cutMoni) {
155 mPassColl->push_back(cutMoni);
156 mCollectionsEmpty=
false;
159 void StHbtCutMonitorHandler::AddCutMonitorFail(
StHbtCutMonitor* cutMoni) {
160 mFailColl->push_back(cutMoni);
161 mCollectionsEmpty=
false;
165 StHbtCutMonitorIterator iter = mPassColl->begin();
166 if ( (
int)mPassColl->size() <= n )
return NULL;
167 for (
int i=0; i<n; i++)
173 StHbtCutMonitorIterator iter = mFailColl->begin();
174 if ( (
int)mFailColl->size() <= n )
return NULL;
175 for (
int i=0; i<n; i++)