Skip to content
Snippets Groups Projects
Commit cb52c535 authored by Dominik Smith's avatar Dominik Smith Committed by Felix Weiglhofer
Browse files

Started to implement parameter file writer for TOF hitfinder.

parent 730ef27b
No related branches found
No related tags found
1 merge request!1391Online-capable TOF hitfinder.
......@@ -16,6 +16,7 @@ set(SRCS
CbmTaskTriggerDigi.cxx
CbmTaskTofHitFinder.cxx
CbmTaskTofClusterizer.cxx
CbmTaskTofClusterizerParWrite.cxx
CbmTaskUnpack.cxx
CbmTaskUnpackXpu.cxx
)
......
......@@ -19,6 +19,7 @@
#pragma link C++ class CbmTaskMakeRecoEvents + ;
#pragma link C++ class CbmTaskTofHitFinder + ;
#pragma link C++ class CbmTaskTofClusterizer + ;
#pragma link C++ class CbmTaskTofClusterizerParWrite + ;
#pragma link C++ class CbmTaskTriggerDigi + ;
#pragma link C++ class CbmTaskUnpack + ;
#pragma link C++ class CbmTaskUnpackXpu + ;
......
This diff is collapsed.
/* Copyright (C) 2023 Facility for Antiproton and Ion Research in Europe, Darmstadt
SPDX-License-Identifier: GPL-3.0-only
Authors: Dominik Smith [committer], Pierre-Alain Loizeau, Norbert Herrmann */
#ifndef CBMTASKTOFCLUSTERIZERPARWRITE_H
#define CBMTASKTOFCLUSTERIZERPARWRITE_H 1
// TOF Classes and includes
// Input/Output
class CbmEvent;
// Geometry
class CbmTofDetectorId;
class CbmTofDigiPar;
class CbmTofDigiBdfPar;
class CbmTofCell;
class CbmDigiManager;
class CbmTsEventHeader;
#include "CbmMatch.h"
#include "CbmTofDigi.h"
#include "tof/Clusterizer.h"
// ROOT Classes and includes
#include "Math/Rotation3D.h"
#include "Math/Vector3Dfwd.h"
// FAIR classes and includes
#include "FairTask.h"
// ROOT Classes and includes
class TClonesArray;
// C++ Classes and includes
#include <vector>
class CbmTaskTofClusterizerParWrite : public FairTask {
public:
/**
** @brief Constructor.
**/
CbmTaskTofClusterizerParWrite();
/**
** @brief Constructor.
**/
CbmTaskTofClusterizerParWrite(const char* name, int32_t verbose = 1, bool writeDataInOut = true);
/**
** @brief Destructor.
**/
virtual ~CbmTaskTofClusterizerParWrite();
/**
** @brief Inherited from FairTask.
**/
virtual InitStatus Init();
/**
** @brief Inherited from FairTask.
**/
virtual void SetParContainers();
/**
** @brief Inherited from FairTask.
**/
virtual void Exec(Option_t* option);
/**
** @brief Inherited from FairTask.
**/
virtual void Finish();
virtual void Finish(double calMode);
inline void SetCalMode(int32_t iMode) { fCalMode = iMode; }
inline void SetDutId(int32_t Id) { fDutId = Id; }
inline void PosYMaxScal(double val) { fPosYMaxScal = val; }
inline void SetTotMax(double val) { fTotMax = val; }
inline void SetTotMin(double val) { fTotMin = val; }
inline void SetTotMean(double val) { fTotMean = val; }
inline void SetMaxTimeDist(double val) { fMaxTimeDist = val; }
inline void SetChannelDeadtime(double val) { fdChannelDeadtime = val; }
inline void SetCalParFileName(TString CalParFileName) { fCalParFileName = CalParFileName; }
inline int GetNbHits() { return fiNbHits; }
inline double GetTotMean() { return fTotMean; }
void SwapChannelSides(bool bSwap) { fbSwapChannelSides = bSwap; }
void SetFileIndex(int32_t iIndex) { fiFileIndex = iIndex; }
void SetWriteDigisInOut(bool bDigis) { fbWriteDigisInOut = bDigis; }
void SetWriteHitsInOut(bool bHits) { fbWriteHitsInOut = bHits; }
void SetDeadStrips(int32_t iDet, uint32_t ival);
protected:
private:
int32_t iNbTs = 0;
int fiHitStart = 0;
bool bAddBeamCounterSideDigi = true;
const double dDoubleMax = 1.E300;
const int32_t nbClWalkBinX = 50; // was 100 (11.10.2018)
const int32_t nbClWalkBinY = 41; // choose odd number to have central bin symmetric around 0
const int32_t DetMask = 0x001FFFFF; // geo v21a
std::vector<CbmTofDigi>* fT0DigiVec = nullptr; //! T0 Digis
/**
** @brief Copy constructor.
**/
CbmTaskTofClusterizerParWrite(const CbmTaskTofClusterizerParWrite&);
/**
** @brief Copy operator.
**/
CbmTaskTofClusterizerParWrite& operator=(const CbmTaskTofClusterizerParWrite&);
// Functions common for all clusters approximations
/**
** @brief Initialize other parameters not included in parameter classes.
**/
bool InitParameters();
/**
** @brief Initialize other parameters not included in parameter classes.
**/
bool InitCalibParameter();
/**
** @brief Create one algo object for each RPC
**/
bool InitAlgos();
// Hit finder algo
std::map<uint32_t, std::map<uint32_t, cbm::algo::tof::Clusterizer>> fAlgo = {}; //[nbType][nbSm*nbRpc]
// ToF geometry variables
CbmTofDetectorId* fTofId;
CbmTofDigiPar* fDigiPar;
CbmTofDigiBdfPar* fDigiBdfPar;
const CbmTsEventHeader* fTsHeader;
// Input variables
std::vector<CbmTofDigi> fTofDigiVec {}; //! TOF Digis
CbmDigiManager* fDigiMan; // TOF Input Digis
TClonesArray* fEventsColl; // CBMEvents (time based)
// Output variables
bool fbWriteHitsInOut;
bool fbWriteDigisInOut;
std::vector<CbmTofDigi>* fTofCalDigiVec = nullptr; //! // Calibrated TOF Digis
TClonesArray* fTofHitsColl; // TOF hits
TClonesArray* fTofDigiMatchColl; // TOF Digi Links
std::vector<CbmTofDigi>* fTofCalDigiVecOut = nullptr; //! // Calibrated TOF Digis
TClonesArray* fTofHitsCollOut; // TOF hits
TClonesArray* fTofDigiMatchCollOut; // TOF Digi Links
int32_t fiNbHits; // Index of the CbmTofHit TClonesArray
// Intermediate storage variables (digi, index)
std::vector<std::vector<std::vector<std::pair<CbmTofDigi*, int32_t>>>> fStorDigi; //[nbType][nbSm*nbRpc][nDigis]
//Calibration parameters
std::vector<std::vector<std::vector<std::vector<double>>>> fvCPTOff; //[nSMT][nRpc][nCh][nbSide]
std::vector<std::vector<std::vector<std::vector<double>>>> fvCPTotGain; //[nSMT][nRpc][nCh][nbSide]
std::vector<std::vector<std::vector<std::vector<double>>>> fvCPTotOff; //[nSMT][nRpc][nCh][nbSide]
std::vector<std::vector<std::vector<std::vector<std::vector<double>>>>>
fvCPWalk; //[nSMT][nRpc][nCh][nbSide][nbWalkBins]
std::vector<std::vector<std::vector<double>>> fvCPTOffY; //[nSMT][nRpc][nBin]
std::vector<std::vector<double>> fvCPTOffYBinWidth; //[nSMT][nRpc]
std::vector<std::vector<double>> fvCPTOffYRange; //[nSMT][nRpc]
std::vector<uint32_t> fvDeadStrips; //[nbDet]
// Calib
int32_t fCalMode;
int32_t fDutId;
double fPosYMaxScal;
double fTotMax;
double fTotMin;
double fTotOff;
double fTotMean;
double fMaxTimeDist;
double fdChannelDeadtime;
TString fCalParFileName; // name of the file name with Calibration Parameters
double fdTOTMax;
double fdTOTMin;
double fdTTotMean;
double fdMaxTimeDist; // Isn't this just a local variable? Why make it global and preset?!?
double fdMaxSpaceDist; // Isn't this just a local variable? Why make it global and preset?!?
double fdModifySigvel;
double fdEvent;
double fProcessTime = 0.0;
uint64_t fuNbDigis = 0;
uint64_t fuNbHits = 0;
bool fbSwapChannelSides;
int32_t fiOutputTreeEntry;
int32_t fiFileIndex;
ClassDef(CbmTaskTofClusterizerParWrite, 1);
};
#endif // CBMTASKTOFCLUSTERIZER_H
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment