#include <PlotKinem.h>
Inheritance diagram for Anp::PlotKinem:

Public Member Functions | |
| PlotKinem () | |
| virtual | ~PlotKinem () |
| bool | Run (Record &record) |
| bool | Run (Event &event, const Record &record, bool pass) |
| void | Config (const Registry ®) |
| void | Set (TDirectory *dir) |
| void | End (const DataBlock &) |
Private Types | |
| typedef std::map< std::string, Anp::Handle< Anp::HistKinem > > | PlotMap |
Private Member Functions | |
| bool | Fill (const std::string &input, const RecoNu &rnu, double weight) |
| short | GetBinX (const RecoNu &rnu) const |
| short | GetBinQ2 (const RecoNu &rnu) const |
| TH2 * | GetTH2 (const std::string &key, const std::string &name="") |
Private Attributes | |
| std::string | fDirName |
| bool | fPlot |
| int | fNMiss |
| double | fEHCut |
| TDirectory * | fDir |
| PlotMap | fMap |
| TH2 * | fXvsQ2 |
| TH2 * | fEvsQ2 |
| TH2 * | fEvsX |
|
|
Definition at line 79 of file PlotKinem.h. |
|
|
Definition at line 98 of file PlotKinem.cxx. 00099 :fDirName("kinem"), 00100 fPlot(false), 00101 fNMiss(0), 00102 fEHCut(0.15), 00103 fDir(0) 00104 { 00105 }
|
|
|
Definition at line 108 of file PlotKinem.cxx. 00109 {
00110 }
|
|
|
Reimplemented from Anp::AlgEvent. Definition at line 162 of file PlotKinem.cxx. References fDirName, fEHCut, Registry::Get(), Registry::KeyExists(), and reg. 00163 {
00164 const char *value_char = 0;
00165 if(reg.Get("PlotKinemDirName", value_char) && value_char)
00166 {
00167 fDirName = value_char;
00168 }
00169
00170 reg.Get("PlotKinemEHCut", fEHCut);
00171
00172 if(reg.KeyExists("PrintConfig"))
00173 {
00174 cout << "PlotKinem::Config" << endl
00175 << " EHCut = " << fEHCut << endl
00176 << " DirName = " << fDirName << endl;
00177 }
00178 }
|
|
|
Reimplemented from Anp::AlgEvent. Definition at line 204 of file PlotKinem.cxx.
|
|
||||||||||||||||
|
Definition at line 211 of file PlotKinem.cxx. References fDir, fMap, Anp::GetDir(), and Anp::Handle< T >::release(). Referenced by Run(). 00212 {
00213 //
00214 // Handle "all" differently to break recursive chain
00215 //
00216
00217 PlotMap::iterator hit = fMap.find(input);
00218 if(hit == fMap.end())
00219 {
00220 Handle<HistKinem> hist(new HistKinem());
00221 TDirectory *dir = fDir;
00222 if(input != "all") dir = Anp::GetDir(input, fDir);
00223
00224 //
00225 // Create histograms
00226 //
00227 if(!(hist -> Make(dir)))
00228 {
00229 hist.release();
00230 }
00231
00232 hit = fMap.insert(PlotMap::value_type(input, hist)).first;
00233 }
00234
00235 if((hit -> second).valid())
00236 {
00237 return (hit -> second) -> Fill(rnu, weight);
00238 }
00239
00240 return false;
00241 }
|
|
|
Definition at line 258 of file PlotKinem.cxx. References Anp::RecoNu::Q2(). 00259 {
00260 const double q2 = rnu.Q2();
00261
00262 if (q2 < 0.00) return -1;
00263 else if(q2 < 0.30) return 1;
00264 else if(q2 < 0.70) return 2;
00265 else if(q2 < 1.50) return 3;
00266 else if(q2 < 4.00) return 4;
00267
00268 return 5;
00269 }
|
|
|
Definition at line 244 of file PlotKinem.cxx. References Anp::RecoNu::X(). 00245 {
00246 const double x = rnu.X();
00247
00248 if (x < 0.0) return -1;
00249 else if(x < 0.13) return 1;
00250 else if(x < 0.23) return 2;
00251 else if(x < 0.35) return 3;
00252 else if(x < 0.60) return 4;
00253
00254 return 5;
00255 }
|
|
||||||||||||
|
Definition at line 272 of file PlotKinem.cxx. References fDir, and Anp::SetDir(). 00273 {
00274 TH2 *h = HistMan::Instance().CreateTH2(key, "kinem");
00275 if(h)
00276 {
00277 Anp::SetDir(h, fDir, name);
00278 }
00279 else
00280 {
00281 ++fNMiss;
00282 }
00283
00284 return h;
00285 }
|
|
||||||||||||||||
|
Implements Anp::AlgEvent. Definition at line 124 of file PlotKinem.cxx. References Anp::RecoNu::EHad(), Anp::RecoNu::ELep(), Anp::RecoNu::ENeu(), Anp::RecoNu::EQES(), fEvsQ2, fEvsX, Fill(), fXvsQ2, Anp::Event::GetNu(), Anp::RecoNu::Q2(), Anp::RecoNu::SetEHad(), Anp::RecoNu::Weight(), and Anp::RecoNu::X(). 00125 {
00126 if(!pass || !fPlot)
00127 {
00128 return true;
00129 }
00130
00131 RecoNu rnu = event.GetNu();
00132 if(rnu.EHad() < fEHCut)
00133 {
00134 rnu.SetEHad(std::max<double>(0.0, rnu.EQES() - rnu.ELep()));
00135 }
00136
00137 PlotKinem::Fill("all", rnu, rnu.Weight());
00138
00139 fXvsQ2 -> Fill(rnu.Q2(), rnu.X(), rnu.Weight());
00140 fEvsQ2 -> Fill(rnu.Q2(), rnu.ENeu(), rnu.Weight());
00141 fEvsX -> Fill(rnu.X(), rnu.ENeu(), rnu.Weight());
00142
00143 const short bin_x = PlotKinem::GetBinX (rnu);
00144 const short bin_q2 = PlotKinem::GetBinQ2(rnu);
00145
00146 if(bin_x >= 0 && bin_q2 >= 0)
00147 {
00148 stringstream bname, xname, qname;
00149 bname << "bin_xq2_" << bin_x << "_" << bin_q2;
00150 xname << "bin_x_" << bin_x;
00151 qname << "bin_q2_" << bin_q2;
00152
00153 PlotKinem::Fill(bname.str(), rnu, rnu.Weight());
00154 PlotKinem::Fill(xname.str(), rnu, rnu.Weight());
00155 PlotKinem::Fill(qname.str(), rnu, rnu.Weight());
00156 }
00157
00158 return true;
00159 }
|
|
|
Implements Anp::AlgSnarl. Definition at line 113 of file PlotKinem.cxx. References Anp::Record::EventBegIterator(), Anp::Record::EventEndIterator(), and Anp::EventIterator. 00114 {
00115 for(EventIterator ievent = record.EventBegIterator(); ievent != record.EventEndIterator(); ++ievent)
00116 {
00117 PlotKinem::Run(*ievent, record, true);
00118 }
00119
00120 return true;
00121 }
|
|
|
Reimplemented from Anp::AlgEvent. Definition at line 181 of file PlotKinem.cxx. References fDir, fDirName, fEvsQ2, fEvsX, fNMiss, fPlot, fXvsQ2, and Anp::GetDir(). 00182 {
00183 fPlot = false;
00184
00185 if(!dir) return;
00186
00187 fDir = Anp::GetDir(fDirName, dir);
00188
00189 fXvsQ2 = PlotKinem::GetTH2("x_vs_q2");
00190 fEvsQ2 = PlotKinem::GetTH2("e_vs_q2");
00191 fEvsX = PlotKinem::GetTH2("e_vs_x");
00192
00193 if(fNMiss == 0)
00194 {
00195 fPlot = true;
00196 }
00197 else
00198 {
00199 cerr << "PlotKinem::Make - missed " << fNMiss << " histograms" << endl;
00200 }
00201 }
|
|
|
Definition at line 90 of file PlotKinem.h. |
|
|
Definition at line 83 of file PlotKinem.h. |
|
|
Definition at line 88 of file PlotKinem.h. Referenced by Config(). |
|
|
Definition at line 95 of file PlotKinem.h. |
|
|
Definition at line 96 of file PlotKinem.h. |
|
|
Definition at line 92 of file PlotKinem.h. |
|
|
Definition at line 86 of file PlotKinem.h. Referenced by Set(). |
|
|
Definition at line 85 of file PlotKinem.h. Referenced by Set(). |
|
|
Definition at line 94 of file PlotKinem.h. |
1.3.9.1