GSI Forum
GSI Helmholtzzentrum für Schwerionenforschung

Home » PANDA » PandaRoot » Bugs, Fixes, Releases » [FIXED] FairEvtFilter problem with c++11
Re: FairEvtFilter problem with c++11 [message #17517 is a reply to message #17513] Fri, 14 November 2014 11:19 Go to previous messageGo to previous message
StefanoSpataro is currently offline  StefanoSpataro
Messages: 2736
Registered: June 2005
Location: Torino
first-grade participant

From: *to.infn.it
I fixed in the code and committed in svn.
Simply you cannot assign the value of a static const in the header, but you need to move it to the .cxx (thanks Mohammad and Florain for the help).
A good question is why you are defining pi, instead of using TMath::Pi().
You can find below the changes I did.


pandauser@panda-VirtualBox:~/fairsoft_jul14p3/pandaroot$ svn diff fts/FtsTracking/
Index: fts/FtsTracking/PndFtsHoughTrackFinder.cxx
===================================================================
--- fts/FtsTracking/PndFtsHoughTrackFinder.cxx	(revision 26438)
+++ fts/FtsTracking/PndFtsHoughTrackFinder.cxx	(working copy)
@@ -4,8 +4,10 @@
 
 ClassImp(PndFtsHoughTrackFinder);
 
+const Double_t PndFtsHoughTrackFinder::meinpi = 3.14159265359;
+const Double_t PndFtsHoughTrackFinder::fZLineParabola = 368.;
+const Double_t PndFtsHoughTrackFinder::fZParabolaLine = 605.;
 
-
 PndFtsHoughTrackFinder::PndFtsHoughTrackFinder(PndFtsHoughTrackerTask *trackerTask) :
 			fTrackerTask(trackerTask),
 
Index: fts/FtsTracking/PndFtsHoughTrackFinder.h
===================================================================
--- fts/FtsTracking/PndFtsHoughTrackFinder.h	(revision 26438)
+++ fts/FtsTracking/PndFtsHoughTrackFinder.h	(working copy)
@@ -164,10 +164,10 @@
 	//	std::vector<PndTrackCand> fTrackCand; // resulting track candidates, also used for returning PndTracks
 
 
-	static const Double_t meinpi = 3.14159265359;
+	static const Double_t meinpi;
 	///< sets where the apex of the parabola is supposed to be
-	static const Double_t fZLineParabola = 368.; // the value should coincide with the start of the dipole field // 368. was ok
-	static const Double_t fZParabolaLine = 605.; // the value should coincide with the end of the dipole field // TODO determine this value
+	static const Double_t fZLineParabola; // the value should coincide with the start of the dipole field // 368. was ok
+	static const Double_t fZParabolaLine; // the value should coincide with the end of the dipole field // TODO determine this value
 
 
 
pandauser@panda-VirtualBox:~/fairsoft_jul14p3/pandaroot$ svn diff pgenerators/eventFilter/
Index: pgenerators/eventFilter/FairEvtFilter.cxx
===================================================================
--- pgenerators/eventFilter/FairEvtFilter.cxx	(revision 26438)
+++ pgenerators/eventFilter/FairEvtFilter.cxx	(working copy)
@@ -5,8 +5,8 @@
 
 #include "FairEvtFilter.h"
 
+const Double_t FairEvtFilter::kNoChargeSpecified = -999.9;
 
-
 // -----   Default constructor   -------------------------------------------
 FairEvtFilter::FairEvtFilter()
 : TNamed(), fEventNr(0), fVerbose(0), fTestMode(0)
Index: pgenerators/eventFilter/FairEvtFilter.h
===================================================================
--- pgenerators/eventFilter/FairEvtFilter.h	(revision 26438)
+++ pgenerators/eventFilter/FairEvtFilter.h	(working copy)
@@ -126,7 +126,7 @@
 	TDatabasePDG* fdbPdg;
 	// constant holding a double number which is not a valid charge
 	// this serves to indicate that the value has not been specified by the user
-	static const Double_t kNoChargeSpecified = -999.9;
+	static const Double_t kNoChargeSpecified;
 
 	TClonesArray* fParticleList; // list of particles in the event which was generated
 	Int_t fVerbose; // level of commenting output for your filter, between 0 and 12
 
Read Message icon9.gif
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: TRandom() - seed
Next Topic: Reading parameter file, ROOT::delete_TFile(void*) ()
Goto Forum:
  


Current Time: Wed Apr 24 01:29:16 CEST 2024

Total time taken to generate the page: 0.01080 seconds