#include "RVersion.h" // for ROOT_VERSION_CODE #include "Rtypes.h" // for Bool_t, etc #include "TLorentzVector.h" // for TLorentzVector class FairField; /** * The Main Application for GEANE * @author M. Al-Turany * @version 0.1 * @since 10.11.10 */ class FairGeaneApplication : public TVirtualMCApplication { public: /** default constructor */ FairGeaneApplication(); /** Special constructor, used for initializing G3 for Geane track propagation *@param Debug true to print step info*/ FairGeaneApplication(Bool_t Debug); /** default destructor */ virtual ~FairGeaneApplication(); #if ROOT_VERSION_CODE < 333824 /** Calculate user field b at point x */ void Field(const Double_t* x, Double_t* b) const; // MC Application #endif /** Return Field used in simulation*/ FairField* GetField() {return fxField;} /** Initialize MC engine */ void InitMC(const char* setup, const char* cuts); /** * Set the magnetic field for simulation or Geane * @param field: magnetic field */ void SetField(FairField* field); /** Define action at each step, dispatch the action to the corresponding detectors */ void GeaneStepping(); // MC Application void ConstructGeometry(); /** Singelton instance */ static FairGeaneApplication* Instance(); /**pure virtual functions that hasve to be implimented */ void InitGeometry() {;} void GeneratePrimaries() {;} void BeginEvent() {;} void BeginPrimary() {;} void PreTrack() {;} void PostTrack() {;} void FinishPrimary() {;} void FinishEvent() {;} void Stepping() {;} void StopRun() {;} private: // data members /**Magnetic Field Pointer*/ FairField* fxField; // /**MC Engine 1= Geant3, 2 = Geant4*/ Int_t fMcVersion; // mc Version /** Debug flag*/ Bool_t fDebug;//! TLorentzVector fTrkPos; //! ClassDef(FairGeaneApplication,1) //Interface to MonteCarlo application private: FairGeaneApplication(const FairGeaneApplication&); FairGeaneApplication& operator=(const FairGeaneApplication&); }; // inline functions inline FairGeaneApplication* FairGeaneApplication::Instance() { return static_cast(TVirtualMCApplication::Instance());} #endif /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ // ------------------------------------------------------------------------- // ----- FairGenerator header file ----- // ----- Created 09/06/04 by D. Bertini / V. Friese ----- // ------------------------------------------------------------------------- /** FairGenerator.h *@author D.Bertini *@author V.Friese * The FairGenerator is the abtract base class for the generators used to generate input for the transport simulation.Each concrete generator class derived from this one must implement the abtract method ReadEvent, which has to use the method FairPrimaryGenerator::AddTrack. **/ #ifndef FAIRGENERATOR_H #define FAIRGENERATOR_H #include "TNamed.h" // for TNamed #include "Rtypes.h" // for Bool_t, etc class FairPrimaryGenerator; class FairGenerator : public TNamed { public: /** Default constructor. **/ FairGenerator(); /** Constructor with name and title **/ FairGenerator(const char* name, const char* title="FAIR Generator"); /** Destructor. **/ virtual ~FairGenerator(); /** Abstract method ReadEvent must be implemented by any derived class. It has to handle the generation of input tracks (reading from input file) and the handing of the tracks to the FairPrimaryGenerator. I t is called from FairMCApplication. *@param pStack The stack *@return kTRUE if successful, kFALSE if not **/ virtual Bool_t ReadEvent(FairPrimaryGenerator* primGen) = 0; /**Initialize the generator if needed */ virtual Bool_t Init() { return kTRUE;} /** Clone this object (used in MT mode only) */ virtual FairGenerator* CloneGenerator() const; protected: /** Copy constructor */ FairGenerator(const FairGenerator&); /** Assignment operator */ FairGenerator& operator= (const FairGenerator&); ClassDef(FairGenerator,1); }; #endif /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ // ------------------------------------------------------------------------- // ----- FairStack header file ----- // ----- Created 10/08/04 by D. Bertini ----- // ------------------------------------------------------------------------- /** FairStack.h *@author D.Bertini * Generic MC stack class **/ #ifndef FAIRGENERICSTACK_H #define FAIRGENERICSTACK_H #include "TClonesArray.h" #include "TVirtualMCStack.h" // for TVirtualMCStack #include "Rtypes.h" // for Double_t, Int_t, etc #include "TMCProcess.h" // for TMCProcess #include // for NULL class FairLogger; class TParticle; class TRefArray; class TIterator; class FairGenericStack : public TVirtualMCStack { public: /** Default constructor **/ FairGenericStack(); /** Destructor with estimated array size **/ FairGenericStack(Int_t size); /** Destructor **/ virtual ~FairGenericStack(); /** Virtual method PushTrack. ** Add a TParticle to the stack. *@param toBeDone Flag for tracking *@param parentID Index of mother particle *@param pdgCode Particle type (PDG encoding) *@param px,py,pz Momentum components at start vertex [GeV] *@param e Total energy at start vertex [GeV] *@param vx,vy,vz Coordinates of start vertex [cm] *@param time Start time of track [s] *@param polx,poly,polz Polarisation vector *@param proc Production mechanism (VMC encoding) *@param ntr Track number (filled by the stack) *@param weight Particle weight *@param is Generation status code (whatever that means) **/ virtual void PushTrack(Int_t toBeDone, Int_t parentID, Int_t pdgCode, Double_t px, Double_t py, Double_t pz, Double_t e, Double_t vx, Double_t vy, Double_t vz, Double_t time, Double_t polx, Double_t poly, Double_t polz, TMCProcess proc, Int_t& ntr, Double_t weight, Int_t is); /** Virtual method PushTrack. ** Add a TParticle to the stack. *@param toBeDone Flag for tracking *@param parentID Index of mother particle *@param pdgCode Particle type (PDG encoding) *@param px,py,pz Momentum components at start vertex [GeV] *@param e Total energy at start vertex [GeV] *@param vx,vy,vz Coordinates of start vertex [cm] *@param time Start time of track [s] *@param polx,poly,polz Polarisation vector *@param proc Production mechanism (VMC encoding) *@param ntr Track number (filled by the stack) *@param weight Particle weight *@param is Generation status code (whatever that means) *@param secondparentID used fot the index of mother of primery in the list **/ virtual void PushTrack(Int_t toBeDone, Int_t parentID, Int_t pdgCode, Double_t px, Double_t py, Double_t pz, Double_t e, Double_t vx, Double_t vy, Double_t vz, Double_t time, Double_t polx, Double_t poly, Double_t polz, TMCProcess proc, Int_t& ntr, Double_t weight, Int_t is, Int_t secondparentID); /** Virtual method PopNextTrack. ** Gets next particle for tracking from the stack. *@param iTrack index of popped track *@return Pointer to the TParticle of the track **/ virtual TParticle* PopNextTrack(Int_t& iTrack); /** Virtual method PopPrimaryForTracking. ** Gets primary particle by index for tracking from stack. *@param iPrim index of primary particle *@return Pointer to the TParticle of the track **/ virtual TParticle* PopPrimaryForTracking(Int_t iPrim); /** Add a TParticle to the fParticles array **/ void AddParticle(TParticle* part); /** Fill the MCTrack output array, applying filter criteria **/ virtual void FillTrackArray(); /** Update the track index in the MCTracks and MCPoints **/ virtual void UpdateTrackIndex(TRefArray* detArray=0); /** Set the list of detectors to be used for filltering the stack*/ void SetDetArrayList(TRefArray* detArray); /** Resets arrays and stack and deletes particles and tracks **/ virtual void Reset(); /** Register the MCTrack array to the Root Manager **/ virtual void Register(); /** Output to screen **@param iVerbose: 0=events summary, 1=track info **/ virtual void Print(Option_t* option="") const; /** Modifiers **/ virtual void SetCurrentTrack(Int_t iTrack); /** Accessors **/ virtual Int_t GetNtrack() const; // Total number of tracks virtual Int_t GetNprimary() const; // Number of primaries virtual TParticle* GetCurrentTrack() const; virtual Int_t GetCurrentTrackNumber() const; virtual Int_t GetCurrentParentTrackNumber() const; virtual TParticle* GetParticle(Int_t) const { return NULL; } virtual TClonesArray* GetListOfParticles() { return NULL; } /** Clone this object (used in MT mode only) */ virtual FairGenericStack* CloneStack() const; protected: /** Copy constructor */ FairGenericStack(const FairGenericStack&); /** Assignment operator */ FairGenericStack& operator=(const FairGenericStack&); /** Fair Logger */ FairLogger* fLogger;//! /** List of detectors registering hits in the simulation */ TRefArray* fDetList; //! /** Iterator for the detector list*/ TIterator* fDetIter; /**Verbosity level*/ Int_t fVerbose; ClassDef(FairGenericStack,1) }; #endif /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ // ------------------------------------------------------------------------- // ----- FairIon header file ----- // ----- Created 27/08/04 by V. Friese / D.Bertini ----- // ------------------------------------------------------------------------- /** FairIon.h *@author V.Friese *@author D.Bertini ** ** A class for the user definition of an ion. It will be instantiated ** from the constructor of the FairIonGenerator. **/ #ifndef FAIRION_H #define FAIRION_H #include "TNamed.h" // for TNamed #include "Rtypes.h" // for Int_t, Double_t, etc class FairLogger; class FairIon: public TNamed { public: /** Default constructor **/ FairIon(); /** Standard constructor *@param name name *@param z atomic number *@param a atomic mass *@param q electric charge *@param e excitation energy *@param m mass [GeV] ** If mass is not given, it will be set to a times the proton mass. **/ FairIon(const char* name, Int_t z, Int_t a, Int_t q, Double_t e=0., Double_t m=0.); void SetParams( const char* name, Int_t z, Int_t a, Int_t q, Double_t e=0., Double_t m=0.) { SetName(name); fZ=z; fA=a; fQ=q; fExcEnergy=e; fMass=m; } /** Destructor **/ virtual ~FairIon(); /** Accessors **/ /** * Return the atomic number */ Int_t GetZ() const { return fZ; } /** * Return the atomic mass */ Int_t GetA() const { return fA; } /** * Return the charge */ Int_t GetQ() const { return fQ; } /** * Return the excitation energy */ Double_t GetExcEnergy() const { return fExcEnergy; } /** * Return the mass in GeV */ Double_t GetMass() const { return fMass; } /** Modifiers **/ /** * Set the excitation energy */ void SetExcEnergy(Double_t eExc) { fExcEnergy = eExc; } /** * Set the mass in GeV */ void SetMass(Double_t mass) { fMass = mass*amu; } private: /** Data members **/ static Int_t fgNIon; //! /// Number of ions instantiated. One per generator. Int_t fZ; /// Atomic number Int_t fA; /// Atomic mass Int_t fQ; /// Electric charge Double_t fExcEnergy; /// Excitation energy [GeV] Double_t fMass; /// Mass [GeV] FairLogger* fLogger; //! /// FairLogger static const Double_t amu; /// .931494028 Gev/c**2 FairIon(const FairIon&); FairIon& operator=(const FairIon&); ClassDef(FairIon,2); }; #endif /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ // ------------------------------------------------------------------------- // ----- FairMCApplication header file ----- // ----- Created 06/01/04 by M. Al-Turany ----- // ------------------------------------------------------------------------- #ifndef FAIR_MC_APPLICATION_H #define FAIR_MC_APPLICATION_H #include "TVirtualMCApplication.h" // for TVirtualMCApplication #include "FairRunInfo.h" // for FairRunInfo #include "RVersion.h" // for ROOT_VERSION_CODE #include "Rtypes.h" // for Int_t, Bool_t, Double_t, etc #include "TLorentzVector.h" // for TLorentzVector #include "TString.h" // for TString #include // for map, multimap, etc #include // for list class FairDetector; class FairEventHeader; class FairField; class FairGenericStack; class FairMCEventHeader; class FairPrimaryGenerator; class FairRadGridManager; class FairRadLenManager; class FairRadMapManager; class FairRootManager; class FairTask; class FairTrajFilter; class FairVolume; class TChain; class TIterator; class TObjArray; class TRefArray; class TTask; class TVirtualMC; /** * The Main Application ( Interface to MonteCarlo application ) * @author M. Al-Turany, D. Bertini * @version 0.1 * @since 12.01.04 */ class FairMCApplication : public TVirtualMCApplication { public: /** Standard constructor *@param name name *@param title title *@param ModList a TObjArray containing all detectors and modules used in this simulation *@param MatName material file name */ FairMCApplication(const char* name, const char* title, TObjArray* ModList, const char* MatName); /** default constructor */ FairMCApplication(); /** default destructor */ virtual ~FairMCApplication(); /** Singelton instance */ static FairMCApplication* Instance(); virtual void AddDecayModes(); /** Add user defined particles (optional) */ virtual void AddParticles(); // MC Application /** Add user defined ions (optional) */ virtual void AddIons(); // MC Application /** *Add user defined Tasks to be executed after each event (optional) * @param fTask: Task that has to be excuted during simulation */ void AddTask(TTask* fTask); /** Define actions at the beginning of the event */ virtual void BeginEvent(); // MC Application /** Define actions at the beginning of primary track */ virtual void BeginPrimary(); // MC Application /** Construct user geometry */ virtual void ConstructGeometry(); // MC Application /** Define parameters for optical processes (optional) */ virtual void ConstructOpGeometry(); // MC Application #if ROOT_VERSION_CODE < 333824 /** Calculate user field b at point x */ virtual void Field(const Double_t* x, Double_t* b) const; // MC Application #endif /** Define actions at the end of event */ virtual void FinishEvent(); // MC Application /** Define actions at the end of primary track */ virtual void FinishPrimary(); // MC Application /** Define actions at the end of run */ void FinishRun(); /** Generate primary particles */ virtual void GeneratePrimaries(); // MC Application /** Return detector by name */ FairDetector* GetDetector(const char* DetName); /** Return Field used in simulation*/ FairField* GetField() {return fxField;} /**Return primary generator*/ FairPrimaryGenerator* GetGenerator(); /**Return list of tasks*/ TTask* GetListOfTasks(); FairGenericStack* GetStack(); TChain* GetChain(); /** Initialize geometry */ virtual void InitGeometry(); // MC Application /** Initialize MC engine */ void InitMC(const char* setup, const char* cuts); /** Initialize Tasks if any*/ void InitTasks(); /**Define actions at the end of each track */ virtual void PostTrack(); // MC Application /** Define actions at the beginning of each track*/ virtual void PreTrack(); // MC Application /** Clone for worker (used in MT mode only) */ virtual TVirtualMCApplication* CloneForWorker() const; /** Init worker run (used in MT mode only) */ virtual void InitForWorker() const; /** Finish worker run (used in MT mode only) */ virtual void FinishWorkerRun() const; /** Run the MC engine * @param nofEvents : number of events to simulate */ void RunMC(Int_t nofEvents); /** * Set the magnetic field for simulation * @param field: magnetic field */ void SetField(FairField* field); /** * Set the event generator for simulation * @param fxGenerator: Event generator(s) */ void SetGenerator(FairPrimaryGenerator* fxGenerator); /** * Set the parameter containers needed by Tasks(if any) */ void SetParTask(); /** * Switch for using Pythia as external decayer * @param decayer: if TRUE pythia will decay particles specifid in the Decay Config macro (see SetPythiaDecayerConfig) */ void SetPythiaDecayer(Bool_t decayer) {fPythiaDecayer=decayer;} /** * set the decay configuration macro to be used by Pythia */ void SetPythiaDecayerConfig(const TString decayerConf) {fPythiaDecayerConfig=decayerConf;} /** * Switch for using the radiation length manager */ void SetRadiationLengthReg(Bool_t RadLen); /** * Switch for using the radiation map manager */ void SetRadiationMapReg(Bool_t RadMap); /** * Switch for debuging the tracking */ void SetTrackingDebugMode( Bool_t set ) {fDebug = set;} /** * Switch for using 2 or 3 body phase-space decay * @param decay: if TRUE 2/3 body phase space decay will be used for particle specified in the User Decay Config macro (see SetUserDecayConfig) */ void SetUserDecay(Bool_t decay) {fUserDecay= decay;} /** * set the decay configuration macro to be used by user decay */ void SetUserDecayConfig(const TString decayerConf) {fUserDecayConfig= decayerConf;} /** Define action at each step, dispatch the action to the corresponding detectors */ virtual void Stepping(); // MC Application /** Stop the run*/ virtual void StopRun(); /**Define maximum radius for tracking (optional) */ virtual Double_t TrackingRmax() const; // MC Application /** Define maximum z for tracking (optional) */ virtual Double_t TrackingZmax() const; // MC Application void AddMeshList ( TObjArray* meshList ); private: // methods void RegisterStack(); Int_t GetIonPdg(Int_t z, Int_t a) const; void UndoGeometryModifications(); // data members /**List of active detector */ TRefArray* fActiveDetectors; /**List of FairTask*/ FairTask* fFairTaskList;//! /**detector list (Passive and Active)*/ TRefArray* fDetectors; /**Map used for dispatcher*/ TRefArray* fDetMap; /**Iterator for Module list*/ TIterator* fModIter; //! /**Module list in simulation*/ TObjArray* fModules; /**Number of sensetive volumes in simulation session*/ Int_t fNoSenVolumes; //! /**flag for using Pythia as external decayer */ Bool_t fPythiaDecayer; /** Pythia decay config macro*/ TString fPythiaDecayerConfig; //! /** Simulation Stack */ FairGenericStack* fStack; //! /**Pointer to thr I/O Manager */ FairRootManager* fRootManager; //! /**List of sensetive volumes in all detectors*/ TRefArray* fSenVolumes; //! /**Magnetic Field Pointer*/ FairField* fxField; // /**Primary generator*/ FairPrimaryGenerator* fEvGen; // /**MC Engine 1= Geant3, 2 = Geant4*/ Int_t fMcVersion; // mc Version /** Track visualization manager */ FairTrajFilter* fTrajFilter; //! /**Flag for accepted tracks for visualization*/ Bool_t fTrajAccepted; //! /**Flag for using user decay*/ Bool_t fUserDecay; /**User decay config macro*/ TString fUserDecayConfig; //! /** Debug flag*/ Bool_t fDebug;//! /**dispatcher internal use */ FairVolume* fDisVol; /**dispatcher internal use */ FairDetector* fDisDet; /**dispatcher internal use */ std::multimap fVolMap;//! /**dispatcher internal use */ std::multimap ::iterator fVolIter; //! /** Track position*/ /**dispatcher internal use RadLeng*/ std::map fModVolMap;//! /**dispatcher internal use RadLen*/ std::map ::iterator fModVolIter; //! TLorentzVector fTrkPos; //! /** Flag for Radiation length register mode */ Bool_t fRadLength; //! /**Radiation length Manager*/ FairRadLenManager* fRadLenMan; //! /** Flag for Radiation map register mode */ Bool_t fRadMap; //! /**Radiation Map Manager*/ FairRadMapManager* fRadMapMan; //! /**Radiation map Grid Manager*/ FairRadGridManager* fRadGridMan; //! FairEventHeader* fEventHeader; //! FairMCEventHeader* fMCEventHeader; //! /** list of senstive detectors used in the simuation session*/ std::list listActiveDetectors; //! /** list of all detectors used in the simuation session*/ std::list listDetectors; //! /** Pointer to the current MC engine //! */ TVirtualMC* fMC; ClassDef(FairMCApplication,4) //Interface to MonteCarlo application private: /** Protected copy constructor */ FairMCApplication(const FairMCApplication&); /** Protected assignment operator */ FairMCApplication& operator=(const FairMCApplication&); FairRunInfo fRunInfo;//! Bool_t fGeometryIsInitialized; }; // inline functions inline FairMCApplication* FairMCApplication::Instance() { return static_cast(TVirtualMCApplication::Instance());} #endif /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ #ifndef FAIRMODULE_H #define FAIRMODULE_H #include "TNamed.h" // for TNamed #include "FairGeoInterface.h" // for FairGeoInterface #include "FairGeoLoader.h" // for FairGeoLoader #include "FairGeoNode.h" // for FairGeoNode #include "FairGeoVolume.h" // for FairGeoVolume #include "FairLogger.h" // for FairLogLevel::INFO, etc #include "FairRun.h" // for FairRun #include "FairRuntimeDb.h" // for FairRuntimeDb #include "Rtypes.h" // for Bool_t, Int_t, etc #include "TList.h" // for TList (ptr only), TListIter #include "TObjArray.h" // for TObjArray #include "TString.h" // for TString, operator!= #include // for NULL #include // for string class FairVolumeList; class FairVolume; class TArrayI; class TGeoMatrix; class TGeoNode; class TGeoVolume; class TGeoMedium; class TRefArray; /** * Base class for constructing all detecors and passive volumes * @author M. Al-Turany, Denis Bertini * @version 1.0 * @since 01.04.08 M.Al-Turany * Add methods to construct geometry via ROOT files * Add some documentation * * Changelog: 29.02.2012 [O.Merle] Fixed missing material assignment for top volume. * ... and please - add some documentation to your code. */ class FairModule: public TNamed { public: /**default ctor*/ FairModule(); /**Standard ctor*/ FairModule(const char* Name, const char* title, Bool_t Active=kFALSE); /**default dtor*/ virtual ~FairModule(); /**Print method should be implemented in detector or module*/ virtual void Print(Option_t*) const {;} /**Set the geometry file name o be used*/ virtual void SetGeometryFileName(TString fname, TString geoVer="0"); /**Get the Geometry file name*/ virtual TString GetGeometryFileName() {return fgeoName ;} /**Get the geometry file version if used*/ virtual TString GetGeometryFileVer() {return fgeoVer ;} /**method called from the MC application to construct the geometry, has to be implimented by user*/ virtual void ConstructGeometry(); /**method called from the MC application to set optical geometry properties*/ virtual void ConstructOpGeometry(); /**construct geometry from root files (TGeo)*/ virtual void ConstructRootGeometry(); /**construct geometry from standard ASSCII files (Hades Format)*/ virtual void ConstructASCIIGeometry(); /** Modify the geometry for the simulation run using methods of the Root geometry package */ virtual void ModifyGeometry() {;} /**construct geometry from GDML files*/ virtual void ConstructGDMLGeometry(TGeoMatrix*); /** Clone this object (used in MT mode only)*/ virtual FairModule* CloneModule() const; /** Init worker run (used in MT mode only) */ virtual void BeginWorkerRun() const {;} /** Finish worker run (used in MT mode only) */ virtual void FinishWorkerRun() const {;} /**template function to construct geometry. to be used in derived classes.*/ template void ConstructASCIIGeometry(T dataType1, TString containerName="", U datatype2 = NULL); /**Set the sensitivity flag for volumes, called from ConstructASCIIRootGeometry(), and has to be implimented for detectors * which use ConstructASCIIRootGeometry() to build the geometry */ virtual Bool_t CheckIfSensitive(std::string name); /**called from ConstructRootGeometry()*/ virtual void ExpandNode(TGeoNode* Node); /**called from ConstructGDMLGeometry()*/ virtual void ExpandNodeForGDML(TGeoNode*); /**return the MC id of a volume named vname*/ virtual Int_t getVolId( const TString& ) const {return 0;} /**return the detector/Module id (which was set in the sim macro for the detector)*/ Int_t GetModId() {return fModId;} /**Set the verbose level in this detector*/ void SetVerboseLevel(Int_t level) {fVerboseLevel=level;} /**return the detector status */ Bool_t IsActive() {return fActive;} /**set the detector/module id*/ void SetModId(Int_t id) {fModId=id;} /** Set the name of the mother volume to which a new geometry is added. ** This function is needed for geometries which are defined as ROOT geometry manager. **/ void SetMotherVolume(TString volName) {fMotherVolumeName=volName;} /**called from ConstuctASCIIGeometry*/ void ProcessNodes ( TList* aList ); /**Set the parameter containers*/ virtual void SetParContainers() {;} /** Initialize everything which has to be done before the construction and modification ** of the geometry. Mostly this is needed to read data from the parameter containers.*/ virtual void InitParContainers() {;} /**return the geo parameter of this detector/module*/ TList* GetListOfGeoPar() { return flGeoPar;} /**list of volumes in a simulation session*/ static FairVolumeList* vList; //! /**total number of volumes in a simulaion session*/ static Int_t fNbOfVolumes; //! /**list of all sensitive volumes in a simulaion session*/ static TRefArray* svList; //! static TArrayI* volNumber; //! TString fMotherVolumeName; //! FairVolume* getFairVolume(FairGeoNode* fNode); void AddSensitiveVolume(TGeoVolume* v); private: /** Re-implimented from ROOT: TGeoMatrix::SetDefaultName() */ void SetDefaultMatrixName(TGeoMatrix* matrix); void AssignMediumAtImport(TGeoVolume* v); // O.Merle, 29.02.2012 - see impl. /**called from ConstructGDMLGeometry. Changes default ID created by TGDMLParse*/ void ReAssignMediaId(); void swap(FairModule& other) throw(); protected: FairModule(const FairModule&); FairModule& operator=(const FairModule&); TString fgeoVer; TString fgeoName; Int_t fModId; Bool_t fActive; Int_t fNbOfSensitiveVol; //! Int_t fVerboseLevel; TList* flGeoPar; //! list of Detector Geometry parameters Bool_t kGeoSaved; //! flag for initialisation ClassDef( FairModule,4) }; template void FairModule::ConstructASCIIGeometry(T dataType1, TString containerName, U) { FairGeoLoader* loader=FairGeoLoader::Instance(); FairGeoInterface* GeoInterface =loader->getGeoInterface(); T* MGeo=new T(); MGeo->print(); MGeo->setGeomFile(GetGeometryFileName()); GeoInterface->addGeoModule(MGeo); Bool_t rc = GeoInterface->readSet(MGeo); if ( rc ) { MGeo->create(loader->getGeoBuilder()); } TList* volList = MGeo->getListOfVolumes(); // store geo parameter FairRun* fRun = FairRun::Instance(); FairRuntimeDb* rtdb= FairRun::Instance()->GetRuntimeDb(); dataType1 = *MGeo; if ( "" != containerName) { LOG(INFO) << "Add GeoNodes for "<< MGeo->getDescription() << " to container " << containerName << FairLogger::endl; // U par=(U)(rtdb->getContainer(containerName)); U* par=static_cast(rtdb->getContainer(containerName)); TObjArray* fSensNodes = par->GetGeoSensitiveNodes(); TObjArray* fPassNodes = par->GetGeoPassiveNodes(); TListIter iter(volList); FairGeoNode* node = NULL; FairGeoVolume* aVol=NULL; while( (node = static_cast(iter.Next())) ) { aVol = dynamic_cast ( node ); if ( node->isSensitive() ) { fSensNodes->AddLast( aVol ); } else { fPassNodes->AddLast( aVol ); } } ProcessNodes( volList ); par->setChanged(); par->setInputVersion(fRun->GetRunId(),1); } } #endif //FAIRMODULE_H /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ /// Class FAIRParticle /// ------------------ /// Extended TParticle with persistent pointers to mother and daughters /// particles (Ivana Hrivnacova, 5.4.2002) /// Used to define particles which will be added to Geant3/4 (M. Al-Turany) #ifndef FAIR_PARTICLE_H #define FAIR_PARTICLE_H #include "TObject.h" // for TObject #include "Rtypes.h" // for Int_t, Double_t, Bool_t, etc #include "TMCParticleType.h" // for TMCParticleType #include "TRef.h" // for TRef #include "TRefArray.h" // for TRefArray #include "TString.h" // for TString class TParticle; class FairParticle : public TObject { public: FairParticle(Int_t id, TParticle* particle); FairParticle(Int_t id, TParticle* particle, FairParticle* mother); 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); FairParticle(const char* name, Int_t z, Int_t a, Double_t mass , Int_t q, Bool_t stable, Double_t decaytime); FairParticle( Int_t pdg , const TString name, TMCParticleType mcType, Double_t mass, Double_t charge, Double_t lifetime, const TString pType="Ion", Double_t width=0, Int_t iSpin=0, Int_t iParity=0, Int_t iConjugation=0, Int_t iIsospin=0, Int_t iIsospinZ=0, Int_t gParity=0, Int_t lepton=0, Int_t baryon=0,Bool_t stable=kFALSE); FairParticle(); virtual ~FairParticle(); // methods void SetMother(FairParticle* particle); void AddDaughter(FairParticle* particle); virtual void Print(Option_t* option = "") const; void PrintDaughters() const; // get methods Int_t GetPDG() const; TParticle* GetParticle() const; FairParticle* GetMother() const; Int_t GetNofDaughters() const; FairParticle* GetDaughter(Int_t i) const; virtual const char* GetName() const {return fname.Data();} TMCParticleType GetMCType() {return fmcType;} Double_t GetMass() {return fmass;} Double_t GetCharge() {return fcharge;} Double_t GetDecayTime() {return fDecayTime;} const TString& GetPType() {return fpType;} Double_t GetWidth() {return fwidth;} Int_t GetSpin() {return fiSpin;} Int_t GetiParity() {return fiParity;} Int_t GetConjugation() {return fiConjugation;} Int_t GetIsospin() {return fiIsospin;} Int_t GetIsospinZ() {return fiIsospinZ;} Int_t GetgParity() {return fgParity;} Int_t GetLepton() {return flepton;} Int_t GetBaryon() {return fbaryon;} Bool_t IsStable() {return fstable;} private: FairParticle(const FairParticle& P); FairParticle& operator= (const FairParticle&) {return *this;} // data members Int_t fpdg; TParticle* fParticle; TRef fMother; TRefArray fDaughters; const TString fname; TMCParticleType fmcType; Double_t fmass; Double_t fcharge; Double_t fDecayTime; const TString fpType; Double_t fwidth; Int_t fiSpin; Int_t fiParity; Int_t fiConjugation; Int_t fiIsospin; Int_t fiIsospinZ; Int_t fgParity; Int_t flepton; Int_t fbaryon; Bool_t fstable; ClassDef(FairParticle,3) // Extended TParticle }; #endif //FAIR_PARTICLE_H /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ /** FairPrimaryGenerator.h *@author V.Friese * The FairPrimaryGenerator is responsible for the handling of the MC input. Several input generators can be registered to it; these have to be derived from the FairGenerator class. The FairPrimaryGenerator defines position and (optionally) smearing of the primary vertex. This class should be instantised only once. Modified 05.06.07: add a method DoTracking(Bool_t) to be able to switch on/off the tracking from the macro (M. Al-Turany) **/ #ifndef FAIRPRIMARYGENERATOR_H #define FAIRPRIMARYGENERATOR_H #include "TNamed.h" // for TNamed #include "FairGenerator.h" // for FairGenerator #include "Riosfwd.h" // for ostream #include "Rtypes.h" // for Double_t, Bool_t, Int_t, etc #include "TObjArray.h" // for TObjArray #include "TVector3.h" // for TVector3 #include // for operator<<, basic_ostream, etc class FairGenericStack; class FairMCEventHeader; class TF1; class TIterator; class FairPrimaryGenerator : public TNamed { public: /** Default constructor. **/ FairPrimaryGenerator(); /** Constructor with name and title **/ FairPrimaryGenerator(const char *name, const char *title = "FAIR Generator"); /** Destructor. **/ virtual ~FairPrimaryGenerator(); /** Initialize the generater (if needed!)*/ virtual Bool_t Init(); /** Register a generator derived from FairGenerator. **/ void AddGenerator(FairGenerator *generator) { if (!fGenList) { std::cout << "Empty fGenList pointer ! " << std::endl; return; } fGenList->Add(generator); } /** Public method GenerateEvent To be called at the beginning of each event from FairMCApplication. Generates an event vertex and calls the ReadEvent methods from the registered generators. *@param pStack The particle stack *@return kTRUE if successful, kFALSE if not **/ virtual Bool_t GenerateEvent(FairGenericStack *pStack); /** Public method AddTrack Adding a track to the MC stack. To be called within the ReadEvent methods of the registered generators. *@param pdgid Particle ID (PDG code) *@param px,py,pz Momentum coordinates [GeV] *@param vx,vy,vz Track origin relative to event vertex **/ virtual void AddTrack(Int_t pdgid, Double_t px, Double_t py, Double_t pz, Double_t vx, Double_t vy, Double_t vz, Int_t parent = -1, Bool_t wanttracking = true, Double_t e = -9e9, Double_t tof = 0., Double_t weight = 0.); /** Clone this object (used in MT mode only) */ virtual FairPrimaryGenerator* ClonePrimaryGenerator() const; /** Set beam position and widths. *@param beamX0 mean x position of beam at target *@param beamY0 mean y position of beam at target *@param beamSigmaX Gaussian beam width in x *@param beamSigmaY Gaussian beam width in y **/ void SetBeam(Double_t beamX0, Double_t beamY0, Double_t beamSigmaX, Double_t beamSigmaY); /** Set nominal beam angle and angle widths. *@param beamAngleX0 mean x angle of beam at target *@param beamAngleY0 mean y angle of beam at target *@param beamAngleSigmaX Gaussian beam angle width in x *@param beamAngleSigmaY Gaussian beam angle width in y **/ void SetBeamAngle(Double_t beamAngleX0, Double_t beamAngleY0, Double_t beamAngleSigmaX, Double_t beamAngleSigmaY); /** Public method SetEventPlane **@param phiMin Lower limit for event plane angle [rad] **@param phiMax Upper limit for event plane angle [rad] **If set, an event plane angle will be generated with flat **distrtibution between phiMin and phiMax. **/ void SetEventPlane(Double_t phiMin, Double_t phiMax); /** Set target position and thickness. *@param targetZ z position of target center *@param targetDz full target thickness **/ void SetTarget(Double_t targetZ, Double_t targetDz); /** Set target position for multiple tagets. The thickness * is the same for all targets. *@param nroftargets number of targets *@param *targetZ z positions of target center *@param targetDz full target thickness **/ void SetMultTarget(Int_t nroftargets, Double_t *targetZ, Double_t targetDz); /** Enable vertex smearing in z and/or xy direction **/ void SmearVertexZ(Bool_t flag); void SmearGausVertexZ(Bool_t flag); void SmearVertexXY(Bool_t flag); void SmearGausVertexXY(Bool_t flag); TObjArray *GetListOfGenerators() { return fGenList; } /** Set the pointer to the MCEvent **/ void SetEvent(FairMCEventHeader *event) { fEvent = event; }; /** Accessor to the MCEvent **/ FairMCEventHeader *GetEvent() { return fEvent; }; /** Swich on/off the tracking of a particle*/ void DoTracking(Bool_t doTracking = kTRUE) { fdoTracking = doTracking; } Int_t GetTotPrimary() { return fTotPrim; } protected: /** Copy constructor */ FairPrimaryGenerator(const FairPrimaryGenerator&); /** Assignment operator */ FairPrimaryGenerator &operator=(const FairPrimaryGenerator&); /** Nominal beam position at target in x [cm] */ Double_t fBeamX0; /** Nominal beam position at target in y [cm]*/ Double_t fBeamY0; /** Beam width (Gaussian) in x [cm]*/ Double_t fBeamSigmaX; /** Beam width (Gaussian) in y [cm]*/ Double_t fBeamSigmaY; /** Nominal beam angle at target in x [rad] */ Double_t fBeamAngleX0; /** Nominal beam angle at target in y [rad] */ Double_t fBeamAngleY0; /** Actual beam angle at target in x [rad] */ Double_t fBeamAngleX; /** Actual beam angle at target in y [rad] */ Double_t fBeamAngleY; /** Beam angle width (Gaussian) in x [rad]*/ Double_t fBeamAngleSigmaX; /** Beam angle width (Gaussian) in y [rad]*/ Double_t fBeamAngleSigmaY; /** Actual beam direction at the vertex */ TVector3 fBeamDirection; /** Lower limit for the event plane rotation angle [rad] */ Double_t fPhiMin; /** Upper limit for the event plane rotation angle [rad] */ Double_t fPhiMax; /** Actual event plane rotation angle [rad] */ Double_t fPhi; /** Nominal z position of center of targets [cm]*/ Double_t *fTargetZ; //! /** Number of targets;*/ Int_t fNrTargets; /** Full target thickness [cm]*/ Double_t fTargetDz; /** Vertex position of current event [cm]*/ TVector3 fVertex; /** Number of primary tracks in current event*/ Int_t fNTracks; /** Flag for uniform vertex smearing in z*/ Bool_t fSmearVertexZ; /** Flag for gaus vertex smearing in z*/ Bool_t fSmearGausVertexZ; /** Flag for vertex smearing in xy*/ Bool_t fSmearVertexXY; /** Flag for gaus vertex smearing in xy*/ Bool_t fSmearGausVertexXY; /** Flag for beam gradient calculation*/ Bool_t fBeamAngle; /** Flag for event plane rotation*/ Bool_t fEventPlane; /** Pointer to MC stack*/ FairGenericStack *fStack; //! /** List of registered generators */ TObjArray *fGenList; /** Iterator over generator list */ TIterator *fListIter; //! /** Pointer to MCEventHeader */ FairMCEventHeader *fEvent; //! /** go to tracking */ Bool_t fdoTracking; //! /** Number of MC tracks before a Generator is called, needed for MC index * update */ Int_t fMCIndexOffset; //! /** Number of all primaries of this run*/ static Int_t fTotPrim; //! /** Event number (Set by the primary generator if not set already by one of the specific generators **/ Int_t fEventNr; /** Private method MakeVertex. If vertex smearing in xy is switched on, the event vertex is smeared Gaussianlike in x and y direction according to the mean beam positions and widths set by the SetBeam method. If vertex smearing in z is switched on, the z coordinate of the event vertex is flatly distributed over the extension of the target. To be called at the beginning of the event from the GenerateEvent method. **/ void MakeVertex(); /** Private method MakeBeamAngle. If beam angle smearing in xy is switched on, all tracks in an event are rotated by a Gaussianlike angle distribution around the x and y axis according to the mean beam angle and angle widths set by the SetBeamAngle method. To be called at the beginning of the event from the GenerateEvent method. **/ void MakeBeamAngle(); /** Private method MakeEventPlane. If the rotation of the event around the z-axis by a random angle is switched on, the complete event is rotated by the chosen angle. This function is called at the beginning of the event from the GenerateEvent method. The function pick a random rotation angle between fPhiMin and fPhiMax which are set using the function SetEventPlane. **/ void MakeEventPlane(); ClassDef(FairPrimaryGenerator, 5); }; #endif /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ #ifndef FAIRRUNIDGENERATOR_H #define FAIRRUNIDGENERATOR_H #include // IWYU pragma: keep for timespec // IWYU pragma: no_include typedef unsigned char uint8_t; typedef unsigned short int uint16_t; typedef unsigned int uint32_t; typedef unsigned char uuid_t[16]; class FairRunIdGenerator { struct uuid { uint32_t time_low; uint16_t time_mid; uint16_t time_hi_and_version; uint16_t clock_seq; uint8_t node[6]; }; struct timespec fTimeSpec; int get_random_fd(void); void get_random_bytes(void*, int); int get_node_id(unsigned char*); int get_clock(uint32_t*, uint32_t*, uint16_t*); void uuid_generate_time(uuid_t); void uuid_generate_random(uuid_t); void uuid_generate(uuid_t); void uuid_pack(const struct uuid*, uuid_t); void uuid_unpack(const uuid_t, struct uuid*); public: struct timespec getTimeSpec() {return fTimeSpec;} struct timespec getTimeSpecFromTID( unsigned int ms); unsigned int getTID(); public: FairRunIdGenerator() : fTimeSpec() {} ~FairRunIdGenerator() {} unsigned int generateId(void); }; #endif /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ #ifndef FAIR_VOLUME_H #define FAIR_VOLUME_H #include "TNamed.h" // for TNamed #include "Rtypes.h" // for Int_t, FairVolume::Class, etc #include "TString.h" // for TString #include "FairModule.h" #include "FairDetector.h" class FairGeoNode; /** * This Object is only used for internal book keeping! * @author M. Al-Turany, D. Bertini * @version 0.1 * @since 12.01.04 */ class FairVolume : public TNamed { public: FairVolume(); FairVolume(TString name, Int_t id=0, Int_t detid=0,FairModule* fMod=0); virtual ~FairVolume(); // const char* GetName() { return fName.Data();} // TString getName() { return fName;} void setRealName( TString name ) { fRealName = name;} const char* getRealName() { return fRealName.Data();} Int_t getVolumeId() { return fVolumeId;} Int_t getModId() { return fModId;} void setModId(Int_t id) { fModId=id;} void setCopyNo(Int_t id) { fCopyNo=id;} void setVolumeId ( Int_t id ) {fVolumeId= id;} void setGeoNode(FairGeoNode* d) {fNode=d;} void setMotherId(Int_t fM) {fMotherId=fM;} void setMotherCopyNo(Int_t CopyNo) {fMotherCopyNo=CopyNo;} FairModule* GetModule() {return fModule;} FairDetector* GetDetector() { return fDetector;} void SetModule(FairModule* mod) { fModule=mod; if (mod->InheritsFrom("FairDetector")){ fDetector=dynamic_cast(mod); } } Int_t getMCid() {return fMCid;} Int_t getCopyNo() { return fCopyNo;} void setMCid(Int_t id) {fMCid=id;} FairGeoNode* getGeoNode() {return fNode;} Int_t getMotherId() { return fMotherId;} Int_t getMotherCopyNo() {return fMotherCopyNo;} private: FairVolume(const FairVolume&); FairVolume& operator=(const FairVolume&); // TString fName; /**Volume Name in MC*/ TString fRealName; /**Volume Name in ASCII file*/ Int_t fVolumeId; /**Volume Id in GeoManager*/ Int_t fModId; /**Module Id in which this volume exist*/ Int_t fMCid; /**Volume Id in MC*/ Int_t fCopyNo; /**Volume Copy No*/ Int_t fMotherId; /**Mother Volume Id*/ Int_t fMotherCopyNo; /**Mother Volume Copy No*/ FairDetector* fDetector; /** The Detector which will proccess the hits for this volume*/ FairModule* fModule; /**The Module in which the volume is */ FairGeoNode* fNode; /**Node corresponding to this volume*/ ClassDef(FairVolume,2) // Volume Definition }; #endif // /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ #ifndef FAIR_VOLUMELIST_H #define FAIR_VOLUMELIST_H #include "TObject.h" // for TObject #include "FairVolume.h" #include "Rtypes.h" // for Int_t, etc #include "TObjArray.h" // for TObjArray #include "TString.h" // for TString //class FairVolume; /** * This Object is only used for internal book keeping! * @author M. Al-Turany, D. Bertini * @version 0.1 * @since 12.01.04 */ class FairVolumeList : public TObject { private: TObjArray* fData; FairVolumeList(const FairVolumeList&); FairVolumeList& operator=(const FairVolumeList&); public: FairVolumeList(); virtual ~FairVolumeList(); FairVolume* getVolume( TString* name ); Int_t getVolumeId( TString* name ); FairVolume* findObject( TString name ); void addVolume( FairVolume* elem); Int_t getEntries () { return fData->GetEntries();} FairVolume* At(Int_t pos ) { return ( dynamic_cast(fData->At(pos))); } ClassDef(FairVolumeList,1) // Volume List }; #endif //FAIR_VOLUMELIST_H /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ //* $Id: */ // ------------------------------------------------------------------------- // ----- FairEventBuilder header file ----- // ----- Created 23/09/2013 by R. Karabowicz ----- // ------------------------------------------------------------------------- /** FairEventBuilder *@author Radoslaw Karabowicz *@since 23/09/2013 *@version 1.0 ** ** FairRoot base task for the event buffers. ** The tasks may: ** 1. analyze data to reconstruct event times or other characteristics ** in the function TClonesArray* FindEvents(), that returns ** TClonesArray of FairRecoEvents ** 2. identify the data that could belong to event in the ** function and insert this identified data to the output TClonesArrays ** in the function StoreEventData(event) ** The implementations may be using any or both of the above functions. **/ #ifndef FAIREVENTBUILDER_H #define FAIREVENTBUILDER_H 1 #include "FairWriteoutBuffer.h" #include "FairRecoEventHeader.h" #include "TStopwatch.h" #include "TString.h" #include #include #include class TClonesArray; //class FairRecoEventHeader; class FairEventBuilder : public FairWriteoutBuffer { public : /** Default constructor **/ FairEventBuilder(); /** Constructor with task name **/ FairEventBuilder(TString branchName, TString className, TString folderName, Bool_t persistance); /** Destructor **/ virtual ~FairEventBuilder(); virtual void WriteOutAllDeadTimeData(); virtual std::vector > FindEvents() = 0; virtual void StoreEventData(FairRecoEventHeader* /*recoEvent*/) = 0; void SetIdentifier(Int_t ident) { fIdentifier=ident; } Int_t GetIdentifier() { return fIdentifier; } virtual Bool_t Init() = 0; virtual void Print(Option_t *option="") const = 0; /** Finish at the end of each event **/ virtual void Finish(); Double_t AllowedTime() { return fMaxAllowedEventCreationTime; }; void SetMaxAllowedTime(Double_t td) { fMaxAllowedEventCreationTime = td; }; void SetBuilderName(const char* name) { fBuilderName=name; } TString GetBuilderName() { return fBuilderName; } private: TString fBuilderName; TStopwatch fTimer; Double_t fExecTime; Int_t fIdentifier; Double_t fMaxAllowedEventCreationTime; ClassDef(FairEventBuilder,1); }; #endif /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ //* $Id: */ // ------------------------------------------------------------------------- // ----- FairEventBuilderManager header file ----- // ----- Created 20/09/2013 by R. Karabowicz ----- // ------------------------------------------------------------------------- /** FairEventBuilderManager *@author Radoslaw Karabowicz *@since 20/09/2013 *@version 1.0 ** ** FairRoot general task for recreating events in Time-Based reconstruction mode. ** Various experiments should implement their own version of Event Builder. ** The main member of the task is vector of reconstructed events fRecoEvents. ** It also contains a vector of implementations of FairEventBuilders, that are ** responsible for feeding fRecoEvents vector via FindEvents() function. ** ** The heart of the experiment-specific implemenations is ** the AnalyzeAndExtractEvents() function, which should interpret ** the experimental data to reconstruct events. **/ #ifndef FAIREVENTBUILDERMANAGER_H #define FAIREVENTBUILDERMANAGER_H 1 #include "FairTask.h" #include "FairEventBuilder.h" #include "TStopwatch.h" #include #include #include class TClonesArray; class FairEventBuilderManager : public FairTask { public : /** Default constructor **/ FairEventBuilderManager(); /** Constructor with task name **/ FairEventBuilderManager(const char* name, Int_t iVerbose=1); /** Destructor **/ virtual ~FairEventBuilderManager(); /** Execution **/ virtual void Exec(Option_t* opt); /** Adding FairEventBuilder **/ virtual void AddEventBuilder(FairEventBuilder* eventBuilder); protected: std::vector fEventBuilders; std::vector > > fPossibleEvents; /** Fill events from various builders **/ virtual Double_t FillEventVectors(); /** Analyze and extract events - experiment specific **/ virtual void AnalyzeAndExtractEvents(Double_t maxEventTimeAllowed) = 0; /** Create output tree structure **/ virtual void CreateAndFillEvent(FairRecoEventHeader* recoEvent); private: /** Get parameter containers **/ virtual void SetParContainers(); /** Intialisation **/ virtual InitStatus Init(); /** Reinitialisation **/ virtual InitStatus ReInit(); /** Finish at the end of each event **/ virtual void Finish(); ClassDef(FairEventBuilderManager,1); }; #endif /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ // ------------------------------------------------------------------------- // ----- FairEventHeader header file ----- // ----- Created 08/09/04 D.Bertini ----- // ------------------------------------------------------------------------- #ifndef FAIREVENTHEADER_H #define FAIREVENTHEADER_H #include "TNamed.h" // for TNamed #include "Rtypes.h" // for Int_t, Double_t, UInt_t, etc /** * Event Header Class **@author D.Bertini **@author M.Al-Turany */ class FairEventHeader : public TNamed { public: /** Default constructor */ FairEventHeader(); /** Get the run ID for this run*/ UInt_t GetRunId() {return fRunId;} /** Get the MC time for this event*/ Double_t GetEventTime() {return fEventTime;} /** Get the MC input file Id for this event*/ Int_t GetInputFileId() {return fInputFileId;} /**The entry number in the original MC chain */ Int_t GetMCEntryNumber() {return fMCEntryNo;} /** Set the run ID for this run * @param runid : unique run id */ void SetRunId(UInt_t runid) {fRunId=runid;} /** Set the MC time for this event * @param time : time in ns */ void SetEventTime(Double_t time) {fEventTime=time;} /** Set the Signal file Id for this event*/ void SetInputFileId(Int_t id) {fInputFileId=id;} /**The entry number in the original MC chain */ void SetMCEntryNumber(Int_t id) {fMCEntryNo=id;} /** * Destructor */ virtual ~FairEventHeader(); virtual void Register(Bool_t Persistance = kTRUE); protected: /** Run Id */ UInt_t fRunId; /** Event Time **/ Double_t fEventTime; /** Input file identifier, the file description is in the File header*/ Int_t fInputFileId; /**MC entry number from input chain*/ Int_t fMCEntryNo; ClassDef(FairEventHeader,3) }; #endif /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ // ------------------------------------------------------------------------- // ----- FairFileHeader source file ----- // ----- Created 20/04/11 M.Al-Turany ----- // ------------------------------------------------------------------------- #ifndef FAIRFILEHEADER_H #define FAIRFILEHEADER_H #include "TNamed.h" // for TNamed #include "Rtypes.h" // for UInt_t, etc #include "TString.h" // for TString class FairFileInfo; class TFile; class TList; /** * File Header Class **@author M.Al-Turany */ class FairFileHeader : public TNamed { public: /** Default constructor */ FairFileHeader(); /**Add a class name of a task*/ void AddTaskClassName(TString taskname); /** Set the run ID for this run * @param runid : unique run id */ void SetRunId(UInt_t runid) {fRunId=runid;} /** Get the run ID for this run*/ UInt_t GetRunId() {return fRunId;} /** Return the list of tasks class names */ TList* GetListOfTasks() {return fTaskList;} void AddInputFile(TFile* f, UInt_t id, UInt_t ChId); /** * Destructor */ virtual ~FairFileHeader(); FairFileInfo* GetFileInfo(UInt_t id, UInt_t ChId); protected: /** Run Id */ UInt_t fRunId; /**list of TObjStrings presenting the class names of tasks used to produce this file */ TList* fTaskList; /**list of TObjStrings presenting the input files used to produce this file*/ TList* fFileList; private: FairFileHeader(const FairFileHeader&); FairFileHeader& operator=(const FairFileHeader&); ClassDef(FairFileHeader,2) }; #endif /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ // FairFileInfo.h // Created by Mohammad Al-Turany on 6/21/11. // #ifndef FAIRFILEINFO_H #define FAIRFILEINFO_H #include "TNamed.h" // for TNamed #include "Rtypes.h" // for UInt_t, FairFileInfo::Class, etc #include "TString.h" // for TString class TFile; class FairFileInfo : public TNamed { public: FairFileInfo(); FairFileInfo(TFile* file, UInt_t id, UInt_t ChId); virtual ~FairFileInfo(); TString GetPath() {return fPath;} UInt_t GetSize() {return fSize;} UInt_t GetIdentifier() {return fIdentifier;} UInt_t GetOrderInChain() {return fInChainId;} void Print(Option_t* option="") const; void SetPath(TString path) {fPath = path;} void SetSize(UInt_t size) {fSize =size;} void SetIdentifier(UInt_t id) {fIdentifier =id;} void SetOrderInChain(UInt_t id) {fInChainId =id;} protected: /** Full path of file*/ TString fPath; /** size of file in bytes*/ UInt_t fSize; /** Signal file identifier used*/ UInt_t fIdentifier; /** file order in the chain*/ UInt_t fInChainId; private: FairFileInfo(const FairFileInfo&); FairFileInfo& operator=(const FairFileInfo&); ClassDef(FairFileInfo,1) }; #endif //FAIRFILEINFO_H /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ #ifndef FAIRHIT_H #define FAIRHIT_H #include "FairTimeStamp.h" // for FairTimeStamp #include "Rtypes.h" // for Double_t, Int_t, Double32_t, etc #include "TVector3.h" // for TVector3 #ifndef __CINT__ #include #include #endif //__CINT__ /** * Abstract base class for reconstructed hits in the FAIR detectors. **@author V.Friese **@author D.Bertini **@author M.Al-Turany */ class FairHit : public FairTimeStamp { public: /** Default constructor **/ FairHit(); /** Constructor with hit parameters **/ FairHit(Int_t detID, TVector3& pos, TVector3& dpos, Int_t index); /** Destructor **/ virtual ~FairHit(); /** Accessors **/ Double_t GetDx() const { return fDx; }; Double_t GetDy() const { return fDy; }; Double_t GetDz() const { return fDz; }; Int_t GetRefIndex() const { return fRefIndex; }; void PositionError(TVector3& dpos) const; Int_t GetDetectorID() const { return fDetectorID; }; Double_t GetX() const { return fX; }; Double_t GetY() const { return fY; }; Double_t GetZ() const { return fZ; }; void Position(TVector3& pos) const; /** Modifiers **/ void SetDx(Double_t dx) { fDx = dx; } void SetDy(Double_t dy) { fDy = dy; } void SetDz(Double_t dz) { fDz = dz; } void SetDxyz(Double_t dx, Double_t dy, Double_t dz); void SetPositionError(const TVector3& dpos); void SetRefIndex(Int_t index) { fRefIndex = index; } void SetDetectorID(Int_t detID) { fDetectorID = detID; } void SetX(Double_t x) { fX = x; } void SetY(Double_t y) { fY = y; } void SetZ(Double_t z) { fZ = z; } void SetXYZ(Double_t x, Double_t y, Double_t z); void SetPosition(const TVector3& pos); /*** Output to screen */ virtual void Print(const Option_t*) const {;} template void serialize(Archive& ar, const unsigned int) { ar& boost::serialization::base_object(*this); ar& fDetectorID; ar& fRefIndex; ar& fX; ar& fY; ar& fZ; ar& fDx; ar& fDy; ar& fDz; } protected: #ifndef __CINT__ // for BOOST serialization friend class boost::serialization::access; #endif // for BOOST serialization Double32_t fDx, fDy, fDz; ///< Errors of position [cm] Int_t fRefIndex; ///< Index of FairMCPoint for this hit Int_t fDetectorID; ///< Detector unique identifier Double32_t fX, fY, fZ; ///< Position of hit [cm] ClassDef(FairHit,3); }; inline void FairHit::PositionError(TVector3& dpos) const { dpos.SetXYZ(fDx, fDy, fDz); } inline void FairHit::SetDxyz(Double_t dx, Double_t dy, Double_t dz) { fDx = dx; fDy = dy; fDz = dz; } inline void FairHit::SetPositionError(const TVector3& dpos) { fDx = dpos.X(); fDy = dpos.Y(); fDz = dpos.Z(); } inline void FairHit::Position(TVector3& pos) const { pos.SetXYZ(fX, fY, fZ); } inline void FairHit::SetXYZ(Double_t x, Double_t y, Double_t z) { fX = x; fY = y; fZ = z; } inline void FairHit::SetPosition(const TVector3& pos) { fX = pos.X(); fY = pos.Y(); fZ = pos.Z(); } #endif /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ /* * FairLink.h * * Created on: Dec 23, 2009 * Author: stockman */ #ifndef FAIRLINK_H_ #define FAIRLINK_H_ #include "TObject.h" // for TObject #include "Riosfwd.h" // for ostream #include "Rtypes.h" // for Int_t, Float_t, etc #include "TString.h" // for TString #include // for ostream, cout #ifndef __CINT__ #include #include #endif //__CINT__ class FairLink : public TObject { public: FairLink(); FairLink(Int_t type, Int_t index, Float_t weight = 1.); FairLink(TString branchName, Int_t index, Float_t weight = 1.); FairLink(Int_t file, Int_t entry, Int_t type, Int_t index, Float_t weight = 1.); FairLink(Int_t file, Int_t entry, TString branchName, Int_t index, Float_t weight = 1.); virtual ~FairLink(); void SetLink(Int_t file, Int_t entry, Int_t type, Int_t index, Float_t weight = 1.) { fFile = file; fEntry = entry; fType = type; fIndex = index; fWeight = weight; }; void SetLink(Int_t type, Int_t index, Float_t weight = 1.) { fFile = -1; fEntry = -1; fType = type; fIndex = index; fWeight = weight; }; Int_t GetFile() const {return fFile;} Int_t GetEntry() const {return fEntry;} Int_t GetType() const {return fType;} Int_t GetIndex() const {return fIndex;} Float_t GetWeight() const {return fWeight;} void SetWeight(Float_t weight) {fWeight = weight;} void AddWeight(Float_t weight) {fWeight += weight;} virtual void PrintLinkInfo(std::ostream& out = std::cout) const; virtual bool operator==(const FairLink& link) const { if ((fFile == link.GetFile() || link.GetFile() == -1) && (fEntry == link.GetEntry() || link.GetEntry() == -1) && fType == link.GetType() && fIndex == link.GetIndex()) { return true; } else { return false; } } virtual bool operator<(const FairLink& link) const { if (fFile != -1 && link.GetFile() != -1){ if (fFile < link.GetFile()) return true; else if (link.GetFile() < fFile) return false; } if (fEntry != -1 && link.GetEntry() != -1){ if(fEntry < link.GetEntry()) return true; else if (link.GetEntry() < fEntry) return false; } if (fType < link.GetType()) return true; else if (link.GetType() < fType) return false; if (fIndex < link.GetIndex()) return true; else if (link.GetIndex() < fIndex) return false; return false; // if (fFile != -1 && fFile < link.GetFile()) { // return true; // } else if ((fFile == link.GetFile() || link.GetFile() == -1) && fEntry < link.GetEntry()) { // return true; // } else if ((fFile == link.GetFile() || link.GetFile() == -1) && (fEntry == link.GetEntry() || link.GetEntry() == -1) && fType < link.GetType()) { // return true; // } else if ((fFile == link.GetFile() || link.GetFile() == -1) && (fEntry == link.GetEntry() || link.GetEntry() == -1) && fType == link.GetType() && fIndex < link.GetIndex()) { // return true; // } else { // return false; // } } friend std::ostream& operator<< (std::ostream& out, const FairLink& link) { link.PrintLinkInfo(out); return out; } ClassDef(FairLink, 3); template void serialize(Archive& ar, const unsigned int) { ar& fFile; ar& fEntry; ar& fType; ar& fIndex; ar& fWeight; } private: Int_t fFile; Int_t fEntry; Int_t fType; Int_t fIndex; Float_t fWeight; }; #endif /* FAIRLINK_H_ */ /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ /** FairMCEventHeader.h *@author V.Friese ** Data class (level MC) containing information about the input event. ** 15.05.2008 change the event time to ns (M. Al-Turany) **/ #ifndef FAIRMCEVENTHEADER_H #define FAIRMCEVENTHEADER_H 1 #include "TNamed.h" // for TNamed #include "Rtypes.h" // for Double_t, UInt_t, etc #include "TVector3.h" // for TVector3 class FairMCEventHeader : public TNamed { public: /** Default constructor **/ FairMCEventHeader(); /** Constructor with all members ** *@param iEvent event identifier *@param x,y,z vertex oordinates [cm] *@param t event time [ns] *@param b impact parameter [fm] (if relevant) *@param nPrim number of input tracks **/ FairMCEventHeader(Int_t iEvent, Double_t x, Double_t y, Double_t z, Double_t t, Double_t b, Int_t nPrim); /** Standard constructor with run identifier **/ FairMCEventHeader(UInt_t runId); /** Destructor **/ virtual ~FairMCEventHeader(); /** Accessors **/ UInt_t GetRunID() const { return fRunId; } /// run identifier UInt_t GetEventID() const { return fEventId; } /// event identifier Double_t GetX() const { return fX; } /// vertex x [cm] Double_t GetY() const { return fY; } /// vertex y [cm] Double_t GetZ() const { return fZ; } /// vertex z [cm] Double_t GetT() const { return fT; } /// event time [ns] Double_t GetB() const { return fB; } /// impact parameter [fm] Int_t GetNPrim() const { return fNPrim; } /// number of input tracks Bool_t IsSet() const { return fIsSet; } /// Flag Double_t GetRotX() const { return fRotX; } /// rot. around x-axis [rad] Double_t GetRotY() const { return fRotY; } /// rot. around y-axis [rad] Double_t GetRotZ() const { return fRotZ; } /// rot. around z-axis [rad] void GetVertex(TVector3& vertex) { vertex.SetXYZ(fX, fY, fZ); } /** Modifiers **/ void SetEventID(UInt_t eventId) { fEventId = eventId; } void SetRunID(UInt_t runId) { fRunId = runId; } void SetTime(Double_t t) { fT = t; } void SetB(Double_t b) { fB = b; } void SetNPrim(Int_t nPrim) { fNPrim = nPrim; } void MarkSet(Bool_t isSet) { fIsSet = isSet; } void SetVertex(Double_t x, Double_t y, Double_t z); void SetVertex(const TVector3& vertex); void SetRotX(Double_t rotx) { fRotX = rotx; } void SetRotY(Double_t roty) { fRotY = roty; } void SetRotZ(Double_t rotz) { fRotZ = rotz; } /** Reset all members **/ void Reset(); /** Register the class as data branch to the output */ virtual void Register(); protected: UInt_t fRunId; /// Run identifier UInt_t fEventId; /// Event identifier Double32_t fX; /// Primary vertex x [cm] Double32_t fY; /// Primary vertex y [cm] Double32_t fZ; /// Primary vertex z [cm] Double32_t fT; /// Event time [s] Double32_t fB; /// Impact parameter [fm] (if relevant) Int_t fNPrim; /// Number of input tracks Bool_t fIsSet; /// Flag whether variables are filled Double32_t fRotX; /// Rotation around x-axis (beam tilt) [rad] Double32_t fRotY; /// Rotation around y-axis (beam tilt) [rad] Double32_t fRotZ; /// Rotation around z-axis (event plane) [rad] ClassDef(FairMCEventHeader,2); }; inline void FairMCEventHeader::SetVertex(Double_t x, Double_t y, Double_t z) { fX = x; fY = y; fZ = z; } inline void FairMCEventHeader::SetVertex(const TVector3& vertex) { fX = vertex.X(); fY = vertex.Y(); fZ = vertex.Z(); } #endif /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ /** FairMCPoint.h * This is the base class for all MC Points generated by the transport of * tracks through active detectors. **/ #ifndef FAIRMCPOINT_H #define FAIRMCPOINT_H #include "FairMultiLinkedData_Interface.h" // for FairMultiLinkedData #include "Rtypes.h" // for Double_t, Double32_t, Int_t, etc #include "TVector3.h" // for TVector3 #ifndef __CINT__ #include #include #endif //__CINT__ class FairMCPoint : public FairMultiLinkedData_Interface { public: /** Default constructor **/ FairMCPoint(); /** Constructor with arguments *@param trackID Index of MCTrack *@param detID Detector ID *@param pos Point coordinates [cm] *@param mom Momentum of track at MCPoint [GeV] *@param tof Time since event start [ns] *@param length Track length since creation [cm] *@param eLoss Energy deposit [GeV] *@param EventId MC event id **/ FairMCPoint(Int_t trackID, Int_t detID, TVector3 pos, TVector3 mom, Double_t tof, Double_t length, Double_t eLoss, UInt_t EventId=0); /** Destructor **/ virtual ~FairMCPoint(); /** Accessors */ UInt_t GetEventID() const { return fEventId; } /// event identifier Int_t GetTrackID() const { return fTrackID; } Double_t GetPx() const { return fPx; } Double_t GetPy() const { return fPy; } Double_t GetPz() const { return fPz; } Double_t GetTime() const { return fTime; } Double_t GetLength() const { return fLength; } Double_t GetEnergyLoss() const { return fELoss; } void Momentum(TVector3& mom) const { mom.SetXYZ(fPx, fPy, fPz); } Int_t GetDetectorID() const { return fDetectorID; }; Double_t GetX() const { return fX; }; Double_t GetY() const { return fY; }; Double_t GetZ() const { return fZ; }; void Position(TVector3& pos) const { pos.SetXYZ(fX, fY, fZ); } /** Modifiers **/ void SetEventID(UInt_t eventId) { fEventId = eventId; } virtual void SetTrackID(Int_t id) { fTrackID = id;} void SetTime(Double_t time) { fTime = time; } void SetLength(Double_t length) { fLength = length; } void SetEnergyLoss(Double_t eLoss) { fELoss = eLoss; } void SetMomentum(const TVector3& mom); void SetDetectorID(Int_t detID) { fDetectorID = detID; } void SetX(Double_t x) { fX = x; } void SetY(Double_t y) { fY = y; } void SetZ(Double_t z) { fZ = z; } void SetXYZ(Double_t x, Double_t y, Double_t z); void SetPosition(const TVector3& pos); /** Output to screen **/ virtual void Print(const Option_t* opt = 0) const; template void serialize(Archive & ar, const unsigned int) { //ar & boost::serialization::base_object(*this); ar & fTrackID; ar & fEventId; ar & fDetectorID; ar & fX; ar & fY; ar & fZ; ar & fPx; ar & fPy; ar & fPz; ar & fTime; ar & fLength; ar & fELoss; } protected: #ifndef __CINT__ // for BOOST serialization friend class boost::serialization::access; #endif // for BOOST serialization Int_t fTrackID; ///< Track index UInt_t fEventId; ///< MC Event id Double32_t fPx, fPy, fPz; ///< Momentum components [GeV] Double32_t fTime; ///< Time since event start [ns] Double32_t fLength; ///< Track length since creation [cm] Double32_t fELoss; ///< Energy loss at this point [GeV] Int_t fDetectorID; ///< Detector unique identifier Double32_t fX, fY, fZ; ///< Position of hit [cm] ClassDef(FairMCPoint,5) }; inline void FairMCPoint::SetMomentum(const TVector3& mom) { fPx = mom.Px(); fPy = mom.Py(); fPz = mom.Pz(); } inline void FairMCPoint::SetXYZ(Double_t x, Double_t y, Double_t z) { fX = x; fY = y; fZ = z; } inline void FairMCPoint::SetPosition(const TVector3& pos) { fX = pos.X(); fY = pos.Y(); fZ = pos.Z(); } #endif /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ // ------------------------------------------------------------------------- // ----- FairMesh header file ----- // ----- original author D.Bertini ----- // ----- adapted april 2010 O.Hartmann ----- // ------------------------------------------------------------------------- #ifndef FAIRMESH_H #define FAIRMESH_H #include "TObject.h" // for TObject #include "Rtypes.h" // for Double_t, Int_t, etc #include "TH2.h" // for TH2D #include "TString.h" // for TString /** * Abstract base class for Mesh Objects. **@author D.Bertini */ class FairMesh : public TObject { public: /** Default constructor **/ FairMesh(); FairMesh(const char*); /** Destructor **/ virtual ~FairMesh(); /** Accessors **/ Double_t GetXmin() const { return fXmin; }; Double_t GetYmin() const { return fYmin; }; Double_t GetZmin() const { return fZmin; }; Double_t GetXmax() const { return fXmax; }; Double_t GetYmax() const { return fYmax; }; Double_t GetZmax() const { return fZmax; }; /** Modifiers **/ void SetX(Double_t xmin,Double_t xmax, Int_t nbin ) { fXmin = xmin; fXmax = xmax; NXbin = nbin; } void SetY(Double_t ymin,Double_t ymax, Int_t nbin ) { fYmin = ymin; fYmax = ymax; NYbin = nbin; } void SetZ(Double_t zmin,Double_t zmax, Int_t nbin ) { fZmin = zmin; fZmax = zmax; NZbin = nbin; } TH2D* GetMeshTid() { return fMeshTid; } TH2D* GetMeshFlu() { return fMeshFlu; } TH2D* GetMeshSEU() { return fMeshSEU; } /*** Output to screen */ // virtual void Print(const Option_t* opt = 0) const {;} Double_t GetDiag() { return fDiag; } Double_t GetBinVolume() { return fBinVolume; } void fillTID(Double_t x , Double_t y , Double_t we ) { fMeshTid->Fill(x,y,we); } void fillFluence(Double_t x , Double_t y , Double_t we ) { fMeshFlu->Fill(x,y,we); } void fillSEU(Double_t x , Double_t y , Double_t we ) { fMeshSEU->Fill(x,y,we); } void Scale(Double_t fac ) { fMeshTid->Scale(fac); fMeshFlu->Scale(fac); fMeshSEU->Scale(fac); } void calculate(); void print(); protected: Double_t fXmin, fYmin, fZmin; Double_t fXmax, fYmax, fZmax; Int_t NXbin, NYbin, NZbin; Double_t fBinVolume; Double_t fDiag; TH2D* fMeshTid; // !mesh TH2D* fMeshFlu; // !mesh TH2D* fMeshSEU; // !mesh TString fhname; // !mesh private: FairMesh(const FairMesh&); FairMesh& operator=(const FairMesh&); ClassDef(FairMesh,1); }; #endif /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ /** * FairMultiLinkedData.h * * \date Dec 7, 2009 * \author T.Stockmanns */ #ifndef FAIRMULTILINKEDDATA_H_ #define FAIRMULTILINKEDDATA_H_ #include "TObject.h" // for TObject #include "FairLink.h" // for FairLink #include "Riosfwd.h" // for ostream #include "Rtypes.h" // for Int_t, Bool_t, kFALSE, etc #include "TString.h" // for TString #include // for operator<<, ostream, cout #include // for set #include // for vector class FairMultiLinkedData : public TObject { public: FairMultiLinkedData();///< Default constructor FairMultiLinkedData(std::set links, Bool_t persistanceCheck = kTRUE);///< Constructor FairMultiLinkedData(TString dataType, std::vector links, Int_t fileId = -1, Int_t evtId = -1,Bool_t persistanceCheck = kTRUE, Bool_t bypass = kFALSE, Float_t mult = 1.0);///< Constructor FairMultiLinkedData(Int_t dataType, std::vector links, Int_t fileId = -1, Int_t evtId = -1, Bool_t persistanceCheck = kTRUE, Bool_t bypass = kFALSE, Float_t mult = 1.0);///< Constructor virtual ~FairMultiLinkedData() {}; virtual std::set GetLinks() const { return fLinks;} ///< returns stored links as FairLinks virtual FairLink GetEntryNr() const { return fEntryNr;} ///< gives back the entryNr virtual Int_t GetNLinks() const { return fLinks.size(); } ///< returns the number of stored links virtual FairLink GetLink(Int_t pos) const; ///< returns the FairLink at the given position virtual FairMultiLinkedData GetLinksWithType(Int_t type) const; ///< Gives you a list of links which contain the given type virtual std::vector GetSortedMCTracks(); ///< Gives you a list of all FairLinks pointing to a "MCTrack" sorted by their weight TObject* GetData(FairLink& myLink); ///< Get the TObject the Link is pointing to virtual Int_t GetDefaultType() { return fDefaultType;} Bool_t GetPersistanceCheck() {return fPersistanceCheck;} ///< Returns the value of PersistanceCheck Int_t GetVerbose() {return fVerbose;} ///< Returns the verbosity level virtual void SetDefaultType(Int_t type) { fDefaultType = type;} virtual void SetPersistanceCheck(Bool_t check) {fPersistanceCheck = check;} ///< Controls if a persistance check of a link is done or not virtual void SetVerbose(Int_t level) {fVerbose = level;} ///< Sets the verbosity level virtual void SetInsertHistory(Bool_t val){ fInsertHistory = val;} ///< Toggles if history of a link is inserted or not virtual void SetEntryNr(FairLink entry){ fEntryNr = entry;} virtual void SetLinks(FairMultiLinkedData links, Float_t mult = 1.0); ///< Sets the links as vector of FairLink virtual void SetLink(FairLink link, Bool_t bypass = kFALSE, Float_t mult = 1.0); ///< Sets the Links with a single FairLink virtual void AddLinks(FairMultiLinkedData links, Float_t mult = 1.0); ///< Adds a List of FairLinks (FairMultiLinkedData) to fLinks 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 virtual void InsertLink(FairLink link); ///< Inserts a link into the list of links without persistance checking virtual void InsertHistory(FairLink link); ///< Adds the FairLinks of the inserted link to the set of links of this object virtual void AddAllWeights(Double_t weight); ///< Adds weight to all Links virtual void SetAllWeights(Double_t weight); ///< Sets a common weight for Links virtual void MultiplyAllWeights(Double_t weight); /// ["; for (Int_t i = 0; i < GetNLinks(); i++) { GetLink(i).PrintLinkInfo(out); out << " "; } out << "]"; return out; } ///< Output friend std::ostream& operator<< (std::ostream& out, const FairMultiLinkedData& data) { data.PrintLinkInfo(out); return out; } ///< Output protected: std::set fLinks; FairLink fEntryNr; Bool_t fPersistanceCheck; //! Bool_t fInsertHistory; //! Int_t fVerbose; //! virtual void SimpleAddLinks(Int_t fileId, Int_t evtId, Int_t dataType, std::vector links, Bool_t, Float_t) { for (UInt_t i = 0; i < links.size(); i++) { fLinks.insert(FairLink(fileId, evtId, dataType, links[i])); } } Int_t fDefaultType; ClassDef(FairMultiLinkedData, 4); }; /**\fn virtual void FairMultiLinkedData::SetLinks(Int_t type, std::vector links) * \param type as Int_t gives one type of source data for all indices * \param links as vector gives the vector of indices at which position in the TClonesArray the source data is stored */ /**\fn virtual void FairMultiLinkedData::SetLinks(std::vector type, std::vector links) * \param type as vector gives the type of source data (TClonesArray) * \param links as vector gives the vector of indices at which position in the TClonesArray the source data is stored */ #endif /* FAIRMULTILinkedData_H_ */ /** * FairMultiLinkedData_Interface.h * * \date Dec 7, 2009 * \author T.Stockmanns */ #ifndef FairMultiLinkedData_Interface_H_ #define FairMultiLinkedData_Interface_H_ #include "TObject.h" // for TObject #include "FairLink.h" // for FairLink #include "FairMultiLinkedData.h" #include "FairRootManager.h" #include "Riosfwd.h" // for ostream #include "Rtypes.h" // for Int_t, Bool_t, kFALSE, etc #include "TString.h" // for TString #include "TRef.h" #include // for operator<<, ostream, cout #include // for set #include // for vector class FairMultiLinkedData_Interface : public TObject { public: FairMultiLinkedData_Interface();///< Default constructor FairMultiLinkedData_Interface(FairMultiLinkedData& links, Bool_t persistanceCheck = kTRUE);///< Constructor FairMultiLinkedData_Interface(TString dataType, std::vector links, Int_t fileId = -1, Int_t evtId = -1,Bool_t persistanceCheck = kTRUE, Bool_t bypass = kFALSE, Float_t mult = 1.0);///< Constructor FairMultiLinkedData_Interface(Int_t dataType, std::vector links, Int_t fileId = -1, Int_t evtId = -1, Bool_t persistanceCheck = kTRUE, Bool_t bypass = kFALSE, Float_t mult = 1.0);///< Constructor FairMultiLinkedData_Interface(const FairMultiLinkedData_Interface& toCopy); virtual ~FairMultiLinkedData_Interface() { delete(fLink); }; FairMultiLinkedData_Interface& operator=(const FairMultiLinkedData_Interface& rhs); virtual std::set GetLinks() const; ///< returns stored links as FairLinks virtual Int_t GetNLinks() const; ///< returns the number of stored links virtual FairLink GetLink(Int_t pos) const; ///< returns the FairLink at the given position virtual FairMultiLinkedData GetLinksWithType(Int_t type) const; ///< returns all FairLinks with the corresponding type virtual FairLink GetEntryNr() const; virtual FairMultiLinkedData* GetPointerToLinks() const { return fLink;} virtual std::vector GetSortedMCTracks(); virtual void SetLinks(FairMultiLinkedData links); ///< Sets the links as vector of FairLink virtual void SetLink(FairLink link); ///< Sets the Links with a single FairLink virtual void SetInsertHistory(Bool_t val); virtual void SetEntryNr(FairLink val); virtual void SetPointerToLinks(FairMultiLinkedData* links) {fLink = links;} virtual void AddLinks(FairMultiLinkedData links, Float_t mult = 1.0); ///< Adds a List of FairLinks (FairMultiLinkedData_Interface) to fLinks 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 virtual void AddInterfaceData(FairMultiLinkedData_Interface* data); virtual void ResetLinks(); std::ostream& PrintLinkInfo(std::ostream& out = std::cout) const { if (GetPointerToLinks() != 0) GetPointerToLinks()->PrintLinkInfo(out); return out; } ///< Output friend std::ostream& operator<< (std::ostream& out, FairMultiLinkedData_Interface& data) { data.PrintLinkInfo(out); return out; } ///< Output protected: Int_t fVerbose; //! Bool_t fInsertHistory; //! FairMultiLinkedData* fLink; FairMultiLinkedData* CreateFairMultiLinkedData(); ClassDef(FairMultiLinkedData_Interface, 5); }; /**\fn virtual void FairMultiLinkedData_Interface::SetLinks(Int_t type, std::vector links) * \param type as Int_t gives one type of source data for all indices * \param links as vector gives the vector of indices at which position in the TClonesArray the source data is stored */ /**\fn virtual void FairMultiLinkedData_Interface::SetLinks(std::vector type, std::vector links) * \param type as vector gives the type of source data (TClonesArray) * \param links as vector gives the vector of indices at which position in the TClonesArray the source data is stored */ #endif /* FairMultiLinkedData_Interface_H_ */ /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ // ------------------------------------------------------------------------- // ----- FairRadLenPoint header file ----- // ----- Created 14/01/08 by M. Al-Turany ----- // ------------------------------------------------------------------------- /** FairRadLenPoint.h *@author M. Al-Turany * */ #ifndef FAIRRADLENPOINT_H #define FAIRRADLENPOINT_H #include "FairMCPoint.h" // for FairMCPoint #include "Rtypes.h" // for Double_t, Float_t, etc #include "TVector3.h" // for TVector3 class FairRadLenPoint : public FairMCPoint { public: /** Default constructor **/ FairRadLenPoint(); FairRadLenPoint(Int_t trackID, Int_t detID, TVector3 pos, TVector3 mom, Double_t tof, Double_t length, Double_t eLoss, TVector3 posOut, TVector3 momOut, Float_t fA, Float_t fZ, Float_t fDensity, Float_t fRadLen); /** Destructor **/ virtual ~FairRadLenPoint(); /** Accessors **/ Float_t GetA() { return fA; } Float_t GetZm() { return fZmat; } Float_t GetRadLength() { return fRadLen;} Float_t GetDensity() { return fDensity ; } /** Modifiers **/ void SetA(Double_t A) { fA = A; } void SetZm(Double_t Z) { fZmat = Z; } void SetRadLength(Double_t length) { fRadLen = length;} void SetDensity (Double_t Density) { fDensity = Density; } /** Output to screen **/ virtual void Print(const Option_t* opt) const; Double_t GetXOut() const { return fXOut;}; Double_t GetYOut() const { return fYOut;}; Double_t GetZOut() const { return fZOut;}; Double_t GetPxOut() const { return fPxOut; } Double_t GetPyOut() const { return fPyOut; } Double_t GetPzOut() const { return fPzOut; } TVector3 GetPosition() const { return TVector3(fX, fY, fZ);} TVector3 GetPositionOut() const { return TVector3(fXOut, fYOut, fZOut);} void PositionOut(TVector3& pos) const { pos.SetXYZ(fXOut, fYOut, fZOut);}; void MomentumOut(TVector3& mom) const { mom.SetXYZ(fPxOut,fPyOut,fPzOut); } protected: Float_t fA; // A of material Float_t fZmat; // Z of material Float_t fDensity; // density of material Float_t fRadLen; // radiation length Double_t fXOut, fYOut, fZOut; Double_t fPxOut, fPyOut, fPzOut; ClassDef(FairRadLenPoint,1) }; #endif /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ // ------------------------------------------------------------------------- // ----- FairRadMapPoint header file ----- // ------------------------------------------------------------------------- /** FairRadMapPoint.h *@author O.N. Hartmann * */ #ifndef FAIRRADMAPPOINT_H #define FAIRRADMAPPOINT_H #include "FairMCPoint.h" // for FairMCPoint #include "Rtypes.h" // for Double_t, Float_t, Int_t, etc #include "TVector3.h" // for TVector3 class FairRadMapPoint : public FairMCPoint { public: /** Default constructor **/ FairRadMapPoint(); FairRadMapPoint(Int_t trackID, Int_t detID, TVector3 pos, TVector3 mom, Double_t tof, Double_t length, Double_t eLoss, TVector3 posOut, TVector3 momOut, Float_t fA, Float_t fZ, Float_t fDensity, Double_t fVolMass, Double_t fStep, Double_t fDose, Double_t fDoseSL, Int_t fPdg ); /** Destructor **/ virtual ~FairRadMapPoint(); /** Accessors **/ Float_t GetA() { return fA; } Float_t GetZm() { return fZmat; } Float_t GetMass() { return fVolMass;} Float_t GetDensity() { return fDensity ; } /** Modifiers **/ void SetA(Double_t A) { fA = A; } void SetZm(Double_t Z) { fZmat = Z; } void SetMass(Double_t vmass) { fVolMass = vmass;} void SetDensity (Double_t Density) { fDensity = Density; } /** Output to screen **/ virtual void Print(const Option_t* opt) const; Int_t GetPdg() const { return fPdg;}; Double_t GetXOut() const { return fXOut;}; Double_t GetYOut() const { return fYOut;}; Double_t GetZOut() const { return fZOut;}; Double_t GetPxOut() const { return fPxOut; } Double_t GetPyOut() const { return fPyOut; } Double_t GetPzOut() const { return fPzOut; } Double_t GetDose() const { return fDose;} Double_t GetDoseSL() const { return fDoseSL;} TVector3 GetPosition() const { return TVector3(fX, fY, fZ);} TVector3 GetPositionOut() const { return TVector3(fXOut, fYOut, fZOut);} void PositionOut(TVector3& pos) const { pos.SetXYZ(fXOut, fYOut, fZOut);}; void MomentumOut(TVector3& mom) const { mom.SetXYZ(fPxOut,fPyOut,fPzOut); } protected: // Int_t detID; // detector ID or volume ID Int_t fPdg; // track PID Float_t fA; // A of material Float_t fZmat; // Z of material Float_t fDensity; // density of material Double_t fVolMass; // radiation length Double_t fStep, fDose, fDoseSL; Double_t fXOut, fYOut, fZOut; Double_t fPxOut, fPyOut, fPzOut; ClassDef(FairRadMapPoint,3) }; #endif /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ // ------------------------------------------------------------------------- // ----- FairRecoEventHeader header file ----- // ----- Created 20/09/13 R.Karabowicz ----- // ------------------------------------------------------------------------- #ifndef FAIRRECOEVENTHEADER_H #define FAIRRECOEVENTHEADER_H #include "TNamed.h" /** * Event Header Class **@author D.Bertini **@author M.Al-Turany **@author R.Karabowicz */ class FairRecoEventHeader : public TNamed { public: /** Default constructor */ FairRecoEventHeader(); /** Get the run ID for this run*/ UInt_t GetRunId() const { return fRunId; } /** Get the MC time for this event*/ Double_t GetEventTime() const { return fEventTime; } /** Get the error of MC time for this event*/ Double_t GetEventTimeError() const { return fEventTimeError; } /** Get identifier*/ Int_t GetIdentifier() const { return fIdentifier; } /** Set the run ID for this run * @param runid : unique run id */ void SetRunId(UInt_t runid) { fRunId=runid; } /** Set the MC time for this event * @param time : time in ns * @param terr : time error in ns */ void SetEventTime(Double_t time, Double_t terr) { fEventTime=time; fEventTimeError=terr; } /** Set the run ID for this run * @param ident : identifier */ void SetIdentifier(Int_t ident) { fIdentifier=ident; } virtual bool operator<(const FairRecoEventHeader& tempObj) const { if (fEventTime < tempObj.GetEventTime()) { return true; } else if (fEventTime > tempObj.GetEventTime()) { return false; } return false; } virtual bool operator>(const FairRecoEventHeader& tempObj) const { if (fEventTime > tempObj.GetEventTime()) { return true; } else if (fEventTime < tempObj.GetEventTime()) { return false; } return false; } virtual bool operator==(const FairRecoEventHeader& tempObj) const { if (fEventTime == tempObj.GetEventTime() ) { return true; } return false; } /** * Destructor */ virtual ~FairRecoEventHeader(); protected: /** Run Id */ UInt_t fRunId; /** Identifier */ Int_t fIdentifier; /** Event Time **/ Double_t fEventTime; /** Event Time Error **/ Double_t fEventTimeError; ClassDef(FairRecoEventHeader,1) }; #endif /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ #ifndef FAIRRUNINFO_H #define FAIRRUNINFO_H #include "TObject.h" // for TObject #include "Rtypes.h" // for Double_t, Long_t, etc #include "TSystem.h" // for CpuInfo_t, MemInfo_t, etc #include "TTimeStamp.h" // for TTimeStamp #include // for vector class FairLogger; class TList; class FairRunInfo : public TObject { public: FairRunInfo(); ~FairRunInfo(); void StoreInfo(); void WriteInfo(); void Reset(); private: TTimeStamp fTimeStamp;//! CpuInfo_t fCpuInfo;//! MemInfo_t fMemInfo;//! ProcInfo_t fProcInfo;//! std::vector fTimeDiff;//! std::vector fTime;//! std::vector fResidentMemory;//! std::vector fVirtualMemory;//! FairLogger* fLogger; void CalculateTimeDifference(); void PrintInfo(); void GetInfo(); void CreateAndFillHistograms(TList* histoList); void WriteHistosToFile(TList* histoList); FairRunInfo(const FairRunInfo&); FairRunInfo& operator=(const FairRunInfo&); ClassDef(FairRunInfo,1) }; #endif /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ #ifndef FAIRTIMESTAMP_H #define FAIRTIMESTAMP_H #include "FairMultiLinkedData_Interface.h" // for FairMultiLinkedData #include "FairLink.h" // for FairLink #include "Riosfwd.h" // for ostream #include "Rtypes.h" // for Double_t, etc #include // for ostream, cout #ifndef __CINT__ // for BOOST serialization #include #include #endif //__CINT__ class TObject; /** * Base class for Time stamp information ** Aug. 2010 **@author M.Al-Turany */ class FairTimeStamp : public FairMultiLinkedData_Interface { public: /** Default constructor **/ FairTimeStamp(); /** Constructor with time **/ FairTimeStamp(Double_t time); /** Constructor with time and time error **/ FairTimeStamp(Double_t time, Double_t timeerror); /** Destructor **/ virtual ~FairTimeStamp(); /** Accessors **/ virtual Double_t GetTimeStamp() const { return fTimeStamp; }; virtual Double_t GetTimeStampError() const { return fTimeStampError;}; virtual FairLink GetEntryNr() const {return fEntryNr;} /** Modifiers **/ virtual void SetTimeStamp(Double_t t) { fTimeStamp = t; } virtual void SetTimeStampError(Double_t t) {fTimeStampError = t;} virtual void SetEntryNr(FairLink entry) {fEntryNr = entry;} virtual Int_t Compare(const TObject* obj) const { if (this == obj) { return 0; } FairTimeStamp* tsobj = static_cast(const_cast(obj)); Double_t ts = tsobj->GetTimeStamp(); Double_t tserror = tsobj->GetTimeStampError(); if (fTimeStamp < ts) { return -1; } else if (fTimeStamp == ts && fTimeStampError < tserror) { return -1; } else if (fTimeStamp == ts && fTimeStampError == tserror) { return 0; } else { return 1; } } virtual std::ostream& PrintTimeInfo(std::ostream& out = std::cout) const; virtual Bool_t IsSortable() const { return kTRUE;}; virtual bool equal(FairTimeStamp* data) { return (fTimeStamp == data->GetTimeStamp() && fTimeStampError == data->GetTimeStampError()); } friend std::ostream& operator<< (std::ostream& out, const FairTimeStamp& link) { link.PrintTimeInfo(out); return out; } virtual bool operator< (const FairTimeStamp* rValue) const { if (GetTimeStamp() < rValue->GetTimeStamp()) return true; else return false; } template void serialize(Archive& ar, const unsigned int) { // ar & boost::serialization::base_object(*this); ar& fTimeStamp; ar& fTimeStampError; } protected: #ifndef __CINT__ // for BOOST serialization friend class boost::serialization::access; #endif // for BOOST serialization Double_t fTimeStamp; /** Time of digit or Hit [ns] */ Double_t fTimeStampError; /** Error on time stamp */ FairLink fEntryNr; //! indicates where the data is stored in the branch ClassDef(FairTimeStamp,3); }; #endif /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ // ------------------------------------------------------------------------- // ----- FairTrackParam header file ----- // ----- Created 27/01/05 by V. Friese ----- // ------------------------------------------------------------------------- /** FairTrackParam.h *@author V.Friese ** ** Parameters (x, y, tx, ty, q/p) of a track ** resulting from the track fit. The z coordinate is not a parameter. ** The 5x5 covariance matrix can be set and accessed by either an array ** of size 15, the TMatrixFSym class or elementwise. Note that TMatrixFSym ** should not be used when performance is an issue. ** The internal representation of the covariance matrix elements is ** an array of double. **/ #ifndef FAIRSTSTRACKPARAM #define FAIRSTSTRACKPARAM 1 #include "TObject.h" // for TObject #include "Rtypes.h" // for Double_t, Double32_t, Int_t, etc #include "TMatrixFSymfwd.h" // for TMatrixFSym #include "TVector3.h" // for TVector3 class FairTrackParam : public TObject { public: /** Constructor **/ FairTrackParam(); /** Constructor with all variables **/ FairTrackParam(Double_t x, Double_t y, Double_t z, Double_t tx, Double_t ty, Double_t qp, const TMatrixFSym& covMat); /** Copy constructor **/ FairTrackParam(const FairTrackParam& param); /** Destructor **/ virtual ~FairTrackParam(); /** Output to screen **/ void Print(Option_t* option = "") const; /** Accessors **/ Double_t GetX() const { return fX; }; Double_t GetY() const { return fY; }; Double_t GetZ() const { return fZ; }; Double_t GetTx() const { return fTx; }; Double_t GetTy() const { return fTy; }; Double_t GetQp() const { return fQp; }; void Position(TVector3& pos) const { pos.SetXYZ(fX, fY, fZ); }; void Momentum(TVector3& mom) const; void CovMatrix(Double_t cov[]) const; void CovMatrix(TMatrixFSym& covMat) const; Double_t GetCovariance(Int_t i, Int_t j) const; /** Modifiers **/ void SetX(Double_t x) { fX = x; }; void SetY(Double_t y) { fY = y; }; void SetZ(Double_t z) { fZ = z; }; void SetTx(Double_t tx) { fTx = tx; }; void SetTy(Double_t ty) { fTy = ty; }; void SetQp(Double_t qp) { fQp = qp; }; void SetPosition(const TVector3& pos); void SetCovMatrix(Double_t cov[]); void SetCovMatrix(const TMatrixFSym& covMat); void SetCovariance(Int_t i, Int_t j, Double_t val); /** Assignment operator **/ FairTrackParam& operator=(const FairTrackParam& par ); private: /** Position of track at given z [cm] **/ Double32_t fX, fY, fZ; /** Direction of track tx = dx/dz; ty = dy/dz **/ Double32_t fTx, fTy; /** Charge over momentum [1/GeV] **/ Double32_t fQp; /** Covariance matrix for the variables x, y, tx, ty, q/p ** The 15 elements of the upper triangle of the symmetric matrix ** are stored in an array of floats. The sequence of the array is ** a[0,0..4], a[1,1..4], a[2,2..4], a[3,3..4], a[4,4]. **/ Double32_t fCovMatrix[15]; ClassDef(FairTrackParam,1); }; #endif /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ // ------------------------------------------------------------------------- // ----- FairField header file ----- // ----- Created 06/01/04 by M. Al-Turany ----- // ----- Redesign 13/02/06 by V. Friese ----- // ----- Redesign 04/08/06 by M. Al-Turany ----- // ------------------------------------------------------------------------- /** FairField.h ** @author M.Al-Turany ** @author V.Friese ** @since 06.01.2004 ** @version1.0 ** ** Abstract base class for magnetic fields in FAIR ** Concrete field should implement the pure virtual methods ** GetBx, GetBy and GetBz and/or GetBxyz ** ** Note: Field values should be returned in kG (thanks to GEANT3) **/ #ifndef FAIRFIELD_H #define FAIRFIELD_H 1 #include "RVersion.h" // for ROOT_VERSION_CODE #include "Riosfwd.h" // for ostream #include "Rtypes.h" // for Double_t, Bool_t, etc #if ROOT_VERSION_CODE < 333824 #ifndef ROOT_TVirtualMagField #define ROOT_TVirtualMagField // copied from ROOT for backward compatibility with ROOT versions before 5.24 #include "TNamed.h" class TVirtualMagField : public TNamed { public: TVirtualMagField() : TNamed() {} TVirtualMagField(const char* name) : TNamed(name,"") {} virtual ~TVirtualMagField() {} virtual void Field(const Double_t* x, Double_t* B) = 0; ClassDef(TVirtualMagField, 1) // Abstract base field class }; ClassImp(TVirtualMagField) #endif #else #include "TVirtualMagField.h" #endif #include // for printf #include // for operator<<, basic_ostream, etc #include "FairLogger.h" class FairField : public TVirtualMagField { public: /** Default constructor **/ FairField(); /** Constructor with name and title **/ FairField(const char* name, const char* title = "FAIR Magnetic Field"); FairField& operator=(const FairField&) {return *this;} /** Destructor **/ virtual ~FairField(); /** Intialisation. E.g. read in the field map. If needed, to be ** implemented in the concrete class. **/ virtual void Init() { }; /** Test whether field type is Constant **/ Bool_t IsConst(); /** Test whether field typ is Map **/ Bool_t IsMap(); /** Field type ( 0=constant, 1=map, 2=map sym2, 3 = map sym3 ) **/ Int_t GetType() const { return fType; } /** Get x component of magnetic field [kG] ** @param x,y,z Position [cm] **/ virtual Double_t GetBx(Double_t, Double_t, Double_t) {LOG(WARNING)<<"FairField::GetBx Should be implemented in User class"<createFairField(); } return field; }; virtual void SetParm() { if(fCreator) { fCreator->SetParm(); } } protected: FairFieldFactory* fCreator; static FairFieldFactory* fgRinstance; ClassDef(FairFieldFactory,1) private: FairFieldFactory(const FairFieldFactory& M); FairFieldFactory& operator= (const FairFieldFactory&) {return *this;} }; #endif //FAIRFIELDFACTORY_H /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ /** * Runge-Kutte Track propagator * @author M. Al-Turany * @version 0.1 * @since 22.1.10 */ #ifndef RKPropagator #define RKPropagator #include "TObject.h" // for TObject #include "Rtypes.h" // for Double_t, etc class FairField; class FairRKPropagator : public TObject { private: FairRKPropagator(const FairRKPropagator&); // Not implemented FairRKPropagator& operator=(const FairRKPropagator&); // Not implemented Double_t fMaxStep; FairField* fMagField; public: void Step(Double_t Charge, Double_t* vecRKIn, Double_t* vecOut); Double_t OneStepRungeKutta(Double_t charge, Double_t step, Double_t* vect, Double_t* vout); FairRKPropagator(FairField* field); /**Propagate to closest approach of a point @CHARGE Particle charge @STEP maximum Step size @vecRKIn Initial co-ords,direction cosines,momentum @vecOut Output co-ords,direction cosines,momentum */ void Propagat(Double_t Charge, Double_t* vecRKIn, Double_t* Pos); /**Propagate to closest approach of a plane @CHARGE Particle charge @vecRKIn Initial co-ords,direction cosines,momentum @vec1 vector on the plane @vec2 vector on the plane @vec3 point on the plane @vecOut Output co-ords,direction cosines,momentum */ void PropagatToPlane(Double_t Charge, Double_t* vecRKIn, Double_t* vec1, Double_t* vec2, Double_t* vec3, Double_t* vecOut); virtual ~FairRKPropagator(); ClassDef(FairRKPropagator, 1); }; #endif /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ // ----------------------------------------------------------------------------- // ----- ----- // ----- FairSource ----- // ----- Created 01.11.2013 by F. Uhlig ----- // ----- ----- // ----------------------------------------------------------------------------- #ifndef FAIRSOURCE_H #define FAIRSOURCE_H #include "TObject.h" #include class FairEventHeader; enum Source_Type {kONLINE, kFILE}; class FairSource : public TObject { public: FairSource(); FairSource(const FairSource& source); virtual ~FairSource(); virtual Bool_t Init() = 0; virtual Int_t ReadEvent(UInt_t=0) = 0; virtual void Close() = 0; virtual void Reset() = 0; virtual Bool_t ActivateObject(TObject**, const char*) { return kFALSE; } virtual Source_Type GetSourceType() = 0; virtual void SetParUnpackers() = 0; virtual Bool_t InitUnpackers() = 0; virtual Bool_t ReInitUnpackers() = 0; /**Check the maximum event number we can run to*/ virtual Int_t CheckMaxEventNo(Int_t=0) {return -1;} /**Read the tree entry on one branch**/ virtual void ReadBranchEvent(const char*) {return;} virtual void ReadBranchEvent(const char*, Int_t) {return;} virtual void FillEventHeader(FairEventHeader* feh); void SetRunId(Int_t runId) { fRunId = runId; } Int_t GetRunId() const { return fRunId; } protected: Int_t fRunId; public: ClassDef(FairSource, 2) }; #endif /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ // // FairFileSource.h // FAIRROOT // // Created by Mohammad Al-Turany on 08/02/14. // // #ifndef __FAIRROOT__FairFileSource__ #define __FAIRROOT__FairFileSource__ #include "FairSource.h" #include #include "TChain.h" #include "TFile.h" #include "TFolder.h" #include "TF1.h" class FairEventHeader; class FairFileHeader; class FairMCEventHeader; class TString; class FairLogger; class FairRuntimeDb; class FairFileSource : public FairSource { public: FairFileSource(TFile *f, const char* Title="InputRootFile", UInt_t identifier=0); FairFileSource(const TString* RootFileName, const char* Title="InputRootFile", UInt_t identifier=0); FairFileSource(const TString RootFileName, const char* Title="InputRootFile", UInt_t identifier=0); // FairFileSource(const FairFileSource& file); virtual ~FairFileSource(); Bool_t Init(); Int_t ReadEvent(UInt_t i=0); void Close(); void Reset(); virtual Source_Type GetSourceType() { return kFILE; } virtual void SetParUnpackers() {} virtual Bool_t InitUnpackers() { return kTRUE; } virtual Bool_t ReInitUnpackers() { return kTRUE; } /**Check the maximum event number we can run to*/ virtual Int_t CheckMaxEventNo(Int_t EvtEnd=0); /**Read the tree entry on one branch**/ virtual void ReadBranchEvent(const char* BrName); /**Read specific tree entry on one branch**/ virtual void ReadBranchEvent(const char* BrName, Int_t Entry); virtual void FillEventHeader(FairEventHeader* feh); const TFile* GetRootFile(){return fRootFile;} /** Add a friend file (input) by name)*/ void AddFriend(TString FileName); /**Add ROOT file to input, the file will be chained to already added files*/ void AddFile(TString FileName); void AddFriendsToChain(); void PrintFriendList(); Bool_t CompareBranchList(TFile* fileHandle, TString inputLevel); void CheckFriendChains(); void CreateNewFriendChain(TString inputFile, TString inputLevel); TTree* GetInTree() {return fInChain->GetTree();} TChain* GetInChain() {return fInChain;} TFile* GetInFile() {return fRootFile;} void CloseInFile() { if(fRootFile) { fRootFile->Close(); }} /**Set the input tree when running on PROOF worker*/ void SetInTree (TTree* tempTree); TObjArray* GetListOfFolders(){return fListFolder;} TFolder* GetBranchDescriptionFolder(){return fCbmroot;} UInt_t GetEntries(){return fNoOfEntries; } // TList* GetBranchNameList() {return fBranchNameList;} void SetInputFile(TString name); /** 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 */ void SetBeamTime(Double_t beamTime, Double_t gapTime); /** Set the min and max limit for event time in ns */ void SetEventTimeInterval(Double_t min, Double_t max); /** Set the mean time for the event in ns */ void SetEventMeanTime(Double_t mean); void SetEventTime(); Double_t GetDeltaEventTime(); void SetFileHeader(FairFileHeader* f) {fFileHeader =f;} Double_t GetEventTime(); // virtual Bool_t SetObject(TObject* obj, const char* ObjType); // virtual void SetObjectName(const char* ObjName, const char* ObjType); virtual Bool_t ActivateObject(TObject** obj, const char* BrName); /**Set the status of the EvtHeader *@param Status: True: The header was creatged in this session and has to be filled FALSE: We use an existing header from previous data level */ void SetEvtHeaderNew(Bool_t Status) {fEvtHeaderIsNew = Status;} Bool_t IsEvtHeaderNew() {return fEvtHeaderIsNew;} /** Allow to disable the testing the file layout when adding files to a chain. */ void SetCheckFileLayout(Bool_t enable) {fCheckFileLayout = enable;} private: /** Title of input source, could be input, background or signal*/ TString fInputTitle; /**ROOT file*/ TFile* fRootFile; /** Current Entry number */ Int_t fCurrentEntryNr; //! /** List of all files added with AddFriend */ std::list fFriendFileList; //! std::list fInputChainList;//! std::map fFriendTypeList;//! std::map* > fCheckInputBranches; //! std::list fInputLevel; //! std::map > fRunIdInfoAll; //! /**Input Chain */ TChain* fInChain; /**Input Tree */ TTree* fInTree; /** list of folders from all input (and friends) files*/ TObjArray *fListFolder; //! /** RuntimeDb*/ FairRuntimeDb* fRtdb; /**folder structure of output*/ TFolder* fCbmout; /**folder structure of input*/ TFolder* fCbmroot; /***/ UInt_t fSourceIdentifier; /**No of Entries in this source*/ UInt_t fNoOfEntries; /**Initialization flag, true if initialized*/ Bool_t IsInitialized; FairFileSource(const FairFileSource&); FairFileSource operator=(const FairFileSource&); /** MC Event header */ FairMCEventHeader* fMCHeader; //! /**Event Header*/ FairEventHeader* fEvtHeader; //! /**File Header*/ FairFileHeader* fFileHeader; //! /** This is true if the event time used, came from simulation*/ Bool_t fEventTimeInMCHeader; //! /**This flag is true if the event header was created in this session * otherwise it is false which means the header was created in a previous data * level and used here (e.g. in the digi) */ Bool_t fEvtHeaderIsNew; //! /** for internal use, to return the same event time for the same entry*/ UInt_t fCurrentEntryNo; //! /** for internal use, to return the same event time for the same entry*/ UInt_t fTimeforEntryNo; //! /** min time for one event (ns) */ Double_t fEventTimeMin; //! /** max time for one Event (ns) */ Double_t fEventTimeMax; //! /** Time of event since th start (ns) */ Double_t fEventTime; //! /** Time of particles in beam (ns) */ Double_t fBeamTime; //! /** Time without particles in beam (gap) (ns) */ Double_t fGapTime; //! /** EventMean time used (P(t)=1/fEventMeanTime*Exp(-t/fEventMeanTime) */ Double_t fEventMeanTime; //! /** used to generate random numbers for event time; */ TF1* fTimeProb; //! /** True if the file layout should be checked when adding files to a chain. * Default value is true. */ Bool_t fCheckFileLayout; //! ClassDef(FairFileSource, 3) }; #endif /* defined(__FAIRROOT__FairFileSource__) */ /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ // // FairMixedSource.h // FAIRROOT // // Created by Mohammad Al-Turany on 08/02/14. // // #ifndef __FAIRROOT__FairMixedSource__ #define __FAIRROOT__FairMixedSource__ #include "FairSource.h" #include #include "TChain.h" #include "TFile.h" #include "TF1.h" class FairEventHeader; class FairFileHeader; class FairMCEventHeader; class TString; class FairLogger; class FairRuntimeDb; class TFolder; class FairRootManager; class FairMixedSource : public FairSource { public: FairMixedSource(TFile *f, const char* Title="InputRootFile", UInt_t identifier=0); FairMixedSource(const TString* RootFileName, const char* Title="InputRootFile", UInt_t identifier=0); FairMixedSource(const TString RootFileName, const Int_t signalId, const char* Title="InputRootFile", UInt_t identifier=0); // FairMixedSource(const FairMixedSource& file); virtual ~FairMixedSource(); Bool_t Init(); Int_t ReadEvent(UInt_t i=0); void Close(); void Reset(); virtual Source_Type GetSourceType() { return kFILE; } virtual void SetParUnpackers() {} virtual Bool_t InitUnpackers() { return kTRUE; } virtual Bool_t ReInitUnpackers() { return kTRUE; } /**Check the maximum event number we can run to*/ virtual Int_t CheckMaxEventNo(Int_t EvtEnd=0); /**Read the tree entry on one branch**/ void ReadBranchEvent(const char* BrName); /** Read specific tree entry on one branch**/ void ReadBranchEvent(const char* BrName, Int_t Entry); void FillEventHeader(FairEventHeader* feh); const TFile* GetRootFile(){return fRootFile;} /** Add a friend file (input) by name)*/ virtual Bool_t ActivateObject(TObject** obj, const char* BrName); void ReadBKEvent(UInt_t i=0); /**Set the input signal file *@param name : signal file name *@param identifier : Unsigned integer which identify the signal file */ void SetSignalFile(TString name, UInt_t identifier ); /**Set the input background file by name*/ void SetBackgroundFile(TString name); /**Add signal file to input *@param name : signal file name *@param identifier : Unsigned integer which identify the signal file to which this signal should be added */ void AddSignalFile(TString name, UInt_t identifier ); void AddBackgroundFile(TString name); TChain* GetBGChain() { return fBackgroundChain;} TChain* GetSignalChainNo(UInt_t i); Bool_t OpenBackgroundChain(); Bool_t OpenSignalChain(); /**Set the signal to background ratio in event units *@param background : Number of background Events for one signal *@param Signalid : Signal file Id, used when adding (setting) the signal file */ void BGWindowWidthNo(UInt_t background, UInt_t Signalid); /**Set the signal to background rate in time units *@param background : Time of background Events before one signal *@param Signalid : Signal file Id, used when adding (setting) the signal file */ void BGWindowWidthTime(Double_t background, UInt_t Signalid); /** Set the min and max limit for event time in ns */ void SetEventTimeInterval(Double_t min, Double_t max); /** Set the mean time for the event in ns */ void SetEventMeanTime(Double_t mean); /** 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 */ void SetBeamTime(Double_t beamTime, Double_t gapTime); void SetEventTime(); Double_t GetDeltaEventTime(); void SetFileHeader(FairFileHeader* f) {fFileHeader =f;} Double_t GetEventTime(); /**Add ROOT file to input, the file will be chained to already added files*/ Bool_t CompareBranchList(TFile* fileHandle, TString inputLevel); /**Set the input tree when running on PROOF worker*/ TObjArray* GetListOfFolders(){return fListFolder;} TFolder* GetBranchDescriptionFolder(){return fCbmroot;} UInt_t GetEntries(){return fNoOfEntries; } /**Set the status of the EvtHeader *@param Status: True: The header was creatged in this session and has to be filled FALSE: We use an existing header from previous data level */ void SetEvtHeaderNew(Bool_t Status) {fEvtHeaderIsNew = Status;} Bool_t IsEvtHeaderNew() {return fEvtHeaderIsNew;} private: /**IO manager */ FairRootManager* fRootManager; /** Title of input source, could be input, background or signal*/ TString fInputTitle; /**ROOT file*/ TFile* fRootFile; /** List of all files added with AddFriend */ std::list fFriendFileList; //! std::list fInputChainList;//! std::map fFriendTypeList;//! std::map* > fCheckInputBranches; //! std::list fInputLevel; //! std::map > fRunIdInfoAll; //! /** list of folders from all input (and friends) files*/ TObjArray *fListFolder; //! /** RuntimeDb*/ FairRuntimeDb* fRtdb; /**folder structure of output*/ TFolder* fCbmout; /**folder structure of input*/ TFolder* fCbmroot; /***/ UInt_t fSourceIdentifier; /**No of Entries in this source*/ UInt_t fNoOfEntries; /**Initialization flag, true if initialized*/ Bool_t IsInitialized; /** MC Event header */ FairMCEventHeader* fMCHeader; //! /**Event Header*/ FairEventHeader* fEvtHeader; //! /**Output Event Header*/ FairEventHeader* fOutHeader; //! /**File Header*/ FairFileHeader* fFileHeader; //! /** This is true if the event time used, came from simulation*/ Bool_t fEventTimeInMCHeader; //! /**This flag is true if the event header was created in this session * otherwise it is false which means the header was created in a previous data * level and used here (e.g. in the digi) */ Bool_t fEvtHeaderIsNew; //! /** for internal use, to return the same event time for the same entry*/ UInt_t fCurrentEntryNo; //! /** for internal use, to return the same event time for the same entry*/ UInt_t fTimeforEntryNo; //! /* /\**No of entries in BG Chain*\/ */ UInt_t fNoOfBGEntries; //! /* /\**Hold the current entry for each input chain*\/ */ std::map fCurrentEntry; //! /** min time for one event (ns) */ Double_t fEventTimeMin; //! /** max time for one Event (ns) */ Double_t fEventTimeMax; //! /** Time of event since th start (ns) */ Double_t fEventTime; //! /** Time of particles in beam (ns) */ Double_t fBeamTime; //! /** Time without particles in beam (gap) (ns) */ Double_t fGapTime; //! /** EventMean time used (P(t)=1/fEventMeanTime*Exp(-t/fEventMeanTime) */ Double_t fEventMeanTime; //! /** used to generate random numbers for event time; */ TF1* fTimeProb; //! /**holds the SB ratio by number*/ std::map fSignalBGN;//! /* /\**True for background window in entry units*\/ */ Bool_t fSBRatiobyN; //! /* /\**True for background window in time units (ns) *\/ */ Bool_t fSBRatiobyT; //! /**Actual identifier of the added signals, this is used to identify how many signals are added*/ UInt_t fActualSignalIdentifier; //! /** Total number of signals added (Types and not files!)*/ UInt_t fNoOfSignals; //! /** list of chains which has to be created for the different signals*/ std::list* fSignalChainList; //! /**Chain containing the background*/ TChain* fBackgroundChain; //! std::map fSignalTypeList;//! FairMixedSource(const FairMixedSource&); FairMixedSource& operator=(const FairMixedSource&); public: ClassDef(FairMixedSource, 0) }; #endif /* defined(__FAIRROOT__FairMixedSource__) */ /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ // ----------------------------------------------------------------------------- // ----- ----- // ----- FairMbsSource ----- // ----- Created 12.04.2013 by D.Kresan ----- // ----- Copied from FairSource 01.11.2013 by F.Uhlig ----- // ----- ----- // ----------------------------------------------------------------------------- #ifndef FAIRONLINESOURCE_H #define FAIRONLINESOURCE_H #include "FairSource.h" #include "TObjArray.h" #include "FairUnpack.h" class FairOnlineSource : public FairSource { public: FairOnlineSource(); FairOnlineSource(const FairOnlineSource& source); virtual ~FairOnlineSource(); inline void AddUnpacker(FairUnpack* unpacker) { fUnpackers->Add(unpacker); } inline const TObjArray* GetUnpackers() const { return fUnpackers; } virtual Bool_t Init() = 0; virtual Int_t ReadEvent(UInt_t=0) = 0; virtual void Close() = 0; virtual void SetParUnpackers(); virtual Bool_t InitUnpackers(); virtual Bool_t ReInitUnpackers(); void Reset(); virtual Source_Type GetSourceType() { return kONLINE; } protected: TObjArray* fUnpackers; private: FairOnlineSource& operator=(const FairOnlineSource&); ClassDef(FairOnlineSource, 0) }; #endif /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ // ----------------------------------------------------------------------------- // ----- ----- // ----- FairLmdSource ----- // ----- Created 12.04.2013 by D.Kresan ----- // ----------------------------------------------------------------------------- #ifndef FAIRLMDSOURCE_H #define FAIRLMDSOURCE_H extern "C" { #include "f_evt.h" #include "s_filhe_swap.h" #include "s_bufhe_swap.h" } #include "TString.h" #include "FairMbsSource.h" class TList; class FairLmdSource : public FairMbsSource { public: FairLmdSource(); FairLmdSource(const FairLmdSource& source); virtual ~FairLmdSource(); void AddFile(TString fileName); void AddPath(TString dir, TString wildCard); inline Int_t GetCurrentFile() const { return fCurrentFile; } inline const TList* GetFileNames() const { return fFileNames; } virtual Bool_t Init(); virtual Int_t ReadEvent(UInt_t=0); virtual void Close(); protected: Bool_t OpenNextFile(TString fileName); Int_t fCurrentFile; Int_t fNEvent; Int_t fCurrentEvent; TList* fFileNames; s_evt_channel* fxInputChannel; s_ve10_1* fxEvent; s_bufhe* fxBuffer; Int_t* fxEventData; s_ves10_1* fxSubEvent; s_filhe* fxInfoHeader; FairLmdSource& operator=(const FairLmdSource&); ClassDef(FairLmdSource, 0) }; #endif /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ // ----------------------------------------------------------------------------- // ----- ----- // ----- FairRemoteSource ----- // ----- Created 12.04.2013 by D.Kresan ----- // ----------------------------------------------------------------------------- #ifndef FAIRREMOTESOURCE_H #define FAIRREMOTESOURCE_H #include "FairMbsSource.h" class TSocket; class MRevBuffer; class REvent; class FairRemoteSource : public FairMbsSource { public: FairRemoteSource(char* node); FairRemoteSource(const FairRemoteSource& source); virtual ~FairRemoteSource(); virtual Bool_t Init(); virtual Int_t ReadEvent(UInt_t=0); virtual void Close(); inline const char* GetNode() const { return fNode; } private: char* fNode; TSocket* fSocket; MRevBuffer* fBuffer; REvent* fREvent; FairRemoteSource& operator=(const FairRemoteSource&); public: ClassDef(FairRemoteSource, 0) }; #endif /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ // ----------------------------------------------------------------------------- // ----- ----- // ----- FairMbsSource ----- // ----- Created 12.04.2013 by D.Kresan ----- // ----- Copied from FairSource 01.11.2013 by F.Uhlig ----- // ----- ----- // ----------------------------------------------------------------------------- #ifndef FAIRMBSSOURCE_H #define FAIRMBSSOURCE_H #include "FairOnlineSource.h" #include "TObjArray.h" #include "FairUnpack.h" class FairMbsSource : public FairOnlineSource { public: FairMbsSource(); FairMbsSource(const FairMbsSource& source); virtual ~FairMbsSource(); virtual Bool_t Init() = 0; virtual Int_t ReadEvent(UInt_t=0) = 0; virtual void Close() = 0; protected: Bool_t Unpack(Int_t* data, Int_t size, Short_t type, Short_t subType, Short_t procId, Short_t subCrate, Short_t control); ClassDef(FairMbsSource, 0) }; #endif /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ // ----------------------------------------------------------------------------- // ----- ----- // ----- FairUnpack ----- // ----- Created 12.04.2013 by D.Kresan ----- // ----------------------------------------------------------------------------- #ifndef FAIRUNPACK_H #define FAIRUNPACK_H #include "Rtypes.h" // for Int_t, Bool_t, etc #include "TObject.h" class FairUnpack : public TObject { public: FairUnpack(Short_t type, Short_t subType, Short_t procId, Short_t subCrate, Short_t control); virtual ~FairUnpack(); virtual Bool_t Init() = 0; virtual Bool_t ReInit() { return kTRUE; } virtual Bool_t DoUnpack(Int_t* data, Int_t size) = 0; virtual void Reset() = 0; virtual void SetParContainers() { }; inline Short_t GetType() const { return fType; } inline Short_t GetSubType() const { return fSubType; } inline Short_t GetProcId() const { return fProcId; } inline Short_t GetSubCrate() const { return fSubCrate; } inline Short_t GetControl() const { return fControl; } private: Short_t fType; Short_t fSubType; Short_t fProcId; Short_t fSubCrate; Short_t fControl; protected: virtual void Register() = 0; public: ClassDef(FairUnpack, 0) }; #endif /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ ////////////////////////////////////////////////////////////////////// // Copyright: // GSI, Gesellschaft fuer Schwerionenforschung mbH // Planckstr. 1 // D-64291 Darmstadt // Germany // created 16. 2.1999 by Horst Goeringer ////////////////////////////////////////////////////////////////////// // MRevBuffer.h // description of class MRevBuffer // ROOT client package for multithreaded remote event server (MBS) ////////////////////////////////////////////////////////////////////// // 20. 8.1999, H.G.: MRevBuffer::RevGetI added // 6. 3.2000, H.G.: new member function RevStatus ////////////////////////////////////////////////////////////////////// #ifndef MRevBuffer_H #define MRevBuffer_H #include "TObject.h" // for TObject #include "Rtypes.h" // for Int_t, ClassDef, etc class TSocket; class REvent : public TObject { private: Int_t iSize; // event size (byte) Int_t iNumb; // event number Int_t* piData; // event parameter REvent(const REvent&); REvent& operator=(const REvent&); public: REvent(); // constructor ~REvent(); // destructor void ReFillHead(Int_t* pHead); // unpack and fill event header void ReFillData(Int_t* pData); // unpack and fill event data Int_t ReGetNumb(); // get event number Int_t ReGetSize(); // get event size Int_t ReGetData(Int_t ichan); // get event parameter ichan Int_t* GetData() { return piData; } Int_t nSubEvt; Int_t subEvtSize[100]; Short_t subEvtType[100]; Short_t subEvtSubType[100]; Short_t subEvtProcId[100]; Short_t subEvtSubCrate[100]; Short_t subEvtControl[100]; Int_t* pSubEvt[100]; ClassDef(REvent, 0) // prototype for event }; ////////////////////////////////////////////////////////////////////// class MRevBuffer : public TObject { private: TSocket* pTSocket; // ptr socket of channel to event server Int_t iSocket; // socket id of channel to event server Int_t iBufNo1; // first buffer no. received (test) Int_t iBufNo2; // last buffer no. received (test) Int_t iDebug; // verbosity level (test) Int_t iSwap; // > 0: swap event data Int_t iStatus; // current status of server Int_t iBufSizeAlloc; // allocated buffer size Int_t iBufSize; // size current buffer Int_t iBufNo; // current buffer no. Int_t iFragBegin; // > 0: last buffer ended with fragment Int_t iFragConc; // no. of concatenated fragments Int_t iFragBeginIgn; // no. of ignored fragment begins Int_t iFragEndIgn; // no. of ignored fragment ends Int_t iHeadPar; // no. of (4 byte) parms buffer header Int_t iEvtMax; // no. of events requested Int_t iEvtNo; // last event no. handled Int_t iEvtRel; // rel. event no. in buffer Int_t iEvtBuf; // no. of events in current buffer Int_t iEvtPar; // no. of parameters in event (incl. len) Int_t* piBuf; // ptr event buffer Int_t* piNextEvt; // ptr first element next event REvent* pEvt; // ptr event class MRevBuffer(const MRevBuffer&); MRevBuffer& operator=(const MRevBuffer&); public: MRevBuffer( Int_t iMode); // constructor ~MRevBuffer(); // destructor TSocket* RevOpen( char* pNode, Int_t iPort, Int_t iEvent); // input: node name and port number server, req. no. of events // returns Socket ptr of server connection Int_t* RevGetI( TSocket* pSocket, Int_t iFlush); // get next event (pointer) from buffer, input: // Socket ptr, // iFlush = 1: skip current buffer (not impl) REvent* RevGet( TSocket* pSocket, Int_t iFlush, Int_t iSkip); // get next event (pointer) from buffer, input: // Socket ptr, // iFlush = 1: skip current buffer (not impl) // iSkip > 0: take only each iSkip event (not impl) Int_t RevStatus(Int_t iOut); // get status information (iOut = 1: also message to stdout) // = 0: last event request successfull // = 1: server not yet connected // = 2: server connected, but still no request for events // = 3: server connection okay, but currently no DAQ events // = 4: connection to server closed // = 5: connection to server closed after user break (CTL C) // = 6: connection to server closed after failure void RevBufWait(Int_t iWait); // wait for iWait seconds Int_t RevBufsize(); // get size of current buffer (byte) void RevClose( TSocket* pSocket ); // input Socket ptr ClassDef(MRevBuffer, 0) // prototype for remote event buffer }; #endif // !MRevBuffer_H // ----------------------------------------------------------------------------- // ----- FairMbsStreamSource header file ----- // ----- ----- // ----- created by C. Simon on 2014-09-12 ----- // ----- ----- // ----- based on FairLmdSource by D. Kresan ----- // ----- ----- // ----- revision 23363, 2013-12-26 ----- // ----------------------------------------------------------------------------- #ifndef FAIRMBSSTREAMSOURCE_H #define FAIRMBSSTREAMSOURCE_H extern "C" { #include "f_evt.h" #include "s_filhe_swap.h" #include "s_bufhe_swap.h" } #include "TString.h" #include "FairMbsSource.h" class FairMbsStreamSource : public FairMbsSource { public: FairMbsStreamSource(TString tServerName); FairMbsStreamSource(const FairMbsStreamSource& source); virtual ~FairMbsStreamSource(); virtual Bool_t Init(); virtual Int_t ReadEvent(UInt_t=0); virtual void Close(); const char* GetServerName() const {return fServerName.Data();}; private: Bool_t ConnectToServer(); TString fServerName; s_evt_channel* fxInputChannel; s_ve10_1* fxEvent; s_bufhe* fxBuffer; Int_t* fxEventData; s_ves10_1* fxSubEvent; FairMbsStreamSource& operator=(const FairMbsStreamSource&); public: ClassDef(FairMbsStreamSource, 0) }; #endif #undef _BACKWARD_BACKWARD_WARNING_H In file included from input_line_8:1: In file included from /home/vratik/workspace/expertroot_H5/macro/H5run/eventDisplay.C:2: In file included from /home/vratik/fair_install_root6/FairRootInst/include/FairMCTracks.h:24: /home/vratik/fair_install_root6/FairRootInst/include/FairTask.h:156:23: error: expected parameter declarator ClassDef(FairTask,3); ^ /home/vratik/fair_install_root6/FairRootInst/include/FairTask.h:156:23: error: expected ')' /home/vratik/fair_install_root6/FairRootInst/include/FairTask.h:156:13: note: to match this '(' ClassDef(FairTask,3); ^ /home/vratik/fair_install_root6/FairRootInst/include/FairTask.h:156:5: error: C++ requires a type specifier for all declarations ClassDef(FairTask,3); ^ In file included from input_line_71:1: In file included from /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:16: /home/vratik/fair_install_root6/FairSoftInst/include/root/TEvePathMark.h:51:30: error: expected parameter declarator ClassDefNV(TEvePathMarkT, 1); // Template for a special point on a track: position/momentum re... ^ /home/vratik/fair_install_root6/FairSoftInst/include/root/TEvePathMark.h:51:30: error: expected ')' /home/vratik/fair_install_root6/FairSoftInst/include/root/TEvePathMark.h:51:14: note: to match this '(' ClassDefNV(TEvePathMarkT, 1); // Template for a special point on a track: position/momentum re... ^ /home/vratik/fair_install_root6/FairSoftInst/include/root/TEvePathMark.h:51:4: error: C++ requires a type specifier for all declarations ClassDefNV(TEvePathMarkT, 1); // Template for a special point on a track: position/momentum re... ^ /home/vratik/fair_install_root6/FairSoftInst/include/root/TEvePathMark.h:54:33: error: typedef redefinition with different types ('TEvePathMarkT<...>' vs 'TEvePathMarkT<...>') typedef TEvePathMarkT TEvePathMark; ^ libEve dictionary forward declarations' payload:201:32: note: previous definition is here typedef TEvePathMarkT TEvePathMark __attribute__((annotate("$clingAutoload$TEvePathMark.h"))) ; ^ In file included from input_line_71:1: In file included from /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:16: /home/vratik/fair_install_root6/FairSoftInst/include/root/TEvePathMark.h:55:33: error: typedef redefinition with different types ('TEvePathMarkT<...>' vs 'TEvePathMarkT<...>') typedef TEvePathMarkT TEvePathMarkF; ^ libEve dictionary forward declarations' payload:202:32: note: previous definition is here typedef TEvePathMarkT TEvePathMarkF __attribute__((annotate("$clingAutoload$TEvePathMark.h"))) ; ^ In file included from input_line_71:1: In file included from /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:16: /home/vratik/fair_install_root6/FairSoftInst/include/root/TEvePathMark.h:56:33: error: typedef redefinition with different types ('TEvePathMarkT<...>' vs 'TEvePathMarkT<...>') typedef TEvePathMarkT TEvePathMarkD; ^ libEve dictionary forward declarations' payload:203:33: note: previous definition is here typedef TEvePathMarkT TEvePathMarkD __attribute__((annotate("$clingAutoload$TEvePathMar... ^ In file included from input_line_71:1: /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:58:27: error: expected parameter declarator ClassDef(TEveMagField, 0); // Abstract interface to magnetic field ^ /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:58:27: error: expected ')' /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:58:12: note: to match this '(' ClassDef(TEveMagField, 0); // Abstract interface to magnetic field ^ /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:58:4: error: C++ requires a type specifier for all declarations ClassDef(TEveMagField, 0); // Abstract interface to magnetic field ^ /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:43:18: error: no matching constructor for initialization of 'TEveVector' (aka 'TEveVectorT') TEveVector b = GetField(x, y, z); ^ ~~~~~~~~~~~~~~~~~ /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:47:75: error: no member named 'fX' in 'TEveVectorT' TEveVectorD GetFieldD(const TEveVectorD &v) const { return GetFieldD(v.fX, v.fY, v.fZ); } ~ ^ /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:47:81: error: no member named 'fY' in 'TEveVectorT' TEveVectorD GetFieldD(const TEveVectorD &v) const { return GetFieldD(v.fX, v.fY, v.fZ); } ~ ^ /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:47:87: error: no member named 'fZ' in 'TEveVectorT' TEveVectorD GetFieldD(const TEveVectorD &v) const { return GetFieldD(v.fX, v.fY, v.fZ); } ~ ^ /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:52:85: error: no viable conversion from returned value of type 'TEveVectorT' to function return type 'TEveVectorT' virtual TEveVectorD GetFieldD(Double_t x, Double_t y, Double_t z) const { return GetField(x, y, z); } ^~~~~~~~~~~~~~~~~ /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveVector.h:39:4: note: candidate function operator const TT*() const { return &fX; } ^ /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveVector.h:40:4: note: candidate function operator TT*() { return &fX; } ^ In file included from input_line_71:1: /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:55:74: error: no matching constructor for initialization of 'TEveVector' (aka 'TEveVectorT') virtual TEveVector GetField(Float_t, Float_t, Float_t) const { return TEveVector(); } ^ /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:81:32: error: expected parameter declarator ClassDef(TEveMagFieldConst, 0); // Interface to constant magnetic field. ^ /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:81:32: error: expected ')' /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:81:12: note: to match this '(' ClassDef(TEveMagFieldConst, 0); // Interface to constant magnetic field. ^ /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:81:4: error: C++ requires a type specifier for all declarations ClassDef(TEveMagFieldConst, 0); // Interface to constant magnetic field. ^ /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:73:23: error: no matching constructor for initialization of 'TEveVectorD' (aka 'TEveVectorT') TEveMagField(), fB(x, y, z) ^ ~~~~~~~ fatal error: too many errors emitted, stopping now [-ferror-limit=] In file included from input_line_8:1: In file included from /home/vratik/workspace/expertroot_H5/macro/H5run/eventDisplay.C:2: In file included from /home/vratik/fair_install_root6/FairRootInst/include/FairMCTracks.h:27: In file included from /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:16: /home/vratik/fair_install_root6/FairSoftInst/include/root/TEvePathMark.h:51:30: error: expected parameter declarator ClassDefNV(TEvePathMarkT, 1); // Template for a special point on a track: position/momentum re... ^ /home/vratik/fair_install_root6/FairSoftInst/include/root/TEvePathMark.h:51:30: error: expected ')' /home/vratik/fair_install_root6/FairSoftInst/include/root/TEvePathMark.h:51:14: note: to match this '(' ClassDefNV(TEvePathMarkT, 1); // Template for a special point on a track: position/momentum re... ^ /home/vratik/fair_install_root6/FairSoftInst/include/root/TEvePathMark.h:51:4: error: C++ requires a type specifier for all declarations ClassDefNV(TEvePathMarkT, 1); // Template for a special point on a track: position/momentum re... ^ /home/vratik/fair_install_root6/FairSoftInst/include/root/TEvePathMark.h:54:33: error: typedef redefinition with different types ('TEvePathMarkT<...>' vs 'TEvePathMarkT<...>') typedef TEvePathMarkT TEvePathMark; ^ libEve dictionary forward declarations' payload:201:32: note: previous definition is here typedef TEvePathMarkT TEvePathMark __attribute__((annotate("$clingAutoload$TEvePathMark.h"))) ; ^ In file included from input_line_8:1: In file included from /home/vratik/workspace/expertroot_H5/macro/H5run/eventDisplay.C:2: In file included from /home/vratik/fair_install_root6/FairRootInst/include/FairMCTracks.h:27: In file included from /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:16: /home/vratik/fair_install_root6/FairSoftInst/include/root/TEvePathMark.h:55:33: error: typedef redefinition with different types ('TEvePathMarkT<...>' vs 'TEvePathMarkT<...>') typedef TEvePathMarkT TEvePathMarkF; ^ libEve dictionary forward declarations' payload:202:32: note: previous definition is here typedef TEvePathMarkT TEvePathMarkF __attribute__((annotate("$clingAutoload$TEvePathMark.h"))) ; ^ In file included from input_line_8:1: In file included from /home/vratik/workspace/expertroot_H5/macro/H5run/eventDisplay.C:2: In file included from /home/vratik/fair_install_root6/FairRootInst/include/FairMCTracks.h:27: In file included from /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:16: /home/vratik/fair_install_root6/FairSoftInst/include/root/TEvePathMark.h:56:33: error: typedef redefinition with different types ('TEvePathMarkT<...>' vs 'TEvePathMarkT<...>') typedef TEvePathMarkT TEvePathMarkD; ^ libEve dictionary forward declarations' payload:203:33: note: previous definition is here typedef TEvePathMarkT TEvePathMarkD __attribute__((annotate("$clingAutoload$TEvePathMar... ^ In file included from libEve dictionary payload:35: In file included from /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveVSD.h:16: /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveVSDStructs.h:56:50: error: no matching constructor for initialization of 'TEveVector' (aka 'TEveVectorT') fDecayed(kFALSE), fTDecay(0), fVDecay(), fPDecay() {} ^ /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveVSDStructs.h:56:61: error: no matching constructor for initialization of 'TEveVector' (aka 'TEveVectorT') fDecayed(kFALSE), fTDecay(0), fVDecay(), fPDecay() {} ^ /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveVSDStructs.h:90:66: error: no matching constructor for initialization of 'TEveVector' (aka 'TEveVectorT') TEveHit() : fDetId(0), fSubdetId(0), fLabel(0), fEvaLabel(0), fV() {} ^ /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveVSDStructs.h:118:45: error: no matching constructor for initialization of 'TEveVector' (aka 'TEveVectorT') TEveCluster() : fDetId(0), fSubdetId(0), fV() { fLabel[0] = fLabel[1] = fLabel[2] = 0; } ^ /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveVSDStructs.h:154:33: error: typedef redefinition with different types ('TEveRecTrackT<...>' vs 'TEveRecTrackT<...>') typedef TEveRecTrackT TEveRecTrack; ^ libEve dictionary forward declarations' payload:204:32: note: previous definition is here typedef TEveRecTrackT TEveRecTrack __attribute__((annotate("$clingAutoload$TEveVSDStruct... ^ In file included from libEve dictionary payload:35: In file included from /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveVSD.h:16: /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveVSDStructs.h:155:33: error: typedef redefinition with different types ('TEveRecTrackT<...>' vs 'TEveRecTrackT<...>') typedef TEveRecTrackT TEveRecTrackF; ^ libEve dictionary forward declarations' payload:205:32: note: previous definition is here typedef TEveRecTrackT TEveRecTrackF __attribute__((annotate("$clingAutoload$TEveVSDStruc... ^ In file included from libEve dictionary payload:35: In file included from /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveVSD.h:16: /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveVSDStructs.h:156:33: error: typedef redefinition with different types ('TEveRecTrackT<...>' vs 'TEveRecTrackT<...>') typedef TEveRecTrackT TEveRecTrackD; ^ libEve dictionary forward declarations' payload:206:33: note: previous definition is here typedef TEveRecTrackT TEveRecTrackD __attribute__((annotate("$clingAutoload$TEveVSDStru... ^ In file included from libEve dictionary payload:35: In file included from /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveVSD.h:16: /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveVSDStructs.h:180:20: error: no matching constructor for initialization of 'TEveVector' (aka 'TEveVectorT') TEveRecKink() : fVKink(), fPMother(), fVMother(), fPDaughter(), fVDaughter(), fSign(0), fStatus(0) ^ /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveVSDStructs.h:180:30: error: no matching constructor for initialization of 'TEveVector' (aka 'TEveVectorT') TEveRecKink() : fVKink(), fPMother(), fVMother(), fPDaughter(), fVDaughter(), fSign(0), fStatus(0) ^ /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveVSDStructs.h:180:42: error: no matching constructor for initialization of 'TEveVector' (aka 'TEveVectorT') TEveRecKink() : fVKink(), fPMother(), fVMother(), fPDaughter(), fVDaughter(), fSign(0), fStatus(0) ^ /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveVSDStructs.h:180:54: error: no matching constructor for initialization of 'TEveVector' (aka 'TEveVectorT') TEveRecKink() : fVKink(), fPMother(), fVMother(), fPDaughter(), fVDaughter(), fSign(0), fStatus(0) ^ /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveVSDStructs.h:180:68: error: no matching constructor for initialization of 'TEveVector' (aka 'TEveVectorT') TEveRecKink() : fVKink(), fPMother(), fVMother(), fPDaughter(), fVDaughter(), fSign(0), fStatus(0) ^ /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveVSDStructs.h:215:29: error: no matching constructor for initialization of 'TEveVector' (aka 'TEveVectorT') TEveRecV0() : fStatus(), fVNeg(), fPNeg(), fVPos(), fPPos(), ^ /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveVSDStructs.h:215:38: error: no matching constructor for initialization of 'TEveVector' (aka 'TEveVectorT') TEveRecV0() : fStatus(), fVNeg(), fPNeg(), fVPos(), fPPos(), ^ /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveVSDStructs.h:215:47: error: no matching constructor for initialization of 'TEveVector' (aka 'TEveVectorT') TEveRecV0() : fStatus(), fVNeg(), fPNeg(), fVPos(), fPPos(), ^ /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveVSDStructs.h:215:56: error: no matching constructor for initialization of 'TEveVector' (aka 'TEveVectorT') TEveRecV0() : fStatus(), fVNeg(), fPNeg(), fVPos(), fPPos(), ^ /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveVSDStructs.h:216:18: error: no matching constructor for initialization of 'TEveVector' (aka 'TEveVectorT') fVCa(), fV0Birth(), fLabel(0), fPdg(0) ^ /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveVSDStructs.h:216:26: error: no matching constructor for initialization of 'TEveVector' (aka 'TEveVectorT') fVCa(), fV0Birth(), fLabel(0), fPdg(0) ^ /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveVSDStructs.h:244:35: error: no matching constructor for initialization of 'TEveVector' (aka 'TEveVectorT') TEveRecCascade() : fStatus(), fVBac(), fPBac(), ^ fatal error: too many errors emitted, stopping now [-ferror-limit=] Error in : Error parsing payload code for class TEveMagField with content: #line 1 "libEve dictionary payload" #ifndef G__VECTOR_HAS_CLASS_ITERATOR #define G__VECTOR_HAS_CLASS_ITERATOR 1 #endif #define _BACKWARD_BACKWARD_WARNING_H #include "TEveBrowser.h" #include "TEveChunkManager.h" #include "TEveCompound.h" #include "TEveElement.h" #include "TEveElementEditor.h" #include "TEveEventManager.h" #include "TEveGValuators.h" #include "TEveGedEditor.h" #include "TEveMacro.h" #include "TEveManager.h" #include "TEvePad.h" #include "TEveParamList.h" #include "TEveProjectionAxes.h" #include "TEveProjectionAxesEditor.h" #include "TEveProjectionAxesGL.h" #include "TEveProjectionBases.h" #include "TEveProjectionManager.h" #include "TEveProjectionManagerEditor.h" #include "TEveProjections.h" #include "TEveScene.h" #include "TEveSceneInfo.h" #include "TEveSelection.h" #include "TEveTrans.h" #include "TEveTransEditor.h" #include "TEveTreeTools.h" #include "TEveUtil.h" #include "TEveVector.h" #include "TEvePathMark.h" #include "TEveVSD.h" #include "TEveViewer.h" #include "TEveViewerListEditor.h" #include "TEveWindow.h" #include "TEveWindowEditor.h" #include "TEveWindowManager.h" #include "TEveSecondarySelectable.h" #include "TEveArrow.h" #include "TEveArrowEditor.h" #include "TEveArrowGL.h" #include "TEveBox.h" #include "TEveBoxGL.h" #include "TEveBoxSet.h" #include "TEveBoxSetGL.h" #include "TEveCalo.h" #include "TEveCalo2DGL.h" #include "TEveCalo3DGL.h" #include "TEveCaloData.h" #include "TEveCaloLegoEditor.h" #include "TEveCaloLegoGL.h" #include "TEveCaloLegoOverlay.h" #include "TEveCaloVizEditor.h" #include "TEveDigitSet.h" #include "TEveDigitSetEditor.h" #include "TEveDigitSetGL.h" #include "TEveFrameBox.h" #include "TEveFrameBoxGL.h" #include "TEveGeoNode.h" #include "TEveGeoNodeEditor.h" #include "TEveGeoPolyShape.h" #include "TEveGeoShape.h" #include "TEveGeoShapeExtract.h" #include "TEveGridStepper.h" #include "TEveGridStepperEditor.h" #include "TEveLegoEventHandler.h" #include "TEveShape.h" #include "TEveShapeEditor.h" #include "TEveLine.h" #include "TEveLineEditor.h" #include "TEveLineGL.h" #include "TEvePointSet.h" #include "TEvePointSetArrayEditor.h" #include "TEvePolygonSetProjected.h" #include "TEvePolygonSetProjectedGL.h" #include "TEveQuadSet.h" #include "TEveQuadSetGL.h" #include "TEveRGBAPalette.h" #include "TEveRGBAPaletteEditor.h" #include "TEveRGBAPaletteOverlay.h" #include "TEveScalableStraightLineSet.h" #include "TEveStraightLineSet.h" #include "TEveStraightLineSetEditor.h" #include "TEveStraightLineSetGL.h" #include "TEveText.h" #include "TEveTextEditor.h" #include "TEveTextGL.h" #include "TEveTrack.h" #include "TEveTrackEditor.h" #include "TEveTrackGL.h" #include "TEveTrackProjected.h" #include "TEveTrackProjectedGL.h" #include "TEveTrackPropagator.h" #include "TEveTrackPropagatorEditor.h" #include "TEveTriangleSet.h" #include "TEveTriangleSetEditor.h" #include "TEveTriangleSetGL.h" #include "TEveJetCone.h" #include "TEveJetConeEditor.h" #include "TEveJetConeGL.h" #include "TEvePlot3D.h" #include "TEvePlot3DGL.h" #undef _BACKWARD_BACKWARD_WARNING_H In file included from input_line_8:1: In file included from /home/vratik/workspace/expertroot_H5/macro/H5run/eventDisplay.C:2: In file included from /home/vratik/fair_install_root6/FairRootInst/include/FairMCTracks.h:27: /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:58:27: error: expected parameter declarator ClassDef(TEveMagField, 0); // Abstract interface to magnetic field ^ /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:58:27: error: expected ')' /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:58:12: note: to match this '(' ClassDef(TEveMagField, 0); // Abstract interface to magnetic field ^ /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:58:4: error: C++ requires a type specifier for all declarations ClassDef(TEveMagField, 0); // Abstract interface to magnetic field ^ /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:43:18: error: no matching constructor for initialization of 'TEveVector' (aka 'TEveVectorT') TEveVector b = GetField(x, y, z); ^ ~~~~~~~~~~~~~~~~~ /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:47:75: error: no member named 'fX' in 'TEveVectorT' TEveVectorD GetFieldD(const TEveVectorD &v) const { return GetFieldD(v.fX, v.fY, v.fZ); } ~ ^ /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:47:81: error: no member named 'fY' in 'TEveVectorT' TEveVectorD GetFieldD(const TEveVectorD &v) const { return GetFieldD(v.fX, v.fY, v.fZ); } ~ ^ /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:47:87: error: no member named 'fZ' in 'TEveVectorT' TEveVectorD GetFieldD(const TEveVectorD &v) const { return GetFieldD(v.fX, v.fY, v.fZ); } ~ ^ /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:52:85: error: no viable conversion from returned value of type 'TEveVectorT' to function return type 'TEveVectorT' virtual TEveVectorD GetFieldD(Double_t x, Double_t y, Double_t z) const { return GetField(x, y, z); } ^~~~~~~~~~~~~~~~~ /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveVector.h:39:4: note: candidate function operator const TT*() const { return &fX; } ^ /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveVector.h:40:4: note: candidate function operator TT*() { return &fX; } ^ In file included from input_line_8:1: In file included from /home/vratik/workspace/expertroot_H5/macro/H5run/eventDisplay.C:2: In file included from /home/vratik/fair_install_root6/FairRootInst/include/FairMCTracks.h:27: /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:55:74: error: no matching constructor for initialization of 'TEveVector' (aka 'TEveVectorT') virtual TEveVector GetField(Float_t, Float_t, Float_t) const { return TEveVector(); } ^ /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:81:32: error: expected parameter declarator ClassDef(TEveMagFieldConst, 0); // Interface to constant magnetic field. ^ /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:81:32: error: expected ')' /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:81:12: note: to match this '(' ClassDef(TEveMagFieldConst, 0); // Interface to constant magnetic field. ^ /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:81:4: error: C++ requires a type specifier for all declarations ClassDef(TEveMagFieldConst, 0); // Interface to constant magnetic field. ^ /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:73:23: error: no matching constructor for initialization of 'TEveVectorD' (aka 'TEveVectorT') TEveMagField(), fB(x, y, z) ^ ~~~~~~~ /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:78:97: error: no matching constructor for initialization of 'TEveVectorD' (aka 'TEveVectorT') virtual TEveVectorD GetFieldD(Double_t /*x*/, Double_t /*y*/, Double_t /*z*/) const { return fB; } ^~ /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:79:57: error: no member named 'Mag' in 'TEveVectorT' virtual Double_t GetMaxFieldMagD() const { return fB.Mag(); }; ~~ ^ /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:112:30: error: expected parameter declarator ClassDef(TEveMagFieldDuo, 0); // Interface to magnetic field with two different values dependi... ^ /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:112:30: error: expected ')' /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:112:12: note: to match this '(' ClassDef(TEveMagFieldDuo, 0); // Interface to magnetic field with two different values dependi... ^ /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:112:4: error: C++ requires a type specifier for all declarations ClassDef(TEveMagFieldDuo, 0); // Interface to magnetic field with two different values dependi... ^ /home/vratik/fair_install_root6/FairSoftInst/include/root/TEveTrackPropagator.h:99:7: error: no matching constructor for initialization of 'TEveVectorD' (aka 'TEveVectorT') fBIn(0,0,bIn), fBOut(0,0,bOut), fR2(r*r) ^ ~~~~~~~ fatal error: too many errors emitted, stopping now [-ferror-limit=] Warning in : Problems in compiling forward declarations for module G__EventDisplayDict: ' #line 1 "G__EventDisplayDict dictionary forward declarations' payload" #pragma clang diagnostic ignored "-Wkeyword-compat" #pragma clang diagnostic ignored "-Wignored-attributes" #pragma clang diagnostic ignored "-Wreturn-type-c-linkage" extern int __Cling_Autoloading_Map; class FairEventManager; class FairMCTracks; 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; 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; class __attribute__((annotate("$clingAutoload$FairBoxSetDraw.h"))) FairBoxSetDraw; class FairBoxSet; class FairBoxSetEditor; class FairPointSetDraw; class FairMCPointDraw; class FairHitDraw; class FairHitPointSetDraw; class FairTimeStampPointDraw; ' Error in : Error parsing payload code for class FairMCTracks with content: #line 1 "G__EventDisplayDict dictionary payload" #ifndef G__VECTOR_HAS_CLASS_ITERATOR #define G__VECTOR_HAS_CLASS_ITERATOR 1 #endif #define _BACKWARD_BACKWARD_WARNING_H /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ /** * class for event management and navigation. * 06.12.07 M.Al-Turany */ #ifndef FairEventManager_H #define FairEventManager_H #include "TEveEventManager.h" // for TEveEventManager #include "FairRunAna.h" // for FairRunAna #include "Rtypes.h" // for Float_t, Int_t, Bool_t, etc #include "TEveViewer.h" #include "TEveScene.h" #include "TEveProjectionAxes.h" #include "TEveProjectionManager.h" class FairRootManager; //does not work with streamer, reason unclear class FairTask; class TGListTreeItem; class FairEventManager : public TEveEventManager { public: static FairEventManager* Instance(); FairEventManager(); virtual ~FairEventManager(); virtual void Open(); virtual void GotoEvent(Int_t event); // *MENU* virtual void NextEvent(); // *MENU* virtual void PrevEvent(); // *MENU* virtual void Close(); virtual void DisplaySettings(); // *Menu* virtual Int_t Color(Int_t pdg); void AddTask(FairTask* t) {fRunAna->AddTask(t);} virtual void Init( Int_t visopt = 1, Int_t vislvl = 3, Int_t maxvisnds = 10000); virtual Int_t GetCurrentEvent() {return fEntry;} virtual void SetPriOnly(Bool_t Pri) {fPriOnly=Pri;} virtual Bool_t IsPriOnly() {return fPriOnly;} virtual void SelectPDG(Int_t PDG) {fCurrentPDG= PDG;} virtual Int_t GetCurrentPDG() {return fCurrentPDG;} virtual void SetMaxEnergy( Float_t max) {fMaxEnergy = max;} virtual void SetMinEnergy( Float_t min) {fMinEnergy = min;} virtual void SetEvtMaxEnergy( Float_t max) {fEvtMaxEnergy = max;} virtual void SetEvtMinEnergy( Float_t min) {fEvtMinEnergy = min;} virtual Float_t GetEvtMaxEnergy() {return fEvtMaxEnergy ;} virtual Float_t GetEvtMinEnergy() {return fEvtMinEnergy ;} virtual Float_t GetMaxEnergy() {return fMaxEnergy;} virtual Float_t GetMinEnergy() {return fMinEnergy;} virtual void SetRPhiPlane(Double_t a, Double_t b, Double_t c, Double_t d); virtual void SetRhoZPlane(Double_t a, Double_t b, Double_t c, Double_t d); void UpdateEditor(); virtual void AddParticlesToPdgDataBase(Int_t pdg=0); ClassDef(FairEventManager,1); protected: TEveViewer* GetRPhiView() const {return fRPhiView;}; TEveViewer *GetRhoZView() const {return fRhoZView;}; TEveViewer *GetMultiView() const {return fMultiView;}; TEveViewer *GetMultiRPhiView() const { return fMultiRPhiView;}; TEveViewer *GetMultiRhoZView() const {return fMultiRhoZView;}; TEveScene* GetRhoZScene() const {return fRhoZScene;}; TEveScene* GetRPhiScene() const {return fRPhiScene;}; TEveProjectionManager* GetRhoZProjManager() const {return fRhoZProjManager;}; TEveProjectionManager* GetRPhiProjManager() const {return fRPhiProjManager;}; TEveProjectionAxes *GetRPhiAxes() const { return fAxesPhi;}; TEveProjectionAxes *GetRhoZAxes() const {return fAxesRho;}; private: FairRootManager* fRootManager; //! Int_t fEntry; //! FairRunAna* fRunAna; //! TGListTreeItem* fEvent; //! Bool_t fPriOnly; //! Int_t fCurrentPDG; //! Float_t fMinEnergy; //! Float_t fMaxEnergy; //! Float_t fEvtMinEnergy; //! Float_t fEvtMaxEnergy; //! Double_t fRPhiPlane[4]; //! Double_t fRhoZPlane[4]; //! TEveViewer *fRPhiView; //! TEveViewer *fRhoZView; //! TEveViewer *fMultiView; //! TEveViewer *fMultiRPhiView; //! TEveViewer *fMultiRhoZView; //! TEveScene *fRPhiScene; //! TEveScene *fRhoZScene;//! TEveProjectionManager *fRPhiProjManager; //! TEveProjectionManager *fRhoZProjManager; //! TEveProjectionAxes *fAxesPhi; TEveProjectionAxes *fAxesRho; static FairEventManager* fgRinstance; //! FairEventManager(const FairEventManager&); FairEventManager& operator=(const FairEventManager&); void SetViewers(TEveViewer *RPhi, TEveViewer *RhoZ); }; #endif /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ // ------------------------------------------------------------------------- // ----- FairMCTracks header file ----- // ----- Created 10/12/07 by M. Al-Turany ----- // ------------------------------------------------------------------------- /** FairMCTracks * @author M. Al-Turany * @since 10.12.07 * MVD event display object ** **/ #ifndef FAIRMCTRACKS_H #define FAIRMCTRACKS_H #include "FairTask.h" // for FairTask, InitStatus #include "Rtypes.h" // for Double_t, etc #include "TEveTrackPropagator.h" // IWYU pragma: keep needed by cint #include "TString.h" // for TString class FairEventManager; class TClonesArray; class TEveTrackList; class TObjArray; class TParticle; class FairMCTracks : public FairTask { public: /** Default constructor **/ FairMCTracks(); /** Standard constructor *@param name Name of task *@param iVerbose Verbosity level **/ FairMCTracks(const char* name, Int_t iVerbose = 1); /** Destructor **/ virtual ~FairMCTracks(); /** Set verbosity level. For this task and all of the subtasks. **/ void SetVerbose(Int_t iVerbose) {fVerbose = iVerbose;} /** Executed task **/ virtual void Exec(Option_t* option); virtual InitStatus Init(); virtual void SetParContainers(); /** Action after each event**/ virtual void Finish(); void Reset(); TEveTrackList* GetTrGroup(TParticle* P); protected: TClonesArray* fTrackList; //! TEveTrackPropagator* fTrPr; FairEventManager* fEventManager; //! TObjArray* fEveTrList; TString fEvent; //! TEveTrackList* fTrList; //! //TEveElementList *fTrackCont; Double_t MinEnergyLimit; Double_t MaxEnergyLimit; Double_t PEnergy; private: FairMCTracks(const FairMCTracks&); FairMCTracks& operator=(const FairMCTracks&); ClassDef(FairMCTracks,1); }; #endif /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ // ------------------------------------------------------------------------- // ----- FairEventManagerEditor ----- // ----- Created 16/12/07 by M. Al-Turany ----- // ------------------------------------------------------------------------- #ifndef ROOT_FAIREVENTMANAGEREDITOR #define ROOT_FAIREVENTMANAGEREDITOR #include "TGedFrame.h" // for TGedFrame #include "GuiTypes.h" // for Pixel_t #include "Rtypes.h" // for ClassDef #include "TGFrame.h" // for EFrameType::kChildFrame class FairEventManager; class TEveGValuator; class TGCheckButton; class TGLabel; class TGNumberEntry; class TGWindow; class TObject; class FairEventManagerEditor : public TGedFrame { FairEventManagerEditor(const FairEventManagerEditor&); // Not implemented FairEventManagerEditor& operator=(const FairEventManagerEditor&); // Not implemented protected: TObject* fObject; FairEventManager* fManager; TGNumberEntry* fCurrentEvent, *fCurrentPDG; TGCheckButton* fVizPri; TEveGValuator* fMinEnergy ,*fMaxEnergy; TGLabel* fEventTime; public: FairEventManagerEditor(const TGWindow* p=0, Int_t width=170, Int_t height=30, UInt_t options = kChildFrame, Pixel_t back=GetDefaultFrameBackground()); virtual ~FairEventManagerEditor() {} void SetModel( TObject* obj); virtual void SelectEvent(); virtual void SelectPDG(); void DoVizPri(); virtual void MaxEnergy(); virtual void MinEnergy(); virtual void Init(); ClassDef(FairEventManagerEditor, 0); // Specialization of TGedEditor for proper update propagation to TEveManager. }; #endif /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ #ifndef ROOT_FAIREMCTRACKSEDITOR #define ROOT_FAIREMCTRACKSEDITOR #include "TGedFrame.h" // for TGedFrame #include "GuiTypes.h" // for Pixel_t #include "Rtypes.h" // for FairMCTracksEditor::Class, etc #include "TGFrame.h" // for EFrameType::kChildFrame class FairEventManager; class TGWindow; class TObject; class FairMCTracksEditor : public TGedFrame { FairMCTracksEditor(const FairMCTracksEditor&); // Not implemented FairMCTracksEditor& operator=(const FairMCTracksEditor&); // Not implemented protected: TObject* fObject; FairEventManager* fManager; public: FairMCTracksEditor(const TGWindow* p=0, Int_t width=170, Int_t height=30, UInt_t options = kChildFrame, Pixel_t back=GetDefaultFrameBackground()); virtual ~FairMCTracksEditor() {} virtual void SetModel( TObject* obj); ClassDef(FairMCTracksEditor, 0); // Specialization of TGedEditor for proper update propagation to TEveManager. }; #endif /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ // ------------------------------------------------------------------------- // ----- FairBoxSet header file ----- // ----- Created 26/03/09 by T. Stockmanns ----- // ------------------------------------------------------------------------- /** FairBoxSet * @author T. Stockmanns * @since 26.3.2009 * Base class to display 3D Points in Eve as a BoxSet * One has to overwrite the method GetVector which takes a TObject and writes out a TVector3 which is then taken as an input * to place the points. * If one wants to change the color of the points one has to overwrite the method GetValue. This method takes a TObject and * an integer and translates this into an integer as input for the EveBoxSet method DigitValue ** **/ #ifndef FAIRBOXSET_H #define FAIRBOXSET_H #include "TEveBoxSet.h" // for TEveBoxSet #include "FairBoxSetDraw.h" // for FairBoxSetDraw #include "Rtypes.h" // for Double_t, FairBoxSet::Class, etc class FairBoxSet : public TEveBoxSet { public: /** Standard constructor **/ FairBoxSet(FairBoxSetDraw* drawer, const char* name = "FairBoxSet", const char* t = ""); void SetTimeWindowPlus(Double_t time) {fDraw->SetTimeWindowPlus(time);} void SetTimeWindowMinus(Double_t time) {fDraw->SetTimeWindowMinus(time);} Double_t GetTimeWindowPlus() {return fDraw->GetTimeWindowPlus();} Double_t GetTimeWindowMinus() {return fDraw->GetTimeWindowMinus();} /** Destructor **/ virtual ~FairBoxSet() {}; protected: private: FairBoxSetDraw* fDraw; FairBoxSet(const FairBoxSet&); FairBoxSet operator=(const FairBoxSet&); ClassDef(FairBoxSet,1); }; #endif /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ // ------------------------------------------------------------------------- // ----- FairBoxSetDraw header file ----- // ----- Created 26/03/09 by T. Stockmanns ----- // ------------------------------------------------------------------------- /** FairBoxSetDraw * @author T. Stockmanns * @since 26.3.2009 * Base class to display 3D Points in Eve as a BoxSet * One has to overwrite the method GetVector which takes a TObject and writes out a TVector3 which is then taken as an input * to place the points. * If one wants to change the color of the points one has to overwrite the method GetValue. This method takes a TObject and * an integer and translates this into an integer as input for the EveBoxSet method DigitValue ** **/ #ifndef FAIRBOXSETDRAW_H #define FAIRBOXSETDRAW_H #include "FairTask.h" // for FairTask, InitStatus #include "FairTSBufferFunctional.h" // IWYU pragma: keep needed for cint #include "Rtypes.h" // for Double_t, Int_t, Bool_t, etc class FairBoxSet; class TObject; class TVector3; class TClonesArray; class FairEventManager; class FairRootManager; class FairBoxSetDraw : public FairTask { public: /** Default constructor **/ FairBoxSetDraw(); /** Standard constructor *@param name Name of task *@param iVerbose Verbosity level **/ FairBoxSetDraw(const char* name, Int_t iVerbose = 1); /** Destructor **/ virtual ~FairBoxSetDraw(); virtual Double_t GetTimeWindowPlus() {return fTimeWindowPlus;} virtual Double_t GetTimeWindowMinus() {return fTimeWindowMinus;} /** Set verbosity level. For this task and all of the subtasks. **/ virtual void SetVerbose(Int_t iVerbose) {fVerbose = iVerbose;}; virtual void SetBoxDimensions(Double_t x, Double_t y, Double_t z) { fX = x; fY = y; fZ = z; } virtual void SetTimeWindowMinus(Double_t val); virtual void SetTimeWindowPlus(Double_t val); virtual void SetStartTime(Double_t val) {fStartTime = val;} virtual void UseEventTimeAsStartTime(Bool_t val = kTRUE) {fUseEventTime = val;} /** Executed task **/ virtual void Exec(Option_t* option); FairBoxSet* CreateBoxSet(); void Reset(); protected: Int_t fVerbose; // Verbosity level virtual void SetParContainers() ; virtual InitStatus Init(); /** Action after each event**/ virtual void Finish(); virtual TVector3 GetVector(TObject* obj) = 0; virtual Int_t GetValue(TObject* obj,Int_t i); virtual void AddBoxes(FairBoxSet* set, TObject* obj, Int_t i = 0); TClonesArray* fList; //! FairEventManager* fEventManager; //! FairRootManager* fManager; FairBoxSet* fq; //! Double_t fX, fY, fZ; Double_t fTimeWindowPlus; Double_t fTimeWindowMinus; Double_t fStartTime; Bool_t fUseEventTime; private: FairBoxSetDraw(const FairBoxSetDraw&); FairBoxSetDraw& operator=(const FairBoxSetDraw&); BinaryFunctor* fStartFunctor; BinaryFunctor* fStopFunctor; ClassDef(FairBoxSetDraw,1); }; #endif /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ // ------------------------------------------------------------------------- // ----- FairBoxSetEditor header file ----- // ----- Created 26/03/09 by T. Stockmanns ----- // ------------------------------------------------------------------------- /** FairBoxSetEditor * @author T. Stockmanns * @since 26.3.2009 * Base class to display 3D Points in Eve as a BoxSet * One has to overwrite the method GetVector which takes a TObject and writes out a TVector3 which is then taken as an input * to place the points. * If one wants to change the color of the points one has to overwrite the method GetValue. This method takes a TObject and * an integer and translates this into an integer as input for the EveBoxSet method DigitValue ** **/ #ifndef FairBoxSetEditor_H #define FairBoxSetEditor_H #include "TGedFrame.h" // for TGedFrame #include "FairBoxSet.h" // for FairBoxSet #include "GuiTypes.h" // for Pixel_t #include "Rtypes.h" // for FairBoxSetEditor::Class, etc #include "TGFrame.h" // for EFrameType::kChildFrame, etc #include "TGNumberEntry.h" // for TGNumberEntry #include "TObject.h" // for TObject class TGWindow; class FairBoxSetEditor : public TGedFrame { public: FairBoxSetEditor(const TGWindow* p=0, Int_t width=170, Int_t height=30, UInt_t options = kChildFrame, Pixel_t back=GetDefaultFrameBackground()); virtual ~FairBoxSetEditor() {}; virtual void Init(); virtual void SetModel(TObject* obj) { fM = dynamic_cast(obj); if (fM) { fTimeWindowPlus->SetNumber(fM->GetTimeWindowPlus()); fTimeWindowMinus->SetNumber(fM->GetTimeWindowMinus()); } } virtual void TimeWindow(); TGVerticalFrame* fInfoFrame; TGNumberEntry* fTimeWindowPlus; TGNumberEntry* fTimeWindowMinus; protected: TObject* fObject; FairBoxSet* fM; private: FairBoxSetEditor(const FairBoxSetEditor&); FairBoxSetEditor& operator=(const FairBoxSetEditor&); ClassDef(FairBoxSetEditor,2); }; #endif /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ // ------------------------------------------------------------------------- // ----- FairPointSetDraw header file ----- // ----- Created 10/12/07 by M. Al-Turany ----- // ------------------------------------------------------------------------- /** FairPointSetDraw * @author M. Al-Turany * @since 03.01.08 * Task to display MC points ** **/ #ifndef FAIRPOINTSETDRAW_H #define FAIRPOINTSETDRAW_H #include "FairTask.h" // for FairTask, InitStatus #include "Rtypes.h" // for Int_t, Color_t, etc class FairEventManager; class TClonesArray; class TEvePointSet; class TObject; class TVector3; class FairPointSetDraw : public FairTask { public: /** Default constructor **/ FairPointSetDraw(); /** Standard constructor *@param name Name of task *@param iVerbose Verbosity level **/ FairPointSetDraw(const char* name, Color_t color ,Style_t mstyle, Int_t iVerbose = 1); /** Destructor **/ virtual ~FairPointSetDraw(); /** Set verbosity level. For this task and all of the subtasks. **/ void SetVerbose(Int_t iVerbose) {fVerbose = iVerbose;}; /** Executed task **/ virtual void Exec(Option_t* option); void Reset(); protected: virtual TVector3 GetVector(TObject* obj) = 0; virtual TObject* GetValue(TObject* obj,Int_t i); Int_t fVerbose; // Verbosity level virtual void SetParContainers() ; virtual InitStatus Init(); /** Action after each event**/ virtual void Finish() ; TClonesArray* fPointList; //! FairEventManager* fEventManager; //! TEvePointSet* fq; //! Color_t fColor; //! Style_t fStyle; //! private: FairPointSetDraw(const FairPointSetDraw&); FairPointSetDraw& operator=(const FairPointSetDraw&); ClassDef(FairPointSetDraw,1); }; #endif /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ /* * FairMCPointsDraw.h * * Created on: Apr 17, 2009 * Author: stockman */ #ifndef FAIRMCPOINTDRAW_H_ #define FAIRMCPOINTDRAW_H_ #include "FairPointSetDraw.h" // for FairPointSetDraw #include "Rtypes.h" // for FairMCPointDraw::Class, etc class TObject; class TVector3; class FairMCPointDraw: public FairPointSetDraw { public: FairMCPointDraw(); FairMCPointDraw(const char* name, Color_t color ,Style_t mstyle, Int_t iVerbose = 1):FairPointSetDraw(name, color, mstyle, iVerbose) {}; virtual ~FairMCPointDraw(); protected: TVector3 GetVector(TObject* obj); ClassDef(FairMCPointDraw,1); }; #endif /* FAIRMCPOINTDRAW_H_ */ /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ /* * FairHitDraw.h * * Created on: Apr 16, 2009 * Author: stockman * * Simple method to draw points derived from FairHit */ #ifndef FAIRHITDRAW_H_ #define FAIRHITDRAW_H_ #include "FairBoxSetDraw.h" // for FairBoxSetDraw #include "Rtypes.h" // for FairHitDraw::Class, etc #include "TVector3.h" // for TVector3 class TObject; class FairHitDraw: public FairBoxSetDraw { public: FairHitDraw(); /** Standard constructor *@param name Name of task *@param iVerbose Verbosity level **/ FairHitDraw(const char* name, Int_t iVerbose = 1); protected: TVector3 GetVector(TObject* obj); ClassDef(FairHitDraw,1); }; #endif /* FAIRHITDRAW_H_ */ /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ /* * FairMCPointsDraw.h * * Created on: Sep. 30, 2009 * Author: stockman */ #ifndef FAIRHITPOINTSETDRAW_H_ #define FAIRHITPOINTSETDRAW_H_ #include "FairPointSetDraw.h" // for FairPointSetDraw #include "Rtypes.h" // for FairHitPointSetDraw::Class, etc class TObject; class TVector3; class FairHitPointSetDraw: public FairPointSetDraw { public: FairHitPointSetDraw(); FairHitPointSetDraw(const char* name, Color_t color ,Style_t mstyle, Int_t iVerbose = 1):FairPointSetDraw(name, color, mstyle, iVerbose) {}; virtual ~FairHitPointSetDraw(); protected: TVector3 GetVector(TObject* obj); ClassDef(FairHitPointSetDraw,1); }; #endif /* FAIRHITPOINTSETDRAW_H_ */ /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ /* * FairTimeStampPointDraw.h * * Created on: Feb 28, 2011 * Author: stockman */ #ifndef FAIRTIMESTAMPPOINTDRAW_H_ #define FAIRTIMESTAMPPOINTDRAW_H_ #include "FairBoxSetDraw.h" // for FairBoxSetDraw #include "Rtypes.h" // for Int_t, etc #include "TVector3.h" // for TVector3 class TObject; class FairTimeStampPointDraw : public FairBoxSetDraw { public: FairTimeStampPointDraw(); FairTimeStampPointDraw(const char* name, Int_t iVerbose = 1); virtual ~FairTimeStampPointDraw(); private: virtual TVector3 GetVector(TObject* obj); virtual Int_t GetValue(TObject* obj,Int_t i); ClassDef(FairTimeStampPointDraw, 1); }; #endif /* FAIRTIMESTAMPPOINTDRAW_H_ */ #undef _BACKWARD_BACKWARD_WARNING_H In file included from input_line_8:1: In file included from /home/vratik/workspace/expertroot_H5/macro/H5run/eventDisplay.C:2: /home/vratik/fair_install_root6/FairRootInst/include/FairMCTracks.h:85:27: error: expected parameter declarator ClassDef(FairMCTracks,1); ^ /home/vratik/fair_install_root6/FairRootInst/include/FairMCTracks.h:85:27: error: expected ')' /home/vratik/fair_install_root6/FairRootInst/include/FairMCTracks.h:85:13: note: to match this '(' ClassDef(FairMCTracks,1); ^ /home/vratik/fair_install_root6/FairRootInst/include/FairMCTracks.h:85:5: error: C++ requires a type specifier for all declarations ClassDef(FairMCTracks,1); ^ Error in : Error parsing payload code for class FairParRootFileIo with content: #line 1 "G__ParBaseDict dictionary payload" #ifndef G__VECTOR_HAS_CLASS_ITERATOR #define G__VECTOR_HAS_CLASS_ITERATOR 1 #endif #define _BACKWARD_BACKWARD_WARNING_H /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ #ifndef FAIRCONTFACT_H #define FAIRCONTFACT_H #include "TNamed.h" // for TNamed #include "Rtypes.h" // for Bool_t, ClassDef, etc #include "TList.h" // for TList #include "TString.h" // for TString class FairLogger; class FairParIo; class FairParSet; class FairContainer : public TNamed { private: FairContainer(); FairContainer(const FairContainer&); FairContainer& operator=(const FairContainer&); protected: /** available contexts for this parameter container*/ TList* contexts; /** actual context set by the user */ TString actualContext; /** Fair Logger */ FairLogger* fLogger;//! public: FairContainer( const char*, const char*, const char*); ~FairContainer(); void addContext(const char*); Bool_t setActualContext(const char* c); const char* getDefaultContext(); const char* getActualContext() { return actualContext.Data(); } void print(); TString getConcatName(); const char* getContext(); ClassDef(FairContainer,0) // class for list elements in class FairContFact }; class FairContFact : public TNamed { public: FairContFact(); virtual ~FairContFact(); Bool_t addContext(const char* name); void print(); FairParSet* getContainer(const char*); virtual FairParSet* createContainer(FairContainer*) {return 0;} virtual void activateParIo(FairParIo*) {} protected: TList* containers; // all parameter containers managed by this factory const char* getActualContext(const char* name) { return (static_cast(containers->FindObject(name)))->getActualContext(); } /** Fair Logger */ FairLogger* fLogger;//! ClassDef(FairContFact,0) // base class of all factories for parameter containers private: FairContFact(const FairContFact&); FairContFact& operator=(const FairContFact&); }; #endif /* !FAIRCONTFACT_H */ /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ #ifndef FAIRDETPARASCIIFILEIO_H #define FAIRDETPARASCIIFILEIO_H #include "FairDetParIo.h" // for FairDetParIo #include "Riosfwd.h" // for fstream #include "Rtypes.h" // for Text_t, Bool_t, etc #include "TString.h" // for TString #include // for fstream class FairParSet; class FairDetParAsciiFileIo : public FairDetParIo { protected: TString fHeader; //! header of container output in file TString sepLine; //! comment line std::fstream* pFile; //! pointer to ascii file // virtual Bool_t write(HDetector*) {return kTRUE;} Bool_t findContainer(const Text_t* name); Bool_t checkAllFound(Int_t*,Int_t); void writeHeader(const Text_t*, const Text_t* context="", const Text_t* author="", const Text_t* description=""); void writeComment(FairParSet*); void readComment(const Char_t*, FairParSet*); // Bool_t readLabPositions(const Text_t*,HDetGeomPar*,Int_t*,Int_t,Int_t); // Bool_t readVolumes(const Text_t*,HDetGeomPar*); // void readTransform(HGeomTransform&); // Bool_t readVolume(HGeomVolume*,HGeomShapes*,Text_t*); // void writeTransform(const HGeomTransform&); // void writeVolume(HGeomVolume*,HGeomShapes*); public: FairDetParAsciiFileIo(std::fstream* f); virtual ~FairDetParAsciiFileIo() {} // Bool_t read(HDetGeomPar*,Int_t*); // Int_t writeFile(HDetGeomPar*); private: FairDetParAsciiFileIo& operator=(const FairDetParAsciiFileIo&); FairDetParAsciiFileIo(const FairDetParAsciiFileIo&); ClassDef(FairDetParAsciiFileIo,0) // Class for detector parameter I/O from ascii file }; #endif /* !FAIRDETPARASCIIFILEIO_H */ /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ #ifndef FAIRDETPARIO_H #define FAIRDETPARIO_H #include "TNamed.h" // for TNamed #include "Rtypes.h" // for Int_t, FairDetParIo::Class, etc class FairParSet; class FairDetParIo : public TNamed { protected: Int_t inputNumber; // input number (first or second input in runtime database) public: FairDetParIo(); virtual ~FairDetParIo() {;} // sets the input number void setInputNumber(Int_t n) {inputNumber=n;} // returns the input number Int_t getInputNumber() {return inputNumber;} // initializes parameter container virtual Bool_t init(FairParSet*) {return kFALSE;} // writes parameter container to output virtual Int_t write(FairParSet*) {return kFALSE;} ClassDef(FairDetParIo,0) // Base class for detector parameter IO }; #endif /* !HDETPARIO_H */ /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ #ifndef FAIRDETPARROOTFILEIO_H #define FAIRDETPARROOTFILEIO_H #include "FairDetParIo.h" // for FairDetParIo #include "Rtypes.h" // for Int_t, Text_t, etc using std::fstream; class FairParRootFile; class FairParSet; class TObject; class FairDetParRootFileIo : public FairDetParIo { protected: FairParRootFile* pFile; // pointer to parameter ROOT file public: FairDetParRootFileIo(FairParRootFile* f); virtual ~FairDetParRootFileIo() {} virtual Bool_t read(FairParSet*); Int_t write(FairParSet*); // Bool_t read(HDetGeomPar*,Int_t*); protected: Int_t findInputVersion(Text_t* contName); Int_t getMaxVersion(Text_t* contName); TObject* findContainer(Text_t* contName, Int_t version); private: FairDetParRootFileIo(const FairDetParRootFileIo&); FairDetParRootFileIo& operator= (const FairDetParRootFileIo&); ClassDef(FairDetParRootFileIo,0) // detector base class for parameter I/O from ROOT file }; #endif /* !FAIRDETPARROOTFILEIO_H */ /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ #ifndef FAIRGENERICPARASCIIFILEIO_H #define FAIRGENERICPARASCIIFILEIO_H #include "FairDetParAsciiFileIo.h" // for FairDetParAsciiFileIo #include "Riosfwd.h" // for fstream #include "Rtypes.h" // for Int_t, Bool_t, etc #include // for fstream class FairParGenericSet; class FairParSet; class TString; class FairGenericParAsciiFileIo : public FairDetParAsciiFileIo { public: FairGenericParAsciiFileIo(std::fstream* f=0); ~FairGenericParAsciiFileIo() {} Bool_t init(FairParSet*); Int_t write(FairParSet*); private: ClassDef(FairGenericParAsciiFileIo,0) // I/O from Ascii file for parameter containers derived from FairParGenericSet Bool_t readGenericSet(FairParGenericSet* pPar); Int_t writeGenericSet(FairParGenericSet* pPar); template const UChar_t* readData(type,const Char_t*,TString&,Int_t&); template void writeData(type*,Int_t); }; #endif /* !FAIRGENERICPARASCIIFILEIO_H */ /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ #ifndef FAIRGENERICPARROOTFILEIO_H #define FAIRGENERICPARROOTFILEIO_H #include "FairDetParRootFileIo.h" // for FairDetParRootFileIo #include "Rtypes.h" // for ClassDef macro class FairParRootFile; class FairParSet; class FairGenericParRootFileIo : public FairDetParRootFileIo { public: FairGenericParRootFileIo(FairParRootFile* f=0); ~FairGenericParRootFileIo() {} Bool_t init(FairParSet*); ClassDef(FairGenericParRootFileIo,0) // I/O from ROOT file for parameter containers derived from FairParGenericSet }; #endif /* !FAIRGENERICPARROOTFILEIO_H */ /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ #ifndef FAIRPARASCIFILEIIO_H #define FAIRPARASCIFILEIIO_H #include "FairParIo.h" // for FairParIo #include "Riosfwd.h" // for fstream #include "Rtypes.h" // for Bool_t, Text_t, etc #include // for fstream, etc class TList; class FairParAsciiFileIo : public FairParIo { protected: std::fstream* file; // pointer to a file public: FairParAsciiFileIo(); // default destructor closes an open file and deletes list of I/Os ~FairParAsciiFileIo(); // opens file // if a file is already open, this file will be closed // activates detector I/Os Bool_t open(const Text_t* fname, const Text_t* status="in"); // concatenate files whose names are stored in the TList // TList holds list od TObjStrings // create file all.par in local working directory // calls open to open the generated file all.par Bool_t open(const TList* fnamelist, const Text_t* status="in"); // closes file void close(); // returns kTRUE if file is open Bool_t check() { if (file) { return (file->rdbuf()->is_open()==1); } else { return kFALSE; } } // prints information about the file and the detector I/Os void print(); std::fstream* getFile(); private: FairParAsciiFileIo(const FairParAsciiFileIo&); FairParAsciiFileIo& operator=(const FairParAsciiFileIo&); ClassDef(FairParAsciiFileIo,0) // Parameter I/O from ASCII files }; #endif /* !FAIRPARASCIIFILEIO_H */ /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ #ifndef FAIRPARGENERICSET_H #define FAIRPARGENERICSET_H #include "FairParSet.h" // for FairParSet #include "Rtypes.h" // for Bool_t, etc class FairParIo; class FairParamList; class FairParGenericSet : public FairParSet { public: FairParGenericSet(const char* name,const char* title,const char* context, Bool_t ownership=kFALSE) : FairParSet(name,title,context,ownership) {} virtual ~FairParGenericSet() {} virtual void putParams(FairParamList*)=0; virtual Bool_t getParams(FairParamList*)=0; virtual void printParams(); Bool_t init(FairParIo* inp); Int_t write(FairParIo* output); // DB add on void fill(UInt_t) {}; void store(UInt_t) {}; protected: FairParGenericSet() : FairParSet() {} ClassDef(FairParGenericSet,1) // Base class for generic-style parameter containers }; #endif /* !FAIRPARGENERICSET_H */ /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ #ifndef FAIRPARIO_H #define FAIRPARIO_H #include "TObject.h" // for TObject #include "Rtypes.h" // for Bool_t, Text_t, etc #include "TString.h" // for TString class FairDetParIo; class FairRtdbRun; class TList; class FairParIo : public TObject { protected: TList* detParIoList; // list of detector I/Os Bool_t autoWritable; // flag indicating if automatic write is possible TString filename; public: FairParIo(); virtual ~FairParIo(); virtual FairDetParIo* getDetParIo(const Text_t*); virtual void setDetParIo(FairDetParIo*); virtual void removeDetParIo(Text_t*); void setInputNumber(Int_t); virtual void close() {;} // returns the filename const char* getFilename() {return filename.Data();} // creates input/output class for a special detector and stores pointer // used only for Oracle input/output // (code in class OraIo) virtual void setDetParIo(Text_t*) {;} // prints information about input/output virtual void print() {;} // checks if the input/output is open virtual Bool_t check() { return kFALSE; } // reads versions of parameter containers for an event file virtual void readVersions(FairRtdbRun*) {;} // sets global file pointer in ROOT if input/output is a ROOT-file // (code in FairParRootFileIo) virtual void cd() {;} // set and get for flag autoWritable void setAutoWritable(Bool_t f=kTRUE) {autoWritable=f;} Bool_t isAutoWritable() {return autoWritable;} private: FairParIo(const FairParIo&); FairParIo& operator=(const FairParIo&); ClassDef(FairParIo,0) // Base class for all parameter I/Os }; #endif /* !FAIRPARIO_H */ /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ #ifndef FAIRPARROOTFILEIO_H #define FAIRPARROOTFILEIO_H #include "FairParIo.h" // for FairParIo #include "Rtypes.h" // for Bool_t, Text_t, Int_t, etc #include "TFile.h" // for TFile #include "TNamed.h" // for TNamed #include using std::fstream; class FairRtdbRun; class TKey; class TList; class FairParRootFile : public TNamed { public: FairRtdbRun* run; //! pointer to current run in ROOT file FairParRootFile(const Text_t* fname, Option_t* option="READ", const Text_t* ftitle="",Int_t compress=1); FairParRootFile(TFile* f); ~FairParRootFile(); FairRtdbRun* getRun() {return run;} void readVersions(FairRtdbRun*); Bool_t IsOpen() {return RootFile->IsOpen();} void cd() {RootFile->cd();} Bool_t IsWritable() {return RootFile->IsWritable();} TKey* GetKey(Text_t* t) { return RootFile->GetKey(t);} TList* GetListOfKeys() { return RootFile->GetListOfKeys();} void Close() {RootFile->Close();} protected: TFile* RootFile; private: FairParRootFile(const FairParRootFile&); FairParRootFile& operator=(const FairParRootFile&); ClassDef(FairParRootFile,0) // ROOT file for Parameter I/O }; class FairParRootFileIo : public FairParIo { protected: FairParRootFile* file; // pointer to ROOT file Bool_t fMerging; public: FairParRootFileIo(); FairParRootFileIo(Bool_t merged); ~FairParRootFileIo(); Bool_t open(const Text_t* fname, Option_t* option="READ", const Text_t* ftitle="",Int_t compress=1); Bool_t open(const TList* fnamelist, Option_t* option="READ", const Text_t* ftitle="",Int_t compress=1); void close(); void print(); FairParRootFile* getParRootFile(); void readVersions(FairRtdbRun*); TList* getKeys(); Bool_t check() { // returns kTRUE if file is open if (file) { return file->IsOpen(); } else { return kFALSE; } } void cd() { // sets the global ROOT file pointer gFile if (file) { file->cd(); } } /** Open an existing root file for IO */ Bool_t open(TFile* f); void setMerging( Bool_t io ) { fMerging=io;} private: FairParRootFileIo(const FairParRootFileIo&); FairParRootFileIo& operator=(const FairParRootFileIo&); ClassDef(FairParRootFileIo,0) // Parameter I/O from ROOT files }; #endif /* !FAIRPARROOTFILEIO_H */ /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ #ifndef FAIRPARSET_H #define FAIRPARSET_H #include "TNamed.h" #include "Rtypes.h" // for Int_t, Bool_t, etc #include "TString.h" // for TString class FairLogger; class FairParIo; class FairParSet : public TObject { protected: TString fName; // TString fTitle; // TString detName; //! name of the detector the container belongs to Int_t versions[3]; //! versions of container in the 2 possible inputs Bool_t status; //! static flag Bool_t changed; //! flag is kTRUE if parameters have changed Bool_t owned; //! if flag is KTRUE FairDB has the par. class ownership TString paramContext; // Context/purpose for parameters and conditions TString author; // Author of parameters TString description ; // Description of parameters /** Fair Logger */ FairLogger* fLogger; //! public: FairParSet(const char* name="",const char* title="",const char* context="", Bool_t owner=kFALSE); virtual ~FairParSet() {} virtual const char* GetName() const {return static_cast(fName.Data());} virtual const char* GetTitle() const {return static_cast(fTitle.Data());} virtual Bool_t init(); virtual Bool_t init(FairParIo*) { return kFALSE; } virtual Int_t write(); virtual Int_t write(FairParIo*) { return kFALSE; } virtual void clear() {} virtual void print(); const char* getDetectorName() {return detName.Data();} void resetInputVersions(); void setInputVersion(Int_t v=-1,Int_t i=0) { if (i>=0 && i<3) { versions[i]=v; } } Int_t getInputVersion(Int_t i) { if (i>=0 && i<3) { return versions[i]; } else { return 0; } } void setStatic(Bool_t flag=kTRUE) {status=flag;} Bool_t isStatic() {return status;} void setOwnership(Bool_t flag=kTRUE) {owned=flag;} Bool_t isOwned() {return owned;} void setChanged(Bool_t flag=kTRUE) {changed=flag;} Bool_t hasChanged() {return changed;} const char* getParamContext() const { return paramContext.Data(); } void setAuthor(const char* s) {author=s;} const char* getAuthor() const { return author.Data(); } void setDescription(const char* s) {description=s;} const char* getDescription() const { return description.Data(); } void copyComment(FairParSet& r) { author=r.getAuthor(); description=r.getDescription(); } virtual void fill(UInt_t) {}; virtual void store(UInt_t) {}; FairParSet& operator=(const FairParSet&); FairParSet(const FairParSet&); ClassDef(FairParSet,2) // Base class for all parameter containers }; #endif /* !FAIRPARSET_H */ /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ #ifndef FAIRPARAMLIST_H #define FAIRPARAMLIST_H #include "TNamed.h" // for TNamed #include "Rtypes.h" // for Text_t, Int_t, Bool_t, etc #include "TArrayC.h" // for TArrayC #include "TFile.h" // for TFile #include "TList.h" // for TList #include "TObject.h" // for TObject #include "TROOT.h" // for TROOT, gROOT #include "TSeqCollection.h" // for TSeqCollection #include "TString.h" // for TString class FairLogger; class TArrayD; class TArrayF; class TArrayI; class FairParamObj : public TNamed { protected: UChar_t* paramValue; // Pointer to binary array Int_t arraySize; // Size of binary array TString paramType; // Type of parameter value or class name Bool_t basicType; // kTRUE for C-types and C-type parameter arrays, kFALSE for classes Int_t bytesPerValue; // number of bytes per value Int_t classVersion; // Code version of classes stored as binary UChar_t* streamerInfo; // Pointer to binary array container the streamer info Int_t streamerInfoSize; // Size of streamer info array public: FairParamObj(const Text_t* name=""); FairParamObj(FairParamObj&); FairParamObj(const Text_t*,Int_t); FairParamObj(const Text_t*,Bool_t); FairParamObj(const Text_t*,UInt_t); FairParamObj(const Text_t*,Float_t); FairParamObj(const Text_t*,Double_t); FairParamObj(const Text_t*,const Int_t*,const Int_t); FairParamObj(const Text_t*,const UInt_t*,const Int_t); FairParamObj(const Text_t*,const Float_t*,const Int_t); FairParamObj(const Text_t*,const Double_t*,const Int_t); FairParamObj(const Text_t*,const Text_t*); FairParamObj(const Text_t*,const Char_t*,const Int_t); FairParamObj(const Text_t*,const UChar_t*,const Int_t); ~FairParamObj(); void setParamType(const Text_t* t); UChar_t* setLength(Int_t l); void setParamValue(UChar_t*,const Int_t); void setClassVersion(const Int_t v) { classVersion=v; } UChar_t* setStreamerInfoSize(Int_t); void setStreamerInfo(UChar_t*,const Int_t); UChar_t* getParamValue() { return paramValue; } Bool_t isBasicType() { return basicType; } const char* getParamType() { return paramType.Data(); } Int_t getBytesPerValue() { return bytesPerValue; } Int_t getClassVersion() { return classVersion; } Int_t getLength() { return arraySize; } Int_t getNumParams(); UChar_t* getStreamerInfo() { return streamerInfo; } Int_t getStreamerInfoSize() { return streamerInfoSize; } void print(); protected: template void printData(type*,Int_t); private: FairParamObj& operator=(const FairParamObj&); ClassDef(FairParamObj,0) // Class for binary parameter object (name + binary array) }; class FairParamList : public TObject { protected: TList* paramList; // List for parameters stored as string FairLogger* fLogger; // FairRoot logging mechanism class FairParamTFile : public TFile { public: FairParamTFile() { // Create StreamerInfo index Int_t lenIndex = gROOT->GetListOfStreamerInfo()->GetSize()+1; if (lenIndex < 5000) { lenIndex = 5000; } fClassIndex = new TArrayC(lenIndex); } ~FairParamTFile() { delete fClassIndex; fClassIndex=0; } }; public: FairParamList(); ~FairParamList(); void add(FairParamObj&); void add(const Text_t*,const Text_t*); void add(const Text_t*,Int_t); void add(const Text_t*,Bool_t); void add(const Text_t*,UInt_t); void add(const Text_t*,Float_t); void add(const Text_t*,Double_t); void add(const Text_t*,TArrayI&); void add(const Text_t*,TArrayC&); void add(const Text_t*,TArrayF&); void add(const Text_t*,TArrayD&); void add(const Text_t*,const UChar_t*,const Int_t); void add(const Text_t*,const Int_t*,const Int_t); void add(const Text_t*,const Float_t*,const Int_t); void add(const Text_t*,const Double_t*,const Int_t); void addObject(const Text_t*,TObject*); Bool_t fill(const Text_t*,Text_t*,const Int_t); Bool_t fill(const Text_t*,Int_t*,const Int_t nValues=1); Bool_t fill(const Text_t*,Bool_t*,const Int_t nValues=1); Bool_t fill(const Text_t*,UInt_t*,const Int_t nValues=1); Bool_t fill(const Text_t*,Float_t*,const Int_t nValues=1); Bool_t fill(const Text_t*,Double_t*,const Int_t nValues=1); Bool_t fill(const Text_t*,UChar_t*,const Int_t nValues=1); Bool_t fill(const Text_t*,TArrayI*); Bool_t fill(const Text_t*,TArrayC*); Bool_t fill(const Text_t*,TArrayF*); Bool_t fill(const Text_t*,TArrayD*); Bool_t fillObject(const Text_t*,TObject*); void print(); FairParamObj* find(const Text_t* name) { return static_cast(paramList->FindObject(name)); } TList* getList() { return paramList; } private: FairParamList(const FairParamList&); FairParamList& operator=(const FairParamList&); ClassDef(FairParamList,3) // Class for lists of parameters (of type FairParamObj) }; #endif /* !FAIRPARAMLIST_H */ /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ #ifndef FAIRRTDBRUN_H #define FAIRRTDBRUN_H #include "TNamed.h" // for TNamed #include "Riosfwd.h" // for fstream #include "Rtypes.h" // for Int_t, Text_t, UInt_t, etc #include "TString.h" // for TString #include // for sprintf, sscanf #include // for fstream class TList; using std::fstream; class FairParVersion : public TNamed { protected: Int_t inputVersions[3]; //! version of the parameter container in the 2 possible inputs Int_t rootVersion; // version of the parameter container in the ROOT output file public: FairParVersion() : TNamed(),rootVersion(0) {} FairParVersion(Text_t* name); ~FairParVersion() {} void setInputVersion(Int_t v=-1,Int_t i=0) { if (i>=0 && i<3) { inputVersions[i]=v; } } Int_t getInputVersion(Int_t i) { if (i>=0 && i<3) { return inputVersions[i]; } else { return -1; } } void resetInputVersions() { for(Int_t i=0; i<3; i++) {inputVersions[i]=-1;} } void setRootVersion(Int_t v) {rootVersion=v;} Int_t getRootVersion() {return rootVersion;} ClassDef(FairParVersion,1) // Class for parameter versions }; class FairRtdbRun : public TNamed { protected: TList* parVersions; // List of container names with the versions TString refRun; //! name of the reference run for initialization public: FairRtdbRun(); FairRtdbRun(const Text_t* name,const Text_t* refName=""); FairRtdbRun(Int_t r,Int_t rr=-1); FairRtdbRun(FairRtdbRun& run); ~FairRtdbRun(); inline UInt_t getRunId(void); void addParVersion(FairParVersion* pv); FairParVersion* getParVersion(const Text_t* name); TList* getParVersions() {return parVersions;} const Text_t* getRefRun() {return refRun.Data();} void setRefRun(Text_t* s) {refRun=s;} inline void setRefRun(Int_t r); void resetInputVersions(); void resetOutputVersions(); void print(); void write(std::fstream&); private: FairRtdbRun& operator=(const FairRtdbRun&); ClassDef(FairRtdbRun,1) // Class for parameter version management of a run }; // -------------------- inlines --------------------------- inline UInt_t FairRtdbRun::getRunId(void) { UInt_t r; sscanf(GetName(),"%i",&r); return r; } inline void FairRtdbRun::setRefRun(Int_t r) { if (r==-1) { refRun=""; } else { char name[255]; sprintf(name,"%i",r); refRun=name; } } #endif /* !FAIRRTDBRUN_H */ /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ #ifndef FAIRRUNTIMEDB_H #define FAIRRUNTIMEDB_H #include "TObject.h" // for TObject #include "Rtypes.h" // for Bool_t, Int_t, Text_t, etc #include "TList.h" // for TList #include "TString.h" // for TString class FairContFact; class FairLogger; class FairParIo; class FairParSet; class FairRtdbRun; static TList contFactories; //! list of container factories class FairRuntimeDb : public TObject { private: static FairRuntimeDb* gRtdb; //! protected: FairRuntimeDb(void); TList* containerList; // list of parameter containers TList* runs; // list of runs FairParIo* firstInput; // first (prefered) input for parameters FairParIo* secondInput; // second input (used if not found in first input) FairParIo* output; // output for parameters FairRtdbRun* currentRun; // Current run TString currentFileName; // Name of current event file Bool_t versionsChanged; // flag for write of list of runs (set kTRUE by each write) Bool_t isRootFileOutput; // flag indicating that the output is a ROOT file /** Fair Logger */ FairLogger* fLogger; //! /** * Select which IO type to use. */ typedef enum { UNKNOWN_Type = 0, AsciiFileOutput = 1, // Ascii in-out-put RootFileOutput = 2, // Root Files RootTSQLOutput = 3 // Use a TSQL db } ParamIOType; ParamIOType ioType;//IO Type public: static FairRuntimeDb* instance(void); ~FairRuntimeDb(void); Bool_t addParamContext(const char*); void printParamContexts(); void addContFactory(FairContFact*); FairContFact* getContFactory(const Text_t*); Bool_t addContainer(FairParSet*); FairParSet* getContainer(const Text_t*); FairParSet* findContainer(const char*); void removeContainer(Text_t*); void removeAllContainers(void); Bool_t initContainers(Int_t runId,Int_t refId=-1,const Text_t* fileName=""); void setContainersStatic(Bool_t f=kTRUE); Bool_t writeContainers(void); Bool_t writeContainer(FairParSet*,FairRtdbRun*,FairRtdbRun* refRun=0); FairRtdbRun* addRun(Int_t runId,Int_t refId=-1); FairRtdbRun* getRun(Int_t); FairRtdbRun* getRun(Text_t*); FairRtdbRun* getCurrentRun(void) {return currentRun;} Text_t const* getCurrentFileName() {return currentFileName.Data();} void clearRunList(void); void removeRun(Text_t*); Bool_t setInputVersion(Int_t run,Text_t* container, Int_t version,Int_t inputNumber); Bool_t setRootOutputVersion(Int_t run,Text_t* container,Int_t version); void setVersionsChanged(Bool_t f=kTRUE) {versionsChanged=f;} void resetInputVersions(void); void resetOutputVersions(void); void resetAllVersions(void); Bool_t readAll(void); void writeVersions(void); void saveOutput(void); Bool_t setFirstInput(FairParIo*); Bool_t setSecondInput(FairParIo*); Bool_t setOutput(FairParIo*); FairParIo* getFirstInput(void); FairParIo* getSecondInput(void); FairParIo* getOutput(void); void closeFirstInput(void); void closeSecondInput(void); void closeOutput(void); void activateParIo(FairParIo*); TList* getListOfContainers() {return containerList;} void print(void); Int_t findOutputVersion(FairParSet*); private: FairRuntimeDb(const FairRuntimeDb& M); FairRuntimeDb& operator= (const FairRuntimeDb&) {return *this;} Bool_t initContainers(void); ClassDef(FairRuntimeDb,0) // Class for runtime database }; #endif /* !FAIRRUNTIMEDB_H */ #undef _BACKWARD_BACKWARD_WARNING_H In file included from input_line_8:1: /home/vratik/workspace/expertroot_H5/macro/H5run/eventDisplay.C:9:36: error: allocation of incomplete type 'FairParRootFileIo' FairParRootFileIo* parIo1 = new FairParRootFileIo(); ^~~~~~~~~~~~~~~~~ G__ParBaseDict dictionary forward declarations' payload:17:85: note: forward declaration of 'FairParRootFileIo' class __attribute__((annotate(R"ATTRDUMP(Parameter I/O from ROOT files)ATTRDUMP"))) FairParRootFileIo; ^ In file included from input_line_8:1: /home/vratik/workspace/expertroot_H5/macro/H5run/eventDisplay.C:10:9: error: member access into incomplete type 'FairParRootFileIo' parIo1->open("par.root"); ^ G__ParBaseDict dictionary forward declarations' payload:17:85: note: forward declaration of 'FairParRootFileIo' class __attribute__((annotate(R"ATTRDUMP(Parameter I/O from ROOT files)ATTRDUMP"))) FairParRootFileIo; ^ Error in : Error parsing payload code for class FairRuntimeDb with content: #line 1 "G__ParBaseDict dictionary payload" #ifndef G__VECTOR_HAS_CLASS_ITERATOR #define G__VECTOR_HAS_CLASS_ITERATOR 1 #endif #define _BACKWARD_BACKWARD_WARNING_H /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ #ifndef FAIRCONTFACT_H #define FAIRCONTFACT_H #include "TNamed.h" // for TNamed #include "Rtypes.h" // for Bool_t, ClassDef, etc #include "TList.h" // for TList #include "TString.h" // for TString class FairLogger; class FairParIo; class FairParSet; class FairContainer : public TNamed { private: FairContainer(); FairContainer(const FairContainer&); FairContainer& operator=(const FairContainer&); protected: /** available contexts for this parameter container*/ TList* contexts; /** actual context set by the user */ TString actualContext; /** Fair Logger */ FairLogger* fLogger;//! public: FairContainer( const char*, const char*, const char*); ~FairContainer(); void addContext(const char*); Bool_t setActualContext(const char* c); const char* getDefaultContext(); const char* getActualContext() { return actualContext.Data(); } void print(); TString getConcatName(); const char* getContext(); ClassDef(FairContainer,0) // class for list elements in class FairContFact }; class FairContFact : public TNamed { public: FairContFact(); virtual ~FairContFact(); Bool_t addContext(const char* name); void print(); FairParSet* getContainer(const char*); virtual FairParSet* createContainer(FairContainer*) {return 0;} virtual void activateParIo(FairParIo*) {} protected: TList* containers; // all parameter containers managed by this factory const char* getActualContext(const char* name) { return (static_cast(containers->FindObject(name)))->getActualContext(); } /** Fair Logger */ FairLogger* fLogger;//! ClassDef(FairContFact,0) // base class of all factories for parameter containers private: FairContFact(const FairContFact&); FairContFact& operator=(const FairContFact&); }; #endif /* !FAIRCONTFACT_H */ /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ #ifndef FAIRDETPARASCIIFILEIO_H #define FAIRDETPARASCIIFILEIO_H #include "FairDetParIo.h" // for FairDetParIo #include "Riosfwd.h" // for fstream #include "Rtypes.h" // for Text_t, Bool_t, etc #include "TString.h" // for TString #include // for fstream class FairParSet; class FairDetParAsciiFileIo : public FairDetParIo { protected: TString fHeader; //! header of container output in file TString sepLine; //! comment line std::fstream* pFile; //! pointer to ascii file // virtual Bool_t write(HDetector*) {return kTRUE;} Bool_t findContainer(const Text_t* name); Bool_t checkAllFound(Int_t*,Int_t); void writeHeader(const Text_t*, const Text_t* context="", const Text_t* author="", const Text_t* description=""); void writeComment(FairParSet*); void readComment(const Char_t*, FairParSet*); // Bool_t readLabPositions(const Text_t*,HDetGeomPar*,Int_t*,Int_t,Int_t); // Bool_t readVolumes(const Text_t*,HDetGeomPar*); // void readTransform(HGeomTransform&); // Bool_t readVolume(HGeomVolume*,HGeomShapes*,Text_t*); // void writeTransform(const HGeomTransform&); // void writeVolume(HGeomVolume*,HGeomShapes*); public: FairDetParAsciiFileIo(std::fstream* f); virtual ~FairDetParAsciiFileIo() {} // Bool_t read(HDetGeomPar*,Int_t*); // Int_t writeFile(HDetGeomPar*); private: FairDetParAsciiFileIo& operator=(const FairDetParAsciiFileIo&); FairDetParAsciiFileIo(const FairDetParAsciiFileIo&); ClassDef(FairDetParAsciiFileIo,0) // Class for detector parameter I/O from ascii file }; #endif /* !FAIRDETPARASCIIFILEIO_H */ /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ #ifndef FAIRDETPARIO_H #define FAIRDETPARIO_H #include "TNamed.h" // for TNamed #include "Rtypes.h" // for Int_t, FairDetParIo::Class, etc class FairParSet; class FairDetParIo : public TNamed { protected: Int_t inputNumber; // input number (first or second input in runtime database) public: FairDetParIo(); virtual ~FairDetParIo() {;} // sets the input number void setInputNumber(Int_t n) {inputNumber=n;} // returns the input number Int_t getInputNumber() {return inputNumber;} // initializes parameter container virtual Bool_t init(FairParSet*) {return kFALSE;} // writes parameter container to output virtual Int_t write(FairParSet*) {return kFALSE;} ClassDef(FairDetParIo,0) // Base class for detector parameter IO }; #endif /* !HDETPARIO_H */ /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ #ifndef FAIRDETPARROOTFILEIO_H #define FAIRDETPARROOTFILEIO_H #include "FairDetParIo.h" // for FairDetParIo #include "Rtypes.h" // for Int_t, Text_t, etc using std::fstream; class FairParRootFile; class FairParSet; class TObject; class FairDetParRootFileIo : public FairDetParIo { protected: FairParRootFile* pFile; // pointer to parameter ROOT file public: FairDetParRootFileIo(FairParRootFile* f); virtual ~FairDetParRootFileIo() {} virtual Bool_t read(FairParSet*); Int_t write(FairParSet*); // Bool_t read(HDetGeomPar*,Int_t*); protected: Int_t findInputVersion(Text_t* contName); Int_t getMaxVersion(Text_t* contName); TObject* findContainer(Text_t* contName, Int_t version); private: FairDetParRootFileIo(const FairDetParRootFileIo&); FairDetParRootFileIo& operator= (const FairDetParRootFileIo&); ClassDef(FairDetParRootFileIo,0) // detector base class for parameter I/O from ROOT file }; #endif /* !FAIRDETPARROOTFILEIO_H */ /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ #ifndef FAIRGENERICPARASCIIFILEIO_H #define FAIRGENERICPARASCIIFILEIO_H #include "FairDetParAsciiFileIo.h" // for FairDetParAsciiFileIo #include "Riosfwd.h" // for fstream #include "Rtypes.h" // for Int_t, Bool_t, etc #include // for fstream class FairParGenericSet; class FairParSet; class TString; class FairGenericParAsciiFileIo : public FairDetParAsciiFileIo { public: FairGenericParAsciiFileIo(std::fstream* f=0); ~FairGenericParAsciiFileIo() {} Bool_t init(FairParSet*); Int_t write(FairParSet*); private: ClassDef(FairGenericParAsciiFileIo,0) // I/O from Ascii file for parameter containers derived from FairParGenericSet Bool_t readGenericSet(FairParGenericSet* pPar); Int_t writeGenericSet(FairParGenericSet* pPar); template const UChar_t* readData(type,const Char_t*,TString&,Int_t&); template void writeData(type*,Int_t); }; #endif /* !FAIRGENERICPARASCIIFILEIO_H */ /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ #ifndef FAIRGENERICPARROOTFILEIO_H #define FAIRGENERICPARROOTFILEIO_H #include "FairDetParRootFileIo.h" // for FairDetParRootFileIo #include "Rtypes.h" // for ClassDef macro class FairParRootFile; class FairParSet; class FairGenericParRootFileIo : public FairDetParRootFileIo { public: FairGenericParRootFileIo(FairParRootFile* f=0); ~FairGenericParRootFileIo() {} Bool_t init(FairParSet*); ClassDef(FairGenericParRootFileIo,0) // I/O from ROOT file for parameter containers derived from FairParGenericSet }; #endif /* !FAIRGENERICPARROOTFILEIO_H */ /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ #ifndef FAIRPARASCIFILEIIO_H #define FAIRPARASCIFILEIIO_H #include "FairParIo.h" // for FairParIo #include "Riosfwd.h" // for fstream #include "Rtypes.h" // for Bool_t, Text_t, etc #include // for fstream, etc class TList; class FairParAsciiFileIo : public FairParIo { protected: std::fstream* file; // pointer to a file public: FairParAsciiFileIo(); // default destructor closes an open file and deletes list of I/Os ~FairParAsciiFileIo(); // opens file // if a file is already open, this file will be closed // activates detector I/Os Bool_t open(const Text_t* fname, const Text_t* status="in"); // concatenate files whose names are stored in the TList // TList holds list od TObjStrings // create file all.par in local working directory // calls open to open the generated file all.par Bool_t open(const TList* fnamelist, const Text_t* status="in"); // closes file void close(); // returns kTRUE if file is open Bool_t check() { if (file) { return (file->rdbuf()->is_open()==1); } else { return kFALSE; } } // prints information about the file and the detector I/Os void print(); std::fstream* getFile(); private: FairParAsciiFileIo(const FairParAsciiFileIo&); FairParAsciiFileIo& operator=(const FairParAsciiFileIo&); ClassDef(FairParAsciiFileIo,0) // Parameter I/O from ASCII files }; #endif /* !FAIRPARASCIIFILEIO_H */ /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ #ifndef FAIRPARGENERICSET_H #define FAIRPARGENERICSET_H #include "FairParSet.h" // for FairParSet #include "Rtypes.h" // for Bool_t, etc class FairParIo; class FairParamList; class FairParGenericSet : public FairParSet { public: FairParGenericSet(const char* name,const char* title,const char* context, Bool_t ownership=kFALSE) : FairParSet(name,title,context,ownership) {} virtual ~FairParGenericSet() {} virtual void putParams(FairParamList*)=0; virtual Bool_t getParams(FairParamList*)=0; virtual void printParams(); Bool_t init(FairParIo* inp); Int_t write(FairParIo* output); // DB add on void fill(UInt_t) {}; void store(UInt_t) {}; protected: FairParGenericSet() : FairParSet() {} ClassDef(FairParGenericSet,1) // Base class for generic-style parameter containers }; #endif /* !FAIRPARGENERICSET_H */ /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ #ifndef FAIRPARIO_H #define FAIRPARIO_H #include "TObject.h" // for TObject #include "Rtypes.h" // for Bool_t, Text_t, etc #include "TString.h" // for TString class FairDetParIo; class FairRtdbRun; class TList; class FairParIo : public TObject { protected: TList* detParIoList; // list of detector I/Os Bool_t autoWritable; // flag indicating if automatic write is possible TString filename; public: FairParIo(); virtual ~FairParIo(); virtual FairDetParIo* getDetParIo(const Text_t*); virtual void setDetParIo(FairDetParIo*); virtual void removeDetParIo(Text_t*); void setInputNumber(Int_t); virtual void close() {;} // returns the filename const char* getFilename() {return filename.Data();} // creates input/output class for a special detector and stores pointer // used only for Oracle input/output // (code in class OraIo) virtual void setDetParIo(Text_t*) {;} // prints information about input/output virtual void print() {;} // checks if the input/output is open virtual Bool_t check() { return kFALSE; } // reads versions of parameter containers for an event file virtual void readVersions(FairRtdbRun*) {;} // sets global file pointer in ROOT if input/output is a ROOT-file // (code in FairParRootFileIo) virtual void cd() {;} // set and get for flag autoWritable void setAutoWritable(Bool_t f=kTRUE) {autoWritable=f;} Bool_t isAutoWritable() {return autoWritable;} private: FairParIo(const FairParIo&); FairParIo& operator=(const FairParIo&); ClassDef(FairParIo,0) // Base class for all parameter I/Os }; #endif /* !FAIRPARIO_H */ /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ #ifndef FAIRPARROOTFILEIO_H #define FAIRPARROOTFILEIO_H #include "FairParIo.h" // for FairParIo #include "Rtypes.h" // for Bool_t, Text_t, Int_t, etc #include "TFile.h" // for TFile #include "TNamed.h" // for TNamed #include using std::fstream; class FairRtdbRun; class TKey; class TList; class FairParRootFile : public TNamed { public: FairRtdbRun* run; //! pointer to current run in ROOT file FairParRootFile(const Text_t* fname, Option_t* option="READ", const Text_t* ftitle="",Int_t compress=1); FairParRootFile(TFile* f); ~FairParRootFile(); FairRtdbRun* getRun() {return run;} void readVersions(FairRtdbRun*); Bool_t IsOpen() {return RootFile->IsOpen();} void cd() {RootFile->cd();} Bool_t IsWritable() {return RootFile->IsWritable();} TKey* GetKey(Text_t* t) { return RootFile->GetKey(t);} TList* GetListOfKeys() { return RootFile->GetListOfKeys();} void Close() {RootFile->Close();} protected: TFile* RootFile; private: FairParRootFile(const FairParRootFile&); FairParRootFile& operator=(const FairParRootFile&); ClassDef(FairParRootFile,0) // ROOT file for Parameter I/O }; class FairParRootFileIo : public FairParIo { protected: FairParRootFile* file; // pointer to ROOT file Bool_t fMerging; public: FairParRootFileIo(); FairParRootFileIo(Bool_t merged); ~FairParRootFileIo(); Bool_t open(const Text_t* fname, Option_t* option="READ", const Text_t* ftitle="",Int_t compress=1); Bool_t open(const TList* fnamelist, Option_t* option="READ", const Text_t* ftitle="",Int_t compress=1); void close(); void print(); FairParRootFile* getParRootFile(); void readVersions(FairRtdbRun*); TList* getKeys(); Bool_t check() { // returns kTRUE if file is open if (file) { return file->IsOpen(); } else { return kFALSE; } } void cd() { // sets the global ROOT file pointer gFile if (file) { file->cd(); } } /** Open an existing root file for IO */ Bool_t open(TFile* f); void setMerging( Bool_t io ) { fMerging=io;} private: FairParRootFileIo(const FairParRootFileIo&); FairParRootFileIo& operator=(const FairParRootFileIo&); ClassDef(FairParRootFileIo,0) // Parameter I/O from ROOT files }; #endif /* !FAIRPARROOTFILEIO_H */ /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ #ifndef FAIRPARSET_H #define FAIRPARSET_H #include "TNamed.h" #include "Rtypes.h" // for Int_t, Bool_t, etc #include "TString.h" // for TString class FairLogger; class FairParIo; class FairParSet : public TObject { protected: TString fName; // TString fTitle; // TString detName; //! name of the detector the container belongs to Int_t versions[3]; //! versions of container in the 2 possible inputs Bool_t status; //! static flag Bool_t changed; //! flag is kTRUE if parameters have changed Bool_t owned; //! if flag is KTRUE FairDB has the par. class ownership TString paramContext; // Context/purpose for parameters and conditions TString author; // Author of parameters TString description ; // Description of parameters /** Fair Logger */ FairLogger* fLogger; //! public: FairParSet(const char* name="",const char* title="",const char* context="", Bool_t owner=kFALSE); virtual ~FairParSet() {} virtual const char* GetName() const {return static_cast(fName.Data());} virtual const char* GetTitle() const {return static_cast(fTitle.Data());} virtual Bool_t init(); virtual Bool_t init(FairParIo*) { return kFALSE; } virtual Int_t write(); virtual Int_t write(FairParIo*) { return kFALSE; } virtual void clear() {} virtual void print(); const char* getDetectorName() {return detName.Data();} void resetInputVersions(); void setInputVersion(Int_t v=-1,Int_t i=0) { if (i>=0 && i<3) { versions[i]=v; } } Int_t getInputVersion(Int_t i) { if (i>=0 && i<3) { return versions[i]; } else { return 0; } } void setStatic(Bool_t flag=kTRUE) {status=flag;} Bool_t isStatic() {return status;} void setOwnership(Bool_t flag=kTRUE) {owned=flag;} Bool_t isOwned() {return owned;} void setChanged(Bool_t flag=kTRUE) {changed=flag;} Bool_t hasChanged() {return changed;} const char* getParamContext() const { return paramContext.Data(); } void setAuthor(const char* s) {author=s;} const char* getAuthor() const { return author.Data(); } void setDescription(const char* s) {description=s;} const char* getDescription() const { return description.Data(); } void copyComment(FairParSet& r) { author=r.getAuthor(); description=r.getDescription(); } virtual void fill(UInt_t) {}; virtual void store(UInt_t) {}; FairParSet& operator=(const FairParSet&); FairParSet(const FairParSet&); ClassDef(FairParSet,2) // Base class for all parameter containers }; #endif /* !FAIRPARSET_H */ /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ #ifndef FAIRPARAMLIST_H #define FAIRPARAMLIST_H #include "TNamed.h" // for TNamed #include "Rtypes.h" // for Text_t, Int_t, Bool_t, etc #include "TArrayC.h" // for TArrayC #include "TFile.h" // for TFile #include "TList.h" // for TList #include "TObject.h" // for TObject #include "TROOT.h" // for TROOT, gROOT #include "TSeqCollection.h" // for TSeqCollection #include "TString.h" // for TString class FairLogger; class TArrayD; class TArrayF; class TArrayI; class FairParamObj : public TNamed { protected: UChar_t* paramValue; // Pointer to binary array Int_t arraySize; // Size of binary array TString paramType; // Type of parameter value or class name Bool_t basicType; // kTRUE for C-types and C-type parameter arrays, kFALSE for classes Int_t bytesPerValue; // number of bytes per value Int_t classVersion; // Code version of classes stored as binary UChar_t* streamerInfo; // Pointer to binary array container the streamer info Int_t streamerInfoSize; // Size of streamer info array public: FairParamObj(const Text_t* name=""); FairParamObj(FairParamObj&); FairParamObj(const Text_t*,Int_t); FairParamObj(const Text_t*,Bool_t); FairParamObj(const Text_t*,UInt_t); FairParamObj(const Text_t*,Float_t); FairParamObj(const Text_t*,Double_t); FairParamObj(const Text_t*,const Int_t*,const Int_t); FairParamObj(const Text_t*,const UInt_t*,const Int_t); FairParamObj(const Text_t*,const Float_t*,const Int_t); FairParamObj(const Text_t*,const Double_t*,const Int_t); FairParamObj(const Text_t*,const Text_t*); FairParamObj(const Text_t*,const Char_t*,const Int_t); FairParamObj(const Text_t*,const UChar_t*,const Int_t); ~FairParamObj(); void setParamType(const Text_t* t); UChar_t* setLength(Int_t l); void setParamValue(UChar_t*,const Int_t); void setClassVersion(const Int_t v) { classVersion=v; } UChar_t* setStreamerInfoSize(Int_t); void setStreamerInfo(UChar_t*,const Int_t); UChar_t* getParamValue() { return paramValue; } Bool_t isBasicType() { return basicType; } const char* getParamType() { return paramType.Data(); } Int_t getBytesPerValue() { return bytesPerValue; } Int_t getClassVersion() { return classVersion; } Int_t getLength() { return arraySize; } Int_t getNumParams(); UChar_t* getStreamerInfo() { return streamerInfo; } Int_t getStreamerInfoSize() { return streamerInfoSize; } void print(); protected: template void printData(type*,Int_t); private: FairParamObj& operator=(const FairParamObj&); ClassDef(FairParamObj,0) // Class for binary parameter object (name + binary array) }; class FairParamList : public TObject { protected: TList* paramList; // List for parameters stored as string FairLogger* fLogger; // FairRoot logging mechanism class FairParamTFile : public TFile { public: FairParamTFile() { // Create StreamerInfo index Int_t lenIndex = gROOT->GetListOfStreamerInfo()->GetSize()+1; if (lenIndex < 5000) { lenIndex = 5000; } fClassIndex = new TArrayC(lenIndex); } ~FairParamTFile() { delete fClassIndex; fClassIndex=0; } }; public: FairParamList(); ~FairParamList(); void add(FairParamObj&); void add(const Text_t*,const Text_t*); void add(const Text_t*,Int_t); void add(const Text_t*,Bool_t); void add(const Text_t*,UInt_t); void add(const Text_t*,Float_t); void add(const Text_t*,Double_t); void add(const Text_t*,TArrayI&); void add(const Text_t*,TArrayC&); void add(const Text_t*,TArrayF&); void add(const Text_t*,TArrayD&); void add(const Text_t*,const UChar_t*,const Int_t); void add(const Text_t*,const Int_t*,const Int_t); void add(const Text_t*,const Float_t*,const Int_t); void add(const Text_t*,const Double_t*,const Int_t); void addObject(const Text_t*,TObject*); Bool_t fill(const Text_t*,Text_t*,const Int_t); Bool_t fill(const Text_t*,Int_t*,const Int_t nValues=1); Bool_t fill(const Text_t*,Bool_t*,const Int_t nValues=1); Bool_t fill(const Text_t*,UInt_t*,const Int_t nValues=1); Bool_t fill(const Text_t*,Float_t*,const Int_t nValues=1); Bool_t fill(const Text_t*,Double_t*,const Int_t nValues=1); Bool_t fill(const Text_t*,UChar_t*,const Int_t nValues=1); Bool_t fill(const Text_t*,TArrayI*); Bool_t fill(const Text_t*,TArrayC*); Bool_t fill(const Text_t*,TArrayF*); Bool_t fill(const Text_t*,TArrayD*); Bool_t fillObject(const Text_t*,TObject*); void print(); FairParamObj* find(const Text_t* name) { return static_cast(paramList->FindObject(name)); } TList* getList() { return paramList; } private: FairParamList(const FairParamList&); FairParamList& operator=(const FairParamList&); ClassDef(FairParamList,3) // Class for lists of parameters (of type FairParamObj) }; #endif /* !FAIRPARAMLIST_H */ /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ #ifndef FAIRRTDBRUN_H #define FAIRRTDBRUN_H #include "TNamed.h" // for TNamed #include "Riosfwd.h" // for fstream #include "Rtypes.h" // for Int_t, Text_t, UInt_t, etc #include "TString.h" // for TString #include // for sprintf, sscanf #include // for fstream class TList; using std::fstream; class FairParVersion : public TNamed { protected: Int_t inputVersions[3]; //! version of the parameter container in the 2 possible inputs Int_t rootVersion; // version of the parameter container in the ROOT output file public: FairParVersion() : TNamed(),rootVersion(0) {} FairParVersion(Text_t* name); ~FairParVersion() {} void setInputVersion(Int_t v=-1,Int_t i=0) { if (i>=0 && i<3) { inputVersions[i]=v; } } Int_t getInputVersion(Int_t i) { if (i>=0 && i<3) { return inputVersions[i]; } else { return -1; } } void resetInputVersions() { for(Int_t i=0; i<3; i++) {inputVersions[i]=-1;} } void setRootVersion(Int_t v) {rootVersion=v;} Int_t getRootVersion() {return rootVersion;} ClassDef(FairParVersion,1) // Class for parameter versions }; class FairRtdbRun : public TNamed { protected: TList* parVersions; // List of container names with the versions TString refRun; //! name of the reference run for initialization public: FairRtdbRun(); FairRtdbRun(const Text_t* name,const Text_t* refName=""); FairRtdbRun(Int_t r,Int_t rr=-1); FairRtdbRun(FairRtdbRun& run); ~FairRtdbRun(); inline UInt_t getRunId(void); void addParVersion(FairParVersion* pv); FairParVersion* getParVersion(const Text_t* name); TList* getParVersions() {return parVersions;} const Text_t* getRefRun() {return refRun.Data();} void setRefRun(Text_t* s) {refRun=s;} inline void setRefRun(Int_t r); void resetInputVersions(); void resetOutputVersions(); void print(); void write(std::fstream&); private: FairRtdbRun& operator=(const FairRtdbRun&); ClassDef(FairRtdbRun,1) // Class for parameter version management of a run }; // -------------------- inlines --------------------------- inline UInt_t FairRtdbRun::getRunId(void) { UInt_t r; sscanf(GetName(),"%i",&r); return r; } inline void FairRtdbRun::setRefRun(Int_t r) { if (r==-1) { refRun=""; } else { char name[255]; sprintf(name,"%i",r); refRun=name; } } #endif /* !FAIRRTDBRUN_H */ /******************************************************************************** * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence version 3 (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ #ifndef FAIRRUNTIMEDB_H #define FAIRRUNTIMEDB_H #include "TObject.h" // for TObject #include "Rtypes.h" // for Bool_t, Int_t, Text_t, etc #include "TList.h" // for TList #include "TString.h" // for TString class FairContFact; class FairLogger; class FairParIo; class FairParSet; class FairRtdbRun; static TList contFactories; //! list of container factories class FairRuntimeDb : public TObject { private: static FairRuntimeDb* gRtdb; //! protected: FairRuntimeDb(void); TList* containerList; // list of parameter containers TList* runs; // list of runs FairParIo* firstInput; // first (prefered) input for parameters FairParIo* secondInput; // second input (used if not found in first input) FairParIo* output; // output for parameters FairRtdbRun* currentRun; // Current run TString currentFileName; // Name of current event file Bool_t versionsChanged; // flag for write of list of runs (set kTRUE by each write) Bool_t isRootFileOutput; // flag indicating that the output is a ROOT file /** Fair Logger */ FairLogger* fLogger; //! /** * Select which IO type to use. */ typedef enum { UNKNOWN_Type = 0, AsciiFileOutput = 1, // Ascii in-out-put RootFileOutput = 2, // Root Files RootTSQLOutput = 3 // Use a TSQL db } ParamIOType; ParamIOType ioType;//IO Type public: static FairRuntimeDb* instance(void); ~FairRuntimeDb(void); Bool_t addParamContext(const char*); void printParamContexts(); void addContFactory(FairContFact*); FairContFact* getContFactory(const Text_t*); Bool_t addContainer(FairParSet*); FairParSet* getContainer(const Text_t*); FairParSet* findContainer(const char*); void removeContainer(Text_t*); void removeAllContainers(void); Bool_t initContainers(Int_t runId,Int_t refId=-1,const Text_t* fileName=""); void setContainersStatic(Bool_t f=kTRUE); Bool_t writeContainers(void); Bool_t writeContainer(FairParSet*,FairRtdbRun*,FairRtdbRun* refRun=0); FairRtdbRun* addRun(Int_t runId,Int_t refId=-1); FairRtdbRun* getRun(Int_t); FairRtdbRun* getRun(Text_t*); FairRtdbRun* getCurrentRun(void) {return currentRun;} Text_t const* getCurrentFileName() {return currentFileName.Data();} void clearRunList(void); void removeRun(Text_t*); Bool_t setInputVersion(Int_t run,Text_t* container, Int_t version,Int_t inputNumber); Bool_t setRootOutputVersion(Int_t run,Text_t* container,Int_t version); void setVersionsChanged(Bool_t f=kTRUE) {versionsChanged=f;} void resetInputVersions(void); void resetOutputVersions(void); void resetAllVersions(void); Bool_t readAll(void); void writeVersions(void); void saveOutput(void); Bool_t setFirstInput(FairParIo*); Bool_t setSecondInput(FairParIo*); Bool_t setOutput(FairParIo*); FairParIo* getFirstInput(void); FairParIo* getSecondInput(void); FairParIo* getOutput(void); void closeFirstInput(void); void closeSecondInput(void); void closeOutput(void); void activateParIo(FairParIo*); TList* getListOfContainers() {return containerList;} void print(void); Int_t findOutputVersion(FairParSet*); private: FairRuntimeDb(const FairRuntimeDb& M); FairRuntimeDb& operator= (const FairRuntimeDb&) {return *this;} Bool_t initContainers(void); ClassDef(FairRuntimeDb,0) // Class for runtime database }; #endif /* !FAIRRUNTIMEDB_H */ #undef _BACKWARD_BACKWARD_WARNING_H In file included from input_line_8:1: /home/vratik/workspace/expertroot_H5/macro/H5run/eventDisplay.C:11:7: error: member access into incomplete type 'FairRuntimeDb' rtdb->setFirstInput(parIo1); ^ G__ParBaseDict dictionary forward declarations' payload:22:82: note: forward declaration of 'FairRuntimeDb' class __attribute__((annotate(R"ATTRDUMP(Class for runtime database)ATTRDUMP"))) FairRuntimeDb; ^ root [1] .q