Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
first separation T0 V0
  • Loading branch information
AllaMaevskaya committed Mar 29, 2019
commit 0acd64a7cf6d6f32fa65b578087acc967f829da8
1 change: 1 addition & 0 deletions Detectors/FIT/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
add_subdirectory(common)
add_subdirectory(T0)
add_subdirectory(V0)

4 changes: 4 additions & 0 deletions Detectors/FIT/T0/base/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ set(HEADERS
include/${MODULE_NAME}/Geometry.h
)

<<<<<<< HEAD
=======

>>>>>>> first separation T0 V0
Set(LINKDEF src/T0BaseLinkDef.h)
Set(LIBRARY_NAME ${MODULE_NAME})
set(BUCKET_NAME fit_base_bucket)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// 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.

#ifdef __CLING__

#pragma link off all globals;
#pragma link off all classes;
#pragma link off all functions;

#pragma link C++ class o2::t0::Geometry + ;

#endif
49 changes: 31 additions & 18 deletions Detectors/FIT/T0/reconstruction/src/RecPoints.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@ ClassImp(o2::t0::RecPoints);

void RecPoints::FillFromDigits(const o2::fit::Digit& digit)
{
mTimeAmp.clear();
mCollisionTime = {};

Int_t ndigitsC = 0, ndigitsA = 0;
constexpr Int_t nMCPsA = 4 * o2::t0::Geometry::NCellsA;
constexpr Int_t nMCPsC = 4 * o2::t0::Geometry::NCellsC;
constexpr Int_t nMCPs = nMCPsA + nMCPsC;
Float_t cfd[nMCPs] = {}, amp[nMCPs] = {};
Float_t sideAtime = 0, sideCtime = 0;

mBC = digit.getBC();
Expand All @@ -35,28 +37,39 @@ void RecPoints::FillFromDigits(const o2::fit::Digit& digit)

Float_t BCEventTime = 12.5;

mTimeAmp = digit.getChDgData();
for (auto& d : mTimeAmp) {
d.CFDTime -= mEventTime /*- BCEventTime*/;
if (abs(d.CFDTime - BCEventTime) < 2) {
if (d.ChId < nMCPsA) {
sideAtime += d.CFDTime;
ndigitsA++;
} else {
sideCtime += d.CFDTime;
ndigitsC++;
}
}
for (const auto& d : digit.getChDgData()) {
Int_t mcp = d.ChId;
cfd[mcp] = d.CFDTime - mEventTime - BCEventTime;
amp[mcp] = d.QTCAmpl;
mTimeAmp.push_back(ChannelData{ mcp, cfd[mcp], amp[mcp] });
// LOG(DEBUG) << " mcp " << mcp<<" time "<< cfd[mcp]<<" amplitude "<< amp[mcp] << FairLogger::endl;
}

for (Int_t imcp = 0; imcp < nMCPsA; imcp++) {
if (cfd[imcp] > -2 && cfd[imcp] < 2) {
sideAtime += (cfd[imcp]);
ndigitsA++;
}
}
for (Int_t imcp = 0; imcp < nMCPsC; imcp++) {
if (cfd[imcp + nMCPsA] > 0) {
sideCtime += (cfd[imcp + nMCPsA]);
ndigitsC++;
}
}
if (ndigitsA > 0)
mCollisionTime[1] = sideAtime / Float_t(ndigitsA);

sideAtime = sideAtime / Float_t(ndigitsA);
if (ndigitsC > 0)
mCollisionTime[2] = sideCtime / Float_t(ndigitsC);
sideCtime = sideCtime / Float_t(ndigitsC);

if (ndigitsA > 0 && ndigitsC > 0) {
mVertex = (mCollisionTime[1] - mCollisionTime[2]) / 2.;
mCollisionTime[0] = (mCollisionTime[1] + mCollisionTime[2]) / 2.;
if (sideAtime > 0 && sideCtime > 0) {
mVertex = (sideAtime - sideCtime) / 2.;
mCollisionTime[0] = (sideAtime + sideCtime) / 2.;
}
if (sideAtime > 0) {
mCollisionTime[1] = sideAtime;
}
if (sideCtime > 0) {
mCollisionTime[2] = sideCtime;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@

#pragma link C++ class o2::t0::CollisionTimeRecoTask + ;
#pragma link C++ class o2::t0::RecPoints + ;
<<<<<<< HEAD
#pragma link C++ class std::vector < o2::t0::RecPoints > +;
=======
>>>>>>> first separation T0 V0
#pragma link C++ class o2::t0::Channel + ;

#endif
25 changes: 25 additions & 0 deletions Detectors/FIT/T0/simulation/include/T0Simulation/Detector.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,31 @@ class TGraph;
namespace o2
{
namespace t0
<<<<<<< HEAD:Detectors/FIT/T0/simulation/include/T0Simulation/Detector.h
=======
{
class HitType : public o2::BasicXYZEHit<float>
{
public:
using BasicXYZEHit<float>::BasicXYZEHit;
};
} // namespace t0
} // namespace o2

#ifdef USESHM
namespace std
{
template <>
class allocator<o2::t0::HitType> : public o2::utils::ShmAllocator<o2::t0::HitType>
{
};
} // namespace std
#endif

namespace o2
{
namespace t0
>>>>>>> first separation T0 V0:Detectors/FIT/T0/simulation/include/T0Simulation/Detector.h
{
class Geometry;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ inline o2::fit::DigitizationParameters T0DigitizationParameters()
result.mTime_trg_gate = 4.; // ns
result.mAmpThreshold = 100; // number of photoelectrons
result.mTimeDiffAC = (Geometry::ZdetA - Geometry::ZdetC) * TMath::C();
<<<<<<< HEAD
result.mIsT0 = true;
=======
>>>>>>> first separation T0 V0

return result;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ class DigitizerTask : public FairTask
Digitizer mDigitizer; ///< Digitizer
const std::vector<o2::t0::HitType>* mHitsArray = nullptr; ///< Array of MC hits

TBranch* mQEDBranch = nullptr; //! optional special branch of hits from QED collitions
const std::vector<o2::fit::HitType>* mHitsArrayQED = nullptr; //! array of MC hits from ED
float mQEDEntryTimeBinNS = 0.f; ///< every entry in the QED branch integrates QED for so many nanosec.
double mLastQEDTimeNS = 0.; ///< center of the time-bin of last added QED bg slot (entry of mQEDBranch)
int mLastQEDEntry = -1; ///< last used QED entry
UChar_t mQEDSourceID = 0; ///< MC ID source of the QED (stored in the labels)
TBranch* mQEDBranch = nullptr; //! optional special branch of hits from QED collitions
const std::vector<o2::t0::HitType>* mHitsArrayQED = nullptr; //! array of MC hits from ED
float mQEDEntryTimeBinNS = 0.f; ///< every entry in the QED branch integrates QED for so many nanosec.
double mLastQEDTimeNS = 0.; ///< center of the time-bin of last added QED bg slot (entry of mQEDBranch)
int mLastQEDEntry = -1; ///< last used QED entry
UChar_t mQEDSourceID = 0; ///< MC ID source of the QED (stored in the labels)

o2::fit::Digit* mEventDigit = nullptr;
o2::dataformats::MCTruthContainer<o2::fit::MCLabel> mMCTruthArray; //! Labels containter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ struct DigitizationParameters {
Int_t mAmpThreshold; // number of photoelectrons
Float_t mTimeDiffAC;
bool mIsT0; //amplitude T0(true) or V0 (false)

};
} // namespace o2::fit
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,17 @@ class Digitizer
Double_t mEventTime; // timestamp

DigitizationParameters parameters;
<<<<<<< HEAD:Detectors/FIT/common/simulation/include/FITSimulation/Digitizer.h
=======
/*
Float_t mBC_clk_center = 12.5; // clk center
Int_t mMCPs = (Geometry::NCellsA + Geometry::NCellsC) * 4; //number of MCPs
Float_t mCFD_trsh_mip = 0.4; // = 4[mV] / 10[mV/mip]
Float_t mTime_trg_gate = 4.; // ns
Int_t mAmpThreshold = 100; // number of photoelectrons
Float_t mTimeDiffAC = (Geometry::ZdetA - Geometry::ZdetC) * TMath::C();
*/
>>>>>>> first separation T0 V0:Detectors/FIT/common/simulation/include/FITSimulation/Digitizer.h

o2::dataformats::MCTruthContainer<o2::fit::MCLabel>* mMCLabels = nullptr;

Expand Down
2 changes: 2 additions & 0 deletions Detectors/FIT/common/simulation/src/Digitizer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ void Digitizer::process(const std::vector<o2::fit::HitType>* hits, Digit* digit)
}
}

<<<<<<< HEAD:Detectors/FIT/common/simulation/src/Digitizer.cxx
void Digitizer::computeAverage(Digit& digit)
{
constexpr Float_t nPe_in_mip = 250.; // n ph. e. in one mip
Expand All @@ -86,6 +87,7 @@ void Digitizer::computeAverage(Digit& digit)
ch_data.CFDTime /= ch_data.numberOfParticles;
if (parameters.mIsT0)
ch_data.QTCAmpl = ch_data.numberOfParticles / nPe_in_mip;

}
channel_data.erase(std::remove_if(channel_data.begin(), channel_data.end(),
[this](ChannelData const& ch_data) {
Expand Down
9 changes: 5 additions & 4 deletions Steer/DigitizerWorkflow/src/FITDigitizerSpec.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class FITDPLDigitizerTask

LOG(INFO) << "CALLING FIT DIGITIZATION";

static std::vector<o2::fit::HitType> hits;
static std::vector<o2::t0::HitType> hits;
o2::dataformats::MCTruthContainer<o2::MCCompLabel> labelAccum;
o2::dataformats::MCTruthContainer<o2::MCCompLabel> labels;
o2::fit::Digit digit;
Expand All @@ -104,9 +104,9 @@ class FITDPLDigitizerTask
// loop over all composite collisions given from context
// (aka loop over all the interaction records)
for (int collID = 0; collID < timesview.size(); ++collID) {
mDigitizer.setEventTime(timesview[collID].timeNS);
mDigitizer.setOrbit(timesview[collID].orbit);
mDigitizer.setBC(timesview[collID].bc);
mT0Digitizer.setEventTime(timesview[collID].timeNS);
mT0Digitizer.setOrbit(timesview[collID].orbit);
mT0Digitizer.setBC(timesview[collID].bc);
digit.cleardigits();
// for each collision, loop over the constituents event and source IDs
// (background signal merging is basically taking place here)
Expand Down Expand Up @@ -164,6 +164,7 @@ class FITDPLDigitizerTask
o2::detectors::DetID mID;
o2::header::DataOrigin mOrigin = o2::header::gDataOriginInvalid;
o2::fit::Digitizer mDigitizer; ///< Digitizer

//Digitizer mV0Digitizer; ///< Digitizer
// RS: at the moment using hardcoded flag for continuos readout
o2::parameters::GRPObject::ROMode mROMode = o2::parameters::GRPObject::CONTINUOUS; // readout mode
Expand Down
2 changes: 1 addition & 1 deletion macro/build_geometry.C
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ void build_geometry(FairRunSim* run = nullptr)
}

// TODO: Fix this typo ("T0"->"V0"), after fixing the o2::v0::Detector constructor - so that it does not cause o2sim crash
if (isActivated("T0")) {
if (isActivated("V0")) {
// FIT-V0
run->AddModule(new o2::v0::Detector(true));
}
Expand Down
5 changes: 5 additions & 0 deletions run/O2HitMerger.h
Original file line number Diff line number Diff line change
Expand Up @@ -467,12 +467,17 @@ void O2HitMerger::initDetInstances()
mDetectorInstances[i] = std::move(std::make_unique<o2::tof::Detector>(true));
counter++;
}
<<<<<<< HEAD
if (i == DetID::T0) {
mDetectorInstances[i] = std::move(std::make_unique<o2::t0::Detector>(true));
counter++;
}
if (i == DetID::V0) {
mDetectorInstances[i] = std::move(std::make_unique<o2::v0::Detector>(true));
=======
if (i == DetID::FIT) {
mDetectorInstances[i] = std::move(std::make_unique<o2::t0::Detector>(true));
>>>>>>> first separation T0 V0
counter++;
}
if (i == DetID::MCH) {
Expand Down