当前位置: 首页>>代码示例>>C++>>正文


C++ Analysis::AddSuperModule方法代码示例

本文整理汇总了C++中Analysis::AddSuperModule方法的典型用法代码示例。如果您正苦于以下问题:C++ Analysis::AddSuperModule方法的具体用法?C++ Analysis::AddSuperModule怎么用?C++ Analysis::AddSuperModule使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Analysis的用法示例。


在下文中一共展示了Analysis::AddSuperModule方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: runPixelTreeMaker

void runPixelTreeMaker(Bool_t doMC         = 0,
                       const char *files   = 0,
                       const char *outfile = 0,
                       UInt_t nev          = 0,
		       Float_t SDRelFrac   = 1.)
{
  gDebugMask  = Debug::kAnalysis;
  gDebugLevel = 1;
  gErrorIgnoreLevel = kInfo;

  // setup analysis object
  Analysis *ana = new Analysis;
  ana->SetUseHLT(1);
  if (nev>0)
    ana->SetProcessNEvents(nev);
  TString ofname(gSystem->Getenv("MIT_OUTPUTFILE"));
  if (!ofname.IsNull()) 
    ana->SetOutputName(ofname);

  if (files) {
    TString dummy(files);
    TString suffix(dummy(dummy.Length()-4,dummy.Length()));
    if (suffix.CompareTo("root")==0)
      ana->AddFile(files);
    else
      ana->AddFiles(files);
  }

  HLTMod *hmod = new HLTMod;
  hmod->SetPrintTable(1);
  ana->AddSuperModule(hmod);

  // setup modules
  PixelsMakerMod *mod = new PixelsMakerMod;
  mod->SetIsMC(doMC);
  mod->AddVertexName("Pixel3Vertexes");
  mod->AddVertexName("TrackletVertexes");
  mod->AddVertexName("ClusterVertexes");
  mod->AddVertexName("PixelVertexes");
  mod->AddVertexName("PrimaryVertexes");
  mod->AddVertexName("PrimaryVertexesBeamSpot");
  // - diffractive study -
  mod->SetUseHfOnly(true);
  mod->SetSDRelFrac(SDRelFrac);

  if (outfile)
    mod->SetFileName(Form("%s_SDRelFrac%.1f.root",outfile,SDRelFrac));
  else
    mod->SetFileName("pixeltree.root");

  ana->AddSuperModule(mod);
  
  // run the analysis after successful initialisation
  ana->Run(!gROOT->IsBatch());
}
开发者ID:CmsHI,项目名称:CVS_SavedFMa,代码行数:55,代码来源:runPixelTreeMaker.C

示例2: jetPlusIsoTrack

//--------------------------------------------------------------------------------------------------
void jetPlusIsoTrack(const char *fileset    = "",
                     const char *dataset    = "s8-wm-id9",
                     const char *book       = "mit/filler/006",
                     const char *catalogDir = "/home/mitprod/catalog",
                     Int_t       nEvents    = -1)
{
  TString skimName("jetPlusIsoTrack");
  using namespace mithep;
  gDebugMask  = Debug::kAnalysis;
  gDebugLevel = 1;

  //------------------------------------------------------------------------------------------------
  // organize selection
  //------------------------------------------------------------------------------------------------
  const char     *jetInput   = Names::gkSC5JetBrn;
  const char     *gsfTracks  = "GsfTracks";
  const Double_t  jetPtMin   = 30;
  const Double_t  trackPtMin = 10;

  JetIDMod *jetId = new JetIDMod;  
  jetId->SetInputName  (jetInput);
  jetId->SetUseCorrection(kFALSE);
  jetId->SetPtCut      (jetPtMin); 

  JetPlusIsoTrackSelMod *selMod = new JetPlusIsoTrackSelMod;
  selMod->SetTrackPtMin(trackPtMin);
  selMod->SetJetColName(jetId->GetOutputName());
  selMod->SetTrackerTrackColName(Names::gkTrackBrn);
  selMod->SetGsfTrackColName(gsfTracks);

  //------------------------------------------------------------------------------------------------
  // link modules together
  //------------------------------------------------------------------------------------------------
  
  //------------------------------------------------------------------------------------------------
  // organize output
  //------------------------------------------------------------------------------------------------
  OutputMod *outMod = new OutputMod;
  outMod->Keep("*");
  selMod->Add(outMod);
  TString rootFile = skimName;
  if (TString(fileset) != TString(""))
    rootFile += TString("_") + TString(fileset);
  printf("\nRoot output: %s\n\n",rootFile.Data());  
  outMod->SetFileName(rootFile);
  outMod->SetPathName(".");

  //------------------------------------------------------------------------------------------------
  // set up analysis
  //------------------------------------------------------------------------------------------------
  Analysis *ana = new Analysis;
  ana->AddSuperModule(jetId);
  ana->AddSuperModule(selMod);
  if (nEvents>0)
    ana->SetProcessNEvents(nEvents);

  //------------------------------------------------------------------------------------------------
  // organize input
  //------------------------------------------------------------------------------------------------
  printf("\nRely on Catalog: %s\n",catalogDir);
  printf("  -> Book: %s  Dataset: %s  Fileset: %s <-\n\n",book,dataset,fileset);
  Catalog *c = new Catalog(catalogDir);
  Dataset *d = c->FindDataset(book,dataset,fileset);
  ana->AddDataset(d);

  //------------------------------------------------------------------------------------------------
  // run the analysis after successful initialisation
  //------------------------------------------------------------------------------------------------
  ana->Run(kFALSE);
}
开发者ID:bendavid,项目名称:MitPhysics,代码行数:71,代码来源:jetPlusIsoTrack.C

示例3: runSCNtupler


//.........这里部分代码省略.........
  if(nevents>0) 
    ana->SetProcessNEvents(nevents);
  printf("\nRely on Catalog: %s\n",catalogDir);
  printf("  -> Book: %s  Dataset: %s  Fileset: %s <-\n\n",book,dataset,fileset);
  Catalog *c = new Catalog(catalogDir);
  TString skimdataset = TString(dataset)+TString("/")+TString(skim);
  Dataset *d = NULL;
  TString bookstr = book;
  if (TString(skim).CompareTo("noskim") == 0)
    d = c->FindDataset(bookstr,dataset,fileset,caching);
  else
    d = c->FindDataset(bookstr,skimdataset.Data(),fileset,caching);
  ana->AddDataset(d);
    
  //
  // setup ntupler module
  //
  SCNtuplerMod *mymod = new SCNtuplerMod;
  mymod->SetOutputName(outputName);          // output ntuple file name
  mymod->SetIsData(isData);              // toggle data specific or MC specific procedures
  mymod->SetUseGen(useGen);              // use generator info
  mymod->SetSkipIfHLTFail(skipHLTFail);  // skip to next event if no HLT accept
  mymod->SetFSRMode(fsrmode);
  mymod->SetMuPtMin(muPtMin);
  mymod->SetMuPtMax(muPtMax);
  mymod->SetMuEtaMin(muEtaMin);
  mymod->SetMuEtaMax(muEtaMax);
  mymod->SetEleEtMin(eleEtMin);
  mymod->SetEleEtMax(eleEtMax);
  mymod->SetEleEtaMin(eleEtaMin);
  mymod->SetEleEtaMax(eleEtaMax);
  mymod->SetJetPtMin(jetPtMin);
  mymod->SetSCEtMin(scEtMin);
  mymod->SetMinNTracksFit(minNTracksFit);
  mymod->SetMinNdof(minNdof);
  mymod->SetMaxAbsZ(maxAbsZ);
  mymod->SetMaxRho(maxRho);

  // Jet corrections
  char* PATH = getenv("CMSSW_BASE"); assert(PATH);
  TString path(TString::Format("%s/src/MitPhysics/data/", PATH));

  mymod->AddJetCorr(path + "Summer13_V1_MC_L1FastJet_AK5PF.txt");
  mymod->AddJetCorr(path + "Summer13_V1_MC_L2Relative_AK5PF.txt");
  mymod->AddJetCorr(path + "Summer13_V1_MC_L3Absolute_AK5PF.txt");
  if(isData) {
    mymod->AddJetCorr(path + "Summer13_V1_DATA_L1FastJet_AK5PF.txt");
    mymod->AddJetCorr(path + "Summer13_V1_DATA_L2Relative_AK5PF.txt");
    mymod->AddJetCorr(path + "Summer13_V1_DATA_L3Absolute_AK5PF.txt");
    mymod->AddJetCorr(path + "Summer13_V1_DATA_L2L3Residual_AK5PF.txt");
  }
  //
  // SingleMu
  // these are examples of triggers with trigger objects

  mymod->AddTrigger("HLT_IsoMu24_eta2p1_v11", kHLT_IsoMu24_eta2p1, "hltL3crIsoL1sMu16Eta2p1L1f0L2f16QL3f24QL3crIsoFiltered10", kHLT_IsoMu24_eta2p1Obj);
  mymod->AddTrigger("HLT_IsoMu24_eta2p1_v12", kHLT_IsoMu24_eta2p1, "hltL3crIsoL1sMu16Eta2p1L1f0L2f16QL3f24QL3crIsoFiltered10", kHLT_IsoMu24_eta2p1Obj);
  mymod->AddTrigger("HLT_IsoMu24_eta2p1_v13", kHLT_IsoMu24_eta2p1, "hltL3crIsoL1sMu16Eta2p1L1f0L2f16QL3f24QL3crIsoRhoFiltered0p15", kHLT_IsoMu24_eta2p1Obj);
  mymod->AddTrigger("HLT_IsoMu24_eta2p1_v14", kHLT_IsoMu24_eta2p1, "hltL3crIsoL1sMu16Eta2p1L1f0L2f16QL3f24QL3crIsoRhoFiltered0p15", kHLT_IsoMu24_eta2p1Obj);
  mymod->AddTrigger("HLT_IsoMu24_eta2p1_v15", kHLT_IsoMu24_eta2p1, "hltL3crIsoL1sMu16Eta2p1L1f0L2f16QL3f24QL3crIsoRhoFiltered0p15", kHLT_IsoMu24_eta2p1Obj);

  //
  // SingleElectron
  // these are examples of triggers with trigger objects

  mymod->AddTrigger("HLT_Ele27_WP80_v8", kHLT_Ele27_WP80, "hltEle27WP80TrackIsoFilter", kHLT_Ele27_WP80Obj);
  mymod->AddTrigger("HLT_Ele27_WP80_v9", kHLT_Ele27_WP80, "hltEle27WP80TrackIsoFilter", kHLT_Ele27_WP80Obj);
  mymod->AddTrigger("HLT_Ele27_WP80_v10", kHLT_Ele27_WP80, "hltEle27WP80TrackIsoFilter", kHLT_Ele27_WP80Obj);
  mymod->AddTrigger("HLT_Ele27_WP80_v11", kHLT_Ele27_WP80, "hltEle27WP80TrackIsoFilter", kHLT_Ele27_WP80Obj);

  //
  // DoubleMu
  // and these are just triggers -- no object matching

  mymod->AddTrigger("HLT_Mu17_TkMu8_v9", kHLT_Mu17_TkMu8);
  mymod->AddTrigger("HLT_Mu17_TkMu8_v10", kHLT_Mu17_TkMu8);
  mymod->AddTrigger("HLT_Mu17_TkMu8_v11", kHLT_Mu17_TkMu8);
  mymod->AddTrigger("HLT_Mu17_TkMu8_v12", kHLT_Mu17_TkMu8);
  mymod->AddTrigger("HLT_Mu17_TkMu8_v13", kHLT_Mu17_TkMu8);
  mymod->AddTrigger("HLT_Mu17_TkMu8_v14", kHLT_Mu17_TkMu8);

  //
  // DoubleEle
  // and these are just triggers -- no object matching

  mymod->AddTrigger("HLT_Ele17_CaloIdT_CaloIsoVL_TrkIdVL_TrkIsoVL_Ele8_CaloIdT_CaloIsoVL_TrkIdVL_TrkIsoVL_v15", kHLT_Ele17_CaloIdL_CaloIsoVL);
  mymod->AddTrigger("HLT_Ele17_CaloIdT_CaloIsoVL_TrkIdVL_TrkIsoVL_Ele8_CaloIdT_CaloIsoVL_TrkIdVL_TrkIsoVL_v16", kHLT_Ele17_CaloIdL_CaloIsoVL);
  mymod->AddTrigger("HLT_Ele17_CaloIdT_CaloIsoVL_TrkIdVL_TrkIsoVL_Ele8_CaloIdT_CaloIsoVL_TrkIdVL_TrkIsoVL_v17", kHLT_Ele17_CaloIdL_CaloIsoVL);
  mymod->AddTrigger("HLT_Ele17_CaloIdT_CaloIsoVL_TrkIdVL_TrkIsoVL_Ele8_CaloIdT_CaloIsoVL_TrkIdVL_TrkIsoVL_v18", kHLT_Ele17_CaloIdL_CaloIsoVL);
  mymod->AddTrigger("HLT_Ele17_CaloIdT_CaloIsoVL_TrkIdVL_TrkIsoVL_Ele8_CaloIdT_CaloIsoVL_TrkIdVL_TrkIsoVL_v19", kHLT_Ele17_CaloIdL_CaloIsoVL);

  mymod->SetPrintHLT(kFALSE); // print HLT table at start of analysis? good for debugging.. also lots of spam
  
  ana->AddSuperModule(mymod); 
    
  //
  // run analysis after successful initialisation
  //
  ana->Run(!gROOT->IsBatch());
}
开发者ID:jaylawhorn,项目名称:mitewk,代码行数:101,代码来源:runSCNtupler.C

示例4: runMonoJetSkim


//.........这里部分代码省略.........
  if (TString(fileset) != TString(""))
    outputName += TString("_") + TString(fileset);
  
  OutputMod *skimOutput = new OutputMod;

  skimOutput->Keep("*");
  skimOutput->Drop("L1TechBits*");
  skimOutput->Drop("L1AlgoBits*");
  skimOutput->Drop("MCVertexes");
  skimOutput->Drop("PFEcal*SuperClusters");
  skimOutput->Drop("*Tracks");
  skimOutput->Drop("StandaloneMuonTracksWVtxConstraint");
  skimOutput->Drop("PrimaryVertexesBeamSpot");
  skimOutput->Drop("InclusiveSecondaryVertexes");
  skimOutput->Drop("CosmicMuons");
  skimOutput->Drop("MergedElectronsStable");
  skimOutput->Drop("MergedConversions*");
  skimOutput->Drop("AKT8GenJets");
  skimOutput->Drop("AKt4PFJets");
  skimOutput->Drop("DCASig");
  skimOutput->AddNewBranch(type1MetCorr->GetOutputName());
  skimOutput->AddNewBranch(monojetSel->GetCategoryFlagsName());

  skimOutput->SetMaxFileSize(10 * 1024); // 10 GB - should never exceed
  skimOutput->SetFileName(outputName);
  skimOutput->SetPathName(".");
  skimOutput->SetCheckTamBr(false);
  skimOutput->SetKeepTamBr(false);
  skimOutput->SetCheckBrDep(true);
  skimOutput->SetUseBrDep(true);

  skimOutput->AddCondition(monojetSel);

  //------------------------------------------------------------------------------------------------
  // making the analysis chain
  //------------------------------------------------------------------------------------------------
  auto mItr(modules.begin());
  while (true) {
    auto* mod = *(mItr++);
    if (mItr == modules.end())
      break;
    mod->Add(*mItr);
  }

  //------------------------------------------------------------------------------------------------
  // setup analysis
  //------------------------------------------------------------------------------------------------
  Analysis *ana = new Analysis;
  ana->SetUseCacher(1);
  ana->SetUseHLT(kTRUE);
  ana->SetAllowNoHLTTree(kTRUE); // for private MC with no HLT info
  ana->SetKeepHierarchy(kFALSE);
  ana->SetPrintScale(100);
  ana->SetOutputName(outputName + "_hist.root");
  if (nEvents >= 0)
    ana->SetProcessNEvents(nEvents);

  ana->AddSuperModule(modules.front());
  ana->AddOutputMod(skimOutput);

  //------------------------------------------------------------------------------------------------
  // organize input
  //------------------------------------------------------------------------------------------------
  Catalog *c = new Catalog(catalogDir);
  TString skimDataset = TString(dataset)+TString("/") +TString(skim);
  Dataset *d = NULL;
  if (TString(skim).CompareTo("noskim") == 0)
    d = c->FindDataset(book,dataset,fileset, 1); // 1 to use smartcache
  else
    d = c->FindDataset(book,skimDataset.Data(),fileset, 1);
  ana->AddDataset(d);
  ana->SetCacheSize(0);

  //------------------------------------------------------------------------------------------------
  // Say what we are doing
  //------------------------------------------------------------------------------------------------
  printf("\n==== PARAMETER SUMMARY FOR THIS JOB ====\n");
  printf("\n JSON file: %s\n", json.Data());
  printf("\n Rely on Catalog: %s\n",catalogDir);
  printf("  -> Book: %s  Dataset: %s  Skim: %s  Fileset: %s <-\n",book,dataset,skim,fileset);
  printf("\n========================================\n");

  std::cout << std::endl;
  std::cout << "+++++ ANALYSIS FLOW +++++" << std::endl;
  ana->PrintModuleTree();
  std::cout << std::endl;
  std::cout << "+++++++++++++++++++++++++" << std::endl;

  //------------------------------------------------------------------------------------------------
  // run the analysis after successful initialisation
  //------------------------------------------------------------------------------------------------
  ana->Run(false);

  delete ana; // all modules deleted recursively

  // rename the output file so that condor can see it
  gSystem->Rename("./" + outputName + "_000.root", "./" + outputName + ".root");

  return;
}
开发者ID:DylanHsu,项目名称:MitPhysics,代码行数:101,代码来源:runMonoJetSkim.C


注:本文中的Analysis::AddSuperModule方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。