outputEventDisplay.txt

Vratislav Chudoba, 02/06/2018 02:30 PM

Download (292 KB)

 
1
#include "RVersion.h"                   // for ROOT_VERSION_CODE
2
#include "Rtypes.h"                     // for Bool_t, etc
3
#include "TLorentzVector.h"             // for TLorentzVector
4

    
5
class FairField;
6

    
7
/**
8
 * The Main Application for GEANE
9
 * @author M. Al-Turany
10
 * @version 0.1
11
 * @since 10.11.10
12
 */
13

    
14
class FairGeaneApplication : public TVirtualMCApplication
15
{
16
  public:
17
    /** default constructor */
18
    FairGeaneApplication();
19
    /** Special constructor, used for initializing G3 for Geane track propagation
20
    *@param Debug    true to print step info*/
21
    FairGeaneApplication(Bool_t Debug);
22
    /** default destructor */
23
    virtual ~FairGeaneApplication();
24
#if ROOT_VERSION_CODE < 333824
25
    /** Calculate user field  b at point x */
26
    void          Field(const Double_t* x, Double_t* b) const;      // MC Application
27
#endif
28
    /** Return Field used in simulation*/
29
    FairField*             GetField() {return fxField;}
30
    /** Initialize MC engine */
31
    void                  InitMC(const char* setup,  const char* cuts);
32
    /**
33
    * Set the magnetic field for simulation or Geane
34
    * @param field: magnetic field
35
    */
36
    void                   SetField(FairField* field);
37
    /** Define action at each step, dispatch the action to the corresponding detectors */
38
    void          GeaneStepping();                           // MC Application
39
    void ConstructGeometry();
40
    /** Singelton instance
41
     */
42
    static FairGeaneApplication* Instance();
43

    
44
    /**pure virtual functions that hasve to be implimented */
45

    
46
    void InitGeometry() {;}
47
    void GeneratePrimaries() {;}
48
    void BeginEvent() {;}
49
    void BeginPrimary() {;}
50
    void PreTrack() {;}
51
    void PostTrack() {;}
52
    void FinishPrimary() {;}
53
    void FinishEvent() {;}
54
    void Stepping() {;}
55
    void StopRun() {;}
56

    
57

    
58
  private:
59
    // data members
60
    /**Magnetic Field Pointer*/
61
    FairField*            fxField; //
62
    /**MC Engine 1= Geant3, 2 = Geant4*/
63
    Int_t                fMcVersion;     // mc Version
64
    /** Debug flag*/
65
    Bool_t               fDebug;//!
66
    TLorentzVector fTrkPos; //!
67

    
68
    ClassDef(FairGeaneApplication,1)  //Interface to MonteCarlo application
69
  private:
70
    FairGeaneApplication(const FairGeaneApplication&);
71
    FairGeaneApplication& operator=(const FairGeaneApplication&);
72
};
73

    
74
// inline functions
75

    
76
inline FairGeaneApplication* FairGeaneApplication::Instance()
77
{ return static_cast<FairGeaneApplication*>(TVirtualMCApplication::Instance());}
78

    
79
#endif
80
/********************************************************************************
81
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
82
 *                                                                              *
83
 *              This software is distributed under the terms of the             * 
84
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *  
85
 *                  copied verbatim in the file "LICENSE"                       *
86
 ********************************************************************************/
87
// -------------------------------------------------------------------------
88
// -----                    FairGenerator header file                   -----
89
// -----          Created 09/06/04  by D. Bertini / V. Friese          -----
90
// -------------------------------------------------------------------------
91

    
92

    
93
/** FairGenerator.h
94
 *@author D.Bertini <d.bertini@gsi.de>
95
 *@author V.Friese  <v.friese@gsi.de>
96
 *
97
The FairGenerator is the abtract base class for the generators used to
98
generate input for the transport simulation.Each concrete generator class
99
derived from this one must implement the abtract method ReadEvent,
100
which has to use the method FairPrimaryGenerator::AddTrack.
101
**/
102

    
103

    
104
#ifndef FAIRGENERATOR_H
105
#define FAIRGENERATOR_H
106

    
107
#include "TNamed.h"                     // for TNamed
108

    
109
#include "Rtypes.h"                     // for Bool_t, etc
110

    
111
class FairPrimaryGenerator;
112

    
113
class FairGenerator : public TNamed
114
{
115

    
116
  public:
117

    
118
    /** Default constructor. **/
119
    FairGenerator();
120

    
121

    
122
    /** Constructor with name and title **/
123
    FairGenerator(const char* name, const char* title="FAIR Generator");
124

    
125

    
126
    /** Destructor. **/
127
    virtual ~FairGenerator();
128

    
129

    
130
    /** Abstract method ReadEvent must be implemented by any derived class.
131
        It has to handle the generation of input tracks (reading from input
132
        file) and the handing of the tracks to the FairPrimaryGenerator. I
133
        t is called from FairMCApplication.
134
        *@param pStack The stack
135
        *@return kTRUE if successful, kFALSE if not
136
    **/
137
    virtual Bool_t ReadEvent(FairPrimaryGenerator* primGen) = 0;
138

    
139

    
140
    /**Initialize the generator if needed */
141
    virtual Bool_t Init() { return kTRUE;}
142

    
143
    /** Clone this object (used in MT mode only) */
144
    virtual FairGenerator* CloneGenerator() const;
145

    
146
  protected:
147
    /** Copy constructor */
148
    FairGenerator(const FairGenerator&);
149
    /** Assignment operator */
150
    FairGenerator& operator= (const FairGenerator&);
151

    
152
    ClassDef(FairGenerator,1);
153
};
154

    
155
#endif
156

    
157

    
158
/********************************************************************************
159
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
160
 *                                                                              *
161
 *              This software is distributed under the terms of the             * 
162
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *  
163
 *                  copied verbatim in the file "LICENSE"                       *
164
 ********************************************************************************/
165
// -------------------------------------------------------------------------
166
// -----                       FairStack header file                    -----
167
// -----           Created 10/08/04  by D. Bertini                     -----
168
// -------------------------------------------------------------------------
169

    
170

    
171
/** FairStack.h
172
 *@author D.Bertini <d.bertini@gsi.de>
173
 * Generic MC stack class
174
 **/
175

    
176

    
177
#ifndef FAIRGENERICSTACK_H
178
#define FAIRGENERICSTACK_H
179

    
180
#include "TClonesArray.h" 
181
#include "TVirtualMCStack.h"            // for TVirtualMCStack
182

    
183
#include "Rtypes.h"                     // for Double_t, Int_t, etc
184
#include "TMCProcess.h"                 // for TMCProcess
185

    
186
#include <stddef.h>                     // for NULL
187

    
188
class FairLogger;
189
class TParticle;
190
class TRefArray;
191
class TIterator;
192

    
193

    
194
class FairGenericStack : public TVirtualMCStack
195
{
196

    
197
  public:
198

    
199
    /** Default constructor  **/
200
    FairGenericStack();
201

    
202

    
203
    /** Destructor with estimated array size  **/
204
    FairGenericStack(Int_t size);
205

    
206

    
207
    /** Destructor  **/
208
    virtual ~FairGenericStack();
209

    
210
    /** Virtual method PushTrack.
211
     ** Add a TParticle to the stack.
212
     *@param toBeDone  Flag for tracking
213
     *@param parentID  Index of mother particle
214
     *@param pdgCode   Particle type (PDG encoding)
215
     *@param px,py,pz  Momentum components at start vertex [GeV]
216
     *@param e         Total energy at start vertex [GeV]
217
     *@param vx,vy,vz  Coordinates of start vertex [cm]
218
     *@param time      Start time of track [s]
219
     *@param polx,poly,polz Polarisation vector
220
     *@param proc      Production mechanism (VMC encoding)
221
     *@param ntr       Track number (filled by the stack)
222
     *@param weight    Particle weight
223
     *@param is        Generation status code (whatever that means)
224
     **/
225
    virtual void PushTrack(Int_t toBeDone, Int_t parentID, Int_t pdgCode,
226
                           Double_t px, Double_t py, Double_t pz,
227
                           Double_t e, Double_t vx, Double_t vy,
228
                           Double_t vz, Double_t time, Double_t polx,
229
                           Double_t poly, Double_t polz, TMCProcess proc,
230
                           Int_t& ntr, Double_t weight, Int_t is);
231

    
232
    /** Virtual method PushTrack.
233
     ** Add a TParticle to the stack.
234
     *@param toBeDone         Flag for tracking
235
     *@param parentID         Index of mother particle
236
     *@param pdgCode          Particle type (PDG encoding)
237
     *@param px,py,pz         Momentum components at start vertex [GeV]
238
     *@param e                Total energy at start vertex [GeV]
239
     *@param vx,vy,vz         Coordinates of start vertex [cm]
240
     *@param time             Start time of track [s]
241
     *@param polx,poly,polz   Polarisation vector
242
     *@param proc             Production mechanism (VMC encoding)
243
     *@param ntr              Track number (filled by the stack)
244
     *@param weight           Particle weight
245
     *@param is               Generation status code (whatever that means)
246
     *@param secondparentID   used fot the index of mother of primery in the list
247
     **/
248

    
249
    virtual void PushTrack(Int_t toBeDone, Int_t parentID, Int_t pdgCode,
250
                           Double_t px, Double_t py, Double_t pz,
251
                           Double_t e, Double_t vx, Double_t vy,
252
                           Double_t vz, Double_t time, Double_t polx,
253
                           Double_t poly, Double_t polz, TMCProcess proc,
254
                           Int_t& ntr, Double_t weight, Int_t is, Int_t secondparentID);
255

    
256

    
257
    /** Virtual method PopNextTrack.
258
     ** Gets next particle for tracking from the stack.
259
     *@param  iTrack  index of popped track
260
     *@return Pointer to the TParticle of the track
261
     **/
262
    virtual TParticle* PopNextTrack(Int_t& iTrack);
263

    
264

    
265
    /** Virtual method PopPrimaryForTracking.
266
     ** Gets primary particle by index for tracking from stack.
267
     *@param  iPrim   index of primary particle
268
     *@return Pointer to the TParticle of the track
269
     **/
270
    virtual TParticle* PopPrimaryForTracking(Int_t iPrim);
271

    
272

    
273
    /** Add a TParticle to the fParticles array **/
274
    void AddParticle(TParticle* part);
275

    
276

    
277
    /** Fill the MCTrack output array, applying filter criteria **/
278
    virtual void FillTrackArray();
279

    
280

    
281
    /** Update the track index in the MCTracks and MCPoints **/
282
    virtual void UpdateTrackIndex(TRefArray* detArray=0);
283

    
284

    
285
    /** Set the list of detectors to be used for filltering the stack*/
286
    void SetDetArrayList(TRefArray* detArray);
287

    
288
    /** Resets arrays and stack and deletes particles and tracks **/
289
    virtual void Reset();
290

    
291

    
292
    /** Register the MCTrack array to the Root Manager  **/
293
    virtual void Register();
294

    
295

    
296
    /** Output to screen
297
     **@param iVerbose: 0=events summary, 1=track info
298
     **/
299
    virtual void Print(Option_t* option="") const;
300

    
301

    
302
    /** Modifiers  **/
303
    virtual void SetCurrentTrack(Int_t iTrack);
304

    
305
    /** Accessors **/
306
    virtual Int_t GetNtrack() const;   // Total number of tracks
307
    virtual Int_t GetNprimary() const; // Number of primaries
308
    virtual TParticle* GetCurrentTrack() const;
309
    virtual Int_t GetCurrentTrackNumber() const;
310
    virtual Int_t GetCurrentParentTrackNumber() const;
311
    virtual TParticle* GetParticle(Int_t) const { return NULL; }
312

    
313
    virtual TClonesArray* GetListOfParticles() { return NULL; } 
314

    
315
    /** Clone this object (used in MT mode only) */
316
    virtual FairGenericStack* CloneStack() const;
317

    
318
  protected:
319
    /** Copy constructor */
320
    FairGenericStack(const FairGenericStack&);
321
    /** Assignment operator */
322
    FairGenericStack& operator=(const FairGenericStack&);
323

    
324
    /** Fair Logger */
325
    FairLogger*            fLogger;//!
326

    
327
    /** List of detectors registering hits in the simulation */
328
    TRefArray*  fDetList;  //!
329

    
330
    /** Iterator for the detector list*/
331
    TIterator* fDetIter;
332

    
333
    /**Verbosity level*/
334
    Int_t fVerbose;
335

    
336
    ClassDef(FairGenericStack,1)
337

    
338

    
339
};
340

    
341
#endif
342
/********************************************************************************
343
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
344
 *                                                                              *
345
 *              This software is distributed under the terms of the             * 
346
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *  
347
 *                  copied verbatim in the file "LICENSE"                       *
348
 ********************************************************************************/
349
// -------------------------------------------------------------------------
350
// -----                       FairIon header file                      -----
351
// -----          Created 27/08/04  by V. Friese / D.Bertini           -----
352
// -------------------------------------------------------------------------
353

    
354
/** FairIon.h
355
 *@author V.Friese <v.friese@gsi.de>
356
 *@author D.Bertini <d.bertini@gsi.de>
357
 **
358
 ** A class for the user definition of an ion. It will be instantiated
359
 ** from the constructor of the FairIonGenerator.
360
 **/
361

    
362

    
363
#ifndef FAIRION_H
364
#define FAIRION_H
365

    
366
#include "TNamed.h"                     // for TNamed
367

    
368
#include "Rtypes.h"                     // for Int_t, Double_t, etc
369

    
370
class FairLogger;
371

    
372
class FairIon: public TNamed
373
{
374
  public:
375

    
376
    /** Default constructor **/
377
    FairIon();
378

    
379

    
380
    /** Standard constructor
381
     *@param name  name
382
     *@param z     atomic number
383
     *@param a     atomic mass
384
     *@param q     electric charge
385
     *@param e     excitation energy
386
     *@param m     mass [GeV]
387
     ** If mass is not given, it will be set to a times the proton mass.
388
     **/
389

    
390
    FairIon(const char* name, Int_t z, Int_t a, Int_t q, Double_t e=0., Double_t m=0.);
391
    void SetParams( const char* name, Int_t z, Int_t a,
392
                    Int_t q, Double_t e=0., Double_t m=0.) {
393
      SetName(name);
394
      fZ=z;
395
      fA=a;
396
      fQ=q;
397
      fExcEnergy=e;
398
      fMass=m;
399
    }
400
    /** Destructor **/
401
    virtual ~FairIon();
402

    
403

    
404
    /** Accessors **/
405
    /**
406
    * Return the atomic number
407
    */
408
    Int_t GetZ()            const { return fZ; }
409
    /**
410
     * Return the atomic mass
411
    */
412
    Int_t GetA()            const { return fA; }
413
    /**
414
     * Return the charge
415
    */
416
    Int_t GetQ()            const { return fQ; }
417
    /**
418
    * Return the  excitation energy
419
    */
420
    Double_t GetExcEnergy() const { return fExcEnergy; }
421
    /**
422
    * Return the mass in GeV
423
    */
424
    Double_t GetMass()      const { return fMass; }
425

    
426
    /** Modifiers **/
427
    /**
428
    * Set the  excitation energy
429
    */
430
    void SetExcEnergy(Double_t eExc) { fExcEnergy = eExc; }
431
    /**
432
    * Set the mass in GeV
433
    */
434
    void SetMass(Double_t mass)      { fMass = mass*amu; }
435

    
436

    
437
  private:
438

    
439
    /** Data members **/
440

    
441
    static Int_t fgNIon;  //! /// Number of ions instantiated. One per generator.
442
    Int_t    fZ;          /// Atomic number
443
    Int_t    fA;          /// Atomic mass
444
    Int_t    fQ;          /// Electric charge
445
    Double_t fExcEnergy;  /// Excitation energy [GeV]
446
    Double_t fMass;       /// Mass [GeV]
447
    FairLogger* fLogger;  //! /// FairLogger
448
    static const Double_t amu; ///  .931494028 Gev/c**2
449

    
450
    FairIon(const FairIon&);
451
    FairIon& operator=(const FairIon&);
452

    
453
    ClassDef(FairIon,2);
454

    
455
};
456

    
457

    
458

    
459
#endif
460
/********************************************************************************
461
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
462
 *                                                                              *
463
 *              This software is distributed under the terms of the             * 
464
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *  
465
 *                  copied verbatim in the file "LICENSE"                       *
466
 ********************************************************************************/
467
// -------------------------------------------------------------------------
468
// -----               FairMCApplication header file                   -----
469
// -----            Created 06/01/04  by M. Al-Turany                  -----
470
// -------------------------------------------------------------------------
471

    
472
#ifndef FAIR_MC_APPLICATION_H
473
#define FAIR_MC_APPLICATION_H
474

    
475
#include "TVirtualMCApplication.h"      // for TVirtualMCApplication
476

    
477
#include "FairRunInfo.h"                // for FairRunInfo
478

    
479
#include "RVersion.h"                   // for ROOT_VERSION_CODE
480
#include "Rtypes.h"                     // for Int_t, Bool_t, Double_t, etc
481
#include "TLorentzVector.h"             // for TLorentzVector
482
#include "TString.h"                    // for TString
483

    
484
#include <map>                           // for map, multimap, etc
485
#include <list>                           // for list
486

    
487
class FairDetector;
488
class FairEventHeader;
489
class FairField;
490
class FairGenericStack;
491
class FairMCEventHeader;
492
class FairPrimaryGenerator;
493
class FairRadGridManager;
494
class FairRadLenManager;
495
class FairRadMapManager;
496
class FairRootManager;
497
class FairTask;
498
class FairTrajFilter;
499
class FairVolume;
500
class TChain;
501
class TIterator;
502
class TObjArray;
503
class TRefArray;
504
class TTask;
505
class TVirtualMC;
506
/**
507
 * The Main Application ( Interface to MonteCarlo application )
508
 * @author M. Al-Turany, D. Bertini
509
 * @version 0.1
510
 * @since 12.01.04
511
 */
512

    
513
class FairMCApplication : public TVirtualMCApplication
514
{
515
  public:
516
    /** Standard constructor
517
    *@param name      name
518
    *@param title     title
519
    *@param ModList  a TObjArray containing all detectors and modules used in this simulation
520
    *@param MatName  material file name
521
    */
522
    FairMCApplication(const char* name,   const char* title, TObjArray* ModList, const char* MatName);
523
    /** default constructor
524
    */
525
    FairMCApplication();
526
    /** default destructor
527
    */
528
    virtual ~FairMCApplication();
529
    /** Singelton instance
530
    */
531
    static FairMCApplication* Instance();
532
    virtual void          AddDecayModes();
533
    /**  Add user defined particles (optional) */
534
    virtual void          AddParticles();                                   // MC Application
535
    /** Add user defined ions (optional) */
536
    virtual void          AddIons();                                        // MC Application
537
    /**
538
    *Add user defined Tasks to be executed after each event (optional)
539
    * @param fTask: Task that has to be excuted during simulation
540
    */
541
    void                  AddTask(TTask* fTask);
542
    /** Define actions at the beginning of the event */
543
    virtual void          BeginEvent();                                     // MC Application
544
    /** Define actions at the beginning of primary track */
545
    virtual void          BeginPrimary();                                   // MC Application
546
    /** Construct user geometry */
547
    virtual void          ConstructGeometry();                              // MC Application
548
    /** Define parameters for optical processes (optional) */
549
    virtual void          ConstructOpGeometry();                            // MC Application
550
#if ROOT_VERSION_CODE < 333824
551
    /** Calculate user field  b at point x */
552
    virtual void          Field(const Double_t* x, Double_t* b) const;      // MC Application
553
#endif
554
    /** Define actions at the end of event */
555
    virtual void          FinishEvent();                                    // MC Application
556
    /** Define actions at the end of primary track */
557
    virtual void          FinishPrimary();                                  // MC Application
558
    /** Define actions at the end of run */
559
    void                  FinishRun();
560
    /** Generate primary particles */
561
    virtual void          GeneratePrimaries();                              // MC Application
562
    /** Return detector by name  */
563
    FairDetector*          GetDetector(const char* DetName);
564
    /** Return Field used in simulation*/
565
    FairField*             GetField() {return fxField;}
566
    /**Return primary generator*/
567
    FairPrimaryGenerator*  GetGenerator();
568
    /**Return list of tasks*/
569
    TTask*                GetListOfTasks();
570
    FairGenericStack*      GetStack();
571
    TChain*               GetChain();
572
    /** Initialize geometry */
573
    virtual void          InitGeometry();                                   // MC Application
574
    /** Initialize MC engine */
575
    void                  InitMC(const char* setup,  const char* cuts);
576
    /** Initialize Tasks if any*/
577
    void                  InitTasks();
578
    /**Define actions at the end of each track */
579
    virtual void          PostTrack();                                      // MC Application
580
    /** Define actions at the beginning of each track*/
581
    virtual void          PreTrack();                                       // MC Application
582

    
583
    /** Clone for worker (used in MT mode only) */
584
    virtual TVirtualMCApplication* CloneForWorker() const;
585

    
586
    /** Init worker run (used in MT mode only) */
587
    virtual void InitForWorker() const;
588

    
589
    /** Finish worker run (used in MT mode only) */
590
    virtual void FinishWorkerRun() const;
591

    
592
    /** Run the MC engine
593
     * @param nofEvents : number of events to simulate
594
     */
595
    void                  RunMC(Int_t nofEvents);
596
    /**
597
    * Set the magnetic field for simulation
598
    * @param field: magnetic field
599
    */
600
    void                  SetField(FairField* field);
601
    /**
602
     * Set the event generator  for simulation
603
     * @param fxGenerator: Event generator(s)
604
     */
605
    void                  SetGenerator(FairPrimaryGenerator* fxGenerator);
606
    /**
607
     * Set the parameter containers needed by Tasks(if any)
608
     */
609
    void                  SetParTask();
610
    /**
611
     * Switch for using Pythia as external decayer
612
     * @param decayer: if TRUE pythia will decay particles specifid in the Decay Config macro (see SetPythiaDecayerConfig)
613
     */
614
    void                  SetPythiaDecayer(Bool_t decayer) {fPythiaDecayer=decayer;}
615
    /**
616
    * set the decay configuration macro to be used by Pythia
617
    */
618
    void                  SetPythiaDecayerConfig(const TString decayerConf) {fPythiaDecayerConfig=decayerConf;}
619
    /**
620
    * Switch for using the radiation length manager
621
    */
622
    void                  SetRadiationLengthReg(Bool_t RadLen);
623
    /**
624
    * Switch for using the radiation map manager
625
    */
626
    void                  SetRadiationMapReg(Bool_t RadMap);
627
    /**
628
    * Switch for debuging the tracking
629
    */
630
    void                  SetTrackingDebugMode( Bool_t set ) {fDebug = set;}
631
    /**
632
    * Switch for using 2 or 3 body phase-space decay
633
    * @param  decay: if TRUE 2/3 body phase space decay will be used for particle specified in the User Decay Config macro (see SetUserDecayConfig)
634
    */
635
    void                  SetUserDecay(Bool_t decay) {fUserDecay= decay;}
636
    /**
637
    * set the decay configuration macro to be used by user decay
638
    */
639
    void                  SetUserDecayConfig(const TString decayerConf) {fUserDecayConfig= decayerConf;}
640
    /** Define action at each step, dispatch the action to the corresponding detectors */
641
    virtual void          Stepping();                                       // MC Application
642
    /** Stop the run*/
643
    virtual void          StopRun();
644
    /**Define maximum radius for tracking (optional) */
645
    virtual Double_t      TrackingRmax() const;                             // MC Application
646
    /** Define maximum z for tracking (optional) */
647
    virtual Double_t      TrackingZmax() const;                              // MC Application
648

    
649
    void AddMeshList ( TObjArray* meshList );
650

    
651
  private:
652
    // methods
653
    void RegisterStack();
654

    
655
    Int_t GetIonPdg(Int_t z, Int_t a) const;
656

    
657
    void UndoGeometryModifications();
658

    
659
    // data members
660
    /**List of active detector */
661
    TRefArray*           fActiveDetectors;
662
    /**List of FairTask*/
663
    FairTask*             fFairTaskList;//!
664
    /**detector list (Passive and Active)*/
665
    TRefArray*           fDetectors;
666
    /**Map used for dispatcher*/
667
    TRefArray*           fDetMap;
668
    /**Iterator for Module list*/
669
    TIterator*           fModIter; //!
670
    /**Module list in simulation*/
671
    TObjArray*           fModules;
672
    /**Number of sensetive volumes in simulation session*/
673
    Int_t                fNoSenVolumes; //!
674
    /**flag for using Pythia as external decayer */
675
    Bool_t               fPythiaDecayer;
676
    /** Pythia decay config macro*/
677
    TString               fPythiaDecayerConfig; //!
678
    /** Simulation Stack  */
679
    FairGenericStack*     fStack; //!
680
    /**Pointer to thr I/O Manager */
681
    FairRootManager*      fRootManager; //!
682
    /**List of sensetive volumes in all detectors*/
683
    TRefArray*           fSenVolumes; //!
684
    /**Magnetic Field Pointer*/
685
    FairField*            fxField; //
686
    /**Primary generator*/
687
    FairPrimaryGenerator* fEvGen; //
688
    /**MC Engine 1= Geant3, 2 = Geant4*/
689
    Int_t                fMcVersion;     // mc Version
690
    /** Track visualization manager */
691
    FairTrajFilter*       fTrajFilter; //!
692
    /**Flag for accepted tracks for visualization*/
693
    Bool_t               fTrajAccepted; //!
694
    /**Flag for using user decay*/
695
    Bool_t               fUserDecay;
696
    /**User decay config macro*/
697
    TString               fUserDecayConfig; //!
698
    /** Debug flag*/
699
    Bool_t               fDebug;//!
700
    /**dispatcher internal use */
701
    FairVolume*          fDisVol;
702
    /**dispatcher internal use */
703
    FairDetector*         fDisDet;
704
    /**dispatcher internal use */
705
    std::multimap <Int_t, FairVolume* > fVolMap;//!
706
    /**dispatcher internal use */
707
    std::multimap <Int_t, FairVolume* >::iterator fVolIter; //!
708
    /** Track position*/
709
    /**dispatcher internal use RadLeng*/
710
    std::map <Int_t, Int_t > fModVolMap;//!
711
    /**dispatcher internal use RadLen*/
712
    std::map <Int_t, Int_t >::iterator fModVolIter; //!
713
    TLorentzVector fTrkPos; //!
714
    /** Flag for Radiation length register mode  */
715
    Bool_t   fRadLength;  //!
716

    
717
    /**Radiation length Manager*/
718
    FairRadLenManager*  fRadLenMan; //!
719
    /** Flag for Radiation map register mode  */
720
    Bool_t   fRadMap;     //!
721
    /**Radiation Map Manager*/
722
    FairRadMapManager*  fRadMapMan; //!
723
    /**Radiation map Grid Manager*/
724
    FairRadGridManager* fRadGridMan; //!
725

    
726
    FairEventHeader*    fEventHeader; //!
727

    
728
    FairMCEventHeader*  fMCEventHeader; //!
729
    /** list of senstive detectors used in the simuation session*/
730
    std::list <FairDetector *> listActiveDetectors; //!
731
    /** list of all detectors used in the simuation session*/
732
    std::list <FairDetector *> listDetectors;  //!
733
    /** Pointer to the current MC engine //!
734
     */
735
    TVirtualMC* fMC;
736

    
737
   
738
    
739
    ClassDef(FairMCApplication,4)  //Interface to MonteCarlo application
740

    
741
  private:
742
    /** Protected copy constructor */
743
    FairMCApplication(const FairMCApplication&);
744
    /** Protected assignment operator */
745
    FairMCApplication& operator=(const FairMCApplication&);
746

    
747
    FairRunInfo fRunInfo;//!
748
    Bool_t      fGeometryIsInitialized;
749
};
750

    
751
// inline functions
752

    
753
inline FairMCApplication* FairMCApplication::Instance()
754
{ return static_cast<FairMCApplication*>(TVirtualMCApplication::Instance());}
755

    
756
#endif
757
/********************************************************************************
758
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
759
 *                                                                              *
760
 *              This software is distributed under the terms of the             * 
761
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *  
762
 *                  copied verbatim in the file "LICENSE"                       *
763
 ********************************************************************************/
764
#ifndef FAIRMODULE_H
765
#define FAIRMODULE_H
766

    
767
#include "TNamed.h"                     // for TNamed
768

    
769
#include "FairGeoInterface.h"           // for FairGeoInterface
770
#include "FairGeoLoader.h"              // for FairGeoLoader
771
#include "FairGeoNode.h"                // for FairGeoNode
772
#include "FairGeoVolume.h"              // for FairGeoVolume
773
#include "FairLogger.h"                 // for FairLogLevel::INFO, etc
774
#include "FairRun.h"                    // for FairRun
775
#include "FairRuntimeDb.h"              // for FairRuntimeDb
776

    
777
#include "Rtypes.h"                     // for Bool_t, Int_t, etc
778
#include "TList.h"                      // for TList (ptr only), TListIter
779
#include "TObjArray.h"                  // for TObjArray
780
#include "TString.h"                    // for TString, operator!=
781

    
782
#include <stddef.h>                     // for NULL
783
#include <string>                       // for string
784

    
785
class FairVolumeList;
786
class FairVolume;
787
class TArrayI;
788
class TGeoMatrix;
789
class TGeoNode;
790
class TGeoVolume;
791
class TGeoMedium;
792
class TRefArray;
793

    
794
/**
795
 * Base class for constructing all detecors and passive volumes
796
 * @author M. Al-Turany, Denis Bertini
797
 * @version 1.0
798
 * @since 01.04.08 M.Al-Turany
799
 * Add methods to construct geometry via ROOT files
800
 * Add some documentation
801
 *
802
 * Changelog: 29.02.2012 [O.Merle] Fixed missing material assignment for top volume.
803
 *                                 ... and please - add some documentation to your code.
804
 */
805
class FairModule:  public TNamed
806
{
807
  public:
808
    /**default ctor*/
809
    FairModule();
810
    /**Standard ctor*/
811
    FairModule(const char* Name, const char* title, Bool_t Active=kFALSE);
812
    /**default dtor*/
813
    virtual  ~FairModule();
814
    /**Print method should be implemented in detector or module*/
815
    virtual void        Print(Option_t*) const {;}
816
    /**Set the geometry file name o be used*/
817
    virtual void        SetGeometryFileName(TString fname, TString geoVer="0");
818
    /**Get the Geometry file name*/
819
    virtual TString     GetGeometryFileName() {return  fgeoName ;}
820
    /**Get the geometry file version if used*/
821
    virtual TString     GetGeometryFileVer() {return   fgeoVer ;}
822
    /**method called from the MC application to construct the geometry, has to be implimented by user*/
823
    virtual void        ConstructGeometry();
824
    /**method called from the MC application to set optical geometry properties*/
825
    virtual void        ConstructOpGeometry();
826
    /**construct geometry from root files (TGeo)*/
827
    virtual void        ConstructRootGeometry();
828
    /**construct geometry from standard ASSCII files (Hades Format)*/
829
    virtual void        ConstructASCIIGeometry();
830
    /** Modify the geometry for the simulation run using methods of the Root geometry package */
831
    virtual void        ModifyGeometry() {;}
832
    /**construct geometry from GDML files*/
833
    virtual void        ConstructGDMLGeometry(TGeoMatrix*);
834
    /** Clone this object (used in MT mode only)*/
835
    virtual FairModule* CloneModule() const;
836
    /** Init worker run (used in MT mode only) */
837
    virtual void BeginWorkerRun() const {;}
838
    /** Finish worker run (used in MT mode only) */
839
    virtual void FinishWorkerRun() const {;}
840

    
841
    /**template function to construct geometry. to be used in derived classes.*/
842
    template<class T, class U>
843
    void ConstructASCIIGeometry(T dataType1, TString containerName="", U datatype2 = NULL);
844

    
845
    /**Set the sensitivity flag for volumes, called from ConstructASCIIRootGeometry(), and has to be implimented for detectors
846
     * which use ConstructASCIIRootGeometry() to build the geometry */
847
    virtual Bool_t      CheckIfSensitive(std::string name);
848
    /**called from ConstructRootGeometry()*/
849
    virtual void        ExpandNode(TGeoNode* Node);
850
    /**called from ConstructGDMLGeometry()*/
851
    virtual void        ExpandNodeForGDML(TGeoNode*);
852
    /**return the MC id of a volume named vname*/
853
    virtual Int_t       getVolId( const TString& ) const {return 0;}
854
    /**return the detector/Module id (which was set in the sim macro for the detector)*/
855
    Int_t               GetModId() {return fModId;}
856
    /**Set the verbose level in this detector*/
857
    void                SetVerboseLevel(Int_t level) {fVerboseLevel=level;}
858
    /**return the detector status */
859
    Bool_t              IsActive() {return fActive;}
860
    /**set the detector/module id*/
861
    void                SetModId(Int_t id) {fModId=id;}
862
    /** Set the name of the mother volume to which a new geometry is added.
863
     ** This function is needed for geometries which are defined as ROOT geometry manager.
864
     **/
865
    void                SetMotherVolume(TString volName) {fMotherVolumeName=volName;}
866
    /**called from ConstuctASCIIGeometry*/
867
    void   ProcessNodes ( TList* aList );
868
    /**Set the parameter containers*/
869
    virtual  void       SetParContainers() {;}
870
    /** Initialize everything which has to be done before the construction and modification
871
     ** of the geometry. Mostly this is needed to read data from the parameter containers.*/
872
    virtual  void       InitParContainers() {;}
873
    /**return the geo parameter of this detector/module*/
874
    TList* GetListOfGeoPar() { return flGeoPar;}
875

    
876
    /**list of volumes in a simulation session*/
877
    static              FairVolumeList*   vList; //!
878
    /**total number of volumes in a simulaion session*/
879
    static Int_t        fNbOfVolumes;  //!
880
    /**list of all sensitive volumes in  a simulaion session*/
881
    static TRefArray*   svList;   //!
882

    
883
    static TArrayI*     volNumber; //!
884
    TString             fMotherVolumeName; //!
885
    FairVolume*   getFairVolume(FairGeoNode* fNode);
886
    void    AddSensitiveVolume(TGeoVolume* v);
887
  private:
888
    /** Re-implimented from ROOT:  TGeoMatrix::SetDefaultName()  */
889
    void SetDefaultMatrixName(TGeoMatrix* matrix);
890
    void AssignMediumAtImport(TGeoVolume* v);  // O.Merle, 29.02.2012 - see impl.
891

    
892
    /**called from ConstructGDMLGeometry. Changes default ID created by TGDMLParse*/
893
    void ReAssignMediaId();
894
    void swap(FairModule& other) throw();
895

    
896
  protected:
897
    FairModule(const FairModule&);
898
    FairModule& operator=(const FairModule&);
899
    TString             fgeoVer;
900
    TString             fgeoName;
901
    Int_t               fModId;
902
    Bool_t              fActive;
903
    Int_t               fNbOfSensitiveVol; //!
904
    Int_t               fVerboseLevel;
905
    TList*              flGeoPar; //!  list of Detector Geometry parameters
906
    Bool_t              kGeoSaved; //! flag for initialisation
907

    
908
    ClassDef( FairModule,4)
909
};
910

    
911
template<class T, class U>
912
void FairModule::ConstructASCIIGeometry(T dataType1, TString containerName, U)
913
{
914
  FairGeoLoader* loader=FairGeoLoader::Instance();
915
  FairGeoInterface* GeoInterface =loader->getGeoInterface();
916
  T* MGeo=new T();
917
  MGeo->print();
918
  MGeo->setGeomFile(GetGeometryFileName());
919
  GeoInterface->addGeoModule(MGeo);
920
  Bool_t rc = GeoInterface->readSet(MGeo);
921
  if ( rc ) { MGeo->create(loader->getGeoBuilder()); }
922

    
923
  TList* volList = MGeo->getListOfVolumes();
924
  // store geo parameter
925
  FairRun* fRun = FairRun::Instance();
926
  FairRuntimeDb* rtdb= FairRun::Instance()->GetRuntimeDb();
927

    
928
  dataType1 = *MGeo;
929

    
930
  if ( "" != containerName) {
931
    LOG(INFO) << "Add GeoNodes for "<< MGeo->getDescription()
932
              << " to container " << containerName << FairLogger::endl;
933

    
934
    //    U par=(U)(rtdb->getContainer(containerName));
935
    U*      par=static_cast<U*>(rtdb->getContainer(containerName));
936
    TObjArray* fSensNodes = par->GetGeoSensitiveNodes();
937
    TObjArray* fPassNodes = par->GetGeoPassiveNodes();
938

    
939
    TListIter iter(volList);
940
    FairGeoNode* node   = NULL;
941
    FairGeoVolume* aVol=NULL;
942

    
943
    while( (node = static_cast<FairGeoNode*>(iter.Next())) ) {
944
      aVol = dynamic_cast<FairGeoVolume*> ( node );
945
      if ( node->isSensitive()  ) {
946
        fSensNodes->AddLast( aVol );
947
      } else {
948
        fPassNodes->AddLast( aVol );
949
      }
950
    }
951
    ProcessNodes( volList );
952
    par->setChanged();
953
    par->setInputVersion(fRun->GetRunId(),1);
954

    
955
  }
956
}
957

    
958

    
959
#endif //FAIRMODULE_H
960
/********************************************************************************
961
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
962
 *                                                                              *
963
 *              This software is distributed under the terms of the             * 
964
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *  
965
 *                  copied verbatim in the file "LICENSE"                       *
966
 ********************************************************************************/
967
/// Class FAIRParticle
968
/// ------------------
969
/// Extended TParticle with persistent pointers to mother and daughters
970
/// particles  (Ivana Hrivnacova, 5.4.2002)
971
/// Used to define particles which will be added to Geant3/4 (M. Al-Turany)
972

    
973
#ifndef FAIR_PARTICLE_H
974
#define FAIR_PARTICLE_H
975

    
976
#include "TObject.h"                    // for TObject
977

    
978
#include "Rtypes.h"                     // for Int_t, Double_t, Bool_t, etc
979
#include "TMCParticleType.h"            // for TMCParticleType
980
#include "TRef.h"                       // for TRef
981
#include "TRefArray.h"                  // for TRefArray
982
#include "TString.h"                    // for TString
983

    
984
class TParticle;
985

    
986
class FairParticle : public TObject
987
{
988
  public:
989
    FairParticle(Int_t id, TParticle* particle);
990
    FairParticle(Int_t id, TParticle* particle, FairParticle* mother);
991
    FairParticle(const char* name, Int_t z, Int_t a, Int_t s,Double_t mass , Int_t q, Bool_t stable, Double_t decaytime);
992
    FairParticle(const char* name, Int_t z, Int_t a, Double_t mass , Int_t q, Bool_t stable, Double_t decaytime);
993
    FairParticle( Int_t pdg , const TString name, TMCParticleType mcType, Double_t mass, Double_t charge,
994
                  Double_t lifetime, const TString pType="Ion",  Double_t width=0, Int_t iSpin=0, Int_t iParity=0,
995
                  Int_t iConjugation=0, Int_t iIsospin=0, Int_t iIsospinZ=0, Int_t gParity=0, Int_t lepton=0,
996
                  Int_t baryon=0,Bool_t stable=kFALSE);
997

    
998
    FairParticle();
999

    
1000
    virtual ~FairParticle();
1001

    
1002
    // methods
1003
    void SetMother(FairParticle* particle);
1004
    void AddDaughter(FairParticle* particle);
1005
    virtual void  Print(Option_t* option = "") const;
1006
    void PrintDaughters() const;
1007

    
1008
    // get methods
1009
    Int_t            GetPDG() const;
1010
    TParticle*       GetParticle() const;
1011
    FairParticle*     GetMother() const;
1012
    Int_t            GetNofDaughters() const;
1013
    FairParticle*     GetDaughter(Int_t i) const;
1014
    virtual const char* GetName() const {return fname.Data();}
1015
    TMCParticleType  GetMCType()  {return fmcType;}
1016
    Double_t         GetMass()          {return fmass;}
1017
    Double_t         GetCharge()        {return fcharge;}
1018
    Double_t         GetDecayTime()     {return fDecayTime;}
1019
    const TString&   GetPType()         {return fpType;}
1020
    Double_t         GetWidth()         {return fwidth;}
1021
    Int_t            GetSpin()          {return fiSpin;}
1022
    Int_t            GetiParity()        {return fiParity;}
1023
    Int_t            GetConjugation()   {return fiConjugation;}
1024
    Int_t            GetIsospin()       {return fiIsospin;}
1025
    Int_t            GetIsospinZ()      {return fiIsospinZ;}
1026
    Int_t            GetgParity()        {return fgParity;}
1027
    Int_t            GetLepton()        {return flepton;}
1028
    Int_t            GetBaryon()        {return fbaryon;}
1029
    Bool_t           IsStable()         {return fstable;}
1030

    
1031
  private:
1032

    
1033
    FairParticle(const FairParticle& P);
1034
    FairParticle& operator= (const  FairParticle&) {return *this;}
1035
    // data members
1036
    Int_t     fpdg;
1037
    TParticle*    fParticle;
1038
    TRef          fMother;
1039
    TRefArray     fDaughters;
1040
    const TString            fname;
1041
    TMCParticleType   fmcType;
1042
    Double_t    fmass;
1043
    Double_t    fcharge;
1044
    Double_t    fDecayTime;
1045
    const TString   fpType;
1046
    Double_t    fwidth;
1047
    Int_t     fiSpin;
1048
    Int_t     fiParity;
1049
    Int_t     fiConjugation;
1050
    Int_t     fiIsospin;
1051
    Int_t     fiIsospinZ;
1052
    Int_t     fgParity;
1053
    Int_t     flepton;
1054
    Int_t     fbaryon;
1055
    Bool_t    fstable;
1056

    
1057
    ClassDef(FairParticle,3) // Extended TParticle
1058
};
1059

    
1060
#endif //FAIR_PARTICLE_H   
1061

    
1062

    
1063
/********************************************************************************
1064
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
1065
 *                                                                              *
1066
 *              This software is distributed under the terms of the *
1067
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3, *
1068
 *                  copied verbatim in the file "LICENSE" *
1069
 ********************************************************************************/
1070

    
1071
/** FairPrimaryGenerator.h
1072
 *@author V.Friese  <v.friese@gsi.de>
1073
 *
1074
The FairPrimaryGenerator is responsible for the handling of the MC input.
1075
Several input generators can be registered to it; these have to be
1076
derived from the FairGenerator class. The FairPrimaryGenerator defines
1077
position and (optionally) smearing of the primary vertex.
1078
This class should be instantised only once.
1079

    
1080
Modified 05.06.07:  add a method DoTracking(Bool_t) to be able to switch on/off
1081
the tracking from the macro (M. Al-Turany)
1082

    
1083
**/
1084

    
1085
#ifndef FAIRPRIMARYGENERATOR_H
1086
#define FAIRPRIMARYGENERATOR_H
1087

    
1088
#include "TNamed.h" // for TNamed
1089

    
1090
#include "FairGenerator.h" // for FairGenerator
1091

    
1092
#include "Riosfwd.h"   // for ostream
1093
#include "Rtypes.h"    // for Double_t, Bool_t, Int_t, etc
1094
#include "TObjArray.h" // for TObjArray
1095
#include "TVector3.h"  // for TVector3
1096

    
1097
#include <iostream> // for operator<<, basic_ostream, etc
1098

    
1099
class FairGenericStack;
1100
class FairMCEventHeader;
1101
class TF1;
1102
class TIterator;
1103

    
1104
class FairPrimaryGenerator : public TNamed {
1105

    
1106
public:
1107
  /** Default constructor. **/
1108
  FairPrimaryGenerator();
1109

    
1110
  /** Constructor with name and title **/
1111
  FairPrimaryGenerator(const char *name, const char *title = "FAIR Generator");
1112

    
1113
  /** Destructor. **/
1114
  virtual ~FairPrimaryGenerator();
1115

    
1116
  /** Initialize the generater (if needed!)*/
1117
  virtual Bool_t Init();
1118

    
1119
  /** Register a generator derived from FairGenerator.  **/
1120
  void AddGenerator(FairGenerator *generator) {
1121
    if (!fGenList) {
1122
      std::cout << "Empty fGenList pointer ! " << std::endl;
1123
      return;
1124
    }
1125
    fGenList->Add(generator);
1126
  }
1127

    
1128
  /** Public method GenerateEvent
1129
      To be called at the beginning of each event from FairMCApplication.
1130
      Generates an event vertex and calls the ReadEvent methods from the
1131
      registered generators.
1132
      *@param pStack The particle stack
1133
      *@return kTRUE if successful, kFALSE if not
1134
      **/
1135
  virtual Bool_t GenerateEvent(FairGenericStack *pStack);
1136

    
1137
  /** Public method AddTrack
1138
      Adding a track to the MC stack. To be called within the ReadEvent
1139
      methods of the registered generators.
1140
      *@param pdgid Particle ID (PDG code)
1141
      *@param px,py,pz Momentum coordinates [GeV]
1142
      *@param vx,vy,vz Track origin relative to event vertex
1143
      **/
1144
  virtual void AddTrack(Int_t pdgid, Double_t px, Double_t py, Double_t pz,
1145
                        Double_t vx, Double_t vy, Double_t vz,
1146
                        Int_t parent = -1, Bool_t wanttracking = true,
1147
                        Double_t e = -9e9, Double_t tof = 0.,
1148
                        Double_t weight = 0.);
1149

    
1150
  /** Clone this object (used in MT mode only) */
1151
  virtual FairPrimaryGenerator* ClonePrimaryGenerator() const;
1152

    
1153
  /** Set beam position and widths.
1154
   *@param beamX0      mean x position of beam at target
1155
   *@param beamY0      mean y position of beam at target
1156
   *@param beamSigmaX  Gaussian beam width in x
1157
   *@param beamSigmaY  Gaussian beam width in y
1158
   **/
1159
  void SetBeam(Double_t beamX0, Double_t beamY0, Double_t beamSigmaX,
1160
               Double_t beamSigmaY);
1161

    
1162
  /** Set nominal beam angle and angle widths.
1163
   *@param beamAngleX0      mean x angle of beam at target
1164
   *@param beamAngleY0      mean y angle of beam at target
1165
   *@param beamAngleSigmaX  Gaussian beam angle width in x
1166
   *@param beamAngleSigmaY  Gaussian beam angle width in y
1167
   **/
1168
  void SetBeamAngle(Double_t beamAngleX0, Double_t beamAngleY0,
1169
                    Double_t beamAngleSigmaX, Double_t beamAngleSigmaY);
1170

    
1171
  /** Public method SetEventPlane
1172
   **@param phiMin   Lower limit for event plane angle [rad]
1173
   **@param phiMax   Upper limit for event plane angle [rad]
1174
   **If set, an event plane angle will be generated with flat
1175
   **distrtibution between phiMin and phiMax.
1176
   **/
1177
  void SetEventPlane(Double_t phiMin, Double_t phiMax);
1178

    
1179
  /** Set target position and thickness.
1180
   *@param targetZ   z position of target center
1181
   *@param targetDz  full target thickness
1182
   **/
1183
  void SetTarget(Double_t targetZ, Double_t targetDz);
1184

    
1185
  /** Set target position for multiple tagets. The thickness
1186
   * is the same for all targets.
1187
   *@param nroftargets   number of targets
1188
   *@param *targetZ      z positions of target center
1189
   *@param targetDz      full target thickness
1190
   **/
1191
  void SetMultTarget(Int_t nroftargets, Double_t *targetZ, Double_t targetDz);
1192

    
1193
  /** Enable vertex smearing in z and/or xy direction **/
1194
  void SmearVertexZ(Bool_t flag);
1195
  void SmearGausVertexZ(Bool_t flag);
1196
  void SmearVertexXY(Bool_t flag);
1197
  void SmearGausVertexXY(Bool_t flag);
1198

    
1199
  TObjArray *GetListOfGenerators() { return fGenList; }
1200

    
1201
  /** Set the pointer to the MCEvent **/
1202
  void SetEvent(FairMCEventHeader *event) {
1203
    fEvent = event;
1204
  };
1205

    
1206
  /** Accessor to the MCEvent **/
1207
  FairMCEventHeader *GetEvent() {
1208
    return fEvent;
1209
  };
1210

    
1211
  /** Swich on/off the tracking of a particle*/
1212

    
1213
  void DoTracking(Bool_t doTracking = kTRUE) { fdoTracking = doTracking; }
1214

    
1215
  Int_t GetTotPrimary() { return fTotPrim; }
1216

    
1217
protected:
1218
  /**  Copy constructor */
1219
  FairPrimaryGenerator(const FairPrimaryGenerator&);
1220
  /**  Assignment operator */
1221
  FairPrimaryGenerator &operator=(const FairPrimaryGenerator&);
1222

    
1223
  /**  Nominal beam position at target in x [cm] */
1224
  Double_t fBeamX0;
1225
  /** Nominal beam position at target in y [cm]*/
1226
  Double_t fBeamY0;
1227
  /** Beam width (Gaussian) in x [cm]*/
1228
  Double_t fBeamSigmaX;
1229
  /**  Beam width (Gaussian) in y [cm]*/
1230
  Double_t fBeamSigmaY;
1231

    
1232
  /**  Nominal beam angle at target in x [rad] */
1233
  Double_t fBeamAngleX0;
1234
  /**  Nominal beam angle at target in y [rad] */
1235
  Double_t fBeamAngleY0;
1236
  /**  Actual beam angle at target in x [rad] */
1237
  Double_t fBeamAngleX;
1238
  /**  Actual beam angle at target in y [rad] */
1239
  Double_t fBeamAngleY;
1240
  /** Beam angle width (Gaussian) in x [rad]*/
1241
  Double_t fBeamAngleSigmaX;
1242
  /** Beam angle width (Gaussian) in y [rad]*/
1243
  Double_t fBeamAngleSigmaY;
1244
  /** Actual beam direction at the vertex */
1245
  TVector3 fBeamDirection;
1246

    
1247
  /** Lower limit for the event plane rotation angle [rad] */
1248
  Double_t fPhiMin;
1249
  /** Upper limit for the event plane rotation angle [rad] */
1250
  Double_t fPhiMax;
1251
  /** Actual event plane rotation angle [rad] */
1252
  Double_t fPhi;
1253

    
1254
  /**  Nominal z position of center of targets [cm]*/
1255
  Double_t *fTargetZ; //!
1256
  /**  Number of targets;*/
1257
  Int_t fNrTargets;
1258
  /**  Full target thickness [cm]*/
1259
  Double_t fTargetDz;
1260

    
1261
  /** Vertex position of current event [cm]*/
1262
  TVector3 fVertex;
1263

    
1264
  /** Number of primary tracks in current event*/
1265
  Int_t fNTracks;
1266

    
1267
  /**  Flag for uniform vertex smearing in z*/
1268
  Bool_t fSmearVertexZ;
1269
  /**  Flag for gaus vertex smearing in z*/
1270
  Bool_t fSmearGausVertexZ;
1271
  /**  Flag for vertex smearing in xy*/
1272
  Bool_t fSmearVertexXY;
1273
  /**  Flag for gaus vertex smearing in xy*/
1274
  Bool_t fSmearGausVertexXY;
1275
  /**  Flag for beam gradient calculation*/
1276
  Bool_t fBeamAngle;
1277
  /**  Flag for event plane rotation*/
1278
  Bool_t fEventPlane;
1279

    
1280
  /**  Pointer to MC stack*/
1281
  FairGenericStack *fStack; //!
1282
  /**  List of registered generators */
1283
  TObjArray *fGenList;
1284
  /**  Iterator over generator list */
1285
  TIterator *fListIter; //!
1286
  /**  Pointer to MCEventHeader */
1287
  FairMCEventHeader *fEvent; //!
1288
  /** go to tracking  */
1289
  Bool_t fdoTracking; //!
1290
  /** Number of MC tracks before a Generator is called, needed for MC index
1291
   * update */
1292
  Int_t fMCIndexOffset; //!
1293
  /** Number of all primaries of this run*/
1294
  static Int_t fTotPrim; //!
1295
  /** Event number (Set by the primary generator if not set already by one of
1296
      the specific generators
1297
   **/
1298
  Int_t fEventNr;
1299

    
1300
  /** Private method MakeVertex. If vertex smearing in xy is switched on,
1301
      the event vertex is smeared Gaussianlike in x and y direction
1302
      according to the mean beam positions and widths set by the
1303
      SetBeam method. If vertex smearing in z is switched on, the z
1304
      coordinate of the event vertex is flatly distributed over the
1305
      extension of the target.
1306
      To be called at the beginning of the event from the
1307
      GenerateEvent method.
1308
  **/
1309
  void MakeVertex();
1310

    
1311
  /** Private method MakeBeamAngle. If beam angle smearing in xy
1312
  is switched on, all tracks in an event are rotated by a Gaussianlike
1313
  angle distribution around the x and y axis according to the mean
1314
  beam angle and angle widths set by the SetBeamAngle method.
1315
  To be called at the beginning of the event from the GenerateEvent
1316
  method.
1317
  **/
1318
  void MakeBeamAngle();
1319

    
1320
  /** Private method MakeEventPlane. If the rotation of the event around the
1321
      z-axis by a random angle is switched on, the complete event is rotated
1322
      by the chosen angle. This function is called at the beginning of the
1323
      event from the GenerateEvent method. The function pick a random
1324
      rotation angle between fPhiMin and fPhiMax which are set using the
1325
      function SetEventPlane.
1326
  **/
1327
  void MakeEventPlane();
1328

    
1329
  ClassDef(FairPrimaryGenerator, 5);
1330
};
1331

    
1332
#endif
1333
/********************************************************************************
1334
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
1335
 *                                                                              *
1336
 *              This software is distributed under the terms of the             * 
1337
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *  
1338
 *                  copied verbatim in the file "LICENSE"                       *
1339
 ********************************************************************************/
1340
#ifndef FAIRRUNIDGENERATOR_H
1341
#define FAIRRUNIDGENERATOR_H
1342

    
1343
#include <time.h>               // IWYU pragma: keep for timespec
1344
// IWYU pragma: no_include <sys/_structs.h>
1345

    
1346
typedef unsigned char      uint8_t;
1347
typedef unsigned short int uint16_t;
1348
typedef unsigned int       uint32_t;
1349
typedef unsigned char      uuid_t[16];
1350

    
1351
class FairRunIdGenerator
1352
{
1353
    struct uuid {
1354
      uint32_t time_low;
1355
      uint16_t time_mid;
1356
      uint16_t time_hi_and_version;
1357
      uint16_t clock_seq;
1358
      uint8_t node[6];
1359
    };
1360

    
1361
    struct timespec fTimeSpec;
1362

    
1363
    int get_random_fd(void);
1364
    void get_random_bytes(void*, int);
1365
    int get_node_id(unsigned char*);
1366
    int get_clock(uint32_t*, uint32_t*, uint16_t*);
1367
    void uuid_generate_time(uuid_t);
1368
    void uuid_generate_random(uuid_t);
1369
    void uuid_generate(uuid_t);
1370
    void uuid_pack(const struct uuid*, uuid_t);
1371
    void uuid_unpack(const uuid_t, struct uuid*);
1372
  public:
1373
    struct timespec getTimeSpec() {return fTimeSpec;}
1374
    struct timespec getTimeSpecFromTID( unsigned  int ms);
1375
    unsigned  int getTID();
1376

    
1377
  public:
1378
    FairRunIdGenerator() : fTimeSpec() {}
1379
    ~FairRunIdGenerator() {}
1380
    unsigned int generateId(void);
1381

    
1382

    
1383

    
1384
};
1385

    
1386
#endif
1387
/********************************************************************************
1388
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
1389
 *                                                                              *
1390
 *              This software is distributed under the terms of the             * 
1391
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *  
1392
 *                  copied verbatim in the file "LICENSE"                       *
1393
 ********************************************************************************/
1394
#ifndef FAIR_VOLUME_H
1395
#define FAIR_VOLUME_H
1396

    
1397
#include "TNamed.h"                     // for TNamed
1398

    
1399
#include "Rtypes.h"                     // for Int_t, FairVolume::Class, etc
1400
#include "TString.h"                    // for TString
1401
#include "FairModule.h"
1402
#include "FairDetector.h"
1403
class FairGeoNode;
1404

    
1405
/**
1406
 * This Object is only used for internal book keeping!
1407
 * @author M. Al-Turany, D. Bertini
1408
 * @version 0.1
1409
 * @since 12.01.04
1410
 */
1411

    
1412

    
1413
class FairVolume : public TNamed
1414
{
1415

    
1416
  public:
1417

    
1418
    FairVolume();
1419
    FairVolume(TString name, Int_t id=0, Int_t detid=0,FairModule* fMod=0);
1420
    virtual ~FairVolume();
1421

    
1422
    //    const char*  GetName() { return fName.Data();}
1423
    //    TString getName() { return fName;}
1424

    
1425
    void setRealName( TString name ) { fRealName = name;}
1426
    const char* getRealName() { return fRealName.Data();}
1427
    Int_t getVolumeId() { return fVolumeId;}
1428
    Int_t getModId() { return  fModId;}
1429
    void  setModId(Int_t id) { fModId=id;}
1430
    void  setCopyNo(Int_t id) { fCopyNo=id;}
1431
    void  setVolumeId ( Int_t id ) {fVolumeId= id;}
1432
    void  setGeoNode(FairGeoNode* d) {fNode=d;}
1433
    void  setMotherId(Int_t fM) {fMotherId=fM;}
1434
    void  setMotherCopyNo(Int_t CopyNo) {fMotherCopyNo=CopyNo;}
1435

    
1436
    FairModule*   GetModule()     {return fModule;}
1437
    FairDetector* GetDetector() { return fDetector;}
1438
    void SetModule(FairModule* mod) {
1439
        fModule=mod;
1440
        if (mod->InheritsFrom("FairDetector")){
1441
           fDetector=dynamic_cast<FairDetector *>(mod);
1442
        }
1443
    }
1444

    
1445
    Int_t getMCid() {return fMCid;}
1446
    Int_t getCopyNo() { return fCopyNo;}
1447
    void  setMCid(Int_t id) {fMCid=id;}
1448
    FairGeoNode* getGeoNode() {return fNode;}
1449
    Int_t getMotherId() { return fMotherId;}
1450
    Int_t getMotherCopyNo() {return fMotherCopyNo;}
1451

    
1452

    
1453
  private:
1454
    FairVolume(const FairVolume&);
1455
    FairVolume& operator=(const FairVolume&);
1456

    
1457
    //    TString fName;   /**Volume Name in MC*/
1458
    TString fRealName; /**Volume Name in ASCII file*/
1459
    Int_t fVolumeId;       /**Volume Id in GeoManager*/
1460
    Int_t fModId;          /**Module Id in which this volume exist*/
1461
    Int_t fMCid;   /**Volume Id in MC*/
1462
    Int_t fCopyNo;         /**Volume Copy No*/
1463
    Int_t fMotherId; /**Mother Volume Id*/
1464
    Int_t fMotherCopyNo;   /**Mother Volume Copy No*/
1465
    FairDetector* fDetector; /** The Detector which will proccess the hits for this volume*/
1466
    FairModule*   fModule;    /**The Module in which the volume is */
1467
    FairGeoNode*  fNode;     /**Node corresponding to this volume*/
1468
    
1469

    
1470
    ClassDef(FairVolume,2) // Volume Definition
1471

    
1472
};
1473

    
1474
#endif //
1475
/********************************************************************************
1476
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
1477
 *                                                                              *
1478
 *              This software is distributed under the terms of the             * 
1479
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *  
1480
 *                  copied verbatim in the file "LICENSE"                       *
1481
 ********************************************************************************/
1482
#ifndef FAIR_VOLUMELIST_H
1483
#define FAIR_VOLUMELIST_H
1484

    
1485
#include "TObject.h"                    // for TObject
1486

    
1487
#include "FairVolume.h"
1488

    
1489
#include "Rtypes.h"                     // for Int_t, etc
1490
#include "TObjArray.h"                  // for TObjArray
1491
#include "TString.h"                    // for TString
1492

    
1493
//class FairVolume;
1494

    
1495
/**
1496
* This Object is only used for internal book keeping!
1497
* @author M. Al-Turany, D. Bertini
1498
* @version 0.1
1499
* @since 12.01.04
1500
*/
1501

    
1502
class FairVolumeList : public TObject
1503
{
1504
  private:
1505
    TObjArray* fData;
1506
    FairVolumeList(const FairVolumeList&);
1507
    FairVolumeList& operator=(const FairVolumeList&);
1508

    
1509
  public:
1510
    FairVolumeList();
1511
    virtual ~FairVolumeList();
1512

    
1513
    FairVolume* getVolume( TString* name );
1514
    Int_t getVolumeId( TString* name );
1515

    
1516
    FairVolume* findObject( TString name );
1517
    void addVolume( FairVolume* elem);
1518

    
1519
    Int_t getEntries () { return fData->GetEntries();}
1520
    FairVolume* At(Int_t pos ) { return ( dynamic_cast<FairVolume*>(fData->At(pos))); }
1521

    
1522
    ClassDef(FairVolumeList,1) // Volume List
1523
};
1524

    
1525
#endif //FAIR_VOLUMELIST_H
1526

    
1527

    
1528
/********************************************************************************
1529
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
1530
 *                                                                              *
1531
 *              This software is distributed under the terms of the             * 
1532
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *  
1533
 *                  copied verbatim in the file "LICENSE"                       *
1534
 ********************************************************************************/
1535
//* $Id: */
1536

    
1537
// -------------------------------------------------------------------------
1538
// -----                     FairEventBuilder header file                -----
1539
// -----                  Created 23/09/2013 by R. Karabowicz          -----
1540
// -------------------------------------------------------------------------
1541

    
1542

    
1543
/** FairEventBuilder
1544
 *@author Radoslaw Karabowicz <r.karabowicz@gsi.de>
1545
 *@since 23/09/2013
1546
 *@version 1.0
1547
 **
1548
 ** FairRoot base task for the event buffers.
1549
 ** The tasks may:
1550
 ** 1. analyze data to reconstruct event times or other characteristics
1551
 **    in the function TClonesArray* FindEvents(), that returns
1552
 **    TClonesArray of FairRecoEvents
1553
 ** 2. identify the data that could belong to event in the
1554
 **    function and insert this identified data to the output TClonesArrays
1555
 **    in the function StoreEventData(event)
1556
 ** The implementations may be using any or both of the above functions.
1557
 **/
1558

    
1559

    
1560
#ifndef FAIREVENTBUILDER_H
1561
#define FAIREVENTBUILDER_H 1
1562

    
1563
#include "FairWriteoutBuffer.h"
1564
#include "FairRecoEventHeader.h"
1565

    
1566
#include "TStopwatch.h"
1567
#include "TString.h"
1568

    
1569
#include <map>
1570
#include <set>
1571
#include <vector>
1572

    
1573
class TClonesArray;
1574
//class FairRecoEventHeader;
1575

    
1576
class FairEventBuilder : public FairWriteoutBuffer
1577
{
1578

    
1579

    
1580
  public :
1581

    
1582
    /** Default constructor **/
1583
    FairEventBuilder();
1584

    
1585

    
1586
    /** Constructor with task name **/
1587
    FairEventBuilder(TString branchName, TString className, TString folderName, Bool_t persistance);
1588

    
1589

    
1590
    /** Destructor **/
1591
    virtual ~FairEventBuilder();
1592

    
1593
    virtual void WriteOutAllDeadTimeData();
1594

    
1595
    virtual std::vector<std::pair<double, FairRecoEventHeader*> > FindEvents() = 0;
1596
    virtual void          StoreEventData(FairRecoEventHeader* /*recoEvent*/) = 0;
1597

    
1598
    void  SetIdentifier(Int_t ident) {
1599
      fIdentifier=ident;
1600
    }
1601
    Int_t GetIdentifier() {
1602
      return fIdentifier;
1603
    }
1604

    
1605
    virtual Bool_t Init() = 0;
1606

    
1607
    virtual void Print(Option_t *option="") const = 0;
1608

    
1609
    /** Finish at the end of each event **/
1610
    virtual void Finish();
1611

    
1612
    Double_t AllowedTime() {
1613
      return fMaxAllowedEventCreationTime;
1614
    };
1615
    void SetMaxAllowedTime(Double_t td) {
1616
      fMaxAllowedEventCreationTime = td;
1617
    };
1618

    
1619
    void    SetBuilderName(const char* name) {
1620
      fBuilderName=name;
1621
    }
1622
    TString GetBuilderName() {
1623
      return fBuilderName;
1624
    }
1625

    
1626
  private:
1627

    
1628
    TString    fBuilderName;
1629

    
1630
    TStopwatch fTimer;
1631
    Double_t   fExecTime;
1632

    
1633
    Int_t      fIdentifier;
1634
    Double_t   fMaxAllowedEventCreationTime;
1635

    
1636
    ClassDef(FairEventBuilder,1);
1637

    
1638
};
1639

    
1640
#endif
1641
/********************************************************************************
1642
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
1643
 *                                                                              *
1644
 *              This software is distributed under the terms of the             * 
1645
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *  
1646
 *                  copied verbatim in the file "LICENSE"                       *
1647
 ********************************************************************************/
1648
//* $Id: */
1649

    
1650
// -------------------------------------------------------------------------
1651
// -----                     FairEventBuilderManager header file              -----
1652
// -----                  Created 20/09/2013 by R. Karabowicz          -----
1653
// -------------------------------------------------------------------------
1654

    
1655

    
1656
/** FairEventBuilderManager
1657
 *@author Radoslaw Karabowicz <r.karabowicz@gsi.de>
1658
 *@since 20/09/2013
1659
 *@version 1.0
1660
 **
1661
 ** FairRoot general task for recreating events in Time-Based reconstruction mode.
1662
 ** Various experiments should implement their own version of Event Builder.
1663
 ** The main member of the task is vector of reconstructed events fRecoEvents.
1664
 ** It also contains a vector of implementations of FairEventBuilders, that are
1665
 ** responsible for feeding fRecoEvents vector via FindEvents() function.
1666
 **
1667
 ** The heart of the experiment-specific implemenations is
1668
 ** the AnalyzeAndExtractEvents() function, which should interpret
1669
 ** the experimental data to reconstruct events.
1670
 **/
1671

    
1672

    
1673
#ifndef FAIREVENTBUILDERMANAGER_H
1674
#define FAIREVENTBUILDERMANAGER_H 1
1675

    
1676
#include "FairTask.h"
1677
#include "FairEventBuilder.h"
1678

    
1679
#include "TStopwatch.h"
1680

    
1681
#include <map>
1682
#include <set>
1683
#include <vector>
1684

    
1685
class TClonesArray;
1686

    
1687
class FairEventBuilderManager : public FairTask
1688
{
1689

    
1690

    
1691
  public :
1692

    
1693
    /** Default constructor **/
1694
    FairEventBuilderManager();
1695

    
1696

    
1697
    /** Constructor with task name **/
1698
    FairEventBuilderManager(const char* name, Int_t iVerbose=1);
1699

    
1700

    
1701
    /** Destructor **/
1702
    virtual ~FairEventBuilderManager();
1703

    
1704

    
1705
    /** Execution **/
1706
    virtual void Exec(Option_t* opt);
1707

    
1708

    
1709
    /** Adding FairEventBuilder **/
1710
    virtual void AddEventBuilder(FairEventBuilder* eventBuilder);
1711

    
1712
  protected:
1713

    
1714
    std::vector<FairEventBuilder*> fEventBuilders;
1715
    std::vector<std::vector<std::pair<double,FairRecoEventHeader*> > >  fPossibleEvents;
1716

    
1717

    
1718
    /** Fill events from various builders **/
1719
    virtual Double_t FillEventVectors();
1720

    
1721

    
1722
    /** Analyze and extract events - experiment specific **/
1723
    virtual void AnalyzeAndExtractEvents(Double_t maxEventTimeAllowed) = 0;
1724

    
1725

    
1726
    /** Create output tree structure **/
1727
    virtual void CreateAndFillEvent(FairRecoEventHeader* recoEvent);
1728

    
1729
  private:
1730

    
1731
    /** Get parameter containers **/
1732
    virtual void SetParContainers();
1733

    
1734

    
1735
    /** Intialisation **/
1736
    virtual InitStatus Init();
1737

    
1738

    
1739
    /** Reinitialisation **/
1740
    virtual InitStatus ReInit();
1741

    
1742

    
1743
    /** Finish at the end of each event **/
1744
    virtual void Finish();
1745

    
1746

    
1747
    ClassDef(FairEventBuilderManager,1);
1748

    
1749
};
1750

    
1751
#endif
1752
/********************************************************************************
1753
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
1754
 *                                                                              *
1755
 *              This software is distributed under the terms of the             *
1756
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *
1757
 *                  copied verbatim in the file "LICENSE"                       *
1758
 ********************************************************************************/
1759
// -------------------------------------------------------------------------
1760
// -----                       FairEventHeader header file                      -----
1761
// -----          Created 08/09/04                 D.Bertini           -----
1762
// -------------------------------------------------------------------------
1763

    
1764
#ifndef FAIREVENTHEADER_H
1765
#define FAIREVENTHEADER_H
1766

    
1767
#include "TNamed.h"                     // for TNamed
1768

    
1769
#include "Rtypes.h"                     // for Int_t, Double_t, UInt_t, etc
1770

    
1771
/**
1772
 *  Event Header Class
1773
  **@author D.Bertini <d.bertini@gsi.de>
1774
  **@author M.Al-Turany <m.al-turany@gsi.de>
1775
 */
1776
class FairEventHeader : public TNamed
1777
{
1778

    
1779
  public:
1780

    
1781
    /** Default constructor */
1782
    FairEventHeader();
1783

    
1784
    /** Get the run ID for this run*/
1785
    UInt_t GetRunId() {return fRunId;}
1786

    
1787
    /** Get the MC time for this event*/
1788
    Double_t GetEventTime() {return fEventTime;}
1789

    
1790
    /** Get the MC input file Id for this event*/
1791
    Int_t GetInputFileId() {return fInputFileId;}
1792

    
1793
    /**The entry number in the original MC chain */
1794
    Int_t GetMCEntryNumber() {return fMCEntryNo;}
1795

    
1796
    /** Set the run ID for this run
1797
    * @param runid : unique run id
1798
    */
1799
    void SetRunId(UInt_t runid) {fRunId=runid;}
1800

    
1801
    /** Set the MC time for this event
1802
     * @param time : time in ns
1803
     */
1804
    void SetEventTime(Double_t time) {fEventTime=time;}
1805

    
1806
    /** Set the Signal file Id for this event*/
1807
    void SetInputFileId(Int_t id) {fInputFileId=id;}
1808

    
1809
    /**The entry number in the original MC chain */
1810
    void SetMCEntryNumber(Int_t id) {fMCEntryNo=id;}
1811

    
1812
    /**
1813
     * Destructor
1814
     */
1815
    virtual ~FairEventHeader();
1816
    virtual void Register(Bool_t Persistance = kTRUE);
1817
  protected:
1818

    
1819
    /** Run Id */
1820
    UInt_t fRunId;
1821
    /** Event Time **/
1822
    Double_t  fEventTime;
1823
    /** Input file identifier, the file description is in the File header*/
1824
    Int_t     fInputFileId;
1825
    /**MC entry number from input chain*/
1826
    Int_t     fMCEntryNo;
1827

    
1828

    
1829
    ClassDef(FairEventHeader,3)
1830

    
1831
};
1832
#endif
1833
/********************************************************************************
1834
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
1835
 *                                                                              *
1836
 *              This software is distributed under the terms of the             * 
1837
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *  
1838
 *                  copied verbatim in the file "LICENSE"                       *
1839
 ********************************************************************************/
1840
// -------------------------------------------------------------------------
1841
// -----                         FairFileHeader source file           -----
1842
// -----            Created 20/04/11                 M.Al-Turany        -----
1843
// -------------------------------------------------------------------------
1844

    
1845
#ifndef FAIRFILEHEADER_H
1846
#define FAIRFILEHEADER_H
1847

    
1848
#include "TNamed.h"                     // for TNamed
1849

    
1850
#include "Rtypes.h"                     // for UInt_t, etc
1851
#include "TString.h"                    // for TString
1852

    
1853
class FairFileInfo;
1854
class TFile;
1855
class TList;
1856

    
1857
/**
1858
 *  File Header Class
1859
   **@author M.Al-Turany <m.al-turany@gsi.de>
1860
 */
1861
class FairFileHeader : public TNamed
1862
{
1863

    
1864
  public:
1865

    
1866
    /** Default constructor */
1867
    FairFileHeader();
1868

    
1869
    /**Add a class name of a task*/
1870
    void AddTaskClassName(TString taskname);
1871

    
1872
    /** Set the run ID for this run
1873
       * @param runid : unique run id
1874
       */
1875
    void SetRunId(UInt_t runid) {fRunId=runid;}
1876

    
1877
    /** Get the run ID for this run*/
1878
    UInt_t GetRunId() {return fRunId;}
1879

    
1880
    /** Return the list of tasks class names */
1881
    TList* GetListOfTasks() {return fTaskList;}
1882

    
1883
    void AddInputFile(TFile* f, UInt_t id, UInt_t ChId);
1884

    
1885
    /**
1886
     * Destructor
1887
     */
1888
    virtual ~FairFileHeader();
1889

    
1890

    
1891
    FairFileInfo* GetFileInfo(UInt_t id, UInt_t ChId);
1892

    
1893

    
1894

    
1895

    
1896
  protected:
1897
    /** Run Id */
1898
    UInt_t fRunId;
1899

    
1900
    /**list of TObjStrings presenting the class names of tasks used to produce this file */
1901
    TList* fTaskList;
1902

    
1903
    /**list of TObjStrings presenting the input files used to produce this file*/
1904
    TList* fFileList;
1905

    
1906
  private:
1907
    FairFileHeader(const FairFileHeader&);
1908
    FairFileHeader& operator=(const FairFileHeader&);
1909

    
1910

    
1911
    ClassDef(FairFileHeader,2)
1912

    
1913
};
1914
#endif
1915
/********************************************************************************
1916
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
1917
 *                                                                              *
1918
 *              This software is distributed under the terms of the             * 
1919
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *  
1920
 *                  copied verbatim in the file "LICENSE"                       *
1921
 ********************************************************************************/
1922
//  FairFileInfo.h
1923
//  Created by Mohammad Al-Turany on 6/21/11.
1924
//
1925
#ifndef FAIRFILEINFO_H
1926
#define FAIRFILEINFO_H
1927

    
1928
#include "TNamed.h"                     // for TNamed
1929

    
1930
#include "Rtypes.h"                     // for UInt_t, FairFileInfo::Class, etc
1931
#include "TString.h"                    // for TString
1932

    
1933
class TFile;
1934

    
1935
class FairFileInfo : public TNamed
1936
{
1937
  public:
1938

    
1939
    FairFileInfo();
1940
    FairFileInfo(TFile* file, UInt_t id,  UInt_t ChId);
1941
    virtual  ~FairFileInfo();
1942

    
1943

    
1944
    TString     GetPath()          {return fPath;}
1945
    UInt_t      GetSize()          {return fSize;}
1946
    UInt_t      GetIdentifier()    {return fIdentifier;}
1947
    UInt_t      GetOrderInChain()  {return fInChainId;}
1948

    
1949
    void        Print(Option_t* option="") const;
1950

    
1951
    void        SetPath(TString path) {fPath = path;}
1952
    void        SetSize(UInt_t  size) {fSize =size;}
1953
    void        SetIdentifier(UInt_t  id) {fIdentifier =id;}
1954
    void        SetOrderInChain(UInt_t id) {fInChainId =id;}
1955

    
1956

    
1957

    
1958
  protected:
1959
    /** Full path of file*/
1960
    TString fPath;
1961
    /** size of file in bytes*/
1962
    UInt_t  fSize;
1963
    /** Signal file identifier used*/
1964
    UInt_t  fIdentifier;
1965
    /** file order in the chain*/
1966
    UInt_t  fInChainId;
1967

    
1968
  private:
1969
    FairFileInfo(const FairFileInfo&);
1970
    FairFileInfo& operator=(const FairFileInfo&);
1971

    
1972
    ClassDef(FairFileInfo,1)
1973
};
1974

    
1975
#endif //FAIRFILEINFO_H
1976
/********************************************************************************
1977
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
1978
 *                                                                              *
1979
 *              This software is distributed under the terms of the             * 
1980
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *  
1981
 *                  copied verbatim in the file "LICENSE"                       *
1982
 ********************************************************************************/
1983
#ifndef FAIRHIT_H
1984
#define FAIRHIT_H
1985

    
1986
#include "FairTimeStamp.h"              // for FairTimeStamp
1987

    
1988
#include "Rtypes.h"                     // for Double_t, Int_t, Double32_t, etc
1989
#include "TVector3.h"                   // for TVector3
1990

    
1991
#ifndef __CINT__
1992
#include <boost/serialization/access.hpp>
1993
#include <boost/serialization/base_object.hpp>
1994
#endif //__CINT__
1995

    
1996
/**
1997
 * Abstract base class for reconstructed hits in the FAIR detectors.
1998
  **@author V.Friese <v.friese@gsi.de>
1999
  **@author D.Bertini <d.bertini@gsi.de>
2000
  **@author M.Al-Turany <m.al-turany@gsi.de>
2001
 */
2002
class FairHit : public FairTimeStamp
2003
{
2004

    
2005
  public:
2006

    
2007
    /** Default constructor **/
2008
    FairHit();
2009

    
2010

    
2011
    /** Constructor with hit parameters **/
2012
    FairHit(Int_t detID, TVector3& pos, TVector3& dpos, Int_t index);
2013

    
2014
    /** Destructor **/
2015
    virtual ~FairHit();
2016

    
2017

    
2018
    /** Accessors **/
2019
    Double_t GetDx()            const { return fDx;                     };
2020
    Double_t GetDy()            const { return fDy;                     };
2021
    Double_t GetDz()            const { return fDz;                     };
2022
    Int_t    GetRefIndex()      const { return fRefIndex;               };
2023
    void PositionError(TVector3& dpos) const;
2024
    Int_t    GetDetectorID()    const { return fDetectorID;             };
2025
    Double_t GetX()             const { return fX;                      };
2026
    Double_t GetY()             const { return fY;                      };
2027
    Double_t GetZ()             const { return fZ;                      };
2028
    void Position(TVector3& pos)       const;
2029

    
2030

    
2031

    
2032
    /** Modifiers **/
2033
    void SetDx(Double_t dx) { fDx = dx; }
2034
    void SetDy(Double_t dy) { fDy = dy; }
2035
    void SetDz(Double_t dz) { fDz = dz; }
2036
    void SetDxyz(Double_t dx, Double_t dy, Double_t dz);
2037
    void SetPositionError(const TVector3& dpos);
2038
    void SetRefIndex(Int_t index)   { fRefIndex = index; }
2039
    void SetDetectorID(Int_t detID) { fDetectorID = detID; }
2040
    void SetX(Double_t x) { fX = x; }
2041
    void SetY(Double_t y) { fY = y; }
2042
    void SetZ(Double_t z) { fZ = z; }
2043
    void SetXYZ(Double_t x, Double_t y, Double_t z);
2044
    void SetPosition(const TVector3& pos);
2045

    
2046

    
2047
    /*** Output to screen */
2048
    virtual void Print(const Option_t*) const {;}
2049

    
2050
    template<class Archive>
2051
    void serialize(Archive& ar, const unsigned int)
2052
    {
2053
        ar& boost::serialization::base_object<FairTimeStamp>(*this);
2054
        ar& fDetectorID;
2055
        ar& fRefIndex;
2056
        ar& fX;
2057
        ar& fY;
2058
        ar& fZ;
2059
        ar& fDx;
2060
        ar& fDy;
2061
        ar& fDz;
2062
    }
2063

    
2064
  protected:
2065
#ifndef __CINT__ // for BOOST serialization
2066
    friend class boost::serialization::access;
2067
#endif // for BOOST serialization
2068

    
2069
    Double32_t fDx, fDy, fDz;   ///< Errors of position [cm]
2070
    Int_t      fRefIndex;       ///< Index of FairMCPoint for this hit
2071
    Int_t      fDetectorID;     ///< Detector unique identifier
2072
    Double32_t fX, fY, fZ;      ///< Position of hit [cm]
2073

    
2074
    ClassDef(FairHit,3);
2075
};
2076

    
2077

    
2078
inline void FairHit::PositionError(TVector3& dpos) const
2079
{
2080
  dpos.SetXYZ(fDx, fDy, fDz);
2081
}
2082

    
2083

    
2084
inline void FairHit::SetDxyz(Double_t dx, Double_t dy, Double_t dz)
2085
{
2086
  fDx = dx;
2087
  fDy = dy;
2088
  fDz = dz;
2089
}
2090

    
2091

    
2092
inline void FairHit::SetPositionError(const TVector3& dpos)
2093
{
2094
  fDx = dpos.X();
2095
  fDy = dpos.Y();
2096
  fDz = dpos.Z();
2097
}
2098

    
2099
inline void FairHit::Position(TVector3& pos) const
2100
{
2101
  pos.SetXYZ(fX, fY, fZ);
2102
}
2103

    
2104

    
2105
inline void FairHit::SetXYZ(Double_t x, Double_t y, Double_t z)
2106
{
2107
  fX = x;
2108
  fY = y;
2109
  fZ = z;
2110
}
2111

    
2112

    
2113
inline void FairHit::SetPosition(const TVector3& pos)
2114
{
2115
  fX = pos.X();
2116
  fY = pos.Y();
2117
  fZ = pos.Z();
2118
}
2119

    
2120
#endif
2121
/********************************************************************************
2122
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
2123
 *                                                                              *
2124
 *              This software is distributed under the terms of the             * 
2125
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *  
2126
 *                  copied verbatim in the file "LICENSE"                       *
2127
 ********************************************************************************/
2128
/*
2129
 * FairLink.h
2130
 *
2131
 *  Created on: Dec 23, 2009
2132
 *      Author: stockman
2133
 */
2134

    
2135
#ifndef FAIRLINK_H_
2136
#define FAIRLINK_H_
2137

    
2138
#include "TObject.h"                    // for TObject
2139

    
2140
#include "Riosfwd.h"                    // for ostream
2141
#include "Rtypes.h"                     // for Int_t, Float_t, etc
2142
#include "TString.h"                    // for TString
2143

    
2144
#include <iostream>                     // for ostream, cout
2145

    
2146
#ifndef __CINT__
2147
#include <boost/serialization/access.hpp>
2148
#include <boost/serialization/base_object.hpp>
2149
#endif //__CINT__
2150

    
2151
class FairLink : public TObject
2152
{
2153
  public:
2154
    FairLink();
2155
    FairLink(Int_t type, Int_t index, Float_t weight = 1.);
2156
    FairLink(TString branchName, Int_t index, Float_t weight = 1.);
2157
    FairLink(Int_t file, Int_t entry, Int_t type, Int_t index, Float_t weight = 1.);
2158
    FairLink(Int_t file, Int_t entry, TString branchName, Int_t index, Float_t weight = 1.);
2159
    virtual ~FairLink();
2160

    
2161
    void SetLink(Int_t file, Int_t entry, Int_t type, Int_t index, Float_t weight = 1.) {
2162
      fFile = file;
2163
      fEntry = entry;
2164
      fType = type;
2165
      fIndex = index;
2166
      fWeight = weight;
2167
    };
2168
    void SetLink(Int_t type, Int_t index, Float_t weight = 1.) {
2169
      fFile = -1;
2170
      fEntry = -1;
2171
      fType = type;
2172
      fIndex = index;
2173
      fWeight = weight;
2174
    };
2175
    Int_t GetFile() const {return fFile;}
2176
    Int_t GetEntry() const {return fEntry;}
2177
    Int_t GetType() const {return fType;}
2178
    Int_t GetIndex() const {return fIndex;}
2179
    Float_t GetWeight() const {return fWeight;}
2180

    
2181
    void SetWeight(Float_t weight) {fWeight = weight;}
2182
    void AddWeight(Float_t weight) {fWeight += weight;}
2183

    
2184
    virtual void PrintLinkInfo(std::ostream& out = std::cout) const;
2185

    
2186
    virtual bool operator==(const FairLink& link) const {
2187
      if ((fFile == link.GetFile() || link.GetFile() == -1) && (fEntry == link.GetEntry() || link.GetEntry() == -1) && fType == link.GetType() && fIndex == link.GetIndex()) {
2188
        return true;
2189
      } else {
2190
        return false;
2191
      }
2192
    }
2193

    
2194
    virtual bool operator<(const FairLink& link) const {
2195
	if (fFile != -1 && link.GetFile() != -1){
2196
		if (fFile < link.GetFile()) 		return true;
2197
		else if (link.GetFile() < fFile) 	return false;
2198
	}
2199
	if (fEntry != -1 && link.GetEntry() != -1){
2200
		if(fEntry < link.GetEntry())		return true;
2201
		else if (link.GetEntry() < fEntry)	return false;
2202
	}
2203
	if (fType < link.GetType())				return true;
2204
	else if (link.GetType() < fType)		return false;
2205
	if (fIndex < link.GetIndex())			return true;
2206
	else if (link.GetIndex() < fIndex)		return false;
2207

    
2208
	return false;
2209
//      if (fFile != -1 && fFile < link.GetFile()) {
2210
//        return true;
2211
//      } else if ((fFile == link.GetFile() || link.GetFile() == -1) && fEntry < link.GetEntry()) {
2212
//        return true;
2213
//      } else if ((fFile == link.GetFile() || link.GetFile() == -1)  && (fEntry == link.GetEntry() || link.GetEntry() == -1) && fType < link.GetType()) {
2214
//        return true;
2215
//      } else if ((fFile == link.GetFile() || link.GetFile() == -1)  && (fEntry == link.GetEntry() || link.GetEntry() == -1) && fType == link.GetType() && fIndex < link.GetIndex()) {
2216
//        return true;
2217
//      } else {
2218
//        return false;
2219
//      }
2220
    }
2221

    
2222
    friend std::ostream& operator<< (std::ostream& out, const FairLink& link) {
2223
      link.PrintLinkInfo(out);
2224
      return out;
2225
    }
2226

    
2227
    ClassDef(FairLink, 3);
2228

    
2229
    template<class Archive>
2230
        void serialize(Archive& ar, const unsigned int)
2231
        {
2232
            ar& fFile;
2233
            ar& fEntry;
2234
            ar& fType;
2235
            ar& fIndex;
2236
            ar& fWeight;
2237
        }
2238

    
2239

    
2240
  private:
2241
    Int_t fFile;
2242
    Int_t fEntry;
2243
    Int_t fType;
2244
    Int_t fIndex;
2245
    Float_t fWeight;
2246

    
2247
};
2248

    
2249
#endif /* FAIRLINK_H_ */
2250
/********************************************************************************
2251
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
2252
 *                                                                              *
2253
 *              This software is distributed under the terms of the             * 
2254
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *  
2255
 *                  copied verbatim in the file "LICENSE"                       *
2256
 ********************************************************************************/
2257
/** FairMCEventHeader.h
2258
 *@author V.Friese <v.friese@gsi.de>
2259
 ** Data class (level MC) containing information about the input event.
2260
 ** 15.05.2008 change the event time to ns (M. Al-Turany)
2261
 **/
2262

    
2263

    
2264
#ifndef FAIRMCEVENTHEADER_H
2265
#define FAIRMCEVENTHEADER_H 1
2266

    
2267
#include "TNamed.h"                     // for TNamed
2268

    
2269
#include "Rtypes.h"                     // for Double_t, UInt_t, etc
2270
#include "TVector3.h"                   // for TVector3
2271

    
2272
class FairMCEventHeader : public TNamed
2273
{
2274

    
2275
  public:
2276

    
2277
    /** Default constructor **/
2278
    FairMCEventHeader();
2279

    
2280

    
2281
    /** Constructor with all members
2282
     **
2283
     *@param iEvent   event identifier
2284
     *@param x,y,z    vertex oordinates [cm]
2285
     *@param t        event time [ns]
2286
     *@param b        impact parameter [fm] (if relevant)
2287
     *@param nPrim    number of input tracks
2288
     **/
2289
    FairMCEventHeader(Int_t iEvent, Double_t x, Double_t y, Double_t z,
2290
                      Double_t t, Double_t b, Int_t nPrim);
2291

    
2292

    
2293
    /** Standard constructor with run identifier **/
2294
    FairMCEventHeader(UInt_t runId);
2295

    
2296

    
2297
    /** Destructor **/
2298
    virtual ~FairMCEventHeader();
2299

    
2300

    
2301
    /** Accessors **/
2302
    UInt_t GetRunID()   const { return fRunId; }     /// run identifier
2303
    UInt_t GetEventID() const { return fEventId; }   /// event identifier
2304
    Double_t GetX()     const { return fX; }         /// vertex x [cm]
2305
    Double_t GetY()     const { return fY; }         /// vertex y [cm]
2306
    Double_t GetZ()     const { return fZ; }         /// vertex z [cm]
2307
    Double_t GetT()     const { return fT; }         /// event time [ns]
2308
    Double_t GetB()     const { return fB; }         /// impact parameter [fm]
2309
    Int_t GetNPrim()    const { return fNPrim; }     /// number of input tracks
2310
    Bool_t IsSet()      const { return fIsSet; }     /// Flag
2311
    Double_t GetRotX()     const { return fRotX; } /// rot. around x-axis [rad]
2312
    Double_t GetRotY()     const { return fRotY; } /// rot. around y-axis [rad]
2313
    Double_t GetRotZ()     const { return fRotZ; } /// rot. around z-axis [rad]
2314

    
2315
    void GetVertex(TVector3& vertex) { vertex.SetXYZ(fX, fY, fZ); }
2316

    
2317

    
2318
    /** Modifiers **/
2319
    void SetEventID(UInt_t eventId) { fEventId = eventId; }
2320
    void SetRunID(UInt_t runId) { fRunId = runId; }
2321
    void SetTime(Double_t t)       { fT = t; }
2322
    void SetB(Double_t b)          { fB = b; }
2323
    void SetNPrim(Int_t nPrim)     { fNPrim = nPrim; }
2324
    void MarkSet(Bool_t isSet)     { fIsSet = isSet; }
2325
    void SetVertex(Double_t x, Double_t y, Double_t z);
2326
    void SetVertex(const TVector3& vertex);
2327
    void SetRotX(Double_t rotx) { fRotX = rotx; }
2328
    void SetRotY(Double_t roty) { fRotY = roty; }
2329
    void SetRotZ(Double_t rotz) { fRotZ = rotz; }
2330

    
2331
    /** Reset all members **/
2332
    void Reset();
2333

    
2334
    /** Register the class as data branch to the output */
2335
    virtual void Register();
2336

    
2337
  protected:
2338

    
2339

    
2340
    UInt_t     fRunId;       ///  Run identifier
2341
    UInt_t     fEventId;     ///  Event identifier
2342
    Double32_t fX;           ///  Primary vertex x [cm]
2343
    Double32_t fY;           ///  Primary vertex y [cm]
2344
    Double32_t fZ;           ///  Primary vertex z [cm]
2345
    Double32_t fT;           ///  Event time [s]
2346
    Double32_t fB;           ///  Impact parameter [fm] (if relevant)
2347
    Int_t      fNPrim;       ///  Number of input tracks
2348
    Bool_t     fIsSet;       ///  Flag whether variables are filled
2349
    Double32_t fRotX;        ///  Rotation around x-axis (beam tilt) [rad]
2350
    Double32_t fRotY;        ///  Rotation around y-axis (beam tilt) [rad]
2351
    Double32_t fRotZ;        ///  Rotation around z-axis (event plane) [rad]
2352

    
2353

    
2354
    ClassDef(FairMCEventHeader,2);
2355

    
2356
};
2357

    
2358

    
2359
inline void FairMCEventHeader::SetVertex(Double_t x, Double_t y,
2360
    Double_t z)
2361
{
2362
  fX = x;
2363
  fY = y;
2364
  fZ = z;
2365
}
2366

    
2367

    
2368
inline void FairMCEventHeader::SetVertex(const TVector3& vertex)
2369
{
2370
  fX = vertex.X();
2371
  fY = vertex.Y();
2372
  fZ = vertex.Z();
2373
}
2374

    
2375

    
2376
#endif
2377
/********************************************************************************
2378
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
2379
 *                                                                              *
2380
 *              This software is distributed under the terms of the             * 
2381
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *  
2382
 *                  copied verbatim in the file "LICENSE"                       *
2383
 ********************************************************************************/
2384
/**  FairMCPoint.h
2385
 * This is the base class for all MC Points generated by the transport of
2386
 * tracks through active detectors.
2387
 **/
2388

    
2389

    
2390

    
2391
#ifndef FAIRMCPOINT_H
2392
#define FAIRMCPOINT_H
2393

    
2394
#include "FairMultiLinkedData_Interface.h"        // for FairMultiLinkedData
2395

    
2396
#include "Rtypes.h"                     // for Double_t, Double32_t, Int_t, etc
2397
#include "TVector3.h"                   // for TVector3
2398

    
2399

    
2400
#ifndef __CINT__
2401
#include <boost/serialization/access.hpp>
2402
#include <boost/serialization/base_object.hpp>
2403
#endif //__CINT__
2404

    
2405
class FairMCPoint : public FairMultiLinkedData_Interface
2406
{
2407

    
2408
  public:
2409

    
2410
    /** Default constructor **/
2411
    FairMCPoint();
2412

    
2413

    
2414
    /** Constructor with arguments
2415
     *@param trackID  Index of MCTrack
2416
     *@param detID    Detector ID
2417
     *@param pos      Point coordinates [cm]
2418
     *@param mom      Momentum of track at MCPoint [GeV]
2419
     *@param tof      Time since event start [ns]
2420
     *@param length   Track length since creation [cm]
2421
     *@param eLoss    Energy deposit [GeV]
2422
     *@param EventId  MC event id
2423
     **/
2424
    FairMCPoint(Int_t trackID, Int_t detID, TVector3 pos, TVector3 mom,
2425
                Double_t tof, Double_t length, Double_t eLoss, UInt_t EventId=0);
2426
    
2427
    /** Destructor **/
2428
    virtual ~FairMCPoint();
2429

    
2430

    
2431
    /** Accessors */
2432
    UInt_t   GetEventID()    const { return fEventId; }        /// event identifier
2433
    Int_t    GetTrackID()    const { return fTrackID; }
2434
    Double_t GetPx()         const { return fPx; }
2435
    Double_t GetPy()         const { return fPy; }
2436
    Double_t GetPz()         const { return fPz; }
2437
    Double_t GetTime()       const { return fTime; }
2438
    Double_t GetLength()     const { return fLength; }
2439
    Double_t GetEnergyLoss() const { return fELoss; }
2440
    void Momentum(TVector3& mom) const { mom.SetXYZ(fPx, fPy, fPz); }
2441
    Int_t    GetDetectorID()   const { return fDetectorID;             };
2442
    Double_t GetX()             const { return fX;                      };
2443
    Double_t GetY()             const { return fY;                      };
2444
    Double_t GetZ()             const { return fZ;                      };
2445
    void Position(TVector3& pos) const { pos.SetXYZ(fX, fY, fZ); }
2446

    
2447

    
2448

    
2449

    
2450
    /** Modifiers **/
2451
    void SetEventID(UInt_t eventId) { fEventId = eventId; }
2452
    virtual void SetTrackID(Int_t id) { fTrackID = id;}
2453
    void SetTime(Double_t time)        { fTime = time; }
2454
    void SetLength(Double_t length)    { fLength = length; }
2455
    void SetEnergyLoss(Double_t eLoss) { fELoss = eLoss; }
2456
    void SetMomentum(const TVector3& mom);
2457
    void SetDetectorID(Int_t detID) { fDetectorID = detID; }
2458
    void SetX(Double_t x) { fX = x; }
2459
    void SetY(Double_t y) { fY = y; }
2460
    void SetZ(Double_t z) { fZ = z; }
2461
    void SetXYZ(Double_t x, Double_t y, Double_t z);
2462
    void SetPosition(const TVector3& pos);
2463

    
2464

    
2465
    /** Output to screen **/
2466
    virtual void Print(const Option_t* opt = 0) const;
2467

    
2468

    
2469
    
2470
    template<class Archive>
2471
    void serialize(Archive & ar, const unsigned int) 
2472
    {
2473
        //ar & boost::serialization::base_object<FairMultiLinkedData>(*this);
2474
        ar & fTrackID;
2475
        ar & fEventId;
2476
        ar & fDetectorID; 
2477
        ar & fX;
2478
        ar & fY;
2479
        ar & fZ;
2480
        ar & fPx;
2481
        ar & fPy;
2482
        ar & fPz; 
2483
        ar & fTime; 
2484
        ar & fLength; 
2485
        ar & fELoss; 
2486
    }
2487

    
2488
  protected:
2489

    
2490
    #ifndef __CINT__ // for BOOST serialization
2491
    friend class boost::serialization::access;
2492

    
2493
    #endif // for BOOST serialization
2494
    
2495
    Int_t fTrackID;               ///< Track index
2496
    UInt_t fEventId;              ///< MC Event id
2497
    Double32_t fPx, fPy, fPz;     ///< Momentum components [GeV]
2498
    Double32_t fTime;             ///< Time since event start [ns]
2499
    Double32_t fLength;           ///< Track length since creation [cm]
2500
    Double32_t fELoss;            ///< Energy loss at this point [GeV]
2501
    Int_t      fDetectorID;       ///< Detector unique identifier
2502
    Double32_t fX, fY, fZ;        ///< Position of hit [cm]
2503

    
2504

    
2505
    ClassDef(FairMCPoint,5)
2506

    
2507
};
2508

    
2509

    
2510
inline void FairMCPoint::SetMomentum(const TVector3& mom)
2511
{
2512
  fPx = mom.Px();
2513
  fPy = mom.Py();
2514
  fPz = mom.Pz();
2515
}
2516

    
2517

    
2518
inline void FairMCPoint::SetXYZ(Double_t x, Double_t y, Double_t z)
2519
{
2520
  fX = x;
2521
  fY = y;
2522
  fZ = z;
2523
}
2524

    
2525

    
2526
inline void FairMCPoint::SetPosition(const TVector3& pos)
2527
{
2528
  fX = pos.X();
2529
  fY = pos.Y();
2530
  fZ = pos.Z();
2531
}
2532

    
2533

    
2534

    
2535
#endif
2536
/********************************************************************************
2537
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
2538
 *                                                                              *
2539
 *              This software is distributed under the terms of the             * 
2540
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *  
2541
 *                  copied verbatim in the file "LICENSE"                       *
2542
 ********************************************************************************/
2543
// -------------------------------------------------------------------------
2544
// -----                       FairMesh header file                    -----
2545
// -----          original author                  D.Bertini           -----
2546
// -----          adapted april 2010               O.Hartmann          -----
2547
// -------------------------------------------------------------------------
2548

    
2549
#ifndef FAIRMESH_H
2550
#define FAIRMESH_H
2551

    
2552
#include "TObject.h"                    // for TObject
2553

    
2554
#include "Rtypes.h"                     // for Double_t, Int_t, etc
2555
#include "TH2.h"                        // for TH2D
2556
#include "TString.h"                    // for TString
2557

    
2558
/**
2559
 * Abstract base class for Mesh Objects.
2560
  **@author D.Bertini <d.bertini@gsi.de>
2561
 */
2562
class FairMesh : public TObject
2563
{
2564

    
2565
  public:
2566

    
2567
    /** Default constructor **/
2568
    FairMesh();
2569
    FairMesh(const char*);
2570

    
2571

    
2572
    /** Destructor **/
2573
    virtual ~FairMesh();
2574

    
2575

    
2576
    /** Accessors **/
2577
    Double_t GetXmin()  const { return fXmin;  };
2578
    Double_t GetYmin()  const { return fYmin;  };
2579
    Double_t GetZmin()  const { return fZmin;  };
2580

    
2581
    Double_t GetXmax()  const { return fXmax;  };
2582
    Double_t GetYmax()  const { return fYmax;  };
2583
    Double_t GetZmax()  const { return fZmax;  };
2584

    
2585

    
2586
    /** Modifiers **/
2587
    void SetX(Double_t xmin,Double_t xmax, Int_t nbin ) {
2588
      fXmin = xmin;
2589
      fXmax = xmax;
2590
      NXbin = nbin;
2591
    }
2592
    void SetY(Double_t ymin,Double_t ymax, Int_t nbin ) {
2593
      fYmin = ymin;
2594
      fYmax = ymax;
2595
      NYbin = nbin;
2596
    }
2597
    void SetZ(Double_t zmin,Double_t zmax, Int_t nbin ) {
2598
      fZmin = zmin;
2599
      fZmax = zmax;
2600
      NZbin = nbin;
2601
    }
2602

    
2603
    TH2D* GetMeshTid() { return fMeshTid; }
2604
    TH2D* GetMeshFlu() { return fMeshFlu; }
2605
    TH2D* GetMeshSEU() { return fMeshSEU; }
2606
    /*** Output to screen */
2607
// virtual void Print(const Option_t* opt = 0) const {;}
2608

    
2609
    Double_t GetDiag() { return fDiag; }
2610
    Double_t GetBinVolume() { return fBinVolume; }
2611

    
2612
    void fillTID(Double_t x , Double_t y , Double_t we ) {
2613
      fMeshTid->Fill(x,y,we);
2614
    }
2615
    void fillFluence(Double_t x , Double_t y , Double_t we ) {
2616
      fMeshFlu->Fill(x,y,we);
2617

    
2618
    }
2619
    void fillSEU(Double_t x , Double_t y , Double_t we ) {
2620
      fMeshSEU->Fill(x,y,we);
2621

    
2622
    }
2623
    void Scale(Double_t fac ) {
2624
      fMeshTid->Scale(fac);
2625
      fMeshFlu->Scale(fac);
2626
      fMeshSEU->Scale(fac);
2627
    }
2628

    
2629
    void calculate();
2630

    
2631

    
2632
    void print();
2633
  protected:
2634

    
2635
    Double_t  fXmin, fYmin, fZmin;
2636
    Double_t  fXmax, fYmax, fZmax;
2637
    Int_t     NXbin, NYbin, NZbin;
2638
    Double_t fBinVolume;
2639
    Double_t fDiag;
2640
    TH2D* fMeshTid; // !mesh
2641
    TH2D* fMeshFlu; // !mesh
2642
    TH2D* fMeshSEU; // !mesh
2643
    TString fhname; // !mesh
2644

    
2645
  private:
2646
    FairMesh(const FairMesh&);
2647
    FairMesh& operator=(const FairMesh&);
2648

    
2649
    ClassDef(FairMesh,1);
2650

    
2651
};
2652

    
2653
#endif
2654
/********************************************************************************
2655
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
2656
 *                                                                              *
2657
 *              This software is distributed under the terms of the             * 
2658
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *  
2659
 *                  copied verbatim in the file "LICENSE"                       *
2660
 ********************************************************************************/
2661
/**
2662
 * FairMultiLinkedData.h
2663
 *
2664
 * \date Dec 7, 2009
2665
 * \author T.Stockmanns <t.stockmanns@fz-juelich.de>
2666
 */
2667

    
2668
#ifndef FAIRMULTILINKEDDATA_H_
2669
#define FAIRMULTILINKEDDATA_H_
2670

    
2671
#include "TObject.h"                    // for TObject
2672

    
2673
#include "FairLink.h"                   // for FairLink
2674

    
2675
#include "Riosfwd.h"                    // for ostream
2676
#include "Rtypes.h"                     // for Int_t, Bool_t, kFALSE, etc
2677
#include "TString.h"                    // for TString
2678

    
2679
#include <iostream>                     // for operator<<, ostream, cout
2680
#include <set>                          // for set
2681
#include <vector>                       // for vector
2682

    
2683
class FairMultiLinkedData : public  TObject
2684
{
2685
  public:
2686
    FairMultiLinkedData();///< Default constructor
2687
    FairMultiLinkedData(std::set<FairLink> links, Bool_t persistanceCheck = kTRUE);///< Constructor
2688
    FairMultiLinkedData(TString dataType, std::vector<Int_t> links, Int_t fileId = -1, Int_t evtId = -1,Bool_t persistanceCheck = kTRUE, Bool_t bypass = kFALSE, Float_t mult = 1.0);///< Constructor
2689
    FairMultiLinkedData(Int_t dataType, std::vector<Int_t> links, Int_t fileId = -1, Int_t evtId = -1, Bool_t persistanceCheck = kTRUE, Bool_t bypass = kFALSE, Float_t mult = 1.0);///< Constructor
2690

    
2691
    virtual ~FairMultiLinkedData() {};
2692

    
2693
    virtual std::set<FairLink>    GetLinks() const {    return fLinks;}           ///< returns stored links as FairLinks
2694
    virtual FairLink		GetEntryNr() const { return fEntryNr;}				///< gives back the entryNr
2695
    virtual Int_t           GetNLinks() const { return fLinks.size(); }       ///< returns the number of stored links
2696
    virtual FairLink        GetLink(Int_t pos) const;                 ///< returns the FairLink at the given position
2697
    virtual FairMultiLinkedData   GetLinksWithType(Int_t type) const;             ///< Gives you a list of links which contain the given type
2698
    virtual std::vector<FairLink> GetSortedMCTracks();				///< Gives you a list of all FairLinks pointing to a "MCTrack" sorted by their weight
2699
    TObject*         GetData(FairLink& myLink);                  ///< Get the TObject the Link is pointing to
2700
    virtual Int_t GetDefaultType() { return fDefaultType;}
2701
    Bool_t              GetPersistanceCheck() {return fPersistanceCheck;}     ///< Returns the value of PersistanceCheck
2702
    Int_t             GetVerbose() {return fVerbose;}             ///< Returns the verbosity level
2703
    virtual void SetDefaultType(Int_t type) {  fDefaultType = type;}
2704
    virtual void SetPersistanceCheck(Bool_t check) {fPersistanceCheck = check;}       ///< Controls if a persistance check of a link is done or not
2705
    virtual void SetVerbose(Int_t level) {fVerbose = level;}                ///< Sets the verbosity level
2706
    virtual void SetInsertHistory(Bool_t val){ fInsertHistory = val;}		///< Toggles if history of a link is inserted or not
2707

    
2708
    virtual void SetEntryNr(FairLink entry){ fEntryNr = entry;}
2709
    virtual void SetLinks(FairMultiLinkedData links, Float_t mult = 1.0);           ///< Sets the links as vector of FairLink
2710
    virtual void SetLink(FairLink link, Bool_t bypass = kFALSE, Float_t mult = 1.0);      ///< Sets the Links with a single FairLink
2711

    
2712
    virtual void AddLinks(FairMultiLinkedData links, Float_t mult = 1.0);           ///< Adds a List of FairLinks (FairMultiLinkedData) to fLinks
2713
    virtual void AddLink(FairLink link, Bool_t bypass = kFALSE, Float_t mult = 1.0);      ///< Adds a FairLink link at the end of fLinks. If multi is kTRUE a link is allowed more than once otherwise it is stored only once
2714

    
2715
    virtual void InsertLink(FairLink link);                         ///< Inserts a link into the list of links without persistance checking
2716
    virtual void InsertHistory(FairLink link);                      ///< Adds the FairLinks of the inserted link to the set of links of this object
2717

    
2718

    
2719
    virtual void AddAllWeights(Double_t weight);                        ///< Adds weight to all Links
2720
    virtual void SetAllWeights(Double_t weight);                        ///< Sets a common weight for Links
2721
    virtual void MultiplyAllWeights(Double_t weight);                   ///<Multiplies all Links with weight
2722

    
2723

    
2724
    virtual Bool_t IsLinkInList(FairLink link)    {return IsLinkInList(link.GetType(), link.GetIndex());}   ///< Test if a given link is in fLinks
2725
    virtual Bool_t IsLinkInList(Int_t type, Int_t index);                             ///< Same as IsLinkInList(FairLink) just with type and index given separately
2726
    virtual Int_t LinkPosInList(FairLink link)  {return LinkPosInList(link.GetType(), link.GetIndex());}    ///< returns position of link in fLinks. If it is not in the list -1 is returned
2727
    virtual Int_t LinkPosInList(Int_t type, Int_t index);                             ///< Same as LinkPosInList(FairLink)
2728

    
2729
    virtual void DeleteLink(FairLink link)    {DeleteLink(link.GetType(), link.GetIndex());}          ///< Deletes a link ouf of fLinks
2730
    virtual void DeleteLink(Int_t type, Int_t index);                               ///< Deletes a link ouf of fLinks
2731

    
2732
    virtual void Reset() {ResetLinks();}
2733
    virtual void ResetLinks() {fLinks.clear();}                                    ///< Clears fLinks
2734

    
2735

    
2736
    std::ostream& PrintLinkInfo(std::ostream& out = std::cout) const
2737
    {
2738
      out << GetEntryNr() << " -> [";
2739
      for (Int_t i = 0; i < GetNLinks(); i++) {
2740
        GetLink(i).PrintLinkInfo(out);
2741
        out << " ";
2742
      }
2743
      out << "]";
2744
      return out;
2745
    }                                                     ///< Output
2746

    
2747
    friend std::ostream& operator<< (std::ostream& out, const FairMultiLinkedData& data) {
2748
      data.PrintLinkInfo(out);
2749
      return out;
2750
    }                                                     ///< Output
2751

    
2752
  protected:
2753
    std::set<FairLink> fLinks;
2754
    FairLink fEntryNr;
2755
    Bool_t fPersistanceCheck; //!
2756
    Bool_t fInsertHistory; //!
2757
    Int_t fVerbose; //!
2758

    
2759
    virtual void SimpleAddLinks(Int_t fileId, Int_t evtId, Int_t dataType, std::vector<Int_t> links, Bool_t, Float_t) {
2760
      for (UInt_t i = 0; i < links.size(); i++) {
2761
        fLinks.insert(FairLink(fileId, evtId, dataType, links[i]));
2762
      }
2763
    }
2764
    Int_t fDefaultType;
2765

    
2766

    
2767
    ClassDef(FairMultiLinkedData, 4);
2768
};
2769

    
2770
/**\fn virtual void FairMultiLinkedData::SetLinks(Int_t type, std::vector<Int_t> links)
2771
 * \param type as Int_t gives one type of source data for all indices
2772
 * \param links as vector<Int_t> gives the vector of indices at which position in the TClonesArray the source data is stored
2773
 */
2774

    
2775
/**\fn virtual void FairMultiLinkedData::SetLinks(std::vector<Int_t> type, std::vector<Int_t> links)
2776
 * \param type as vector<Int_t> gives the type of source data (TClonesArray)
2777
 * \param links as vector<Int_t> gives the vector of indices at which position in the TClonesArray the source data is stored
2778
 */
2779

    
2780

    
2781
#endif /* FAIRMULTILinkedData_H_ */
2782
/**
2783
 * FairMultiLinkedData_Interface.h
2784
 *
2785
 * \date Dec 7, 2009
2786
 * \author T.Stockmanns <t.stockmanns@fz-juelich.de>
2787
 */
2788

    
2789
#ifndef FairMultiLinkedData_Interface_H_
2790
#define FairMultiLinkedData_Interface_H_
2791

    
2792
#include "TObject.h"                    // for TObject
2793

    
2794
#include "FairLink.h"                   // for FairLink
2795
#include "FairMultiLinkedData.h"
2796
#include "FairRootManager.h"
2797

    
2798
#include "Riosfwd.h"                    // for ostream
2799
#include "Rtypes.h"                     // for Int_t, Bool_t, kFALSE, etc
2800
#include "TString.h"                    // for TString
2801
#include "TRef.h"
2802

    
2803
#include <iostream>                     // for operator<<, ostream, cout
2804
#include <set>                          // for set
2805
#include <vector>                       // for vector
2806

    
2807

    
2808
class FairMultiLinkedData_Interface : public  TObject
2809
{
2810
  public:
2811
    FairMultiLinkedData_Interface();///< Default constructor
2812
    FairMultiLinkedData_Interface(FairMultiLinkedData& links, Bool_t persistanceCheck = kTRUE);///< Constructor
2813
    FairMultiLinkedData_Interface(TString dataType, std::vector<Int_t> links, Int_t fileId = -1, Int_t evtId = -1,Bool_t persistanceCheck = kTRUE, Bool_t bypass = kFALSE, Float_t mult = 1.0);///< Constructor
2814
    FairMultiLinkedData_Interface(Int_t dataType, std::vector<Int_t> links, Int_t fileId = -1, Int_t evtId = -1, Bool_t persistanceCheck = kTRUE, Bool_t bypass = kFALSE, Float_t mult = 1.0);///< Constructor
2815
    FairMultiLinkedData_Interface(const FairMultiLinkedData_Interface& toCopy);
2816

    
2817
    virtual ~FairMultiLinkedData_Interface() {
2818
    	delete(fLink);
2819
    };
2820

    
2821
    FairMultiLinkedData_Interface& operator=(const FairMultiLinkedData_Interface& rhs);
2822

    
2823
    virtual std::set<FairLink>  GetLinks() const;           		///< returns stored links as FairLinks
2824
    virtual Int_t           	GetNLinks() const;                	///< returns the number of stored links
2825
    virtual FairLink        	GetLink(Int_t pos) const;         	///< returns the FairLink at the given position
2826
    virtual FairMultiLinkedData GetLinksWithType(Int_t type) const; ///< returns all FairLinks with the corresponding type
2827
    virtual FairLink            GetEntryNr() const;
2828
    virtual FairMultiLinkedData* 		GetPointerToLinks() const {	return fLink;}
2829

    
2830
    virtual std::vector<FairLink> GetSortedMCTracks();
2831

    
2832
    virtual void SetLinks(FairMultiLinkedData links);           ///< Sets the links as vector of FairLink
2833
    virtual void SetLink(FairLink link);      					///< Sets the Links with a single FairLink
2834
    virtual void SetInsertHistory(Bool_t val);
2835
    virtual void SetEntryNr(FairLink val);
2836
    virtual void SetPointerToLinks(FairMultiLinkedData* links) {fLink = links;}
2837

    
2838
    virtual void AddLinks(FairMultiLinkedData links, Float_t mult = 1.0);		///< Adds a List of FairLinks (FairMultiLinkedData_Interface) to fLinks
2839
    virtual void AddLink(FairLink link);      								///< Adds a FairLink link at the end of fLinks. If multi is kTRUE a link is allowed more than once otherwise
2840
    virtual void AddInterfaceData(FairMultiLinkedData_Interface* data);
2841

    
2842

    
2843

    
2844
    virtual void ResetLinks();
2845

    
2846

    
2847
    std::ostream& PrintLinkInfo(std::ostream& out = std::cout) const {
2848

    
2849
		if (GetPointerToLinks() != 0)
2850
			GetPointerToLinks()->PrintLinkInfo(out);
2851
		return out;
2852
    }                                                     ///< Output
2853

    
2854
    friend std::ostream& operator<< (std::ostream& out, FairMultiLinkedData_Interface& data) {
2855
      data.PrintLinkInfo(out);
2856
      return out;
2857
    }                                                     ///< Output
2858

    
2859
  protected:
2860

    
2861
    Int_t fVerbose; //!
2862
    Bool_t fInsertHistory; //!
2863
    FairMultiLinkedData* fLink;
2864

    
2865
    FairMultiLinkedData* CreateFairMultiLinkedData();
2866

    
2867
    ClassDef(FairMultiLinkedData_Interface, 5);
2868
};
2869

    
2870
/**\fn virtual void FairMultiLinkedData_Interface::SetLinks(Int_t type, std::vector<Int_t> links)
2871
 * \param type as Int_t gives one type of source data for all indices
2872
 * \param links as vector<Int_t> gives the vector of indices at which position in the TClonesArray the source data is stored
2873
 */
2874

    
2875
/**\fn virtual void FairMultiLinkedData_Interface::SetLinks(std::vector<Int_t> type, std::vector<Int_t> links)
2876
 * \param type as vector<Int_t> gives the type of source data (TClonesArray)
2877
 * \param links as vector<Int_t> gives the vector of indices at which position in the TClonesArray the source data is stored
2878
 */
2879

    
2880

    
2881
#endif /* FairMultiLinkedData_Interface_H_ */
2882
/********************************************************************************
2883
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
2884
 *                                                                              *
2885
 *              This software is distributed under the terms of the             * 
2886
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *  
2887
 *                  copied verbatim in the file "LICENSE"                       *
2888
 ********************************************************************************/
2889
// -------------------------------------------------------------------------
2890
// -----                      FairRadLenPoint header file               -----
2891
// -----                  Created 14/01/08  by M. Al-Turany            -----
2892
// -------------------------------------------------------------------------
2893

    
2894

    
2895
/**  FairRadLenPoint.h
2896
 *@author M. Al-Turany
2897
 *
2898
 */
2899

    
2900
#ifndef FAIRRADLENPOINT_H
2901
#define FAIRRADLENPOINT_H
2902

    
2903
#include "FairMCPoint.h"                // for FairMCPoint
2904

    
2905
#include "Rtypes.h"                     // for Double_t, Float_t, etc
2906
#include "TVector3.h"                   // for TVector3
2907

    
2908
class FairRadLenPoint : public FairMCPoint
2909
{
2910

    
2911
  public:
2912

    
2913
    /** Default constructor **/
2914
    FairRadLenPoint();
2915

    
2916
    FairRadLenPoint(Int_t trackID, Int_t detID, TVector3 pos, TVector3 mom,
2917
                    Double_t tof, Double_t length, Double_t eLoss, TVector3 posOut, TVector3 momOut,
2918
                    Float_t  fA, Float_t fZ,  Float_t  fDensity, Float_t  fRadLen);
2919

    
2920

    
2921
    /** Destructor **/
2922
    virtual ~FairRadLenPoint();
2923

    
2924

    
2925
    /** Accessors **/
2926
    Float_t GetA()              { return fA; }
2927
    Float_t GetZm()              { return fZmat; }
2928
    Float_t GetRadLength()      { return fRadLen;}
2929
    Float_t GetDensity()        { return fDensity ; }
2930

    
2931

    
2932
    /** Modifiers **/
2933
    void SetA(Double_t A)              { fA = A; }
2934
    void SetZm(Double_t Z)              { fZmat = Z; }
2935
    void SetRadLength(Double_t length) { fRadLen = length;}
2936
    void SetDensity (Double_t Density) { fDensity = Density; }
2937

    
2938
    /** Output to screen **/
2939
    virtual void Print(const Option_t* opt) const;
2940

    
2941
    Double_t GetXOut() const { return fXOut;};
2942
    Double_t GetYOut() const { return fYOut;};
2943
    Double_t GetZOut() const { return fZOut;};
2944

    
2945
    Double_t GetPxOut() const { return fPxOut; }
2946
    Double_t GetPyOut() const { return fPyOut; }
2947
    Double_t GetPzOut() const { return fPzOut; }
2948

    
2949
    TVector3 GetPosition() const { return TVector3(fX, fY, fZ);}
2950
    TVector3 GetPositionOut() const { return TVector3(fXOut, fYOut, fZOut);}
2951

    
2952
    void PositionOut(TVector3& pos) const { pos.SetXYZ(fXOut, fYOut, fZOut);};
2953
    void MomentumOut(TVector3& mom) const { mom.SetXYZ(fPxOut,fPyOut,fPzOut); }
2954

    
2955

    
2956
  protected:
2957

    
2958
    Float_t        fA;          // A of material
2959
    Float_t        fZmat;       // Z of material
2960
    Float_t        fDensity;    // density of material
2961
    Float_t        fRadLen;     // radiation length
2962

    
2963
    Double_t fXOut, fYOut, fZOut;
2964
    Double_t fPxOut, fPyOut, fPzOut;
2965

    
2966

    
2967
    ClassDef(FairRadLenPoint,1)
2968

    
2969
};
2970

    
2971

    
2972
#endif
2973
/********************************************************************************
2974
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
2975
 *                                                                              *
2976
 *              This software is distributed under the terms of the             * 
2977
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *  
2978
 *                  copied verbatim in the file "LICENSE"                       *
2979
 ********************************************************************************/
2980
// -------------------------------------------------------------------------
2981
// -----                     FairRadMapPoint header file               -----
2982
// -------------------------------------------------------------------------
2983

    
2984

    
2985
/**  FairRadMapPoint.h
2986
 *@author O.N. Hartmann
2987
 *
2988
 */
2989

    
2990
#ifndef FAIRRADMAPPOINT_H
2991
#define FAIRRADMAPPOINT_H
2992

    
2993
#include "FairMCPoint.h"                // for FairMCPoint
2994

    
2995
#include "Rtypes.h"                     // for Double_t, Float_t, Int_t, etc
2996
#include "TVector3.h"                   // for TVector3
2997

    
2998
class FairRadMapPoint : public FairMCPoint
2999
{
3000

    
3001
  public:
3002

    
3003
    /** Default constructor **/
3004
    FairRadMapPoint();
3005

    
3006
    FairRadMapPoint(Int_t trackID, Int_t detID, TVector3 pos, TVector3 mom,
3007
                    Double_t tof, Double_t length, Double_t eLoss,
3008
                    TVector3 posOut, TVector3 momOut,
3009
                    Float_t  fA, Float_t fZ,  Float_t  fDensity, Double_t fVolMass,
3010
                    Double_t fStep, Double_t fDose, Double_t fDoseSL, Int_t fPdg );
3011

    
3012

    
3013
    /** Destructor **/
3014
    virtual ~FairRadMapPoint();
3015

    
3016

    
3017
    /** Accessors **/
3018
    Float_t GetA()              { return fA; }
3019
    Float_t GetZm()             { return fZmat; }
3020
    Float_t GetMass()           { return fVolMass;}
3021
    Float_t GetDensity()        { return fDensity ; }
3022

    
3023
    /** Modifiers **/
3024
    void SetA(Double_t A)              { fA = A; }
3025
    void SetZm(Double_t Z)             { fZmat = Z; }
3026
    void SetMass(Double_t vmass)       { fVolMass = vmass;}
3027
    void SetDensity (Double_t Density) { fDensity = Density; }
3028

    
3029
    /** Output to screen **/
3030
    virtual void Print(const Option_t* opt) const;
3031

    
3032
    Int_t GetPdg() const { return fPdg;};
3033

    
3034
    Double_t GetXOut() const { return fXOut;};
3035
    Double_t GetYOut() const { return fYOut;};
3036
    Double_t GetZOut() const { return fZOut;};
3037

    
3038
    Double_t GetPxOut() const { return fPxOut; }
3039
    Double_t GetPyOut() const { return fPyOut; }
3040
    Double_t GetPzOut() const { return fPzOut; }
3041

    
3042
    Double_t GetDose() const { return fDose;}
3043
    Double_t GetDoseSL() const { return fDoseSL;}
3044

    
3045
    TVector3 GetPosition() const { return TVector3(fX, fY, fZ);}
3046
    TVector3 GetPositionOut() const { return TVector3(fXOut, fYOut, fZOut);}
3047

    
3048
    void PositionOut(TVector3& pos) const { pos.SetXYZ(fXOut, fYOut, fZOut);};
3049
    void MomentumOut(TVector3& mom) const { mom.SetXYZ(fPxOut,fPyOut,fPzOut); }
3050

    
3051

    
3052

    
3053
  protected:
3054

    
3055
    //  Int_t          detID;       // detector ID or volume ID
3056
    Int_t          fPdg;        // track PID
3057
    Float_t        fA;          // A of material
3058
    Float_t        fZmat;       // Z of material
3059
    Float_t        fDensity;    // density of material
3060
    Double_t       fVolMass;     // radiation length
3061

    
3062
    Double_t fStep, fDose, fDoseSL;
3063
    Double_t fXOut, fYOut, fZOut;
3064
    Double_t fPxOut, fPyOut, fPzOut;
3065

    
3066

    
3067
    ClassDef(FairRadMapPoint,3)
3068

    
3069
};
3070

    
3071

    
3072
#endif
3073
/********************************************************************************
3074
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
3075
 *                                                                              *
3076
 *              This software is distributed under the terms of the             * 
3077
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *  
3078
 *                  copied verbatim in the file "LICENSE"                       *
3079
 ********************************************************************************/
3080
// -------------------------------------------------------------------------
3081
// -----          FairRecoEventHeader header file                      -----
3082
// -----          Created 20/09/13                 R.Karabowicz        -----
3083
// -------------------------------------------------------------------------
3084

    
3085
#ifndef FAIRRECOEVENTHEADER_H
3086
#define FAIRRECOEVENTHEADER_H
3087

    
3088

    
3089
#include "TNamed.h"
3090

    
3091
/**
3092
 *  Event Header Class
3093
  **@author D.Bertini <d.bertini@gsi.de>
3094
  **@author M.Al-Turany <m.al-turany@gsi.de>
3095
  **@author R.Karabowicz <r.karabowicz@gsi.de>
3096
 */
3097
class FairRecoEventHeader : public TNamed
3098
{
3099

    
3100
  public:
3101

    
3102
    /** Default constructor */
3103
    FairRecoEventHeader();
3104

    
3105
    /** Get the run ID for this run*/
3106
    UInt_t GetRunId() const {
3107
      return fRunId;
3108
    }
3109

    
3110
    /** Get the MC time for this event*/
3111
    Double_t GetEventTime() const {
3112
      return fEventTime;
3113
    }
3114

    
3115
    /** Get the error of MC time for this event*/
3116
    Double_t GetEventTimeError() const {
3117
      return fEventTimeError;
3118
    }
3119

    
3120
    /** Get identifier*/
3121
    Int_t GetIdentifier() const {
3122
      return fIdentifier;
3123
    }
3124

    
3125
    /** Set the run ID for this run
3126
    * @param runid : unique run id
3127
    */
3128
    void SetRunId(UInt_t runid) {
3129
      fRunId=runid;
3130
    }
3131

    
3132
    /** Set the MC time for this event
3133
     * @param time : time in ns
3134
     * @param terr : time error in ns
3135
     */
3136
    void SetEventTime(Double_t time, Double_t terr) {
3137
      fEventTime=time;
3138
      fEventTimeError=terr;
3139
    }
3140

    
3141
    /** Set the run ID for this run
3142
    * @param ident : identifier
3143
    */
3144
    void SetIdentifier(Int_t ident) {
3145
      fIdentifier=ident;
3146
    }
3147

    
3148
    virtual bool operator<(const FairRecoEventHeader& tempObj) const {
3149
      if (fEventTime < tempObj.GetEventTime()) { return true; }
3150
      else if (fEventTime > tempObj.GetEventTime()) { return false; }
3151
      return false;
3152
    }
3153

    
3154
    virtual bool operator>(const FairRecoEventHeader& tempObj) const {
3155
      if (fEventTime > tempObj.GetEventTime()) { return true; }
3156
      else if (fEventTime < tempObj.GetEventTime()) { return false; }
3157
      return false;
3158
    }
3159

    
3160
    virtual bool operator==(const FairRecoEventHeader& tempObj) const {
3161
      if   (fEventTime == tempObj.GetEventTime() ) {
3162
        return true;
3163
      }
3164
      return false;
3165
    }
3166

    
3167
    /**
3168
     * Destructor
3169
     */
3170
    virtual ~FairRecoEventHeader();
3171

    
3172
  protected:
3173

    
3174
    /** Run Id */
3175
    UInt_t fRunId;
3176
    /** Identifier */
3177
    Int_t     fIdentifier;
3178
    /** Event Time **/
3179
    Double_t  fEventTime;
3180
    /** Event Time Error **/
3181
    Double_t  fEventTimeError;
3182

    
3183
    ClassDef(FairRecoEventHeader,1)
3184

    
3185
};
3186
#endif
3187
/********************************************************************************
3188
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
3189
 *                                                                              *
3190
 *              This software is distributed under the terms of the             * 
3191
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *  
3192
 *                  copied verbatim in the file "LICENSE"                       *
3193
 ********************************************************************************/
3194
#ifndef FAIRRUNINFO_H
3195
#define FAIRRUNINFO_H
3196

    
3197
#include "TObject.h"                    // for TObject
3198

    
3199
#include "Rtypes.h"                     // for Double_t, Long_t, etc
3200
#include "TSystem.h"                    // for CpuInfo_t, MemInfo_t, etc
3201
#include "TTimeStamp.h"                 // for TTimeStamp
3202

    
3203
#include <vector>                       // for vector
3204

    
3205
class FairLogger;
3206
class TList;
3207

    
3208
class FairRunInfo : public TObject
3209
{
3210

    
3211
  public:
3212

    
3213
    FairRunInfo();
3214

    
3215
    ~FairRunInfo();
3216

    
3217
    void StoreInfo();
3218

    
3219
    void WriteInfo();
3220

    
3221
    void Reset();
3222

    
3223
  private:
3224

    
3225
    TTimeStamp  fTimeStamp;//!
3226
    CpuInfo_t   fCpuInfo;//!
3227
    MemInfo_t   fMemInfo;//!
3228
    ProcInfo_t  fProcInfo;//!
3229
    std::vector<Double_t> fTimeDiff;//!
3230
    std::vector<Double_t> fTime;//!
3231
    std::vector<Long_t> fResidentMemory;//!
3232
    std::vector<Long_t> fVirtualMemory;//!
3233
    FairLogger* fLogger;
3234

    
3235
    void CalculateTimeDifference();
3236

    
3237
    void PrintInfo();
3238

    
3239
    void GetInfo();
3240

    
3241
    void CreateAndFillHistograms(TList* histoList);
3242

    
3243
    void WriteHistosToFile(TList* histoList);
3244

    
3245
    FairRunInfo(const FairRunInfo&);
3246
    FairRunInfo& operator=(const FairRunInfo&);
3247

    
3248
    ClassDef(FairRunInfo,1)
3249

    
3250
};
3251
#endif
3252
/********************************************************************************
3253
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
3254
 *                                                                              *
3255
 *              This software is distributed under the terms of the             * 
3256
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *  
3257
 *                  copied verbatim in the file "LICENSE"                       *
3258
 ********************************************************************************/
3259
#ifndef FAIRTIMESTAMP_H
3260
#define FAIRTIMESTAMP_H
3261

    
3262
#include "FairMultiLinkedData_Interface.h"        // for FairMultiLinkedData
3263

    
3264
#include "FairLink.h"                   // for FairLink
3265

    
3266
#include "Riosfwd.h"                    // for ostream
3267
#include "Rtypes.h"                     // for Double_t, etc
3268

    
3269
#include <iostream>                     // for ostream, cout
3270

    
3271
#ifndef __CINT__ // for BOOST serialization
3272
#include <boost/serialization/access.hpp>
3273
#include <boost/serialization/base_object.hpp>
3274
#endif //__CINT__
3275

    
3276
class TObject;
3277

    
3278
/**
3279
 * Base class for Time stamp information
3280
 ** Aug. 2010
3281
 **@author M.Al-Turany <m.al-turany@gsi.de>
3282
 */
3283
class FairTimeStamp : public FairMultiLinkedData_Interface
3284
{
3285
  public:
3286
    /** Default constructor **/
3287
    FairTimeStamp();
3288
    /** Constructor with time **/
3289
    FairTimeStamp(Double_t time);
3290
    /** Constructor with time and time error **/
3291
    FairTimeStamp(Double_t time, Double_t timeerror);
3292

    
3293
    /** Destructor **/
3294
    virtual ~FairTimeStamp();
3295
    /** Accessors **/
3296
    virtual Double_t GetTimeStamp()             const { return fTimeStamp; };
3297
    virtual Double_t GetTimeStampError()     const { return fTimeStampError;};
3298
    virtual FairLink GetEntryNr() const {return fEntryNr;}
3299
    /** Modifiers **/
3300
    virtual void SetTimeStamp(Double_t t) { fTimeStamp = t; }
3301
    virtual void SetTimeStampError(Double_t t) {fTimeStampError = t;}
3302
    virtual void SetEntryNr(FairLink entry) {fEntryNr = entry;}
3303
    virtual Int_t Compare(const TObject* obj) const {
3304
      if (this == obj) { return 0; }
3305
      FairTimeStamp* tsobj = static_cast<FairTimeStamp*>(const_cast<TObject*>(obj));
3306
      Double_t ts = tsobj->GetTimeStamp();
3307
      Double_t tserror = tsobj->GetTimeStampError();
3308
      if (fTimeStamp < ts) { return -1; }
3309
      else if (fTimeStamp == ts && fTimeStampError < tserror) { return -1; }
3310
      else if (fTimeStamp == ts && fTimeStampError == tserror) { return 0; }
3311
      else { return 1; }
3312
    }
3313

    
3314

    
3315
    virtual std::ostream& PrintTimeInfo(std::ostream& out = std::cout) const;
3316
    virtual Bool_t IsSortable() const { return kTRUE;};
3317

    
3318

    
3319
    virtual bool equal(FairTimeStamp* data) {
3320
      return (fTimeStamp == data->GetTimeStamp() && fTimeStampError == data->GetTimeStampError());
3321
    }
3322

    
3323
    friend std::ostream& operator<< (std::ostream& out, const FairTimeStamp& link) {
3324
      link.PrintTimeInfo(out);
3325
      return out;
3326
    }
3327

    
3328
    virtual bool operator< (const FairTimeStamp* rValue) const {
3329
    	if (GetTimeStamp() < rValue->GetTimeStamp())
3330
    		return true;
3331
    	else
3332
    		return false;
3333
    }
3334

    
3335
    template<class Archive>
3336
    void serialize(Archive& ar, const unsigned int)
3337
    {
3338
        // ar & boost::serialization::base_object<FairMultiLinkedData>(*this);
3339
        ar& fTimeStamp;
3340
        ar& fTimeStampError;
3341
    }
3342

    
3343
  protected:
3344
#ifndef __CINT__ // for BOOST serialization
3345
    friend class boost::serialization::access;
3346
#endif // for BOOST serialization
3347

    
3348
    Double_t fTimeStamp;        /** Time of digit or Hit  [ns] */
3349
    Double_t fTimeStampError;     /** Error on time stamp */
3350
    FairLink fEntryNr; //!  indicates where the data is stored in the branch
3351

    
3352
    ClassDef(FairTimeStamp,3);
3353
};
3354

    
3355
#endif
3356
/********************************************************************************
3357
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
3358
 *                                                                              *
3359
 *              This software is distributed under the terms of the             * 
3360
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *  
3361
 *                  copied verbatim in the file "LICENSE"                       *
3362
 ********************************************************************************/
3363
// -------------------------------------------------------------------------
3364
// -----                     FairTrackParam header file                 -----
3365
// -----                  Created 27/01/05  by V. Friese               -----
3366
// -------------------------------------------------------------------------
3367

    
3368

    
3369
/**  FairTrackParam.h
3370
 *@author V.Friese <v.friese@gsi.de>
3371
 **
3372
 ** Parameters (x, y, tx, ty, q/p) of a track
3373
 ** resulting from the track fit. The z coordinate is not a parameter.
3374
 ** The 5x5 covariance matrix can be set and accessed by either an array
3375
 ** of size 15, the TMatrixFSym class or elementwise. Note that TMatrixFSym
3376
 ** should not be used when performance is an issue.
3377
 ** The internal representation of the covariance matrix elements is
3378
 ** an array of double.
3379
 **/
3380

    
3381

    
3382
#ifndef FAIRSTSTRACKPARAM
3383
#define FAIRSTSTRACKPARAM 1
3384

    
3385
#include "TObject.h"                    // for TObject
3386

    
3387
#include "Rtypes.h"                     // for Double_t, Double32_t, Int_t, etc
3388
#include "TMatrixFSymfwd.h"             // for TMatrixFSym
3389
#include "TVector3.h"                   // for TVector3
3390

    
3391
class FairTrackParam : public TObject
3392
{
3393

    
3394
  public:
3395

    
3396
    /** Constructor **/
3397
    FairTrackParam();
3398

    
3399

    
3400
    /** Constructor with all variables **/
3401
    FairTrackParam(Double_t x,  Double_t y,  Double_t z,
3402
                   Double_t tx, Double_t ty, Double_t qp,
3403
                   const TMatrixFSym& covMat);
3404

    
3405

    
3406
    /** Copy constructor **/
3407
    FairTrackParam(const FairTrackParam& param);
3408

    
3409

    
3410
    /** Destructor **/
3411
    virtual ~FairTrackParam();
3412

    
3413

    
3414
    /** Output to screen **/
3415
    void  Print(Option_t* option = "") const;
3416

    
3417
    /** Accessors **/
3418
    Double_t GetX()  const { return fX; };
3419
    Double_t GetY()  const { return fY; };
3420
    Double_t GetZ()  const { return fZ; };
3421
    Double_t GetTx() const { return fTx; };
3422
    Double_t GetTy() const { return fTy; };
3423
    Double_t GetQp() const { return fQp; };
3424
    void Position(TVector3& pos) const { pos.SetXYZ(fX, fY, fZ); };
3425
    void Momentum(TVector3& mom) const;
3426
    void CovMatrix(Double_t cov[]) const;
3427
    void CovMatrix(TMatrixFSym& covMat) const;
3428
    Double_t GetCovariance(Int_t i, Int_t j) const;
3429

    
3430

    
3431
    /** Modifiers **/
3432
    void SetX(Double_t x)   { fX  = x;  };
3433
    void SetY(Double_t y)   { fY  = y;  };
3434
    void SetZ(Double_t z)   { fZ  = z;  };
3435
    void SetTx(Double_t tx) { fTx = tx; };
3436
    void SetTy(Double_t ty) { fTy = ty; };
3437
    void SetQp(Double_t qp) { fQp = qp; };
3438
    void SetPosition(const TVector3& pos);
3439
    void SetCovMatrix(Double_t cov[]);
3440
    void SetCovMatrix(const TMatrixFSym& covMat);
3441
    void SetCovariance(Int_t i, Int_t j, Double_t val);
3442

    
3443

    
3444
    /** Assignment operator  **/
3445
    FairTrackParam& operator=(const FairTrackParam& par );
3446

    
3447

    
3448

    
3449
  private:
3450

    
3451
    /** Position of track at given z [cm] **/
3452
    Double32_t fX, fY, fZ;
3453

    
3454
    /** Direction of track tx = dx/dz; ty = dy/dz **/
3455
    Double32_t fTx, fTy;
3456

    
3457
    /** Charge over momentum [1/GeV] **/
3458
    Double32_t fQp;
3459

    
3460
    /** Covariance matrix for the variables x, y, tx, ty, q/p
3461
     ** The 15 elements of the upper triangle of the symmetric matrix
3462
     ** are stored in an array of floats. The sequence of the array is
3463
     ** a[0,0..4], a[1,1..4], a[2,2..4], a[3,3..4], a[4,4].
3464
     **/
3465

    
3466
    Double32_t fCovMatrix[15];
3467

    
3468

    
3469
    ClassDef(FairTrackParam,1);
3470

    
3471
};
3472

    
3473

    
3474
#endif
3475
/********************************************************************************
3476
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
3477
 *                                                                              *
3478
 *              This software is distributed under the terms of the             * 
3479
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *  
3480
 *                  copied verbatim in the file "LICENSE"                       *
3481
 ********************************************************************************/
3482
// -------------------------------------------------------------------------
3483
// -----                      FairField header file                     -----
3484
// -----                Created 06/01/04  by M. Al-Turany              -----
3485
// -----                Redesign 13/02/06  by V. Friese                -----
3486
// -----                Redesign 04/08/06  by M. Al-Turany               -----
3487
// -------------------------------------------------------------------------
3488

    
3489

    
3490
/** FairField.h
3491
 ** @author M.Al-Turany <m.al/turany@gsi.de>
3492
 ** @author V.Friese <v.friese@gsi.de>
3493
 ** @since 06.01.2004
3494
 ** @version1.0
3495
 **
3496
 ** Abstract base class for magnetic fields in FAIR
3497
 ** Concrete field should implement the pure virtual methods
3498
 ** GetBx, GetBy and GetBz and/or  GetBxyz
3499
 **
3500
 ** Note: Field values should be returned in kG (thanks to GEANT3)
3501
 **/
3502

    
3503
#ifndef FAIRFIELD_H
3504
#define FAIRFIELD_H 1
3505

    
3506
#include "RVersion.h"                   // for ROOT_VERSION_CODE
3507
#include "Riosfwd.h"                    // for ostream
3508
#include "Rtypes.h"                     // for Double_t, Bool_t, etc
3509

    
3510
#if ROOT_VERSION_CODE < 333824
3511

    
3512
#ifndef ROOT_TVirtualMagField
3513
#define ROOT_TVirtualMagField
3514
// copied from ROOT for backward compatibility with ROOT versions before 5.24
3515
#include "TNamed.h"
3516

    
3517
class TVirtualMagField : public TNamed
3518
{
3519
  public:
3520
    TVirtualMagField()                 : TNamed() {}
3521
    TVirtualMagField(const char* name) : TNamed(name,"") {}
3522
    virtual ~TVirtualMagField() {}
3523
    virtual void Field(const Double_t* x, Double_t* B) = 0;
3524
    ClassDef(TVirtualMagField, 1)              // Abstract base field class
3525
};
3526
ClassImp(TVirtualMagField)
3527
#endif
3528

    
3529

    
3530
#else
3531

    
3532
#include "TVirtualMagField.h"
3533

    
3534
#endif
3535

    
3536
#include <stdio.h>                      // for printf
3537
#include <iostream>                     // for operator<<, basic_ostream, etc
3538

    
3539
#include "FairLogger.h"
3540

    
3541

    
3542
class FairField : public TVirtualMagField
3543
{
3544

    
3545
  public:
3546

    
3547
    /** Default constructor **/
3548
    FairField();
3549

    
3550

    
3551
    /** Constructor with name and title **/
3552
    FairField(const char* name, const char* title = "FAIR Magnetic Field");
3553

    
3554
    FairField& operator=(const FairField&) {return *this;}
3555

    
3556
    /** Destructor **/
3557
    virtual ~FairField();
3558

    
3559

    
3560
    /** Intialisation. E.g. read in the field map. If needed, to be
3561
     ** implemented in the concrete class.
3562
     **/
3563
    virtual void Init() { };
3564

    
3565
    /** Test whether field type is Constant **/
3566
    Bool_t IsConst();
3567

    
3568

    
3569
    /** Test whether field typ is Map **/
3570
    Bool_t IsMap();
3571

    
3572

    
3573
    /** Field type ( 0=constant, 1=map, 2=map sym2, 3 = map sym3 ) **/
3574
    Int_t GetType() const { return fType; }
3575

    
3576

    
3577
    /** Get x component of magnetic field [kG]
3578
     ** @param x,y,z    Position [cm]
3579
     **/
3580
    virtual Double_t GetBx(Double_t, Double_t, Double_t) {LOG(WARNING)<<"FairField::GetBx Should be implemented in User class"<<FairLogger::endl; return 0;}
3581

    
3582

    
3583
    /** Get y component of magnetic field [kG]
3584
     ** @param x,y,z    Position [cm]
3585
     **/
3586
    virtual Double_t GetBy(Double_t, Double_t, Double_t) {LOG(WARNING)<<"FairField::GetBy Should be implemented in User class"<<FairLogger::endl; return 0;}
3587

    
3588
    /** Get z component of magnetic field [kG]
3589
     ** @param x,y,z    Position [cm]
3590
     **/
3591
    virtual Double_t GetBz(Double_t, Double_t, Double_t) {LOG(WARNING)<<"FairField::GetBz Should be implemented in User class"<<FairLogger::endl; return 0;}
3592

    
3593

    
3594
    /** Get magnetic field. For use of GEANT3
3595
     ** @param point            Coordinates [cm]
3596
     ** @param bField (return)  Field components [kG]
3597
     **/
3598
    virtual void GetFieldValue(const Double_t point[3], Double_t* bField);
3599

    
3600

    
3601
    void Field(const Double_t point[3], Double_t* B) {GetFieldValue(point,B);}
3602

    
3603

    
3604
    /** Screen output. To be implemented in the concrete class. **/
3605
    virtual void  Print(Option_t*) const {;}
3606
    virtual void GetBxyz(const Double_t[3], Double_t*) {LOG(WARNING)<<"FairField::GetBxyz Should be implemented in User class"<<FairLogger::endl;}
3607

    
3608

    
3609

    
3610
    /**Fill Paramater*/
3611

    
3612
    virtual void FillParContainer() {LOG(WARNING)<<"FairField::FillParContainer Should be implemented in User class"<<FairLogger::endl;}
3613
  protected:
3614

    
3615
    /** Field type. 1 = constant field, 2 = field map. **/
3616
    Int_t fType;
3617

    
3618
  private:
3619
    FairField(const FairField&);
3620
    //    FairField& operator=(const FairField&);
3621
    //TODO: Check why the htrack needs this
3622
    ClassDef(FairField,4);
3623

    
3624
};
3625

    
3626

    
3627

    
3628

    
3629
#endif
3630
/********************************************************************************
3631
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
3632
 *                                                                              *
3633
 *              This software is distributed under the terms of the             * 
3634
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *  
3635
 *                  copied verbatim in the file "LICENSE"                       *
3636
 ********************************************************************************/
3637
// -------------------------------------------------------------------------
3638
// -----                    FairFieldFactory header file                  -----
3639
// -----                Created 15/01/07  by M. Al-Turany              -----
3640
// -------------------------------------------------------------------------
3641

    
3642

    
3643
#ifndef FAIRFIELDFACTORY_H
3644
#define FAIRFIELDFACTORY_H
3645

    
3646
#include "Rtypes.h"                     // for FairFieldFactory::Class, etc
3647

    
3648
class FairField;
3649

    
3650
class FairFieldFactory
3651
{
3652

    
3653
  public:
3654
    static FairFieldFactory* Instance();
3655
    FairFieldFactory();
3656
    virtual ~FairFieldFactory();
3657
    virtual FairField* createFairField() {
3658
      FairField* field=0;
3659
      if(fCreator) { field= fCreator->createFairField(); }
3660
      return field;
3661
    };
3662
    virtual void SetParm() {
3663
      if(fCreator) { fCreator->SetParm(); }
3664
    }
3665

    
3666
  protected:
3667
    FairFieldFactory* fCreator;
3668
    static FairFieldFactory*  fgRinstance;
3669

    
3670
    ClassDef(FairFieldFactory,1)
3671
  private:
3672
    FairFieldFactory(const FairFieldFactory& M);
3673
    FairFieldFactory& operator= (const  FairFieldFactory&) {return *this;}
3674

    
3675
};
3676
#endif //FAIRFIELDFACTORY_H
3677

    
3678

    
3679

    
3680

    
3681

    
3682

    
3683

    
3684
/********************************************************************************
3685
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
3686
 *                                                                              *
3687
 *              This software is distributed under the terms of the             * 
3688
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *  
3689
 *                  copied verbatim in the file "LICENSE"                       *
3690
 ********************************************************************************/
3691
/**
3692
* Runge-Kutte Track propagator
3693
* @author M. Al-Turany
3694
* @version 0.1
3695
* @since 22.1.10
3696
*/
3697

    
3698
#ifndef RKPropagator
3699
#define RKPropagator
3700

    
3701
#include "TObject.h"                    // for TObject
3702

    
3703
#include "Rtypes.h"                     // for Double_t, etc
3704

    
3705
class FairField;
3706

    
3707
class FairRKPropagator : public TObject
3708
{
3709

    
3710
  private:
3711
    FairRKPropagator(const FairRKPropagator&);            // Not implemented
3712
    FairRKPropagator& operator=(const FairRKPropagator&); // Not implemented
3713
    Double_t fMaxStep;
3714
    FairField*              fMagField;
3715
  public:
3716
    void Step(Double_t Charge, Double_t* vecRKIn, Double_t* vecOut);
3717
    Double_t OneStepRungeKutta(Double_t charge, Double_t step, Double_t* vect, Double_t* vout);
3718
    FairRKPropagator(FairField* field);
3719
    /**Propagate to closest approach of a point
3720
    @CHARGE    Particle charge
3721
    @STEP      maximum Step size
3722
    @vecRKIn   Initial co-ords,direction cosines,momentum
3723
    @vecOut    Output co-ords,direction cosines,momentum
3724
    */
3725
    void Propagat(Double_t Charge, Double_t* vecRKIn, Double_t* Pos);
3726

    
3727
    /**Propagate to closest approach of a plane
3728
    @CHARGE    Particle charge
3729
    @vecRKIn   Initial co-ords,direction cosines,momentum
3730
    @vec1      vector on the plane
3731
    @vec2      vector on the plane
3732
    @vec3      point on the plane
3733
    @vecOut    Output co-ords,direction cosines,momentum
3734
    */
3735

    
3736
    void PropagatToPlane(Double_t Charge, Double_t* vecRKIn, Double_t* vec1, Double_t* vec2, Double_t* vec3, Double_t* vecOut);
3737

    
3738
    virtual ~FairRKPropagator();
3739
    ClassDef(FairRKPropagator, 1);
3740

    
3741
};
3742

    
3743

    
3744
#endif
3745
/********************************************************************************
3746
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
3747
 *                                                                              *
3748
 *              This software is distributed under the terms of the             * 
3749
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *  
3750
 *                  copied verbatim in the file "LICENSE"                       *
3751
 ********************************************************************************/
3752
// -----------------------------------------------------------------------------
3753
// -----                                                                   -----
3754
// -----                             FairSource                            -----
3755
// -----                    Created 01.11.2013 by F. Uhlig                 -----
3756
// -----                                                                   -----
3757
// -----------------------------------------------------------------------------
3758

    
3759
#ifndef FAIRSOURCE_H
3760
#define FAIRSOURCE_H
3761

    
3762
#include "TObject.h"
3763

    
3764
#include <iostream>
3765

    
3766
class FairEventHeader;
3767

    
3768
enum Source_Type {kONLINE, kFILE};
3769

    
3770
class FairSource : public TObject
3771
{
3772
  public:
3773
    FairSource();
3774
    FairSource(const FairSource& source);
3775
    virtual ~FairSource();
3776

    
3777
    virtual Bool_t Init() = 0;
3778
    virtual Int_t ReadEvent(UInt_t=0) = 0;
3779
    virtual void Close() = 0;
3780

    
3781
    virtual void Reset() = 0;
3782

    
3783
    virtual Bool_t   ActivateObject(TObject**, const char*)  { return kFALSE; }
3784

    
3785
    virtual Source_Type GetSourceType() = 0;
3786

    
3787
    virtual void SetParUnpackers() = 0;
3788

    
3789
    virtual Bool_t InitUnpackers() = 0;
3790

    
3791
    virtual Bool_t ReInitUnpackers() = 0;
3792

    
3793
    /**Check the maximum event number we can run to*/
3794
    virtual Int_t  CheckMaxEventNo(Int_t=0) {return -1;}
3795
    /**Read the tree entry on one branch**/
3796
    virtual void   ReadBranchEvent(const char*) {return;}
3797
    virtual void   ReadBranchEvent(const char*, Int_t) {return;}
3798
    virtual void FillEventHeader(FairEventHeader* feh);
3799

    
3800
    void SetRunId(Int_t runId) { fRunId = runId; }
3801
    Int_t GetRunId() const     { return fRunId;  }
3802

    
3803
  protected:
3804
    Int_t fRunId;
3805

    
3806
  public:
3807
    ClassDef(FairSource, 2)
3808
};
3809

    
3810

    
3811
#endif
3812
/********************************************************************************
3813
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
3814
 *                                                                              *
3815
 *              This software is distributed under the terms of the             *
3816
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *
3817
 *                  copied verbatim in the file "LICENSE"                       *
3818
 ********************************************************************************/
3819
//
3820
//  FairFileSource.h
3821
//  FAIRROOT
3822
//
3823
//  Created by Mohammad Al-Turany on 08/02/14.
3824
//
3825
//
3826

    
3827
#ifndef __FAIRROOT__FairFileSource__
3828
#define __FAIRROOT__FairFileSource__
3829

    
3830
#include "FairSource.h"
3831
#include <list>    
3832
#include "TChain.h"
3833
#include "TFile.h"
3834
#include "TFolder.h"
3835
#include "TF1.h"
3836
class FairEventHeader;
3837
class FairFileHeader;
3838
class FairMCEventHeader;
3839
class TString;
3840
class FairLogger;
3841
class FairRuntimeDb;
3842

    
3843
class FairFileSource : public FairSource
3844
{
3845
public:
3846
    FairFileSource(TFile *f, const char* Title="InputRootFile", UInt_t identifier=0);
3847
    FairFileSource(const TString* RootFileName, const char* Title="InputRootFile", UInt_t identifier=0);
3848
    FairFileSource(const TString RootFileName, const char* Title="InputRootFile", UInt_t identifier=0);
3849
  //  FairFileSource(const FairFileSource& file);
3850
    virtual ~FairFileSource();
3851
    
3852
    Bool_t              Init();
3853
    Int_t               ReadEvent(UInt_t i=0);
3854
    void                Close();
3855
    void                Reset();
3856

    
3857
    virtual Source_Type GetSourceType() { return kFILE; }
3858

    
3859
    virtual void SetParUnpackers() {}
3860

    
3861
    virtual Bool_t InitUnpackers() { return kTRUE; }
3862

    
3863
    virtual Bool_t ReInitUnpackers() { return kTRUE; }
3864

    
3865
    /**Check the maximum event number we can run to*/
3866
    virtual Int_t  CheckMaxEventNo(Int_t EvtEnd=0);
3867
    /**Read the tree entry on one branch**/
3868
    virtual void   ReadBranchEvent(const char* BrName);
3869
    /**Read specific tree entry on one branch**/
3870
    virtual void   ReadBranchEvent(const char* BrName, Int_t Entry);
3871
    virtual void FillEventHeader(FairEventHeader* feh);
3872

    
3873
    const TFile*        GetRootFile(){return fRootFile;}
3874
    /** Add a friend file (input) by name)*/
3875
    void                AddFriend(TString FileName);
3876
    /**Add ROOT file to input, the file will be chained to already added files*/
3877
    void                AddFile(TString FileName);
3878
    void                AddFriendsToChain();
3879
    void                PrintFriendList();
3880
    Bool_t              CompareBranchList(TFile* fileHandle, TString inputLevel);
3881
    void                CheckFriendChains();
3882
    void                CreateNewFriendChain(TString inputFile, TString inputLevel);
3883
    TTree*              GetInTree() {return fInChain->GetTree();}
3884
    TChain*             GetInChain() {return fInChain;}
3885
    TFile*              GetInFile() {return  fRootFile;}
3886
    void                CloseInFile() { if(fRootFile) { fRootFile->Close(); }}
3887
    /**Set the input tree when running on PROOF worker*/
3888
    void                SetInTree (TTree*  tempTree);
3889
    TObjArray*          GetListOfFolders(){return fListFolder;}
3890
    TFolder*            GetBranchDescriptionFolder(){return fCbmroot;}
3891
    UInt_t              GetEntries(){return fNoOfEntries; }
3892

    
3893
    //    TList*              GetBranchNameList() {return fBranchNameList;}
3894

    
3895
    void                SetInputFile(TString name);
3896

    
3897
    /** Set the repetition time of the beam when it can interact (beamTime) and when no interaction happen (gapTime). The total repetition time is beamTime + gapTime */
3898
    void                SetBeamTime(Double_t beamTime, Double_t gapTime);
3899
    /** Set the min and max limit for event time in ns */
3900
    void                SetEventTimeInterval(Double_t min, Double_t max);
3901
    /** Set the mean time for the event in ns */
3902
    void                SetEventMeanTime(Double_t mean);
3903
    void                SetEventTime();
3904
    Double_t		GetDeltaEventTime();
3905
    void                SetFileHeader(FairFileHeader* f) {fFileHeader =f;}
3906
    Double_t            GetEventTime();
3907

    
3908
    //    virtual Bool_t   SetObject(TObject* obj, const char* ObjType);
3909
    //    virtual void     SetObjectName(const char* ObjName, const char* ObjType);
3910

    
3911
    virtual Bool_t   ActivateObject(TObject** obj, const char* BrName);
3912

    
3913
    /**Set the status of the EvtHeader
3914
     *@param Status:  True: The header was creatged in this session and has to be filled
3915
              FALSE: We use an existing header from previous data level
3916
     */
3917
    void                SetEvtHeaderNew(Bool_t Status) {fEvtHeaderIsNew = Status;}
3918
    Bool_t              IsEvtHeaderNew() {return fEvtHeaderIsNew;}
3919

    
3920
    /** Allow to disable the testing the file layout when adding files to a chain.
3921
     */
3922
    void                SetCheckFileLayout(Bool_t enable) {fCheckFileLayout = enable;}
3923

    
3924
private:
3925
    /** Title of input source, could be input, background or signal*/
3926
    TString                           fInputTitle;
3927
    /**ROOT file*/
3928
    TFile*                            fRootFile;
3929
    /** Current Entry number */
3930
    Int_t                             fCurrentEntryNr;  //!
3931
    /** List of all files added with AddFriend */
3932
    std::list<TString>                fFriendFileList; //!
3933
    std::list<TString>                fInputChainList;//!
3934
    std::map<TString, TChain*>          fFriendTypeList;//!
3935
    std::map<TString, std::list<TString>* > fCheckInputBranches; //!
3936
    std::list<TString>                      fInputLevel; //!
3937
    std::map<TString, std::multimap<TString, TArrayI> > fRunIdInfoAll; //!
3938
    /**Input Chain */
3939
    TChain*                             fInChain;
3940
    /**Input Tree */
3941
    TTree*                              fInTree;
3942
    /** list of folders from all input (and friends) files*/
3943
    TObjArray                           *fListFolder; //!
3944
    /** RuntimeDb*/
3945
    FairRuntimeDb*           fRtdb;
3946
    /**folder structure of output*/
3947
    TFolder*                            fCbmout;
3948
    /**folder structure of input*/
3949
    TFolder*                            fCbmroot;
3950
    /***/
3951
    UInt_t                              fSourceIdentifier;
3952
    /**No of Entries in this source*/
3953
    UInt_t                              fNoOfEntries;
3954
    /**Initialization flag, true if initialized*/
3955
    Bool_t                              IsInitialized;
3956
    
3957
    FairFileSource(const FairFileSource&);
3958
    FairFileSource operator=(const FairFileSource&);
3959

    
3960
    /** MC Event header */
3961
    FairMCEventHeader*                      fMCHeader; //!
3962

    
3963
    /**Event Header*/
3964
    FairEventHeader*                        fEvtHeader; //!
3965

    
3966
    /**File Header*/
3967
    FairFileHeader*                        fFileHeader; //!
3968

    
3969
    /** This is true if the event time used, came from simulation*/
3970
    Bool_t                                  fEventTimeInMCHeader; //!
3971
    /**This flag is true if the event header was created in this session
3972
    * otherwise it is false which means the header was created in a previous data
3973
    * level and used here (e.g. in the digi)
3974
    */
3975
    Bool_t      fEvtHeaderIsNew; //!
3976

    
3977
    /** for internal use, to return the same event time for the same entry*/
3978
    UInt_t                                  fCurrentEntryNo; //!
3979
    /** for internal use, to return the same event time for the same entry*/
3980
    UInt_t                                  fTimeforEntryNo; //!
3981

    
3982
    /** min time for one event (ns) */
3983
    Double_t                                fEventTimeMin;  //!
3984
    /** max time for one Event (ns) */
3985
    Double_t                                fEventTimeMax;  //!
3986
    /** Time of event since th start (ns) */
3987
    Double_t                                fEventTime;     //!
3988
    /** Time of particles in beam (ns) */
3989
    Double_t                                fBeamTime; //!
3990
    /** Time without particles in beam (gap) (ns) */
3991
    Double_t                                fGapTime; //!
3992
    /** EventMean time used (P(t)=1/fEventMeanTime*Exp(-t/fEventMeanTime) */
3993
    Double_t                                fEventMeanTime; //!
3994
    /** used to generate random numbers for event time; */
3995
    TF1*                                    fTimeProb;      //!
3996
    /** True if the file layout should be checked when adding files to a chain.
3997
     *  Default value is true.
3998
     */
3999
     Bool_t                                 fCheckFileLayout; //!
4000

    
4001
    ClassDef(FairFileSource, 3)
4002
};
4003

    
4004

    
4005
#endif /* defined(__FAIRROOT__FairFileSource__) */
4006
/********************************************************************************
4007
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
4008
 *                                                                              *
4009
 *              This software is distributed under the terms of the             *
4010
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *
4011
 *                  copied verbatim in the file "LICENSE"                       *
4012
 ********************************************************************************/
4013
//
4014
//  FairMixedSource.h
4015
//  FAIRROOT
4016
//
4017
//  Created by Mohammad Al-Turany on 08/02/14.
4018
//
4019
//
4020

    
4021
#ifndef __FAIRROOT__FairMixedSource__
4022
#define __FAIRROOT__FairMixedSource__
4023

    
4024
#include "FairSource.h"
4025
#include <list>    
4026
#include "TChain.h"
4027
#include "TFile.h"
4028
#include "TF1.h"
4029

    
4030
class FairEventHeader;
4031
class FairFileHeader;
4032
class FairMCEventHeader;
4033
class TString;
4034
class FairLogger;
4035
class FairRuntimeDb;
4036
class TFolder;
4037

    
4038
class FairRootManager;
4039

    
4040
class FairMixedSource : public FairSource
4041
{
4042
public:
4043
    FairMixedSource(TFile *f, const char* Title="InputRootFile", UInt_t identifier=0);
4044
    FairMixedSource(const TString* RootFileName, const char* Title="InputRootFile", UInt_t identifier=0);
4045
    FairMixedSource(const TString RootFileName, const Int_t signalId, const char* Title="InputRootFile", UInt_t identifier=0);
4046
  //  FairMixedSource(const FairMixedSource& file);
4047
    virtual ~FairMixedSource();
4048
    
4049
    Bool_t              Init();
4050
    Int_t               ReadEvent(UInt_t i=0);
4051
    void                Close();
4052
    void                Reset();
4053

    
4054
    virtual Source_Type GetSourceType() { return kFILE; }
4055

    
4056
    virtual void SetParUnpackers() {}
4057

    
4058
    virtual Bool_t InitUnpackers() { return kTRUE; }
4059

    
4060
    virtual Bool_t ReInitUnpackers() { return kTRUE; }
4061

    
4062
    /**Check the maximum event number we can run to*/
4063
    virtual Int_t  CheckMaxEventNo(Int_t EvtEnd=0);
4064
    /**Read the tree entry on one branch**/
4065
    void             ReadBranchEvent(const char* BrName);
4066
    /** Read specific tree entry on one branch**/
4067
    void             ReadBranchEvent(const char* BrName, Int_t Entry);
4068

    
4069
    void                FillEventHeader(FairEventHeader* feh);
4070

    
4071
    const TFile*        GetRootFile(){return fRootFile;}
4072
    /** Add a friend file (input) by name)*/
4073

    
4074
    virtual Bool_t   ActivateObject(TObject** obj, const char* BrName);
4075

    
4076
    void             ReadBKEvent(UInt_t i=0);
4077

    
4078
    /**Set the input signal file
4079
     *@param name :        signal file name
4080
     *@param identifier :  Unsigned integer which identify the signal file
4081
     */
4082
    void                  SetSignalFile(TString name, UInt_t identifier );
4083
    /**Set the input background file by name*/
4084
    void                  SetBackgroundFile(TString name);
4085
    /**Add signal file to input
4086
     *@param name :        signal file name
4087
     *@param identifier :  Unsigned integer which identify the signal file to which this signal should be added
4088
     */
4089
    void                  AddSignalFile(TString name, UInt_t identifier );
4090
    void                  AddBackgroundFile(TString name);
4091

    
4092
    TChain*             GetBGChain() { return  fBackgroundChain;}
4093
    TChain*             GetSignalChainNo(UInt_t i);
4094

    
4095
    Bool_t            OpenBackgroundChain();
4096
    Bool_t            OpenSignalChain();
4097

    
4098
    /**Set the signal to background ratio in event units
4099
    *@param background :  Number of background Events for one signal
4100
    *@param Signalid :    Signal file Id, used when adding (setting) the signal file
4101
    */
4102
    void BGWindowWidthNo(UInt_t background, UInt_t Signalid);
4103
    /**Set the signal to background rate in time units
4104
    *@param background :  Time of background Events before one signal
4105
    *@param Signalid :    Signal file Id, used when adding (setting) the signal file
4106
    */
4107
    void BGWindowWidthTime(Double_t background, UInt_t Signalid);
4108

    
4109
    /** Set the min and max limit for event time in ns */
4110
    void                SetEventTimeInterval(Double_t min, Double_t max);
4111
    /** Set the mean time for the event in ns */
4112
    void                SetEventMeanTime(Double_t mean);
4113
    /** Set the repetition time of the beam when it can interact (beamTime) and when no interaction happen (gapTime). The total repetition time is beamTime + gapTime */
4114
    void                SetBeamTime(Double_t beamTime, Double_t gapTime);
4115
    void                SetEventTime();
4116
    Double_t		GetDeltaEventTime();
4117
    void                SetFileHeader(FairFileHeader* f) {fFileHeader =f;}
4118
    Double_t            GetEventTime();
4119

    
4120
    /**Add ROOT file to input, the file will be chained to already added files*/
4121
    Bool_t              CompareBranchList(TFile* fileHandle, TString inputLevel);
4122
    /**Set the input tree when running on PROOF worker*/
4123
    TObjArray*          GetListOfFolders(){return fListFolder;}
4124
    TFolder*            GetBranchDescriptionFolder(){return fCbmroot;}
4125
    UInt_t              GetEntries(){return fNoOfEntries; }
4126

    
4127
    /**Set the status of the EvtHeader
4128
     *@param Status:  True: The header was creatged in this session and has to be filled
4129
              FALSE: We use an existing header from previous data level
4130
     */
4131
    void                SetEvtHeaderNew(Bool_t Status) {fEvtHeaderIsNew = Status;}
4132
    Bool_t              IsEvtHeaderNew() {return fEvtHeaderIsNew;}
4133

    
4134
private:
4135
    /**IO manager */
4136
    FairRootManager*         fRootManager;
4137

    
4138
    /** Title of input source, could be input, background or signal*/
4139
    TString                           fInputTitle;
4140
    /**ROOT file*/
4141
    TFile*                            fRootFile;
4142
    /** List of all files added with AddFriend */
4143
    std::list<TString>                fFriendFileList; //!
4144
    std::list<TString>                fInputChainList;//!
4145
    std::map<TString, TChain*>          fFriendTypeList;//!
4146
    std::map<TString, std::list<TString>* > fCheckInputBranches; //!
4147
    std::list<TString>                      fInputLevel; //!
4148
    std::map<TString, std::multimap<TString, TArrayI> > fRunIdInfoAll; //!
4149
    /** list of folders from all input (and friends) files*/
4150
    TObjArray                           *fListFolder; //!
4151
    /** RuntimeDb*/
4152
    FairRuntimeDb*           fRtdb;
4153
    /**folder structure of output*/
4154
    TFolder*                            fCbmout;
4155
    /**folder structure of input*/
4156
    TFolder*                            fCbmroot;
4157
    /***/
4158
    UInt_t                              fSourceIdentifier;
4159
    /**No of Entries in this source*/
4160
    UInt_t                              fNoOfEntries;
4161
    /**Initialization flag, true if initialized*/
4162
    Bool_t                              IsInitialized;
4163

    
4164
    /** MC Event header */
4165
    FairMCEventHeader*                      fMCHeader; //!
4166

    
4167
    /**Event Header*/
4168
    FairEventHeader*                        fEvtHeader; //!
4169

    
4170
    /**Output Event Header*/
4171
    FairEventHeader*                        fOutHeader; //!
4172

    
4173
    /**File Header*/
4174
    FairFileHeader*                        fFileHeader; //!
4175

    
4176
    /** This is true if the event time used, came from simulation*/
4177
    Bool_t                                  fEventTimeInMCHeader; //!
4178
    /**This flag is true if the event header was created in this session
4179
    * otherwise it is false which means the header was created in a previous data
4180
    * level and used here (e.g. in the digi)
4181
    */
4182
    Bool_t      fEvtHeaderIsNew; //!
4183

    
4184
    /** for internal use, to return the same event time for the same entry*/
4185
    UInt_t                                  fCurrentEntryNo; //!
4186
    /** for internal use, to return the same event time for the same entry*/
4187
    UInt_t                                  fTimeforEntryNo; //!
4188
    /* /\**No of entries in BG Chain*\/ */
4189
    UInt_t                                  fNoOfBGEntries; //!
4190
    /* /\**Hold the current entry for each input chain*\/ */
4191
    std::map<UInt_t, UInt_t>                fCurrentEntry; //! 
4192

    
4193
    /** min time for one event (ns) */
4194
    Double_t                                fEventTimeMin;  //!
4195
    /** max time for one Event (ns) */
4196
    Double_t                                fEventTimeMax;  //!
4197
    /** Time of event since th start (ns) */
4198
    Double_t                                fEventTime;     //!
4199
    /** Time of particles in beam (ns) */
4200
    Double_t                                fBeamTime; //!
4201
    /** Time without particles in beam (gap) (ns) */
4202
    Double_t                                fGapTime; //!
4203
    /** EventMean time used (P(t)=1/fEventMeanTime*Exp(-t/fEventMeanTime) */
4204
    Double_t                                fEventMeanTime; //!
4205
    /** used to generate random numbers for event time; */
4206
    TF1*                                    fTimeProb;      //!
4207

    
4208
    /**holds the SB ratio by number*/
4209
    std::map<UInt_t, Double_t>              fSignalBGN;//! 
4210
    /* /\**True for background window in entry units*\/ */
4211
    Bool_t                                  fSBRatiobyN;  //! 
4212
    /* /\**True for background window in time units (ns) *\/ */
4213
    Bool_t                                  fSBRatiobyT;  //!
4214

    
4215
    /**Actual identifier of the added signals, this is used to identify how many signals are added*/
4216
    UInt_t                              fActualSignalIdentifier; //!
4217
    /** Total number of signals added (Types and not files!)*/
4218
    UInt_t                              fNoOfSignals; //!
4219
    /** list of chains which has to be created for the different signals*/
4220
    std::list<TString>*                  fSignalChainList; //!
4221
    /**Chain containing the background*/
4222
    TChain*                              fBackgroundChain; //!
4223
    std::map<UInt_t, TChain*>            fSignalTypeList;//!
4224

    
4225
    FairMixedSource(const FairMixedSource&);
4226
    FairMixedSource& operator=(const FairMixedSource&);
4227
    
4228
public:
4229
    ClassDef(FairMixedSource, 0)
4230
};
4231

    
4232

    
4233
#endif /* defined(__FAIRROOT__FairMixedSource__) */
4234
/********************************************************************************
4235
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
4236
 *                                                                              *
4237
 *              This software is distributed under the terms of the             *
4238
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *
4239
 *                  copied verbatim in the file "LICENSE"                       *
4240
 ********************************************************************************/
4241
// -----------------------------------------------------------------------------
4242
// -----                                                                   -----
4243
// -----                             FairMbsSource                         -----
4244
// -----                    Created 12.04.2013 by D.Kresan                 -----
4245
// -----              Copied from FairSource 01.11.2013 by F.Uhlig         -----
4246
// -----                                                                   -----
4247
// -----------------------------------------------------------------------------
4248

    
4249
#ifndef FAIRONLINESOURCE_H
4250
#define FAIRONLINESOURCE_H
4251

    
4252
#include "FairSource.h"
4253
#include "TObjArray.h"
4254

    
4255
#include "FairUnpack.h"
4256

    
4257

    
4258
class FairOnlineSource : public FairSource
4259
{
4260
  public:
4261
    FairOnlineSource();
4262
    FairOnlineSource(const FairOnlineSource& source);
4263
    virtual ~FairOnlineSource();
4264

    
4265
    inline void AddUnpacker(FairUnpack* unpacker) { fUnpackers->Add(unpacker); }
4266
    inline const TObjArray* GetUnpackers() const { return fUnpackers; }
4267

    
4268
    virtual Bool_t Init() = 0;
4269
    virtual Int_t ReadEvent(UInt_t=0) = 0;
4270
    virtual void Close() = 0;
4271

    
4272
    virtual void SetParUnpackers();
4273

    
4274
    virtual Bool_t InitUnpackers();
4275

    
4276
    virtual Bool_t ReInitUnpackers();
4277

    
4278
    void Reset();
4279

    
4280
    virtual Source_Type GetSourceType() { return kONLINE; }
4281

    
4282
  protected:
4283
    TObjArray* fUnpackers;
4284

    
4285
  private:
4286
    FairOnlineSource& operator=(const FairOnlineSource&);
4287

    
4288
    ClassDef(FairOnlineSource, 0)
4289
};
4290

    
4291

    
4292
#endif
4293
/********************************************************************************
4294
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
4295
 *                                                                              *
4296
 *              This software is distributed under the terms of the             * 
4297
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *  
4298
 *                  copied verbatim in the file "LICENSE"                       *
4299
 ********************************************************************************/
4300
// -----------------------------------------------------------------------------
4301
// -----                                                                   -----
4302
// -----                           FairLmdSource                           -----
4303
// -----                    Created 12.04.2013 by D.Kresan                 -----
4304
// -----------------------------------------------------------------------------
4305

    
4306
#ifndef FAIRLMDSOURCE_H
4307
#define FAIRLMDSOURCE_H
4308

    
4309
extern "C"
4310
{
4311
#include "f_evt.h"
4312
#include "s_filhe_swap.h"
4313
#include "s_bufhe_swap.h"
4314
}
4315

    
4316
#include "TString.h"
4317

    
4318
#include "FairMbsSource.h"
4319

    
4320

    
4321
class TList;
4322

    
4323

    
4324
class FairLmdSource : public FairMbsSource
4325
{
4326
  public:
4327
    FairLmdSource();
4328
    FairLmdSource(const FairLmdSource& source);
4329
    virtual ~FairLmdSource();
4330

    
4331
    void AddFile(TString fileName);
4332
    void AddPath(TString dir, TString wildCard);
4333
    inline Int_t GetCurrentFile() const { return fCurrentFile; }
4334
    inline const TList* GetFileNames() const { return fFileNames; }
4335

    
4336
    virtual Bool_t Init();
4337
    virtual Int_t ReadEvent(UInt_t=0);
4338
    virtual void Close();
4339

    
4340
  protected:
4341
    Bool_t OpenNextFile(TString fileName);
4342

    
4343
    Int_t fCurrentFile;
4344
	Int_t fNEvent;
4345
	Int_t fCurrentEvent;
4346
    TList* fFileNames;
4347
    s_evt_channel* fxInputChannel;
4348
    s_ve10_1* fxEvent;
4349
    s_bufhe* fxBuffer;
4350
    Int_t* fxEventData;
4351
    s_ves10_1* fxSubEvent;
4352
	s_filhe* fxInfoHeader;
4353

    
4354
    FairLmdSource& operator=(const FairLmdSource&);
4355

    
4356
    ClassDef(FairLmdSource, 0)
4357
};
4358

    
4359

    
4360
#endif
4361
/********************************************************************************
4362
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
4363
 *                                                                              *
4364
 *              This software is distributed under the terms of the             * 
4365
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *  
4366
 *                  copied verbatim in the file "LICENSE"                       *
4367
 ********************************************************************************/
4368
// -----------------------------------------------------------------------------
4369
// -----                                                                   -----
4370
// -----                          FairRemoteSource                         -----
4371
// -----                    Created 12.04.2013 by D.Kresan                 -----
4372
// -----------------------------------------------------------------------------
4373

    
4374
#ifndef FAIRREMOTESOURCE_H
4375
#define FAIRREMOTESOURCE_H
4376

    
4377
#include "FairMbsSource.h"
4378

    
4379

    
4380
class TSocket;
4381
class MRevBuffer;
4382
class REvent;
4383

    
4384

    
4385
class FairRemoteSource : public FairMbsSource
4386
{
4387
  public:
4388
    FairRemoteSource(char* node);
4389
    FairRemoteSource(const FairRemoteSource& source);
4390
    virtual ~FairRemoteSource();
4391

    
4392
    virtual Bool_t Init();
4393
    virtual Int_t ReadEvent(UInt_t=0);
4394
    virtual void Close();
4395

    
4396
    inline const char* GetNode() const { return fNode; }
4397

    
4398
  private:
4399
    char* fNode;
4400
    TSocket* fSocket;
4401
    MRevBuffer* fBuffer;
4402
    REvent* fREvent;
4403

    
4404
    FairRemoteSource& operator=(const FairRemoteSource&);
4405
    
4406
  public:
4407
    ClassDef(FairRemoteSource, 0)
4408
};
4409

    
4410

    
4411
#endif
4412
/********************************************************************************
4413
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
4414
 *                                                                              *
4415
 *              This software is distributed under the terms of the             * 
4416
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *  
4417
 *                  copied verbatim in the file "LICENSE"                       *
4418
 ********************************************************************************/
4419
// -----------------------------------------------------------------------------
4420
// -----                                                                   -----
4421
// -----                             FairMbsSource                         -----
4422
// -----                    Created 12.04.2013 by D.Kresan                 -----
4423
// -----              Copied from FairSource 01.11.2013 by F.Uhlig         -----
4424
// -----                                                                   -----
4425
// -----------------------------------------------------------------------------
4426

    
4427
#ifndef FAIRMBSSOURCE_H
4428
#define FAIRMBSSOURCE_H
4429

    
4430
#include "FairOnlineSource.h"
4431
#include "TObjArray.h"
4432

    
4433
#include "FairUnpack.h"
4434

    
4435

    
4436
class FairMbsSource : public FairOnlineSource
4437
{
4438
  public:
4439
    FairMbsSource();
4440
    FairMbsSource(const FairMbsSource& source);
4441
    virtual ~FairMbsSource();
4442

    
4443
    virtual Bool_t Init() = 0;
4444
    virtual Int_t ReadEvent(UInt_t=0) = 0;
4445
    virtual void Close() = 0;
4446

    
4447
  protected:
4448
    Bool_t Unpack(Int_t* data, Int_t size,
4449
                  Short_t type, Short_t subType,
4450
                  Short_t procId, Short_t subCrate, Short_t control);
4451

    
4452
    ClassDef(FairMbsSource, 0)
4453
};
4454

    
4455

    
4456
#endif
4457
/********************************************************************************
4458
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
4459
 *                                                                              *
4460
 *              This software is distributed under the terms of the             * 
4461
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *  
4462
 *                  copied verbatim in the file "LICENSE"                       *
4463
 ********************************************************************************/
4464
// -----------------------------------------------------------------------------
4465
// -----                                                                   -----
4466
// -----                             FairUnpack                            -----
4467
// -----                    Created 12.04.2013 by D.Kresan                 -----
4468
// -----------------------------------------------------------------------------
4469

    
4470
#ifndef FAIRUNPACK_H
4471
#define FAIRUNPACK_H
4472

    
4473
#include "Rtypes.h"                     // for Int_t, Bool_t, etc
4474
#include "TObject.h"
4475

    
4476

    
4477
class FairUnpack : public TObject
4478
{
4479
  public:
4480
    FairUnpack(Short_t type, Short_t subType,
4481
               Short_t procId, Short_t subCrate, Short_t control);
4482
    virtual ~FairUnpack();
4483

    
4484
    virtual Bool_t Init() = 0;
4485
    virtual Bool_t ReInit() { return kTRUE; }
4486
    virtual Bool_t DoUnpack(Int_t* data, Int_t size) = 0;
4487
    virtual void   Reset() = 0;
4488
    virtual void   SetParContainers() {  };
4489

    
4490
    inline Short_t GetType()    const { return fType;     }
4491
    inline Short_t GetSubType() const { return fSubType;  }
4492
    inline Short_t GetProcId()  const { return fProcId;   }
4493
    inline Short_t GetSubCrate() const { return fSubCrate; }
4494
    inline Short_t GetControl()  const { return fControl;  }
4495

    
4496
  private:
4497
    Short_t fType;
4498
    Short_t fSubType;
4499
    Short_t fProcId;
4500
    Short_t fSubCrate;
4501
    Short_t fControl;
4502

    
4503
  protected:
4504
    virtual void Register() = 0;
4505

    
4506
  public:
4507
    ClassDef(FairUnpack, 0)
4508
};
4509

    
4510

    
4511
#endif
4512

    
4513

    
4514

    
4515
/********************************************************************************
4516
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
4517
 *                                                                              *
4518
 *              This software is distributed under the terms of the             * 
4519
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *  
4520
 *                  copied verbatim in the file "LICENSE"                       *
4521
 ********************************************************************************/
4522
//////////////////////////////////////////////////////////////////////
4523
// Copyright:
4524
//   GSI, Gesellschaft fuer Schwerionenforschung mbH
4525
//   Planckstr. 1
4526
//   D-64291 Darmstadt
4527
//   Germany
4528
// created 16. 2.1999 by Horst Goeringer
4529
//////////////////////////////////////////////////////////////////////
4530
// MRevBuffer.h
4531
//   description of class MRevBuffer
4532
//   ROOT client package for multithreaded remote event server (MBS)
4533
//////////////////////////////////////////////////////////////////////
4534
// 20. 8.1999, H.G.: MRevBuffer::RevGetI added
4535
//  6. 3.2000, H.G.: new member function RevStatus
4536
//////////////////////////////////////////////////////////////////////
4537

    
4538
#ifndef MRevBuffer_H
4539
#define MRevBuffer_H
4540

    
4541
#include "TObject.h"                    // for TObject
4542

    
4543
#include "Rtypes.h"                     // for Int_t, ClassDef, etc
4544

    
4545
class TSocket;
4546

    
4547
class REvent : public TObject
4548
{
4549
  private:
4550
    Int_t  iSize;              // event size (byte)
4551
    Int_t  iNumb;              // event number
4552
    Int_t*  piData;            // event parameter
4553

    
4554
    REvent(const REvent&);
4555
    REvent& operator=(const REvent&);
4556

    
4557
  public:
4558
    REvent();                  // constructor
4559
    ~REvent();                 // destructor
4560

    
4561
    void ReFillHead(Int_t* pHead);   // unpack and fill event header
4562
    void ReFillData(Int_t* pData);   // unpack and fill event data
4563

    
4564
    Int_t ReGetNumb();               // get event number
4565
    Int_t ReGetSize();               // get event size
4566
    Int_t ReGetData(Int_t ichan);    // get event parameter ichan
4567
    Int_t* GetData() { return piData; }
4568

    
4569
    Int_t nSubEvt;
4570
    Int_t subEvtSize[100];
4571
    Short_t subEvtType[100];
4572
    Short_t subEvtSubType[100];
4573
    Short_t subEvtProcId[100];
4574
    Short_t subEvtSubCrate[100];
4575
    Short_t subEvtControl[100];
4576
    Int_t* pSubEvt[100];
4577

    
4578
    ClassDef(REvent, 0)           // prototype for event
4579
};
4580

    
4581
//////////////////////////////////////////////////////////////////////
4582

    
4583
class MRevBuffer : public TObject
4584
{
4585
  private:
4586
    TSocket* pTSocket;     // ptr socket of channel to event server
4587
    Int_t  iSocket;        // socket id of channel to event server
4588
    Int_t  iBufNo1;        // first buffer no. received (test)
4589
    Int_t  iBufNo2;        // last buffer no. received (test)
4590
    Int_t  iDebug;         // verbosity level (test)
4591
    Int_t  iSwap;          // > 0: swap event data
4592
    Int_t  iStatus;        // current status of server
4593

    
4594
    Int_t  iBufSizeAlloc;  // allocated buffer size
4595
    Int_t  iBufSize;       // size current buffer
4596
    Int_t  iBufNo;         // current buffer no.
4597
    Int_t  iFragBegin;     // > 0: last buffer ended with fragment
4598
    Int_t  iFragConc;      // no. of concatenated fragments
4599
    Int_t  iFragBeginIgn;  // no. of ignored fragment begins
4600
    Int_t  iFragEndIgn;    // no. of ignored fragment ends
4601

    
4602
    Int_t  iHeadPar;       // no. of (4 byte) parms buffer header
4603
    Int_t  iEvtMax;        // no. of events requested
4604
    Int_t  iEvtNo;         // last event no. handled
4605
    Int_t  iEvtRel;        // rel. event no. in buffer
4606
    Int_t  iEvtBuf;        // no. of events in current buffer
4607
    Int_t  iEvtPar;        // no. of parameters in event (incl. len)
4608
    Int_t*  piBuf;         // ptr event buffer
4609
    Int_t*  piNextEvt;     // ptr first element next event
4610
    REvent* pEvt;          // ptr event class
4611

    
4612
    MRevBuffer(const MRevBuffer&);
4613
    MRevBuffer& operator=(const MRevBuffer&);
4614

    
4615
  public:
4616
    MRevBuffer( Int_t iMode); // constructor
4617
    ~MRevBuffer();            // destructor
4618

    
4619
    TSocket* RevOpen( char* pNode, Int_t iPort, Int_t iEvent);
4620
    // input: node name and port number server, req. no. of events
4621
    // returns Socket ptr of server connection
4622

    
4623
    Int_t* RevGetI( TSocket* pSocket, Int_t iFlush);
4624
    // get next event (pointer) from buffer, input:
4625
    // Socket ptr,
4626
    // iFlush = 1: skip current buffer (not impl)
4627

    
4628
    REvent* RevGet( TSocket* pSocket, Int_t iFlush, Int_t iSkip);
4629
    // get next event (pointer) from buffer, input:
4630
    // Socket ptr,
4631
    // iFlush = 1: skip current buffer (not impl)
4632
    // iSkip > 0: take only each iSkip event (not impl)
4633

    
4634
    Int_t RevStatus(Int_t iOut);
4635
    // get status information (iOut = 1: also message to stdout)
4636
    // = 0: last event request successfull
4637
    // = 1: server not yet connected
4638
    // = 2: server connected, but still no request for events
4639
    // = 3: server connection okay, but currently no DAQ events
4640
    // = 4: connection to server closed
4641
    // = 5: connection to server closed after user break (CTL C)
4642
    // = 6: connection to server closed after failure
4643

    
4644
    void RevBufWait(Int_t iWait);
4645
    // wait for iWait seconds
4646

    
4647
    Int_t RevBufsize();
4648
    // get size of current buffer (byte)
4649

    
4650
    void  RevClose( TSocket* pSocket );           // input Socket ptr
4651

    
4652
    ClassDef(MRevBuffer, 0)        // prototype for remote event buffer
4653
};
4654

    
4655
#endif     // !MRevBuffer_H 
4656
// -----------------------------------------------------------------------------
4657
// ----- FairMbsStreamSource header file                                   -----
4658
// -----                                                                   -----
4659
// ----- created by C. Simon on 2014-09-12                                 -----
4660
// -----                                                                   -----
4661
// ----- based on FairLmdSource by D. Kresan                               -----
4662
// -----                                                                   -----
4663
// ----- revision 23363, 2013-12-26                                        -----
4664
// -----------------------------------------------------------------------------
4665

    
4666
#ifndef FAIRMBSSTREAMSOURCE_H
4667
#define FAIRMBSSTREAMSOURCE_H
4668

    
4669
extern "C"
4670
{
4671
#include "f_evt.h"
4672
#include "s_filhe_swap.h"
4673
#include "s_bufhe_swap.h"
4674
}
4675

    
4676
#include "TString.h"
4677

    
4678
#include "FairMbsSource.h"
4679

    
4680
class FairMbsStreamSource : public FairMbsSource
4681
{
4682
  public:
4683
    FairMbsStreamSource(TString tServerName);
4684
    FairMbsStreamSource(const FairMbsStreamSource& source);
4685
    virtual ~FairMbsStreamSource();
4686

    
4687
    virtual Bool_t Init();
4688
    virtual Int_t ReadEvent(UInt_t=0);
4689
    virtual void Close();
4690

    
4691
    const char* GetServerName() const {return fServerName.Data();};
4692

    
4693
  private:
4694
    Bool_t ConnectToServer();
4695

    
4696
    TString fServerName;
4697

    
4698
    s_evt_channel* fxInputChannel;
4699
    s_ve10_1* fxEvent;
4700
    s_bufhe* fxBuffer;
4701
    Int_t* fxEventData;
4702
    s_ves10_1* fxSubEvent;
4703

    
4704
    FairMbsStreamSource& operator=(const FairMbsStreamSource&);
4705

    
4706

    
4707
  public:
4708
    ClassDef(FairMbsStreamSource, 0)
4709
};
4710

    
4711

    
4712
#endif
4713

    
4714
#undef  _BACKWARD_BACKWARD_WARNING_H
4715

    
4716
In file included from input_line_8:1:
4717
In file included from /home/vratik/workspace/expertroot_H5/macro/H5run/eventDisplay.C:2:
4718
In file included from /home/vratik/fair_install_root6/FairRootInst/include/FairMCTracks.h:24:
4719
/home/vratik/fair_install_root6/FairRootInst/include/FairTask.h:156:23: error: expected parameter
4720
      declarator
4721
    ClassDef(FairTask,3);
4722
                      ^
4723
/home/vratik/fair_install_root6/FairRootInst/include/FairTask.h:156:23: error: expected ')'
4724
/home/vratik/fair_install_root6/FairRootInst/include/FairTask.h:156:13: note: to match this '('
4725
    ClassDef(FairTask,3);
4726
            ^
4727
/home/vratik/fair_install_root6/FairRootInst/include/FairTask.h:156:5: error: C++ requires a type
4728
      specifier for all declarations
4729
    ClassDef(FairTask,3);
4730
    ^
4731
In file included from input_line_71:1:
4732
In file included from /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:16:
4733
/home/vratik/fair_install_root6/FairSoftInst/include/root/TEvePathMark.h:51:30: error: expected parameter
4734
      declarator
4735
   ClassDefNV(TEvePathMarkT, 1); // Template for a special point on a track: position/momentum re...
4736
                             ^
4737
/home/vratik/fair_install_root6/FairSoftInst/include/root/TEvePathMark.h:51:30: error: expected ')'
4738
/home/vratik/fair_install_root6/FairSoftInst/include/root/TEvePathMark.h:51:14: note: to match this '('
4739
   ClassDefNV(TEvePathMarkT, 1); // Template for a special point on a track: position/momentum re...
4740
             ^
4741
/home/vratik/fair_install_root6/FairSoftInst/include/root/TEvePathMark.h:51:4: error: C++ requires a type
4742
      specifier for all declarations
4743
   ClassDefNV(TEvePathMarkT, 1); // Template for a special point on a track: position/momentum re...
4744
   ^
4745
/home/vratik/fair_install_root6/FairSoftInst/include/root/TEvePathMark.h:54:33: error: typedef
4746
      redefinition with different types ('TEvePathMarkT<...>' vs 'TEvePathMarkT<...>')
4747
typedef TEvePathMarkT<Float_t>  TEvePathMark;
4748
                                ^
4749
libEve dictionary forward declarations' payload:201:32: note: previous definition is here
4750
typedef TEvePathMarkT<Float_t> TEvePathMark __attribute__((annotate("$clingAutoload$TEvePathMark.h"))) ;
4751
                               ^
4752
In file included from input_line_71:1:
4753
In file included from /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:16:
4754
/home/vratik/fair_install_root6/FairSoftInst/include/root/TEvePathMark.h:55:33: error: typedef
4755
      redefinition with different types ('TEvePathMarkT<...>' vs 'TEvePathMarkT<...>')
4756
typedef TEvePathMarkT<Float_t>  TEvePathMarkF;
4757
                                ^
4758
libEve dictionary forward declarations' payload:202:32: note: previous definition is here
4759
typedef TEvePathMarkT<Float_t> TEvePathMarkF __attribute__((annotate("$clingAutoload$TEvePathMark.h"))) ;
4760
                               ^
4761
In file included from input_line_71:1:
4762
In file included from /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:16:
4763
/home/vratik/fair_install_root6/FairSoftInst/include/root/TEvePathMark.h:56:33: error: typedef
4764
      redefinition with different types ('TEvePathMarkT<...>' vs 'TEvePathMarkT<...>')
4765
typedef TEvePathMarkT<Double_t> TEvePathMarkD;
4766
                                ^
4767
libEve dictionary forward declarations' payload:203:33: note: previous definition is here
4768
typedef TEvePathMarkT<Double_t> TEvePathMarkD __attribute__((annotate("$clingAutoload$TEvePathMar...
4769
                                ^
4770
In file included from input_line_71:1:
4771
/home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:58:27: error: expected
4772
      parameter declarator
4773
   ClassDef(TEveMagField, 0); // Abstract interface to magnetic field
4774
                          ^
4775
/home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:58:27: error: expected
4776
      ')'
4777
/home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:58:12: note: to match
4778
      this '('
4779
   ClassDef(TEveMagField, 0); // Abstract interface to magnetic field
4780
           ^
4781
/home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:58:4: error: C++ requires
4782
      a type specifier for all declarations
4783
   ClassDef(TEveMagField, 0); // Abstract interface to magnetic field
4784
   ^
4785
/home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:43:18: error: no matching
4786
      constructor for initialization of 'TEveVector' (aka 'TEveVectorT<float>')
4787
      TEveVector b = GetField(x, y, z);
4788
                 ^   ~~~~~~~~~~~~~~~~~
4789
/home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:47:75: error: no member
4790
      named 'fX' in 'TEveVectorT<double>'
4791
   TEveVectorD GetFieldD(const TEveVectorD &v) const { return GetFieldD(v.fX, v.fY, v.fZ); }
4792
                                                                        ~ ^
4793
/home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:47:81: error: no member
4794
      named 'fY' in 'TEveVectorT<double>'
4795
   TEveVectorD GetFieldD(const TEveVectorD &v) const { return GetFieldD(v.fX, v.fY, v.fZ); }
4796
                                                                              ~ ^
4797
/home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:47:87: error: no member
4798
      named 'fZ' in 'TEveVectorT<double>'
4799
   TEveVectorD GetFieldD(const TEveVectorD &v) const { return GetFieldD(v.fX, v.fY, v.fZ); }
4800
                                                                                    ~ ^
4801
/home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:52:85: error: no viable
4802
      conversion from returned value of type 'TEveVectorT<Float_t>' to function return type
4803
      'TEveVectorT<Double_t>'
4804
   virtual TEveVectorD GetFieldD(Double_t x, Double_t y, Double_t z) const { return GetField(x, y, z); }
4805
                                                                                    ^~~~~~~~~~~~~~~~~
4806
/home/vratik/fair_install_root6/FairSoftInst/include/root/TEveVector.h:39:4: note: candidate function
4807
   operator const TT*() const { return &fX; }
4808
   ^
4809
/home/vratik/fair_install_root6/FairSoftInst/include/root/TEveVector.h:40:4: note: candidate function
4810
   operator       TT*()       { return &fX; }
4811
   ^
4812
In file included from input_line_71:1:
4813
/home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:55:74: error: no matching
4814
      constructor for initialization of 'TEveVector' (aka 'TEveVectorT<float>')
4815
   virtual TEveVector GetField(Float_t, Float_t, Float_t) const { return TEveVector(); }
4816
                                                                         ^
4817
/home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:81:32: error: expected
4818
      parameter declarator
4819
   ClassDef(TEveMagFieldConst, 0); // Interface to constant magnetic field.
4820
                               ^
4821
/home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:81:32: error: expected
4822
      ')'
4823
/home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:81:12: note: to match
4824
      this '('
4825
   ClassDef(TEveMagFieldConst, 0); // Interface to constant magnetic field.
4826
           ^
4827
/home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:81:4: error: C++ requires
4828
      a type specifier for all declarations
4829
   ClassDef(TEveMagFieldConst, 0); // Interface to constant magnetic field.
4830
   ^
4831
/home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:73:23: error: no matching
4832
      constructor for initialization of 'TEveVectorD' (aka 'TEveVectorT<double>')
4833
      TEveMagField(), fB(x, y, z)
4834
                      ^  ~~~~~~~
4835
fatal error: too many errors emitted, stopping now [-ferror-limit=]
4836
In file included from input_line_8:1:
4837
In file included from /home/vratik/workspace/expertroot_H5/macro/H5run/eventDisplay.C:2:
4838
In file included from /home/vratik/fair_install_root6/FairRootInst/include/FairMCTracks.h:27:
4839
In file included from /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:16:
4840
/home/vratik/fair_install_root6/FairSoftInst/include/root/TEvePathMark.h:51:30: error: expected parameter
4841
      declarator
4842
   ClassDefNV(TEvePathMarkT, 1); // Template for a special point on a track: position/momentum re...
4843
                             ^
4844
/home/vratik/fair_install_root6/FairSoftInst/include/root/TEvePathMark.h:51:30: error: expected ')'
4845
/home/vratik/fair_install_root6/FairSoftInst/include/root/TEvePathMark.h:51:14: note: to match this '('
4846
   ClassDefNV(TEvePathMarkT, 1); // Template for a special point on a track: position/momentum re...
4847
             ^
4848
/home/vratik/fair_install_root6/FairSoftInst/include/root/TEvePathMark.h:51:4: error: C++ requires a type
4849
      specifier for all declarations
4850
   ClassDefNV(TEvePathMarkT, 1); // Template for a special point on a track: position/momentum re...
4851
   ^
4852
/home/vratik/fair_install_root6/FairSoftInst/include/root/TEvePathMark.h:54:33: error: typedef
4853
      redefinition with different types ('TEvePathMarkT<...>' vs 'TEvePathMarkT<...>')
4854
typedef TEvePathMarkT<Float_t>  TEvePathMark;
4855
                                ^
4856
libEve dictionary forward declarations' payload:201:32: note: previous definition is here
4857
typedef TEvePathMarkT<Float_t> TEvePathMark __attribute__((annotate("$clingAutoload$TEvePathMark.h"))) ;
4858
                               ^
4859
In file included from input_line_8:1:
4860
In file included from /home/vratik/workspace/expertroot_H5/macro/H5run/eventDisplay.C:2:
4861
In file included from /home/vratik/fair_install_root6/FairRootInst/include/FairMCTracks.h:27:
4862
In file included from /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:16:
4863
/home/vratik/fair_install_root6/FairSoftInst/include/root/TEvePathMark.h:55:33: error: typedef
4864
      redefinition with different types ('TEvePathMarkT<...>' vs 'TEvePathMarkT<...>')
4865
typedef TEvePathMarkT<Float_t>  TEvePathMarkF;
4866
                                ^
4867
libEve dictionary forward declarations' payload:202:32: note: previous definition is here
4868
typedef TEvePathMarkT<Float_t> TEvePathMarkF __attribute__((annotate("$clingAutoload$TEvePathMark.h"))) ;
4869
                               ^
4870
In file included from input_line_8:1:
4871
In file included from /home/vratik/workspace/expertroot_H5/macro/H5run/eventDisplay.C:2:
4872
In file included from /home/vratik/fair_install_root6/FairRootInst/include/FairMCTracks.h:27:
4873
In file included from /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:16:
4874
/home/vratik/fair_install_root6/FairSoftInst/include/root/TEvePathMark.h:56:33: error: typedef
4875
      redefinition with different types ('TEvePathMarkT<...>' vs 'TEvePathMarkT<...>')
4876
typedef TEvePathMarkT<Double_t> TEvePathMarkD;
4877
                                ^
4878
libEve dictionary forward declarations' payload:203:33: note: previous definition is here
4879
typedef TEvePathMarkT<Double_t> TEvePathMarkD __attribute__((annotate("$clingAutoload$TEvePathMar...
4880
                                ^
4881
In file included from libEve dictionary payload:35:
4882
In file included from /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveVSD.h:16:
4883
/home/vratik/fair_install_root6/FairSoftInst/include/root/TEveVSDStructs.h:56:50: error: no matching
4884
      constructor for initialization of 'TEveVector' (aka 'TEveVectorT<float>')
4885
                   fDecayed(kFALSE), fTDecay(0), fVDecay(), fPDecay() {}
4886
                                                 ^
4887
/home/vratik/fair_install_root6/FairSoftInst/include/root/TEveVSDStructs.h:56:61: error: no matching
4888
      constructor for initialization of 'TEveVector' (aka 'TEveVectorT<float>')
4889
                   fDecayed(kFALSE), fTDecay(0), fVDecay(), fPDecay() {}
4890
                                                            ^
4891
/home/vratik/fair_install_root6/FairSoftInst/include/root/TEveVSDStructs.h:90:66: error: no matching
4892
      constructor for initialization of 'TEveVector' (aka 'TEveVectorT<float>')
4893
   TEveHit() : fDetId(0), fSubdetId(0), fLabel(0), fEvaLabel(0), fV() {}
4894
                                                                 ^
4895
/home/vratik/fair_install_root6/FairSoftInst/include/root/TEveVSDStructs.h:118:45: error: no matching
4896
      constructor for initialization of 'TEveVector' (aka 'TEveVectorT<float>')
4897
   TEveCluster() : fDetId(0), fSubdetId(0), fV() { fLabel[0] = fLabel[1] = fLabel[2] = 0; }
4898
                                            ^
4899
/home/vratik/fair_install_root6/FairSoftInst/include/root/TEveVSDStructs.h:154:33: error: typedef
4900
      redefinition with different types ('TEveRecTrackT<...>' vs 'TEveRecTrackT<...>')
4901
typedef TEveRecTrackT<Float_t>  TEveRecTrack;
4902
                                ^
4903
libEve dictionary forward declarations' payload:204:32: note: previous definition is here
4904
typedef TEveRecTrackT<Float_t> TEveRecTrack __attribute__((annotate("$clingAutoload$TEveVSDStruct...
4905
                               ^
4906
In file included from libEve dictionary payload:35:
4907
In file included from /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveVSD.h:16:
4908
/home/vratik/fair_install_root6/FairSoftInst/include/root/TEveVSDStructs.h:155:33: error: typedef
4909
      redefinition with different types ('TEveRecTrackT<...>' vs 'TEveRecTrackT<...>')
4910
typedef TEveRecTrackT<Float_t>  TEveRecTrackF;
4911
                                ^
4912
libEve dictionary forward declarations' payload:205:32: note: previous definition is here
4913
typedef TEveRecTrackT<Float_t> TEveRecTrackF __attribute__((annotate("$clingAutoload$TEveVSDStruc...
4914
                               ^
4915
In file included from libEve dictionary payload:35:
4916
In file included from /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveVSD.h:16:
4917
/home/vratik/fair_install_root6/FairSoftInst/include/root/TEveVSDStructs.h:156:33: error: typedef
4918
      redefinition with different types ('TEveRecTrackT<...>' vs 'TEveRecTrackT<...>')
4919
typedef TEveRecTrackT<Double_t> TEveRecTrackD;
4920
                                ^
4921
libEve dictionary forward declarations' payload:206:33: note: previous definition is here
4922
typedef TEveRecTrackT<Double_t> TEveRecTrackD __attribute__((annotate("$clingAutoload$TEveVSDStru...
4923
                                ^
4924
In file included from libEve dictionary payload:35:
4925
In file included from /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveVSD.h:16:
4926
/home/vratik/fair_install_root6/FairSoftInst/include/root/TEveVSDStructs.h:180:20: error: no matching
4927
      constructor for initialization of 'TEveVector' (aka 'TEveVectorT<float>')
4928
   TEveRecKink() : fVKink(), fPMother(), fVMother(), fPDaughter(), fVDaughter(), fSign(0), fStatus(0)
4929
                   ^
4930
/home/vratik/fair_install_root6/FairSoftInst/include/root/TEveVSDStructs.h:180:30: error: no matching
4931
      constructor for initialization of 'TEveVector' (aka 'TEveVectorT<float>')
4932
   TEveRecKink() : fVKink(), fPMother(), fVMother(), fPDaughter(), fVDaughter(), fSign(0), fStatus(0)
4933
                             ^
4934
/home/vratik/fair_install_root6/FairSoftInst/include/root/TEveVSDStructs.h:180:42: error: no matching
4935
      constructor for initialization of 'TEveVector' (aka 'TEveVectorT<float>')
4936
   TEveRecKink() : fVKink(), fPMother(), fVMother(), fPDaughter(), fVDaughter(), fSign(0), fStatus(0)
4937
                                         ^
4938
/home/vratik/fair_install_root6/FairSoftInst/include/root/TEveVSDStructs.h:180:54: error: no matching
4939
      constructor for initialization of 'TEveVector' (aka 'TEveVectorT<float>')
4940
   TEveRecKink() : fVKink(), fPMother(), fVMother(), fPDaughter(), fVDaughter(), fSign(0), fStatus(0)
4941
                                                     ^
4942
/home/vratik/fair_install_root6/FairSoftInst/include/root/TEveVSDStructs.h:180:68: error: no matching
4943
      constructor for initialization of 'TEveVector' (aka 'TEveVectorT<float>')
4944
   TEveRecKink() : fVKink(), fPMother(), fVMother(), fPDaughter(), fVDaughter(), fSign(0), fStatus(0)
4945
                                                                   ^
4946
/home/vratik/fair_install_root6/FairSoftInst/include/root/TEveVSDStructs.h:215:29: error: no matching
4947
      constructor for initialization of 'TEveVector' (aka 'TEveVectorT<float>')
4948
   TEveRecV0() : fStatus(), fVNeg(), fPNeg(), fVPos(), fPPos(),
4949
                            ^
4950
/home/vratik/fair_install_root6/FairSoftInst/include/root/TEveVSDStructs.h:215:38: error: no matching
4951
      constructor for initialization of 'TEveVector' (aka 'TEveVectorT<float>')
4952
   TEveRecV0() : fStatus(), fVNeg(), fPNeg(), fVPos(), fPPos(),
4953
                                     ^
4954
/home/vratik/fair_install_root6/FairSoftInst/include/root/TEveVSDStructs.h:215:47: error: no matching
4955
      constructor for initialization of 'TEveVector' (aka 'TEveVectorT<float>')
4956
   TEveRecV0() : fStatus(), fVNeg(), fPNeg(), fVPos(), fPPos(),
4957
                                              ^
4958
/home/vratik/fair_install_root6/FairSoftInst/include/root/TEveVSDStructs.h:215:56: error: no matching
4959
      constructor for initialization of 'TEveVector' (aka 'TEveVectorT<float>')
4960
   TEveRecV0() : fStatus(), fVNeg(), fPNeg(), fVPos(), fPPos(),
4961
                                                       ^
4962
/home/vratik/fair_install_root6/FairSoftInst/include/root/TEveVSDStructs.h:216:18: error: no matching
4963
      constructor for initialization of 'TEveVector' (aka 'TEveVectorT<float>')
4964
                 fVCa(), fV0Birth(), fLabel(0), fPdg(0)
4965
                 ^
4966
/home/vratik/fair_install_root6/FairSoftInst/include/root/TEveVSDStructs.h:216:26: error: no matching
4967
      constructor for initialization of 'TEveVector' (aka 'TEveVectorT<float>')
4968
                 fVCa(), fV0Birth(), fLabel(0), fPdg(0)
4969
                         ^
4970
/home/vratik/fair_install_root6/FairSoftInst/include/root/TEveVSDStructs.h:244:35: error: no matching
4971
      constructor for initialization of 'TEveVector' (aka 'TEveVectorT<float>')
4972
   TEveRecCascade() : fStatus(),  fVBac(), fPBac(),
4973
                                  ^
4974
fatal error: too many errors emitted, stopping now [-ferror-limit=]
4975
Error in <TInterpreter::AutoParse>: Error parsing payload code for class TEveMagField with content:
4976

    
4977
#line 1 "libEve dictionary payload"
4978

    
4979
#ifndef G__VECTOR_HAS_CLASS_ITERATOR
4980
  #define G__VECTOR_HAS_CLASS_ITERATOR 1
4981
#endif
4982

    
4983
#define _BACKWARD_BACKWARD_WARNING_H
4984
#include "TEveBrowser.h"
4985
#include "TEveChunkManager.h"
4986
#include "TEveCompound.h"
4987
#include "TEveElement.h"
4988
#include "TEveElementEditor.h"
4989
#include "TEveEventManager.h"
4990
#include "TEveGValuators.h"
4991
#include "TEveGedEditor.h"
4992
#include "TEveMacro.h"
4993
#include "TEveManager.h"
4994
#include "TEvePad.h"
4995
#include "TEveParamList.h"
4996
#include "TEveProjectionAxes.h"
4997
#include "TEveProjectionAxesEditor.h"
4998
#include "TEveProjectionAxesGL.h"
4999
#include "TEveProjectionBases.h"
5000
#include "TEveProjectionManager.h"
5001
#include "TEveProjectionManagerEditor.h"
5002
#include "TEveProjections.h"
5003
#include "TEveScene.h"
5004
#include "TEveSceneInfo.h"
5005
#include "TEveSelection.h"
5006
#include "TEveTrans.h"
5007
#include "TEveTransEditor.h"
5008
#include "TEveTreeTools.h"
5009
#include "TEveUtil.h"
5010
#include "TEveVector.h"
5011
#include "TEvePathMark.h"
5012
#include "TEveVSD.h"
5013
#include "TEveViewer.h"
5014
#include "TEveViewerListEditor.h"
5015
#include "TEveWindow.h"
5016
#include "TEveWindowEditor.h"
5017
#include "TEveWindowManager.h"
5018
#include "TEveSecondarySelectable.h"
5019
#include "TEveArrow.h"
5020
#include "TEveArrowEditor.h"
5021
#include "TEveArrowGL.h"
5022
#include "TEveBox.h"
5023
#include "TEveBoxGL.h"
5024
#include "TEveBoxSet.h"
5025
#include "TEveBoxSetGL.h"
5026
#include "TEveCalo.h"
5027
#include "TEveCalo2DGL.h"
5028
#include "TEveCalo3DGL.h"
5029
#include "TEveCaloData.h"
5030
#include "TEveCaloLegoEditor.h"
5031
#include "TEveCaloLegoGL.h"
5032
#include "TEveCaloLegoOverlay.h"
5033
#include "TEveCaloVizEditor.h"
5034
#include "TEveDigitSet.h"
5035
#include "TEveDigitSetEditor.h"
5036
#include "TEveDigitSetGL.h"
5037
#include "TEveFrameBox.h"
5038
#include "TEveFrameBoxGL.h"
5039
#include "TEveGeoNode.h"
5040
#include "TEveGeoNodeEditor.h"
5041
#include "TEveGeoPolyShape.h"
5042
#include "TEveGeoShape.h"
5043
#include "TEveGeoShapeExtract.h"
5044
#include "TEveGridStepper.h"
5045
#include "TEveGridStepperEditor.h"
5046
#include "TEveLegoEventHandler.h"
5047
#include "TEveShape.h"
5048
#include "TEveShapeEditor.h"
5049
#include "TEveLine.h"
5050
#include "TEveLineEditor.h"
5051
#include "TEveLineGL.h"
5052
#include "TEvePointSet.h"
5053
#include "TEvePointSetArrayEditor.h"
5054
#include "TEvePolygonSetProjected.h"
5055
#include "TEvePolygonSetProjectedGL.h"
5056
#include "TEveQuadSet.h"
5057
#include "TEveQuadSetGL.h"
5058
#include "TEveRGBAPalette.h"
5059
#include "TEveRGBAPaletteEditor.h"
5060
#include "TEveRGBAPaletteOverlay.h"
5061
#include "TEveScalableStraightLineSet.h"
5062
#include "TEveStraightLineSet.h"
5063
#include "TEveStraightLineSetEditor.h"
5064
#include "TEveStraightLineSetGL.h"
5065
#include "TEveText.h"
5066
#include "TEveTextEditor.h"
5067
#include "TEveTextGL.h"
5068
#include "TEveTrack.h"
5069
#include "TEveTrackEditor.h"
5070
#include "TEveTrackGL.h"
5071
#include "TEveTrackProjected.h"
5072
#include "TEveTrackProjectedGL.h"
5073
#include "TEveTrackPropagator.h"
5074
#include "TEveTrackPropagatorEditor.h"
5075
#include "TEveTriangleSet.h"
5076
#include "TEveTriangleSetEditor.h"
5077
#include "TEveTriangleSetGL.h"
5078
#include "TEveJetCone.h"
5079
#include "TEveJetConeEditor.h"
5080
#include "TEveJetConeGL.h"
5081
#include "TEvePlot3D.h"
5082
#include "TEvePlot3DGL.h"
5083

    
5084
#undef  _BACKWARD_BACKWARD_WARNING_H
5085

    
5086
In file included from input_line_8:1:
5087
In file included from /home/vratik/workspace/expertroot_H5/macro/H5run/eventDisplay.C:2:
5088
In file included from /home/vratik/fair_install_root6/FairRootInst/include/FairMCTracks.h:27:
5089
/home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:58:27: error: expected
5090
      parameter declarator
5091
   ClassDef(TEveMagField, 0); // Abstract interface to magnetic field
5092
                          ^
5093
/home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:58:27: error: expected
5094
      ')'
5095
/home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:58:12: note: to match
5096
      this '('
5097
   ClassDef(TEveMagField, 0); // Abstract interface to magnetic field
5098
           ^
5099
/home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:58:4: error: C++ requires
5100
      a type specifier for all declarations
5101
   ClassDef(TEveMagField, 0); // Abstract interface to magnetic field
5102
   ^
5103
/home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:43:18: error: no matching
5104
      constructor for initialization of 'TEveVector' (aka 'TEveVectorT<float>')
5105
      TEveVector b = GetField(x, y, z);
5106
                 ^   ~~~~~~~~~~~~~~~~~
5107
/home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:47:75: error: no member
5108
      named 'fX' in 'TEveVectorT<double>'
5109
   TEveVectorD GetFieldD(const TEveVectorD &v) const { return GetFieldD(v.fX, v.fY, v.fZ); }
5110
                                                                        ~ ^
5111
/home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:47:81: error: no member
5112
      named 'fY' in 'TEveVectorT<double>'
5113
   TEveVectorD GetFieldD(const TEveVectorD &v) const { return GetFieldD(v.fX, v.fY, v.fZ); }
5114
                                                                              ~ ^
5115
/home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:47:87: error: no member
5116
      named 'fZ' in 'TEveVectorT<double>'
5117
   TEveVectorD GetFieldD(const TEveVectorD &v) const { return GetFieldD(v.fX, v.fY, v.fZ); }
5118
                                                                                    ~ ^
5119
/home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:52:85: error: no viable
5120
      conversion from returned value of type 'TEveVectorT<Float_t>' to function return type
5121
      'TEveVectorT<Double_t>'
5122
   virtual TEveVectorD GetFieldD(Double_t x, Double_t y, Double_t z) const { return GetField(x, y, z); }
5123
                                                                                    ^~~~~~~~~~~~~~~~~
5124
/home/vratik/fair_install_root6/FairSoftInst/include/root/TEveVector.h:39:4: note: candidate function
5125
   operator const TT*() const { return &fX; }
5126
   ^
5127
/home/vratik/fair_install_root6/FairSoftInst/include/root/TEveVector.h:40:4: note: candidate function
5128
   operator       TT*()       { return &fX; }
5129
   ^
5130
In file included from input_line_8:1:
5131
In file included from /home/vratik/workspace/expertroot_H5/macro/H5run/eventDisplay.C:2:
5132
In file included from /home/vratik/fair_install_root6/FairRootInst/include/FairMCTracks.h:27:
5133
/home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:55:74: error: no matching
5134
      constructor for initialization of 'TEveVector' (aka 'TEveVectorT<float>')
5135
   virtual TEveVector GetField(Float_t, Float_t, Float_t) const { return TEveVector(); }
5136
                                                                         ^
5137
/home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:81:32: error: expected
5138
      parameter declarator
5139
   ClassDef(TEveMagFieldConst, 0); // Interface to constant magnetic field.
5140
                               ^
5141
/home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:81:32: error: expected
5142
      ')'
5143
/home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:81:12: note: to match
5144
      this '('
5145
   ClassDef(TEveMagFieldConst, 0); // Interface to constant magnetic field.
5146
           ^
5147
/home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:81:4: error: C++ requires
5148
      a type specifier for all declarations
5149
   ClassDef(TEveMagFieldConst, 0); // Interface to constant magnetic field.
5150
   ^
5151
/home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:73:23: error: no matching
5152
      constructor for initialization of 'TEveVectorD' (aka 'TEveVectorT<double>')
5153
      TEveMagField(), fB(x, y, z)
5154
                      ^  ~~~~~~~
5155
/home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:78:97: error: no matching
5156
      constructor for initialization of 'TEveVectorD' (aka 'TEveVectorT<double>')
5157
   virtual TEveVectorD GetFieldD(Double_t /*x*/, Double_t /*y*/, Double_t /*z*/) const { return fB; }
5158
                                                                                                ^~
5159
/home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:79:57: error: no member
5160
      named 'Mag' in 'TEveVectorT<double>'
5161
   virtual Double_t GetMaxFieldMagD() const { return fB.Mag(); };
5162
                                                     ~~ ^
5163
/home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:112:30: error: expected
5164
      parameter declarator
5165
   ClassDef(TEveMagFieldDuo, 0); // Interface to magnetic field with two different values dependi...
5166
                             ^
5167
/home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:112:30: error: expected
5168
      ')'
5169
/home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:112:12: note: to match
5170
      this '('
5171
   ClassDef(TEveMagFieldDuo, 0); // Interface to magnetic field with two different values dependi...
5172
           ^
5173
/home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:112:4: error: C++
5174
      requires a type specifier for all declarations
5175
   ClassDef(TEveMagFieldDuo, 0); // Interface to magnetic field with two different values dependi...
5176
   ^
5177
/home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:99:7: error: no matching
5178
      constructor for initialization of 'TEveVectorD' (aka 'TEveVectorT<double>')
5179
      fBIn(0,0,bIn), fBOut(0,0,bOut), fR2(r*r)
5180
      ^    ~~~~~~~
5181
fatal error: too many errors emitted, stopping now [-ferror-limit=]
5182
Warning in <TInterpreter::TCling::RegisterModule>: Problems in compiling forward declarations for module G__EventDisplayDict: '
5183
#line 1 "G__EventDisplayDict dictionary forward declarations' payload"
5184
#pragma clang diagnostic ignored "-Wkeyword-compat"
5185
#pragma clang diagnostic ignored "-Wignored-attributes"
5186
#pragma clang diagnostic ignored "-Wreturn-type-c-linkage"
5187
extern int __Cling_Autoloading_Map;
5188
class FairEventManager;
5189
class FairMCTracks;
5190
class __attribute__((annotate(R"ATTRDUMP(Specialization of TGedEditor for proper update propagation to TEveManager.)ATTRDUMP"))) __attribute__((annotate(R"ATTRDUMP(Specialization of TGedEditor for proper update propagation to TEveManager.)ATTRDUMP"))) FairEventManagerEditor;
5191
class __attribute__((annotate(R"ATTRDUMP(Specialization of TGedEditor for proper update propagation to TEveManager.)ATTRDUMP"))) __attribute__((annotate(R"ATTRDUMP(Specialization of TGedEditor for proper update propagation to TEveManager.)ATTRDUMP"))) FairMCTracksEditor;
5192
class __attribute__((annotate("$clingAutoload$FairBoxSetDraw.h")))  FairBoxSetDraw;
5193
class FairBoxSet;
5194
class FairBoxSetEditor;
5195
class FairPointSetDraw;
5196
class FairMCPointDraw;
5197
class FairHitDraw;
5198
class FairHitPointSetDraw;
5199
class FairTimeStampPointDraw;
5200
'
5201
Error in <TInterpreter::AutoParse>: Error parsing payload code for class FairMCTracks with content:
5202

    
5203
#line 1 "G__EventDisplayDict dictionary payload"
5204

    
5205
#ifndef G__VECTOR_HAS_CLASS_ITERATOR
5206
  #define G__VECTOR_HAS_CLASS_ITERATOR 1
5207
#endif
5208

    
5209
#define _BACKWARD_BACKWARD_WARNING_H
5210
/********************************************************************************
5211
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
5212
 *                                                                              *
5213
 *              This software is distributed under the terms of the             * 
5214
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *  
5215
 *                  copied verbatim in the file "LICENSE"                       *
5216
 ********************************************************************************/
5217
/**
5218
* class for event management and navigation.
5219
* 06.12.07 M.Al-Turany
5220
*/
5221
#ifndef FairEventManager_H
5222
#define FairEventManager_H
5223

    
5224
#include "TEveEventManager.h"           // for TEveEventManager
5225

    
5226
#include "FairRunAna.h"                 // for FairRunAna
5227

    
5228
#include "Rtypes.h"                     // for Float_t, Int_t, Bool_t, etc
5229
#include "TEveViewer.h"
5230
#include "TEveScene.h"
5231
#include "TEveProjectionAxes.h"
5232
#include "TEveProjectionManager.h"
5233

    
5234
class FairRootManager; //does not work with streamer, reason unclear
5235
class FairTask;
5236
class TGListTreeItem;
5237

    
5238
class FairEventManager : public TEveEventManager
5239
{
5240
  public:
5241
    static FairEventManager* Instance();
5242
    FairEventManager();
5243
    virtual ~FairEventManager();
5244
    virtual void Open();
5245
    virtual void GotoEvent(Int_t event); // *MENU*
5246
    virtual void NextEvent();   // *MENU*
5247
    virtual void PrevEvent();   // *MENU*
5248
    virtual void Close();
5249
    virtual void DisplaySettings();       //  *Menu*
5250
    virtual Int_t Color(Int_t pdg);
5251
    void AddTask(FairTask* t) {fRunAna->AddTask(t);}
5252
    virtual void Init( Int_t visopt = 1, Int_t vislvl = 3, Int_t maxvisnds = 10000);
5253
    virtual Int_t GetCurrentEvent() {return fEntry;}
5254
    virtual void SetPriOnly(Bool_t Pri) {fPriOnly=Pri;}
5255
    virtual Bool_t IsPriOnly() {return fPriOnly;}
5256
    virtual void SelectPDG(Int_t PDG) {fCurrentPDG= PDG;}
5257
    virtual Int_t GetCurrentPDG() {return fCurrentPDG;}
5258
    virtual void SetMaxEnergy( Float_t max) {fMaxEnergy = max;}
5259
    virtual void SetMinEnergy( Float_t min) {fMinEnergy = min;}
5260
    virtual void SetEvtMaxEnergy( Float_t max) {fEvtMaxEnergy = max;}
5261
    virtual void SetEvtMinEnergy( Float_t min) {fEvtMinEnergy = min;}
5262
    virtual Float_t GetEvtMaxEnergy() {return fEvtMaxEnergy ;}
5263
    virtual Float_t GetEvtMinEnergy() {return fEvtMinEnergy ;}
5264
    virtual Float_t GetMaxEnergy() {return fMaxEnergy;}
5265
    virtual Float_t GetMinEnergy() {return fMinEnergy;}
5266
    virtual void SetRPhiPlane(Double_t a, Double_t b, Double_t c, Double_t d);
5267
    virtual void SetRhoZPlane(Double_t a, Double_t b, Double_t c, Double_t d);
5268
    void UpdateEditor();
5269
    virtual void AddParticlesToPdgDataBase(Int_t pdg=0);
5270
    ClassDef(FairEventManager,1);
5271
  protected:
5272
    TEveViewer* GetRPhiView() const {return fRPhiView;};
5273
    TEveViewer *GetRhoZView() const {return fRhoZView;};
5274
    TEveViewer *GetMultiView() const {return fMultiView;};
5275
    TEveViewer *GetMultiRPhiView() const { return fMultiRPhiView;};
5276
    TEveViewer *GetMultiRhoZView() const {return fMultiRhoZView;};
5277
    TEveScene* GetRhoZScene() const {return fRhoZScene;};
5278
    TEveScene* GetRPhiScene() const {return fRPhiScene;};
5279
    TEveProjectionManager* GetRhoZProjManager() const {return fRhoZProjManager;};
5280
    TEveProjectionManager* GetRPhiProjManager() const {return fRPhiProjManager;};
5281
    TEveProjectionAxes *GetRPhiAxes() const { return fAxesPhi;};
5282
    TEveProjectionAxes *GetRhoZAxes() const {return fAxesRho;};
5283
  private:
5284
    FairRootManager* fRootManager; //!
5285
    Int_t fEntry;                 //!
5286
    FairRunAna* fRunAna;          //!
5287
    TGListTreeItem*  fEvent;     //!
5288
    Bool_t fPriOnly;             //!
5289
    Int_t fCurrentPDG;           //!
5290
    Float_t fMinEnergy;         //!
5291
    Float_t fMaxEnergy;         //!
5292
    Float_t fEvtMinEnergy;         //!
5293
    Float_t fEvtMaxEnergy;         //!
5294
    Double_t fRPhiPlane[4];			//!
5295
    Double_t fRhoZPlane[4];	//!
5296
    TEveViewer *fRPhiView;	//!
5297
    TEveViewer *fRhoZView;	//!
5298
    TEveViewer *fMultiView;	//!
5299
    TEveViewer *fMultiRPhiView;	//!
5300
    TEveViewer *fMultiRhoZView;	//!
5301
    TEveScene *fRPhiScene; //!
5302
    TEveScene *fRhoZScene;//!
5303
    TEveProjectionManager *fRPhiProjManager;	//!
5304
    TEveProjectionManager *fRhoZProjManager;	//!
5305
    TEveProjectionAxes *fAxesPhi;
5306
    TEveProjectionAxes *fAxesRho;
5307

    
5308
    static FairEventManager*    fgRinstance; //!
5309
    FairEventManager(const FairEventManager&);
5310
    FairEventManager& operator=(const FairEventManager&);
5311
    void SetViewers(TEveViewer *RPhi, TEveViewer *RhoZ);
5312
};
5313

    
5314
#endif
5315
/********************************************************************************
5316
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
5317
 *                                                                              *
5318
 *              This software is distributed under the terms of the             * 
5319
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *  
5320
 *                  copied verbatim in the file "LICENSE"                       *
5321
 ********************************************************************************/
5322
// -------------------------------------------------------------------------
5323
// -----                      FairMCTracks header file                 -----
5324
// -----                Created 10/12/07  by M. Al-Turany              -----
5325
// -------------------------------------------------------------------------
5326

    
5327

    
5328
/** FairMCTracks
5329
 * @author M. Al-Turany
5330
 * @since 10.12.07
5331
 *   MVD event display object
5332
 **
5333
 **/
5334

    
5335
#ifndef FAIRMCTRACKS_H
5336
#define FAIRMCTRACKS_H
5337

    
5338
#include "FairTask.h"                   // for FairTask, InitStatus
5339

    
5340
#include "Rtypes.h"                     // for Double_t, etc
5341
#include "TEveTrackPropagator.h"        // IWYU pragma: keep needed by cint
5342
#include "TString.h"                    // for TString
5343

    
5344
class FairEventManager;
5345
class TClonesArray;
5346
class TEveTrackList;
5347
class TObjArray;
5348
class TParticle;
5349

    
5350
class FairMCTracks : public FairTask
5351
{
5352

    
5353
  public:
5354

    
5355
    /** Default constructor **/
5356
    FairMCTracks();
5357

    
5358

    
5359
    /** Standard constructor
5360
    *@param name        Name of task
5361
    *@param iVerbose    Verbosity level
5362
    **/
5363
    FairMCTracks(const char* name, Int_t iVerbose = 1);
5364

    
5365
    /** Destructor **/
5366
    virtual ~FairMCTracks();
5367

    
5368
    /** Set verbosity level. For this task and all of the subtasks. **/
5369
    void SetVerbose(Int_t iVerbose) {fVerbose = iVerbose;}
5370
    /** Executed task **/
5371
    virtual void Exec(Option_t* option);
5372
    virtual InitStatus Init();
5373
    virtual void SetParContainers();
5374

    
5375
    /** Action after each event**/
5376
    virtual void Finish();
5377
    void Reset();
5378
    TEveTrackList* GetTrGroup(TParticle* P);
5379

    
5380
  protected:
5381

    
5382

    
5383
    TClonesArray*  fTrackList;  //!
5384
    TEveTrackPropagator* fTrPr;
5385
    FairEventManager* fEventManager;  //!
5386
    TObjArray* fEveTrList;
5387
    TString fEvent; //!
5388
    TEveTrackList* fTrList;  //!
5389
    //TEveElementList *fTrackCont;
5390

    
5391
    Double_t MinEnergyLimit;
5392
    Double_t MaxEnergyLimit;
5393
    Double_t PEnergy;
5394

    
5395
  private:
5396
    FairMCTracks(const FairMCTracks&);
5397
    FairMCTracks& operator=(const FairMCTracks&);
5398

    
5399
    ClassDef(FairMCTracks,1);
5400

    
5401
};
5402

    
5403

    
5404
#endif
5405
/********************************************************************************
5406
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
5407
 *                                                                              *
5408
 *              This software is distributed under the terms of the             * 
5409
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *  
5410
 *                  copied verbatim in the file "LICENSE"                       *
5411
 ********************************************************************************/
5412
// -------------------------------------------------------------------------
5413
// -----                       FairEventManagerEditor                  -----
5414
// -----                  Created 16/12/07  by M. Al-Turany            -----
5415
// -------------------------------------------------------------------------
5416
#ifndef ROOT_FAIREVENTMANAGEREDITOR
5417
#define ROOT_FAIREVENTMANAGEREDITOR
5418

    
5419
#include "TGedFrame.h"                  // for TGedFrame
5420

    
5421
#include "GuiTypes.h"                   // for Pixel_t
5422
#include "Rtypes.h"                     // for ClassDef
5423
#include "TGFrame.h"                    // for EFrameType::kChildFrame
5424

    
5425
class FairEventManager;
5426
class TEveGValuator;
5427
class TGCheckButton;
5428
class TGLabel;
5429
class TGNumberEntry;
5430
class TGWindow;
5431
class TObject;
5432

    
5433
class FairEventManagerEditor : public TGedFrame
5434
{
5435
    FairEventManagerEditor(const FairEventManagerEditor&);            // Not implemented
5436
    FairEventManagerEditor& operator=(const FairEventManagerEditor&); // Not implemented
5437

    
5438
  protected:
5439
    TObject* fObject;
5440
    FairEventManager*  fManager;
5441
    TGNumberEntry*  fCurrentEvent, *fCurrentPDG;
5442
    TGCheckButton*  fVizPri;
5443
    TEveGValuator* fMinEnergy ,*fMaxEnergy;
5444
    TGLabel* fEventTime;
5445
  public:
5446
    FairEventManagerEditor(const TGWindow* p=0, Int_t width=170, Int_t height=30,
5447
                           UInt_t options = kChildFrame, Pixel_t back=GetDefaultFrameBackground());
5448
    virtual ~FairEventManagerEditor() {}
5449
    void SetModel( TObject* obj);
5450
    virtual void SelectEvent();
5451
    virtual void SelectPDG();
5452
    void DoVizPri();
5453
    virtual void MaxEnergy();
5454
    virtual void MinEnergy();
5455
    virtual void Init();
5456

    
5457
    ClassDef(FairEventManagerEditor, 0); // Specialization of TGedEditor for proper update propagation to TEveManager.
5458
};
5459

    
5460
#endif
5461
/********************************************************************************
5462
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
5463
 *                                                                              *
5464
 *              This software is distributed under the terms of the             * 
5465
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *  
5466
 *                  copied verbatim in the file "LICENSE"                       *
5467
 ********************************************************************************/
5468
#ifndef ROOT_FAIREMCTRACKSEDITOR
5469
#define ROOT_FAIREMCTRACKSEDITOR
5470

    
5471
#include "TGedFrame.h"                  // for TGedFrame
5472

    
5473
#include "GuiTypes.h"                   // for Pixel_t
5474
#include "Rtypes.h"                     // for FairMCTracksEditor::Class, etc
5475
#include "TGFrame.h"                    // for EFrameType::kChildFrame
5476

    
5477
class FairEventManager;
5478
class TGWindow;
5479
class TObject;
5480

    
5481
class FairMCTracksEditor : public TGedFrame
5482
{
5483
    FairMCTracksEditor(const FairMCTracksEditor&);            // Not implemented
5484
    FairMCTracksEditor& operator=(const FairMCTracksEditor&); // Not implemented
5485

    
5486
  protected:
5487
    TObject* fObject;
5488
    FairEventManager*  fManager;
5489
  public:
5490
    FairMCTracksEditor(const TGWindow* p=0, Int_t width=170, Int_t height=30,
5491
                       UInt_t options = kChildFrame, Pixel_t back=GetDefaultFrameBackground());
5492
    virtual ~FairMCTracksEditor() {}
5493

    
5494
    virtual void SetModel( TObject* obj);
5495

    
5496

    
5497
    ClassDef(FairMCTracksEditor, 0); // Specialization of TGedEditor for proper update propagation to TEveManager.
5498
};
5499

    
5500
#endif
5501
/********************************************************************************
5502
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
5503
 *                                                                              *
5504
 *              This software is distributed under the terms of the             * 
5505
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *  
5506
 *                  copied verbatim in the file "LICENSE"                       *
5507
 ********************************************************************************/
5508
// -------------------------------------------------------------------------
5509
// -----              FairBoxSet header file                       -----
5510
// -----          Created 26/03/09  by T. Stockmanns                   -----
5511
// -------------------------------------------------------------------------
5512

    
5513

    
5514
/** FairBoxSet
5515
 * @author T. Stockmanns
5516
 * @since 26.3.2009
5517
 *   Base class to display 3D Points in Eve as a BoxSet
5518
 *   One has to overwrite the method GetVector which takes a TObject and writes out a TVector3 which is then taken as an input
5519
 *   to place the points.
5520
 *   If one wants to change the color of the points one has to overwrite the method GetValue. This method takes a TObject and
5521
 *   an integer and translates this into an integer as input for the EveBoxSet method DigitValue
5522
 **
5523
 **/
5524

    
5525
#ifndef FAIRBOXSET_H
5526
#define FAIRBOXSET_H
5527

    
5528
#include "TEveBoxSet.h"                 // for TEveBoxSet
5529

    
5530
#include "FairBoxSetDraw.h"             // for FairBoxSetDraw
5531

    
5532
#include "Rtypes.h"                     // for Double_t, FairBoxSet::Class, etc
5533

    
5534

    
5535
class FairBoxSet : public TEveBoxSet
5536
{
5537

    
5538
  public:
5539

    
5540
    /** Standard constructor
5541
       **/
5542
    FairBoxSet(FairBoxSetDraw* drawer, const char* name = "FairBoxSet", const char* t = "");
5543

    
5544
    void SetTimeWindowPlus(Double_t time) {fDraw->SetTimeWindowPlus(time);}
5545
    void SetTimeWindowMinus(Double_t time) {fDraw->SetTimeWindowMinus(time);}
5546

    
5547
    Double_t GetTimeWindowPlus() {return fDraw->GetTimeWindowPlus();}
5548
    Double_t GetTimeWindowMinus() {return fDraw->GetTimeWindowMinus();}
5549

    
5550

    
5551
    /** Destructor **/
5552
    virtual ~FairBoxSet() {};
5553

    
5554

    
5555

    
5556
  protected:
5557

    
5558
  private:
5559
    FairBoxSetDraw* fDraw;
5560

    
5561
    FairBoxSet(const FairBoxSet&);
5562
    FairBoxSet operator=(const FairBoxSet&);
5563

    
5564
    ClassDef(FairBoxSet,1);
5565

    
5566
};
5567

    
5568

    
5569
#endif
5570
/********************************************************************************
5571
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
5572
 *                                                                              *
5573
 *              This software is distributed under the terms of the             * 
5574
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *  
5575
 *                  copied verbatim in the file "LICENSE"                       *
5576
 ********************************************************************************/
5577
// -------------------------------------------------------------------------
5578
// -----              FairBoxSetDraw header file                       -----
5579
// -----          Created 26/03/09  by T. Stockmanns                   -----
5580
// -------------------------------------------------------------------------
5581

    
5582

    
5583
/** FairBoxSetDraw
5584
 * @author T. Stockmanns
5585
 * @since 26.3.2009
5586
 *   Base class to display 3D Points in Eve as a BoxSet
5587
 *   One has to overwrite the method GetVector which takes a TObject and writes out a TVector3 which is then taken as an input
5588
 *   to place the points.
5589
 *   If one wants to change the color of the points one has to overwrite the method GetValue. This method takes a TObject and
5590
 *   an integer and translates this into an integer as input for the EveBoxSet method DigitValue
5591
 **
5592
 **/
5593

    
5594
#ifndef FAIRBOXSETDRAW_H
5595
#define FAIRBOXSETDRAW_H
5596

    
5597
#include "FairTask.h"                   // for FairTask, InitStatus
5598

    
5599
#include "FairTSBufferFunctional.h"     // IWYU pragma: keep needed for cint
5600

    
5601
#include "Rtypes.h"                     // for Double_t, Int_t, Bool_t, etc
5602

    
5603
class FairBoxSet;
5604
class TObject;
5605
class TVector3;
5606
class TClonesArray;
5607
class FairEventManager;
5608
class FairRootManager;
5609

    
5610
class FairBoxSetDraw : public FairTask
5611
{
5612

    
5613
  public:
5614

    
5615
    /** Default constructor **/
5616
    FairBoxSetDraw();
5617

    
5618

    
5619
    /** Standard constructor
5620
    *@param name        Name of task
5621
    *@param iVerbose    Verbosity level
5622
    **/
5623
    FairBoxSetDraw(const char* name, Int_t iVerbose = 1);
5624

    
5625
    /** Destructor **/
5626
    virtual ~FairBoxSetDraw();
5627

    
5628
    virtual Double_t GetTimeWindowPlus() {return fTimeWindowPlus;}
5629
    virtual Double_t GetTimeWindowMinus() {return fTimeWindowMinus;}
5630

    
5631
    /** Set verbosity level. For this task and all of the subtasks. **/
5632
    virtual void SetVerbose(Int_t iVerbose) {fVerbose = iVerbose;};
5633
    virtual void SetBoxDimensions(Double_t x, Double_t y, Double_t z) {
5634
      fX = x;
5635
      fY = y;
5636
      fZ = z;
5637
    }
5638

    
5639
    virtual void SetTimeWindowMinus(Double_t val);
5640
    virtual void SetTimeWindowPlus(Double_t val);
5641
    virtual void SetStartTime(Double_t val) {fStartTime = val;}
5642
    virtual void UseEventTimeAsStartTime(Bool_t val = kTRUE) {fUseEventTime = val;}
5643

    
5644
    /** Executed task **/
5645
    virtual void Exec(Option_t* option);
5646

    
5647
    FairBoxSet* CreateBoxSet();
5648

    
5649
    void Reset();
5650

    
5651
  protected:
5652

    
5653
    Int_t   fVerbose;       //  Verbosity level
5654
    virtual void SetParContainers() ;
5655
    virtual InitStatus Init();
5656
    /** Action after each event**/
5657
    virtual void Finish();
5658

    
5659
    virtual TVector3 GetVector(TObject* obj) = 0;
5660
    virtual Int_t GetValue(TObject* obj,Int_t i);
5661
    virtual void AddBoxes(FairBoxSet* set, TObject* obj, Int_t i = 0);
5662

    
5663
    TClonesArray* fList; //!
5664
    FairEventManager* fEventManager;   //!
5665
    FairRootManager* fManager;
5666
    FairBoxSet* fq;    //!
5667
    Double_t fX, fY, fZ;
5668

    
5669
    Double_t fTimeWindowPlus;
5670
    Double_t fTimeWindowMinus;
5671
    Double_t fStartTime;
5672
    Bool_t fUseEventTime;
5673

    
5674

    
5675
  private:
5676
    FairBoxSetDraw(const FairBoxSetDraw&);
5677
    FairBoxSetDraw& operator=(const FairBoxSetDraw&);
5678
    BinaryFunctor* fStartFunctor;
5679
    BinaryFunctor* fStopFunctor;
5680

    
5681
    ClassDef(FairBoxSetDraw,1);
5682

    
5683
};
5684

    
5685

    
5686
#endif
5687
/********************************************************************************
5688
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
5689
 *                                                                              *
5690
 *              This software is distributed under the terms of the             * 
5691
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *  
5692
 *                  copied verbatim in the file "LICENSE"                       *
5693
 ********************************************************************************/
5694
// -------------------------------------------------------------------------
5695
// -----              FairBoxSetEditor header file                       -----
5696
// -----          Created 26/03/09  by T. Stockmanns                   -----
5697
// -------------------------------------------------------------------------
5698

    
5699

    
5700
/** FairBoxSetEditor
5701
 * @author T. Stockmanns
5702
 * @since 26.3.2009
5703
 *   Base class to display 3D Points in Eve as a BoxSet
5704
 *   One has to overwrite the method GetVector which takes a TObject and writes out a TVector3 which is then taken as an input
5705
 *   to place the points.
5706
 *   If one wants to change the color of the points one has to overwrite the method GetValue. This method takes a TObject and
5707
 *   an integer and translates this into an integer as input for the EveBoxSet method DigitValue
5708
 **
5709
 **/
5710

    
5711
#ifndef FairBoxSetEditor_H
5712
#define FairBoxSetEditor_H
5713

    
5714
#include "TGedFrame.h"                  // for TGedFrame
5715

    
5716
#include "FairBoxSet.h"                 // for FairBoxSet
5717

    
5718
#include "GuiTypes.h"                   // for Pixel_t
5719
#include "Rtypes.h"                     // for FairBoxSetEditor::Class, etc
5720
#include "TGFrame.h"                    // for EFrameType::kChildFrame, etc
5721
#include "TGNumberEntry.h"              // for TGNumberEntry
5722
#include "TObject.h"                    // for TObject
5723

    
5724
class TGWindow;
5725

    
5726
class FairBoxSetEditor : public TGedFrame
5727
{
5728

    
5729
  public:
5730

    
5731
    FairBoxSetEditor(const TGWindow* p=0, Int_t width=170, Int_t height=30,
5732
                     UInt_t options = kChildFrame, Pixel_t back=GetDefaultFrameBackground());
5733
    virtual ~FairBoxSetEditor() {};
5734

    
5735
    virtual void Init();
5736

    
5737
    virtual void SetModel(TObject* obj) {
5738
      fM = dynamic_cast<FairBoxSet*>(obj);
5739
      if (fM) {
5740
        fTimeWindowPlus->SetNumber(fM->GetTimeWindowPlus());
5741
        fTimeWindowMinus->SetNumber(fM->GetTimeWindowMinus());
5742
      }
5743
    }
5744

    
5745
    virtual void TimeWindow();
5746

    
5747
    TGVerticalFrame* fInfoFrame;
5748
    TGNumberEntry* fTimeWindowPlus;
5749
    TGNumberEntry* fTimeWindowMinus;
5750

    
5751

    
5752
  protected:
5753
    TObject* fObject;
5754
    FairBoxSet* fM;
5755

    
5756

    
5757

    
5758
  private:
5759
    FairBoxSetEditor(const FairBoxSetEditor&);
5760
    FairBoxSetEditor& operator=(const FairBoxSetEditor&);
5761

    
5762

    
5763
    ClassDef(FairBoxSetEditor,2);
5764

    
5765
};
5766

    
5767

    
5768
#endif
5769
/********************************************************************************
5770
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
5771
 *                                                                              *
5772
 *              This software is distributed under the terms of the             * 
5773
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *  
5774
 *                  copied verbatim in the file "LICENSE"                       *
5775
 ********************************************************************************/
5776
// -------------------------------------------------------------------------
5777
// -----                      FairPointSetDraw header file                    -----
5778
// -----          Created 10/12/07  by M. Al-Turany                    -----
5779
// -------------------------------------------------------------------------
5780

    
5781

    
5782
/** FairPointSetDraw
5783
 * @author M. Al-Turany
5784
 * @since 03.01.08
5785
 *   Task to display MC points
5786
 **
5787
 **/
5788

    
5789
#ifndef FAIRPOINTSETDRAW_H
5790
#define FAIRPOINTSETDRAW_H
5791

    
5792
#include "FairTask.h"                   // for FairTask, InitStatus
5793

    
5794
#include "Rtypes.h"                     // for Int_t, Color_t, etc
5795

    
5796
class FairEventManager;
5797
class TClonesArray;
5798
class TEvePointSet;
5799
class TObject;
5800
class TVector3;
5801

    
5802
class FairPointSetDraw : public FairTask
5803
{
5804

    
5805
  public:
5806

    
5807
    /** Default constructor **/
5808
    FairPointSetDraw();
5809

    
5810

    
5811
    /** Standard constructor
5812
    *@param name        Name of task
5813
    *@param iVerbose    Verbosity level
5814
    **/
5815
    FairPointSetDraw(const char* name, Color_t color ,Style_t mstyle, Int_t iVerbose = 1);
5816

    
5817
    /** Destructor **/
5818
    virtual ~FairPointSetDraw();
5819

    
5820
    /** Set verbosity level. For this task and all of the subtasks. **/
5821
    void SetVerbose(Int_t iVerbose) {fVerbose = iVerbose;};
5822
    /** Executed task **/
5823
    virtual void Exec(Option_t* option);
5824
    void Reset();
5825
  protected:
5826

    
5827
    virtual TVector3 GetVector(TObject* obj) = 0;
5828
    virtual TObject* GetValue(TObject* obj,Int_t i);
5829

    
5830
    Int_t   fVerbose;       //  Verbosity level
5831
    virtual void SetParContainers() ;
5832
    virtual InitStatus Init();
5833
    /** Action after each event**/
5834
    virtual void Finish() ;
5835
    TClonesArray* fPointList; //!
5836
    FairEventManager* fEventManager;   //!
5837
    TEvePointSet* fq;    //!
5838
    Color_t fColor; //!
5839
    Style_t fStyle; //!
5840

    
5841
  private:
5842
    FairPointSetDraw(const FairPointSetDraw&);
5843
    FairPointSetDraw& operator=(const FairPointSetDraw&);
5844

    
5845
    ClassDef(FairPointSetDraw,1);
5846

    
5847
};
5848

    
5849

    
5850
#endif
5851
/********************************************************************************
5852
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
5853
 *                                                                              *
5854
 *              This software is distributed under the terms of the             * 
5855
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *  
5856
 *                  copied verbatim in the file "LICENSE"                       *
5857
 ********************************************************************************/
5858
/*
5859
 * FairMCPointsDraw.h
5860
 *
5861
 *  Created on: Apr 17, 2009
5862
 *      Author: stockman
5863
 */
5864

    
5865
#ifndef FAIRMCPOINTDRAW_H_
5866
#define FAIRMCPOINTDRAW_H_
5867

    
5868
#include "FairPointSetDraw.h"           // for FairPointSetDraw
5869

    
5870
#include "Rtypes.h"                     // for FairMCPointDraw::Class, etc
5871

    
5872
class TObject;
5873
class TVector3;
5874

    
5875
class FairMCPointDraw: public FairPointSetDraw
5876
{
5877
  public:
5878
    FairMCPointDraw();
5879
    FairMCPointDraw(const char* name, Color_t color ,Style_t mstyle, Int_t iVerbose = 1):FairPointSetDraw(name, color, mstyle, iVerbose) {};
5880
    virtual ~FairMCPointDraw();
5881

    
5882
  protected:
5883
    TVector3 GetVector(TObject* obj);
5884

    
5885
    ClassDef(FairMCPointDraw,1);
5886
};
5887

    
5888
#endif /* FAIRMCPOINTDRAW_H_ */
5889
/********************************************************************************
5890
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
5891
 *                                                                              *
5892
 *              This software is distributed under the terms of the             * 
5893
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *  
5894
 *                  copied verbatim in the file "LICENSE"                       *
5895
 ********************************************************************************/
5896
/*
5897
 * FairHitDraw.h
5898
 *
5899
 *  Created on: Apr 16, 2009
5900
 *      Author: stockman
5901
 *
5902
 *      Simple method to draw points derived from FairHit
5903
 */
5904

    
5905
#ifndef FAIRHITDRAW_H_
5906
#define FAIRHITDRAW_H_
5907

    
5908
#include "FairBoxSetDraw.h"             // for FairBoxSetDraw
5909

    
5910
#include "Rtypes.h"                     // for FairHitDraw::Class, etc
5911
#include "TVector3.h"                   // for TVector3
5912

    
5913
class TObject;
5914

    
5915
class FairHitDraw: public FairBoxSetDraw
5916
{
5917
  public:
5918
    FairHitDraw();
5919

    
5920
    /** Standard constructor
5921
      *@param name        Name of task
5922
      *@param iVerbose    Verbosity level
5923
      **/
5924
    FairHitDraw(const char* name, Int_t iVerbose = 1);
5925

    
5926
  protected:
5927

    
5928
    TVector3 GetVector(TObject* obj);
5929

    
5930
    ClassDef(FairHitDraw,1);
5931
};
5932

    
5933
#endif /* FAIRHITDRAW_H_ */
5934
/********************************************************************************
5935
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
5936
 *                                                                              *
5937
 *              This software is distributed under the terms of the             * 
5938
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *  
5939
 *                  copied verbatim in the file "LICENSE"                       *
5940
 ********************************************************************************/
5941
/*
5942
 * FairMCPointsDraw.h
5943
 *
5944
 *  Created on: Sep. 30, 2009
5945
 *      Author: stockman
5946
 */
5947

    
5948
#ifndef FAIRHITPOINTSETDRAW_H_
5949
#define FAIRHITPOINTSETDRAW_H_
5950

    
5951
#include "FairPointSetDraw.h"           // for FairPointSetDraw
5952

    
5953
#include "Rtypes.h"                     // for FairHitPointSetDraw::Class, etc
5954

    
5955
class TObject;
5956
class TVector3;
5957

    
5958
class FairHitPointSetDraw: public FairPointSetDraw
5959
{
5960
  public:
5961
    FairHitPointSetDraw();
5962
    FairHitPointSetDraw(const char* name, Color_t color ,Style_t mstyle, Int_t iVerbose = 1):FairPointSetDraw(name, color, mstyle, iVerbose) {};
5963
    virtual ~FairHitPointSetDraw();
5964

    
5965
  protected:
5966
    TVector3 GetVector(TObject* obj);
5967

    
5968
    ClassDef(FairHitPointSetDraw,1);
5969
};
5970

    
5971
#endif /* FAIRHITPOINTSETDRAW_H_ */
5972
/********************************************************************************
5973
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
5974
 *                                                                              *
5975
 *              This software is distributed under the terms of the             * 
5976
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *  
5977
 *                  copied verbatim in the file "LICENSE"                       *
5978
 ********************************************************************************/
5979
/*
5980
 * FairTimeStampPointDraw.h
5981
 *
5982
 *  Created on: Feb 28, 2011
5983
 *      Author: stockman
5984
 */
5985

    
5986
#ifndef FAIRTIMESTAMPPOINTDRAW_H_
5987
#define FAIRTIMESTAMPPOINTDRAW_H_
5988

    
5989
#include "FairBoxSetDraw.h"             // for FairBoxSetDraw
5990

    
5991
#include "Rtypes.h"                     // for Int_t, etc
5992
#include "TVector3.h"                   // for TVector3
5993

    
5994
class TObject;
5995

    
5996
class FairTimeStampPointDraw : public FairBoxSetDraw
5997
{
5998
  public:
5999
    FairTimeStampPointDraw();
6000
    FairTimeStampPointDraw(const char* name, Int_t iVerbose = 1);
6001
    virtual ~FairTimeStampPointDraw();
6002

    
6003
  private:
6004
    virtual TVector3 GetVector(TObject* obj);
6005
    virtual Int_t GetValue(TObject* obj,Int_t i);
6006

    
6007
    ClassDef(FairTimeStampPointDraw, 1);
6008
};
6009

    
6010
#endif /* FAIRTIMESTAMPPOINTDRAW_H_ */
6011

    
6012
#undef  _BACKWARD_BACKWARD_WARNING_H
6013

    
6014
In file included from input_line_8:1:
6015
In file included from /home/vratik/workspace/expertroot_H5/macro/H5run/eventDisplay.C:2:
6016
/home/vratik/fair_install_root6/FairRootInst/include/FairMCTracks.h:85:27: error: expected parameter
6017
      declarator
6018
    ClassDef(FairMCTracks,1);
6019
                          ^
6020
/home/vratik/fair_install_root6/FairRootInst/include/FairMCTracks.h:85:27: error: expected ')'
6021
/home/vratik/fair_install_root6/FairRootInst/include/FairMCTracks.h:85:13: note: to match this '('
6022
    ClassDef(FairMCTracks,1);
6023
            ^
6024
/home/vratik/fair_install_root6/FairRootInst/include/FairMCTracks.h:85:5: error: C++ requires a type
6025
      specifier for all declarations
6026
    ClassDef(FairMCTracks,1);
6027
    ^
6028
Error in <TInterpreter::AutoParse>: Error parsing payload code for class FairParRootFileIo with content:
6029

    
6030
#line 1 "G__ParBaseDict dictionary payload"
6031

    
6032
#ifndef G__VECTOR_HAS_CLASS_ITERATOR
6033
  #define G__VECTOR_HAS_CLASS_ITERATOR 1
6034
#endif
6035

    
6036
#define _BACKWARD_BACKWARD_WARNING_H
6037
/********************************************************************************
6038
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
6039
 *                                                                              *
6040
 *              This software is distributed under the terms of the             * 
6041
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *  
6042
 *                  copied verbatim in the file "LICENSE"                       *
6043
 ********************************************************************************/
6044
#ifndef FAIRCONTFACT_H
6045
#define FAIRCONTFACT_H
6046

    
6047
#include "TNamed.h"                     // for TNamed
6048

    
6049
#include "Rtypes.h"                     // for Bool_t, ClassDef, etc
6050
#include "TList.h"                      // for TList
6051
#include "TString.h"                    // for TString
6052

    
6053
class FairLogger;
6054
class FairParIo;
6055
class FairParSet;
6056

    
6057
class FairContainer : public TNamed
6058
{
6059
  private:
6060
    FairContainer();
6061
    FairContainer(const FairContainer&);
6062
    FairContainer& operator=(const FairContainer&);
6063

    
6064
  protected:
6065
    /** available contexts for this parameter container*/
6066
    TList* contexts;
6067
    /** actual context set by the user */
6068
    TString actualContext;
6069
    /** Fair Logger */
6070
    FairLogger*  fLogger;//!
6071
  public:
6072
    FairContainer( const char*, const char*, const char*);
6073
    ~FairContainer();
6074
    void addContext(const char*);
6075
    Bool_t setActualContext(const char* c);
6076
    const char* getDefaultContext();
6077
    const char* getActualContext() { return actualContext.Data(); }
6078
    void print();
6079
    TString getConcatName();
6080
    const char* getContext();
6081
    ClassDef(FairContainer,0) // class for list elements in class FairContFact
6082
};
6083

    
6084
class FairContFact : public TNamed
6085
{
6086
  public:
6087
    FairContFact();
6088
    virtual ~FairContFact();
6089
    Bool_t addContext(const char* name);
6090
    void print();
6091
    FairParSet* getContainer(const char*);
6092
    virtual FairParSet* createContainer(FairContainer*) {return 0;}
6093
    virtual void activateParIo(FairParIo*) {}
6094
  protected:
6095

    
6096
    TList* containers;   // all parameter containers managed by this factory
6097
    const char* getActualContext(const char* name) {
6098
      return (static_cast<FairContainer*>(containers->FindObject(name)))->getActualContext();
6099
    }
6100
    /** Fair Logger */
6101
    FairLogger*  fLogger;//!
6102
    ClassDef(FairContFact,0) // base class of all factories for parameter containers
6103
  private:
6104
    FairContFact(const FairContFact&);
6105
    FairContFact& operator=(const FairContFact&);
6106

    
6107

    
6108
};
6109

    
6110
#endif  /* !FAIRCONTFACT_H */
6111
/********************************************************************************
6112
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
6113
 *                                                                              *
6114
 *              This software is distributed under the terms of the             * 
6115
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *  
6116
 *                  copied verbatim in the file "LICENSE"                       *
6117
 ********************************************************************************/
6118
#ifndef FAIRDETPARASCIIFILEIO_H
6119
#define FAIRDETPARASCIIFILEIO_H
6120

    
6121
#include "FairDetParIo.h"               // for FairDetParIo
6122

    
6123
#include "Riosfwd.h"                    // for fstream
6124
#include "Rtypes.h"                     // for Text_t, Bool_t, etc
6125
#include "TString.h"                    // for TString
6126

    
6127
#include <fstream>                      // for fstream
6128

    
6129
class FairParSet;
6130

    
6131
class FairDetParAsciiFileIo : public FairDetParIo
6132
{
6133
  protected:
6134
    TString fHeader;  //! header of container output in file
6135
    TString sepLine;  //! comment line
6136
    std::fstream* pFile;   //! pointer to ascii file
6137
// virtual Bool_t write(HDetector*) {return kTRUE;}
6138
    Bool_t findContainer(const Text_t* name);
6139
    Bool_t checkAllFound(Int_t*,Int_t);
6140
    void writeHeader(const Text_t*, const Text_t* context="",
6141
                     const Text_t* author="", const Text_t* description="");
6142
    void writeComment(FairParSet*);
6143
    void readComment(const Char_t*, FairParSet*);
6144
//  Bool_t readLabPositions(const Text_t*,HDetGeomPar*,Int_t*,Int_t,Int_t);
6145
//  Bool_t readVolumes(const Text_t*,HDetGeomPar*);
6146
//  void readTransform(HGeomTransform&);
6147
//  Bool_t readVolume(HGeomVolume*,HGeomShapes*,Text_t*);
6148
//  void writeTransform(const HGeomTransform&);
6149
//  void writeVolume(HGeomVolume*,HGeomShapes*);
6150

    
6151
  public:
6152
    FairDetParAsciiFileIo(std::fstream* f);
6153
    virtual ~FairDetParAsciiFileIo() {}
6154
//  Bool_t read(HDetGeomPar*,Int_t*);
6155
//  Int_t writeFile(HDetGeomPar*);
6156

    
6157
  private:
6158

    
6159
    FairDetParAsciiFileIo& operator=(const FairDetParAsciiFileIo&);
6160
    FairDetParAsciiFileIo(const FairDetParAsciiFileIo&);
6161

    
6162
    ClassDef(FairDetParAsciiFileIo,0) // Class for detector parameter I/O from ascii file
6163
};
6164

    
6165
#endif  /* !FAIRDETPARASCIIFILEIO_H */
6166
/********************************************************************************
6167
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
6168
 *                                                                              *
6169
 *              This software is distributed under the terms of the             * 
6170
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *  
6171
 *                  copied verbatim in the file "LICENSE"                       *
6172
 ********************************************************************************/
6173
#ifndef FAIRDETPARIO_H
6174
#define FAIRDETPARIO_H
6175

    
6176
#include "TNamed.h"                     // for TNamed
6177

    
6178
#include "Rtypes.h"                     // for Int_t, FairDetParIo::Class, etc
6179

    
6180
class FairParSet;
6181

    
6182
class FairDetParIo : public TNamed
6183
{
6184
  protected:
6185
    Int_t inputNumber; // input number (first or second input in runtime database)
6186
  public:
6187
    FairDetParIo();
6188
    virtual ~FairDetParIo() {;}
6189

    
6190
    // sets the input number
6191
    void setInputNumber(Int_t n) {inputNumber=n;}
6192

    
6193
    // returns the input number
6194
    Int_t getInputNumber() {return inputNumber;}
6195

    
6196
    // initializes parameter container
6197
    virtual Bool_t init(FairParSet*) {return kFALSE;}
6198

    
6199
    // writes parameter container to output
6200
    virtual Int_t write(FairParSet*) {return kFALSE;}
6201

    
6202
    ClassDef(FairDetParIo,0)  // Base class for detector parameter IO
6203
};
6204

    
6205
#endif  /* !HDETPARIO_H */
6206

    
6207

    
6208

    
6209

    
6210

    
6211

    
6212

    
6213
/********************************************************************************
6214
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
6215
 *                                                                              *
6216
 *              This software is distributed under the terms of the             * 
6217
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *  
6218
 *                  copied verbatim in the file "LICENSE"                       *
6219
 ********************************************************************************/
6220
#ifndef FAIRDETPARROOTFILEIO_H
6221
#define FAIRDETPARROOTFILEIO_H
6222

    
6223
#include "FairDetParIo.h"               // for FairDetParIo
6224

    
6225
#include "Rtypes.h"                     // for Int_t, Text_t, etc
6226

    
6227
using std::fstream;
6228

    
6229
class FairParRootFile;
6230
class FairParSet;
6231
class TObject;
6232

    
6233
class FairDetParRootFileIo : public FairDetParIo
6234
{
6235
  protected:
6236
    FairParRootFile* pFile;    // pointer to parameter ROOT file
6237
  public:
6238
    FairDetParRootFileIo(FairParRootFile* f);
6239
    virtual ~FairDetParRootFileIo() {}
6240
    virtual Bool_t read(FairParSet*);
6241
    Int_t write(FairParSet*);
6242
//  Bool_t read(HDetGeomPar*,Int_t*);
6243
  protected:
6244
    Int_t findInputVersion(Text_t* contName);
6245
    Int_t getMaxVersion(Text_t* contName);
6246
    TObject* findContainer(Text_t* contName, Int_t version);
6247
  private:
6248
    FairDetParRootFileIo(const FairDetParRootFileIo&);
6249
    FairDetParRootFileIo& operator= (const FairDetParRootFileIo&);
6250

    
6251
    ClassDef(FairDetParRootFileIo,0) // detector base class for parameter I/O from ROOT file
6252
};
6253

    
6254
#endif  /* !FAIRDETPARROOTFILEIO_H */
6255

    
6256
/********************************************************************************
6257
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
6258
 *                                                                              *
6259
 *              This software is distributed under the terms of the             * 
6260
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *  
6261
 *                  copied verbatim in the file "LICENSE"                       *
6262
 ********************************************************************************/
6263
#ifndef FAIRGENERICPARASCIIFILEIO_H
6264
#define FAIRGENERICPARASCIIFILEIO_H
6265

    
6266
#include "FairDetParAsciiFileIo.h"      // for FairDetParAsciiFileIo
6267

    
6268
#include "Riosfwd.h"                    // for fstream
6269
#include "Rtypes.h"                     // for Int_t, Bool_t, etc
6270

    
6271
#include <fstream>                      // for fstream
6272

    
6273
class FairParGenericSet;
6274
class FairParSet;
6275
class TString;
6276

    
6277
class FairGenericParAsciiFileIo : public FairDetParAsciiFileIo
6278
{
6279
  public:
6280
    FairGenericParAsciiFileIo(std::fstream* f=0);
6281
    ~FairGenericParAsciiFileIo() {}
6282
    Bool_t init(FairParSet*);
6283
    Int_t write(FairParSet*);
6284
  private:
6285

    
6286
    ClassDef(FairGenericParAsciiFileIo,0) // I/O from Ascii file for parameter containers derived from FairParGenericSet
6287
    Bool_t readGenericSet(FairParGenericSet* pPar);
6288
    Int_t writeGenericSet(FairParGenericSet* pPar);
6289

    
6290
    template <class type> const UChar_t* readData(type,const Char_t*,TString&,Int_t&);
6291
    template <class type> void writeData(type*,Int_t);
6292
};
6293

    
6294
#endif  /* !FAIRGENERICPARASCIIFILEIO_H */
6295
/********************************************************************************
6296
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
6297
 *                                                                              *
6298
 *              This software is distributed under the terms of the             * 
6299
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *  
6300
 *                  copied verbatim in the file "LICENSE"                       *
6301
 ********************************************************************************/
6302
#ifndef FAIRGENERICPARROOTFILEIO_H
6303
#define FAIRGENERICPARROOTFILEIO_H
6304

    
6305
#include "FairDetParRootFileIo.h"       // for FairDetParRootFileIo
6306

    
6307
#include "Rtypes.h"                    // for ClassDef macro
6308

    
6309
class FairParRootFile;
6310
class FairParSet;
6311

    
6312
class FairGenericParRootFileIo : public FairDetParRootFileIo
6313
{
6314
  public:
6315
    FairGenericParRootFileIo(FairParRootFile* f=0);
6316
    ~FairGenericParRootFileIo() {}
6317
    Bool_t init(FairParSet*);
6318
    ClassDef(FairGenericParRootFileIo,0) // I/O from ROOT file for parameter containers derived from FairParGenericSet
6319
};
6320

    
6321
#endif  /* !FAIRGENERICPARROOTFILEIO_H */
6322
/********************************************************************************
6323
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
6324
 *                                                                              *
6325
 *              This software is distributed under the terms of the             * 
6326
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *  
6327
 *                  copied verbatim in the file "LICENSE"                       *
6328
 ********************************************************************************/
6329
#ifndef FAIRPARASCIFILEIIO_H
6330
#define FAIRPARASCIFILEIIO_H
6331

    
6332
#include "FairParIo.h"                  // for FairParIo
6333

    
6334
#include "Riosfwd.h"                    // for fstream
6335
#include "Rtypes.h"                     // for Bool_t, Text_t, etc
6336

    
6337
#include <fstream>                      // for fstream, etc
6338

    
6339
class TList;
6340

    
6341
class FairParAsciiFileIo : public FairParIo
6342
{
6343
  protected:
6344
    std::fstream* file;      // pointer to a file
6345
  public:
6346
    FairParAsciiFileIo();
6347

    
6348
    // default destructor closes an open file and deletes list of I/Os
6349
    ~FairParAsciiFileIo();
6350

    
6351
    // opens file
6352
    // if a file is already open, this file will be closed
6353
    // activates detector I/Os
6354
    Bool_t open(const Text_t* fname, const Text_t* status="in");
6355

    
6356
    // concatenate files whose names are stored in the TList
6357
    // TList holds list od TObjStrings
6358
    // create file all.par in local working directory
6359
    // calls open to open the generated file all.par
6360
    Bool_t open(const TList* fnamelist, const Text_t* status="in");
6361

    
6362
    // closes file
6363
    void close();
6364

    
6365
    // returns kTRUE if file is open
6366
    Bool_t check() {
6367
      if (file) { return (file->rdbuf()->is_open()==1); }
6368
      else { return kFALSE; }
6369
    }
6370

    
6371
    // prints information about the file and the detector I/Os
6372
    void print();
6373

    
6374
    std::fstream* getFile();
6375
  private:
6376
    FairParAsciiFileIo(const FairParAsciiFileIo&);
6377
    FairParAsciiFileIo& operator=(const FairParAsciiFileIo&);
6378

    
6379
    ClassDef(FairParAsciiFileIo,0) // Parameter I/O from ASCII files
6380
};
6381

    
6382
#endif  /* !FAIRPARASCIIFILEIO_H */
6383

    
6384
/********************************************************************************
6385
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
6386
 *                                                                              *
6387
 *              This software is distributed under the terms of the             * 
6388
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *  
6389
 *                  copied verbatim in the file "LICENSE"                       *
6390
 ********************************************************************************/
6391
#ifndef FAIRPARGENERICSET_H
6392
#define FAIRPARGENERICSET_H
6393

    
6394
#include "FairParSet.h"                 // for FairParSet
6395

    
6396
#include "Rtypes.h"                     // for Bool_t, etc
6397

    
6398
class FairParIo;
6399
class FairParamList;
6400

    
6401
class FairParGenericSet : public FairParSet
6402
{
6403
  public:
6404
    FairParGenericSet(const char* name,const char* title,const char* context, Bool_t ownership=kFALSE)
6405
      : FairParSet(name,title,context,ownership) {}
6406
    virtual ~FairParGenericSet() {}
6407
    virtual void putParams(FairParamList*)=0;
6408
    virtual Bool_t getParams(FairParamList*)=0;
6409
    virtual void printParams();
6410

    
6411
    Bool_t init(FairParIo* inp);
6412
    Int_t  write(FairParIo* output);
6413

    
6414
   // DB add on
6415
    void fill(UInt_t) {};
6416
    void store(UInt_t) {};
6417

    
6418
  protected:
6419
    FairParGenericSet()
6420
      : FairParSet() {}
6421
    ClassDef(FairParGenericSet,1) // Base class for generic-style parameter containers
6422
};
6423

    
6424
#endif  /* !FAIRPARGENERICSET_H */
6425
/********************************************************************************
6426
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
6427
 *                                                                              *
6428
 *              This software is distributed under the terms of the             * 
6429
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *  
6430
 *                  copied verbatim in the file "LICENSE"                       *
6431
 ********************************************************************************/
6432
#ifndef FAIRPARIO_H
6433
#define FAIRPARIO_H
6434

    
6435
#include "TObject.h"                    // for TObject
6436

    
6437
#include "Rtypes.h"                     // for Bool_t, Text_t, etc
6438
#include "TString.h"                    // for TString
6439

    
6440
class FairDetParIo;
6441
class FairRtdbRun;
6442
class TList;
6443

    
6444
class FairParIo : public TObject
6445
{
6446
  protected:
6447
    TList* detParIoList;  // list of detector I/Os
6448
    Bool_t autoWritable;  // flag indicating if automatic write is possible
6449
    TString filename;
6450
  public:
6451
    FairParIo();
6452
    virtual ~FairParIo();
6453
    virtual FairDetParIo* getDetParIo(const Text_t*);
6454
    virtual void setDetParIo(FairDetParIo*);
6455
    virtual void removeDetParIo(Text_t*);
6456
    void setInputNumber(Int_t);
6457
    virtual void close() {;}
6458

    
6459
    // returns the filename
6460
    const char* getFilename() {return filename.Data();}
6461

    
6462
    // creates input/output class for a special detector and stores pointer
6463
    // used only for Oracle input/output
6464
    // (code in  class OraIo)
6465
    virtual void setDetParIo(Text_t*) {;}
6466

    
6467
    // prints information about input/output
6468
    virtual void print() {;}
6469

    
6470
    // checks if the input/output is open
6471
    virtual Bool_t check() { return kFALSE; }
6472

    
6473
    // reads versions of parameter containers for an event file
6474
    virtual void readVersions(FairRtdbRun*) {;}
6475

    
6476
    // sets global file pointer in ROOT if input/output is a ROOT-file
6477
    // (code in FairParRootFileIo)
6478
    virtual void cd() {;}
6479

    
6480
    // set and get for flag autoWritable
6481
    void setAutoWritable(Bool_t f=kTRUE) {autoWritable=f;}
6482
    Bool_t isAutoWritable() {return autoWritable;}
6483

    
6484
  private:
6485
    FairParIo(const FairParIo&);
6486
    FairParIo& operator=(const FairParIo&);
6487

    
6488
    ClassDef(FairParIo,0) // Base class for all parameter I/Os
6489
};
6490

    
6491
#endif  /* !FAIRPARIO_H */
6492

    
6493

    
6494

    
6495

    
6496
/********************************************************************************
6497
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
6498
 *                                                                              *
6499
 *              This software is distributed under the terms of the             * 
6500
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *  
6501
 *                  copied verbatim in the file "LICENSE"                       *
6502
 ********************************************************************************/
6503
#ifndef FAIRPARROOTFILEIO_H
6504
#define FAIRPARROOTFILEIO_H
6505

    
6506
#include "FairParIo.h"                  // for FairParIo
6507

    
6508
#include "Rtypes.h"                     // for Bool_t, Text_t, Int_t, etc
6509
#include "TFile.h"                      // for TFile
6510
#include "TNamed.h"                     // for TNamed
6511

    
6512
#include <fstream>
6513
using std::fstream;
6514

    
6515
class FairRtdbRun;
6516
class TKey;
6517
class TList;
6518

    
6519
class FairParRootFile : public TNamed
6520
{
6521
  public:
6522
    FairRtdbRun* run;     //! pointer to current run in ROOT file
6523
    FairParRootFile(const Text_t* fname, Option_t* option="READ",
6524
                    const Text_t* ftitle="",Int_t compress=1);
6525
    FairParRootFile(TFile* f);
6526
    ~FairParRootFile();
6527
    FairRtdbRun* getRun() {return run;}
6528
    void readVersions(FairRtdbRun*);
6529

    
6530
    Bool_t IsOpen() {return RootFile->IsOpen();}
6531
    void   cd() {RootFile->cd();}
6532
    Bool_t IsWritable() {return RootFile->IsWritable();}
6533

    
6534
    TKey* GetKey(Text_t* t) { return RootFile->GetKey(t);}
6535
    TList* GetListOfKeys() { return RootFile->GetListOfKeys();}
6536
    void Close() {RootFile->Close();}
6537

    
6538
  protected:
6539
    TFile* RootFile;
6540

    
6541
  private:
6542
    FairParRootFile(const FairParRootFile&);
6543
    FairParRootFile& operator=(const FairParRootFile&);
6544

    
6545
    ClassDef(FairParRootFile,0) // ROOT file for Parameter I/O
6546

    
6547
};
6548

    
6549

    
6550
class FairParRootFileIo : public FairParIo
6551
{
6552
  protected:
6553
    FairParRootFile* file;  // pointer to ROOT file
6554
    Bool_t fMerging;
6555
  public:
6556
    FairParRootFileIo();
6557
    FairParRootFileIo(Bool_t merged);
6558
    ~FairParRootFileIo();
6559
    Bool_t open(const Text_t* fname, Option_t* option="READ",
6560
                const Text_t* ftitle="",Int_t compress=1);
6561
    Bool_t open(const TList* fnamelist, Option_t* option="READ",
6562
                const Text_t* ftitle="",Int_t compress=1);
6563
    void close();
6564
    void print();
6565
    FairParRootFile* getParRootFile();
6566
    void readVersions(FairRtdbRun*);
6567
    TList* getKeys();
6568
    Bool_t check() {
6569
      // returns kTRUE if file is open
6570
      if (file) { return file->IsOpen(); }
6571
      else { return kFALSE; }
6572
    }
6573
    void cd() {
6574
      // sets the global ROOT file pointer gFile
6575
      if (file) { file->cd(); }
6576
    }
6577
    /**
6578
    Open an existing root file for IO
6579
    */
6580
    Bool_t open(TFile* f);
6581
    void setMerging( Bool_t io ) { fMerging=io;}
6582

    
6583
  private:
6584
    FairParRootFileIo(const FairParRootFileIo&);
6585
    FairParRootFileIo& operator=(const FairParRootFileIo&);
6586

    
6587
    ClassDef(FairParRootFileIo,0) // Parameter I/O from ROOT files
6588
};
6589

    
6590
#endif  /* !FAIRPARROOTFILEIO_H */
6591

    
6592
/********************************************************************************
6593
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
6594
 *                                                                              *
6595
 *              This software is distributed under the terms of the             * 
6596
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *  
6597
 *                  copied verbatim in the file "LICENSE"                       *
6598
 ********************************************************************************/
6599
#ifndef FAIRPARSET_H
6600
#define FAIRPARSET_H
6601

    
6602
#include "TNamed.h"
6603
#include "Rtypes.h"                     // for Int_t, Bool_t, etc
6604
#include "TString.h"                    // for TString
6605

    
6606
class FairLogger;
6607
class FairParIo;
6608

    
6609
class FairParSet : public TObject
6610
{
6611
  protected:
6612
    TString fName;         //
6613
    TString fTitle;        //
6614
    TString detName;         //! name of the detector the container belongs to
6615
    Int_t versions[3];       //! versions of container in the 2 possible inputs
6616
    Bool_t status;           //! static flag
6617
    Bool_t changed;          //! flag is kTRUE if parameters have changed
6618
    Bool_t  owned;          //! if flag is KTRUE FairDB has the par. class ownership
6619
    TString paramContext;    // Context/purpose for parameters and conditions
6620
    TString author;          // Author of parameters
6621
    TString description ;    // Description of parameters
6622
    /** Fair Logger */
6623
    FairLogger*  fLogger;  //!
6624

    
6625
  public:
6626
    FairParSet(const char* name="",const char* title="",const char* context="", Bool_t owner=kFALSE);
6627
    virtual ~FairParSet() {}
6628

    
6629
    virtual const char* GetName() const {return static_cast<const char*>(fName.Data());}
6630
    virtual const char* GetTitle() const {return static_cast<const char*>(fTitle.Data());}
6631

    
6632
    virtual Bool_t init();
6633
    virtual Bool_t init(FairParIo*) { return kFALSE; }
6634
    virtual Int_t write();
6635
    virtual Int_t write(FairParIo*) { return kFALSE; }
6636
    virtual void clear() {}
6637
    virtual void print();
6638

    
6639
    const char* getDetectorName() {return detName.Data();}
6640
    void resetInputVersions();
6641

    
6642
    void setInputVersion(Int_t v=-1,Int_t i=0) {
6643
      if (i>=0 && i<3) { versions[i]=v; }
6644
    }
6645
    Int_t getInputVersion(Int_t i) {
6646
      if (i>=0 && i<3) { return versions[i]; }
6647
      else { return 0; }
6648
    }
6649

    
6650
    void setStatic(Bool_t flag=kTRUE) {status=flag;}
6651
    Bool_t isStatic() {return status;}
6652

    
6653
    void setOwnership(Bool_t flag=kTRUE) {owned=flag;}
6654
    Bool_t isOwned() {return owned;}
6655

    
6656
    void setChanged(Bool_t flag=kTRUE) {changed=flag;}
6657
    Bool_t hasChanged() {return changed;}
6658

    
6659
    const char* getParamContext() const { return paramContext.Data(); }
6660

    
6661
    void setAuthor(const char* s) {author=s;}
6662
    const char* getAuthor() const { return author.Data(); }
6663

    
6664
    void setDescription(const char* s) {description=s;}
6665
    const char* getDescription() const { return description.Data(); }
6666

    
6667
    void copyComment(FairParSet& r) {
6668
      author=r.getAuthor();
6669
      description=r.getDescription();
6670
    }
6671

    
6672

    
6673
    virtual void fill(UInt_t) {};
6674
    virtual void store(UInt_t) {};
6675
    
6676

    
6677
    FairParSet& operator=(const FairParSet&);
6678
    FairParSet(const FairParSet&);
6679

    
6680
    ClassDef(FairParSet,2) // Base class for all parameter containers
6681
};
6682

    
6683
#endif  /* !FAIRPARSET_H */
6684

    
6685
/********************************************************************************
6686
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
6687
 *                                                                              *
6688
 *              This software is distributed under the terms of the             * 
6689
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *  
6690
 *                  copied verbatim in the file "LICENSE"                       *
6691
 ********************************************************************************/
6692
#ifndef FAIRPARAMLIST_H
6693
#define FAIRPARAMLIST_H
6694

    
6695
#include "TNamed.h"                     // for TNamed
6696

    
6697
#include "Rtypes.h"                     // for Text_t, Int_t, Bool_t, etc
6698
#include "TArrayC.h"                    // for TArrayC
6699
#include "TFile.h"                      // for TFile
6700
#include "TList.h"                      // for TList
6701
#include "TObject.h"                    // for TObject
6702
#include "TROOT.h"                      // for TROOT, gROOT
6703
#include "TSeqCollection.h"             // for TSeqCollection
6704
#include "TString.h"                    // for TString
6705

    
6706
class FairLogger;
6707
class TArrayD;
6708
class TArrayF;
6709
class TArrayI;
6710

    
6711
class FairParamObj : public TNamed
6712
{
6713
  protected:
6714
    UChar_t* paramValue;    // Pointer to binary array
6715
    Int_t arraySize;        // Size of binary array
6716
    TString paramType;      // Type of parameter value or class name
6717
    Bool_t basicType;       // kTRUE for C-types and C-type parameter arrays, kFALSE for classes
6718
    Int_t bytesPerValue;    // number of bytes per value
6719
    Int_t classVersion;     // Code version of classes stored as binary
6720
    UChar_t* streamerInfo;  // Pointer to binary array container the streamer info
6721
    Int_t streamerInfoSize; // Size of streamer info array
6722
  public:
6723
    FairParamObj(const Text_t* name="");
6724
    FairParamObj(FairParamObj&);
6725
    FairParamObj(const Text_t*,Int_t);
6726
    FairParamObj(const Text_t*,Bool_t);
6727
    FairParamObj(const Text_t*,UInt_t);
6728
    FairParamObj(const Text_t*,Float_t);
6729
    FairParamObj(const Text_t*,Double_t);
6730
    FairParamObj(const Text_t*,const Int_t*,const Int_t);
6731
    FairParamObj(const Text_t*,const UInt_t*,const Int_t);
6732
    FairParamObj(const Text_t*,const Float_t*,const Int_t);
6733
    FairParamObj(const Text_t*,const Double_t*,const Int_t);
6734
    FairParamObj(const Text_t*,const Text_t*);
6735
    FairParamObj(const Text_t*,const Char_t*,const Int_t);
6736
    FairParamObj(const Text_t*,const UChar_t*,const Int_t);
6737
    ~FairParamObj();
6738
    void setParamType(const Text_t* t);
6739
    UChar_t* setLength(Int_t l);
6740
    void setParamValue(UChar_t*,const Int_t);
6741
    void setClassVersion(const Int_t v) { classVersion=v; }
6742
    UChar_t* setStreamerInfoSize(Int_t);
6743
    void setStreamerInfo(UChar_t*,const Int_t);
6744
    UChar_t* getParamValue() { return paramValue; }
6745
    Bool_t isBasicType() { return basicType; }
6746
    const char* getParamType() { return paramType.Data(); }
6747
    Int_t getBytesPerValue() { return bytesPerValue; }
6748
    Int_t getClassVersion() { return classVersion; }
6749
    Int_t getLength() { return arraySize; }
6750
    Int_t getNumParams();
6751
    UChar_t* getStreamerInfo() { return streamerInfo; }
6752
    Int_t getStreamerInfoSize() { return streamerInfoSize; }
6753
    void print();
6754
  protected:
6755
    template <class type> void printData(type*,Int_t);
6756

    
6757
  private:
6758
    FairParamObj& operator=(const FairParamObj&);
6759

    
6760
    ClassDef(FairParamObj,0) // Class for binary parameter object (name + binary array)
6761
};
6762

    
6763

    
6764
class FairParamList : public TObject
6765
{
6766
  protected:
6767
    TList* paramList;      // List for parameters stored as string
6768
    FairLogger* fLogger;  // FairRoot logging mechanism
6769
    class FairParamTFile : public TFile
6770
    {
6771
      public:
6772
        FairParamTFile() {
6773
          // Create StreamerInfo index
6774
          Int_t lenIndex = gROOT->GetListOfStreamerInfo()->GetSize()+1;
6775
          if (lenIndex < 5000) { lenIndex = 5000; }
6776
          fClassIndex = new TArrayC(lenIndex);
6777
        }
6778
        ~FairParamTFile() {
6779
          delete fClassIndex;
6780
          fClassIndex=0;
6781
        }
6782
    };
6783
  public:
6784
    FairParamList();
6785
    ~FairParamList();
6786
    void add(FairParamObj&);
6787
    void add(const Text_t*,const Text_t*);
6788
    void add(const Text_t*,Int_t);
6789
    void add(const Text_t*,Bool_t);
6790
    void add(const Text_t*,UInt_t);
6791
    void add(const Text_t*,Float_t);
6792
    void add(const Text_t*,Double_t);
6793
    void add(const Text_t*,TArrayI&);
6794
    void add(const Text_t*,TArrayC&);
6795
    void add(const Text_t*,TArrayF&);
6796
    void add(const Text_t*,TArrayD&);
6797
    void add(const Text_t*,const UChar_t*,const Int_t);
6798
    void add(const Text_t*,const Int_t*,const Int_t);
6799
    void add(const Text_t*,const Float_t*,const Int_t);
6800
    void add(const Text_t*,const Double_t*,const Int_t);
6801
    void addObject(const Text_t*,TObject*);
6802
    Bool_t fill(const Text_t*,Text_t*,const Int_t);
6803
    Bool_t fill(const Text_t*,Int_t*,const Int_t nValues=1);
6804
    Bool_t fill(const Text_t*,Bool_t*,const Int_t nValues=1);
6805
    Bool_t fill(const Text_t*,UInt_t*,const Int_t nValues=1);
6806
    Bool_t fill(const Text_t*,Float_t*,const Int_t nValues=1);
6807
    Bool_t fill(const Text_t*,Double_t*,const Int_t nValues=1);
6808
    Bool_t fill(const Text_t*,UChar_t*,const Int_t nValues=1);
6809
    Bool_t fill(const Text_t*,TArrayI*);
6810
    Bool_t fill(const Text_t*,TArrayC*);
6811
    Bool_t fill(const Text_t*,TArrayF*);
6812
    Bool_t fill(const Text_t*,TArrayD*);
6813
    Bool_t fillObject(const Text_t*,TObject*);
6814
    void print();
6815
    FairParamObj* find(const Text_t* name) {
6816
      return static_cast<FairParamObj*>(paramList->FindObject(name));
6817
    }
6818
    TList* getList() { return paramList; }
6819
  private:
6820
    FairParamList(const FairParamList&);
6821
    FairParamList& operator=(const FairParamList&);
6822

    
6823
    ClassDef(FairParamList,3) // Class for lists of parameters (of type FairParamObj)
6824
};
6825

    
6826
#endif  /* !FAIRPARAMLIST_H */
6827

    
6828
/********************************************************************************
6829
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
6830
 *                                                                              *
6831
 *              This software is distributed under the terms of the             * 
6832
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *  
6833
 *                  copied verbatim in the file "LICENSE"                       *
6834
 ********************************************************************************/
6835
#ifndef FAIRRTDBRUN_H
6836
#define FAIRRTDBRUN_H
6837

    
6838
#include "TNamed.h"                     // for TNamed
6839

    
6840
#include "Riosfwd.h"                    // for fstream
6841
#include "Rtypes.h"                     // for Int_t, Text_t, UInt_t, etc
6842
#include "TString.h"                    // for TString
6843

    
6844
#include <stdio.h>                      // for sprintf, sscanf
6845
#include <fstream>                      // for fstream
6846

    
6847
class TList;
6848
using std::fstream;
6849

    
6850
class FairParVersion : public TNamed
6851
{
6852
  protected:
6853
    Int_t inputVersions[3]; //! version of the parameter container in the 2 possible inputs
6854
    Int_t rootVersion;      // version of the parameter container in the ROOT output file
6855
  public:
6856
    FairParVersion() : TNamed(),rootVersion(0) {}
6857
    FairParVersion(Text_t* name);
6858
    ~FairParVersion() {}
6859
    void setInputVersion(Int_t v=-1,Int_t i=0) {
6860
      if (i>=0 && i<3) { inputVersions[i]=v; }
6861
    }
6862
    Int_t getInputVersion(Int_t i) {
6863
      if (i>=0 && i<3) { return inputVersions[i]; }
6864
      else { return -1; }
6865
    }
6866
    void resetInputVersions() {
6867
      for(Int_t i=0; i<3; i++) {inputVersions[i]=-1;}
6868
    }
6869
    void setRootVersion(Int_t v) {rootVersion=v;}
6870
    Int_t getRootVersion() {return rootVersion;}
6871
    ClassDef(FairParVersion,1) // Class for parameter versions
6872
};
6873

    
6874
class FairRtdbRun : public TNamed
6875
{
6876
  protected:
6877
    TList* parVersions;   // List of container names with the versions
6878
    TString refRun;       //! name of the reference run for initialization
6879
  public:
6880
    FairRtdbRun();
6881
    FairRtdbRun(const Text_t* name,const Text_t* refName="");
6882
    FairRtdbRun(Int_t r,Int_t rr=-1);
6883
    FairRtdbRun(FairRtdbRun& run);
6884
    ~FairRtdbRun();
6885
    inline UInt_t getRunId(void);
6886
    void addParVersion(FairParVersion* pv);
6887
    FairParVersion* getParVersion(const Text_t* name);
6888
    TList* getParVersions() {return parVersions;}
6889
    const Text_t* getRefRun() {return refRun.Data();}
6890
    void setRefRun(Text_t* s) {refRun=s;}
6891
    inline void setRefRun(Int_t r);
6892
    void resetInputVersions();
6893
    void resetOutputVersions();
6894
    void print();
6895
    void write(std::fstream&);
6896

    
6897
  private:
6898
    FairRtdbRun& operator=(const FairRtdbRun&);
6899

    
6900
    ClassDef(FairRtdbRun,1) // Class for parameter version management of a run
6901
};
6902

    
6903
// -------------------- inlines ---------------------------
6904

    
6905
inline UInt_t FairRtdbRun::getRunId(void)
6906
{
6907
  UInt_t r;
6908
  sscanf(GetName(),"%i",&r);
6909
  return r;
6910
}
6911

    
6912
inline void FairRtdbRun::setRefRun(Int_t r)
6913
{
6914
  if (r==-1) { refRun=""; }
6915
  else {
6916
    char name[255];
6917
    sprintf(name,"%i",r);
6918
    refRun=name;
6919
  }
6920
}
6921

    
6922
#endif  /* !FAIRRTDBRUN_H */
6923

    
6924
/********************************************************************************
6925
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
6926
 *                                                                              *
6927
 *              This software is distributed under the terms of the             * 
6928
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *  
6929
 *                  copied verbatim in the file "LICENSE"                       *
6930
 ********************************************************************************/
6931
#ifndef FAIRRUNTIMEDB_H
6932
#define FAIRRUNTIMEDB_H
6933

    
6934
#include "TObject.h"                    // for TObject
6935

    
6936
#include "Rtypes.h"                     // for Bool_t, Int_t, Text_t, etc
6937
#include "TList.h"                      // for TList
6938
#include "TString.h"                    // for TString
6939

    
6940
class FairContFact;
6941
class FairLogger;
6942
class FairParIo;
6943
class FairParSet;
6944
class FairRtdbRun;
6945

    
6946
static TList contFactories;    //! list of container factories
6947

    
6948
class FairRuntimeDb : public TObject
6949
{
6950
  private:
6951
    static FairRuntimeDb* gRtdb; //!
6952

    
6953
  protected:
6954
    FairRuntimeDb(void);
6955
    TList* containerList;    // list of parameter containers
6956
    TList* runs;             // list of runs
6957
    FairParIo* firstInput;    // first (prefered) input for parameters
6958
    FairParIo* secondInput;   // second input (used if not found in first input)
6959
    FairParIo* output;        // output for parameters
6960
    FairRtdbRun* currentRun;  // Current run
6961
    TString currentFileName; // Name of current event file
6962
    Bool_t versionsChanged;  // flag for write of list of runs (set kTRUE by each write)
6963
    Bool_t isRootFileOutput; // flag indicating that the output is a ROOT file
6964
    /** Fair Logger */
6965
    FairLogger*  fLogger;  //!
6966

    
6967
    /**
6968
     * Select which IO type to use.
6969
     */
6970
    typedef enum {
6971
      UNKNOWN_Type    = 0,
6972
      AsciiFileOutput = 1, // Ascii in-out-put
6973
      RootFileOutput  = 2, // Root Files
6974
      RootTSQLOutput  = 3  // Use a TSQL db
6975
    } ParamIOType;
6976
    ParamIOType ioType;//IO Type
6977

    
6978
  public:
6979
    static FairRuntimeDb* instance(void);
6980
    ~FairRuntimeDb(void);
6981

    
6982
    Bool_t addParamContext(const char*);
6983
    void printParamContexts();
6984
    void addContFactory(FairContFact*);
6985
    FairContFact* getContFactory(const Text_t*);
6986

    
6987
    Bool_t addContainer(FairParSet*);
6988
    FairParSet* getContainer(const Text_t*);
6989
    FairParSet* findContainer(const char*);
6990
    void removeContainer(Text_t*);
6991
    void removeAllContainers(void);
6992
    Bool_t initContainers(Int_t runId,Int_t refId=-1,const Text_t* fileName="");
6993
    void setContainersStatic(Bool_t f=kTRUE);
6994
    Bool_t writeContainers(void);
6995
    Bool_t writeContainer(FairParSet*,FairRtdbRun*,FairRtdbRun* refRun=0);
6996

    
6997
    FairRtdbRun* addRun(Int_t runId,Int_t refId=-1);
6998
    FairRtdbRun* getRun(Int_t);
6999
    FairRtdbRun* getRun(Text_t*);
7000
    FairRtdbRun* getCurrentRun(void) {return currentRun;}
7001
    Text_t const* getCurrentFileName() {return currentFileName.Data();}
7002
    void clearRunList(void);
7003

    
7004
    void removeRun(Text_t*);
7005

    
7006
    Bool_t setInputVersion(Int_t run,Text_t* container,
7007
                           Int_t version,Int_t inputNumber);
7008
    Bool_t setRootOutputVersion(Int_t run,Text_t* container,Int_t version);
7009
    void setVersionsChanged(Bool_t f=kTRUE) {versionsChanged=f;}
7010
    void resetInputVersions(void);
7011
    void resetOutputVersions(void);
7012
    void resetAllVersions(void);
7013

    
7014
    Bool_t readAll(void);
7015
    void writeVersions(void);
7016
    void saveOutput(void);
7017

    
7018
    Bool_t setFirstInput(FairParIo*);
7019
    Bool_t setSecondInput(FairParIo*);
7020
    Bool_t setOutput(FairParIo*);
7021
    FairParIo* getFirstInput(void);
7022
    FairParIo* getSecondInput(void);
7023
    FairParIo* getOutput(void);
7024
    void closeFirstInput(void);
7025
    void closeSecondInput(void);
7026
    void closeOutput(void);
7027
    void activateParIo(FairParIo*);
7028
    TList* getListOfContainers() {return containerList;}
7029
    void print(void);
7030

    
7031
    Int_t findOutputVersion(FairParSet*);
7032

    
7033
  private:
7034
    FairRuntimeDb(const FairRuntimeDb& M);
7035
    FairRuntimeDb& operator= (const  FairRuntimeDb&) {return *this;}
7036
    Bool_t initContainers(void);
7037

    
7038
    ClassDef(FairRuntimeDb,0) // Class for runtime database
7039
};
7040

    
7041
#endif  /* !FAIRRUNTIMEDB_H */
7042

    
7043
#undef  _BACKWARD_BACKWARD_WARNING_H
7044

    
7045
In file included from input_line_8:1:
7046
/home/vratik/workspace/expertroot_H5/macro/H5run/eventDisplay.C:9:36: error: allocation of incomplete
7047
      type 'FairParRootFileIo'
7048
  FairParRootFileIo*  parIo1 = new FairParRootFileIo();
7049
                                   ^~~~~~~~~~~~~~~~~
7050
G__ParBaseDict dictionary forward declarations' payload:17:85: note: forward declaration of
7051
      'FairParRootFileIo'
7052
class __attribute__((annotate(R"ATTRDUMP(Parameter I/O from ROOT files)ATTRDUMP"))) FairParRootFileIo;
7053
                                                                                    ^
7054
In file included from input_line_8:1:
7055
/home/vratik/workspace/expertroot_H5/macro/H5run/eventDisplay.C:10:9: error: member access into
7056
      incomplete type 'FairParRootFileIo'
7057
  parIo1->open("par.root");
7058
        ^
7059
G__ParBaseDict dictionary forward declarations' payload:17:85: note: forward declaration of
7060
      'FairParRootFileIo'
7061
class __attribute__((annotate(R"ATTRDUMP(Parameter I/O from ROOT files)ATTRDUMP"))) FairParRootFileIo;
7062
                                                                                    ^
7063
Error in <TInterpreter::AutoParse>: Error parsing payload code for class FairRuntimeDb with content:
7064

    
7065
#line 1 "G__ParBaseDict dictionary payload"
7066

    
7067
#ifndef G__VECTOR_HAS_CLASS_ITERATOR
7068
  #define G__VECTOR_HAS_CLASS_ITERATOR 1
7069
#endif
7070

    
7071
#define _BACKWARD_BACKWARD_WARNING_H
7072
/********************************************************************************
7073
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
7074
 *                                                                              *
7075
 *              This software is distributed under the terms of the             * 
7076
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *  
7077
 *                  copied verbatim in the file "LICENSE"                       *
7078
 ********************************************************************************/
7079
#ifndef FAIRCONTFACT_H
7080
#define FAIRCONTFACT_H
7081

    
7082
#include "TNamed.h"                     // for TNamed
7083

    
7084
#include "Rtypes.h"                     // for Bool_t, ClassDef, etc
7085
#include "TList.h"                      // for TList
7086
#include "TString.h"                    // for TString
7087

    
7088
class FairLogger;
7089
class FairParIo;
7090
class FairParSet;
7091

    
7092
class FairContainer : public TNamed
7093
{
7094
  private:
7095
    FairContainer();
7096
    FairContainer(const FairContainer&);
7097
    FairContainer& operator=(const FairContainer&);
7098

    
7099
  protected:
7100
    /** available contexts for this parameter container*/
7101
    TList* contexts;
7102
    /** actual context set by the user */
7103
    TString actualContext;
7104
    /** Fair Logger */
7105
    FairLogger*  fLogger;//!
7106
  public:
7107
    FairContainer( const char*, const char*, const char*);
7108
    ~FairContainer();
7109
    void addContext(const char*);
7110
    Bool_t setActualContext(const char* c);
7111
    const char* getDefaultContext();
7112
    const char* getActualContext() { return actualContext.Data(); }
7113
    void print();
7114
    TString getConcatName();
7115
    const char* getContext();
7116
    ClassDef(FairContainer,0) // class for list elements in class FairContFact
7117
};
7118

    
7119
class FairContFact : public TNamed
7120
{
7121
  public:
7122
    FairContFact();
7123
    virtual ~FairContFact();
7124
    Bool_t addContext(const char* name);
7125
    void print();
7126
    FairParSet* getContainer(const char*);
7127
    virtual FairParSet* createContainer(FairContainer*) {return 0;}
7128
    virtual void activateParIo(FairParIo*) {}
7129
  protected:
7130

    
7131
    TList* containers;   // all parameter containers managed by this factory
7132
    const char* getActualContext(const char* name) {
7133
      return (static_cast<FairContainer*>(containers->FindObject(name)))->getActualContext();
7134
    }
7135
    /** Fair Logger */
7136
    FairLogger*  fLogger;//!
7137
    ClassDef(FairContFact,0) // base class of all factories for parameter containers
7138
  private:
7139
    FairContFact(const FairContFact&);
7140
    FairContFact& operator=(const FairContFact&);
7141

    
7142

    
7143
};
7144

    
7145
#endif  /* !FAIRCONTFACT_H */
7146
/********************************************************************************
7147
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
7148
 *                                                                              *
7149
 *              This software is distributed under the terms of the             * 
7150
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *  
7151
 *                  copied verbatim in the file "LICENSE"                       *
7152
 ********************************************************************************/
7153
#ifndef FAIRDETPARASCIIFILEIO_H
7154
#define FAIRDETPARASCIIFILEIO_H
7155

    
7156
#include "FairDetParIo.h"               // for FairDetParIo
7157

    
7158
#include "Riosfwd.h"                    // for fstream
7159
#include "Rtypes.h"                     // for Text_t, Bool_t, etc
7160
#include "TString.h"                    // for TString
7161

    
7162
#include <fstream>                      // for fstream
7163

    
7164
class FairParSet;
7165

    
7166
class FairDetParAsciiFileIo : public FairDetParIo
7167
{
7168
  protected:
7169
    TString fHeader;  //! header of container output in file
7170
    TString sepLine;  //! comment line
7171
    std::fstream* pFile;   //! pointer to ascii file
7172
// virtual Bool_t write(HDetector*) {return kTRUE;}
7173
    Bool_t findContainer(const Text_t* name);
7174
    Bool_t checkAllFound(Int_t*,Int_t);
7175
    void writeHeader(const Text_t*, const Text_t* context="",
7176
                     const Text_t* author="", const Text_t* description="");
7177
    void writeComment(FairParSet*);
7178
    void readComment(const Char_t*, FairParSet*);
7179
//  Bool_t readLabPositions(const Text_t*,HDetGeomPar*,Int_t*,Int_t,Int_t);
7180
//  Bool_t readVolumes(const Text_t*,HDetGeomPar*);
7181
//  void readTransform(HGeomTransform&);
7182
//  Bool_t readVolume(HGeomVolume*,HGeomShapes*,Text_t*);
7183
//  void writeTransform(const HGeomTransform&);
7184
//  void writeVolume(HGeomVolume*,HGeomShapes*);
7185

    
7186
  public:
7187
    FairDetParAsciiFileIo(std::fstream* f);
7188
    virtual ~FairDetParAsciiFileIo() {}
7189
//  Bool_t read(HDetGeomPar*,Int_t*);
7190
//  Int_t writeFile(HDetGeomPar*);
7191

    
7192
  private:
7193

    
7194
    FairDetParAsciiFileIo& operator=(const FairDetParAsciiFileIo&);
7195
    FairDetParAsciiFileIo(const FairDetParAsciiFileIo&);
7196

    
7197
    ClassDef(FairDetParAsciiFileIo,0) // Class for detector parameter I/O from ascii file
7198
};
7199

    
7200
#endif  /* !FAIRDETPARASCIIFILEIO_H */
7201
/********************************************************************************
7202
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
7203
 *                                                                              *
7204
 *              This software is distributed under the terms of the             * 
7205
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *  
7206
 *                  copied verbatim in the file "LICENSE"                       *
7207
 ********************************************************************************/
7208
#ifndef FAIRDETPARIO_H
7209
#define FAIRDETPARIO_H
7210

    
7211
#include "TNamed.h"                     // for TNamed
7212

    
7213
#include "Rtypes.h"                     // for Int_t, FairDetParIo::Class, etc
7214

    
7215
class FairParSet;
7216

    
7217
class FairDetParIo : public TNamed
7218
{
7219
  protected:
7220
    Int_t inputNumber; // input number (first or second input in runtime database)
7221
  public:
7222
    FairDetParIo();
7223
    virtual ~FairDetParIo() {;}
7224

    
7225
    // sets the input number
7226
    void setInputNumber(Int_t n) {inputNumber=n;}
7227

    
7228
    // returns the input number
7229
    Int_t getInputNumber() {return inputNumber;}
7230

    
7231
    // initializes parameter container
7232
    virtual Bool_t init(FairParSet*) {return kFALSE;}
7233

    
7234
    // writes parameter container to output
7235
    virtual Int_t write(FairParSet*) {return kFALSE;}
7236

    
7237
    ClassDef(FairDetParIo,0)  // Base class for detector parameter IO
7238
};
7239

    
7240
#endif  /* !HDETPARIO_H */
7241

    
7242

    
7243

    
7244

    
7245

    
7246

    
7247

    
7248
/********************************************************************************
7249
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
7250
 *                                                                              *
7251
 *              This software is distributed under the terms of the             * 
7252
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *  
7253
 *                  copied verbatim in the file "LICENSE"                       *
7254
 ********************************************************************************/
7255
#ifndef FAIRDETPARROOTFILEIO_H
7256
#define FAIRDETPARROOTFILEIO_H
7257

    
7258
#include "FairDetParIo.h"               // for FairDetParIo
7259

    
7260
#include "Rtypes.h"                     // for Int_t, Text_t, etc
7261

    
7262
using std::fstream;
7263

    
7264
class FairParRootFile;
7265
class FairParSet;
7266
class TObject;
7267

    
7268
class FairDetParRootFileIo : public FairDetParIo
7269
{
7270
  protected:
7271
    FairParRootFile* pFile;    // pointer to parameter ROOT file
7272
  public:
7273
    FairDetParRootFileIo(FairParRootFile* f);
7274
    virtual ~FairDetParRootFileIo() {}
7275
    virtual Bool_t read(FairParSet*);
7276
    Int_t write(FairParSet*);
7277
//  Bool_t read(HDetGeomPar*,Int_t*);
7278
  protected:
7279
    Int_t findInputVersion(Text_t* contName);
7280
    Int_t getMaxVersion(Text_t* contName);
7281
    TObject* findContainer(Text_t* contName, Int_t version);
7282
  private:
7283
    FairDetParRootFileIo(const FairDetParRootFileIo&);
7284
    FairDetParRootFileIo& operator= (const FairDetParRootFileIo&);
7285

    
7286
    ClassDef(FairDetParRootFileIo,0) // detector base class for parameter I/O from ROOT file
7287
};
7288

    
7289
#endif  /* !FAIRDETPARROOTFILEIO_H */
7290

    
7291
/********************************************************************************
7292
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
7293
 *                                                                              *
7294
 *              This software is distributed under the terms of the             * 
7295
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *  
7296
 *                  copied verbatim in the file "LICENSE"                       *
7297
 ********************************************************************************/
7298
#ifndef FAIRGENERICPARASCIIFILEIO_H
7299
#define FAIRGENERICPARASCIIFILEIO_H
7300

    
7301
#include "FairDetParAsciiFileIo.h"      // for FairDetParAsciiFileIo
7302

    
7303
#include "Riosfwd.h"                    // for fstream
7304
#include "Rtypes.h"                     // for Int_t, Bool_t, etc
7305

    
7306
#include <fstream>                      // for fstream
7307

    
7308
class FairParGenericSet;
7309
class FairParSet;
7310
class TString;
7311

    
7312
class FairGenericParAsciiFileIo : public FairDetParAsciiFileIo
7313
{
7314
  public:
7315
    FairGenericParAsciiFileIo(std::fstream* f=0);
7316
    ~FairGenericParAsciiFileIo() {}
7317
    Bool_t init(FairParSet*);
7318
    Int_t write(FairParSet*);
7319
  private:
7320

    
7321
    ClassDef(FairGenericParAsciiFileIo,0) // I/O from Ascii file for parameter containers derived from FairParGenericSet
7322
    Bool_t readGenericSet(FairParGenericSet* pPar);
7323
    Int_t writeGenericSet(FairParGenericSet* pPar);
7324

    
7325
    template <class type> const UChar_t* readData(type,const Char_t*,TString&,Int_t&);
7326
    template <class type> void writeData(type*,Int_t);
7327
};
7328

    
7329
#endif  /* !FAIRGENERICPARASCIIFILEIO_H */
7330
/********************************************************************************
7331
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
7332
 *                                                                              *
7333
 *              This software is distributed under the terms of the             * 
7334
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *  
7335
 *                  copied verbatim in the file "LICENSE"                       *
7336
 ********************************************************************************/
7337
#ifndef FAIRGENERICPARROOTFILEIO_H
7338
#define FAIRGENERICPARROOTFILEIO_H
7339

    
7340
#include "FairDetParRootFileIo.h"       // for FairDetParRootFileIo
7341

    
7342
#include "Rtypes.h"                    // for ClassDef macro
7343

    
7344
class FairParRootFile;
7345
class FairParSet;
7346

    
7347
class FairGenericParRootFileIo : public FairDetParRootFileIo
7348
{
7349
  public:
7350
    FairGenericParRootFileIo(FairParRootFile* f=0);
7351
    ~FairGenericParRootFileIo() {}
7352
    Bool_t init(FairParSet*);
7353
    ClassDef(FairGenericParRootFileIo,0) // I/O from ROOT file for parameter containers derived from FairParGenericSet
7354
};
7355

    
7356
#endif  /* !FAIRGENERICPARROOTFILEIO_H */
7357
/********************************************************************************
7358
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
7359
 *                                                                              *
7360
 *              This software is distributed under the terms of the             * 
7361
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *  
7362
 *                  copied verbatim in the file "LICENSE"                       *
7363
 ********************************************************************************/
7364
#ifndef FAIRPARASCIFILEIIO_H
7365
#define FAIRPARASCIFILEIIO_H
7366

    
7367
#include "FairParIo.h"                  // for FairParIo
7368

    
7369
#include "Riosfwd.h"                    // for fstream
7370
#include "Rtypes.h"                     // for Bool_t, Text_t, etc
7371

    
7372
#include <fstream>                      // for fstream, etc
7373

    
7374
class TList;
7375

    
7376
class FairParAsciiFileIo : public FairParIo
7377
{
7378
  protected:
7379
    std::fstream* file;      // pointer to a file
7380
  public:
7381
    FairParAsciiFileIo();
7382

    
7383
    // default destructor closes an open file and deletes list of I/Os
7384
    ~FairParAsciiFileIo();
7385

    
7386
    // opens file
7387
    // if a file is already open, this file will be closed
7388
    // activates detector I/Os
7389
    Bool_t open(const Text_t* fname, const Text_t* status="in");
7390

    
7391
    // concatenate files whose names are stored in the TList
7392
    // TList holds list od TObjStrings
7393
    // create file all.par in local working directory
7394
    // calls open to open the generated file all.par
7395
    Bool_t open(const TList* fnamelist, const Text_t* status="in");
7396

    
7397
    // closes file
7398
    void close();
7399

    
7400
    // returns kTRUE if file is open
7401
    Bool_t check() {
7402
      if (file) { return (file->rdbuf()->is_open()==1); }
7403
      else { return kFALSE; }
7404
    }
7405

    
7406
    // prints information about the file and the detector I/Os
7407
    void print();
7408

    
7409
    std::fstream* getFile();
7410
  private:
7411
    FairParAsciiFileIo(const FairParAsciiFileIo&);
7412
    FairParAsciiFileIo& operator=(const FairParAsciiFileIo&);
7413

    
7414
    ClassDef(FairParAsciiFileIo,0) // Parameter I/O from ASCII files
7415
};
7416

    
7417
#endif  /* !FAIRPARASCIIFILEIO_H */
7418

    
7419
/********************************************************************************
7420
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
7421
 *                                                                              *
7422
 *              This software is distributed under the terms of the             * 
7423
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *  
7424
 *                  copied verbatim in the file "LICENSE"                       *
7425
 ********************************************************************************/
7426
#ifndef FAIRPARGENERICSET_H
7427
#define FAIRPARGENERICSET_H
7428

    
7429
#include "FairParSet.h"                 // for FairParSet
7430

    
7431
#include "Rtypes.h"                     // for Bool_t, etc
7432

    
7433
class FairParIo;
7434
class FairParamList;
7435

    
7436
class FairParGenericSet : public FairParSet
7437
{
7438
  public:
7439
    FairParGenericSet(const char* name,const char* title,const char* context, Bool_t ownership=kFALSE)
7440
      : FairParSet(name,title,context,ownership) {}
7441
    virtual ~FairParGenericSet() {}
7442
    virtual void putParams(FairParamList*)=0;
7443
    virtual Bool_t getParams(FairParamList*)=0;
7444
    virtual void printParams();
7445

    
7446
    Bool_t init(FairParIo* inp);
7447
    Int_t  write(FairParIo* output);
7448

    
7449
   // DB add on
7450
    void fill(UInt_t) {};
7451
    void store(UInt_t) {};
7452

    
7453
  protected:
7454
    FairParGenericSet()
7455
      : FairParSet() {}
7456
    ClassDef(FairParGenericSet,1) // Base class for generic-style parameter containers
7457
};
7458

    
7459
#endif  /* !FAIRPARGENERICSET_H */
7460
/********************************************************************************
7461
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
7462
 *                                                                              *
7463
 *              This software is distributed under the terms of the             * 
7464
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *  
7465
 *                  copied verbatim in the file "LICENSE"                       *
7466
 ********************************************************************************/
7467
#ifndef FAIRPARIO_H
7468
#define FAIRPARIO_H
7469

    
7470
#include "TObject.h"                    // for TObject
7471

    
7472
#include "Rtypes.h"                     // for Bool_t, Text_t, etc
7473
#include "TString.h"                    // for TString
7474

    
7475
class FairDetParIo;
7476
class FairRtdbRun;
7477
class TList;
7478

    
7479
class FairParIo : public TObject
7480
{
7481
  protected:
7482
    TList* detParIoList;  // list of detector I/Os
7483
    Bool_t autoWritable;  // flag indicating if automatic write is possible
7484
    TString filename;
7485
  public:
7486
    FairParIo();
7487
    virtual ~FairParIo();
7488
    virtual FairDetParIo* getDetParIo(const Text_t*);
7489
    virtual void setDetParIo(FairDetParIo*);
7490
    virtual void removeDetParIo(Text_t*);
7491
    void setInputNumber(Int_t);
7492
    virtual void close() {;}
7493

    
7494
    // returns the filename
7495
    const char* getFilename() {return filename.Data();}
7496

    
7497
    // creates input/output class for a special detector and stores pointer
7498
    // used only for Oracle input/output
7499
    // (code in  class OraIo)
7500
    virtual void setDetParIo(Text_t*) {;}
7501

    
7502
    // prints information about input/output
7503
    virtual void print() {;}
7504

    
7505
    // checks if the input/output is open
7506
    virtual Bool_t check() { return kFALSE; }
7507

    
7508
    // reads versions of parameter containers for an event file
7509
    virtual void readVersions(FairRtdbRun*) {;}
7510

    
7511
    // sets global file pointer in ROOT if input/output is a ROOT-file
7512
    // (code in FairParRootFileIo)
7513
    virtual void cd() {;}
7514

    
7515
    // set and get for flag autoWritable
7516
    void setAutoWritable(Bool_t f=kTRUE) {autoWritable=f;}
7517
    Bool_t isAutoWritable() {return autoWritable;}
7518

    
7519
  private:
7520
    FairParIo(const FairParIo&);
7521
    FairParIo& operator=(const FairParIo&);
7522

    
7523
    ClassDef(FairParIo,0) // Base class for all parameter I/Os
7524
};
7525

    
7526
#endif  /* !FAIRPARIO_H */
7527

    
7528

    
7529

    
7530

    
7531
/********************************************************************************
7532
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
7533
 *                                                                              *
7534
 *              This software is distributed under the terms of the             * 
7535
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *  
7536
 *                  copied verbatim in the file "LICENSE"                       *
7537
 ********************************************************************************/
7538
#ifndef FAIRPARROOTFILEIO_H
7539
#define FAIRPARROOTFILEIO_H
7540

    
7541
#include "FairParIo.h"                  // for FairParIo
7542

    
7543
#include "Rtypes.h"                     // for Bool_t, Text_t, Int_t, etc
7544
#include "TFile.h"                      // for TFile
7545
#include "TNamed.h"                     // for TNamed
7546

    
7547
#include <fstream>
7548
using std::fstream;
7549

    
7550
class FairRtdbRun;
7551
class TKey;
7552
class TList;
7553

    
7554
class FairParRootFile : public TNamed
7555
{
7556
  public:
7557
    FairRtdbRun* run;     //! pointer to current run in ROOT file
7558
    FairParRootFile(const Text_t* fname, Option_t* option="READ",
7559
                    const Text_t* ftitle="",Int_t compress=1);
7560
    FairParRootFile(TFile* f);
7561
    ~FairParRootFile();
7562
    FairRtdbRun* getRun() {return run;}
7563
    void readVersions(FairRtdbRun*);
7564

    
7565
    Bool_t IsOpen() {return RootFile->IsOpen();}
7566
    void   cd() {RootFile->cd();}
7567
    Bool_t IsWritable() {return RootFile->IsWritable();}
7568

    
7569
    TKey* GetKey(Text_t* t) { return RootFile->GetKey(t);}
7570
    TList* GetListOfKeys() { return RootFile->GetListOfKeys();}
7571
    void Close() {RootFile->Close();}
7572

    
7573
  protected:
7574
    TFile* RootFile;
7575

    
7576
  private:
7577
    FairParRootFile(const FairParRootFile&);
7578
    FairParRootFile& operator=(const FairParRootFile&);
7579

    
7580
    ClassDef(FairParRootFile,0) // ROOT file for Parameter I/O
7581

    
7582
};
7583

    
7584

    
7585
class FairParRootFileIo : public FairParIo
7586
{
7587
  protected:
7588
    FairParRootFile* file;  // pointer to ROOT file
7589
    Bool_t fMerging;
7590
  public:
7591
    FairParRootFileIo();
7592
    FairParRootFileIo(Bool_t merged);
7593
    ~FairParRootFileIo();
7594
    Bool_t open(const Text_t* fname, Option_t* option="READ",
7595
                const Text_t* ftitle="",Int_t compress=1);
7596
    Bool_t open(const TList* fnamelist, Option_t* option="READ",
7597
                const Text_t* ftitle="",Int_t compress=1);
7598
    void close();
7599
    void print();
7600
    FairParRootFile* getParRootFile();
7601
    void readVersions(FairRtdbRun*);
7602
    TList* getKeys();
7603
    Bool_t check() {
7604
      // returns kTRUE if file is open
7605
      if (file) { return file->IsOpen(); }
7606
      else { return kFALSE; }
7607
    }
7608
    void cd() {
7609
      // sets the global ROOT file pointer gFile
7610
      if (file) { file->cd(); }
7611
    }
7612
    /**
7613
    Open an existing root file for IO
7614
    */
7615
    Bool_t open(TFile* f);
7616
    void setMerging( Bool_t io ) { fMerging=io;}
7617

    
7618
  private:
7619
    FairParRootFileIo(const FairParRootFileIo&);
7620
    FairParRootFileIo& operator=(const FairParRootFileIo&);
7621

    
7622
    ClassDef(FairParRootFileIo,0) // Parameter I/O from ROOT files
7623
};
7624

    
7625
#endif  /* !FAIRPARROOTFILEIO_H */
7626

    
7627
/********************************************************************************
7628
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
7629
 *                                                                              *
7630
 *              This software is distributed under the terms of the             * 
7631
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *  
7632
 *                  copied verbatim in the file "LICENSE"                       *
7633
 ********************************************************************************/
7634
#ifndef FAIRPARSET_H
7635
#define FAIRPARSET_H
7636

    
7637
#include "TNamed.h"
7638
#include "Rtypes.h"                     // for Int_t, Bool_t, etc
7639
#include "TString.h"                    // for TString
7640

    
7641
class FairLogger;
7642
class FairParIo;
7643

    
7644
class FairParSet : public TObject
7645
{
7646
  protected:
7647
    TString fName;         //
7648
    TString fTitle;        //
7649
    TString detName;         //! name of the detector the container belongs to
7650
    Int_t versions[3];       //! versions of container in the 2 possible inputs
7651
    Bool_t status;           //! static flag
7652
    Bool_t changed;          //! flag is kTRUE if parameters have changed
7653
    Bool_t  owned;          //! if flag is KTRUE FairDB has the par. class ownership
7654
    TString paramContext;    // Context/purpose for parameters and conditions
7655
    TString author;          // Author of parameters
7656
    TString description ;    // Description of parameters
7657
    /** Fair Logger */
7658
    FairLogger*  fLogger;  //!
7659

    
7660
  public:
7661
    FairParSet(const char* name="",const char* title="",const char* context="", Bool_t owner=kFALSE);
7662
    virtual ~FairParSet() {}
7663

    
7664
    virtual const char* GetName() const {return static_cast<const char*>(fName.Data());}
7665
    virtual const char* GetTitle() const {return static_cast<const char*>(fTitle.Data());}
7666

    
7667
    virtual Bool_t init();
7668
    virtual Bool_t init(FairParIo*) { return kFALSE; }
7669
    virtual Int_t write();
7670
    virtual Int_t write(FairParIo*) { return kFALSE; }
7671
    virtual void clear() {}
7672
    virtual void print();
7673

    
7674
    const char* getDetectorName() {return detName.Data();}
7675
    void resetInputVersions();
7676

    
7677
    void setInputVersion(Int_t v=-1,Int_t i=0) {
7678
      if (i>=0 && i<3) { versions[i]=v; }
7679
    }
7680
    Int_t getInputVersion(Int_t i) {
7681
      if (i>=0 && i<3) { return versions[i]; }
7682
      else { return 0; }
7683
    }
7684

    
7685
    void setStatic(Bool_t flag=kTRUE) {status=flag;}
7686
    Bool_t isStatic() {return status;}
7687

    
7688
    void setOwnership(Bool_t flag=kTRUE) {owned=flag;}
7689
    Bool_t isOwned() {return owned;}
7690

    
7691
    void setChanged(Bool_t flag=kTRUE) {changed=flag;}
7692
    Bool_t hasChanged() {return changed;}
7693

    
7694
    const char* getParamContext() const { return paramContext.Data(); }
7695

    
7696
    void setAuthor(const char* s) {author=s;}
7697
    const char* getAuthor() const { return author.Data(); }
7698

    
7699
    void setDescription(const char* s) {description=s;}
7700
    const char* getDescription() const { return description.Data(); }
7701

    
7702
    void copyComment(FairParSet& r) {
7703
      author=r.getAuthor();
7704
      description=r.getDescription();
7705
    }
7706

    
7707

    
7708
    virtual void fill(UInt_t) {};
7709
    virtual void store(UInt_t) {};
7710
    
7711

    
7712
    FairParSet& operator=(const FairParSet&);
7713
    FairParSet(const FairParSet&);
7714

    
7715
    ClassDef(FairParSet,2) // Base class for all parameter containers
7716
};
7717

    
7718
#endif  /* !FAIRPARSET_H */
7719

    
7720
/********************************************************************************
7721
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
7722
 *                                                                              *
7723
 *              This software is distributed under the terms of the             * 
7724
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *  
7725
 *                  copied verbatim in the file "LICENSE"                       *
7726
 ********************************************************************************/
7727
#ifndef FAIRPARAMLIST_H
7728
#define FAIRPARAMLIST_H
7729

    
7730
#include "TNamed.h"                     // for TNamed
7731

    
7732
#include "Rtypes.h"                     // for Text_t, Int_t, Bool_t, etc
7733
#include "TArrayC.h"                    // for TArrayC
7734
#include "TFile.h"                      // for TFile
7735
#include "TList.h"                      // for TList
7736
#include "TObject.h"                    // for TObject
7737
#include "TROOT.h"                      // for TROOT, gROOT
7738
#include "TSeqCollection.h"             // for TSeqCollection
7739
#include "TString.h"                    // for TString
7740

    
7741
class FairLogger;
7742
class TArrayD;
7743
class TArrayF;
7744
class TArrayI;
7745

    
7746
class FairParamObj : public TNamed
7747
{
7748
  protected:
7749
    UChar_t* paramValue;    // Pointer to binary array
7750
    Int_t arraySize;        // Size of binary array
7751
    TString paramType;      // Type of parameter value or class name
7752
    Bool_t basicType;       // kTRUE for C-types and C-type parameter arrays, kFALSE for classes
7753
    Int_t bytesPerValue;    // number of bytes per value
7754
    Int_t classVersion;     // Code version of classes stored as binary
7755
    UChar_t* streamerInfo;  // Pointer to binary array container the streamer info
7756
    Int_t streamerInfoSize; // Size of streamer info array
7757
  public:
7758
    FairParamObj(const Text_t* name="");
7759
    FairParamObj(FairParamObj&);
7760
    FairParamObj(const Text_t*,Int_t);
7761
    FairParamObj(const Text_t*,Bool_t);
7762
    FairParamObj(const Text_t*,UInt_t);
7763
    FairParamObj(const Text_t*,Float_t);
7764
    FairParamObj(const Text_t*,Double_t);
7765
    FairParamObj(const Text_t*,const Int_t*,const Int_t);
7766
    FairParamObj(const Text_t*,const UInt_t*,const Int_t);
7767
    FairParamObj(const Text_t*,const Float_t*,const Int_t);
7768
    FairParamObj(const Text_t*,const Double_t*,const Int_t);
7769
    FairParamObj(const Text_t*,const Text_t*);
7770
    FairParamObj(const Text_t*,const Char_t*,const Int_t);
7771
    FairParamObj(const Text_t*,const UChar_t*,const Int_t);
7772
    ~FairParamObj();
7773
    void setParamType(const Text_t* t);
7774
    UChar_t* setLength(Int_t l);
7775
    void setParamValue(UChar_t*,const Int_t);
7776
    void setClassVersion(const Int_t v) { classVersion=v; }
7777
    UChar_t* setStreamerInfoSize(Int_t);
7778
    void setStreamerInfo(UChar_t*,const Int_t);
7779
    UChar_t* getParamValue() { return paramValue; }
7780
    Bool_t isBasicType() { return basicType; }
7781
    const char* getParamType() { return paramType.Data(); }
7782
    Int_t getBytesPerValue() { return bytesPerValue; }
7783
    Int_t getClassVersion() { return classVersion; }
7784
    Int_t getLength() { return arraySize; }
7785
    Int_t getNumParams();
7786
    UChar_t* getStreamerInfo() { return streamerInfo; }
7787
    Int_t getStreamerInfoSize() { return streamerInfoSize; }
7788
    void print();
7789
  protected:
7790
    template <class type> void printData(type*,Int_t);
7791

    
7792
  private:
7793
    FairParamObj& operator=(const FairParamObj&);
7794

    
7795
    ClassDef(FairParamObj,0) // Class for binary parameter object (name + binary array)
7796
};
7797

    
7798

    
7799
class FairParamList : public TObject
7800
{
7801
  protected:
7802
    TList* paramList;      // List for parameters stored as string
7803
    FairLogger* fLogger;  // FairRoot logging mechanism
7804
    class FairParamTFile : public TFile
7805
    {
7806
      public:
7807
        FairParamTFile() {
7808
          // Create StreamerInfo index
7809
          Int_t lenIndex = gROOT->GetListOfStreamerInfo()->GetSize()+1;
7810
          if (lenIndex < 5000) { lenIndex = 5000; }
7811
          fClassIndex = new TArrayC(lenIndex);
7812
        }
7813
        ~FairParamTFile() {
7814
          delete fClassIndex;
7815
          fClassIndex=0;
7816
        }
7817
    };
7818
  public:
7819
    FairParamList();
7820
    ~FairParamList();
7821
    void add(FairParamObj&);
7822
    void add(const Text_t*,const Text_t*);
7823
    void add(const Text_t*,Int_t);
7824
    void add(const Text_t*,Bool_t);
7825
    void add(const Text_t*,UInt_t);
7826
    void add(const Text_t*,Float_t);
7827
    void add(const Text_t*,Double_t);
7828
    void add(const Text_t*,TArrayI&);
7829
    void add(const Text_t*,TArrayC&);
7830
    void add(const Text_t*,TArrayF&);
7831
    void add(const Text_t*,TArrayD&);
7832
    void add(const Text_t*,const UChar_t*,const Int_t);
7833
    void add(const Text_t*,const Int_t*,const Int_t);
7834
    void add(const Text_t*,const Float_t*,const Int_t);
7835
    void add(const Text_t*,const Double_t*,const Int_t);
7836
    void addObject(const Text_t*,TObject*);
7837
    Bool_t fill(const Text_t*,Text_t*,const Int_t);
7838
    Bool_t fill(const Text_t*,Int_t*,const Int_t nValues=1);
7839
    Bool_t fill(const Text_t*,Bool_t*,const Int_t nValues=1);
7840
    Bool_t fill(const Text_t*,UInt_t*,const Int_t nValues=1);
7841
    Bool_t fill(const Text_t*,Float_t*,const Int_t nValues=1);
7842
    Bool_t fill(const Text_t*,Double_t*,const Int_t nValues=1);
7843
    Bool_t fill(const Text_t*,UChar_t*,const Int_t nValues=1);
7844
    Bool_t fill(const Text_t*,TArrayI*);
7845
    Bool_t fill(const Text_t*,TArrayC*);
7846
    Bool_t fill(const Text_t*,TArrayF*);
7847
    Bool_t fill(const Text_t*,TArrayD*);
7848
    Bool_t fillObject(const Text_t*,TObject*);
7849
    void print();
7850
    FairParamObj* find(const Text_t* name) {
7851
      return static_cast<FairParamObj*>(paramList->FindObject(name));
7852
    }
7853
    TList* getList() { return paramList; }
7854
  private:
7855
    FairParamList(const FairParamList&);
7856
    FairParamList& operator=(const FairParamList&);
7857

    
7858
    ClassDef(FairParamList,3) // Class for lists of parameters (of type FairParamObj)
7859
};
7860

    
7861
#endif  /* !FAIRPARAMLIST_H */
7862

    
7863
/********************************************************************************
7864
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
7865
 *                                                                              *
7866
 *              This software is distributed under the terms of the             * 
7867
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *  
7868
 *                  copied verbatim in the file "LICENSE"                       *
7869
 ********************************************************************************/
7870
#ifndef FAIRRTDBRUN_H
7871
#define FAIRRTDBRUN_H
7872

    
7873
#include "TNamed.h"                     // for TNamed
7874

    
7875
#include "Riosfwd.h"                    // for fstream
7876
#include "Rtypes.h"                     // for Int_t, Text_t, UInt_t, etc
7877
#include "TString.h"                    // for TString
7878

    
7879
#include <stdio.h>                      // for sprintf, sscanf
7880
#include <fstream>                      // for fstream
7881

    
7882
class TList;
7883
using std::fstream;
7884

    
7885
class FairParVersion : public TNamed
7886
{
7887
  protected:
7888
    Int_t inputVersions[3]; //! version of the parameter container in the 2 possible inputs
7889
    Int_t rootVersion;      // version of the parameter container in the ROOT output file
7890
  public:
7891
    FairParVersion() : TNamed(),rootVersion(0) {}
7892
    FairParVersion(Text_t* name);
7893
    ~FairParVersion() {}
7894
    void setInputVersion(Int_t v=-1,Int_t i=0) {
7895
      if (i>=0 && i<3) { inputVersions[i]=v; }
7896
    }
7897
    Int_t getInputVersion(Int_t i) {
7898
      if (i>=0 && i<3) { return inputVersions[i]; }
7899
      else { return -1; }
7900
    }
7901
    void resetInputVersions() {
7902
      for(Int_t i=0; i<3; i++) {inputVersions[i]=-1;}
7903
    }
7904
    void setRootVersion(Int_t v) {rootVersion=v;}
7905
    Int_t getRootVersion() {return rootVersion;}
7906
    ClassDef(FairParVersion,1) // Class for parameter versions
7907
};
7908

    
7909
class FairRtdbRun : public TNamed
7910
{
7911
  protected:
7912
    TList* parVersions;   // List of container names with the versions
7913
    TString refRun;       //! name of the reference run for initialization
7914
  public:
7915
    FairRtdbRun();
7916
    FairRtdbRun(const Text_t* name,const Text_t* refName="");
7917
    FairRtdbRun(Int_t r,Int_t rr=-1);
7918
    FairRtdbRun(FairRtdbRun& run);
7919
    ~FairRtdbRun();
7920
    inline UInt_t getRunId(void);
7921
    void addParVersion(FairParVersion* pv);
7922
    FairParVersion* getParVersion(const Text_t* name);
7923
    TList* getParVersions() {return parVersions;}
7924
    const Text_t* getRefRun() {return refRun.Data();}
7925
    void setRefRun(Text_t* s) {refRun=s;}
7926
    inline void setRefRun(Int_t r);
7927
    void resetInputVersions();
7928
    void resetOutputVersions();
7929
    void print();
7930
    void write(std::fstream&);
7931

    
7932
  private:
7933
    FairRtdbRun& operator=(const FairRtdbRun&);
7934

    
7935
    ClassDef(FairRtdbRun,1) // Class for parameter version management of a run
7936
};
7937

    
7938
// -------------------- inlines ---------------------------
7939

    
7940
inline UInt_t FairRtdbRun::getRunId(void)
7941
{
7942
  UInt_t r;
7943
  sscanf(GetName(),"%i",&r);
7944
  return r;
7945
}
7946

    
7947
inline void FairRtdbRun::setRefRun(Int_t r)
7948
{
7949
  if (r==-1) { refRun=""; }
7950
  else {
7951
    char name[255];
7952
    sprintf(name,"%i",r);
7953
    refRun=name;
7954
  }
7955
}
7956

    
7957
#endif  /* !FAIRRTDBRUN_H */
7958

    
7959
/********************************************************************************
7960
 *    Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH    *
7961
 *                                                                              *
7962
 *              This software is distributed under the terms of the             * 
7963
 *         GNU Lesser General Public Licence version 3 (LGPL) version 3,        *  
7964
 *                  copied verbatim in the file "LICENSE"                       *
7965
 ********************************************************************************/
7966
#ifndef FAIRRUNTIMEDB_H
7967
#define FAIRRUNTIMEDB_H
7968

    
7969
#include "TObject.h"                    // for TObject
7970

    
7971
#include "Rtypes.h"                     // for Bool_t, Int_t, Text_t, etc
7972
#include "TList.h"                      // for TList
7973
#include "TString.h"                    // for TString
7974

    
7975
class FairContFact;
7976
class FairLogger;
7977
class FairParIo;
7978
class FairParSet;
7979
class FairRtdbRun;
7980

    
7981
static TList contFactories;    //! list of container factories
7982

    
7983
class FairRuntimeDb : public TObject
7984
{
7985
  private:
7986
    static FairRuntimeDb* gRtdb; //!
7987

    
7988
  protected:
7989
    FairRuntimeDb(void);
7990
    TList* containerList;    // list of parameter containers
7991
    TList* runs;             // list of runs
7992
    FairParIo* firstInput;    // first (prefered) input for parameters
7993
    FairParIo* secondInput;   // second input (used if not found in first input)
7994
    FairParIo* output;        // output for parameters
7995
    FairRtdbRun* currentRun;  // Current run
7996
    TString currentFileName; // Name of current event file
7997
    Bool_t versionsChanged;  // flag for write of list of runs (set kTRUE by each write)
7998
    Bool_t isRootFileOutput; // flag indicating that the output is a ROOT file
7999
    /** Fair Logger */
8000
    FairLogger*  fLogger;  //!
8001

    
8002
    /**
8003
     * Select which IO type to use.
8004
     */
8005
    typedef enum {
8006
      UNKNOWN_Type    = 0,
8007
      AsciiFileOutput = 1, // Ascii in-out-put
8008
      RootFileOutput  = 2, // Root Files
8009
      RootTSQLOutput  = 3  // Use a TSQL db
8010
    } ParamIOType;
8011
    ParamIOType ioType;//IO Type
8012

    
8013
  public:
8014
    static FairRuntimeDb* instance(void);
8015
    ~FairRuntimeDb(void);
8016

    
8017
    Bool_t addParamContext(const char*);
8018
    void printParamContexts();
8019
    void addContFactory(FairContFact*);
8020
    FairContFact* getContFactory(const Text_t*);
8021

    
8022
    Bool_t addContainer(FairParSet*);
8023
    FairParSet* getContainer(const Text_t*);
8024
    FairParSet* findContainer(const char*);
8025
    void removeContainer(Text_t*);
8026
    void removeAllContainers(void);
8027
    Bool_t initContainers(Int_t runId,Int_t refId=-1,const Text_t* fileName="");
8028
    void setContainersStatic(Bool_t f=kTRUE);
8029
    Bool_t writeContainers(void);
8030
    Bool_t writeContainer(FairParSet*,FairRtdbRun*,FairRtdbRun* refRun=0);
8031

    
8032
    FairRtdbRun* addRun(Int_t runId,Int_t refId=-1);
8033
    FairRtdbRun* getRun(Int_t);
8034
    FairRtdbRun* getRun(Text_t*);
8035
    FairRtdbRun* getCurrentRun(void) {return currentRun;}
8036
    Text_t const* getCurrentFileName() {return currentFileName.Data();}
8037
    void clearRunList(void);
8038

    
8039
    void removeRun(Text_t*);
8040

    
8041
    Bool_t setInputVersion(Int_t run,Text_t* container,
8042
                           Int_t version,Int_t inputNumber);
8043
    Bool_t setRootOutputVersion(Int_t run,Text_t* container,Int_t version);
8044
    void setVersionsChanged(Bool_t f=kTRUE) {versionsChanged=f;}
8045
    void resetInputVersions(void);
8046
    void resetOutputVersions(void);
8047
    void resetAllVersions(void);
8048

    
8049
    Bool_t readAll(void);
8050
    void writeVersions(void);
8051
    void saveOutput(void);
8052

    
8053
    Bool_t setFirstInput(FairParIo*);
8054
    Bool_t setSecondInput(FairParIo*);
8055
    Bool_t setOutput(FairParIo*);
8056
    FairParIo* getFirstInput(void);
8057
    FairParIo* getSecondInput(void);
8058
    FairParIo* getOutput(void);
8059
    void closeFirstInput(void);
8060
    void closeSecondInput(void);
8061
    void closeOutput(void);
8062
    void activateParIo(FairParIo*);
8063
    TList* getListOfContainers() {return containerList;}
8064
    void print(void);
8065

    
8066
    Int_t findOutputVersion(FairParSet*);
8067

    
8068
  private:
8069
    FairRuntimeDb(const FairRuntimeDb& M);
8070
    FairRuntimeDb& operator= (const  FairRuntimeDb&) {return *this;}
8071
    Bool_t initContainers(void);
8072

    
8073
    ClassDef(FairRuntimeDb,0) // Class for runtime database
8074
};
8075

    
8076
#endif  /* !FAIRRUNTIMEDB_H */
8077

    
8078
#undef  _BACKWARD_BACKWARD_WARNING_H
8079

    
8080
In file included from input_line_8:1:
8081
/home/vratik/workspace/expertroot_H5/macro/H5run/eventDisplay.C:11:7: error: member access into
8082
      incomplete type 'FairRuntimeDb'
8083
  rtdb->setFirstInput(parIo1);
8084
      ^
8085
G__ParBaseDict dictionary forward declarations' payload:22:82: note: forward declaration of
8086
      'FairRuntimeDb'
8087
class __attribute__((annotate(R"ATTRDUMP(Class for runtime database)ATTRDUMP"))) FairRuntimeDb;
8088
                                                                                 ^
8089
root [1] .q
8090