// jobdef.C // // Sample ATLAS job definition file for use with the root interface // to DIAL 1.20. // // The goal is to define an application, task and dataset. Pointers // to the objects and their identifiers are stored in the following // global variables: // papp - application // ptsk - task // pdst - dataset // aid - application ID // tid - task ID // did - dataset ID void jobdef() { // Specify names for the application, task and dataset. // Typical job definition is created by changing these values. // // Depending on the following code, a name may be intepreted as // one or more of the following. // 1. ID: Object identifier. // 2. name: Object name in the default selection catalog. // 3. directory: Name of a directory holding files to be used // construct the object. // 4. xml: Name of a file holding the XML description of the // object. // Application: directory, name, or ID. string aname = "atlasopt"; // Task: directory, xml, name, or ID. string tname = "atlasopt_example_zll-10.0.1"; // Dataset: ID or name. string dname = "hma.dc2.003007.digit.A1_z_ee.aod-1000.10files"; ///////////////////////////////////////////////////////////////// // The following is the code to interpret the above names. ///////////////////////////////////////////////////////////////// // Find application. if ( FileStatus(aname).is_directory() ) { cout << "Creating application from " << aname << endl; papp = new dial::Application("*", aname); aid = papp->id(); } else { cout << "Extracting application " << aname << endl; aid = asc.id(aname); if ( ! aid.is_valid() ) { aid = ApplicationId(aname); } papp = ar.extract(aid); } // Find task. if ( FileStatus(tname).is_directory() ) { cout << "Creating task from directory " << tname << endl; ptsk = new dial::Task("*", tname); tid = ptsk->id(); } else if ( FileStatus(tname).is_readable() ) { cout << "Creating task from XML file " << tname << endl; const XmlElement* pxtsk = parser.parse(tname); if ( pxtsk != 0 ) { ptsk = new dial::Task(*pxtsk); tid = ptsk->id(); } } else { cout << "Extracting task " << tname << endl; tid = tsc.id(tname); if ( ! tid.is_valid() ) { tid = TaskId(tname); } ptsk = tr.extract(tid); } // Find dataset. cout << "Extracting dataset " << dname << endl; did = dsc.id(dname); if ( ! did.is_valid() ) { did = dset::DatasetId(dname); } pdst = dr.extract(did); // Check definitions. if ( papp==0 || !papp->is_valid() ) cout << "Application is invalid!!!" << endl; if ( ptsk==0 || !ptsk->is_valid() ) cout << "Task is invalid!!!" << endl; if ( pdst==0 || !pdst->is_valid() ) cout << "Dataset is invalid!!!" << endl; }