[188] | 1 | /*
|
---|
| 2 | ---- Delphes ----
|
---|
| 3 | A Fast Simulator for general purpose LHC detector
|
---|
| 4 | S. Ovyn ~~~~ severine.ovyn@uclouvain.be
|
---|
| 5 |
|
---|
| 6 | Center for Particle Physics and Phenomenology (CP3)
|
---|
| 7 | Universite Catholique de Louvain (UCL)
|
---|
| 8 | Louvain-la-Neuve, Belgium
|
---|
| 9 | */
|
---|
| 10 |
|
---|
| 11 | /// \file Delphes.cpp
|
---|
| 12 | /// \brief executable for the Delphes
|
---|
| 13 |
|
---|
| 14 | #include "TApplication.h"
|
---|
[225] | 15 | #include "FrogUtil.h"
|
---|
| 16 | #include "SmearUtil.h"
|
---|
[188] | 17 | #include <iostream>
|
---|
[225] | 18 | #include <string>
|
---|
[188] | 19 | using namespace std;
|
---|
| 20 |
|
---|
| 21 | int main(int argc, char *argv[])
|
---|
| 22 | {
|
---|
| 23 | int appargc = 2;
|
---|
| 24 | char *appName = "Delphes";
|
---|
| 25 | char *appargv[] = {appName, "-b"};
|
---|
| 26 | TApplication app(appName, &appargc, appargv);
|
---|
| 27 |
|
---|
| 28 | if(argc != 2 && argc != 3) {
|
---|
| 29 | cout << " Usage: " << argv[0] << " input_file [N_events]" << endl;
|
---|
| 30 | cout << " input_file - root file containing the events to display" << endl;
|
---|
| 31 | cout << " detector_card - Datacard containing resolution variables for the detector simulation (optional) "<<endl;
|
---|
| 32 | exit(1);
|
---|
| 33 | }
|
---|
| 34 |
|
---|
| 35 | // 1. ********** initialisation ***********
|
---|
| 36 | //read the input *root file
|
---|
| 37 | string inputfilename(argv[1]);
|
---|
| 38 | if(inputfilename.find(".root") > inputfilename.length() ) {
|
---|
| 39 | cout << "output_file should be a .root file!\n";
|
---|
| 40 | exit(1);
|
---|
| 41 | }
|
---|
| 42 |
|
---|
| 43 | //data card
|
---|
| 44 | string DetDatacard("");
|
---|
| 45 | if(argc==3) DetDatacard =argv[2];
|
---|
| 46 |
|
---|
| 47 | //create output log-file name
|
---|
| 48 | string forLog = inputfilename;
|
---|
| 49 | string LogName = forLog.erase(forLog.find(".root"));
|
---|
| 50 | LogName = LogName+"_FROG.log";
|
---|
| 51 |
|
---|
| 52 |
|
---|
| 53 |
|
---|
| 54 | //Smearing information
|
---|
| 55 | RESOLution *DET = new RESOLution();
|
---|
| 56 | DET->ReadDataCard(DetDatacard);
|
---|
| 57 | DET->Logfile(LogName);
|
---|
| 58 |
|
---|
| 59 |
|
---|
| 60 | // 2 ************** FROG display
|
---|
[225] | 61 | FrogDisplay *FROG = new FrogDisplay(DetDatacard);
|
---|
| 62 | FROG->BuildEvents(inputfilename);
|
---|
| 63 | FROG->BuildGeom();
|
---|
[188] | 64 |
|
---|
| 65 | cout << "** Exiting..." << endl;
|
---|
| 66 | delete FROG;
|
---|
[225] | 67 | delete DET;
|
---|
[188] | 68 | }
|
---|