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,7 +58,7 @@ 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 T0 = 12;
static constexpr ID ACO = 13;
static constexpr ID First = ITS;
static constexpr ID Last = ACO; ///< if extra detectors added, update this !!!
Expand Down Expand Up @@ -105,13 +105,13 @@ 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", "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(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::ACO, DetID::First, DetID::Last;

constexpr int DetID::nDetectors;

Expand Down
2 changes: 1 addition & 1 deletion DataFormats/Headers/include/Headers/DataHeader.h
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ 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 gDataOriginHMP{ "HMP" };
constexpr o2::header::DataOrigin gDataOriginITS{ "ITS" };
constexpr o2::header::DataOrigin gDataOriginMCH{ "MCH" };
Expand Down
6 changes: 3 additions & 3 deletions Detectors/FIT/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 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;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you nee o2::fit namespace declaration here? Below you use explicitly o2::fit::Digit.

// 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
58 changes: 58 additions & 0 deletions Detectors/FIT/T0/macros/readRecPoints.C
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#if !defined(__CLING__) || defined(__ROOTCLING__)
#include "FITSimulation/Detector.h"
#include "FITBase/Digit.h"
#include "FITReconstruction/RecPoints.h"
#include <TH2F.h>
#endif
void readRecPoints()
{
using namespace o2::fit;
// using namespace o2::fit::Digit;

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

TH2F* hMultRec = new TH2F("hMultRec", "photons Recits ", 210, 0, 210, 500, 0, 1000);
TH2F* hTimeRec = new TH2F("hTimeRec", "Time Recits", 210, 0, 210, 1000, 1, 13);
TH1F* ht0AC = new TH1F("hT0AC", "T0AC", 100, -1, 1);

gDirectory = cwd;

TFile* frec = TFile::Open("o2reco_fit.root");
std::cout << " Open rec file " << std::endl;
TTree* recTree = (TTree*)frec->Get("o2sim");
o2::fit::RecPoints* recArr = new RecPoints;
recTree->SetBranchAddress("FITRecPoints", &recArr);
Int_t nevD = recTree->GetEntries(); // recits in cont. readout may be grouped as few events per entry
std::cout << "Found " << nevD << " events with recits " << std::endl;
Float_t cfd[208], amp[208];
for (Int_t iev = 0; iev < nevD; iev++) {
recTree->GetEvent(iev);

Float_t t0AC = recArr->GetCollisionTime(0);
Float_t eventtime = recArr->GetTimeFromDigit();
ht0AC->Fill(t0AC - eventtime);
std::cout << iev << " AC " << recArr->GetCollisionTime(0) << " " << eventtime << std::endl;
for (int ii = 0; ii < 208; ii++) {
cfd[ii] = amp[ii] = 0;
}
for (const auto& d : recArr->getChDgData()) {
Int_t mcp = d.ChId;
cfd[mcp] = d.CFDTime;
amp[mcp] = d.QTCAmpl;
// cout<<iev<<" "<<mcp<<" "<< cfd[mcp]<<" "<< amp[mcp]<<endl;
hMultRec->Fill(Float_t(mcp), amp[mcp]);
hTimeRec->Fill(Float_t(mcp), cfd[mcp]);
}
}
TFile* Hfile = new TFile("FigFit_rec_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);
hTimeRec->Write();
hMultRec->Write();
ht0AC->Write();

} // end of macro
Loading