Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ class DetID
static constexpr ID MCH = 9;
static constexpr ID MID = 10;
static constexpr ID ZDC = 11;
static constexpr ID FIT = 12;
static constexpr ID ACO = 13;
static constexpr ID T0 = 12;
static constexpr ID V0 = 13;
static constexpr ID ACO = 14;
static constexpr ID First = ITS;
static constexpr ID Last = ACO; ///< if extra detectors added, update this !!!

Expand Down Expand Up @@ -105,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", "FIT", "ACO", 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(FIT), utils::bit2Mask(ACO) };
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::FIT, DetID::ACO, 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
3 changes: 2 additions & 1 deletion DataFormats/Headers/include/Headers/DataHeader.h
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,8 @@ constexpr o2::header::DataOrigin gDataOriginACO{ "ACO" };
constexpr o2::header::DataOrigin gDataOriginCPV{ "CPV" };
constexpr o2::header::DataOrigin gDataOriginCTP{ "CTP" };
constexpr o2::header::DataOrigin gDataOriginEMC{ "EMC" };
constexpr o2::header::DataOrigin gDataOriginFIT{ "FIT" };
constexpr o2::header::DataOrigin gDataOriginT0{ "T0" };
constexpr o2::header::DataOrigin gDataOriginV0{ "V0" };
constexpr o2::header::DataOrigin gDataOriginHMP{ "HMP" };
constexpr o2::header::DataOrigin gDataOriginITS{ "ITS" };
constexpr o2::header::DataOrigin gDataOriginMCH{ "MCH" };
Expand Down
7 changes: 4 additions & 3 deletions Detectors/FIT/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Libraries
add_subdirectory(base)
add_subdirectory(simulation)
add_subdirectory(reconstruction)
add_subdirectory(common)
add_subdirectory(T0)
add_subdirectory(V0)

4 changes: 4 additions & 0 deletions Detectors/FIT/T0/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Libraries
add_subdirectory(base)
add_subdirectory(simulation)
add_subdirectory(reconstruction)
22 changes: 22 additions & 0 deletions Detectors/FIT/T0/base/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
set(MODULE_NAME "T0Base")

O2_SETUP(NAME ${MODULE_NAME})

set(SRCS
src/Geometry.cxx
)

set(HEADERS
include/${MODULE_NAME}/Geometry.h
)

Set(LINKDEF src/T0BaseLinkDef.h)
Set(LIBRARY_NAME ${MODULE_NAME})
set(BUCKET_NAME fit_base_bucket)

O2_GENERATE_LIBRARY()

install(
DIRECTORY files
DESTINATION share/Detectors/T0/
)
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <TVector3.h>
namespace o2
{
namespace fit
namespace t0
{
// FIT is not tracking detector, Geometry could be used in future but not now. So just simple settings
class Geometry
Expand Down Expand Up @@ -52,6 +52,6 @@ class Geometry

ClassDefNV(Geometry, 1);
};
} // namespace fit
} // namespace t0
} // namespace o2
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
// or submit itself to any jurisdiction.
#include <iomanip>
//#include <TVector3.h>
#include "FITBase/Geometry.h"
#include "T0Base/Geometry.h"

#include <FairLogger.h>
#include <sstream>

ClassImp(o2::fit::Geometry);
ClassImp(o2::t0::Geometry);

using namespace o2::fit;
using namespace o2::t0;

Geometry::Geometry() : mMCP{ { 0, 0, 0 } }
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
#pragma link off all classes;
#pragma link off all functions;

#pragma link C++ class o2::fit::CollisionTimeRecoTask+;
#pragma link C++ class o2::fit::RecPoints+;
#pragma link C++ class o2::fit::Channel+;
#pragma link C++ class o2::t0::Geometry + ;

#endif
19 changes: 19 additions & 0 deletions Detectors/FIT/T0/base/src/T0BaseLinkDef.h~HEAD
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
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
87 changes: 87 additions & 0 deletions Detectors/FIT/T0/macros/readHitsDigits.C
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
#if !defined(__CLING__) || defined(__ROOTCLING__)
#include "FITSimulation/Detector.h"
#include "FITBase/Digit.h"
#include <TH2F.h>
#endif

void readHitsDigits()
{
using namespace o2::fit;
// using namespace o2::fit::Digit;

// Create histograms
TDirectory* cwd = gDirectory;
gDirectory = 0x0;

TH2F* hMultHit = new TH2F("hMultHits", "photons Hits ", 210, 0, 210, 500, 0, 5000);
TH2F* hTimeHit = new TH2F("hTimeAChit", "Time Hits", 210, 0, 210, 1000, 0, 15);
TH2F* hMultDig = new TH2F("hMultDig", "photons Digits ", 210, 0, 210, 500, 0, 20);
TH2F* hTimeDig = new TH2F("hTimeDig", "Time Digits", 210, 0, 210, 300, 0, 15);

gDirectory = cwd;

TFile* fhit = new TFile("o2sim.root");
TTree* hitTree = (TTree*)fhit->Get("o2sim");
std::vector<HitType>* hitArray = nullptr;
hitTree->SetBranchAddress("FITHit", &hitArray);
Int_t nevH = hitTree->GetEntries(); // hits are stored as one event per entry
std::cout << "Found " << nevH << " events with hits " << std::endl;

Double_t hit_time[240];
Int_t countE[240];
// Event ------------------------- LOOP
for (Int_t ievent = 0; ievent < nevH; ievent++) {
hitTree->GetEntry(ievent);
for (int ii = 0; ii < 240; ii++) {
countE[ii] = 0;
hit_time[ii] = 0;
}
for (auto& hit : *hitArray) {
Int_t detID = hit.GetDetectorID();
hit_time[detID] = hit.GetTime();
hTimeHit->Fill(detID, hit_time[detID]);
if (hit_time[detID] < 10 && detID < 96)
std::cout << ievent << " " << detID << " time " << hit_time[detID] << endl;

countE[detID]++;
}
for (int ii = 0; ii < 208; ii++) {
if (countE[ii] > 100) {
hMultHit->Fill(ii, countE[ii]);
// std::cout<<ii<<" "<<countE[ii]<<endl;
}
}
}
TFile* fdig = TFile::Open("o2sim_digi.root");
std::cout << " Open digits file " << std::endl;
TTree* digTree = (TTree*)fdig->Get("o2sim");
o2::fit::Digit* digArr = new Digit;
digTree->SetBranchAddress("FITDigit", &digArr);
Int_t nevD = digTree->GetEntries(); // digits in cont. readout may be grouped as few events per entry
std::cout << "Found " << nevD << " events with digits " << std::endl;
Float_t cfd[208], amp[208];
for (Int_t iev = 0; iev < nevD; iev++) {
digTree->GetEvent(iev);
for (int ii = 0; ii < 208; ii++) {
cfd[ii] = amp[ii] = 0;
}
for (const auto& d : digArr->getChDgData()) {
Int_t mcp = d.ChId;
cfd[mcp] = d.CFDTime;
amp[mcp] = d.QTCAmpl;
// cout<<iev<<" "<<mcp<<" "<< cfd[mcp]<<" "<< amp[mcp]<<endl;
hMultDig->Fill(Float_t(mcp), amp[mcp]);
hTimeDig->Fill(Float_t(mcp), cfd[mcp]);
}
}
TFile* Hfile = new TFile("FigFit_dig_pp.root", "RECREATE");
printf("Writting histograms to root file \n");
Hfile->cd();
//Create a canvas, set the view range, show histograms
// TCanvas *c1 = new TCanvas("c1","Alice T0 Time ",400,10,600,600);
hTimeHit->Write();
hMultHit->Write();
hTimeDig->Write();
hMultDig->Write();

} // end of macro
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(MODULE_NAME "FITReconstruction")
set(MODULE_NAME "T0Reconstruction")

O2_SETUP(NAME ${MODULE_NAME})

Expand All @@ -13,7 +13,7 @@ set(HEADERS
)


Set(LINKDEF src/FITReconstructionLinkDef.h)
Set(LINKDEF src/T0ReconstructionLinkDef.h)
Set(LIBRARY_NAME ${MODULE_NAME})
set(BUCKET_NAME fit_reconstruction_bucket)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,22 @@

#include <vector>
#include "FITBase/Digit.h"
#include "FITReconstruction/RecPoints.h"
#include "T0Reconstruction/RecPoints.h"
namespace o2
{
namespace fit
namespace t0
{
class CollisionTimeRecoTask
{
public:
CollisionTimeRecoTask() = default;
~CollisionTimeRecoTask() = default;
void Process(const Digit& digits, RecPoints& recPoints) const;
void Process(const o2::fit::Digit& digits, RecPoints& recPoints) const;
void FinishTask();

private:
ClassDefNV(CollisionTimeRecoTask, 1);
};
} // namespace fit
} // namespace t0
} // namespace o2
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

namespace o2
{
namespace fit
namespace t0
{
struct Channel {
Int_t index;
Expand All @@ -34,15 +34,15 @@ class RecPoints
RecPoints() = default;
RecPoints(const std::array<Float_t, 3>& collisiontime,
Float_t vertex,
std::vector<ChannelData> timeamp)
std::vector<o2::fit::ChannelData> timeamp)
: mCollisionTime(collisiontime),
mVertex(vertex),
mTimeAmp(std::move(timeamp))
{
}
~RecPoints() = default;

void FillFromDigits(const Digit& digit);
void FillFromDigits(const o2::fit::Digit& digit);
Float_t GetCollisionTime(int side) const { return mCollisionTime[side]; }
void setCollisionTime(Float_t time, int side) { mCollisionTime[side] = time; }

Expand All @@ -56,20 +56,20 @@ class RecPoints
void setBC(Int_t bc) { mBC = bc; }
void setOrbit(Int_t orbit) { mOrbit = orbit; }

const std::vector<ChannelData>& getChDgData() const { return mTimeAmp; }
void setChDgData(const std::vector<ChannelData>& TimeAmp) { mTimeAmp = TimeAmp; }
void setChDgData(std::vector<ChannelData>&& TimeAmp) { mTimeAmp = std::move(TimeAmp); }
const std::vector<o2::fit::ChannelData>& getChDgData() const { return mTimeAmp; }
void setChDgData(const std::vector<o2::fit::ChannelData>& TimeAmp) { mTimeAmp = TimeAmp; }
void setChDgData(std::vector<o2::fit::ChannelData>&& TimeAmp) { mTimeAmp = std::move(TimeAmp); }

private:
std::array<Float_t, 3> mCollisionTime;
Float_t mVertex = 0;
Double_t mEventTime; //event time from Fair for continuous
std::vector<ChannelData> mTimeAmp;
std::vector<o2::fit::ChannelData> mTimeAmp;
Int_t mBC = 0; // BC from digits
Int_t mOrbit = 0; // orbit from digits

ClassDefNV(RecPoints, 1);
};
} // namespace fit
} // namespace t0
} // namespace o2
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
/// \file CollisionTimeRecoTask.cxx
/// \brief Implementation of the FIT reconstruction task

#include "FITReconstruction/CollisionTimeRecoTask.h"
#include "FairLogger.h" // for LOG

#include "T0Reconstruction/CollisionTimeRecoTask.h"
#include "FairLogger.h" // for LOG

using namespace o2::t0;
using namespace o2::fit;
/*
//_____________________________________________________________________
Expand All @@ -29,7 +29,7 @@ CollisionTimeRecoTask::CollisionTimeRecoTask()
void CollisionTimeRecoTask::Process(const Digit& digits,
RecPoints& recPoints) const
{
LOG(INFO) << "Running reconstruction on new event" << FairLogger::endl;
// LOG(INFO) << "Running reconstruction on new event" << FairLogger::endl;
recPoints.FillFromDigits(digits);
}
//________________________________________________________
Expand Down
Loading