Skip to content
Merged
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
1 change: 1 addition & 0 deletions Modules/TOF/include/TOF/TaskCosmics.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class TaskCosmics final : public TaskInterface
const float mTFDuration = ((nrow - 1) / nrow) * o2::tof::Geo::BC_TIME * o2::tof::Geo::BC_IN_ORBIT * 256 * 1E-9; /// Duration of a TF used to compute the rate of cosmics
float mSelDeltaTSignalRegion = 50000.f; /// Cut on the DeltaT to select signal
float mSelDeltaTBackgroundRegion = 100000.f; /// Cut on the DeltaT to select background
float mSelMinLength = 500.f; /// Cut on the minimum length that a track mush have [cm]

// Histograms
std::shared_ptr<TH1F> mHistoCrate1 = nullptr; /// Crates of the first hit
Expand Down
39 changes: 27 additions & 12 deletions Modules/TOF/src/TaskCosmics.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ void TaskCosmics::initialize(o2::framework::InitContext& /*ctx*/)
mSelDeltaTBackgroundRegion = atoi(param->second.c_str());
LOG(INFO) << "Set SelDeltaTBackgroundRegion to " << mSelDeltaTBackgroundRegion << " ps";
}
if (auto param = mCustomParameters.find("SelMinLength"); param != mCustomParameters.end()) {
mSelMinLength = atoi(param->second.c_str());
LOG(INFO) << "Set SelMinLength to " << mSelMinLength << " cm";
}

mHistoCrate1.reset(new TH1F("Crate1", "Crate1;Crate of first hit;Counts", 72, 0, 72));
getObjectsManager()->startPublishing(mHistoCrate1.get());
Expand All @@ -80,9 +84,9 @@ void TaskCosmics::initialize(o2::framework::InitContext& /*ctx*/)
getObjectsManager()->startPublishing(mHistoToT1.get());
mHistoToT2.reset(new TH1F("ToT2", "ToT2;ToT (ns);Counts", 100, 0., 48.8));
getObjectsManager()->startPublishing(mHistoToT2.get());
mHistoLength.reset(new TH1F("Length", "Length;Length (cm);Counts", 100, 500.f, 1000.f));
mHistoLength.reset(new TH1F("Length", "Length;Length (cm);Counts", 100, mSelMinLength, 1000.f));
getObjectsManager()->startPublishing(mHistoLength.get());
mHistoDeltaTLength.reset(new TH2F("DeltaTLength", "DeltaT vs Length;Length (cm);#DeltaT (ps);Counts", 100, 500.f, 1000.f, 1000, -1e6, 1e6));
mHistoDeltaTLength.reset(new TH2F("DeltaTLength", "DeltaT vs Length;Length (cm);#DeltaT (ps);Counts", 100, mSelMinLength, 1000.f, 1000, -1e6, 1e6));
getObjectsManager()->startPublishing(mHistoDeltaTLength.get());
mHistoCosmicRate.reset(new TH1F("CosmicRate", "CosmicRate;Crate;Cosmic rate (Hz)", 72, 0., 72));
mCounterPeak.MakeHistogram(mHistoCosmicRate.get());
Expand All @@ -104,21 +108,32 @@ void TaskCosmics::monitorData(o2::framework::ProcessingContext& ctx)
{
mCounterTF.Count(0);
const auto cosmics = ctx.inputs().get<std::vector<o2::tof::CosmicInfo>>("infocosmics");
for (auto i : cosmics) {
const int crate1 = o2::tof::Geo::getCrateFromECH(o2::tof::Geo::getECHFromCH(i.getCH1()));
const int crate2 = o2::tof::Geo::getCrateFromECH(o2::tof::Geo::getECHFromCH(i.getCH2()));

for (unsigned int i = 0; i < cosmics.size(); i++) {
if (cosmics.size() > i + 2) {
if (fabs(cosmics[i].getT1() - cosmics[i + 2].getT1()) < 2E3) {
continue;
}
}

const o2::tof::CosmicInfo cosmic = cosmics[i];
if (cosmic.getL() < mSelMinLength) {
continue;
}
const int crate1 = o2::tof::Geo::getCrateFromECH(o2::tof::Geo::getECHFromCH(cosmic.getCH1()));
const int crate2 = o2::tof::Geo::getCrateFromECH(o2::tof::Geo::getECHFromCH(cosmic.getCH2()));
mHistoCrate1->Fill(crate1);
mHistoCrate2->Fill(crate2);
mHistoCrate1VsCrate2->Fill(crate1, crate2);
mHistoDeltaT->Fill(i.getDeltaTime());
mHistoToT1->Fill(i.getTOT1());
mHistoToT2->Fill(i.getTOT2());
mHistoLength->Fill(i.getL());
mHistoDeltaTLength->Fill(i.getL(), i.getDeltaTime());
if (abs(i.getDeltaTime()) < mSelDeltaTSignalRegion) {
mHistoDeltaT->Fill(cosmic.getDeltaTime());
mHistoToT1->Fill(cosmic.getTOT1());
mHistoToT2->Fill(cosmic.getTOT2());
mHistoLength->Fill(cosmic.getL());
mHistoDeltaTLength->Fill(cosmic.getL(), cosmic.getDeltaTime());
if (abs(cosmic.getDeltaTime()) < mSelDeltaTSignalRegion) {
mCounterPeak.Count(crate1);
mCounterPeak.Count(crate2);
} else if (abs(i.getDeltaTime()) < mSelDeltaTBackgroundRegion) {
} else if (abs(cosmic.getDeltaTime()) < mSelDeltaTBackgroundRegion) {
mCounterPeak.Add(crate1, -1);
mCounterPeak.Add(crate2, -1);
}
Expand Down
3 changes: 2 additions & 1 deletion Modules/TOF/tofcosmics.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
},
"taskParameters": {
"SelDeltaTSignalRegion": "50000",
"SelDeltaTBackgroundRegion": "100000"
"SelDeltaTBackgroundRegion": "100000",
"SelMinLength": "500"
},
"location": "remote"
}
Expand Down