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.1 by loizides, Fri Nov 28 20:27:23 2008 UTC vs.
Revision 1.2 by loizides, Thu Dec 4 13:52:27 2008 UTC

# Line 42 | Line 42 | namespace mithep
42        Double_t                 fPtMax;      //maximum pt
43        Double_t                 fEtaMin;     //minimum eta
44        Double_t                 fEtaMax;     //maximum eta
45 <      T                       *fCol;        //!pointer to collection
45 >      Bool_t                   fLoadBr;     //=true then load branch (def=1)
46 >      const Collection<T>     *fCol;        //!pointer to collection
47        TH1D                    *fPtHist;     //!pt histogram
48        TH1D                    *fEtaHist;    //!eta histogram
49 +      TH1D                    *fMassHist;   //!mass histogram
50 +      TH1D                    *fMtHist;     //!mt histogram
51  
52        void                     Process();
53        void                     SlaveBegin();
# Line 62 | Line 65 | mithep::PlotKineMod<T>::PlotKineMod(cons
65    fPtMax(5000),
66    fEtaMin(-10),
67    fEtaMax(10),
68 +  fLoadBr(kTRUE),
69    fCol(0),
70    fPtHist(0),
71    fEtaHist(0)
# Line 75 | Line 79 | void mithep::PlotKineMod<T>::Process()
79   {
80    // Process entries of the tree: Just load the branch and fill the histograms.
81  
82 <  LoadBranch(GetColName());
83 <
82 >  if (fLoadBr)
83 >    LoadBranch(GetColName());
84 >  else
85 >    fCol = GetObjThisEvt<Collection<T> >(GetColName());
86 >    
87    Int_t ents=fCol->GetEntries();
88    for(Int_t i=0;i<ents;++i) {
89 <     const Particle *p = fCol->At(i);
89 >     const T *p = fCol->At(i);
90       Double_t pt = p->Pt();
91       if (pt<fPtMin)
92         continue;
# Line 101 | Line 108 | void mithep::PlotKineMod<T>::SlaveBegin(
108   {
109    // Request a branch and create the histograms.
110  
111 <  ReqBranch(GetColName(), fCol);
111 >  if (fLoadBr)
112 >    ReqBranch(GetColName(), fCol);
113  
114 <  fPtHist  = new TH1D("hPtHist",";p_{t};#",100,0.,25.);
114 >  fPtHist  = new TH1D("hPtHist",";p_{t} [GeV];#",100,0.,250.);
115    AddOutput(fPtHist);
116    fEtaHist = new TH1D("hEtaHist",";#eta;#",160,-8.,8.);
117    AddOutput(fEtaHist);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines