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"
|
---|
15 | #include "interface/FrogUtil.h"
|
---|
16 | #include "interface/SmearUtil.h"
|
---|
17 | #include <iostream>
|
---|
18 | using namespace std;
|
---|
19 |
|
---|
20 | int main(int argc, char *argv[])
|
---|
21 | {
|
---|
22 | int appargc = 2;
|
---|
23 | char *appName = "Delphes";
|
---|
24 | char *appargv[] = {appName, "-b"};
|
---|
25 | TApplication app(appName, &appargc, appargv);
|
---|
26 |
|
---|
27 | if(argc != 2 && argc != 3) {
|
---|
28 | cout << " Usage: " << argv[0] << " input_file [N_events]" << endl;
|
---|
29 | cout << " input_file - root file containing the events to display" << endl;
|
---|
30 | cout << " detector_card - Datacard containing resolution variables for the detector simulation (optional) "<<endl;
|
---|
31 | exit(1);
|
---|
32 | }
|
---|
33 |
|
---|
34 | // 1. ********** initialisation ***********
|
---|
35 | //read the input *root file
|
---|
36 | string inputfilename(argv[1]);
|
---|
37 | if(inputfilename.find(".root") > inputfilename.length() ) {
|
---|
38 | cout << "output_file should be a .root file!\n";
|
---|
39 | exit(1);
|
---|
40 | }
|
---|
41 |
|
---|
42 | //data card
|
---|
43 | string DetDatacard("");
|
---|
44 | if(argc==3) DetDatacard =argv[2];
|
---|
45 |
|
---|
46 | //create output log-file name
|
---|
47 | string forLog = inputfilename;
|
---|
48 | string LogName = forLog.erase(forLog.find(".root"));
|
---|
49 | LogName = LogName+"_FROG.log";
|
---|
50 |
|
---|
51 |
|
---|
52 |
|
---|
53 | //Smearing information
|
---|
54 | RESOLution *DET = new RESOLution();
|
---|
55 | DET->ReadDataCard(DetDatacard);
|
---|
56 | DET->Logfile(LogName);
|
---|
57 |
|
---|
58 |
|
---|
59 | // 2 ************** FROG display
|
---|
60 | FrogDisplay *FROG = new FrogDisplay();
|
---|
61 | FROG->BuidEvents(inputfilename,DET->NEvents_Frog);
|
---|
62 | FROG->BuildGeom(DetDatacard);
|
---|
63 |
|
---|
64 | cout << "** Exiting..." << endl;
|
---|
65 | delete FROG;
|
---|
66 | }
|
---|