ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/PhysicsMod/interface/PlotKineMod.h
(Generate patch)

Comparing UserCode/MitAna/PhysicsMod/interface/PlotKineMod.h (file contents):
Revision 1.9 by loizides, Mon May 18 06:30:38 2009 UTC vs.
Revision 1.12 by loizides, Wed Jun 17 11:50:27 2009 UTC

# Line 11 | Line 11
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
# Line 30 | Line 30 | 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  
# Line 46 | Line 44 | namespace mithep
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
# Line 57 | Line 54 | namespace mithep
54        TH1D                    *fEtaHist;    //!eta histogram
55        TH1D                    *fEntHist;    //!entries histogram
56  
57 <      ClassDefT(PlotKineMod, 1) // Plot kinematics module
57 >      ClassDef(PlotKineMod, 1) // Plot kinematics module
58    };
59   }
60  
# Line 66 | Line 63 | template<class T>
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),
# Line 84 | Line 80 | mithep::PlotKineMod<T>::PlotKineMod(cons
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    }
# Line 135 | Line 117 | void mithep::PlotKineMod<T>::SlaveBegin(
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);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines