Skip to content

Commit 2493615

Browse files
committed
Bugfix: Correctly set transient data members and variable length arrays for streamer
Bugfix: Fixed a warning in CMakeLists.txt Bugfix: Removed extra namespace from the Detector class
1 parent e91c171 commit 2493615

10 files changed

Lines changed: 121 additions & 122 deletions

Base/Detector.h

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,7 @@ namespace Base {
1414
class Detector : public FairDetector {
1515

1616
public:
17-
enum Model {
18-
test123 = 0
19-
};
20-
17+
enum Model { test123 = 0 };
2118

2219
Detector(const char* name, Bool_t Active, Int_t DetId = 0);
2320

@@ -73,8 +70,8 @@ class Detector : public FairDetector {
7370
Double_t dthick = 0., UInt_t detType = 0, Int_t buildFlag = 0);
7471

7572
protected:
76-
static Float_t mDensityFactor; ///< factor that is multiplied to all material densities (ONLY for
77-
///< systematic studies)
73+
static Float_t mDensityFactor; //! factor that is multiplied to all material densities (ONLY for
74+
//systematic studies)
7875
private:
7976
Detector(const Detector&);
8077
Detector& operator=(const Detector&);

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ set(EXECUTABLE_OUTPUT_PATH "${CMAKE_BINARY_DIR}/bin")
5555
set(INCLUDE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/include")
5656
Set(VMCWORKDIR ${CMAKE_SOURCE_DIR})
5757
Option(USE_PATH_INFO "Information from PATH and LD_LIBRARY_PATH are
58-
used."OFF)
58+
used." OFF)
5959
If(USE_PATH_INFO)
6060
Set(PATH "$PATH")
6161
If (APPLE)

Data/Stack.h

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -181,32 +181,32 @@ class Stack : public FairGenericStack {
181181
FairLogger* mLogger;
182182

183183
/// STL stack (FILO) used to handle the TParticles for tracking
184-
std::stack<TParticle*> mStack;
184+
std::stack<TParticle*> mStack; //!
185185

186186
/// Array of TParticles (contains all TParticles put into or created
187187
/// by the transport
188-
TClonesArray* mParticles;
188+
TClonesArray* mParticles; //!
189189

190190
/// Array of FairMCTracks containg the tracks written to the output
191191
TClonesArray* mTracks;
192192

193193
/// STL map from particle index to storage flag
194-
std::map<Int_t, Bool_t> mStoreMap;
195-
std::map<Int_t, Bool_t>::iterator mStoreIterator;
194+
std::map<Int_t, Bool_t> mStoreMap; //!
195+
std::map<Int_t, Bool_t>::iterator mStoreIterator; //!
196196

197197
/// STL map from particle index to track index
198-
std::map<Int_t, Int_t> mIndexMap;
199-
std::map<Int_t, Int_t>::iterator mIndexIterator;
198+
std::map<Int_t, Int_t> mIndexMap; //!
199+
std::map<Int_t, Int_t>::iterator mIndexIterator; //!
200200

201201
/// STL map from track index and detector ID to number of MCPoints
202-
std::map<std::pair<Int_t, Int_t>, Int_t> mPointsMap;
202+
std::map<std::pair<Int_t, Int_t>, Int_t> mPointsMap; //!
203203

204204
/// Some indices and counters
205-
Int_t mIndexOfCurrentTrack; ///< Index of current track
206-
Int_t mNumberOfPrimaryParticles; ///< Number of primary particles
207-
Int_t mNumberOfEntriesInParticles; ///< Number of entries in mParticles
208-
Int_t mNumberOfEntriesInTracks; ///< Number of entries in mTracks
209-
Int_t mIndex; ///< Used for merging
205+
Int_t mIndexOfCurrentTrack; //! Index of current track
206+
Int_t mNumberOfPrimaryParticles; //! Number of primary particles
207+
Int_t mNumberOfEntriesInParticles; //! Number of entries in mParticles
208+
Int_t mNumberOfEntriesInTracks; //! Number of entries in mTracks
209+
Int_t mIndex; //! Used for merging
210210

211211
/// Variables defining the criteria for output selection
212212
Bool_t mStoreMothers;

its/Detector.cxx

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ using std::endl;
3333

3434
using namespace AliceO2::ITS;
3535

36-
AliceO2::ITS::Detector::Detector()
36+
Detector::Detector()
3737
: AliceO2::Base::Detector("ITS", kTRUE, kAliIts),
3838
mLayerID(0),
3939
mTrackNumberID(-1),
@@ -80,7 +80,7 @@ AliceO2::ITS::Detector::Detector()
8080
{
8181
}
8282

83-
AliceO2::ITS::Detector::Detector(const char* name, Bool_t active, const Int_t nlay)
83+
Detector::Detector(const char* name, Bool_t active, const Int_t nlay)
8484
: AliceO2::Base::Detector(name, active, kAliIts),
8585
mLayerID(0),
8686
mTrackNumberID(-1),
@@ -162,7 +162,7 @@ AliceO2::ITS::Detector::Detector(const char* name, Bool_t active, const Int_t nl
162162
}
163163
}
164164

165-
AliceO2::ITS::Detector::~Detector()
165+
Detector::~Detector()
166166
{
167167
delete[] mTurboLayer;
168168
delete[] mLayerPhi0;
@@ -190,7 +190,7 @@ AliceO2::ITS::Detector::~Detector()
190190
delete[] mLayerID;
191191
}
192192

193-
AliceO2::ITS::Detector& AliceO2::ITS::Detector::operator=(const AliceO2::ITS::Detector& h)
193+
Detector& Detector::operator=(const Detector& h)
194194
{
195195
// The standard = operator
196196
// Inputs:
@@ -218,7 +218,7 @@ AliceO2::ITS::Detector& AliceO2::ITS::Detector::operator=(const AliceO2::ITS::De
218218
return *this;
219219
}
220220

221-
void AliceO2::ITS::Detector::Initialize()
221+
void Detector::Initialize()
222222
{
223223
if (!mLayerID) {
224224
mLayerID = new Int_t[mNumberLayers];
@@ -236,7 +236,7 @@ void AliceO2::ITS::Detector::Initialize()
236236
// O2itsGeoPar* par=(O2itsGeoPar*)(rtdb->getContainer("O2itsGeoPar"));
237237
}
238238

239-
void AliceO2::ITS::Detector::InitParameterContainers()
239+
void Detector::InitParameterContainers()
240240
{
241241
LOG(INFO) << "Initialize aliitsdet misallign parameters" << FairLogger::endl;
242242
mNumberOfDetectors = mMisalignmentParameter->GetNumberOfDetectors();
@@ -248,7 +248,7 @@ void AliceO2::ITS::Detector::InitParameterContainers()
248248
mRotZ = mMisalignmentParameter->GetRotZ();
249249
}
250250

251-
void AliceO2::ITS::Detector::SetParameterContainers()
251+
void Detector::SetParameterContainers()
252252
{
253253
LOG(INFO) << "Set tutdet misallign parameters" << FairLogger::endl;
254254
// Get Base Container
@@ -260,7 +260,7 @@ void AliceO2::ITS::Detector::SetParameterContainers()
260260
mMisalignmentParameter = (MisalignmentParameter*)(rtdb->getContainer("MisallignmentParameter"));
261261
}
262262

263-
Bool_t AliceO2::ITS::Detector::ProcessHits(FairVolume* vol)
263+
Bool_t Detector::ProcessHits(FairVolume* vol)
264264
{
265265
// This method is called from the MC stepping
266266
if (!(gMC->TrackCharge())) {
@@ -328,7 +328,7 @@ Bool_t AliceO2::ITS::Detector::ProcessHits(FairVolume* vol)
328328
return kTRUE;
329329
}
330330

331-
void AliceO2::ITS::Detector::CreateMaterials()
331+
void Detector::CreateMaterials()
332332
{
333333
// Int_t ifield = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Integ();
334334
// Float_t fieldm = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max();
@@ -459,21 +459,21 @@ void AliceO2::ITS::Detector::CreateMaterials()
459459
epsil, stmin);
460460
}
461461

462-
void AliceO2::ITS::Detector::EndOfEvent()
462+
void Detector::EndOfEvent()
463463
{
464464
mPointCollection->Clear();
465465
}
466466

467-
void AliceO2::ITS::Detector::Register()
467+
void Detector::Register()
468468
{
469469
// This will create a branch in the output tree called Point, setting the last
470470
// parameter to kFALSE means that this collection will not be written to the file,
471471
// it will exist only during the simulation
472472

473-
FairRootManager::Instance()->Register("AliceO2::ITS::Point", "ITS", mPointCollection, kTRUE);
473+
FairRootManager::Instance()->Register("Point", "ITS", mPointCollection, kTRUE);
474474
}
475475

476-
TClonesArray* AliceO2::ITS::Detector::GetCollection(Int_t iColl) const
476+
TClonesArray* Detector::GetCollection(Int_t iColl) const
477477
{
478478
if (iColl == 0) {
479479
return mPointCollection;
@@ -482,12 +482,12 @@ TClonesArray* AliceO2::ITS::Detector::GetCollection(Int_t iColl) const
482482
}
483483
}
484484

485-
void AliceO2::ITS::Detector::Reset()
485+
void Detector::Reset()
486486
{
487487
mPointCollection->Clear();
488488
}
489489

490-
void AliceO2::ITS::Detector::SetNumberOfWrapperVolumes(Int_t n)
490+
void Detector::SetNumberOfWrapperVolumes(Int_t n)
491491
{
492492
// book arrays for wrapper volumes
493493
if (mNumberOfWrapperVolumes) {
@@ -508,7 +508,7 @@ void AliceO2::ITS::Detector::SetNumberOfWrapperVolumes(Int_t n)
508508
}
509509
}
510510

511-
void AliceO2::ITS::Detector::DefineWrapperVolume(Int_t id, Double_t rmin, Double_t rmax,
511+
void Detector::DefineWrapperVolume(Int_t id, Double_t rmin, Double_t rmax,
512512
Double_t zspan)
513513
{
514514
// set parameters of id-th wrapper volume
@@ -522,7 +522,7 @@ void AliceO2::ITS::Detector::DefineWrapperVolume(Int_t id, Double_t rmin, Double
522522
mWrapperZSpan[id] = zspan;
523523
}
524524

525-
void AliceO2::ITS::Detector::DefineLayer(Int_t nlay, double phi0, Double_t r, Double_t zlen,
525+
void Detector::DefineLayer(Int_t nlay, double phi0, Double_t r, Double_t zlen,
526526
Int_t nstav, Int_t nunit, Double_t lthick, Double_t dthick,
527527
UInt_t dettypeID, Int_t buildLevel)
528528
{
@@ -565,7 +565,7 @@ void AliceO2::ITS::Detector::DefineLayer(Int_t nlay, double phi0, Double_t r, Do
565565
mBuildLevel[nlay] = buildLevel;
566566
}
567567

568-
void AliceO2::ITS::Detector::DefineLayerTurbo(Int_t nlay, Double_t phi0, Double_t r, Double_t zlen,
568+
void Detector::DefineLayerTurbo(Int_t nlay, Double_t phi0, Double_t r, Double_t zlen,
569569
Int_t nstav, Int_t nunit, Double_t width,
570570
Double_t tilt, Double_t lthick, Double_t dthick,
571571
UInt_t dettypeID, Int_t buildLevel)
@@ -615,7 +615,7 @@ void AliceO2::ITS::Detector::DefineLayerTurbo(Int_t nlay, Double_t phi0, Double_
615615
mBuildLevel[nlay] = buildLevel;
616616
}
617617

618-
void AliceO2::ITS::Detector::GetLayerParameters(Int_t nlay, Double_t& phi0, Double_t& r,
618+
void Detector::GetLayerParameters(Int_t nlay, Double_t& phi0, Double_t& r,
619619
Double_t& zlen, Int_t& nstav, Int_t& nmod,
620620
Double_t& width, Double_t& tilt, Double_t& lthick,
621621
Double_t& dthick, UInt_t& dettype) const
@@ -655,7 +655,7 @@ void AliceO2::ITS::Detector::GetLayerParameters(Int_t nlay, Double_t& phi0, Doub
655655
dettype = mChipTypeID[nlay];
656656
}
657657

658-
TGeoVolume* AliceO2::ITS::Detector::CreateWrapperVolume(Int_t id)
658+
TGeoVolume* Detector::CreateWrapperVolume(Int_t id)
659659
{
660660
// Creates an air-filled wrapper cylindrical volume
661661

@@ -677,7 +677,7 @@ TGeoVolume* AliceO2::ITS::Detector::CreateWrapperVolume(Int_t id)
677677
return wrapper;
678678
}
679679

680-
void AliceO2::ITS::Detector::ConstructGeometry()
680+
void Detector::ConstructGeometry()
681681
{
682682
// Create the detector materials
683683
CreateMaterials();
@@ -689,7 +689,7 @@ void AliceO2::ITS::Detector::ConstructGeometry()
689689
DefineSensitiveVolumes();
690690
}
691691

692-
void AliceO2::ITS::Detector::ConstructDetectorGeometry()
692+
void Detector::ConstructDetectorGeometry()
693693
{
694694
// Create the geometry and insert it in the mother volume ITSV
695695
TGeoManager* geoManager = gGeoManager;
@@ -834,7 +834,7 @@ void AliceO2::ITS::Detector::ConstructDetectorGeometry()
834834
}
835835

836836
// Service Barrel
837-
void AliceO2::ITS::Detector::CreateServiceBarrel(const Bool_t innerBarrel, TGeoVolume* dest,
837+
void Detector::CreateServiceBarrel(const Bool_t innerBarrel, TGeoVolume* dest,
838838
const TGeoManager* mgr)
839839
{
840840
// Creates the Service Barrel (as a simple cylinder) for IB and OB
@@ -870,7 +870,7 @@ void AliceO2::ITS::Detector::CreateServiceBarrel(const Bool_t innerBarrel, TGeoV
870870
return;
871871
}
872872

873-
void AliceO2::ITS::Detector::DefineSensitiveVolumes()
873+
void Detector::DefineSensitiveVolumes()
874874
{
875875
TGeoManager* geoManager = gGeoManager;
876876
TGeoVolume* v;
@@ -885,7 +885,7 @@ void AliceO2::ITS::Detector::DefineSensitiveVolumes()
885885
}
886886
}
887887

888-
Point* AliceO2::ITS::Detector::AddHit(Int_t trackID, Int_t detID, TVector3 startPos, TVector3 pos,
888+
Point* Detector::AddHit(Int_t trackID, Int_t detID, TVector3 startPos, TVector3 pos,
889889
TVector3 mom, Double_t startTime, Double_t time,
890890
Double_t length, Double_t eLoss, Int_t shunt)
891891
{
@@ -895,7 +895,7 @@ Point* AliceO2::ITS::Detector::AddHit(Int_t trackID, Int_t detID, TVector3 start
895895
Point(trackID, detID, startPos, pos, mom, startTime, time, length, eLoss, shunt);
896896
}
897897

898-
TParticle* AliceO2::ITS::Detector::GetParticle() const
898+
TParticle* Detector::GetParticle() const
899899
{
900900
// Returns the pointer to the TParticle for the particle that created
901901
// this hit. From the TParticle all kinds of information about this
@@ -910,7 +910,7 @@ TParticle* AliceO2::ITS::Detector::GetParticle() const
910910
return ((AliceO2::Data::Stack*)gMC->GetStack())->GetParticle(GetTrack());
911911
}
912912

913-
void AliceO2::ITS::Detector::Print(ostream* os) const
913+
void Detector::Print(ostream* os) const
914914
{
915915
// Standard output format for this class.
916916
// Inputs:
@@ -948,7 +948,7 @@ void AliceO2::ITS::Detector::Print(ostream* os) const
948948
return;
949949
}
950950

951-
void AliceO2::ITS::Detector::Read(istream* is)
951+
void Detector::Read(istream* is)
952952
{
953953
// Standard input format for this class.
954954
// Inputs:
@@ -965,7 +965,7 @@ void AliceO2::ITS::Detector::Read(istream* is)
965965
return;
966966
}
967967

968-
ostream& operator<<(ostream& os, AliceO2::ITS::Detector& p)
968+
ostream& operator<<(ostream& os, Detector& p)
969969
{
970970
// Standard output streaming function.
971971
// Inputs:
@@ -980,7 +980,7 @@ ostream& operator<<(ostream& os, AliceO2::ITS::Detector& p)
980980
return os;
981981
}
982982

983-
istream& operator>>(istream& is, AliceO2::ITS::Detector& r)
983+
istream& operator>>(istream& is, Detector& r)
984984
{
985985
// Standard input streaming function.
986986
// Inputs:

0 commit comments

Comments
 (0)