本文整理汇总了C++中Analysis::SetProcessNEvents方法的典型用法代码示例。如果您正苦于以下问题:C++ Analysis::SetProcessNEvents方法的具体用法?C++ Analysis::SetProcessNEvents怎么用?C++ Analysis::SetProcessNEvents使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Analysis
的用法示例。
在下文中一共展示了Analysis::SetProcessNEvents方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: runH4lSkim
//--------------------------------------------------------------------------------------------------
void runH4lSkim(const char *fileset = "0000",
const char *skim = "noskim",
const char *dataset = "r11b-pho-pr-v1",
const char *book = "local/filefi/025",
const char *catalogDir = "/home/cmsprod/catalog",
const char *outputName = "h4l",
int nEvents = 1000)
{
//------------------------------------------------------------------------------------------------
// some parameters get passed through the environment
//------------------------------------------------------------------------------------------------
char json[1024], overlap[1024], path[1024];
float overlapCut = -1;
if (decodeEnv(json,overlap,overlapCut,path) != 0)
return;
TString jsonFile = TString("/home/cmsprod/cms/json/") + TString(json);
Bool_t isData = (jsonFile.CompareTo("/home/cmsprod/cms/json/~") != 0);
printf("\n Initialization worked: \n\n");
printf(" JSON : %s (file: %s)\n", json,jsonFile.Data());
printf(" OVERLAP: %s\n\n",overlap);
printf(" PATH : %s\n", path);
printf(" isData : %d\n\n",isData);
//------------------------------------------------------------------------------------------------
// some global setups
//------------------------------------------------------------------------------------------------
using namespace mithep;
gDebugMask = Debug::kGeneral;
gDebugLevel = 3;
//------------------------------------------------------------------------------------------------
// set up information
//------------------------------------------------------------------------------------------------
RunLumiSelectionMod *runLumiSel = new RunLumiSelectionMod;
runLumiSel->SetAcceptMC(kTRUE); // Monte Carlo events are always accepted
// only select on run- and lumisection numbers when valid json file present
if ((jsonFile.CompareTo("/home/cmsprod/cms/json/~") != 0) &&
(jsonFile.CompareTo("/home/cmsprod/cms/json/-") != 0) ) {
printf("\n Jason file added: %s \n\n",jsonFile.Data());
runLumiSel->AddJSONFile(jsonFile.Data());
}
if ((jsonFile.CompareTo("/home/cmsprod/cms/json/-") == 0) ) {
printf("\n WARNING -- Looking at data without JSON file: always accept.\n\n");
runLumiSel->SetAbortIfNotAccepted(kFALSE); // accept all events if there is no valid JSON file
}
printf("\n Run lumi worked. \n\n");
//------------------------------------------------------------------------------------------------
// the skimmer
//------------------------------------------------------------------------------------------------
H4lSkim *skmMod = new H4lSkim();
//------------------------------------------------------------------------------------------------
// making analysis chain
//------------------------------------------------------------------------------------------------
runLumiSel->Add(skmMod);
//------------------------------------------------------------------------------------------------
// setup analysis
//------------------------------------------------------------------------------------------------
Analysis *ana = new Analysis;
ana->SetUseHLT (kTRUE);
ana->SetKeepHierarchy(kTRUE);
ana->SetSuperModule (runLumiSel);
ana->SetPrintScale (100);
if (nEvents >= 0)
ana->SetProcessNEvents(nEvents);
//------------------------------------------------------------------------------------------------
// 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);
else
d = c->FindDataset(book,skimDataset.Data(),fileset);
ana->AddDataset(d);
//------------------------------------------------------------------------------------------------
// organize hist/ntuple output
//------------------------------------------------------------------------------------------------
ana->SetOutputName("test.root");
ana->SetCacheSize(64*1024*1024);
//------------------------------------------------------------------------------------------------
// organize root output
//------------------------------------------------------------------------------------------------
OutputMod *outMod = new OutputMod;
outMod->Drop("*");
outMod->Keep("EventHeader");
outMod->Keep("PileupInfo");
outMod->Keep("HLTObjects");
//.........这里部分代码省略.........
示例2: runFlatMonoJet
//.........这里部分代码省略.........
jetplusmettree->SetMetFromBranch(kFALSE);
jetplusmettree->SetPhotonsFromBranch(kFALSE);
jetplusmettree->SetPhotonsName(photonCleaningMod->GetOutputName());
jetplusmettree->SetElectronsFromBranch(kFALSE);
jetplusmettree->SetElectronsName(electronCleaning->GetOutputName());
jetplusmettree->SetMuonsFromBranch(kFALSE);
jetplusmettree->SetMuonsName(muonId->GetOutputName());
jetplusmettree->SetTausFromBranch(kFALSE);
jetplusmettree->SetTausName(pftauCleaningMod->GetOutputName());
jetplusmettree->SetJetsFromBranch(kFALSE);
jetplusmettree->SetJetsName(jetCleaning->GetOutputName());
jetplusmettree->SetRawJetsName(pubJet->GetOutputName());
jetplusmettree->SetPVFromBranch(kFALSE);
jetplusmettree->SetPVName(goodPVFilterMod->GetOutputName());
jetplusmettree->SetLeptonsName(merger->GetOutputName());
jetplusmettree->SetIsData(isData);
jetplusmettree->SetProcessID(0);
jetplusmettree->SetFillNtupleType(0);
//------------------------------------------------------------------------------------------------
// making analysis chain
//------------------------------------------------------------------------------------------------
// this is how it always starts
runLumiSel->Add(generatorMod);
generatorMod->Add(goodPVFilterMod);
goodPVFilterMod->Add(hltModP);
// photon regression
hltModP->Add(photreg);
// simple object id modules
photreg ->Add(SepPUMod);
SepPUMod ->Add(muonId);
muonId ->Add(eleIdMod);
eleIdMod ->Add(electronCleaning);
electronCleaning ->Add(merger);
merger ->Add(photonIDMod);
photonIDMod ->Add(photonCleaningMod);
photonCleaningMod->Add(pftauIDMod);
pftauIDMod ->Add(pftauCleaningMod);
pftauCleaningMod ->Add(pubJet);
pubJet ->Add(jetCorr);
jetCorr ->Add(metCorrT0T1Shift);
metCorrT0T1Shift ->Add(jetID);
jetID ->Add(muonIdIso);
muonIdIso ->Add(jetCleaning);
jetCleaning ->Add(jetplusmettree);
//------------------------------------------------------------------------------------------------
// setup analysis
//------------------------------------------------------------------------------------------------
Analysis *ana = new Analysis;
ana->SetUseCacher(cacher);
ana->SetUseHLT(kTRUE);
ana->SetKeepHierarchy(kTRUE);
ana->SetSuperModule(runLumiSel);
ana->SetPrintScale(100);
if (nEvents >= 0)
ana->SetProcessNEvents(nEvents);
//------------------------------------------------------------------------------------------------
// organize input
//------------------------------------------------------------------------------------------------
TString skimdataset = TString(dataset)+TString("/") +TString(skim);
TString bookstr = book;
Catalog *c = new Catalog(cataDir.Data());
Dataset *d = NULL;
if (TString(skim).CompareTo("noskim") == 0)
d = c->FindDataset(bookstr,dataset,fileset,local);
else
d = c->FindDataset(bookstr,skimdataset.Data(),fileset,local);
ana->AddDataset(d);
//ana->AddFile("/mnt/hadoop/cms/store/user/paus/filefi/032/r12a-met-j22-v1/C4AC0AB8-BA82-E211-B238-003048678FF4.root");
//------------------------------------------------------------------------------------------------
// organize output
//------------------------------------------------------------------------------------------------
TString rootFile = TString(outputName);
rootFile += TString("_") + TString(dataset) + TString("_") + TString(skim);
if (TString(fileset) != TString(""))
rootFile += TString("_") + TString(fileset);
rootFile += TString(".root");
ana->SetOutputName(rootFile.Data());
ana->SetCacheSize(0);
//------------------------------------------------------------------------------------------------
// Say what we are doing
//------------------------------------------------------------------------------------------------
printf("\n==== PARAMETER SUMMARY FOR THIS JOB ====\n");
printf("\n JSON file: %s\n",jsonFile.Data());
printf("\n Rely on Catalog: %s\n",cataDir.Data());
printf(" -> Book: %s Dataset: %s Skim: %s Fileset: %s <-\n",book,dataset,skim,fileset);
printf("\n Root output: %s\n\n",rootFile.Data());
printf("\n========================================\n");
//------------------------------------------------------------------------------------------------
// run the analysis after successful initialisation
//------------------------------------------------------------------------------------------------
ana->Run(kFALSE);
return;
}
示例3: 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;
}
示例4: runHgg
//.........这里部分代码省略.........
}
// high level trigger is always first
//mcselmod ->Add(hltModE);
//mcselmod ->Add(hltModES);
mcselmod ->Add(hltModP);
hltModP ->Add(goodPVFilterMod);
//hltModE ->Add(goodPVFilterModE);
//hltModES ->Add(goodPVFilterModES);
//goodPVFilterMod ->Add(muonId);
goodPVFilterMod->Add(photreg);
photreg->Add(pubJet);
pubJet->Add(jetCorr);
// simple object id modules
//goodPVFilterModE ->Add(elecId);
//goodPVFilterModES ->Add(elecIdS);
//jetCorr ->Add(photcic);
//jetCorr ->Add(photcicnoeleveto);
jetCorr ->Add(photpresel);
//jetCorr ->Add(photpreselinverteleveto);
//jetCorr ->Add(photpreselnosmear);
//photcic ->Add(phottreecic);
//photcicnoeleveto ->Add(phottreecicnoeleveto);
photpresel ->Add(phottreepresel);
//photpreselinverteleveto ->Add(phottreepreselinverteleveto);
//photpreselnosmear ->Add(phottreepreselnosmear);
//jetCorr ->Add(photidcic);
//photidcic ->Add(phottreesingle);
//elecId->Add(phottreeE);
//elecIdS->Add(phottreeES);
TFile::SetOpenTimeout(0);
TFile::SetCacheFileDir("./rootfilecache",kTRUE,kTRUE);
TFile::SetReadaheadSize(128*1024*1024);
//------------------------------------------------------------------------------------------------
// setup analysis
//------------------------------------------------------------------------------------------------
Analysis *ana = new Analysis;
ana->SetUseHLT(kTRUE);
ana->SetKeepHierarchy(kTRUE);
ana->SetSuperModule(runLumiSel);
ana->SetPrintScale(100);
if (nEvents >= 0)
ana->SetProcessNEvents(nEvents);
//------------------------------------------------------------------------------------------------
// organize input
//------------------------------------------------------------------------------------------------
Catalog *c = new Catalog(catalogDir);
TString skimdataset = TString(dataset)+TString("/") +TString(skim);
Dataset *d = NULL;
TString bookstr = book;
//if (TString(dataset).Contains("s11-h")) bookstr.ReplaceAll("local","t2mit");
if (TString(skim).CompareTo("noskim") == 0)
d = c->FindDataset(bookstr,dataset,fileset);
else
d = c->FindDataset(bookstr,skimdataset.Data(),fileset);
ana->AddDataset(d);
//ana->AddFile("/mnt/hadoop/cmsprod/filefi/025/r11b-pho-n30-v1/4863E9D1-BC1C-E111-99BA-001A92810AF4.root");
//------------------------------------------------------------------------------------------------
// organize output
//------------------------------------------------------------------------------------------------
TString rootFile = TString(outputName);
rootFile += TString("_") + TString(dataset) + TString("_") + TString(skim);
if (TString(fileset) != TString(""))
rootFile += TString("_") + TString(fileset);
rootFile += TString(".root");
ana->SetOutputName(rootFile.Data());
//ana->SetCacheSize(64*1024*1024);
ana->SetCacheSize(0);
//------------------------------------------------------------------------------------------------
// Say what we are doing
//------------------------------------------------------------------------------------------------
printf("\n==== PARAMETER SUMMARY FOR THIS JOB ====\n");
printf("\n JSON file: %s\n and overlap cut: %f (%s)\n",jsonFile.Data(),overlapCut,overlap);
printf("\n Rely on Catalog: %s\n",catalogDir);
printf(" -> Book: %s Dataset: %s Skim: %s Fileset: %s <-\n",book,dataset,skim,fileset);
printf("\n Root output: %s\n\n",rootFile.Data());
printf("\n========================================\n");
//------------------------------------------------------------------------------------------------
// run the analysis after successful initialisation
//------------------------------------------------------------------------------------------------
ana->Run(!gROOT->IsBatch());
return;
}
示例5: runMonoJetTrigger
//.........这里部分代码省略.........
MonoJetAnalysisMod *jetplusmet = new MonoJetAnalysisMod("MonoJetSelector");
jetplusmet->SetJetsName(theJetCleaning->GetOutputName()); //identified jets
jetplusmet->SetJetsFromBranch(kFALSE);
jetplusmet->SetElectronsName(electronCleaning->GetOutputName());
jetplusmet->SetElectronsFromBranch(kFALSE);
jetplusmet->SetMuonsName(muonIdMod->GetOutputName());
jetplusmet->SetMuonsFromBranch(kFALSE);
jetplusmet->SetLeptonsName(merger->GetOutputName());
jetplusmet->SetMinNumJets(1);
jetplusmet->SetMinNumLeptons(0);
jetplusmet->SetMinJetEt(30);
jetplusmet->SetMaxJetEta(2.7);
jetplusmet->SetMinChargedHadronFrac(0.3);
jetplusmet->SetMaxNeutralHadronFrac(0.7);
jetplusmet->SetMaxNeutralEmFrac(0.7);
jetplusmet->SetMinMetEt(30);
HLTEvtSelMod *hlttree = new HLTEvtSelMod("MonoJetHLTTreeWriter");
hlttree->SetCleanJetsName(theJetCleaning->GetOutputName());
hlttree->SetVertexName(goodPVFilterMod->GetOutputName());
hlttree->SetTrigObjsName(hltModP->GetOutputName());
//------------------------------------------------------------------------------------------------
// making analysis chain
//------------------------------------------------------------------------------------------------
// this is how it always starts
runLumiSel ->Add(goodPVFilterMod);
goodPVFilterMod->Add(hltModP);
// photon regression
hltModP->Add(photreg);
// simple object id modules
photreg ->Add(SepPUMod);
SepPUMod ->Add(muonIdMod);
muonIdMod ->Add(eleIdMod);
eleIdMod ->Add(electronCleaning);
electronCleaning ->Add(merger);
merger ->Add(photonIDMod);
photonIDMod ->Add(photonCleaningMod);
photonCleaningMod->Add(pubJet);
pubJet ->Add(jetCorr);
jetCorr ->Add(theJetID);
theJetID ->Add(theJetCleaning);
// Jet+met selection
theJetCleaning ->Add(jetplusmet);
jetplusmet ->Add(hlttree);
//------------------------------------------------------------------------------------------------
// setup analysis
//------------------------------------------------------------------------------------------------
Analysis *ana = new Analysis;
ana->SetUseHLT(kTRUE);
ana->SetKeepHierarchy(kTRUE);
ana->SetSuperModule(runLumiSel);
ana->SetPrintScale(100);
if (nEvents >= 0)
ana->SetProcessNEvents(nEvents);
//------------------------------------------------------------------------------------------------
// organize input
//------------------------------------------------------------------------------------------------
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, true);
else
d = c->FindDataset(bookstr,skimdataset.Data(),fileset, true);
ana->AddDataset(d);
//------------------------------------------------------------------------------------------------
// organize output
//------------------------------------------------------------------------------------------------
TString rootFile = TString(outputName);
rootFile += TString("_") + TString(dataset) + TString("_") + TString(skim);
if (TString(fileset) != TString(""))
rootFile += TString("_") + TString(fileset);
rootFile += TString(".root");
ana->SetOutputName(rootFile.Data());
//ana->SetCacheSize(64*1024*1024);
ana->SetCacheSize(0);
//------------------------------------------------------------------------------------------------
// Say what we are doing
//------------------------------------------------------------------------------------------------
printf("\n==== PARAMETER SUMMARY FOR THIS JOB ====\n");
printf("\n JSON file: %s\n and overlap cut: %f (%s)\n",jsonFile.Data(),overlapCut,overlap);
printf("\n Rely on Catalog: %s\n",catalogDir);
printf(" -> Book: %s Dataset: %s Skim: %s Fileset: %s <-\n",book,dataset,skim,fileset);
printf("\n Root output: %s\n\n",rootFile.Data());
printf("\n========================================\n");
//------------------------------------------------------------------------------------------------
// run the analysis after successful initialisation
//------------------------------------------------------------------------------------------------
ana->Run(!gROOT->IsBatch());
return;
}
示例6: runH2gSkim
//.........这里部分代码省略.........
mcselmod->AddAbsPdgId(24);
mcselmod->AddAbsPdgId(25);
SkimMod<MCParticle> *skimMod = 0;
if (! isData) {
skimMod = new SkimMod<MCParticle>;
skimMod->SetBranchName("MCParticles");
}
OutputMod *outMod = new OutputMod;
outMod->Keep("*");
outMod->Drop("CaloTowers");
outMod->Drop("MCParticles");
outMod->Drop("*Jets*");
outMod->Keep("AKT5GenJets");
outMod->Keep("AKt5PFJets");
if (! isData)
outMod->AddNewBranch("SkmMCParticles");
TString skmRootFile = TString(outputName);
skmRootFile += TString("_") + TString(dataset) + TString("_") + TString(skim);
if (TString(fileset) != TString(""))
skmRootFile += TString("_") + TString(fileset);
outMod->SetFileName(skmRootFile);
outMod->SetPathName(".");
//------------------------------------------------------------------------------------------------
// making analysis chain
//------------------------------------------------------------------------------------------------
// this is how it always starts
runLumiSel ->Add(twophotonsel);
if (isData) {
twophotonsel ->Add(outMod);
}
else {
twophotonsel ->Add(mcselmod);
mcselmod ->Add(skimMod);
skimMod ->Add(outMod);
}
//------------------------------------------------------------------------------------------------
// setup analysis
//------------------------------------------------------------------------------------------------
Analysis *ana = new Analysis;
ana->SetUseHLT (kTRUE);
ana->SetKeepHierarchy(kTRUE);
ana->SetSuperModule (runLumiSel);
ana->SetPrintScale (100);
if (nEvents >= 0)
ana->SetProcessNEvents(nEvents);
//------------------------------------------------------------------------------------------------
// organize input
//------------------------------------------------------------------------------------------------
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);
else
d = c->FindDataset(bookstr,skimdataset.Data(),fileset);
ana->AddDataset(d);
//------------------------------------------------------------------------------------------------
// organize output
//------------------------------------------------------------------------------------------------
TString rootFile = TString(outputName);
rootFile += TString("_") + TString(dataset) + TString("_") + TString(skim);
if (TString(fileset) != TString(""))
rootFile += TString("_") + TString(fileset);
rootFile += TString(".root");
//ana->SetOutputName(rootFile.Data());
//ana->SetCacheSize(64*1024*1024);
//ana->SetCacheSize(0);
ana->SetOutputName("test.root");
//------------------------------------------------------------------------------------------------
// Say what we are doing
//------------------------------------------------------------------------------------------------
printf("\n==== PARAMETER SUMMARY FOR THIS JOB ====\n");
printf("\n JSON file: %s\n and overlap cut: %f (%s)\n",jsonFile.Data(),overlapCut,overlap);
printf("\n Rely on Catalog: %s\n",catalogDir);
printf(" -> Book: %s Dataset: %s Skim: %s Fileset: %s <-\n",book,dataset,skim,fileset);
printf("\n Root output: %s\n\n",rootFile.Data());
printf("\n========================================\n");
//------------------------------------------------------------------------------------------------
// run the analysis after successful initialisation
//------------------------------------------------------------------------------------------------
ana->Run(!gROOT->IsBatch());
return;
}
示例7: runHgg_LT
//.........这里部分代码省略.........
phottreecic->SetApplyBTag(true);
phottreecic->SetApplyLeptonTag(true);
phottreecic->SetLeptonTagElectronsName("HggLeptonTagElectrons");
phottreecic->SetLeptonTagMuonsName ("HggLeptonTagMuons");
PhotonTreeWriter *phottreepresel = new PhotonTreeWriter("PhotonTreeWriterPresel");
phottreepresel->SetPhotonsFromBranch(kFALSE);
phottreepresel->SetInputPhotonsName(photpresel->GetOutputName());
phottreepresel->SetEnableJets(kTRUE);
phottreepresel->SetPFJetsFromBranch(kFALSE);
phottreepresel->SetPFJetName(jetCorr->GetOutputName());
phottreepresel->SetExcludeDoublePrompt(excludedoubleprompt);
phottreepresel->SetIsData(isData);
phottreepresel->SetApplyLeptonTag(true);
phottreepresel->SetLeptonTagElectronsName("HggLeptonTagElectrons");
phottreepresel->SetLeptonTagMuonsName ("HggLeptonTagMuons");
//------------------------------------------------------------------------------------------------
// making analysis chain
//------------------------------------------------------------------------------------------------
// this is how it always starts
runLumiSel ->Add(mcselmod);
if (TString(dataset).Contains("-h")) {
mcselmod ->Add(sysMod);
}
mcselmod ->Add(hltModP);
hltModP ->Add(goodPVFilterMod);
goodPVFilterMod ->Add(photreg);
photreg ->Add(pubJet);
pubJet ->Add(jetCorr);
jetCorr ->Add(photcic);
photcic ->Add(eleIdMod);
eleIdMod ->Add(muonIdMod);
muonIdMod ->Add(phottreecic);
TFile::SetOpenTimeout(0);
TFile::SetCacheFileDir("./rootfilecache",kTRUE,kTRUE);
TFile::SetReadaheadSize(128*1024*1024);
//------------------------------------------------------------------------------------------------
// setup analysis
//------------------------------------------------------------------------------------------------
Analysis *ana = new Analysis;
ana->SetUseHLT(kTRUE);
ana->SetKeepHierarchy(kTRUE);
ana->SetSuperModule(runLumiSel);
ana->SetPrintScale(100);
if (nEvents >= 0)
ana->SetProcessNEvents(nEvents);
//------------------------------------------------------------------------------------------------
// organize input
//------------------------------------------------------------------------------------------------
Catalog *c = new Catalog(catalogDir);
TString skimdataset = TString(dataset)+TString("/") +TString(skim);
Dataset *d = NULL;
TString bookstr = book;
//if (TString(dataset).Contains("s11-h")) bookstr.ReplaceAll("local","t2mit");
if (TString(skim).CompareTo("noskim") == 0)
d = c->FindDataset(bookstr,dataset,fileset);
else
d = c->FindDataset(bookstr,skimdataset.Data(),fileset);
ana->AddDataset(d);
//ana->AddFile("/mnt/hadoop/cmsprod/filefi/025/r11b-pho-n30-v1/4863E9D1-BC1C-E111-99BA-001A92810AF4.root");
//------------------------------------------------------------------------------------------------
// organize output
//------------------------------------------------------------------------------------------------
TString rootFile = TString(outputName);
rootFile += TString("_") + TString(dataset) + TString("_") + TString(skim);
if (TString(fileset) != TString(""))
rootFile += TString("_") + TString(fileset);
rootFile += TString(".root");
ana->SetOutputName(rootFile.Data());
//ana->SetCacheSize(64*1024*1024);
ana->SetCacheSize(0);
//------------------------------------------------------------------------------------------------
// Say what we are doing
//------------------------------------------------------------------------------------------------
printf("\n==== PARAMETER SUMMARY FOR THIS JOB ====\n");
printf("\n JSON file: %s\n and overlap cut: %f (%s)\n",jsonFile.Data(),overlapCut,overlap);
printf("\n Rely on Catalog: %s\n",catalogDir);
printf(" -> Book: %s Dataset: %s Skim: %s Fileset: %s <-\n",book,dataset,skim,fileset);
printf("\n Root output: %s\n\n",rootFile.Data());
printf("\n========================================\n");
//------------------------------------------------------------------------------------------------
// run the analysis after successful initialisation
//------------------------------------------------------------------------------------------------
ana->Run(!gROOT->IsBatch());
return;
}
示例8: runHggAna
//.........这里部分代码省略.........
photIdMIT-> AddEnCorrPerRun (160404, 163869, // Run Range
-0.0047, 0.0025, // EB high/low R9
0.0058, -0.0010); // EE high/low R9
photIdMIT-> AddEnCorrPerRun (165071, 165970, // Run Range
-0.0007, 0.0049, // EB high/low R9
0.0249, 0.0062); // EE high/low R9
photIdMIT-> AddEnCorrPerRun (165971, 166502, // Run Range
0.0003, 0.0067, // EB high/low R9
0.0376, 0.0133); // EE high/low R9
photIdMIT-> AddEnCorrPerRun (166503, 166861, // Run Range
0.0011, 0.0063, // EB high/low R9
0.0450, 0.0178); // EE high/low R9
photIdMIT-> AddEnCorrPerRun (166862, 999999, // Run Range
0.0014, 0.0074, // EB high/low R9
0.0561, 0.0273); // EE high/low R9
photIdMIT-> SetPhotonSelType("MITSelection");
photIdMIT-> SetVertexSelType("StdSelection");
photIdMIT-> SetInputPhotonsName(photId->GetOutputName());
photIdMIT-> SetPhotonsFromBranch(false);
photIdMIT-> SetOutputName("MITPhotons");
photIdMIT-> SetPVName(goodPVFilterMod->GetOutputName());
photIdMIT-> SetPVFromBranch(false);
photIdMIT-> SetTupleName("MITtuple");
// Two analysis Modules
HggAnalysisMod *anaModCiC = new HggAnalysisMod;
anaModCiC->SetPhotonName (photIdCiC->GetOutputName());
anaModCiC->SetPhotonsFromBranch(kFALSE);
HggAnalysisMod *anaModMIT = new HggAnalysisMod;
anaModMIT->SetPhotonName (photIdMIT->GetOutputName());
anaModMIT->SetPhotonsFromBranch(kFALSE);
//------------------------------------------------------------------------------------------------
// making analysis chain
//------------------------------------------------------------------------------------------------
// this is how it always starts
runLumiSel ->Add(hltModP);
// the MIT flow...
hltModP ->Add(goodPVFilterMod);
goodPVFilterMod ->Add(photId);
photId ->Add(photIdMIT);
photIdMIT ->Add(anaModMIT);
// the CiC flow...
hltModP ->Add(photIdCiC);
photIdCiC ->Add(anaModCiC);
//------------------------------------------------------------------------------------------------
// setup analysis
//------------------------------------------------------------------------------------------------
Analysis *ana = new Analysis;
ana->SetUseHLT(kTRUE);
ana->SetKeepHierarchy(kTRUE);
ana->SetSuperModule(runLumiSel);
ana->SetPrintScale(100);
if (nEvents >= 0)
ana->SetProcessNEvents(nEvents);
//------------------------------------------------------------------------------------------------
// 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);
else
d = c->FindDataset(book,skimdataset.Data(),fileset);
ana->AddDataset(d);
//------------------------------------------------------------------------------------------------
// organize output
//------------------------------------------------------------------------------------------------
TString rootFile = TString(outputName);
rootFile += TString("_") + TString(dataset) + TString("_") + TString(skim);
if (TString(fileset) != TString(""))
rootFile += TString("_") + TString(fileset);
rootFile += TString(".root");
ana->SetOutputName(rootFile.Data());
ana->SetCacheSize(64*1024*1024);
//------------------------------------------------------------------------------------------------
// Say what we are doing
//------------------------------------------------------------------------------------------------
printf("\n==== PARAMETER SUMMARY FOR THIS JOB ====\n");
printf("\n JSON file: %s\n and overlap cut: %f (%s)\n",jsonFile.Data(),overlapCut,overlap);
printf("\n Rely on Catalog: %s\n",catalogDir);
printf(" -> Book: %s Dataset: %s Skim: %s Fileset: %s <-\n",book,dataset,skim,fileset);
printf("\n Root output: %s\n\n",rootFile.Data());
printf("\n========================================\n");
//------------------------------------------------------------------------------------------------
// run the analysis after successful initialisation
//------------------------------------------------------------------------------------------------
ana->Run(!gROOT->IsBatch());
return;
}