ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/cbrown/Development/Plotting/Modules/SampleClass.C
(Generate patch)

Comparing UserCode/cbrown/Development/Plotting/Modules/SampleClass.C (file contents):
Revision 1.7 by buchmann, Wed May 23 15:13:17 2012 UTC vs.
Revision 1.9 by buchmann, Tue Jun 5 09:18:29 2012 UTC

# Line 45 | Line 45 | public:
45    bool is_data;
46    bool is_signal;
47    bool is_active;
48 +  float weightrenormalization;
49    int groupindex;
50    Color_t samplecolor;
51    
# Line 72 | Line 73 | sample::sample(string m_filename, string
73    this->groupindex=m_groupindex;
74    this->is_active=true;
75    this->samplecolor=mycolor;
76 +  this->weightrenormalization=1.0;
77    if(!doesROOTFileExist(this->filename)) {
78      stringstream message;
79      message << "The " << write_mc_or_data(is_data) << " sample " << this->samplename << " is invalid because the associated file path, " << this->filename << " is incorrect.";
# Line 106 | Line 108 | sample::sample(string m_filename, string
108        if(m_Nentries>1) write_warning(__FUNCTION__,warning.str());
109        this->Nentries=measured_nevents;
110      }
111 <    this->weight=(xs/(float)Nentries);
112 <    TH1F *weight_histo = (TH1F*)(this->tfile)->Get("weight_histo");
111 <    this->weight/=average_weight;
111 >    this->weight=(xs/(float)Nentries)/average_weight;
112 >    this->weightrenormalization=(1.0/average_weight);
113    }
114    else {
115      this->is_active=false;
# Line 217 | Line 218 | void samplecollection::ListSamples()
218      dout << "MC sample(s): " << endl;
219      for (int isamp=0;isamp<(int)this->collection.size();isamp++)
220        {
221 <        if(!(this->collection)[isamp].is_data) dout << " - " << (this->collection)[isamp].samplename << " (" << (this->collection)[isamp].filename << ") xs=" << (this->collection)[isamp].xs << " pb, N(events)=" << (this->collection)[isamp].Nentries << endl;
221 >        if(!(this->collection)[isamp].is_data) dout << " - " << (this->collection)[isamp].samplename << " (" << (this->collection)[isamp].filename << ") xs=" << (this->collection)[isamp].xs << " pb, N(events)=" << (this->collection)[isamp].Nentries << " , RN = " << (this->collection)[isamp].weightrenormalization << endl;
222        }
223    }
224    dout << "---------------------------------------------------------------------------------------------------" << endl;
# Line 270 | Line 271 | TH1F* samplecollection::Draw(string m_hi
271    if(Verbosity>0) dout << endl << endl;
272    if(Verbosity>0) dout << "-------------------------------------------------------------------------------------" << endl;
273    if(Verbosity>0) dout << "histoname : " << m_histoname << " , m_var = " << m_var << ", m_xlabel=" << m_xlabel << " m_ylabel=" << m_ylabel << " m_is_data = " << m_is_data << " lumi = " << luminosity << " onlyindex size: " << onlyindex.size() << endl;
274 +  
275    if(HUSH==0) dout << "Drawing histo called " << m_histoname << "... " << endl;
276    bool do_only_selected_samples=false;
277    if(onlyindex.size()>0&&onlyindex[0]!=-1) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines