本文整理汇总了C++中Analysis::SetCacheSize方法的典型用法代码示例。如果您正苦于以下问题:C++ Analysis::SetCacheSize方法的具体用法?C++ Analysis::SetCacheSize怎么用?C++ Analysis::SetCacheSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Analysis
的用法示例。
在下文中一共展示了Analysis::SetCacheSize方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: runEMU
//.........这里部分代码省略.........
//------------------------------------------------------------------------------------------------
// analysis modules
//------------------------------------------------------------------------------------------------
EMUAnalysis2 *analysisModEMU = new EMUAnalysis2;
analysisModEMU->SetTrigObjsName (hltMod -> GetOutputName());
analysisModEMU->SetMuonName (muonId -> GetOutputName());
analysisModEMU->SetElecName (electronCleaning -> GetOutputName());
analysisModEMU->SetJetName (pfJetCleaning -> GetOutputName());
// analysisModEMU->SetHistNamePref ("hXXXXX");
//------------------------------------------------------------------------------------------------
// making analysis chain
//------------------------------------------------------------------------------------------------
// just in case we have run lumi sel
if ((jsonFile.CompareTo("/home/cmsprod/json/~") != 0) &&
(jsonFile.CompareTo("/home/cmsprod/json/-") != 0) )
runLumiSel->Add(generatorMod);
generatorMod ->Add(hltMod);
hltMod ->Add(goodPVFilterMod);
goodPVFilterMod ->Add(muonId);
muonId ->Add(electronId);
electronId ->Add(photonId);
photonId ->Add(pubPFJet);
pubPFJet ->Add(pubTCMet);
pubTCMet ->Add(pubPFMet);
pubPFMet ->Add(pubCaloMet);
pubCaloMet ->Add(pfTauId);
pfTauId ->Add(jetCorr);
jetCorr ->Add(metCaloCorr);
metCaloCorr ->Add(pfJetId);
pfJetId ->Add(electronCleaning);
electronCleaning ->Add(photonCleaning);
photonCleaning ->Add(pfTauCleaning);
pfTauCleaning ->Add(pfJetCleaning);
pfJetCleaning ->Add(mergeLeptonsMod);
mergeLeptonsMod ->Add(analysisModEMU);
//------------------------------------------------------------------------------------------------
// setup analysis
//------------------------------------------------------------------------------------------------
Analysis *ana = new Analysis;
ana->SetUseHLT(kTRUE);
ana->SetKeepHierarchy(kTRUE);
if (nEvents >= 0)
ana->SetProcessNEvents(nEvents);
if ((jsonFile.CompareTo("/home/cmsprod/json/~") != 0) &&
(jsonFile.CompareTo("/home/cmsprod/json/-") != 0) )
ana->SetSuperModule(runLumiSel);
else
ana->SetSuperModule(generatorMod);
ana->SetPrintScale(100);
//------------------------------------------------------------------------------------------------
// 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);
//ana->AddFile("root://castorcms//castor/cern.ch/user/p/paus/filler/011/s09-ttbar-7-mc3/*.root");
//ana->AddFile("hgg-skim_r10a-eg-pr-v4_noskim_0000_000.root");
//ana->AddFile("hgg-skim_p10-h110gg-gf-v26_noskim_0000_000.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());
// use current directory:
// ana->SetOutputName((TString(outputName)+TString(".root")).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;
}
示例2: runMonoPhoton
//.........这里部分代码省略.........
beamhalotree->SetHltObjsName(hltModP->GetOutputName());
beamhalotree->SetIsData(isData);
beamhalotree->SetProcessID(0);
beamhalotree->SetFillNtupleType(3);//beamhalo
//------------------------------------------------------------------------------------------------
// making analysis chain
//------------------------------------------------------------------------------------------------
// this is how it always starts
runLumiSel ->Add(mcselmod);
mcselmod->Add(generatorMod);
generatorMod->Add(goodPVFilterMod);
goodPVFilterMod->Add(hltModP);
// photon regression
hltModP->Add(photreg);
// simple object id modules
photreg ->Add(SepPUMod);
SepPUMod ->Add(muonIdMod);
muonIdMod ->Add(cosmicCleaning);
cosmicCleaning ->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);
// Gamma+met selection
//theJetCleaning ->Add(phplusmet);
//phplusmet ->Add(phplusmettree);
theJetCleaning ->Add(phplusmettree);
// Dilepton selection
theJetCleaning ->Add(dilepton);
dilepton ->Add(dileptontree);
// Fake photon selection
theJetCleaning ->Add(phfake);
phfake ->Add(phfaketree);
// Beam Halo selection
theJetCleaning ->Add(beamhalo);
beamhalo ->Add(beamhalotree);
//------------------------------------------------------------------------------------------------
// setup analysis
//------------------------------------------------------------------------------------------------
Analysis *ana = new Analysis;
ana->SetUseHLT(kTRUE);
ana->SetKeepHierarchy(kFALSE);
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;
}
示例3: runFlatMonoJet
//.........这里部分代码省略.........
jetplusmettree->SetElectronsName(electronCleaning->GetOutputName());
jetplusmettree->SetMuonsFromBranch(kFALSE);
jetplusmettree->SetMuonsName(muonId->GetOutputName());
jetplusmettree->SetTausFromBranch(kFALSE);
jetplusmettree->SetTausName(pftauCleaningMod->GetOutputName());
jetplusmettree->SetJetsFromBranch(kFALSE);
jetplusmettree->SetJetsName(theJetCleaning->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(theJetID);
theJetID ->Add(theJetCleaning);
theJetCleaning ->Add(jetplusmettree);
//------------------------------------------------------------------------------------------------
// 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); // chaching on
//d = c->FindDataset(bookstr,dataset,fileset, false); // chaching off
}
else {
d = c->FindDataset(bookstr,skimdataset.Data(),fileset, true);
//d = c->FindDataset(bookstr,skimdataset.Data(),fileset, false);
}
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(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;
}
示例4: runMonoJetSkim
//.........这里部分代码省略.........
runLumiSel ->Add(generatorMod);
generatorMod ->Add(goodPvMod);
goodPvMod ->Add(hltModP);
// photon regression
hltModP ->Add(photonReg);
// simple object id modules
photonReg ->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(jetCleaning);
jetCleaning ->Add(monojetSel);
//------------------------------------------------------------------------------------------------
// setup analysis
//------------------------------------------------------------------------------------------------
Analysis *ana = new Analysis;
ana->SetUseCacher(1);
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, 1); // 1 to use smartcache
else
d = c->FindDataset(book,skimDataset.Data(),fileset, 1);
ana->AddDataset(d);
ana->SetCacheSize(0);
//------------------------------------------------------------------------------------------------
// skim output
//------------------------------------------------------------------------------------------------
TString outputName = TString(outputLabel);
outputName += TString("_") + TString(dataset) + TString("_") + TString(skim);
if (TString(fileset) != TString(""))
outputName += TString("_") + TString(fileset);
OutputMod *skimOutput = new OutputMod;
skimOutput->Drop("*");
skimOutput->Keep("HLT*");
skimOutput->Keep("MC*");
skimOutput->Keep("PileupInfo");
skimOutput->Keep("Rho");
skimOutput->Keep("EvtSelData");
skimOutput->Keep("BeamSpot");
skimOutput->Keep("PrimaryVertexes");
skimOutput->Keep("PFMet");
skimOutput->Keep("AKt5PFJets");
skimOutput->Keep("Electrons");
skimOutput->Keep("Muons");
skimOutput->Keep("HPSTaus");
skimOutput->Keep("Photons");
// TODO find some object that is named and can hold bit mask info
skimOutput->AddNewBranch(monojetSel->GetCategoriesName());
skimOutput->SetMaxFileSize(10 * 1024); // 10 GB - should never exceed
skimOutput->SetFileName(outputName);
skimOutput->SetPathName(".");
monojetSel->Add(skimOutput);
//------------------------------------------------------------------------------------------------
// 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",catalogDir);
printf(" -> Book: %s Dataset: %s Skim: %s Fileset: %s <-\n",book,dataset,skim,fileset);
printf("\n========================================\n");
//------------------------------------------------------------------------------------------------
// 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;
}
示例5: runBavanti
//--------------------------------------------------------------------------------------------------
void runBavanti(const char *fileset = "0000",
const char *skim = "noskim",
const char *dataset = "r12b-smu-j22-v1",
const char *book = "t2mit/filefi/032",
const char *catalogDir = "/home/cmsprod/catalog",
const char *outputName = "boostedv",
int nEvents = 1000)
{
//------------------------------------------------------------------------------------------------
// some parameters get passed through the environment
//------------------------------------------------------------------------------------------------
TString cataDir = Utils::GetCatalogDir(catalogDir);
TString mitData = Utils::GetEnv("MIT_DATA");
TString json = Utils::GetEnv("MIT_PROD_JSON");
TString jsonFile = Utils::GetJsonFile("/home/cmsprod/cms/json");
Bool_t isData = (json.CompareTo("~") != 0);
printf("\n Initialization worked. Data?: %d\n\n",isData);
//------------------------------------------------------------------------------------------------
// some global setups
//------------------------------------------------------------------------------------------------
// debugging config
using namespace mithep;
gDebugMask = (Debug::EDebugMask) (Debug::kGeneral | Debug::kTreeIO);
gDebugLevel = 3;
// Caching and how
Int_t local = 1, cacher = 1;
// local = 0 - as is,
// 1 - /mt/hadoop (MIT:SmartCache - preload one-by-one)
// 2 - /mnt/hadoop (MIT:SmartCache - preload complete fileset)
// 3 - ./ (xrdcp - preload one-by-one)
// cacher = 0 - no file by file caching
// 1 - file by file caching on
//------------------------------------------------------------------------------------------------
// set up information for master module
//------------------------------------------------------------------------------------------------
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 (json.CompareTo("~") != 0 && json.CompareTo("-") != 0) {
printf(" runBoostedV() - adding jsonFile: %s\n",jsonFile.Data());
runLumiSel->AddJSONFile(jsonFile.Data());
}
if (json.CompareTo("-") == 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");
//------------------------------------------------------------------------------------------------
// 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
//------------------------------------------------------------------------------------------------
Catalog *c = new Catalog(cataDir.Data());
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,local);
else
d = c->FindDataset(bookstr,skimdataset.Data(),fileset,local);
ana->AddDataset(d);
//------------------------------------------------------------------------------------------------
// organize output
//------------------------------------------------------------------------------------------------
TString rootFile = TString(outputName);
rootFile += TString("_") + TString(dataset) + TString("_") + TString(skim);
if (TString(fileset) != TString(""))
rootFile += TString("_") + TString(fileset);
ana->SetOutputName(rootFile + TString(".root"));
ana->SetCacheSize(0);
//------------------------------------------------------------------------------------------------
// select events with a good primary vertex
//------------------------------------------------------------------------------------------------
GoodPVFilterMod *goodPvFilterMod = new GoodPVFilterMod;
goodPvFilterMod->SetMinVertexNTracks(0);
goodPvFilterMod->SetMinNDof(4.0);
goodPvFilterMod->SetMaxAbsZ(24.0);
goodPvFilterMod->SetMaxRho(2.0);
goodPvFilterMod->SetIsMC(!isData);
goodPvFilterMod->SetVertexesName("PrimaryVertexes");
//.........这里部分代码省略.........
示例6: getCatalogDir
//--------------------------------------------------------------------------------------------------
void runBavantiBoostedV_Synch
(const char *fileset = "0000",
const char *skim = "noskim",
//const char *dataset = "s12-ttj-sl-v1-v7c",
const char *dataset = "GJets_HT-400ToInf_8TeV-madgraph+Summer12_DR53X-PU_S10_START53_V7A-v1+AODSIM",
const char *book = "t2mit/filefi/032",
const char *catalogDir = "/home/cmsprod/catalog",
const char *outputName = "boostedv",
int nEvents = 10)
{
//------------------------------------------------------------------------------------------------
// some parameters get passed through the environment
//------------------------------------------------------------------------------------------------
TString cataDir = getCatalogDir(catalogDir);
TString mitData = Utils::GetEnv("MIT_DATA");
TString json = Utils::GetEnv("MIT_PROD_JSON");
TString jsonFile = getJsonFile("/home/cmsprod/cms/json");
Bool_t isData = (json.CompareTo("~") != 0);
// only for synchrionization purposes
isData = kFALSE;
printf("\n Initialization worked. Data?: %d\n\n",isData);
//------------------------------------------------------------------------------------------------
// some global setups
//------------------------------------------------------------------------------------------------
// debugging config
using namespace mithep;
gDebugMask = (Debug::EDebugMask) (Debug::kGeneral | Debug::kTreeIO);
gDebugLevel = 3;
// Caching and how
Int_t local = 1, cacher = 1;
// local = 0 - as is,
// 1 - /mt/hadoop (MIT:SmartCache - preload one-by-one)
// 2 - /mnt/hadoop (MIT:SmartCache - preload complete fileset)
// 3 - ./ (xrdcp - preload one-by-one)
// cacher = 0 - no file by file caching
// 1 - file by file caching on
//------------------------------------------------------------------------------------------------
// set up information for master module
//------------------------------------------------------------------------------------------------
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 (json.CompareTo("~") != 0 && json.CompareTo("-") != 0) {
printf(" runBoostedV() - adding jsonFile: %s\n",jsonFile.Data());
runLumiSel->AddJSONFile(jsonFile.Data());
}
if (json.CompareTo("-") == 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");
//------------------------------------------------------------------------------------------------
// 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
//------------------------------------------------------------------------------------------------
Catalog *c = new Catalog(cataDir.Data());
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,local);
else
d = c->FindDataset(bookstr,skimdataset.Data(),fileset,local);
ana->AddDataset(d);
//------------------------------------------------------------------------------------------------
// organize output
//------------------------------------------------------------------------------------------------
TString rootFile = TString(outputName);
rootFile += TString("_") + TString(dataset) + TString("_") + TString(skim);
if (TString(fileset) != TString(""))
rootFile += TString("_") + TString(fileset);
TString ntupleFile = rootFile + TString("_ntuple");
rootFile += TString(".root");
ana->SetOutputName(rootFile.Data());
ana->SetCacheSize(0);
//------------------------------------------------------------------------------------------------
// HLT information
//------------------------------------------------------------------------------------------------
HLTMod *hltModP = new HLTMod("HLTModP");
//.........这里部分代码省略.........
示例7: runHgg2012HCP
//.........这里部分代码省略.........
//jetCorr ->Add(photidpresel);
//photidpresel ->Add(phottreesingle);
//photidpreselinvert ->Add(phottreesingleinvert);
//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);
if (TString(dataset).Contains("meridiani")) {
ana->SetUseHLT(kFALSE);
}
//------------------------------------------------------------------------------------------------
// 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);
std::vector<TString> synchFile;
// synchFile.push_back("26650E45-A902-E211-9523-001D09F29146.root");
// synchFile.push_back("FC4B4004-6502-E211-B532-BCAEC518FF8A.root");
// synchFile.push_back("063C9BE3-8F02-E211-9503-001D09F2424A.root");
// synchFile.push_back("10946F3E-4F02-E211-ACA8-5404A63886BB.root");
// synchFile.push_back("70EAB2D6-8F02-E211-AD24-001D09F29146.root");
// synchFile.push_back("50F136D5-8F02-E211-A7E1-001D09F25109.root");
// synchFile.push_back("ACF83417-6502-E211-8A06-002481E0D90C.root");
// synchFile.push_back("50F136D5-8F02-E211-A7E1-001D09F25109.root");
// synchFile.push_back("84D8683B-3702-E211-ACC8-BCAEC53296F3.root");
// synchFile.push_back("64CF7800-6802-E211-AE29-003048D374CA.root");
// synchFile.push_back("044DE8D2-8F02-E211-BEF1-00215AEDFD98.root");
// synchFile.push_back("6A50C106-6002-E211-A8FD-003048F118E0.root");
// synchFile.push_back("80DCA06C-5002-E211-B0FD-5404A6388692.root");
// synchFile.push_back("1600BC48-4F02-E211-B8FA-BCAEC518FF6B.root");
// synchFile.push_back("36E6F661-9002-E211-8ED4-001D09F253D4.root");
synchFile.push_back("28B1B2DB-AAF5-E111-8D01-E0CB4E4408E3.root");
synchFile.push_back("1EA891A9-77F8-E111-BD59-003048D2BB90.root");
synchFile.push_back("38E9A015-F1F8-E111-9654-001D09F28D4A.root");
synchFile.push_back("DC46A78E-60E0-E111-B65D-001D09F25479.root");
synchFile.push_back("B490A799-45DD-E111-A676-001D09F2AD4D.root");
synchFile.push_back("2E00B5D2-C9DD-E111-81B5-0025901D6268.root");
for( unsigned int iF = 0 ; iF<synchFile.size(); ++iF) {
ana->AddFile("root://xrootd.cmsaf.mit.edu//store/user/paus/filefi/029/r12c-dph-pr-v2/"+synchFile[iF]); ///scratch/fabstoec/root/DA2D6D6F-BB95-E111-9564-001A92971B7E.root");
//ana->AddFile("root://xrootd.cmsaf.mit.edu//store/user/paus/filefi/029/r12b-dph-j13-v1/"+synchFile[iF]); ///scratch/fabstoec/root/DA2D6D6F-BB95-E111-9564-001A92971B7E.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: runPhRes
//.........这里部分代码省略.........
photIdCiC-> SetIsData(isData);
photIdCiC-> ApplyEleVeto(false);
photIdCiC-> DoDataEneCorr(false);
photIdCiC-> DoMCSmear(false);
photIdCiC-> SetPhotonSelType("CiCSelection");
photIdCiC-> SetVertexSelType("StdSelection");
photIdCiC-> SetOutputName("CiCPhotons");
photIdCiC-> SetTupleName("CiCTuple");
// copy the Mod for the MIT selection
PhotonPairSelector *photIdMIT = new PhotonPairSelector;
photIdMIT-> SetIsData(isData);
photIdMIT-> ApplyEleVeto(false);
photIdMIT-> DoDataEneCorr(false);
photIdMIT-> DoMCSmear(false);
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(hltModEle);
// the MIT flow...
hltModEle ->Add(goodPVFilterMod);
goodPVFilterMod ->Add(photId);
photId ->Add(photIdMIT);
photIdMIT ->Add(anaModMIT);
// the CiC flow...
hltModEle ->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;
}
示例9: runIoTest
//--------------------------------------------------------------------------------------------------
void runIoTest(const char *fileset = "0000",
const char *skim = "noskim",
const char *dataset = "r12b-dmu-j22-v1",
const char *book = "t2mit/filefi/032",
const char *catalogDir = "/home/cmsprod/catalog",
const char *outputName = "iotest",
int nEvents = 200000)
{
//------------------------------------------------------------------------------------------------
// some parameters get passed through the environment
//------------------------------------------------------------------------------------------------
TString cataDir = getCatalogDir(catalogDir);
TString mitData = Utils::GetEnv("MIT_DATA");
TString json = Utils::GetEnv("MIT_PROD_JSON");
TString jsonFile = getJsonFile("/home/cmsprod/cms/json");
Bool_t isData = (json.CompareTo("~") != 0);
printf("\n Initialization worked. Data?: %d\n\n",isData);
//------------------------------------------------------------------------------------------------
// some global setups
//------------------------------------------------------------------------------------------------
using namespace mithep;
gDebugMask = ( Debug::kAnalysis && Debug::kTreeIO );
gDebugLevel = 1;
//------------------------------------------------------------------------------------------------
// set up information for master module
//------------------------------------------------------------------------------------------------
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 (json.CompareTo("~") != 0 && json.CompareTo("-") != 0) {
runLumiSel->AddJSONFile(jsonFile.Data());
}
if (json.CompareTo("-") == 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");
//------------------------------------------------------------------------------------------------
// setup analysis
//------------------------------------------------------------------------------------------------
Analysis *ana = new Analysis;
ana->SetUseCacher(1);
ana->SetUseHLT(kTRUE);
ana->SetKeepHierarchy(kTRUE);
ana->SetSuperModule(runLumiSel);
ana->SetPrintScale(100);
if (nEvents >= 0)
ana->SetProcessNEvents(nEvents);
//------------------------------------------------------------------------------------------------
// organize input
//------------------------------------------------------------------------------------------------
Catalog *c = new Catalog(cataDir.Data());
TString skimdataset = TString(dataset)+TString("/") +TString(skim);
Dataset *d = NULL;
TString bookstr = book;
Int_t local = 3;
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);
//------------------------------------------------------------------------------------------------
// organize output
//------------------------------------------------------------------------------------------------
TString rootFile = TString(outputName);
rootFile += TString("_") + TString(dataset) + TString("_") + TString(skim);
if (TString(fileset) != TString(""))
rootFile += TString("_") + TString(fileset);
TString ntupleFile = rootFile + TString("_ntuple.root");
rootFile += TString(".root");
ana->SetOutputName(rootFile.Data());
ana->SetCacheSize(0);
//------------------------------------------------------------------------------------------------
// HLT information
//------------------------------------------------------------------------------------------------
HLTMod *hltModP = new HLTMod("HLTModP");
hltModP->SetBitsName("HLTBits");
hltModP->SetTrigObjsName("HltObjsMonoJet");
hltModP->SetAbortIfNotAccepted(isData);
hltModP->SetPrintTable(kFALSE);
// monojet triggers
const int nMjtTrigs = 1;
TString monoJetTriggers[nMjtTrigs] = { "HLT_MonoCentralPFJet80_PFMETnoMu105_NHEF0p95_v4" };
for (int i=0; i<nMjtTrigs; i++)
hltModP->AddTrigger(TString("!+"+monoJetTriggers[i]),0,999999);
//------------------------------------------------------------------------------------------------
// making analysis chain
//------------------------------------------------------------------------------------------------
runLumiSel ->Add(hltModP);
//.........这里部分代码省略.........
示例10: 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;
}
示例11: runShowerCorrections
//.........这里部分代码省略.........
elecId->SetApplyConversionFilterType2(kTRUE);
elecId->SetChargeFilter (kFALSE);
elecId->SetApplyD0Cut (kTRUE);
elecId->SetNExpectedHitsInnerCut (0);
elecId->SetVertexName (goodPVFilterMod->GetOutputName());
elecId->SetPtMin (30.);
PhotonMCDataSFMod *phSFMod = new PhotonMCDataSFMod;
phSFMod-> SetIsData(isData);
phSFMod-> SetInputPhotonsName(photidpreselinvert->GetOutputName());
phSFMod-> SetPhotonsFromBranch(false);
phSFMod-> SetPVName(goodPVFilterMod->GetOutputName());
phSFMod-> SetPVFromBranch(false);
phSFMod-> SetElectronName(elecId->GetOutputName());
phSFMod-> SetEleFromBranch(false);
phSFMod-> AddTriggerLegs("hltEle32CaloIdLCaloIsoVLSC17PixelMatchFilter"/*,"hltEle32CaloIdLCaloIsoVLSC17HEDoubleFilter"*/);
phSFMod-> AddTriggerLegs("hltEle17CaloIdVTCaloIsoVTTrkIdTTrkIsoVTEle8TrackIsoFilter");
phSFMod-> AddTriggerLegs("hltEle20CaloIdVTCaloIsoVTTrkIdTTrkIsoVTSC4TrackIsoFilter");
phSFMod-> AddTriggerLegs("hltEle32CaloIdTCaloIsoTTrkIdTTrkIsoTSC17TrackIsoFilter");
phSFMod-> SetTrigObjsName(hltModE->GetOutputName());
phSFMod-> SetTupleName("MITtuple");
//------------------------------------------------------------------------------------------------
// making analysis chain
//------------------------------------------------------------------------------------------------
// this is how it always starts
runLumiSel ->Add(hltModE);
hltModE ->Add(goodPVFilterMod);
goodPVFilterMod ->Add(elecId);
// ... the MIT flow ...
elecId ->Add(photidpreselinvert);
photidpreselinvert->Add(phSFMod);
//------------------------------------------------------------------------------------------------
// 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);
Catalog *c = new Catalog(catalogDir);
TString skimdataset = TString(dataset)+TString("/") +TString(skim);
Dataset *d = NULL;
TString bookstr = book;
Bool_t caching = kTRUE;
//if (TString(dataset).Contains("s11-h")) bookstr.ReplaceAll("local","t2mit");
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);
//------------------------------------------------------------------------------------------------
// 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;
}
示例12: 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");
//.........这里部分代码省略.........
示例13: 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;
}
示例14: 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;
}
示例15: 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;
}