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
8 changes: 3 additions & 5 deletions Modules/FIT/FT0/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

add_library(O2QcFT0)

target_sources(O2QcFT0 PRIVATE src/TH1ReductorLaser.cxx
src/DigitQcTaskLaser.cxx
target_sources(O2QcFT0 PRIVATE src/AgingLaserTask.cxx
src/DigitQcTask.cxx
src/GenericCheck.cxx
src/CFDEffCheck.cxx
Expand Down Expand Up @@ -32,8 +31,7 @@ install(TARGETS O2QcFT0
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})

add_root_dictionary(O2QcFT0
HEADERS include/FT0/TH1ReductorLaser.h
include/FT0/DigitQcTaskLaser.h
HEADERS include/FT0/AgingLaserTask.h
include/FT0/DigitQcTask.h
include/FT0/PostProcTask.h
include/FT0/CFDEffCheck.h
Expand Down Expand Up @@ -70,7 +68,6 @@ install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/FT0
# RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
#)


# ---- Test(s) ----

#set(TEST_SRCS test/testQcFT0.cxx) # uncomment to reenable the test which was empty
Expand All @@ -91,6 +88,7 @@ endforeach()
# ----- Configs -------
install(FILES
ft0-reconstruction-config.json
etc/ft0-aging-laser.json
DESTINATION etc)

get_property(dirs
Expand Down
33 changes: 33 additions & 0 deletions Modules/FIT/FT0/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# FT0 quality control

## Aging monitoring

The aging monitoring of FT0 is performed by 1 minute long laser runs that should be launched after each beam dump. A dedicated QC task is analyzing the laser data: `o2::quality_control_modules::ft0::AgingLaserTask`.

At the moment the QC task is adapted to the FT0 laser calibration system (LCS) and the monitoring of the FT0 aging. If needed, the task can be generalized to work with other FIT detectors.

### Monitoring principles

The schematics of the LCS is shown below. Per laser pulse, there will be two signals in each reference channel and one signal in each detector channel. The signals are separated in time by well defined delays, so one can identify them by BC ID.

<img src="images/lcs.png" width="500px">

More information about the LCS and the hardware side of the aging monitoring can be found [here](https://indico.cern.ch/event/1229241/contributions/5172798/attachments/2561719/4420583/Ageing-related%20tasks.pdf).

### `AgingLaserTask` configuration

An example configuration can be found in `etc/ft0-aging-laser.json`. The task parameters are:

- `detectorChannelIDs`: list of detector channels to be monitored. Omit this parameter to use all.
- `referenceChannelIDs`: the reference channel IDs, should be: "208, 209, 210, 211".
- `detectorAmpCut`: Lower cut on the detector amplitude in ADC ch, default "0". **TODO**: this has no effect at the moment.
- `referenceAmpCut`: Lower cut on the reference channel amplitude in ADC ch to ignore cross talk, default "100".
- `laserTriggerBCs`: list of BCs when the laser fires, should be "0, 1783".
- `detectorBCdelay`: amount of BCs after the laser trigger BCs when the laser pulse is expected in the detector, should be "131".
- `referencePeak1BCdelays`: amount of BCs after the laser trigger BCs when the first laser pulse is expected in the reference channels, should be "115, 115, 115, 115". One value per reference channel, even though they will be the same with the current LCS setup.
- `referencePeak2BCdelays`: amount of BCs after the laser trigger BCs when the second laser pulse is expected in the reference channels, should be "136, 142, 135, 141". One value per reference channel.
- `debug`: If true, an additional set of plots can be produced for debugging purposes, default "false".

The channel ID and BC values delays are rather fixed and should not change unless the LCS changes significantly.

**TODO**: should we apply the amplitude cuts in the SliceTrendingTask instead?
51 changes: 51 additions & 0 deletions Modules/FIT/FT0/etc/ft0-aging-laser.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"qc": {
"config": {
"database": {
"implementation": "CCDB",
"#host": "ccdb-test.cern.ch:8080",
"host": "http://localhost:8080",
"username": "not_applicable",
"password": "not_applicable",
"name": "not_applicable"
},
"monitoring": {
"url": "infologger:///debug?qc"
},
"consul": {
"url": ""
},
"conditionDB": {
"url": "alice-ccdb.cern.ch"
},
"bookkeeping": {
"url": ""
}
},
"tasks": {
"AgingLaser": {
"active": "true",
"className": "o2::quality_control_modules::ft0::AgingLaserTask",
"moduleName": "QcFT0",
"detectorName": "FT0",
"cycleDurationSeconds": "300",
"maxNumberCycles": "-1",
"dataSource": {
"type": "direct",
"query": "digits:FT0/DIGITSBC/0;channels:FT0/DIGITSCH/0"
},
"taskParameters": {
"#detectorChannelIDs": "omit to use all",
"referenceChannelIDs": "208, 209, 210, 211",
"detectorAmpCut": "0",
"referenceAmpCut": "100",
"laserTriggerBCs": "0, 1783",
"detectorBCdelay": "131",
"referencePeak1BCdelays": "115, 115, 115, 115",
"referencePeak2BCdelays": "136, 142, 135, 141",
"debug": "false"
}
}
}
}
}
Binary file added Modules/FIT/FT0/images/lcs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
171 changes: 171 additions & 0 deletions Modules/FIT/FT0/include/FT0/AgingLaserTask.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// 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.

///
/// \file AgingLaserTask.h
/// \author Andreas Molander <andreas.molander@cern.ch>, Sandor Lokos <sandor.lokos@cern.ch>, Edmundo Garcia-Solis <edmundo.garcia@cern.ch>
///

#ifndef QC_MODULE_FT0_AGINGLASERTASK_H
#define QC_MODULE_FT0_AGINGLASERTASK_H

#include "QualityControl/TaskInterface.h"

#include <CommonConstants/LHCConstants.h>
#include <FT0Base/Constants.h>

#include <TH1I.h>
#include <TH2I.h>

#include <cstddef>
#include <cstdint>
#include <map>
#include <memory>
#include <set>
#include <vector>

using namespace o2::quality_control::core;

namespace o2::quality_control_modules::ft0
{

class AgingLaserTask final : public TaskInterface
{
public:
AgingLaserTask() = default;
~AgingLaserTask() override;

void initialize(o2::framework::InitContext& ctx) override;
void startOfActivity(const Activity& activity) override;
void startOfCycle() override;
void monitorData(o2::framework::ProcessingContext& ctx) override;
void endOfCycle() override;
void endOfActivity(const Activity& activity) override;
void reset() override;

private:
/// Check if the laser was triggered for this BC
/// \param bc BC to check
/// \param bcDelay Expected BC delay from trigger to signal
/// \return True if the laser was triggered
bool bcIsTrigger(int bc, int bcDelay) const;

/// Check if a detector signal is expected for this BC
/// \param bc BC to check
/// \return True if a detector signal is expected
bool bcIsDetector(int bc) const;

/// Check if the first reference signal is expected for this BC
/// \param bc BC to check
/// \param refChId Rerernce channel where signal is seen
/// \return True if the first reference signal is expected for this BC
bool bcIsPeak1(int bc, int refChId) const;

/// Check if the second reference signal is expected for this BC
/// \param bc BC to check
/// \param refChId Rerernce channel where signal is seen
/// \return True if the second reference signal is expected for this BC
bool bcIsPeak2(int bc, int refChId) const;

// Constants
constexpr static std::size_t sNCHANNELS_PM = o2::ft0::Constants::sNCHANNELS_PM; ///< Max number of FT0 channels
constexpr static std::size_t sMaxBC = o2::constants::lhc::LHCMaxBunches; ///< Max number of BCs

// Task parameters
std::vector<uint8_t> mDetectorChIDs; ///< Enabled detector channels
std::vector<uint8_t> mReferenceChIDs; ///< Enabled reference channels
int mDetectorAmpCut; ///< Amplitude cut for detector channels
int mReferenceAmpCut; ///< Amplitude cut for reference channels
std::vector<int> mLaserTriggerBCs; ///< BCs in which the laser is triggered
int mDetectorBCdelay; ///< BC delay for detector channels (same for all)
std::map<uint8_t, int> mReferencePeak1BCdelays; ///< BC delays for reference channel peak 1 (per channel)
std::map<uint8_t, int> mReferencePeak2BCdelays; ///< BC delays for reference channel peak 2 (per channel)

bool mDebug = false; ///< Enable more histograms in debug mode

// Histograms

// Amplitude per channel
std::unique_ptr<TH2I> mHistAmpVsChADC0; ///< Amplitude per channel for ADC0 (detector + reference channels)
std::unique_ptr<TH2I> mHistAmpVsChADC1; ///< Amplitude per channel for ADC1 (detector + reference channels)
std::unique_ptr<TH2I> mHistAmpVsChPeak1ADC0; ///< Amplitude per channel for peak 1 for ADC0 (reference channels)
std::unique_ptr<TH2I> mHistAmpVsChPeak1ADC1; ///< Amplitude per channel for peak 1 for ADC1 (reference channels)
std::unique_ptr<TH2I> mHistAmpVsChPeak2ADC0; ///< Amplitude per channel for peak 2 for ADC0 (reference channels)
std::unique_ptr<TH2I> mHistAmpVsChPeak2ADC1; ///< Amplitude per channel for peak 2 for ADC1 (reference channels)

// // Time per channel
std::unique_ptr<TH2I> mHistTimeVsCh; ///< Time per channel (detector + reference channels)
std::unique_ptr<TH2I> mHistTimeVsChPeak1; ///< Time per channel for peak 1 (reference channels, both ADCs)
std::unique_ptr<TH2I> mHistTimeVsChPeak2; ///< Time per channel for peak 2 (reference channels, both ADCs)

// Debug histograms

// Ampltiude per channel
std::unique_ptr<TH2I> mDebugHistAmpVsCh; ///< Amplitude per channel (detector + reference channels)

// Ampltidue histograms for reference channel peaks
std::map<uint8_t, std::unique_ptr<TH1I>> mMapDebugHistAmp; ///< Amplitude (both ADCs and peaks)
std::map<uint8_t, std::unique_ptr<TH1I>> mMapDebugHistAmpADC0; ///< Ampltidue for ADC0
std::map<uint8_t, std::unique_ptr<TH1I>> mMapDebugHistAmpADC1; ///< Ampltidue for ADC1
std::map<uint8_t, std::unique_ptr<TH1I>> mMapDebugHistAmpPeak1; ///< Amplitude for peak 1
std::map<uint8_t, std::unique_ptr<TH1I>> mMapDebugHistAmpPeak2; ///< Amplitude for peak 2
std::map<uint8_t, std::unique_ptr<TH1I>> mMapDebugHistAmpPeak1ADC0; ///< Amplitude for peak 1 for ADC0
std::map<uint8_t, std::unique_ptr<TH1I>> mMapDebugHistAmpPeak1ADC1; ///< Amplitude for peak 1 for ADC1
std::map<uint8_t, std::unique_ptr<TH1I>> mMapDebugHistAmpPeak2ADC0; ///< Amplitude for peak 2 for ADC0
std::map<uint8_t, std::unique_ptr<TH1I>> mMapDebugHistAmpPeak2ADC1; ///< Amplitude for peak 2 for ADC1

// Time per channel
std::unique_ptr<TH2I> mDebugHistTimeVsChADC0; ///< Time per channel for ADC0 (detector + reference channels)
std::unique_ptr<TH2I> mDebugHistTimeVsChADC1; ///< Time per channel for ADC1 (detector + reference channels)
std::unique_ptr<TH2I> mDebugHistTimeVsChPeak1ADC0; ///< Time per channel for peak 1 for ADC0 (reference channels)
std::unique_ptr<TH2I> mDebugHistTimeVsChPeak1ADC1; ///< Time per channel for peak 1 for ADC1 (reference channels)
std::unique_ptr<TH2I> mDebugHistTimeVsChPeak2ADC0; ///< Time per channel for peak 2 for ADC0 (reference channels)
std::unique_ptr<TH2I> mDebugHistTimeVsChPeak2ADC1; ///< Time per channel for peak 2 for ADC1 (reference channels)

// Time histograms for reference channel peaks
// TODO: add mMapDebugHistTime, mMapDebugHistTimeADC0, mMapDebugHistTimeADC1
std::map<uint8_t, std::unique_ptr<TH1I>> mMapDebugHistTimePeak1;
std::map<uint8_t, std::unique_ptr<TH1I>> mMapDebugHistTimePeak2;
std::map<uint8_t, std::unique_ptr<TH1I>> mMapDebugHistTimePeak1ADC0;
std::map<uint8_t, std::unique_ptr<TH1I>> mMapDebugHistTimePeak1ADC1;
std::map<uint8_t, std::unique_ptr<TH1I>> mMapDebugHistTimePeak2ADC0;
std::map<uint8_t, std::unique_ptr<TH1I>> mMapDebugHistTimePeak2ADC1;

// BC
std::unique_ptr<TH1I> mDebugHistBC; ///< All BCs
std::unique_ptr<TH1I> mDebugHistBCDetector; ///< Detector channel BCs
std::unique_ptr<TH1I> mDebugHistBCReference; ///< Reference channel BCs
std::unique_ptr<TH1I> mDebugHistBCAmpCut; ///< All BCs with amplitude cut
std::unique_ptr<TH1I> mDebugHistBCAmpCutADC0; ///< All BCs with amplitude cut for ADC0
std::unique_ptr<TH1I> mDebugHistBCAmpCutADC1; ///< All BCs with amplitude cut for ADC1
std::unique_ptr<TH1I> mDebugHistBCDetectorAmpCut; ///< Detector channel BCs with amplitude cut
std::unique_ptr<TH1I> mDebugHistBCDetectorAmpCutADC0; ///< Detector channel BCs with amplitude cut for ADC0
std::unique_ptr<TH1I> mDebugHistBCDetectorAmpCutADC1; ///< Detector channel BCs with amplitude cut for ADC1
std::unique_ptr<TH1I> mDebugHistBCReferenceAmpCut; ///< Reference channel BCs with amplitude cut
std::unique_ptr<TH1I> mDebugHistBCReferenceAmpCutADC0; ///< Reference channel BCs with amplitude cut for ADC0
std::unique_ptr<TH1I> mDebugHistBCReferenceAmpCutADC1; ///< Reference channel BCs with amplitude cut for ADC1

// Amplitude per BC for reference channels
std::map<uint8_t, std::unique_ptr<TH2I>> mMapDebugHistAmpVsBC; ///< Amplitude vs BC (both ADCs and peaks = 4 peaks)
std::map<uint8_t, std::unique_ptr<TH2I>> mMapDebugHistAmpVsBCADC0; ///< Amplitude vs BC for ADC0 (both peaks)
std::map<uint8_t, std::unique_ptr<TH2I>> mMapDebugHistAmpVsBCADC1; ///< Amplitude vs BC for ADC1 (both peaks)

// Including the histograms below will produce 'object of class TObjArray read too many bytes' in --local-batch mode

// // Time per BC for reference channels
// std::map<uint8_t, std::unique_ptr<TH2I>> mMapDebugHistTimeVsBC; ///< Time vs BC (both ADCs and peaks = 4 peaks)
// std::map<uint8_t, std::unique_ptr<TH2I>> mMapDebugHistTimeVsBCADC0; ///< Time vs BC for ADC0 (both peaks)
// std::map<uint8_t, std::unique_ptr<TH2I>> mMapDebugHistTimeVsBCADC1; ///< Time vs BC for ADC1 (both peaks)
};

} // namespace o2::quality_control_modules::ft0

#endif // QC_MODULE_FT0_AGINGLASERTASK_H
Loading