11 |
|
#ifndef MITANA_PHYSICSMOD_PLOTKINEMOD_H |
12 |
|
#define MITANA_PHYSICSMOD_PLOTKINEMOD_H |
13 |
|
|
14 |
+ |
#include "MitAna/DataCont/interface/Collection.h" |
15 |
|
#include "MitAna/TreeMod/interface/BaseMod.h" |
15 |
– |
#include "MitAna/DataTree/interface/Collections.h" |
16 |
|
#include <TH1D.h> |
17 |
|
|
18 |
|
namespace mithep |
30 |
|
const char *GetInputName() const { return GetColName(); } |
31 |
|
Double_t GetPtMin() const { return fPtMin; } |
32 |
|
Double_t GetPtMax() const { return fPtMax; } |
33 |
– |
Bool_t GetLoadBranch() const { return fLoadBr; } |
33 |
|
void SetColName(const char *n) { fColName=n; } |
34 |
|
void SetEntriesMax(Int_t e) { fEntriesMax = e; } |
35 |
|
void SetEtaMin(Double_t e) { fEtaMin = e; } |
36 |
|
void SetEtaMax(Double_t e) { fEtaMax = e; } |
37 |
|
void SetInputName(const char *n) { SetColName(n); } |
39 |
– |
void SetLoadBranch(Bool_t b) { fLoadBr = b; } |
38 |
|
void SetPtMin(Double_t pt) { fPtMin = pt; } |
39 |
|
void SetPtMax(Double_t pt) { fPtMax = pt; } |
40 |
|
|
44 |
|
void SlaveBegin(); |
45 |
|
|
46 |
|
TString fColName; //name of collection |
49 |
– |
Bool_t fLoadBr; //=true then load branch (def=1) |
47 |
|
Double_t fPtMin; //minimum pt |
48 |
|
Double_t fPtMax; //maximum pt |
49 |
|
Double_t fEtaMin; //minimum eta |
63 |
|
mithep::PlotKineMod<T>::PlotKineMod(const char *name, const char *title) : |
64 |
|
BaseMod(name,title), |
65 |
|
fColName("SetMe"), |
69 |
– |
fLoadBr(kTRUE), |
66 |
|
fPtMin(1), |
67 |
|
fPtMax(5000), |
68 |
|
fEtaMin(-10), |
80 |
|
|
81 |
|
//-------------------------------------------------------------------------------------------------- |
82 |
|
template<class T> |
87 |
– |
Bool_t mithep::PlotKineMod<T>::Load() |
88 |
– |
{ |
89 |
– |
// Load data from branch or get pointer from event. |
90 |
– |
|
91 |
– |
if (GetLoadBranch()) |
92 |
– |
LoadBranch(GetColName()); |
93 |
– |
else |
94 |
– |
fCol = GetObjThisEvt<Collection<T> >(GetColName()); |
95 |
– |
|
96 |
– |
return (fCol!=0); |
97 |
– |
} |
98 |
– |
|
99 |
– |
//-------------------------------------------------------------------------------------------------- |
100 |
– |
template<class T> |
83 |
|
void mithep::PlotKineMod<T>::Process() |
84 |
|
{ |
85 |
|
// Process entries of the tree: Just load the branch and fill the histograms. |
86 |
|
|
87 |
< |
if (!Load()) { |
87 |
> |
if (!LoadEventObject(GetColName(), fCol)) { |
88 |
|
SendError(kAbortModule, "Process", "Could not load data!"); |
89 |
|
return; |
90 |
|
} |
117 |
|
{ |
118 |
|
// Request a branch and create the histograms. |
119 |
|
|
120 |
< |
if (GetLoadBranch()) |
139 |
< |
ReqBranch(GetColName(), fCol); |
120 |
> |
ReqEventObject(GetColName(), fCol); |
121 |
|
|
122 |
|
if (GetFillHist()) { |
123 |
|
Int_t ptbins = (Int_t)((fPtMax-fPtMin)/2.5); |