Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
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
93 changes: 93 additions & 0 deletions Detectors/FIT/T0/macros/readHitsDigits.C
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
#if !defined(__CLING__) || defined(__ROOTCLING__)
#include "FITBase/Digit.h"
#include "FITSimulation/HitType.h"
#include <TH2F.h>
#include <TTree.h>
#include <TFile.h>
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* hTimeHitA = new TH2F("hTimeAhit", "Time Hits", 210, 0, 210, 1000, 11, 12);
TH2F* hTimeHitC = new TH2F("hTimeChit", "Time Hits", 210, 0, 210, 1000, 2.8, 3.8);
TH2F* hMultDig = new TH2F("hMultDig", "photons Digits ", 210, 0, 210, 500, 0, 20);
TH2F* hTimeDig = new TH2F("hTimeDig", "Time Digits", 210, 0, 210, 100, -1, 1);

gDirectory = cwd;

TFile* fhit = new TFile("o2sim.root");
TTree* hitTree = (TTree*)fhit->Get("o2sim");
std::vector<o2::fit::HitType>* hitArray = nullptr;
hitTree->SetBranchAddress("T0Hit", &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();
hTimeHitA->Fill(detID, hit_time[detID]);
hTimeHitC->Fill(detID, hit_time[detID]);
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("t0digits.root");
std::cout << " Open digits file " << std::endl;
TTree* digTree = (TTree*)fdig->Get("o2sim");
std::vector<o2::fit::Digit>* digArr = new std::vector<Digit>;
digTree->SetBranchAddress("T0Digit", &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], part[208];
for (Int_t iev = 0; iev < nevD; iev++) {
digTree->GetEvent(iev);
for (const auto& digit : *digArr) {
for (int ii = 0; ii < 208; ii++) {
cfd[ii] = amp[ii] = 0;
}
Double_t evtime = digit.getTime();
for (const auto& d : digit.getChDgData()) {
Int_t mcp = d.ChId;
cfd[mcp] = d.CFDTime - evtime - 12.5;
amp[mcp] = d.QTCAmpl;
part[mcp] = d.numberOfParticles;
// cout << iev << " " << mcp << " " << cfd[mcp] << " " << amp[mcp] << " " << part[mcp] << endl;
hMultDig->Fill(Float_t(mcp), amp[mcp]);
hTimeDig->Fill(Float_t(mcp), cfd[mcp]);
}
}
}
TFile* Hfile = new TFile("FigFit_hits_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);
hTimeHitA->Write();
hTimeHitC->Write();
hMultHit->Write();
hTimeDig->Write();
hMultDig->Write();

} // end of macro
#endif
72 changes: 72 additions & 0 deletions Detectors/FIT/T0/macros/run_reco_t0.C
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#if !defined(__CLING__) || defined(__ROOTCLING__)
#include <Rtypes.h>
#include <TString.h>
#include <TStopwatch.h>
#include <TGeoManager.h>
#include <TFile.h>
#include <TTree.h>
#include <iostream>

#include "FairLogger.h"

#include "T0Reconstruction/CollisionTimeRecoTask.h"
#include "T0Reconstruction/RecPoints.h"
#include "FITBase/Digit.h"
#endif

void run_reco_t0(std::string inpudDig = "t0digits.root",
std::string outName = "o2reco_t0.root",
std::string inputGRP = "o2sim_grp.root")
{

// Initialize logger
FairLogger* logger = FairLogger::GetLogger();
logger->SetLogVerbosityLevel("LOW");
logger->SetLogScreenLevel("DEBUG");

// Setup timer
TStopwatch timer;

TFile* fdig = TFile::Open("t0digits.root");
std::cout << " Open digits file " << std::endl;
TTree* digTree = (TTree*)fdig->Get("o2sim");
digTree->Print();
std::vector<o2::fit::Digit>* digits = new std::vector<o2::fit::Digit>;
digTree->SetBranchAddress("T0Digit", &digits);
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;

//std::vector<o2::fit::RecPoints> recPoints;
std::vector<o2::t0::RecPoints>* recPointsP = new std::vector<o2::t0::RecPoints>;

TFile outFile(outName.c_str(), "recreate");
TTree outTree("o2sim", "T0RecPoints");
outTree.Branch("T0Cluster", &recPointsP);

o2::t0::CollisionTimeRecoTask recoFIT;
timer.Start();
for (int iEv = 0; iEv < nevD; iEv++) {
digTree->GetEntry(iEv);
recPointsP->resize(digits->size());
for (size_t collID = 0; collID < digits->size(); ++collID)
recoFIT.Process((*digits)[collID], (*recPointsP)[collID]);
outTree.Fill();
}

outTree.Print();
outFile.ls();
timer.Stop();
outTree.Write();
Double_t rtime = timer.RealTime();
Double_t ctime = timer.CpuTime();

Float_t cpuUsage = ctime / rtime;
std::cout << "<DartMeasurement name=\"CpuLoad\" type=\"numeric/double\">";
std::cout << cpuUsage;
std::cout << "</DartMeasurement>" << std::endl;
std::cout << "Macro finished succesfully." << std::endl;

std::cout << "Real time " << rtime << " s, CPU time " << ctime
<< "s" << std::endl
<< std::endl;
}
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
Loading