ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/Jeng/PVStudy/src/PVHistograms.cc
(Generate patch)

Comparing UserCode/Jeng/PVStudy/src/PVHistograms.cc (file contents):
Revision 1.1 by jengbou, Fri Dec 4 08:38:17 2009 UTC vs.
Revision 1.2 by jengbou, Fri Dec 4 20:41:58 2009 UTC

# Line 2 | Line 2
2     class:   PVHistograms.cc
3  
4     author: Geng-yuan Jeng, UC Riverside (Geng-yuan.Jeng@cern.ch)
5 +           Yanyan Gao, Fermilab (ygao@fnal.gov)
6  
7     version $Id$
8  
# Line 9 | Line 10
10  
11  
12   #include "UserCode/PVStudy/interface/PVHistograms.h"
13 < #include "TF1.h"
13 <
14 < #include<iostream>
13 > #include <iostream>
14  
15   //_______________________________________________________________
16   PVHistograms::PVHistograms() {
# Line 30 | Line 29 | void PVHistograms::Init(TString type, TS
29  
30    TString methodName = suffix1;
31    if (suffix2 != "") suffix1 += "_" + suffix2;
33  //std::cout << "suffix1 = " << suffix1 << std::endl;
32  
33    if (type == "pvTrk") {
34      // Histograms of track properties
# Line 119 | Line 117 | void PVHistograms::InitA(TString type, T
117  
118    TString methodName = suffix1;
119    if (suffix2 != "") suffix1 += "_" + suffix2;
122  //std::cout << "suffix1 = " << suffix1 << std::endl;
120  
121    if (type == "analysis") {
122 <    h2["resx"+suffix1]= new TH2D("resx"+suffix1, "x-resolution vs number of tracks in pvtx"+methodName, nTrkMax_-nTrkMin_,nTrkMin_-0.5,nTrkMax_-0.5,400,0.,200);
122 >    h2["resx"+suffix1]= new TH2D("resx"+suffix1, "x-resolution vs number of tracks in pvtx"+methodName, nTrkMax_-nTrkMin_,nTrkMin_,nTrkMax_,400,0.,200);
123      h2["resx"+suffix1]->SetMarkerStyle(21);
124      h2["resx"+suffix1]->SetMarkerColor(4);
125      h2["resx"+suffix1]->GetXaxis()->SetTitle("Num of tracks");
126      h2["resx"+suffix1]->GetYaxis()->SetTitle("#mum");
127 <    h2["resy"+suffix1]= new TH2D("resy"+suffix1, "y-resolution vs number of tracks in pvtx"+methodName, nTrkMax_-nTrkMin_,nTrkMin_-0.5,nTrkMax_-0.5,400,0.,200);
127 >    h2["resy"+suffix1]= new TH2D("resy"+suffix1, "y-resolution vs number of tracks in pvtx"+methodName, nTrkMax_-nTrkMin_,nTrkMin_,nTrkMax_,400,0.,200);
128      h2["resy"+suffix1]->SetMarkerStyle(21);
129      h2["resy"+suffix1]->SetMarkerColor(4);
130      h2["resy"+suffix1]->GetXaxis()->SetTitle("Num of tracks");
131      h2["resy"+suffix1]->GetYaxis()->SetTitle("#mum");
132 <    h2["resz"+suffix1]= new TH2D("resz"+suffix1, "z-resolution vs number of tracks in pvtx"+methodName, nTrkMax_-nTrkMin_,nTrkMin_-0.5,nTrkMax_-0.5,400,0.,200);
132 >    h2["resz"+suffix1]= new TH2D("resz"+suffix1, "z-resolution vs number of tracks in pvtx"+methodName, nTrkMax_-nTrkMin_,nTrkMin_,nTrkMax_,400,0.,200);
133      h2["resz"+suffix1]->SetMarkerStyle(21);
134      h2["resz"+suffix1]->SetMarkerColor(4);
135      h2["resz"+suffix1]->GetXaxis()->SetTitle("Num of tracks");
136      h2["resz"+suffix1]->GetYaxis()->SetTitle("#mum");
137 <    h2["pullx"+suffix1]= new TH2D("pullx"+suffix1, "x-pull vs number of tracks"+methodName, nTrkMax_-nTrkMin_,nTrkMin_-0.5,nTrkMax_-0.5,100,0.,2.);
137 >    h2["pullx"+suffix1]= new TH2D("pullx"+suffix1, "x-pull vs number of tracks"+methodName, nTrkMax_-nTrkMin_,nTrkMin_,nTrkMax_,100,0.,2.);
138      h2["pullx"+suffix1]->SetMarkerStyle(21);
139      h2["pullx"+suffix1]->SetMarkerColor(4);
140      h2["pullx"+suffix1]->SetBit(TH1::kCanRebin);
141      h2["pullx"+suffix1]->GetXaxis()->SetTitle("Num of tracks");
142 <    h2["pully"+suffix1]= new TH2D("pully"+suffix1, "y-pull vs number of tracks"+methodName, nTrkMax_-nTrkMin_,nTrkMin_-0.5,nTrkMax_-0.5,100,0.,2.);
142 >    h2["pully"+suffix1]= new TH2D("pully"+suffix1, "y-pull vs number of tracks"+methodName, nTrkMax_-nTrkMin_,nTrkMin_,nTrkMax_,100,0.,2.);
143      h2["pully"+suffix1]->SetMarkerStyle(21);
144      h2["pully"+suffix1]->SetMarkerColor(4);
145      h2["pully"+suffix1]->SetBit(TH1::kCanRebin);
146      h2["pully"+suffix1]->GetXaxis()->SetTitle("Num of tracks");
147 <    h2["pullz"+suffix1]= new TH2D("pullz"+suffix1, "z-pull vs number of tracks"+methodName, nTrkMax_-nTrkMin_,nTrkMin_-0.5,nTrkMax_-0.5,100,0.,2.);
147 >    h2["pullz"+suffix1]= new TH2D("pullz"+suffix1, "z-pull vs number of tracks"+methodName, nTrkMax_-nTrkMin_,nTrkMin_,nTrkMax_,100,0.,2.);
148      h2["pullz"+suffix1]->SetMarkerStyle(21);
149      h2["pullz"+suffix1]->SetMarkerColor(4);
150      h2["pullz"+suffix1]->SetBit(TH1::kCanRebin);
# Line 157 | Line 154 | void PVHistograms::InitA(TString type, T
154  
155   }
156  
160
161 //_______________________________________________________________
162 void PVHistograms::Counter(TString name) {
163
164  h1["counter"]->Fill(name, 1);
165 }
166
157   //_______________________________________________________________
158   void PVHistograms::Fill1d(TString name, Double_t x, Double_t weight) {
159  
# Line 174 | Line 164 | void PVHistograms::Fill1d(TString name,
164   void PVHistograms::Fill2d(TString name, Double_t x, Double_t y, Double_t weight) {
165  
166    h2[name]->Fill(x,y,weight);
177        
167   }
168  
169   //_______________________________________________________________
# Line 187 | Line 176 | void PVHistograms::Print(TString extensi
176      TString tmpname = icv->first;
177      TCanvas *acv = icv->second;
178      acv->Print(TString(tmpname+tag+"."+extension));
179 <  }              
179 >  }
180  
181   }
182 +
183   //_______________________________________________________________
184   void PVHistograms::Save() {
185          
# Line 215 | Line 205 | void PVHistograms::SaveToFile(TString fi
205      TH2D *htemp = (TH2D*) ih->second;
206      htemp->Write();
207    }
208 <                
208 >  
209    foutfile->Write();
210    foutfile->Close();
211 <        
211 >  
212   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines