StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
eventCutMonitor_ReactionPlane.cxx
1 #include "StHbtMaker/Infrastructure/StHbtEvent.hh"
2 #include "StHbtMaker/Infrastructure/StHbtTypes.hh"
3 #include "StHbtMaker/Cut/eventCutMonitor_ReactionPlane.h"
4 #include <cstdio>
5 #include <cmath>
6 
7 #ifdef __ROOT__
9 #endif
10 eventCutMonitor_ReactionPlane::eventCutMonitor_ReactionPlane(){
11  mScaler = new StHbt1DHisto("Scaler", "Scaler", 100, -0.5, 99.5);
12  mVertexX = new StHbt1DHisto("VertexX", "VertexX", 100, -2.,2.);
13  mVertexY = new StHbt1DHisto("VertexY", "VertexY", 100, -2.,2.);
14  mVertexZ = new StHbt1DHisto("VertexZ", "VertexZ", 100, -300.,300.);
15  mReactionPlane = new StHbt1DHisto("ReactionPlane", "ReactionPlane", 36, -2.*asin(1.), 2.*asin(1.) );
16  mReactionPlaneError = new StHbt1DHisto("ReactionPlaneError", "ReactionPlaneError", 36, 0., 2.*asin(1.) );
17  mMultReactionPlaneError = new StHbt2DHisto("Mult_vs_ReactionPlaneError", "Mult_vs_ReactionPlaneError", 36, 0., 2.*asin(1.),100,0,5.e2);
18 }
19 //------------------------------
20 eventCutMonitor_ReactionPlane::eventCutMonitor_ReactionPlane(const char* title1, const char* title2,
21  int nbins, double min, double max){
22  char tit1[100];
23  sprintf(tit1,"%s%s_Scaler",title1,title2);
24  mScaler = new StHbt1DHisto(tit1, "Scaler", 100, -0.5,99.5);
25  sprintf(tit1,"%s%s_VertexX",title1,title2);
26  mVertexX = new StHbt1DHisto(tit1, "VertexX", 100, -1.,1.);
27  sprintf(tit1,"%s%s_VertexY",title1,title2);
28  mVertexY = new StHbt1DHisto(tit1, "VertexY", 100, -1.,1.);
29  sprintf(tit1,"%s%s_VertexZ",title1,title2);
30  mVertexZ = new StHbt1DHisto(tit1, "VertexZ", 100, -200.,200.);
31  sprintf(tit1,"%s%s_ReactionPlane",title1,title2);
32  mReactionPlane = new StHbt1DHisto(tit1,"ReactionPlane", nbins, min, max);
33  sprintf(tit1,"%s%s_ReactionPlaneError",title1,title2);
34  mReactionPlaneError = new StHbt1DHisto(tit1,"ReactionPlaneError", nbins , min, max);
35  sprintf(tit1,"%s%s_MultReactionPlaneError",title1,title2);
36  mMultReactionPlaneError = new StHbt2DHisto(tit1,"MultReactionPlaneError", nbins, min, max ,100,0,1.e3);
37 }
38 //------------------------------
39 eventCutMonitor_ReactionPlane::~eventCutMonitor_ReactionPlane(){
40  delete mScaler;
41  delete mVertexX;
42  delete mVertexY;
43  delete mVertexZ;
44  delete mReactionPlane;
45  delete mReactionPlaneError;
46  delete mMultReactionPlaneError;
47 }
48 
49 //------------------------------
50 void eventCutMonitor_ReactionPlane::Fill(const StHbtEvent* event){
51  mScaler->Fill(0.); // fill event counter
52  mVertexX->Fill( event->PrimVertPos().x(), 1.);
53  mVertexY->Fill( event->PrimVertPos().y(), 1.);
54  mVertexZ->Fill( event->PrimVertPos().z(), 1.);
55  mReactionPlane->Fill( event->ReactionPlane(), 1.);
56  mReactionPlaneError->Fill( event->ReactionPlaneError(), 1.);
57  mMultReactionPlaneError->Fill( event->ReactionPlaneError(), event->UncorrectedNumberOfNegativePrimaries());
58 }
59 
60 //------------------------------
61 void eventCutMonitor_ReactionPlane::Finish(){
62  cout << " entries in histogram mReactionPlane : " << mReactionPlane->Integral() << endl;
63  cout << " entries in histogram mReactionPlaneError : " << mReactionPlaneError->Integral() << endl;
64  cout << " entries in histogram mMultReactionPlaneError : " << mMultReactionPlaneError->Integral() << endl;
65 }
66 
67 //------------------------------
68 StHbtString eventCutMonitor_ReactionPlane::Report(){
69  string Stemp;
70  char Ctemp[100];
71  sprintf(Ctemp," eventCutMonitor_ReactionPlane");
72  Stemp=Ctemp;
73  StHbtString returnThis = Stemp;
74  return returnThis;
75 }
76