StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StHbtMultiTrackCut.cxx
1 /***************************************************************************
2  *
3  *
4  *
5  * Author: Frank Laue, Ohio State, laue@mps.ohio-state.edu
6  ***************************************************************************
7  *
8  * Description: part of STAR HBT Framework: StHbtMaker package
9  * This is a class that holds a collection of StHbtTrackCuts
10  *
11  ***************************************************************************
12  *
13  **************************************************************************/
14 
15 #include "StHbtMaker/Infrastructure/StHbtMultiTrackCut.h"
16 #include "StHbtMaker/Infrastructure/StHbtTrackCutCollection.hh"
17 
18 #ifdef __ROOT__
19 ClassImp(StHbtMultiTrackCut)
20 #endif
21 
22 
23 // *************************************************************************
24 StHbtMultiTrackCut::StHbtMultiTrackCut(){
25  mCutCollection = new StHbtTrackCutCollection;
26 }
27 // *************************************************************************
28 //StHbtMultiTrackCut::StHbtMultiTrackCut(const StHbtMultiTrackCut&) {} // copy constructor
29 // *************************************************************************
30 StHbtMultiTrackCut::~StHbtMultiTrackCut(){
31  StHbtTrackCutIterator iter;
32  for (iter=mCutCollection->begin();iter!=mCutCollection->end();iter++){
33  delete *iter;
34  }
35  delete mCutCollection;
36 }
37 // *************************************************************************
38 StHbtString StHbtMultiTrackCut::Report(){
39  StHbtString temp;
40  temp = "\n StHbtMultiTrackCut::Report() reporting ";
41  temp += (int)mCutCollection->size();
42  temp += " track cuts \n";
43  StHbtTrackCutIterator iter;
44  for (iter=mCutCollection->begin();iter!=mCutCollection->end();iter++){
45  temp += (*iter)->Report();
46  }
47  return temp;
48 }
49 // *************************************************************************
50 bool StHbtMultiTrackCut::Pass(const StHbtTrack* track) {
51  bool temp=0;
52  StHbtTrackCutIterator iter;
53  for (iter=mCutCollection->begin();iter!=mCutCollection->end();iter++){
54  temp = temp || (*iter)->Pass(track);
55  }
56  return temp;
57 }
58 // *************************************************************************
59 void StHbtMultiTrackCut::EventBegin(const StHbtEvent* ev) {
60  StHbtTrackCutIterator iter;
61  for (iter=mCutCollection->begin();iter!=mCutCollection->end();iter++){
62  (*iter)->EventBegin(ev);
63  }
64 }
65 // *************************************************************************
66 void StHbtMultiTrackCut::EventEnd(const StHbtEvent* ev) {
67  StHbtTrackCutIterator iter;
68  for (iter=mCutCollection->begin();iter!=mCutCollection->end();iter++){
69  (*iter)->EventEnd(ev);
70  }
71 }
72 // *************************************************************************
73 void StHbtMultiTrackCut::AddTrackCut(StHbtTrackCut* cut) {
74  mCutCollection->push_back(cut);
75 }
76 // *************************************************************************
77 StHbtMultiTrackCut::StHbtMultiTrackCut(const StHbtMultiTrackCut& cut ) : StHbtTrackCut() {
79  StHbtTrackCutIterator iter;
80  StHbtTrackCut* t;
81  for (iter=cut.mCutCollection->begin();iter!=cut.mCutCollection->end();iter++){
82  t = (*iter)->Clone();
83  if (t) mCutCollection->push_back(t);
84  }
85 }
86 // *************************************************************************
87 StHbtMultiTrackCut* StHbtMultiTrackCut::Clone() {
88  StHbtMultiTrackCut* cut = this->Clone();
89  return cut;
90 }
91 
92 
93