Beispiel #1
0
int main (int argc, char ** argv) 
{
  TChain *tree_CRZLLTree = new TChain("CRZLLTree/crTree");

  //Get the TTree with the candidates
  std::string samplename(argv[2]);
  std::string inputfilename(argv[3]);
  std::string outputfilename(argv[4]);

  HZZ4l analyzer(tree_CRZLLTree, samplename);

  //Set sqrt(s)
  bool is8TeV(atoi(argv[1]));
  analyzer.set8TeV(is8TeV);

  //check if we want to do non-SM shapes
  // 0 means SM
  // 1 means EWK-singlet
  // 2 means 2HDM
  int BSM_flag = 0;
  if(outputfilename.find("kappa") != std::string::npos) BSM_flag = 1;
  if(outputfilename.find("2HDM") != std::string::npos)  BSM_flag = 2;
  analyzer.setBSM(BSM_flag);

  //Let the analyzer know this is a Control Region
  analyzer.setCR(true);

  tree_CRZLLTree->Add(inputfilename.c_str());
 
  //Get the normalization. It's the first bin of the histo
  TFile fIn(inputfilename.c_str());
  std::string histoName = "CRZLLTree/Counters";
  TH1F *nEventComplete = (TH1F*)fIn.Get(histoName.c_str());
  Int_t Nevt_Gen = nEventComplete->GetBinContent(1);

  std::string fileOut_CRZLLTree;     
 
  std::cout << "################################################" << std::endl;
  analyzer.Loop(0, outputfilename);

  return 0;
}
Beispiel #2
0
int main (int argc, char ** argv) 
{
  int theChannel(atoi(argv[1]));

  std::string channelname;

  switch(theChannel){

  case 0:
    channelname = "ZZ4muTree/";
    break;

  case 1:
    channelname = "ZZ4eTree/";
    break;

  case 2:
    channelname = "ZZ2e2muTree/";
    break;

  default:
    std::cout << "Need to specify the correct final state! " << std::endl;
    abort();
  }


  //Get the TTree with the candidates
  std::string chainName = channelname + "candTree";
  TChain *tree = new TChain(chainName.c_str());

  bool is8TeV(atoi(argv[2]));

  std::string filename(argv[3]);
  tree->Add(filename.c_str());

  std::string outputfilename(argv[4]);

  bool isVH(false);
  std::vector<std::string> VHfinalStates;
  VHfinalStates.push_back("splitWH");
  VHfinalStates.push_back("splitZH");
  VHfinalStates.push_back("splitttH");
  if (filename.find("VH")!=std::string::npos) isVH=true;  

  //Get the normalization. It's the first bin of the histo
  TFile fIn(filename.c_str());
  std::string histoName = channelname + "Counters";
  TH1F *nEventComplete = (TH1F*)fIn.Get(histoName.c_str());
  Int_t Nevt_Gen = nEventComplete->GetBinContent(1);

  HZZ4l analyzer(tree);
  if (!isVH || !doVHsplit) {
    std::cout << "################################################" << std::endl;
    std::cout << "Name of the output file : " << outputfilename << std::endl;
    std::cout << "Number of total entries : " << tree->GetEntries() << std::endl ;
    std::cout << "Number of generated events : " << Nevt_Gen << std::endl;
    analyzer.Loop(Nevt_Gen, theChannel, outputfilename.c_str(), is8TeV, 0);
  }
  else{
    analyzer.setVHsplit(true);
    std::string::size_type pos = outputfilename.find("VH");
    for (unsigned int iVH=0; iVH<VHfinalStates.size(); ++iVH){
      std::cout<<filename<<" -> "<<outputfilename<<VHfinalStates[iVH]<<"  "<<pos<<"  "<<std::endl;
      if ( pos != std::string::npos ) outputfilename.replace( pos, 2, VHfinalStates[iVH] ); 
      std::cout << "################################################" << std::endl;
      std::cout << "Name of the output file : " << outputfilename << std::endl;
      std::cout << "Number of total entries : " << tree->GetEntries() << std::endl ;
      std::cout << "Number of generated events : " << Nevt_Gen << std::endl;
      analyzer.Loop(Nevt_Gen, theChannel, outputfilename.c_str(), is8TeV, iVH+1);
    }
  }

  return 0;
}
Beispiel #3
0
int main (int argc, char ** argv)
{
    int theChannel(atoi(argv[1]));

    std::string channelname;

    switch(theChannel) {

    case 0:
        channelname = "ZZ4muTree/";
        break;

    case 1:
        channelname = "ZZ4eTree/";
        break;

    case 2:
        channelname = "ZZ2e2muTree/";
        break;

    default:
        std::cout << "Need to specify the correct final state! " << std::endl;
        abort();
    }


    //Get the TTree with the candidates
    std::string chainName = channelname + "candTree";
    TChain *tree = new TChain(chainName.c_str());

    std::string samplename(argv[3]);
    std::string inputfilename(argv[4]);
    tree->Add(inputfilename.c_str());
    // tree->Show(15);

    std::string outputfilename(argv[5]);

    HZZ4l analyzer(tree, samplename);

    //Set sqrt(s)
    bool is8TeV(atoi(argv[2]));
    analyzer.set8TeV(is8TeV);

    //check if we want to do non-SM shapes
    // 0 means SM
    // 1 means EWK-singlet
    // 2 means 2HDM
    int BSM_flag = 0;
    if(outputfilename.find("kappa") != std::string::npos) BSM_flag = 1;
    if(outputfilename.find("2HDM") != std::string::npos)  BSM_flag = 2;
    analyzer.setBSM(BSM_flag);

    //Get the normalization. It's the first bin of the histo
    TFile fIn(inputfilename.c_str());
    std::string histoName = channelname + "Counters";
    TH1F *nEventComplete = (TH1F*)fIn.Get(histoName.c_str());
    Int_t Nevt_Gen = nEventComplete->GetBinContent(1);
    Float_t Nevt_Gen_weighted = nEventComplete->GetBinContent(0); // Weighted #of events, can be used only when no filter was applied

    //SM case
    if(BSM_flag == 0) {
        std::cout << "################################################" << std::endl;
        analyzer.Loop(theChannel, outputfilename.c_str());
    }

    //EWK-singlet
    else if(BSM_flag == 1) {
        std::cout << "Doing EWK singlet root files!" << std::endl;
        std::string::size_type pos = outputfilename.find("kappa");

        for(float kappa = 0.2; kappa < 1.1 ; kappa = kappa + 0.2) {
            std::cout << "################################################" << std::endl;
            std::cout << "Now doing kappa' = " << kappa << std::endl;
            std::string outputfilename_tmp = outputfilename;
            std::stringstream ss (std::stringstream::in | std::stringstream::out);
            ss << kappa;
            std::string replace_string = "kappa_" + ss.str();
            if(pos != std::string::npos) outputfilename_tmp.replace(pos, 5, replace_string);
            std::cout << outputfilename << " -> " << outputfilename_tmp << std::endl;
            analyzer.setKappa(kappa);
            analyzer.Loop(theChannel, outputfilename_tmp.c_str());
        }

    }


    return 0;
}