HeavyIonsAnalysis/JetAnalysis/src/HiJetMatchAnalyzer.cc
void
HiJetMatchAnalyzer::beginJob(){
  t= fs->make<TTree>("t","Jet Response Analyzer");
  t->Branch("nref",&jra_.nref,"nref/I");
  t->Branch("jtpt",jra_.jtpt,"jtpt[nref]/F");
  t->Branch("jteta",jra_.jteta,"jteta[nref]/F");
  t->Branch("jtphi",jra_.jtphi,"jtphi[nref]/F");
  t->Branch("jtrawpt",jra_.jtrawpt,"jtrawpt[nref]/F");

  if(correctJets_){
    t->Branch("l2",jra_.l2,"l2[nref]/F");
    t->Branch("l3",jra_.l3,"l3[nref]/F");
  }
  t->Branch("area",jra_.area,"area[nref]/F");
  t->Branch("pu",jra_.pu,"pu[nref]/F");
  t->Branch("rho",jra_.rho,"rho[nref]/F");

  t->Branch("refpt",jra_.refpt,"refpt[nref]/F");
  t->Branch("refcorpt",jra_.refpt,"refcorpt[nref]/F");
  t->Branch("refeta",jra_.refeta,"refeta[nref]/F");
  t->Branch("refphi",jra_.refphi,"refphi[nref]/F");
  t->Branch("weight",&jra_.weight,"weight/F");

  jraMatch_.clear();
  for(unsigned int im = 0; im < matchTags_.size(); ++im){
    JRA jrm;
    jraMatch_.push_back(jrm);
  }

  for(unsigned int im = 0; im < matchTags_.size(); ++im){
    t->Branch(Form("jtpt%d",im),jraMatch_[im].jtpt,Form("jtpt%d[nref]/F",im));
    t->Branch(Form("jteta%d",im),jraMatch_[im].jteta,Form("jteta%d[nref]/F",im));
    t->Branch(Form("jtphi%d",im),jraMatch_[im].jtphi,Form("jtphi%d[nref]/F",im));
    t->Branch(Form("jtrawpt%d",im),jraMatch_[im].jtrawpt,Form("jtrawpt%d[nref]/F",im));

    if((bool)correctMatchedJets_[im]){
      t->Branch(Form("l2_%d",im),jraMatch_[im].l2,Form("l2_%d[nref]/F",im));
      t->Branch(Form("l3_%d",im),jraMatch_[im].l3,Form("l3_%d[nref]/F",im));
    }

    t->Branch(Form("area%d",im),jraMatch_[im].area,Form("area%d[nref]/F",im));
    t->Branch(Form("pu%d",im),jraMatch_[im].pu,Form("pu%d[nref]/F",im));
    t->Branch(Form("rho%d",im),jraMatch_[im].rho,Form("rho%d[nref]/F",im));

  }

}
// ------------ method called once each job just before starting event loop  ------------
method called once each job just before starting event loop
method called once each job just before starting event loop
void
HiJetMatchAnalyzer::beginJob(){
  t= fs->make<TTree>("t","Jet Response Analyzer");
  t->Branch("nref",&jra_.nref,"nref/I");
  t->Branch("jtpt",jra_.jtpt,"jtpt[nref]/F");
  t->Branch("jteta",jra_.jteta,"jteta[nref]/F");
  t->Branch("jtphi",jra_.jtphi,"jtphi[nref]/F");
  t->Branch("jtrawpt",jra_.jtrawpt,"jtrawpt[nref]/F");
  if(correctJets_){
    t->Branch("l2",jra_.l2,"l2[nref]/F");
    t->Branch("l3",jra_.l3,"l3[nref]/F");
  }
  t->Branch("area",jra_.area,"area[nref]/F");
  t->Branch("pu",jra_.pu,"pu[nref]/F");
  t->Branch("rho",jra_.rho,"rho[nref]/F");
  t->Branch("refpt",jra_.refpt,"refpt[nref]/F");
  t->Branch("refcorpt",jra_.refpt,"refcorpt[nref]/F");
  t->Branch("refeta",jra_.refeta,"refeta[nref]/F");
  t->Branch("refphi",jra_.refphi,"refphi[nref]/F");
  t->Branch("weight",&jra_.weight,"weight/F");
  jraMatch_.clear();
  for(unsigned int im = 0; im < matchTags_.size(); ++im){
    JRA jrm;
    jraMatch_.push_back(jrm);
  }
  for(unsigned int im = 0; im < matchTags_.size(); ++im){
    t->Branch(Form("jtpt%d",im),jraMatch_[im].jtpt,Form("jtpt%d[nref]/F",im));
    t->Branch(Form("jteta%d",im),jraMatch_[im].jteta,Form("jteta%d[nref]/F",im));
    t->Branch(Form("jtphi%d",im),jraMatch_[im].jtphi,Form("jtphi%d[nref]/F",im));
    t->Branch(Form("jtrawpt%d",im),jraMatch_[im].jtrawpt,Form("jtrawpt%d[nref]/F",im));
    if((bool)correctMatchedJets_[im]){
      t->Branch(Form("l2_%d",im),jraMatch_[im].l2,Form("l2_%d[nref]/F",im));
      t->Branch(Form("l3_%d",im),jraMatch_[im].l3,Form("l3_%d[nref]/F",im));
    }
    t->Branch(Form("area%d",im),jraMatch_[im].area,Form("area%d[nref]/F",im));
    t->Branch(Form("pu%d",im),jraMatch_[im].pu,Form("pu%d[nref]/F",im));
    t->Branch(Form("rho%d",im),jraMatch_[im].rho,Form("rho%d[nref]/F",im));
  }
}
void HiJetMatchAnalyzer :: beginJob ( ) { t = fs -> make < TTree > ( " " , " " ) ; t -> Branch ( " " , & jra_ . nref , " " ) ; t -> Branch ( " " , jra_ . jtpt , " " ) ; t -> Branch ( " " , jra_ . jteta , " " ) ; t -> Branch ( " " , jra_ . jtphi , " " ) ; t -> Branch ( " " , jra_ . jtrawpt , " " ) ; if ( correctJets_ ) { t -> Branch ( " " , jra_ . l2 , " " ) ; t -> Branch ( " " , jra_ . l3 , " " ) ; } t -> Branch ( " " , jra_ . area , " " ) ; t -> Branch ( " " , jra_ . pu , " " ) ; t -> Branch ( " " , jra_ . rho , " " ) ; t -> Branch ( " " , jra_ . refpt , " " ) ; t -> Branch ( " " , jra_ . refpt , " " ) ; t -> Branch ( " " , jra_ . refeta , " " ) ; t -> Branch ( " " , jra_ . refphi , " " ) ; t -> Branch ( " " , & jra_ . weight , " " ) ; jraMatch_ . clear ( ) ; for ( unsigned int im = 0 ; im < matchTags_ . size ( ) ; ++ im ) { JRA jrm ; jraMatch_ . push_back ( jrm ) ; } for ( unsigned int im = 0 ; im < matchTags_ . size ( ) ; ++ im ) { t -> Branch ( Form ( " " , im ) , jraMatch_ [ im ] . jtpt , Form ( " " , im ) ) ; t -> Branch ( Form ( " " , im ) , jraMatch_ [ im ] . jteta , Form ( " " , im ) ) ; t -> Branch ( Form ( " " , im ) , jraMatch_ [ im ] . jtphi , Form ( " " , im ) ) ; t -> Branch ( Form ( " " , im ) , jraMatch_ [ im ] . jtrawpt , Form ( " " , im ) ) ; if ( ( bool ) correctMatchedJets_ [ im ] ) { t -> Branch ( Form ( " " , im ) , jraMatch_ [ im ] . l2 , Form ( " " , im ) ) ; t -> Branch ( Form ( " " , im ) , jraMatch_ [ im ] . l3 , Form ( " " , im ) ) ; } t -> Branch ( Form ( " " , im ) , jraMatch_ [ im ] . area , Form ( " " , im ) ) ; t -> Branch ( Form ( " " , im ) , jraMatch_ [ im ] . pu , Form ( " " , im ) ) ; t -> Branch ( Form ( " " , im ) , jraMatch_ [ im ] . rho , Form ( " " , im ) ) ; } }
method called once each job just before starting event loop
method called once each job just before starting event loop