19 {
20
21
24
25 std::string readDir = "file:/tmp/steinber";
26 if( argc > 2 ) readDir =
argv[ 2 ];
27
28 int nevt = -1;
29 if( argc > 3 ) nevt = std::atoi(argv[ 3 ]);
30
31 std::string enableStr = "" ;
32 if ( argc > 4 ) enableStr =
argv[4];
33
34 std::string vers = "0";
35 if ( argc > 5 ) vers =
argv[5];
36
37 int localTrackLimit = 1e6;
38 if ( argc > 6 ) localTrackLimit = std::atoi(argv[ 6 ]);
39
40 std::string grlOption = "";
41 if ( argc > 7 ) grlOption =
argv[ 7 ];
42
43
45
46
48
49
50
51
52
53 std::string fileDir;
54 bool file_mode = 0;
55 bool eos_mode = 0;
56 bool eoslsf_mode = 0;
58
59 if (readDir.starts_with("file:"))
60 {
61 fileDir = readDir.substr(5);
62 file_mode = 1;
63 std::cout << "Setting up file mode:" << fileDir << std::endl;
66 }
67
68 if (readDir.starts_with("eos:"))
69 {
70 fileDir = readDir.substr(4);
71 eos_mode = 1;
72 std::cout << "Setting up EOS mode:" << fileDir << std::endl;
73 std::string
eospath =
"root://eosatlas.cern.ch/"+fileDir;
76 }
77
78 if (readDir.starts_with("eoslsf:"))
79 {
80 fileDir = readDir.substr(7);
81 eoslsf_mode = 1;
82 std::cout << "Setting up EOS LSF mode:" << fileDir << std::endl;
83 std::string
eospath =
"root://eosatlas.cern.ch/"+fileDir;
86 }
87
88 if (readDir.starts_with("grid:"))
89 {
90 fileDir = readDir.substr(5);
92 std::cout << "Setting up Grid mode:" << fileDir << std::endl;
94 sh.setMetaString(
"nc_grid_filter",
"*");
95 }
96
97
98
99 sh.setMetaString(
"nc_tree",
"CollectionTree" );
100
102
103
105 job.sampleHandler(
sh );
106
107
109
110 std::cout << "runtime options:" << enableStr << std::endl;
111
113 if (enableStr.find("debug")!=std::string::npos) { zdcAna->debug = true; }
114 if (enableStr.find(
"slimmed")!=std::string::npos) { zdcAna->
slimmed =
true; }
115 if (enableStr.find(
"tree")!=std::string::npos) { zdcAna->
enableOutputTree =
true; }
117 if (enableStr.find(
"trigger")!=std::string::npos) { zdcAna->
enableTrigger =
true; }
118 if (enableStr.find(
"zdcCalib")!=std::string::npos) { zdcAna->
zdcCalib =
true; }
119 if (enableStr.find(
"zdcLaser")!=std::string::npos) { zdcAna->
zdcLaser =
true; }
120 if (enableStr.find(
"tracks")!=std::string::npos) { zdcAna->
enableTracks =
true; }
121 if (enableStr.find(
"clusters")!=std::string::npos) { zdcAna->
enableClusters =
true; }
122 if (enableStr.find(
"TT")!=std::string::npos) { zdcAna->
enableTT =
true; }
123 if (enableStr.find(
"jets")!=std::string::npos) { zdcAna->
enableJets =
true; }
124 if (enableStr.find(
"electrons")!=std::string::npos) { zdcAna->
enableElectrons =
true; }
125 if (enableStr.find(
"photons")!=std::string::npos) { zdcAna->
enablePhotons =
true; }
126 if (enableStr.find(
"trigjet")!=std::string::npos) { zdcAna->
enableTriggerJets =
true; }
127 if (enableStr.find(
"muons")!=std::string::npos) { zdcAna->
enableMuons =
true; }
128 if (enableStr.find(
"truth")!=std::string::npos) { zdcAna->
enableTruth =
true; }
129 if (enableStr.find(
"noflipdelay")!=std::string::npos) { zdcAna->
flipDelay =
false; }
130 if (enableStr.find(
"doflipdelay")!=std::string::npos) { zdcAna->
flipDelay =
true; }
131 if (enableStr.find(
"trackLimitReject")!=std::string::npos) { zdcAna->
trackLimitReject =
true; }
132 if (enableStr.find(
"reprocZdc")!=std::string::npos) { zdcAna->
reprocZdc =
true; }
133 if (enableStr.find(
"7samp")!=std::string::npos) { zdcAna->
nsamplesZdc = 7; }
134 if (enableStr.find(
"15samp")!=std::string::npos) { zdcAna->
nsamplesZdc = 15; }
135 if (enableStr.find(
"noGRL")!=std::string::npos) { zdcAna->
useGRL =
false;}
136 if (enableStr.find("express2016A")!=std::string::npos) { zdcAna->express2016A = true;}
137 if (enableStr.find("upc2015")!=std::string::npos) { zdcAna->upc2015 = true;}
138 if (enableStr.find("mb2015")!=std::string::npos) { zdcAna->mb2015 = true;}
139 if (enableStr.find("upcL2015")!=std::string::npos) { zdcAna->upcL2015 = true;}
140 if (enableStr.find("main2016A")!=std::string::npos) { zdcAna->main2016A = true;}
141 if (enableStr.find("upc2016A")!=std::string::npos) { zdcAna->upc2016A = true;}
142 if (enableStr.find("express2016B")!=std::string::npos) { zdcAna->express2016B = true;}
143 if (enableStr.find("main2016B")!=std::string::npos) { zdcAna->main2016B = true;}
144 if (enableStr.find("upc2016B")!=std::string::npos) { zdcAna->upc2016B = true;}
145 if (enableStr.find("upc2016C")!=std::string::npos) { zdcAna->upc2016C = true;}
146 if (enableStr.find("mboverlay2016")!=std::string::npos) { zdcAna->mboverlay2016 = true;}
147
148 if (enableStr.find(
"writeOnlyTriggers")!=std::string::npos) { zdcAna->
writeOnlyTriggers =
true;}
149 if (grlOption !=
"") zdcAna->
grlFilename = grlOption;
150
152
153
154
156 job.outputAdd (output);
158
159 job.algsAdd (ntuple);
160
161
162 job.algsAdd( zdcAna );
163
165 std::cout << "Running " << nevt << " events" << std::endl;
166
167 if (file_mode||eos_mode)
168 {
169
171 driver.submit( job, submitDir );
172
174 }
175
176 if (grid_mode)
177 {
179 driver.options()->setString(
"nc_outputSampleName",
"user.steinber.%in:name[0]%.%in:name[1]%.%in:name[2]%.%in:name[3]%.%in:name[4]%.%in:name[5]%.%in:name[6]%."+vers);
182
183 driver.submitOnly( job, submitDir );
184 }
185
186 if (eoslsf_mode)
187 {
189 TString shellCommand = "export export LSB_JOB_REPORT_MAIL=N; export ATLAS_LOCAL_ROOT_BASE=/cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase &&";
190 shellCommand += "source ${ATLAS_LOCAL_ROOT_BASE}/user/atlasLocalSetup.sh" ;
193 driver.shellInit = shellCommand.Data();
194 driver.submitOnly( job, submitDir );
195 }
196
197 return 0;
198}
a Driver that runs directly inside the submission job itself
static const std::string optMaxEvents
description: the name of the option used for setting the maximum number of events to process per samp...
static const std::string optGridMergeOutput
static const std::string optXaodAccessMode_athena
static const std::string optXaodAccessMode
description: the option to select the access mode for xAODs.
static const std::string optSubmitFlags
description: the name of the option for supplying extra submit parameters to batch systems rationale:...
static const std::string optFilesPerWorker
description: the name of the option for selecting the number of files per batch job.
static const std::string optGridNFilesPerJob
a Driver for running on LSF batch systems
a Driver to submit jobs via prun
a DiskList implementation for EOS
a DiskList implementation for local directories
A class that manages a list of Sample objects.
void addGrid(SampleHandler &sh, const std::string &ds)
effects: add a grid dataset for dataset ds guarantee: strong failures: out of memory II requires: ds....
StatusCode Init(const char *appname)
Function initialising ROOT/PyROOT for using the ATLAS EDM.
the class used for scanning local directories and file servers for samples
const ScanDir & scan(SampleHandler &sh, const std::string &dir) const
scan the given directory and put the created samples into the sample handler
ScanDir & filePattern(const std::string &val_filePattern)
the pattern for files to be accepted