Exemple #1
0
void GetCounts(std::vector<ABCDCount>& counts, std::vector<TTree*>& trees,
	       const std::vector<double>& weights){
  counts.resize(trees.size());
  for(unsigned int i(0); i<trees.size(); ++i){
    if(trees.at(i)->GetEntries()>0){
      std::vector<double> a_count(4), b_count(4), c_count(4), d_count(4);
      trees.at(i)->SetBranchAddress("AWeighted_sbin1", &a_count.at(0));
      trees.at(i)->SetBranchAddress("AWeighted_sbin2", &a_count.at(1));
      trees.at(i)->SetBranchAddress("AWeighted_sbin3", &a_count.at(2));
      trees.at(i)->SetBranchAddress("AWeighted_sbin4", &a_count.at(3));
      trees.at(i)->SetBranchAddress("BWeighted_sbin1", &b_count.at(0));
      trees.at(i)->SetBranchAddress("BWeighted_sbin2", &b_count.at(1));
      trees.at(i)->SetBranchAddress("BWeighted_sbin3", &b_count.at(2));
      trees.at(i)->SetBranchAddress("BWeighted_sbin4", &b_count.at(3));
      trees.at(i)->SetBranchAddress("C2bWeighted_sbin1", &c_count.at(0));
      trees.at(i)->SetBranchAddress("C2bWeighted_sbin2", &c_count.at(1));
      trees.at(i)->SetBranchAddress("C2bWeighted_sbin3", &c_count.at(2));
      trees.at(i)->SetBranchAddress("C2bWeighted_sbin4", &c_count.at(3));
      trees.at(i)->SetBranchAddress("D2bWeighted_sbin1", &d_count.at(0));
      trees.at(i)->SetBranchAddress("D2bWeighted_sbin2", &d_count.at(1));
      trees.at(i)->SetBranchAddress("D2bWeighted_sbin3", &d_count.at(2));
      trees.at(i)->SetBranchAddress("D2bWeighted_sbin4", &d_count.at(3));
      trees.at(i)->GetEntry(0);
      counts.at(i).SetCounts(a_count, b_count, c_count, d_count);
      counts.at(i).SetWeight(weights.at(i));
    }
  }
}
	static void sample_method(B * b) {
		printf("sample called: %d", b_count(b));
		last_count = b_count(b);
	}