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.2 by buchmann, Thu Feb 9 15:59:08 2012 UTC vs.
Revision 1.3 by buchmann, Wed Apr 18 09:21:03 2012 UTC

# Line 169 | Line 169 | public:
169    THStack DrawStack(string m_histoname,string m_var, int m_nbins, float m_minx, float m_maxx, string m_xlabel, string m_ylabel, TCut Cut, bool m_is_data, float luminosity, bool drawsignal);
170    THStack DrawStack(string m_histoname,string m_var, vector<float> binning, string m_xlabel, string m_ylabel, TCut Cut, bool m_is_data, float luminosity, bool drawsignal);
171    vector<int> FindSample(string what);
172 +  vector<int> FindSampleBySampleName(string what);
173    void ListSamples();
174    bool do_sample(int thissample, vector<int> &selected_samples);
175    Color_t GetColor(string filename);
# Line 492 | Line 493 | vector<int> samplecollection::FindSample
493        hitcollection.push_back(isam);
494      } else {
495      }
496 +  }
497 +  if(hitcollection.size()==0) {
498 +    hitcollection.push_back(-1);
499 +    write_warning(__FUNCTION__,"Couldn't find sample "+string(what)+" using sample collection \""+string(this->name)+"\"");
500 +  }
501 +  return hitcollection;
502 + }
503 +
504 + vector<int> samplecollection::FindSampleBySampleName(string what)
505 + {
506 +  vector<int> hitcollection;
507 +  for(unsigned int isam=0;isam<(this->collection).size();isam++)
508 +  {
509 +    if(((this->collection)[isam].samplename).find(what)!=string::npos) {
510 +      hitcollection.push_back(isam);
511 +    } else {
512 +    }
513    }
514    if(hitcollection.size()==0) {
515      hitcollection.push_back(-1);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines