StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
trackCutMonitor_P.cxx
1 #include "StHbtMaker/Infrastructure/StHbtTrack.hh"
2 #include "StHbtMaker/Infrastructure/StHbtTypes.hh"
3 #include "StHbtMaker/Cut/trackCutMonitor_P.h"
4 #include <cstdio>
5 
6 #ifdef __ROOT__
7 ClassImp(trackCutMonitor_P)
8 #endif
9 
10 trackCutMonitor_P::trackCutMonitor_P(){
11  mHisto = new StHbt1DHisto("P","momentum (GeV/c)",20,0.,2.);
12  mHisto->SetDirectory(0);
13 }
14 //------------------------------
15 trackCutMonitor_P::trackCutMonitor_P(const char* TitCutMoni, const char* title,
16  int nbins, double min, double max){
17  mHisto = new StHbt1DHisto(TitCutMoni, title, nbins , min, max);
18  mHisto->SetDirectory(0);
19 }
20 //------------------------------
21 trackCutMonitor_P::~trackCutMonitor_P(){
22  delete mHisto;
23 }
24 
25 //------------------------------
26 void trackCutMonitor_P::Fill(const StHbtTrack* track){
27  mHisto->Fill( abs(track->P()), 1.);
28 }
29 
30 //------------------------------
31 void trackCutMonitor_P::Finish(){
32  cout << " entries in histogram : " << mHisto->Integral() << endl;
33 }
34 
35 //------------------------------
36 StHbtString trackCutMonitor_P::Report(){
37  string Stemp;
38  char Ctemp[100];
39  sprintf(Ctemp," report some stuff");
40  Stemp=Ctemp;
41  StHbtString returnThis = Stemp;
42  return returnThis;
43 }
44