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.17 by buchmann, Thu Oct 11 08:57:44 2012 UTC vs.
Revision 1.18 by buchmann, Wed Nov 7 10:53:36 2012 UTC

# Line 83 | Line 83 | sample::sample(string m_filename, string
83      
84    if(doesROOTFileExist(this->filename)) {
85      //suppressing  stupid 64/32 errors here (Warning in <TFile::ReadStreamerInfo>: /scratch/buchmann/MC_Spring11_PU_PF/TToBLNu_TuneZ2_t-channel_7TeV-madgraph.root: not a TStreamerInfo object)
86 <    Int_t currlevel=gErrorIgnoreLevel;
87 <    gErrorIgnoreLevel=5000;
86 > //    Int_t currlevel=gErrorIgnoreLevel;
87 > //     gErrorIgnoreLevel=5000;
88      this->tfile = new TFile(m_filename.c_str());
89 <    gErrorIgnoreLevel=currlevel;
89 > //     gErrorIgnoreLevel=currlevel;
90      this->events=(TTree*)(this->tfile)->Get(treename.c_str());
91      if(Verbosity>0) dout << "The " << write_mc_or_data(is_data) << " file " << this->filename << " has been added successfully to the list of samples. " << endl;
92      long long measured_nevents=(long)1;
# Line 144 | Line 144 | void sample::closeFile()
144   bool doesROOTFileExist(string filename)
145   {
146    //suppressing  stupid 64/32 errors here (Warning in <TFile::ReadStreamerInfo>: /scratch/buchmann/MC_Spring11_PU_PF/TToBLNu_TuneZ2_t-channel_7TeV-madgraph.root: not a TStreamerInfo object)
147 <  Int_t currlevel=gErrorIgnoreLevel;
148 <  gErrorIgnoreLevel=5000;
147 > //   Int_t currlevel=gErrorIgnoreLevel;
148 > //   gErrorIgnoreLevel=5000;
149    TFile *f = new TFile(filename.c_str());
150    
151    if (f->IsZombie()) {
# Line 153 | Line 153 | bool doesROOTFileExist(string filename)
153      return 0;
154    }
155    f->Close();
156 <  gErrorIgnoreLevel=currlevel;
156 > //   gErrorIgnoreLevel=currlevel;
157    return 1;
158   }
159   //********************************************************
# Line 241 | Line 241 | void samplecollection::ListSamples()
241   void samplecollection::AddSample(string m_filename,string m_samplename,long m_Nentries, float m_xs,bool is_data, bool m_is_signal, int groupindex, Color_t newcolor)
242   {
243    sample NewSample(m_filename,m_samplename,m_Nentries,m_xs,is_data,m_is_signal,groupindex,newcolor);
244 +  if (!NewSample.is_active) {
245 +    write_warning(__FUNCTION__,"Not adding this sample ("+m_filename+") as it has been declared inactive");
246 +    return;
247 +  }
248    (this->collection).push_back(NewSample);
249    if((this->collection).size()==1) {
250      this->nmcsamples=0;
# Line 323 | Line 327 | TH1F* samplecollection::Draw(string m_hi
327      tempdrawhisto->Sumw2();
328      if(use_this_sample) {
329        (this->collection)[isample].events->Draw(drawthis.str().c_str(),(essentialcut&&Cut)*cutWeight);//this weight is based on PU etc. not XS
330 < //    cout << "\033[1;33m Drawing " << drawthis.str() << "   with cut   " << (const char*) (essentialcut&&Cut)*cutWeight << " for sample " <<  (this->collection)[isample].filename << "\033[0m   (overflow: " << addoverunderflowbins << ")" << endl;
330 > //       cout << "\033[1;33m Drawing " << drawthis.str() << "   with cut   " << (const char*) (essentialcut&&Cut)*cutWeight << " for sample " <<  (this->collection)[isample].filename << "\033[0m   (overflow: " << addoverunderflowbins << ")" << endl;
331        if(addoverunderflowbins) {
332          //now also adding the overflow & underflow bins:
333          tempdrawhisto->SetBinContent(tempdrawhisto->GetNbinsX(),tempdrawhisto->GetBinContent(tempdrawhisto->GetNbinsX()+1)+tempdrawhisto->GetBinContent(tempdrawhisto->GetNbinsX()));
# Line 589 | Line 593 | TLegend* samplecollection::allbglegend(s
593   }
594  
595   TLegend* samplecollection::allbglegend(string title="",float posx=0.65, float posy=0.60) {
596 <  Int_t currlevel=gErrorIgnoreLevel;
597 <  gErrorIgnoreLevel=5000;
596 > //   Int_t currlevel=gErrorIgnoreLevel;
597 > //   gErrorIgnoreLevel=5000;
598    TH1F *blub = new TH1F("nothing","nothing",1,0,1);
599 <  gErrorIgnoreLevel=currlevel;//we know this possibly replaces a previous histo, but we don't care since it's fake anyway.
599 > //   gErrorIgnoreLevel=currlevel;//we know this possibly replaces a previous histo, but we don't care since it's fake anyway.
600    return this->allbglegend(title,blub,posx,posy);
601   }
602  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines