Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
195f1c2
first separation T0 V0
AllaMaevskaya Jan 18, 2019
4b6daad
T0 simulation works with this
AllaMaevskaya Jan 22, 2019
2e5709a
move Hit to common
AllaMaevskaya Jan 23, 2019
9abcec9
T0 digitzation as a part of FIT
AllaMaevskaya Jan 26, 2019
15dc66a
add run_reco_t0
AllaMaevskaya Feb 6, 2019
cb8dc52
Added V0: Detector and Geometry classes; no proper hits yet
mslupeck Mar 19, 2019
0acd64a
first separation T0 V0
AllaMaevskaya Jan 18, 2019
83f3b13
T0 simulation works with this
AllaMaevskaya Jan 22, 2019
f1b2bfa
move Hit to common
AllaMaevskaya Jan 23, 2019
a8f333c
T0 digitzation as a part of FIT
AllaMaevskaya Jan 26, 2019
8553ebd
add run_reco_t0
AllaMaevskaya Feb 6, 2019
8100ae2
first separation T0 V0
AllaMaevskaya Jan 18, 2019
d748e72
T0 simulation works with this
AllaMaevskaya Jan 22, 2019
9d0e919
move Hit to common
AllaMaevskaya Jan 23, 2019
a75c6e1
T0 digitzation as a part of FIT
AllaMaevskaya Jan 26, 2019
419cfdc
add run_reco_t0
AllaMaevskaya Feb 6, 2019
297b9f7
remove <<<< after mergeing
AllaMaevskaya Mar 28, 2019
314bd43
fix conflict
AllaMaevskaya Mar 29, 2019
a04fde0
merge with V0
AllaMaevskaya Mar 29, 2019
dcb3915
Fixed material definition in FIT-V0+
mslupeck Mar 30, 2019
ffa30ca
Merge pull request #6 from mslupeck/dev
AllaMaevskaya Mar 30, 2019
a705103
clang fixed
AllaMaevskaya Mar 30, 2019
0290ee5
explicit added
AllaMaevskaya Mar 31, 2019
ab36798
remove empty line in HitMerger.h: clang complains
AllaMaevskaya Mar 31, 2019
1ead442
remove unused macros
AllaMaevskaya Mar 31, 2019
939e2a2
fix T0 part
AllaMaevskaya Mar 31, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix conflict
  • Loading branch information
AllaMaevskaya committed Mar 29, 2019
commit 314bd4392cf9f23806e216ba934668875ce28fbd
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ class DetID
static constexpr ID MID = 10;
static constexpr ID ZDC = 11;
static constexpr ID T0 = 12;
static constexpr ID ACO = 13;
static constexpr ID V0 = 14;
static constexpr ID V0 = 13;
static constexpr ID ACO = 14;
static constexpr ID First = ITS;
static constexpr ID Last = V0; ///< if extra detectors added, update this !!!
static constexpr ID Last = ACO; ///< if extra detectors added, update this !!!

static constexpr int nDetectors = Last + 1; ///< number of defined detectors

Expand Down Expand Up @@ -106,13 +106,14 @@ class DetID
ID mID = First; ///< detector ID

static constexpr const char* sDetNames[nDetectors + 1] = ///< defined detector names
{ "ITS", "TPC", "TRD", "TOF", "PHS", "CPV", "EMC", "HMP", "MFT", "MCH", "MID", "ZDC", "T0", "ACO", "V0", nullptr };

{ "ITS", "TPC", "TRD", "TOF", "PHS", "CPV", "EMC", "HMP", "MFT", "MCH", "MID", "ZDC", "T0", "V0", "ACO", nullptr };

// detector names, will be defined in DataSources
static constexpr std::array<mask_t, nDetectors> sMasks = ///< detectot masks
{ utils::bit2Mask(ITS), utils::bit2Mask(TPC), utils::bit2Mask(TRD), utils::bit2Mask(TOF), utils::bit2Mask(PHS),
utils::bit2Mask(CPV), utils::bit2Mask(EMC), utils::bit2Mask(HMP), utils::bit2Mask(MFT), utils::bit2Mask(MCH),
utils::bit2Mask(MID), utils::bit2Mask(ZDC), utils::bit2Mask(T0), utils::bit2Mask(ACO), utils::bit2Mask(V0) };
utils::bit2Mask(MID), utils::bit2Mask(ZDC), utils::bit2Mask(T0), utils::bit2Mask(V0), utils::bit2Mask(ACO) };

ClassDefNV(DetID, 1);
};
Expand Down
2 changes: 1 addition & 1 deletion DataFormats/Detectors/Common/src/DetID.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ constexpr std::array<DetID::mask_t, DetID::nDetectors> DetID::sMasks;

// redundant declarations
constexpr DetID::ID DetID::ITS, DetID::TPC, DetID::TRD, DetID::TOF, DetID::PHS, DetID::CPV, DetID::EMC,
DetID::HMP, DetID::MFT, DetID::MCH, DetID::MID, DetID::ZDC, DetID::T0, DetID::ACO, DetID::V0, DetID::First, DetID::Last;
DetID::HMP, DetID::MFT, DetID::MCH, DetID::MID, DetID::ZDC, DetID::T0, DetID::V0, DetID::ACO, DetID::First, DetID::Last;

constexpr int DetID::nDetectors;

Expand Down
20 changes: 10 additions & 10 deletions Detectors/FIT/V0/base/include/V0Base/Geometry.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,18 @@ namespace v0
class Geometry
{
public:
enum EGeoType {
eUninitilized,
eDummy,
eOnlySensitive,
eFull
}; // Geometry type options possible to be initialized
enum EGeoType {
eUninitilized,
eDummy,
eOnlySensitive,
eFull
}; // Geometry type options possible to be initialized

///
/// Default constructor.
/// It must be kept public for root persistency purposes,
/// but should never be called by the outside world
Geometry(){mGeometryType = eUninitilized;};
Geometry() { mGeometryType = eUninitilized; };
/// Standard constructor
/// \param initType[in] The type of geometry, that will be initialized
/// -> initType == 0 => only sensitive detector parts
Expand All @@ -50,7 +50,7 @@ class Geometry
/// Copy constructor.
Geometry(const Geometry& geom);

static constexpr float sEpsilon = 0.01; // variable used to make sure one spatial dimension is infinitesimaly larger than the other
static constexpr float sEpsilon = 0.01; // variable used to make sure one spatial dimension is infinitesimaly larger than the other
static constexpr float sDrSeparationScint = 0.03 + 0.04; // paint thickness + separation gap
static constexpr float sDzScint = 2;
static constexpr float sPhiMinScint = 0;
Expand All @@ -60,14 +60,14 @@ class Geometry
static constexpr int sBaseNumberOfSectors = 8; // number of sectors
// TODO: Adjust the sZposition once the simulation geometry is implemented, T0 starts at 328
// at sZposition==320, there is a gap (to be filled with fibers and support) of 8 cm between the plastic of V0+ and aluminum covers of T0+
static constexpr float sZposition = 320-sDzScint; // z-position of the geometrical center of the detectors sensitive part
static constexpr float sZposition = 320 - sDzScint; // z-position of the geometrical center of the detectors sensitive part

private:
void initializeVectors();
void initializeLuts();

void buildGeometry();
void assembleSectors(TGeoVolumeAssembly *volV0);
void assembleSectors(TGeoVolumeAssembly* volV0);
TGeoVolumeAssembly* buildSector(uint16_t iSector);

std::vector<float> mvrAvgScint; // average ring radii (index 0 -> ring 1 min, index 1 -> ring 1 max and ring 2 min, ... index 5 -> ring 5 max)
Expand Down
4 changes: 2 additions & 2 deletions Detectors/FIT/V0/base/src/Geometry.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ void Geometry::buildGeometry(){
}

TGeoVolumeAssembly* Geometry::buildSector(uint16_t iSector){
TGeoBBox *geoBoxClockwise = new TGeoBBox("boolBoxScintSeparator", mvrMaxScint.at(mvrMaxScint.size()-1), sDySeparationScint*2, sDzScint+sEpsilon);
new TGeoBBox("boolBoxScintSeparator", mvrMaxScint.at(mvrMaxScint.size()-1), sDySeparationScint*2, sDzScint+sEpsilon);

std::stringstream ssName;
ssName << "sector" << iSector+1;
Expand All @@ -94,7 +94,7 @@ TGeoVolumeAssembly* Geometry::buildSector(uint16_t iSector){
ssNameGeoComposite << "cellGeoComposite" << iCell+1;

// Generate separation between sectors by subtracting two cuboids from each tube segment
TGeoTubeSeg *geoCellTube = new TGeoTubeSeg(ssNameGeoTube.str().c_str(), mvrMinScint.at(ir), mvrMaxScint.at(ir), sDzScint, sPhiMinScint, sDphiScint);
new TGeoTubeSeg(ssNameGeoTube.str().c_str(), mvrMinScint.at(ir), mvrMaxScint.at(ir), sDzScint, sPhiMinScint, sDphiScint);
std::string booleanFormula = "(";
booleanFormula += ssNameGeoTube.str() + "-boolBoxScintSeparator)"; // subtract counter-clockwise box
booleanFormula += (std::string)"-boolBoxScintSeparator" + ":rotPhiSector1"; // subtract clockwise box (same but rotated by 45 degrees)
Expand Down
30 changes: 18 additions & 12 deletions Detectors/FIT/V0/simulation/include/V0Simulation/Detector.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,18 @@ class Detector : public o2::Base::DetImpl<Detector>
/// This method is called for each step during simulation (see FairMCApplication::Stepping())
Bool_t ProcessHits(FairVolume* v = nullptr) override;

// ------------------------------------------------------------------
// ------------------------------------------------------------------

/// Registers the produced collections in FAIRRootManager
void Register() override;

std::vector<o2::v0::Hit>* getHits(Int_t iColl) {if (iColl == 0) {return mHits;} return nullptr;}
std::vector<o2::v0::Hit>* getHits(Int_t iColl)
{
if (iColl == 0) {
return mHits;
}
return nullptr;
}
/// Gets the produced hits

/// Has to be called after each event to reset the containers
Expand All @@ -78,13 +84,13 @@ class Detector : public o2::Base::DetImpl<Detector>
/// Called at the end of event
void EndOfEvent() override;

// TODO: From MFT -> are they needed?
// void FinishPrimary() override { ; }
// void FinishRun() override { ; }
// void BeginPrimary() override { ; }
// void PostTrack() override { ; }
// void PreTrack() override { ; }
// void SetSpecialPhysicsCuts() override { ; }
// TODO: From MFT -> are they needed?
// void FinishPrimary() override { ; }
// void FinishRun() override { ; }
// void BeginPrimary() override { ; }
// void PostTrack() override { ; }
// void PreTrack() override { ; }
// void SetSpecialPhysicsCuts() override { ; }

// TODO: move to private
/// Creates materials for the detector
Expand Down Expand Up @@ -116,9 +122,9 @@ class Detector : public o2::Base::DetImpl<Detector>
} mTrackData; //!

o2::v0::Hit* addHit(Int_t trackId, Int_t cellId, Int_t particleId,
TVector3 startPos, TVector3 endPos,
TVector3 startMom, double startE,
double endTime, double eLoss, float eTot, float eDep);
TVector3 startPos, TVector3 endPos,
TVector3 startMom, double startE,
double endTime, double eLoss, float eTot, float eDep);

template <typename Det>
friend class o2::Base::DetImpl;
Expand Down
105 changes: 54 additions & 51 deletions Detectors/FIT/V0/simulation/include/V0Simulation/Hit.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,57 +14,59 @@
#ifndef ALICEO2_FIT_V0_HIT_H_
#define ALICEO2_FIT_V0_HIT_H_

#include "SimulationDataFormat/BaseHits.h" // for BasicXYZEHit
#include "Rtypes.h" // for Bool_t, Double_t, Int_t, Double32_t, etc
#include "TVector3.h" // for TVector3
#include "SimulationDataFormat/BaseHits.h" // for BasicXYZEHit
#include "Rtypes.h" // for Bool_t, Double_t, Int_t, Double32_t, etc
#include "TVector3.h" // for TVector3
#include <iosfwd>
#include "CommonUtils/ShmAllocator.h"

namespace o2 {
namespace v0 {
namespace o2
{
namespace v0
{

class Hit : public o2::BasicXYZEHit<Float_t,Float_t>
class Hit : public o2::BasicXYZEHit<Float_t, Float_t>
{
public:

/// Default constructor
Hit() = default;

/// Class Constructor
/// \param trackID Index of MCTrack
/// \param cellID Cell ID
/// \param startPos Coordinates at entrance to active volume [cm]
/// \param pos Coordinates to active volume [cm]
/// \param mom Momentum of track at entrance [GeV]
/// \param endTime Time at entrance [ns]
/// \param time Time since event start [ns]
/// \param eLoss Energy deposit [GeV]
/// \param startStatus: status at entrance
/// \param endStatus: status at exit
inline Hit(int trackID, int cellID, const TVector3& startPos, const TVector3& endPos,
const TVector3& startMom, double startE, double endTime, double eLoss,
float eTot, float eDep); // last two are for testing only

// Entrance position getters
Point3D<Float_t> GetPosStart() const { return mPosStart; }
Float_t GetStartX() const { return mPosStart.X(); }
Float_t GetStartY() const { return mPosStart.Y(); }
Float_t GetStartZ() const { return mPosStart.Z(); }
template<typename F> void GetStartPosition(F &x, F &y, F &z) const
{
x = GetStartX();
y = GetStartY();
z = GetStartZ();
}
// momentum getters
Vector3D<Float_t> GetMomentum() const { return mMomentum; }
Vector3D<Float_t>& GetMomentum() { return mMomentum; }
Float_t GetPx() const { return mMomentum.X(); }
Float_t GetPy() const { return mMomentum.Y(); }
Float_t GetPz() const { return mMomentum.Z(); }
Float_t GetE() const { return mE; }
Float_t GetTotalEnergy() const { return GetE(); }
/*
public:
/// Default constructor
Hit() = default;

/// Class Constructor
/// \param trackID Index of MCTrack
/// \param cellID Cell ID
/// \param startPos Coordinates at entrance to active volume [cm]
/// \param pos Coordinates to active volume [cm]
/// \param mom Momentum of track at entrance [GeV]
/// \param endTime Time at entrance [ns]
/// \param time Time since event start [ns]
/// \param eLoss Energy deposit [GeV]
/// \param startStatus: status at entrance
/// \param endStatus: status at exit
inline Hit(int trackID, int cellID, const TVector3& startPos, const TVector3& endPos,
const TVector3& startMom, double startE, double endTime, double eLoss,
float eTot, float eDep); // last two are for testing only

// Entrance position getters
Point3D<Float_t> GetPosStart() const { return mPosStart; }
Float_t GetStartX() const { return mPosStart.X(); }
Float_t GetStartY() const { return mPosStart.Y(); }
Float_t GetStartZ() const { return mPosStart.Z(); }
template <typename F>
void GetStartPosition(F& x, F& y, F& z) const
{
x = GetStartX();
y = GetStartY();
z = GetStartZ();
}
// momentum getters
Vector3D<Float_t> GetMomentum() const { return mMomentum; }
Vector3D<Float_t>& GetMomentum() { return mMomentum; }
Float_t GetPx() const { return mMomentum.X(); }
Float_t GetPy() const { return mMomentum.Y(); }
Float_t GetPz() const { return mMomentum.Z(); }
Float_t GetE() const { return mE; }
Float_t GetTotalEnergy() const { return GetE(); }
/*
UChar_t GetStatusEnd() const { return mTrackStatusEnd; }
UChar_t GetStatusStart() const { return mTrackStatusStart; }

Expand Down Expand Up @@ -93,12 +95,12 @@ class Hit : public o2::BasicXYZEHit<Float_t,Float_t>
return of;
}
*/
void Print(const Option_t *opt) const;
void Print(const Option_t* opt) const;

private:
Vector3D<Float_t> mMomentum; ///< momentum at entrance
Point3D<Float_t> mPosStart; ///< position at entrance (base mPos give position on exit)
Float_t mE; ///< total energy at entrance
Vector3D<Float_t> mMomentum; ///< momentum at entrance
Point3D<Float_t> mPosStart; ///< position at entrance (base mPos give position on exit)
Float_t mE; ///< total energy at entrance

ClassDefNV(Hit, 1)
};
Expand All @@ -111,7 +113,8 @@ Hit::Hit(int trackID, int detID, const TVector3& startPos, const TVector3& endPo
mPosStart(startPos.X(), startPos.Y(), startPos.Z()),
mE(startE)
// TODO: may require adding initialization to eTot and eDep and corresponding fields in the Hit.h header
{}
{
}

} // namespace v0
} // namespace o2
Expand Down
2 changes: 1 addition & 1 deletion Detectors/FIT/V0/simulation/src/V0SimulationLinkDef.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
#pragma link off all functions;

#pragma link C++ class o2::v0::Detector + ;
#pragma link C++ class o2::Base::DetImpl < o2::v0::Detector > +;
#pragma link C++ class o2::Base::DetImpl < o2::v0::Detector> + ;

#endif
39 changes: 39 additions & 0 deletions Detectors/FIT/common/simulation/include/FITSimulation/MCLabel.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// Copyright CERN and copyright holders of ALICE O2. This software is
// distributed under the terms of the GNU General Public License v3 (GPL
// Version 3), copied verbatim in the file "COPYING".
//
// See http://alice-o2.web.cern.ch/license for full licensing information.
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

// Declaration of a transient MC label class for FIT

#ifndef ALICEO2_FIT_MCLABEL_H_
#define ALICEO2_FIT_MCLABEL_H_

#include "SimulationDataFormat/MCCompLabel.h"

namespace o2
{
namespace fit
{
class MCLabel : public o2::MCCompLabel
{
private:
Int_t mDetID = -1;

public:
MCLabel() = default;
MCLabel(Int_t trackID, Int_t eventID, Int_t srcID, Int_t qID)
: o2::MCCompLabel(trackID, eventID, srcID), mDetID(qID) {}

Int_t getDetID() const { return mDetID; }

ClassDefNV(MCLabel, 1);
};
} // namespace fit
} // namespace o2

#endif
1 change: 1 addition & 0 deletions Framework/Core/src/DataProcessingStatus.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ enum struct DriverStatus : uint32_t {
BYTES_READ = 0,
BYTES_PROCESSED = 1,
BUFFER_OVERFLOWS = 2

};

} // namespace framework
Expand Down
1 change: 0 additions & 1 deletion macro/build_geometry.C
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ void build_geometry(FairRunSim* run = nullptr)
run->AddModule(new o2::t0::Detector(true));
}

// TODO: Fix this typo ("T0"->"V0"), after fixing the o2::v0::Detector constructor - so that it does not cause o2sim crash
if (isActivated("V0")) {
// FIT-V0
run->AddModule(new o2::v0::Detector(true));
Expand Down