Pluto v6.3.0
Loading...
Searching...
No Matches
PProjector.h
Go to the documentation of this file.
1// Author: Ingo Froehlich
2// Written: 14/02/2007
3// Modified:
4
5#ifndef _PPROJECTOR_H_
6#define _PPROJECTOR_H_
7
8#include "PBulkInterface.h"
9#include "PBatch.h"
10#include "TH2.h"
11#include "TH3.h"
12
13#define PROJECTOR_MAX_BATCH 100
14#include "TNtuple.h"
15
16#define PROJECTOR_MAX_BRANCHES 50
17#define PROJECTOR_MAX_STACK 100
18
19
21
22 private:
23
25 TH3 *hist3[PROJECTOR_MAX_BATCH];
26 TH2 *hist2[PROJECTOR_MAX_BATCH];
27 TH1 *hist1[PROJECTOR_MAX_BATCH];
28// PDensityMatrix *matrix[PROJECTOR_MAX_BATCH];
29 Int_t fFillFlag[PROJECTOR_MAX_BATCH];
30 int batch_pos, force_weight;
31
32 int pid_param, link_param,batch_particle_param, batch_value_param,
33 stream_default_pos_param, stream_max_pos_param;
34
35 int key, key_x, key_y, key_z;
36 Double_t *x, *y, *z, *w;
37
38 Double_t *proj_nr;
39
40 FILE *current_ascii_file;
41
42 //for NTuple part:
43 TNtuple *fp_out[PROJECTOR_MAX_BATCH], *fp_in[PROJECTOR_MAX_BATCH];
45 Int_t key_pos_out[PROJECTOR_MAX_BATCH];
47 Int_t key_pos_in[PROJECTOR_MAX_BATCH];
48 Float_t values[PROJECTOR_MAX_BRANCHES];
50 Int_t num_events_in[PROJECTOR_MAX_BATCH];
51 Int_t num_events_in_c[PROJECTOR_MAX_BATCH];
52
53 //for embedding particles
54 Int_t stackpointer;
56 Int_t SetParticles(PParticle ** mstack, int *decay_done,
57 int * num, int stacksize, Int_t first_time); //set the particles from the stream
58
59 protected:
60
61
62 public:
63
66
67
68 Bool_t Modify(PParticle **stack, int *decay_done, int *num, int stacksize); //bulk interface
69
70 Bool_t AddCommand(const char *command); //adds a command line to batch
71 Bool_t Do(const char *command) {return AddCommand(command);};
72 Bool_t AddHistogram(TH3 *histo, const char *command = "",
73 Int_t fillflag = 1); //Add a command and a histogram as a tool object
74 Bool_t AddHistogram(TH2 * histo, const char *command = "",
75 Int_t fillflag = 1); //Add a command and a histogram as a tool object
76 Bool_t AddHistogram(TH1 *histo, const char *command = "",
77 Int_t fillflag = 1); //Add a command and a histogram as a tool object
78 //fillflag=0: do not fill
79 // =1: fill with weight
80 // =2: fill without weight
81
82 Bool_t AddTGraph (TGraph *graph, const char *command);
83 Bool_t AddTGraph2D(TGraph2D *graph2d, const char *command);
84
85 Bool_t AddInputTNtuple(TNtuple *n, const char *command = "");
86 Bool_t Input(TNtuple *n) {
87 return AddInputTNtuple(n);
88 };
89 Bool_t AddInputASCII(const char *filename, const char *command = "");
90
91 Bool_t AddOutputTNtuple(TNtuple *n, const char *command = "");
92 Bool_t AddOutputASCII(const char *filename, const char *command = "");
93
94 Bool_t CloseFile(void) {
95 if (!current_ascii_file) return kFALSE;
96 current_ascii_file = NULL;
97 return kTRUE;
98 };
99 Bool_t IsFileOpen(void) {
100 if (!current_ascii_file) return kFALSE;
101 return kTRUE;
102 }
103
104 void Print(const Option_t *delme=NULL) const ;
105
106 ClassDef(PProjector, 0) // Project particle array to histograms
107};
108#endif
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
#define PROJECTOR_MAX_BATCH
Definition PProjector.h:13
#define PROJECTOR_MAX_STACK
Definition PProjector.h:17
#define PROJECTOR_MAX_BRANCHES
Definition PProjector.h:16
input AddCommand("myeta = P3M(0.,0.,0.,eta.mass)")
Bool_t IsFileOpen(void)
Definition PProjector.h:99
Bool_t AddTGraph2D(TGraph2D *graph2d, const char *command)
void Print(const Option_t *delme=NULL) const
Bool_t CloseFile(void)
Definition PProjector.h:94
Bool_t AddInputASCII(const char *filename, const char *command="")
Bool_t Modify(PParticle **stack, int *decay_done, int *num, int stacksize)
Bool_t AddHistogram(TH2 *histo, const char *command="", Int_t fillflag=1)
Bool_t AddOutputTNtuple(TNtuple *n, const char *command="")
Bool_t AddOutputASCII(const char *filename, const char *command="")
Bool_t AddTGraph(TGraph *graph, const char *command)
Bool_t Do(const char *command)
Definition PProjector.h:71
Bool_t AddCommand(const char *command)
Bool_t AddInputTNtuple(TNtuple *n, const char *command="")
Bool_t AddHistogram(TH3 *histo, const char *command="", Int_t fillflag=1)
Bool_t AddHistogram(TH1 *histo, const char *command="", Int_t fillflag=1)
Bool_t Input(TNtuple *n)
Definition PProjector.h:86
TString filename("eta_dalitz_a")
Int_t n
Definition etap+omeg.C:21
TH1F * histo