ATLAS Offline Software
Loading...
Searching...
No Matches
TRTCalibrator.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef TRT_CALIBTOOLS__TRTCALIBRATOR_H
6#define TRT_CALIBTOOLS__TRTCALIBRATOR_H
7
8/********************************************************************
9
10 NAME: TRTCalibrator.h
11PACKAGE: TRTCalibTools
12
13AUTHORS: Johan Lundquist
14CREATED: 27-03-2009
15
16PURPOSE: Tool for calibrating the TRT
17
18********************************************************************/
19
20
26#include "GaudiKernel/ToolHandle.h"
27#include "GaudiKernel/ServiceHandle.h"
28#include "Gaudi/Property.h"
29
30#include <string>
31#include <vector>
32#include <map>
33#include <set>
34
35class AtlasDetectorID;
36class TRT_ID;
37class TFile;
38namespace InDetDD{
40}
41
45class TRTCalibrator : virtual public ITRTCalibrator, public AthAlgTool {
46public:
47
51 TRTCalibrator(const std::string& type, const std::string& name, const IInterface* parent);
52
56 virtual ~TRTCalibrator() {}
57
76 virtual StatusCode initialize() override;
77 virtual StatusCode finalize() override;
78
79 virtual bool fill(const Trk::Track* aTrack, TRT::TrackInfo* output) override;
80
81 bool IncludedLevels(std::string, int*);
82
86 std::string SubLev(std::string, int);
87
91 bool IsSubLev(const std::string&, int, const std::string&);
92
96 void DumpStrawData(int);
97
101 int GetSubLevels(const std::string&, int, std::set<int>*);
102
106 void MakeBDKeys(int, int, int, int, int, int);
107
111 virtual bool calibrate ATLAS_NOT_THREAD_SAFE () override;
112
113private:
114
115 ToolHandle<ITRT_CalDbTool> m_trtcaldbTool {this, "TRTCalDbTool", "ITRT_CalDbTool", ""};
116 ToolHandle<ITRT_StrawStatusSummaryTool> m_TRTStrawSummaryTool {this, "TRTStrawSummaryTool", "ITRT_StrawStatusSummaryTool", ""};
117 ServiceHandle<ITRT_StrawNeighbourSvc> m_neighbourSvc {this,"NeighbourSvc","ITRT_StrawNeighbourSvc","retrieve barrel and end-cap straw number" };
118
119
120 // Gaudi Properties
121 Gaudi::Property<float> m_maxDistance {this, "maxDistance" , 2.8 , ""};
122 Gaudi::Property<float> m_maxTimeResidual {this, "maxTimeResidual" , 150.0 , ""};
123 Gaudi::Property<float> m_maxTrackChisquarePerDof {this, "maxTrackChisquarePerDof" , 10.0 , ""};
124 Gaudi::Property<float> m_t0offset {this, "T0Offset" , -0.3 , ""};
125
126 Gaudi::Property<int> m_minTimebinsOverThreshold {this, "minTimebinsOverThreshold" , 2 , ""};
127 Gaudi::Property<int> m_minrt {this, "MinRt" , 10000 , "minimum number of hits required to do R-t calibration" };
128 Gaudi::Property<int> m_mint0 {this, "MinT0" , 200 , "minimum number of hits required to do T0 calibration" };
129 Gaudi::Property<int> m_nevents {this, "Nevents" , -1 , "The number of hits or histograms read from the input file"};
130
131 Gaudi::Property<bool> m_SplitBarrel {this, "SplitBarrel" , true , ""};
132 Gaudi::Property<bool> m_useP0 {this, "UseP0" , true , ""};
133 Gaudi::Property<bool> m_floatP3 {this, "FloatP3" , true , ""};
134 Gaudi::Property<bool> m_DoArXenonSep {this, "DoArXenonSep" , false , ""};
135 Gaudi::Property<bool> m_DoShortStrawCorrection {this, "DoShortStrawCorrection" , true , ""};
136
137 Gaudi::Property<std::string> m_selstring {this, "Selstring" , "_*_-_-_-_-_-_-" , ""};
138 Gaudi::Property<std::string> m_calsub {this, "SubPart" , "user" , ""};
139 Gaudi::Property<std::string> m_options {this, "Options" , "" , ""};
140 Gaudi::Property<std::string> m_hittuple {this, "Hittuple" , "merged.root" , ""};
141 Gaudi::Property<std::string> m_rtrel {this, "RtRel" , "basic" , "the rt relation to use"};
142 Gaudi::Property<std::string> m_rtbinning {this, "RtBinning" , "t" , ""};
143 Gaudi::Property<std::string> m_ntrtmanager {this, "TrtManagerLocation" , "TRT" , ""};
144
145 Gaudi::Property< std::vector<std::string> > m_doRt {this, "CalibrateRt" , {} , ""};
146 Gaudi::Property< std::vector<std::string> > m_doT0 {this, "CalibrateT0" , {} , ""};
147 Gaudi::Property< std::vector<std::string> > m_doRes {this, "FitResidual" , {} , ""};
148 Gaudi::Property< std::vector<std::string> > m_beQuiet {this, "NoHistograms" , {} , ""};
149 Gaudi::Property< std::vector<std::string> > m_useBoardRef {this, "UseBoardRef" , {} , ""};
150 Gaudi::Property< std::vector<std::string> > m_doLogPrint {this, "PrintLog" , {} , ""};
151 Gaudi::Property< std::vector<std::string> > m_doOutPrint {this, "PrintT0Out" , {} , ""};
152 Gaudi::Property< std::vector<std::string> > m_doRtPrint {this, "PrintRtOut" , {} , ""};
153
155 const TRT_ID* m_TRTID{};
157 unsigned int m_numOfHitsTotal{};
158 unsigned int m_numOfHitsAccepted{} ;
159 unsigned int m_numOfProcessedTracks{} ;
160
161 std::string m_comTimeName;
163 class BDzero{public: int z;}; class BDstraw{public: std::map<std::string,BDzero> s;}; class BDchip{public: std::map<std::string,BDstraw> c;}; class BDboard{public: std::map<std::string,BDchip> b;}; class BDmodule{public: std::map<std::string,BDboard> m;}; class BDlayer{public: std::map<std::string,BDmodule> l;}; class BDdetector{public: std::map<std::string,BDlayer> d;}; class BDTRT{public: std::map<std::string,BDdetector> t;}; BDTRT m_trt;
175
176
177 class epdata{
178 public:
180 };
181
182 struct conf {
183 std::string Selstring, Options;
185 std::map< std::string,std::set<int> > selections;//TRTsel, detsel, laysel, modsel, brdsel, chpsel, stwsel;
186 };
187 std::map<std::string,conf> m_config;
188
189 enum {CALIB_ALL=-3, CALIB_NONE=-4};
190
191
192};
193
194#endif // TRT_CALIBTOOLS__TRTCALIBRATOR_H
abstract interface to TRT calibration constants
Abstract interface to information on straws electronic grouping.
abstract interface to TRT straw status constants
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
The Detector Manager for all TRT Detector elements, it acts as the interface to the detector elements...
dictionary class for the full TRT
std::map< std::string, BDdetector > t
dictionary class for a board
std::map< std::string, BDchip > b
dictionary class for a chip
std::map< std::string, BDstraw > c
dictionary class for a detector
std::map< std::string, BDlayer > d
dictionary class for a layer
std::map< std::string, BDmodule > l
dictionary class for a module
std::map< std::string, BDboard > m
dictionary class for a straw
std::map< std::string, BDzero > s
dummy dictionary class
std::string m_Lkey_acc
std::string m_Skey
Gaudi::Property< bool > m_SplitBarrel
Gaudi::Property< int > m_minTimebinsOverThreshold
Gaudi::Property< int > m_nevents
const InDetDD::TRT_DetectorManager * m_trtmanager
Gaudi::Property< std::vector< std::string > > m_doOutPrint
Gaudi::Property< std::string > m_rtbinning
std::string SubLev(std::string, int)
return sub-level i from a selection string with the form _X_X_X_X_X_X_X
Gaudi::Property< std::vector< std::string > > m_doRt
ToolHandle< ITRT_CalDbTool > m_trtcaldbTool
const AtlasDetectorID * m_DetID
unsigned int m_numOfProcessedTracks
Gaudi::Property< std::vector< std::string > > m_doRes
virtual StatusCode finalize() override
ServiceHandle< ITRT_StrawNeighbourSvc > m_neighbourSvc
ToolHandle< ITRT_StrawStatusSummaryTool > m_TRTStrawSummaryTool
std::string m_Dkey
Gaudi::Property< std::vector< std::string > > m_doT0
Gaudi::Property< std::string > m_hittuple
Gaudi::Property< int > m_minrt
Gaudi::Property< bool > m_useP0
Gaudi::Property< std::string > m_ntrtmanager
void DumpStrawData(int)
returns true if the ...
unsigned int m_numOfHitsTotal
Gaudi::Property< float > m_maxTrackChisquarePerDof
virtual bool fill(const Trk::Track *aTrack, TRT::TrackInfo *output) override
Gaudi::Property< std::vector< std::string > > m_useBoardRef
BDTRT m_trt_acc
instance if the dictionary class for the full TRT
Gaudi::Property< std::vector< std::string > > m_beQuiet
Gaudi::Property< std::string > m_calsub
bool IncludedLevels(std::string, int *)
virtual StatusCode initialize() override
Pre-define standard calibration configuration.
Gaudi::Property< std::vector< std::string > > m_doRtPrint
Gaudi::Property< std::string > m_rtrel
Gaudi::Property< bool > m_floatP3
unsigned int m_numOfHitsAccepted
std::string m_Ckey
std::string m_Mkey
Gaudi::Property< bool > m_DoShortStrawCorrection
Gaudi::Property< float > m_t0offset
Gaudi::Property< std::string > m_selstring
std::string m_Lkey
TRTCalibrator(const std::string &type, const std::string &name, const IInterface *parent)
Constructor.
Gaudi::Property< std::string > m_options
const TRT_ID * m_TRTID
virtual ~TRTCalibrator()
Destructor.
std::map< std::string, conf > m_config
std::string m_comTimeName
bool IsSubLev(const std::string &, int, const std::string &)
returns true if the ...
virtual bool calibrate ATLAS_NOT_THREAD_SAFE() override
Method for doing the actual calibration.
std::string m_Tkey
void MakeBDKeys(int, int, int, int, int, int)
makes the key strings for a sub-module
Gaudi::Property< float > m_maxTimeResidual
std::string m_Dkey_acc
Gaudi::Property< std::vector< std::string > > m_doLogPrint
int GetSubLevels(const std::string &, int, std::set< int > *)
fills a set of integers with the indexes af the sub-modules that are conatined in a selection
BDTRT m_trt
instance if the dictionary class for the full TRT
Gaudi::Property< int > m_mint0
Gaudi::Property< float > m_maxDistance
Gaudi::Property< bool > m_DoArXenonSep
std::string m_Bkey
This is an Identifier helper class for the TRT subdetector.
Definition TRT_ID.h:82
Message Stream Member.
Definition run.py:1
std::vector< std::string > CalibrateT0
std::vector< std::string > FitResidual
std::vector< std::string > NoHistograms
std::vector< std::string > PrintLog
std::map< std::string, std::set< int > > selections
std::vector< std::string > CalibrateRt
std::vector< std::string > PrintRtOut
std::vector< std::string > PrintT0Out