ATLAS Offline Software
LArRampBuilder.h
Go to the documentation of this file.
1 //Dear emacs, this is -*- c++ -*-
2 
3 /*
4  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 
8 
28 #ifndef LARRAMPBUILDER_H
29 #define LARRAMPBUILDER_H
31 #include "GaudiKernel/ToolHandle.h"
32 
38 
41 
43 #include "LArElecCalib/ILArRinj.h"
45 
49 
51 
53 #include <vector>
54 #include <string>
55 #include <map>
56 #include <memory>
57 
58 class LArOnlineID_Base;
60 
61 class LArRampBuilder : public AthAlgorithm//, public IIncidentListener
62 {
63 
64 public:
67 
68  //standard algorithm methods
71  virtual StatusCode stop();
72  StatusCode finalize(){return StatusCode::SUCCESS;}
73 
74  typedef std::map<uint32_t,LArCalibTriggerAccumulator> ACCRAMP;
75 
76 
77 private:
78  SG::ReadCondHandleKey<LArOnOffIdMapping> m_cablingKey{this, "OnOffMap", "LArOnOffIdMap", "SG key for mapping object"};
79  SG::ReadCondHandleKey<LArOnOffIdMapping> m_cablingKeySC{this,"ScCablingKey","LArOnOffIdMapSC","SG Key of SC LArOnOffIdMapping object"};
80 
81  //Private member functions
82  // choose reconstruction mode (i.e. OF or Parabola)
83  void chooseRecoMode() ;
84  //Does the fitting of the raw ramp. Result is returned as LArRampDB_t.
85  StatusCode rampfit(unsigned deg, const std::vector<LArRawRamp::RAMPPOINT_t>& data,
86  std::vector<float>& rampCoeffs, std::vector<int>& vSat,
87  const HWIdentifier chid, const LArOnOffIdMapping* cabling,
88  const LArBadChannelCont* bcCont);
89 
90  std::unique_ptr<LArConditionsContainer<ACCRAMP> > m_ramps;
91 
92 
93  PublicToolHandle<LArParabolaPeakRecoTool> m_peakParabolaTool{this,"LArParabolaPeakRecoTool","LArParabolaPeakRecoTool"};
94  PublicToolHandle<LArShapePeakRecoTool> m_peakShapeTool{this,"LArShapePeakRecoTool","LArShapePeakRecoTool"};
95  ToolHandle<LArOFPeakRecoTool> m_peakOFTool{this,"PeakOFTool","LArOFPeakRecoTool"};
96 
97  unsigned m_event_counter=0;
98  int m_delay=-1;
99  int m_ipassShape=0;
100 
101  std::vector< std::vector< std::vector< std::vector<double> > > >m_CaliWaves;
102  // vector (gain) of vector(HashCell) of vector (DAC) of DACs
103  std::vector< std::vector< std::vector< unsigned int > > >m_CaliDACs;
104  // vector (gain) of vector(HashCell) of DAC0 index
105  std::vector< std::vector< int> > m_IndexDAC0;
106  std::vector< std::vector< int> > m_IndexHighestDAC;
107 
108  std::vector<float> m_thePedestal;
109 
110 
111 
114 
115 
116  //Algorithm-Properties:
117  Gaudi::Property<std::vector<std::string> > m_keylist{this, "KeyList",{},"List if input SG keys"};
118  Gaudi::Property<std::string> m_keyoutput{this,"KeyOutput","LArRamp","SG Key of output object"};
119 
120  IntegerProperty m_degree{this,"Polynom",1,"Degree of ramp-polynom"};
121  IntegerProperty m_maxADC{this,"RampRange",0,"Ignore ADC values higher than this (0: do nothing)"};
122  BooleanProperty m_dac0sub{this,"SubtractDac0",true,"Take first DAC value as pedestal"};
123  UnsignedIntegerProperty m_DAC0{this,"DAC0",0,"DAC value considered DAC0"};
124  BooleanProperty m_saveRawRamp{this,"StoreRawRamp",false,"Save raw ramp obj in SG"};
125  BooleanProperty m_saveRecRamp{this,"StoreRecRamp",true,"Save reconstructed ramp obj in SG"};
126  BooleanProperty m_satSlope{this,"doSatSlope",true,"Ignore points subject to saturation"};
127  UnsignedIntegerProperty m_minDAC{this,"minDAC",0,"Ignore DAC values smaller that this"};
128  StringProperty m_recoTypeProp{this,"RecoType","OF","One of 'Parabola', 'Shape' or 'OF'"};
129  IntegerProperty m_deadChannelCut{this,"DeadChannelCut",1300,"Complain about channels with max-ADC below this value"};
130  BooleanProperty m_correctBias{this,"correctBias",false,"For Parabola method: Correction yes/no"};
131  BooleanProperty m_withIntercept{this,"WithIntercept",true,"False: Force fit to go through 0/0"};
132  FloatProperty m_delayShift{this,"DelayShift",23}; //Only for OF peak reco
133 
134  Gaudi::Property<bool> m_doBadChannelMask{this,"IgnoreBadChannels",true,"Don't complain about known bad channels"};
136  SG::ReadCondHandleKey<LArBadChannelCont> m_bcContKey {this, "BadChanKey", "LArBadChannel", "SG key for LArBadChan object"};
137  Gaudi::Property<std::vector<std::string> > m_problemsToMask{this,"ProblemsToMask",{}, "Bad-Channel categories to mask"};
138  Gaudi::Property<std::string> m_groupingType{this,"GroupingType","ExtendedFeedThrough","Grouping of the output conditions-container"};
139  Gaudi::Property<std::string> m_hec_key{this,"HECKey","","SG Key of injection-resistor obj used for HEC Ramps"};
140 
142  const LArEM_Base_ID* m_emId=nullptr;
143 
144  Gaudi::Property<bool> m_isSC{this,"isSC",false,"Processing SC data yes/no"};
145  Gaudi::Property<bool> m_ishec{this,"isHEC",false,"Processing HEC data yes/no"};
146  Gaudi::Property<bool> m_iterate{this,"Iterate",false,"Iterative OF peak reco"};
147 
149 
150 };
151 
152 #endif
LArRampBuilder::m_deadChannelCut
IntegerProperty m_deadChannelCut
Definition: LArRampBuilder.h:129
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
LArRampBuilder::m_dac0sub
BooleanProperty m_dac0sub
Definition: LArRampBuilder.h:122
LArRampBuilder::m_recoType
recoType m_recoType
Definition: LArRampBuilder.h:113
LArRampBuilder::m_thePedestal
std::vector< float > m_thePedestal
Definition: LArRampBuilder.h:108
LArRampBuilder::m_isSC
Gaudi::Property< bool > m_isSC
Definition: LArRampBuilder.h:144
LArEM_ID.h
LArRampBuilder::m_keylist
Gaudi::Property< std::vector< std::string > > m_keylist
Definition: LArRampBuilder.h:117
LArRampBuilder::m_peakOFTool
ToolHandle< LArOFPeakRecoTool > m_peakOFTool
Definition: LArRampBuilder.h:95
LArRampBuilder::~LArRampBuilder
~LArRampBuilder()
Definition: LArRampBuilder.h:66
LArCaliWaveContainer.h
LArRampBuilder::m_withIntercept
BooleanProperty m_withIntercept
Definition: LArRampBuilder.h:131
LArEM_Base_ID
This class factors out code common between LArEM_ID and LArEM_SuperCell_ID.
Definition: LArEM_Base_ID.h:38
LArRampBuilder::m_maxADC
IntegerProperty m_maxADC
Definition: LArRampBuilder.h:121
LArRampBuilder::m_saveRecRamp
BooleanProperty m_saveRecRamp
Definition: LArRampBuilder.h:125
LArRawRampContainer.h
LArRampBuilder::initialize
StatusCode initialize()
Definition: LArRampBuilder.cxx:19
LArRampBuilder::m_CaliWaves
std::vector< std::vector< std::vector< std::vector< double > > > > m_CaliWaves
Definition: LArRampBuilder.h:101
LArRampBuilder::m_peakParabolaTool
PublicToolHandle< LArParabolaPeakRecoTool > m_peakParabolaTool
Definition: LArRampBuilder.h:93
LArBadXCont
Conditions-Data class holding LAr Bad Channel or Bad Feb information.
Definition: LArBadChannelCont.h:28
LArOFPeakRecoTool.h
LArRampBuilder::rampfit
StatusCode rampfit(unsigned deg, const std::vector< LArRawRamp::RAMPPOINT_t > &data, std::vector< float > &rampCoeffs, std::vector< int > &vSat, const HWIdentifier chid, const LArOnOffIdMapping *cabling, const LArBadChannelCont *bcCont)
Definition: LArRampBuilder.cxx:755
ReadCellNoiseFromCool.cabling
cabling
Definition: ReadCellNoiseFromCool.py:154
LArRampBuilder::m_groupingType
Gaudi::Property< std::string > m_groupingType
Definition: LArRampBuilder.h:138
deg
#define deg
Definition: SbPolyhedron.cxx:17
LArRampBuilder::m_emId
const LArEM_Base_ID * m_emId
Definition: LArRampBuilder.h:142
LArRampBuilder::m_keyoutput
Gaudi::Property< std::string > m_keyoutput
Definition: LArRampBuilder.h:118
LArRampBuilder
Definition: LArRampBuilder.h:62
LArRampBuilder::m_cablingKeySC
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKeySC
Definition: LArRampBuilder.h:79
LArRampBuilder::m_recoTypeProp
StringProperty m_recoTypeProp
Definition: LArRampBuilder.h:128
HWIdentifier
Definition: HWIdentifier.h:13
LArRampBuilder::m_iterate
Gaudi::Property< bool > m_iterate
Definition: LArRampBuilder.h:146
LArEM_SuperCell_ID.h
Helper class for LArEM offline identifiers for supercells.
LArRampBuilder::m_onlineHelper
const LArOnlineID_Base * m_onlineHelper
Definition: LArRampBuilder.h:141
LArRampBuilder::m_IndexHighestDAC
std::vector< std::vector< int > > m_IndexHighestDAC
Definition: LArRampBuilder.h:106
AthAlgorithm.h
LArRampBuilder::m_degree
IntegerProperty m_degree
Definition: LArRampBuilder.h:120
LArCalibTriggerAccumulator
Helper class to accumulate calibration triggers.
Definition: LArCalibTriggerAccumulator.h:30
LArRampBuilder::m_peakShapeTool
PublicToolHandle< LArShapePeakRecoTool > m_peakShapeTool
Definition: LArRampBuilder.h:94
LArRampBuilder::recoType
recoType
Definition: LArRampBuilder.h:112
LArOnOffIdMapping.h
LArRampBuilder::ACCRAMP
std::map< uint32_t, LArCalibTriggerAccumulator > ACCRAMP
Definition: LArRampBuilder.h:74
LArRampBuilder::m_delay
int m_delay
Definition: LArRampBuilder.h:98
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:88
LArRampBuilder::OF
@ OF
Definition: LArRampBuilder.h:112
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
LArRampBuilder::m_satSlope
BooleanProperty m_satSlope
Definition: LArRampBuilder.h:126
LArRampBuilder::m_doBadChannelMask
Gaudi::Property< bool > m_doBadChannelMask
Definition: LArRampBuilder.h:134
LArRampBuilder::finalize
StatusCode finalize()
Definition: LArRampBuilder.h:72
LArRampBuilder::m_fatalFebErrorPattern
uint16_t m_fatalFebErrorPattern
Definition: LArRampBuilder.h:148
LArAccumulatedCalibDigitContainer.h
LArRampBuilder::chooseRecoMode
void chooseRecoMode()
Definition: LArRampBuilder.cxx:71
LArRampBuilder::m_delayShift
FloatProperty m_delayShift
Definition: LArRampBuilder.h:132
LArRampBuilder::SHAPE
@ SHAPE
Definition: LArRampBuilder.h:112
LArRampBuilder::m_bcContKey
SG::ReadCondHandleKey< LArBadChannelCont > m_bcContKey
Definition: LArRampBuilder.h:136
LArRampBuilder::m_minDAC
UnsignedIntegerProperty m_minDAC
Definition: LArRampBuilder.h:127
AthAlgorithm
Definition: AthAlgorithm.h:47
ReadCondHandleKey.h
LArRampBuilder::m_hec_key
Gaudi::Property< std::string > m_hec_key
Definition: LArRampBuilder.h:139
LArRampBuilder::m_ishec
Gaudi::Property< bool > m_ishec
Definition: LArRampBuilder.h:145
LArOnlineID_Base
Helper for the Liquid Argon Calorimeter cell identifiers.
Definition: LArOnlineID_Base.h:105
LArRampBuilder::m_bcMask
LArBadChannelMask m_bcMask
Definition: LArRampBuilder.h:135
ILArRinj.h
LArRampBuilder::m_event_counter
unsigned m_event_counter
Definition: LArRampBuilder.h:97
LArShapePeakRecoTool.h
LArRampBuilder::m_ipassShape
int m_ipassShape
Definition: LArRampBuilder.h:99
SG::ReadCondHandleKey< LArOnOffIdMapping >
LArRampBuilder::m_cablingKey
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
Definition: LArRampBuilder.h:78
LArRampBuilder::execute
StatusCode execute()
Definition: LArRampBuilder.cxx:122
ILArPedestal.h
LArRampBuilder::m_ramps
std::unique_ptr< LArConditionsContainer< ACCRAMP > > m_ramps
Definition: LArRampBuilder.h:90
LArCalibTriggerAccumulator.h
LArRampBuilder::m_IndexDAC0
std::vector< std::vector< int > > m_IndexDAC0
Definition: LArRampBuilder.h:105
LArParabolaPeakRecoTool.h
LArRampBuilder::m_saveRawRamp
BooleanProperty m_saveRawRamp
Definition: LArRampBuilder.h:124
LArRampBuilder::m_CaliDACs
std::vector< std::vector< std::vector< unsigned int > > > m_CaliDACs
Definition: LArRampBuilder.h:103
LArRampBuilder::m_correctBias
BooleanProperty m_correctBias
Definition: LArRampBuilder.h:130
AthAlgorithm::AthAlgorithm
AthAlgorithm()
Default constructor:
LArRampBuilder::stop
virtual StatusCode stop()
Definition: LArRampBuilder.cxx:383
LArCalibLineMapping.h
LArBadChannelMask.h
LArRampBuilder::m_DAC0
UnsignedIntegerProperty m_DAC0
Definition: LArRampBuilder.h:123
LArRampBuilder::PARABOLA
@ PARABOLA
Definition: LArRampBuilder.h:112
LArRampBuilder::m_problemsToMask
Gaudi::Property< std::vector< std::string > > m_problemsToMask
Definition: LArRampBuilder.h:137
LArBadChannelMask
Definition: LArBadChannelMask.h:18
LArOnOffIdMapping
Definition: LArOnOffIdMapping.h:20