ATLAS Offline Software
Loading...
Searching...
No Matches
CscCalcSlope.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef CSCCALCSLOPE_H
6#define CSCCALCSLOPE_H
7
13
15#include "GaudiKernel/ServiceHandle.h"
16#include "GaudiKernel/ToolHandle.h"
17
24#include "BipolarFit.h"
25
26#include "TGraph.h"
27#include "TH1I.h"
28
29#include <array>
30#include <vector>
31#include <string>
32#include <map>
33#include <set>
34
35class TProfile;
36class TGraphErrors;
37
38namespace MuonCalib{
51
53 {
54 public:
55 CscCalcSlope(const std::string& name, ISvcLocator* pSvcLocator);
56 ~CscCalcSlope()=default;
57
59 StatusCode initialize(void);
60 StatusCode execute(void);
61 StatusCode finalize(void);
62
63 private:
64
66 StatusCode collectEventInfo();
68 StatusCode calculateParameters();
69 StatusCode writeCalibrationFile();
70 StatusCode storeGateRecord();
72 StatusCode makeCalibPoints();
73 double calShape(double *x, double * par);
74 StatusCode calOutput0();
75 StatusCode calOutput3();
76 void outputParameter3(const CscCalibResultCollection & results, std::ofstream & out);
77
79 ToolHandle<ICscCalibTool> m_cscCalibTool{this, "CscCalibTool", "CscCalibTool"};
80 ToolHandle<Muon::ICSC_RDO_Decoder> m_cscRdoDecoderTool{this,"CscRDODecoder","Muon::CscRDO_Decoder"};
81 ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
82 SmartIF<IChronoStatSvc> m_chronoSvc;
83 SG::ReadCondHandleKey<CscCondDbData> m_readKey{this, "ReadKey", "CscCondDbData", "Key of CscCondDbData"};
84
86 std::string m_outputFileName;
87 std::string m_calOutputVersion;
88
90
94
97 unsigned int m_maxStripHash;
99
103 std::vector<float> * m_fitReturns;
104
105 TGraph * m_resGraph;
107 TProfile * m_currentAmpProf;
108 std::map<int, TProfile*> * m_ampProfs;
109 std::set<int> * m_pulsedChambers;
110
113
115
116
117 //Temporary for testing:
120 std::array<double, 24> m_crossTalkFix{};
122 std::vector<float> m_dbLevels;
123
124 float *m_peds, *m_noises;
125 StatusCode fillBitHist(TH1I * bitHist, const uint16_t & val);
127 std::string m_pedFileName;
128
130
131 std::string m_calFitFunc;
132
133 //For peaking time
135 TProfile * m_peakTimeProf;
137
138 //allows linear ploting
140
141 //String command to allow interface to patched version
142 std::string m_cmd_parameters;
143
144 //Number of bits
145 unsigned int m_numBits;
146 };//end class CscCalcSlope
147
148 inline StatusCode CscCalcSlope::fillBitHist(TH1I * bitHist, const uint16_t & val)
149 {
150 if(!bitHist)
151 return StatusCode::RECOVERABLE;
152
153 //Num bits should always be m_numBits
154 std::bitset<12> bitVal(val);
155
156 for(unsigned int bitIndex = 0; bitIndex < m_numBits; bitIndex++){
157 if(bitVal[bitIndex]){
158 bitHist->Fill(bitIndex);
159 }
160 }
161
162
163 return StatusCode::SUCCESS;
164 }
165
166}//end namespace:
167
168#endif
An STL vector of pointers that by default owns its pointed-to elements.
#define x
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Derived DataVector<T>.
Definition DataVector.h:795
StatusCode initialize(void)
basic required functions
std::string m_outputFileName
Parameters input through joboptions.
CscCalibResultCollection * m_peakTimes
std::map< int, TProfile * > * m_ampProfs
double calShape(double *x, double *par)
std::array< double, 24 > m_crossTalkFix
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
SG::ReadCondHandleKey< CscCondDbData > m_readKey
CscCalibResultCollection * m_intercepts
StatusCode finalize(void)
StatusCode calculateParameters()
Finalize functions.
std::vector< float > * m_fitReturns
DataVector< TGraphErrors > * m_calGraphs
CscCalibResultCollection * m_slopes
std::string m_calOutputVersion
ToolHandle< ICscCalibTool > m_cscCalibTool
Services and tools.
int m_eventCnt
coherent correction array has the corrections to the coherently pulsed channels to get the basic chan...
DataVector< DataVector< TProfile > > * m_fracProfs
StatusCode execute(void)
unsigned int m_maxStripHash
Internally global variables.
StatusCode fillBitHist(TH1I *bitHist, const uint16_t &val)
CscCalcSlope(const std::string &name, ISvcLocator *pSvcLocator)
ToolHandle< Muon::ICSC_RDO_Decoder > m_cscRdoDecoderTool
void outputParameter3(const CscCalibResultCollection &results, std::ofstream &out)
std::vector< float > m_dbLevels
DataVector< DataVector< TGraph > > * m_fracGraphs
DataVector< TH1I > * m_bitHists
SmartIF< IChronoStatSvc > m_chronoSvc
std::set< int > * m_pulsedChambers
StatusCode collectEventInfo()
event loop functions
StatusCode writeCalibrationFile()
StatusCode makeCalibPoints()
Utility functions.
CscCalcPed - algorithm that finds the Cathode Strip Chamber pedestals from an RDO.