]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG2/FEMTOSCOPY/AliFemto/Infrastructure/AliFemtoCutMonitorHandler.cxx
This commit was generated by cvs2svn to compensate for changes in r18145,
[u/mrichter/AliRoot.git] / PWG2 / FEMTOSCOPY / AliFemto / Infrastructure / AliFemtoCutMonitorHandler.cxx
1
2 #include "Infrastructure/AliFemtoCutMonitorHandler.h"
3 #include "Infrastructure/AliFemtoTypes.h"
4
5 #ifdef __ROOT__
6 ClassImp(AliFemtoCutMonitorHandler)
7 #endif
8 // ---------------------------------------------------------------------------
9 AliFemtoCutMonitorHandler::AliFemtoCutMonitorHandler() {
10   cout << " *** AliFemtoCutMonitorHandler::AliFemtoCutMonitorHandler() " << endl;
11   fCollectionsEmpty = 0;
12   fPassColl = new AliFemtoCutMonitorCollection();
13   fFailColl = new AliFemtoCutMonitorCollection();
14 }
15 // ---------------------------------------------------------------------------
16 AliFemtoCutMonitorHandler::~AliFemtoCutMonitorHandler() { 
17   delete fPassColl;
18   delete fFailColl;
19 }   
20 // ---------------------------------------------------------------------------
21 void AliFemtoCutMonitorHandler::FillCutMonitor(const AliFemtoEvent* event, bool pass) { 
22   if (fCollectionsEmpty) return;
23   AliFemtoCutMonitorIterator iter;
24   AliFemtoCutMonitor* CM;
25   if ( pass) {
26     for (iter=fPassColl->begin(); iter!=fPassColl->end(); iter++){
27       CM = *iter;
28       CM->Fill(event);
29     }
30   } else {
31     for (iter=fFailColl->begin(); iter!=fFailColl->end(); iter++){
32       CM = *iter;
33       CM->Fill(event);
34     }
35   }
36 }
37 // ---------------------------------------------------------------------------
38 void AliFemtoCutMonitorHandler::FillCutMonitor(const AliFemtoTrack* track, bool pass) { 
39   if (fCollectionsEmpty) return;
40   AliFemtoCutMonitorIterator iter;
41   AliFemtoCutMonitor* CM;
42   if ( pass) {
43     for (iter=fPassColl->begin(); iter!=fPassColl->end(); iter++){
44       CM = *iter;
45       CM->Fill(track);
46     }
47   } else {
48     for (iter=fFailColl->begin(); iter!=fFailColl->end(); iter++){
49       CM = *iter;
50       CM->Fill(track);
51     }
52   }
53 }
54 // ---------------------------------------------------------------------------
55 void AliFemtoCutMonitorHandler::FillCutMonitor(const AliFemtoV0* v0, bool pass) { 
56   if (fCollectionsEmpty) return;
57   AliFemtoCutMonitorIterator iter;
58   AliFemtoCutMonitor* CM;
59   if ( pass) {
60     for (iter=fPassColl->begin(); iter!=fPassColl->end(); iter++){
61       CM = *iter;
62       CM->Fill(v0);
63     }
64   } else {
65     for (iter=fFailColl->begin(); iter!=fFailColl->end(); iter++){
66       CM = *iter;
67       CM->Fill(v0);
68     }
69   }
70 }
71 // ---------------------------------------------------------------------------
72 void AliFemtoCutMonitorHandler::FillCutMonitor(const AliFemtoKink* kink, bool pass) { 
73   if (fCollectionsEmpty) return;
74   AliFemtoCutMonitorIterator iter;
75   AliFemtoCutMonitor* CM;
76   if ( pass) {
77     for (iter=fPassColl->begin(); iter!=fPassColl->end(); iter++){
78       CM = *iter;
79       CM->Fill(kink);
80     }
81   } else {
82     for (iter=fFailColl->begin(); iter!=fFailColl->end(); iter++){
83       CM = *iter;
84       CM->Fill(kink);
85     }
86   }
87 }
88 // ---------------------------------Gael/12/04/02-----------------------------
89 void AliFemtoCutMonitorHandler::FillCutMonitor(const AliFemtoPair* pair, bool pass) { 
90   if (fCollectionsEmpty) return;
91   AliFemtoCutMonitorIterator iter;
92   AliFemtoCutMonitor* CM;
93   if ( pass) {
94     for (iter=fPassColl->begin(); iter!=fPassColl->end(); iter++){
95       CM = *iter;
96       CM->Fill(pair);
97     }
98   } else {
99     for (iter=fFailColl->begin(); iter!=fFailColl->end(); iter++){
100       CM = *iter;
101       CM->Fill(pair);
102     }
103   }
104 }
105 // ---------------------------------Gael/19/06/02-----------------------------
106 void AliFemtoCutMonitorHandler::FillCutMonitor(const AliFemtoParticleCollection* partColl) {
107   if (fCollectionsEmpty) return;
108   AliFemtoCutMonitorIterator iter;
109   AliFemtoCutMonitor* CM;
110   
111   for (iter=fPassColl->begin(); iter!=fPassColl->end(); iter++){
112     CM = *iter;
113     CM->Fill(partColl);
114   }
115 }
116 // ------------------------------------Gael/19/06/02-------------------------
117 void AliFemtoCutMonitorHandler::FillCutMonitor(const AliFemtoEvent* event,const AliFemtoParticleCollection* partColl) {
118   
119   cout<<"In AliFemtoCutMonitorHandler::FillCutMonitor(const AliFemtoEvent* event, AliFemtoPicoEvent* picoEvent)"<<endl;
120   if (fCollectionsEmpty) return;
121   AliFemtoCutMonitorIterator iter;
122   AliFemtoCutMonitor* CM;
123   
124   for (iter=fPassColl->begin(); iter!=fPassColl->end(); iter++){
125     CM = *iter;
126     CM->Fill(event,partColl);
127   }
128 }
129 // ---------------------------------------------------------------------------
130 void AliFemtoCutMonitorHandler::Finish() { 
131   AliFemtoCutMonitorIterator iter;
132   for (iter=fPassColl->begin(); iter!=fPassColl->end(); iter++){
133     (*iter)->Finish();
134   }
135   for (iter=fFailColl->begin(); iter!=fFailColl->end(); iter++){
136     (*iter)->Finish();
137   }
138 }
139 // ---------------------------------------------------------------------------
140 void AliFemtoCutMonitorHandler::AddCutMonitor(AliFemtoCutMonitor* cutMoni1, AliFemtoCutMonitor* cutMoni2) { 
141   fPassColl->push_back(cutMoni1);
142   fFailColl->push_back(cutMoni2);
143   fCollectionsEmpty=false;
144 }
145 // ---------------------------------------------------------------------------
146 void AliFemtoCutMonitorHandler::AddCutMonitor(AliFemtoCutMonitor* cutMoni) { 
147   cout << " make a copy of the cutmonitor and push both into the collections " << endl;
148   cout << " not yet implemented" << endl;
149   fPassColl->push_back(cutMoni);
150   cout << " only pass collection pushed" << endl;
151   fCollectionsEmpty=false;
152 }
153 // ---------------------------------------------------------------------------
154 void AliFemtoCutMonitorHandler::AddCutMonitorPass(AliFemtoCutMonitor* cutMoni) { 
155   fPassColl->push_back(cutMoni);
156   fCollectionsEmpty=false;
157 }
158 // ---------------------------------------------------------------------------
159 void AliFemtoCutMonitorHandler::AddCutMonitorFail(AliFemtoCutMonitor* cutMoni) { 
160   fFailColl->push_back(cutMoni);
161   fCollectionsEmpty=false;
162 }
163 // ---------------------------------------------------------------------------
164 AliFemtoCutMonitor* AliFemtoCutMonitorHandler::PassMonitor(int n) { 
165   AliFemtoCutMonitorIterator iter = fPassColl->begin();
166   if ( (int)fPassColl->size() <= n ) return NULL;
167   for ( int i=0; i<n; i++)
168     iter++;
169   return *iter;
170 }
171 // ---------------------------------------------------------------------------
172 AliFemtoCutMonitor* AliFemtoCutMonitorHandler::FailMonitor(int n) { 
173   AliFemtoCutMonitorIterator iter = fFailColl->begin();
174   if ( (int)fFailColl->size() <= n ) return NULL;
175   for ( int i=0; i<n; i++)
176     iter++;
177   return *iter;
178 }
179
180
181
182  
183