FairRoot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
eventDisplay.C
Go to the documentation of this file.
1 
2 /********************************************************************************
3  * Copyright (C) 2020 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
4  * *
5  * This software is distributed under the terms of the *
6  * GNU Lesser General Public Licence (LGPL) version 3, *
7  * copied verbatim in the file "LICENSE" *
8  ********************************************************************************/
9 /*
10  * eventDisplay.C
11  *
12  * Created on: 27 sie 2020
13  * Author: Daniel Wielanek
14  * E-mail: daniel.wielanek@gmail.com
15  * Warsaw University of Technology, Faculty of Physics
16  */
17 
19 {
20 
21  TString inFile = "prop.mc.root";
22  TString parFile = "prop.par.root";
23  TString outFile = "ed.root";
24  // ----- Reconstruction run -------------------------------------------
25  FairRunAna *fRun = new FairRunAna();
26  // prop.rk.cal.root
27  FairFileSource *fFileSource = new FairFileSource(inFile);
28  fFileSource->AddFriend("prop.tracks.root");
29  fFileSource->AddFriend("prop.hits.root");
30  fRun->SetSource(fFileSource);
31 
32  fRun->SetSink(new FairRootFileSink(outFile));
33 
34  // ----- Parameter database --------------------------------------------
35  FairRuntimeDb *rtdb = fRun->GetRuntimeDb();
36 
37  FairParRootFileIo *parIo1 = new FairParRootFileIo();
38  parIo1->open(parFile);
39  rtdb->setFirstInput(parIo1);
40  // ------------------------------------------------------------------------
41 
42  FairConstField *fMagField = new FairConstField();
43  fMagField->SetField(0., 0., 20.); // values are in kG
44  fMagField->SetFieldRegion(-150, 150, -150, 150, -250, 250); // values are in cm (xmin,xmax,ymin,ymax,zmin,zmax)
45  fRun->SetField(fMagField);
46  //-------------------
47 
48  FairEventManager *fMan = new FairEventManager();
49  fMan->SetXMLConfig("conf.xml");
50  // set view from the front
51  fMan->SetRPhiPlane(0, 0, -5, 0, TGLViewer::kCameraOrthoXOY);
52 
53  FairMCTracksDraw *mcTracks = new FairMCTracksDraw();
54  FairGeoTracksDraw *geoTracks = new FairGeoTracksDraw();
55  FairRecoTracksDraw *recoTracks = new FairRecoTracksDraw();
56  FairMCPointDraw *RutherfordPoints = new FairMCPointDraw("FairTutPropPoint", kBlue, kFullSquare);
57  FairMCPointDraw *RutherfordPoints2 = new FairMCPointDraw("FairTutPropPoint2", kRed, kFullSquare);
58 
59  fMan->AddTask(mcTracks);
60  fMan->AddTask(geoTracks);
61  fMan->AddTask(recoTracks);
62 
63  fMan->AddTask(RutherfordPoints);
64  fMan->AddTask(RutherfordPoints2);
65 
66  fMan->Init();
67 }
list of container factories
Definition: FairRuntimeDb.h:24
virtual void SetXMLConfig(TString xml_config)
void SetField(Double_t bX, Double_t bY, Double_t bZ)
virtual void SetRPhiPlane(Double_t a, Double_t b, Double_t c, Double_t d, TGLViewer::ECameraType camtype)
void SetSink(FairSink *tempSink)
Definition: FairRun.h:84
void eventDisplay()
Definition: eventDisplay.C:18
void SetFieldRegion(Double_t xMin, Double_t xMax, Double_t yMin, Double_t yMax, Double_t zMin, Double_t zMax)
virtual void Init(Int_t visopt=1, Int_t vislvl=3, Int_t maxvisnds=10000)
FairRuntimeDb * GetRuntimeDb(void)
Definition: FairRun.h:80
Bool_t open(const Text_t *fname, Option_t *option="READ", const Text_t *ftitle="", Int_t compress=1)
void AddFriend(TString FileName)
virtual void SetSource(FairSource *tempSource)
Definition: FairRunAna.h:70
void AddTask(FairTask *t)
Bool_t setFirstInput(FairParIo *)
void SetField(FairField *ffield)
Definition: FairRunAna.h:80