ATLAS Offline Software
Loading...
Searching...
No Matches
TileCisDefaultCalibTool Class Reference

#include <TileCisDefaultCalibTool.h>

Inheritance diagram for TileCisDefaultCalibTool:

Public Member Functions

 TileCisDefaultCalibTool (const std::string &type, const std::string &name, const IInterface *pParent)
virtual ~TileCisDefaultCalibTool ()
virtual StatusCode initialize () override
virtual StatusCode initNtuple (int runNumber, int runType, TFile *rootfile) override
virtual StatusCode execute () override
virtual StatusCode finalizeCalculations () override
virtual StatusCode writeNtuple (int runNumber, int runType, TFile *rootfile) override
virtual StatusCode finalize () override
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Static Public Member Functions

static const InterfaceID & interfaceID ()

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

enum  QualityType {
  includedBit = 0 , calibratedBit = 1 , rangeBit = 2 , probBit = 3 ,
  noiseBit = 4 , injRMSBit = 5 , digiErrorBit = 6 , probChi2Bit = 7 ,
  edgeSamp = 8 , nextToEdgeSamp = 9 , stuckbitBit = 10
}
typedef std::map< uint32_t, int > TDACIntMap
typedef std::map< uint32_t, double > TDACDoubleMap
typedef std::map< uint32_t, double >::iterator TDACDoubleMapIter
typedef std::map< HWIdentifier, TDACIntMap * > TAdcIntMap
typedef std::map< HWIdentifier, TDACDoubleMap * > TAdcDoubleMap
typedef std::map< HWIdentifier, TDACDoubleMap * >::iterator TAdcDoubleMapIter
using Tile = TileCalibUtils
typedef ServiceHandle< StoreGateSvc > StoreGateSvc_t

Private Member Functions

int chanIsConnected (int ros, int chan)
void setBit (QualityType qb, int &bitflag)
void unsetBit (QualityType qb, int &bitflag)
TString arrayString (int ros, int drawer, int chan, int gain)
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

TAdcIntMap m_NEvtMap
TAdcIntMap m_NDigitalErrorsMap
TAdcDoubleMap m_MeanMap
TAdcDoubleMap m_MeanSqMap
const TileHWID * m_tileHWID {nullptr}
const TileCablingService * m_cabling {nullptr}
ServiceHandle< TileCablingSvc > m_cablingSvc
ToolHandle< ITileStuckBitsProbsTool > m_stuckBitsProbs
SG::ReadHandleKey< TileDQstatus > m_dqStatusKey {this, "TileDQstatus", "TileDQstatus"}
SG::ReadHandleKey< TileDigitsContainer > m_digitsContainerKey
SG::ReadHandleKey< TileRawChannelContainer > m_rawChannelContainerKey
std::string m_rawChannelContainerName
Gaudi::Property< std::string > m_ntupleID {this, "NtupleID", "h3000"}
std::string m_DigitsContainerName
Gaudi::Property< bool > m_useSmallCap {this, "useSmallCap", false}
Gaudi::Property< bool > m_removePed {this, "removePed", true}
Gaudi::Property< double > m_maxPed {this, "maxPed", 45.}
Gaudi::Property< double > m_phaseMin {this, "phaseMin", -10}
Gaudi::Property< double > m_phaseMax {this, "phaseMax", 300}
Gaudi::Property< double > m_chargeMaxHi {this, "chargeMaxHi", 12.5}
Gaudi::Property< double > m_chargeMinHi {this, "chargeMinHi", 0.5}
Gaudi::Property< double > m_chargeMaxLo {this, "chargeMaxLo", 800.0}
Gaudi::Property< double > m_chargeMinLo {this, "chargeMinLo", 31.5}
Gaudi::Property< double > m_linfitMaxHi {this, "linfitMaxHi", 10.0}
Gaudi::Property< double > m_linfitMinHi {this, "linfitMinHi", 3.0}
Gaudi::Property< double > m_linfitMaxLo {this, "linfitMaxLo", 700.0}
Gaudi::Property< double > m_linfitMinLo {this, "linfitMinLo", 300.0}
Gaudi::Property< double > m_linfitMaxHiDemo {this, "linfitMaxHiDemo", 20.0}
Gaudi::Property< double > m_linfitMinHiDemo {this, "linfitMinHiDemo", 6.0}
Gaudi::Property< double > m_linfitMaxLoDemo {this, "linfitMaxLoDemo", 700.0}
Gaudi::Property< double > m_linfitMinLoDemo {this, "linfitMinLoDemo", 300.0}
Gaudi::Property< bool > m_doSampleChecking {this, "doSampleChecking", true}
float(* m_calib )[Tile::MAX_DRAWER][Tile::MAX_CHAN][Tile::MAX_GAIN]
int(* m_qflag )[Tile::MAX_DRAWER][Tile::MAX_CHAN][Tile::MAX_GAIN]
int(* m_nDAC )[Tile::MAX_DRAWER][Tile::MAX_CHAN][Tile::MAX_GAIN]
int(* m_nDigitalErrors )[Tile::MAX_DRAWER][Tile::MAX_CHAN][Tile::MAX_GAIN]
float(* m_chi2 )[Tile::MAX_DRAWER][Tile::MAX_CHAN][Tile::MAX_GAIN]
int(* m_edgeSample )[Tile::MAX_DRAWER][Tile::MAX_CHAN][Tile::MAX_GAIN]
int(* m_nextToEdgeSample )[Tile::MAX_DRAWER][Tile::MAX_CHAN][Tile::MAX_GAIN]
int(* m_sampleBit )[Tile::MAX_DRAWER][Tile::MAX_CHAN][Tile::MAX_GAIN][NBITS]
unsigned short(* m_bitStatus )[Tile::MAX_DRAWER][Tile::MAX_CHAN][Tile::MAX_GAIN][NBSTATUS]
int(* m_numSamp )[Tile::MAX_DRAWER][Tile::MAX_CHAN][Tile::MAX_GAIN]
TMap * m_scanMap {nullptr}
TMap * m_scanMapRMS {nullptr}
double m_defaultCalib [4] = {0., 0., 0., 0.}
double m_dac2Charge [4] = {0., 0., 0., 0.}
double m_chargeMin [4] = {0., 0., 0., 0.}
double m_chargeMax [4] = {0., 0., 0., 0.}
double m_linfitMin [4] = {0., 0., 0., 0.}
double m_linfitMax [4] = {0., 0., 0., 0.}
double m_maxAmp [4] = {0., 0., 0., 0.}
Gaudi::Property< std::vector< int > > m_fragIDsDemonstrators
Gaudi::Property< std::string > m_infoName {this, "TileInfoName", "TileInfo"}
const TileInfo * m_tileInfo {nullptr}
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default).
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default).
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Definition at line 41 of file TileCisDefaultCalibTool.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 376 of file AthCommonDataStore.h.

◆ TAdcDoubleMap

Definition at line 80 of file TileCisDefaultCalibTool.h.

◆ TAdcDoubleMapIter

◆ TAdcIntMap

Definition at line 79 of file TileCisDefaultCalibTool.h.

◆ TDACDoubleMap

typedef std::map<uint32_t, double> TileCisDefaultCalibTool::TDACDoubleMap
private

Definition at line 75 of file TileCisDefaultCalibTool.h.

◆ TDACDoubleMapIter

typedef std::map<uint32_t,double>::iterator TileCisDefaultCalibTool::TDACDoubleMapIter
private

Definition at line 76 of file TileCisDefaultCalibTool.h.

◆ TDACIntMap

typedef std::map<uint32_t, int> TileCisDefaultCalibTool::TDACIntMap
private

Definition at line 74 of file TileCisDefaultCalibTool.h.

◆ Tile

Definition at line 142 of file TileCisDefaultCalibTool.h.

Member Enumeration Documentation

◆ QualityType

Constructor & Destructor Documentation

◆ TileCisDefaultCalibTool()

TileCisDefaultCalibTool::TileCisDefaultCalibTool ( const std::string & type,
const std::string & name,
const IInterface * pParent )

Definition at line 33 of file TileCisDefaultCalibTool.cxx.

35 : AthAlgTool(type, name, pParent)
36 , m_cablingSvc("TileCablingSvc", name)
37{
38 declareInterface<ITileCalibTool>(this);
39
40 // Initialize arrays for results
46
47 // Initialize sample check arrays
50
54}
#define NBITS
#define NBSTATUS
AthAlgTool()
Default constructor:
static const unsigned int MAX_ROS
Number of ROSs.
static const unsigned int MAX_GAIN
Number of gains per channel.
static const unsigned int MAX_DRAWER
Number of drawers in ROS 1-4.
static const unsigned int MAX_CHAN
Number of channels in drawer.
int(* m_nextToEdgeSample)[Tile::MAX_DRAWER][Tile::MAX_CHAN][Tile::MAX_GAIN]
float(* m_calib)[Tile::MAX_DRAWER][Tile::MAX_CHAN][Tile::MAX_GAIN]
int(* m_sampleBit)[Tile::MAX_DRAWER][Tile::MAX_CHAN][Tile::MAX_GAIN][NBITS]
int(* m_qflag)[Tile::MAX_DRAWER][Tile::MAX_CHAN][Tile::MAX_GAIN]
int(* m_numSamp)[Tile::MAX_DRAWER][Tile::MAX_CHAN][Tile::MAX_GAIN]
int(* m_nDAC)[Tile::MAX_DRAWER][Tile::MAX_CHAN][Tile::MAX_GAIN]
float(* m_chi2)[Tile::MAX_DRAWER][Tile::MAX_CHAN][Tile::MAX_GAIN]
int(* m_edgeSample)[Tile::MAX_DRAWER][Tile::MAX_CHAN][Tile::MAX_GAIN]
ServiceHandle< TileCablingSvc > m_cablingSvc
unsigned short(* m_bitStatus)[Tile::MAX_DRAWER][Tile::MAX_CHAN][Tile::MAX_GAIN][NBSTATUS]
int(* m_nDigitalErrors)[Tile::MAX_DRAWER][Tile::MAX_CHAN][Tile::MAX_GAIN]

◆ ~TileCisDefaultCalibTool()

TileCisDefaultCalibTool::~TileCisDefaultCalibTool ( )
virtual

Definition at line 56 of file TileCisDefaultCalibTool.cxx.

56 {
57
58 delete[] m_calib;
59 delete[] m_qflag;
60 delete[] m_nDAC;
61 delete[] m_nDigitalErrors;
62 delete[] m_chi2;
63 delete[] m_edgeSample;
64 delete[] m_nextToEdgeSample;
65 delete[] m_sampleBit;
66 delete[] m_bitStatus;
67 delete[] m_numSamp;
68
69}

Member Function Documentation

◆ arrayString()

TString TileCisDefaultCalibTool::arrayString ( int ros,
int drawer,
int chan,
int gain )
inlineprivate

◆ chanIsConnected()

int TileCisDefaultCalibTool::chanIsConnected ( int ros,
int chan )
inlineprivate

Definition at line 184 of file TileCisDefaultCalibTool.h.

184 {
185 if (m_cabling->channel2hole(ros, chan) < 0) return 0; //negative means not connected
186 return 1;
187 }
const TileCablingService * m_cabling

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ execute()

StatusCode TileCisDefaultCalibTool::execute ( )
overridevirtual

Implements ITileCalibTool.

Definition at line 156 of file TileCisDefaultCalibTool.cxx.

156 {
157
158 ATH_MSG_DEBUG( "execute()" );
159
160 // Get the DQ digital check information
161 const EventContext& ctx = Gaudi::Hive::currentContext();
162 const TileDQstatus* theDQstatus = SG::makeHandle (m_dqStatusKey, ctx).get();
163
164 // Get event's CIS parameters
165 const uint32_t *cispar = theDQstatus->cispar();
166 uint32_t dac = cispar[6];
167 uint32_t phase = cispar[5];
168 uint32_t cap = cispar[7];
169 int cap_ind = (cap > 10) ? 0 : 1; // 100 pF or 5 pF
170 double chargeAll[4];
171 for (int i=0; i<4; ++i)
172 chargeAll[i] = dac * m_dac2Charge[i];
173
174 // Check if event should be used in calibration
175 bool pass = true;
176 if (cap == 100 && m_useSmallCap)
177 pass = false;
178 else if (cap == 5 && !m_useSmallCap) pass = false;
179 if (phase > m_phaseMax) pass = false;
180 if (phase < m_phaseMin) pass = false;
181 if (cispar[6] == 120) { // Reject garbage events at the beginning of files. This DAQ
182 pass = false; // setting isn't used during a normal CIS scan FYI.
183 }
184
185 // Get TileRawChannelContainer
186 SG::ReadHandle<TileRawChannelContainer> container(m_rawChannelContainerKey);
187 ATH_CHECK( container.isValid() );
188
189 // Create iterator over RawChannelContainer
190 TileRawChannelContainer::const_iterator itColl = (*container).begin();
191 TileRawChannelContainer::const_iterator itCollEnd = (*container).end();
193
194 if (pass) {
195
196 // Go through all TileRawChannelCollections
197 for (; itColl != itCollEnd; ++itColl) {
198
199 int fragId = (*itColl)->identify();
200 bool demonstrator = (std::binary_search(m_fragIDsDemonstrators.begin(), m_fragIDsDemonstrators.end(), fragId));
201 int gain_offset = (demonstrator) ? 2 : 0;
202 double charge = chargeAll[cap_ind+gain_offset];
203
204 // go through all TileRawChannels in collection
205 it = (*itColl)->begin();
206 itEnd = (*itColl)->end();
207
208 for (; it != itEnd; ++it) {
209
210 // get hardware id to identify adc channel
211 HWIdentifier hwid = (*it)->adc_HWID();
212 int ros = m_tileHWID->ros(hwid); // LBA=1 LBC=2 EBA=3 EBC=4
213 int drawer = m_tileHWID->drawer(hwid); // 0 to 63
214 int chan = m_tileHWID->channel(hwid); // 0 to 47 channel not PMT
215 int gain = m_tileHWID->adc(hwid); // low=0 high=1
216
217 // check if channel is connected
218 // if( !chanIsConnected(ros,chan) ) continue;
219
220 // Is channel empty? DQ version
221 if (theDQstatus->isChEmpty(ros, drawer, chan)) continue;
222
223 // find dac maps for adc channel
224 TDACIntMap *NEvtDacMap = (m_NEvtMap)[hwid];
225 TDACIntMap *NDigitalErrorsDacMap = (m_NDigitalErrorsMap)[hwid];
226 TDACDoubleMap *MeanDacMap = (m_MeanMap)[hwid];
227 TDACDoubleMap *MeanSqDacMap = (m_MeanSqMap)[hwid];
228
229 // create new dac maps if they don't exist
230 if (NEvtDacMap == nullptr) {
231 NEvtDacMap = (m_NEvtMap)[hwid] = new TDACIntMap;
232 NDigitalErrorsDacMap = (m_NDigitalErrorsMap)[hwid] = new TDACIntMap;
233 MeanDacMap = (m_MeanMap)[hwid] = new TDACDoubleMap;
234 MeanSqDacMap = (m_MeanSqMap)[hwid] = new TDACDoubleMap;
235 }
236
237 // check that charge is less than chargeMax (depends on gain)
238 if (charge > m_chargeMin[gain+gain_offset] && charge < m_chargeMax[gain+gain_offset]) {
239
240 double amp = (*it)->amplitude();
241
242 // Hack to get rid of pedestal events: need more sophisticated method!
243 if ( (amp > 40.) || (gain == 0 && amp > 6.) || (!m_removePed) ) {
244
245 // Digital error check
246 if (!(theDQstatus->isAdcDQgood(ros, drawer, chan, gain))) {
247 ATH_MSG_DEBUG( "Skipping Module: " << ros << drawer + 1
248 << " channel: " << chan
249 << " ADC: " << gain
250 << " due to DQ error found." );
251
252 (*NDigitalErrorsDacMap)[dac] += 1;
253 continue;
254
255 } else {
256
257 // increment entries for current dac value
258 (*NEvtDacMap)[dac] += 1;
259 (*MeanDacMap)[dac] += amp;
260 (*MeanSqDacMap)[dac] += amp*amp;
261 }
262
263 }
264
265 } // end if (min < charge < max)
266 }
267 }
268 } // end if pass
269
270 if (m_doSampleChecking) {
271 // Get TileDigitsContainer
272 SG::ReadHandle<TileDigitsContainer> digContainer(m_digitsContainerKey);
273 ATH_CHECK( digContainer.isValid() );
274
275 // Create iterator over RawDigitsContainer
276 TileDigitsContainer::const_iterator digItColl = digContainer->begin();
277 TileDigitsContainer::const_iterator digItCollEnd = digContainer->end();
278
279 for (; digItColl != digItCollEnd; ++digItColl) {
280
281 TileDigitsCollection::const_iterator digIt = (*digItColl)->begin();
282 TileDigitsCollection::const_iterator digItEnd = (*digItColl)->end();
283
284 if (digIt != digItEnd) {
285
286 int fragId = (*digItColl)->identify();
287 bool demonstrator = (std::binary_search(m_fragIDsDemonstrators.begin(), m_fragIDsDemonstrators.end(), fragId));
288 int gain_offset = (demonstrator) ? 2 : 0;
289 double charge = chargeAll[cap_ind+gain_offset];
290
291 HWIdentifier adc_id = (*digIt)->adc_HWID();
292 int ros = m_tileHWID->ros(adc_id); // LBA=1 LBC=2 EBA=3 EBC=4
293 int drawer = m_tileHWID->drawer(adc_id); // 0 to 63
294
295 // not clear how to handle this. if not 7 get off? MM - 4 June 2009
296 int numSamples = (*digIt)->NtimeSamples();
297 if (numSamples != 7) {
298 m_doSampleChecking = false;
299 break;
300 }
301
302 for (; digIt != digItEnd; ++digIt) {
303
304 adc_id = (*digIt)->adc_HWID();
305 int chan = m_tileHWID->channel(adc_id); // 0 to 47 channel not PMT
306 int gain = m_tileHWID->adc(adc_id); // low=0 high=1
307
308 std::vector<float> theDigits = (*digIt)->samples();
309
310 //MM - skip channels with digital errors
311 if (!(theDQstatus->isAdcDQgood(ros, drawer, chan, gain))) {
312 continue;
313 }
314
315 // Loop over samples for bit analysis
316 // We don't need to use the same cuts as the "Edge Sample" analysis
317 for(unsigned int sampNum = 0; sampNum < theDigits.size(); sampNum++) {
318
319 // Count the total number of samples taken by an ADC
320 m_numSamp[ros][drawer][chan][gain] += 1;
321 int k = 0;
322 int quotient = theDigits[sampNum];
323
324 // convert sample to binary number
325 while(quotient!=0) {
326 if((quotient % 2) == 1) {
327 // If the bit is one, store info in the array
328 m_sampleBit[ros][drawer][chan][gain][k] += 1;
329 }
330
331 quotient = quotient / 2;
332 k += 1;
333 } // end binary conversion
334 } //end sample loop
335
336 if (pass && charge > m_linfitMin[gain+gain_offset] && charge < m_linfitMax[gain+gain_offset]) {
337
338 std::vector<float> theDigits = (*digIt)->samples();
339 float maxSampVal = -1.;
340 int maxSampNum = -1;
341
342 for (unsigned int sampNum = 0; sampNum < theDigits.size(); sampNum++) {
343 if (theDigits[sampNum] > maxSampVal) {
344 maxSampVal = theDigits[sampNum];
345 maxSampNum = sampNum + 1;
346 }
347 }
348
349 if (maxSampNum == 1 || maxSampNum == 7) {
351 } else if (maxSampNum == 2 || maxSampNum == 6) {
353 }
354
355 } // end digits iterator
356 }
357 } // end digits collections
358
359 } // end if pass
360
361 } // end m_doSampleChecking
362
363 return StatusCode::SUCCESS;
364}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x,...)
double charge(const T &p)
Definition AtlasPID.h:1054
DataModel_detail::const_iterator< DataVector > const_iterator
Standard const_iterator.
Definition DataVector.h:861
Gaudi::Property< double > m_phaseMax
std::map< uint32_t, int > TDACIntMap
Gaudi::Property< bool > m_useSmallCap
SG::ReadHandleKey< TileRawChannelContainer > m_rawChannelContainerKey
Gaudi::Property< bool > m_removePed
Gaudi::Property< std::vector< int > > m_fragIDsDemonstrators
std::map< uint32_t, double > TDACDoubleMap
SG::ReadHandleKey< TileDQstatus > m_dqStatusKey
Gaudi::Property< bool > m_doSampleChecking
Gaudi::Property< double > m_phaseMin
SG::ReadHandleKey< TileDigitsContainer > m_digitsContainerKey
bool isAdcDQgood(int partition, int drawer, int ch, int gain) const
returns status of single ADC returns False if there are any errors
static int isChEmpty(int partition, int drawer, int ch)
True if channel is not fully implemented.
const uint32_t * cispar() const
CIS parameters.
const SG::AuxVectorData * container() const
Return the container holding this element.
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
setEventNumber uint32_t

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ finalize()

StatusCode TileCisDefaultCalibTool::finalize ( )
overridevirtual

Implements ITileCalibTool.

Definition at line 795 of file TileCisDefaultCalibTool.cxx.

795 {
796
797 ATH_MSG_INFO( "finalize()" );
798
799 return StatusCode::SUCCESS;
800}
#define ATH_MSG_INFO(x,...)

◆ finalizeCalculations()

StatusCode TileCisDefaultCalibTool::finalizeCalculations ( )
overridevirtual

Implements ITileCalibTool.

Definition at line 366 of file TileCisDefaultCalibTool.cxx.

366 {
367
368 ATH_MSG_INFO( "finalizeCalculations()" );
369
370 // The values of 81.454 and 1.295 were derived from runs:
371 // 72652 73305 72653 72661 79259 78023 79781 78026
372 // to calibrate the detector, and looking at the mean good calibration value
373 double meanCalib[4];
374 meanCalib[0] = 1.295;
375 meanCalib[1] = 81.454;
376 // values for demonstrator were taken from run 416970
377 meanCalib[2] = 1.26282;
378 meanCalib[3] = 40.9303;
379
380 // hardware id (key to maps)
381 HWIdentifier hwid;
382
383 // dac maps
384 TDACDoubleMap* MeanDacMap;
385 TDACDoubleMap* MeanSqDacMap;
386 TDACIntMap* NEvtDacMap;
387 TDACIntMap* NDigitalErrorsDacMap;
388
389 // count number of points in dac map (for TGraph)
390 int npt, pt;
391
392 // temporary objects for loop
393 TGraphErrors* gr;
394 TGraphErrors* grrms;
396 double charge, mean, mean2, meansq, rms, err, ratio;
397 int nevt, ndigerr = 0;
398 int badPts;
399 double maxRMS;
400 double maxPointInFitRange;
401
402 // linear fit for the calibration factor
403 TF1 *fslope = new TF1("fslope", "[0]*x", 0, 1000);
404
405 m_scanMap = new TMap(20000, 1);
406 m_scanMapRMS = new TMap(20000, 1);
407
408 // iterators over adc maps
409 TAdcDoubleMapIter adcIter(m_MeanMap.begin());
410 TAdcDoubleMapIter adcIterE(m_MeanMap.end());
411
412 // loop over all adcs
413 for (; adcIter != adcIterE; ++adcIter) {
414 hwid = (adcIter)->first;
415 MeanDacMap = (adcIter)->second;
416 MeanSqDacMap = m_MeanSqMap[hwid];
417 NEvtDacMap = m_NEvtMap[hwid];
418 NDigitalErrorsDacMap = m_NDigitalErrorsMap[hwid];
419
420 int ros = m_tileHWID->ros(hwid); // LBA=1 LBC=2 EBA=3 EBC=4
421 int drawer = m_tileHWID->drawer(hwid); // 0 to 63
422 int chan = m_tileHWID->channel(hwid); // 0 to 47 channel not PMT
423 int gain = m_tileHWID->adc(hwid); // low=0 high=1
424
425 int fragId = (ros << 8) | drawer;
426 bool demonstrator = (std::binary_search(m_fragIDsDemonstrators.begin(), m_fragIDsDemonstrators.end(), fragId));
427 int gain_offset = (demonstrator) ? 2 : 0;
428 int gain_ind = gain + gain_offset;
429 int cap_ind = (m_useSmallCap) ? 1 : 0;
430 double dac2Charge = m_dac2Charge[cap_ind+gain_offset];
431 double prevMean = 0.0, deltaMean = 0.0, averSlope = 0.0;
432 double prevCharge = 0.0, deltaCharge = 0.0, deltaChargeMin = 999999.;
433 double prevSlope = 0.0, slope = 0.0, maxGoodAmp=0.0, minGoodAmp = 999999.;
434 double maxGoodCharge = m_linfitMax[gain_ind], minGoodCharge = 999999.;
435 double maxCharge = 0.0, minCharge = 999999., maxAmp = 0.0, minAmp = 999999.;
436 bool signalInRange = true;
437 int nptGood = 0;
438
439 // find number of points in graph for this adc
440 npt = MeanDacMap->size();
441 m_nDAC[ros][drawer][chan][gain] = npt;
442 gr = new TGraphErrors(npt);
443 grrms = new TGraphErrors(npt);
444
445 if (npt == 0) {
446 m_calib[ros][drawer][chan][gain] = 0;
447 m_chi2[ros][drawer][chan][gain] = 0.0;
448 ATH_MSG_DEBUG( "npt==0 for adc channel "
449 << ros << "/" << drawer << "/" << chan << "/" << gain );
450 } else {
451
452 // update quality flag: adc channel is included in run
453 setBit(includedBit, m_qflag[ros][drawer][chan][gain]);
454
455 // iterator over dacs
456 TDACDoubleMapIter dacIter((*MeanDacMap).begin());
457 TDACDoubleMapIter dacIterE((*MeanDacMap).end());
458
459 // initialize current point
460 pt = 0;
461 badPts = 0;
462 maxPointInFitRange = 0.0;
463 maxRMS = 0.0;
464 for (; dacIter != dacIterE; ++dacIter) {
465 dac = (dacIter)->first;
466 mean = (dacIter)->second;
467 meansq = (*MeanSqDacMap)[dac];
468 nevt = (*NEvtDacMap)[dac];
469 ndigerr = (*NDigitalErrorsDacMap)[dac];
470
471 mean = mean / nevt;
472 mean2 = mean * mean;
473 meansq = meansq / nevt;
474
475 rms = (meansq <= mean2) ? 0. : sqrt(meansq - mean2);
476 err = sqrt(rms * rms / nevt + 0.5 * 0.5); // 0.5 is the absolute systematic uncertainty on the measurement
477
478 // find charge for this dac
479 charge = dac * dac2Charge;
480
481 if (mean < m_maxAmp[gain_ind] ) {
482 if (charge>maxCharge) maxCharge = charge;
483 if (charge<minCharge) minCharge = charge;
484 if (mean>maxAmp) maxAmp = mean;
485 if (mean<minAmp) minAmp = mean;
486 }
487
488 deltaMean = mean - prevMean;
489 deltaCharge = charge - prevCharge;
490 if (deltaCharge != 0) {
491 slope = deltaMean / deltaCharge;
492 if (deltaCharge<deltaChargeMin) deltaChargeMin = deltaCharge;
493 }
494
495 // check for problems in calibration range
496 if (charge > m_linfitMin[gain_ind] && charge < m_linfitMax[gain_ind]) {
497 if (mean > m_maxAmp[gain_ind] ) {
498 signalInRange = false;
499 ATH_MSG_DEBUG( "Too high amp in "
500 << ros << "/" << drawer
501 << "/" << chan << "/" << gain
502 << " charge " << charge
503 << " amp " << mean
504 << " => Ignoring this point ");
505 } else {
506 if (prevSlope != 0) {
507 double R = std::abs(slope/prevSlope);
508 double R1 = (nptGood>1) ? (slope / averSlope) : 1.;
509 if (R<0.025 || (nptGood>2 && R1>2.5 && R>2.5) || (nptGood==2 && R1>4.1) ) {
510 // amplitude not changed (within +/- 2.5%) or changed too much, ignore this point
511 ATH_MSG_WARNING( "Wrong amp in "
512 << ros << "/" << drawer
513 << "/" << chan << "/" << gain
514 << " charge " << charge
515 << " amp " << mean
516 << " dC " << deltaCharge
517 << " dA " << deltaMean
518 << " expected dA " << prevSlope*deltaCharge
519 << " aver dA " << averSlope*deltaCharge
520 << " rms " << rms
521 << " => Removing this point ");
522 continue;
523 }
524 }
525 if (signalInRange) {
526 maxGoodCharge = charge;
527 if (charge<minGoodCharge) minGoodCharge = charge;
528 if (mean>maxGoodAmp) maxGoodAmp = mean;
529 if (mean<minGoodAmp) minGoodAmp = mean;
530 }
531 prevMean = mean;
532 prevCharge = charge;
533 if (slope > 0) {
534 prevSlope = slope;
535 }
536 ++nptGood;
537 averSlope += (slope - averSlope) / nptGood;
538 if (slope < 0) {
539 --nptGood;
540 }
541 if (averSlope < 0) {
542 nptGood = 0;
543 averSlope = 0.;
544 }
545 }
546
547 if (rms < 0.01) badPts++;
548 if (mean > maxPointInFitRange) maxPointInFitRange = mean;
549 if (rms > maxRMS) maxRMS = rms;
550
551 } else if (charge <= m_linfitMin[gain_ind] && charge > 0) {
552
553 slope = mean/charge;
554 if (prevSlope !=0 ) {
555 double R = slope / prevSlope;
556 if (R>0.4 && R<2.5) {
557 prevMean = mean;
558 prevCharge = charge;
559 prevSlope = (prevSlope + slope)/2.;
560 }
561 } else {
562 double R = slope / m_defaultCalib[gain_ind];
563 if (R>0.4 && R<2.5) {
564 prevSlope = slope;
565 }
566 }
567 } else if (nptGood < 3 && signalInRange && charge >= m_linfitMax[gain_ind] && mean < m_maxAmp[gain_ind] && prevSlope != 0) {
568 double R = slope/prevSlope;
569 if (R>0.9 && R<1.1) {
570 maxGoodCharge = charge;
571 if (charge<minGoodCharge) minGoodCharge = charge;
572 ++nptGood;
573 }
574 }
575
576 // set point and errors in tgraph
577 gr->SetPoint(pt, charge, mean);
578 gr->SetPointError(pt, 0.0, err);
579
580 grrms->SetPoint(pt, charge, mean);
581 grrms->SetPointError(pt, 0.0, rms);
582
583 pt++;
584 } // end of for all DAC values
585
586 // remove empty points at the end
587 for (int i=npt-1; i>=pt; --i)
588 gr->RemovePoint(i);
589
590 slope = (prevMean > 0 && prevCharge > 0) ? prevMean/prevCharge : m_defaultCalib[gain_ind];
591 fslope->SetParameter(0, slope);
592 if (maxGoodCharge > m_linfitMax[gain_ind]) {
593 ATH_MSG_WARNING( "Extending fit range for "
594 << ros << "/" << drawer
595 << "/" << chan << "/" << gain
596 << " up to " << maxGoodCharge
597 << " pC; N good points " << nptGood);
598 }
599
600 if (deltaChargeMin>999.) deltaChargeMin = 0.1;
601 else deltaChargeMin *= 0.5;
602 gr->Fit("fslope", "q", "", minGoodCharge-deltaChargeMin, maxGoodCharge+deltaChargeMin);
603 ATH_MSG_VERBOSE( "Fit for "
604 << ros << "/" << drawer
605 << "/" << chan << "/" << gain
606 << " minC " << minGoodCharge
607 << " maxC " << maxGoodCharge
608 << " deltaC " << deltaChargeMin*2
609 << " minA " << minGoodAmp
610 << " maxA " << maxGoodAmp
611 << " nptG " << nptGood
612 << " slope " << slope
613 << " fit " << fslope->GetParameter(0));
614 if (nptGood < 3) {
615 const char * bms[3] = {"No good points to fit ",
616 "Only one point to fit ",
617 "Only two points to fit "};
618 const char * ems[3] = {" => Put zero slope",
619 "",
620 ""};
621 ATH_MSG_WARNING( bms[nptGood]
622 << ros << "/" << drawer
623 << "/" << chan << "/" << gain
624 << " charge " << charge
625 << " amp " << mean
626 << " slope " << slope
627 << " fit " << fslope->GetParameter(0)
628 << ems[nptGood]);
629 }
630 slope = (nptGood > 0) ? fslope->GetParameter(0) : 0.;
631
632 if (slope > 0.) {
633 if (maxGoodCharge > minGoodCharge) {
634 averSlope = (maxGoodAmp-minGoodAmp)/(maxGoodCharge-minGoodCharge);
635 if (slope > 2.5 * averSlope) {
636 ATH_MSG_WARNING( "Average slope and fit slope do not match "
637 << ros << "/" << drawer
638 << "/" << chan << "/" << gain
639 << " charge " << charge
640 << " amp " << mean
641 << " avslope " << averSlope
642 << " fit " << slope
643 << " => Put zero slope");
644 slope = 0.;
645 }
646 } else if (maxCharge > minCharge) {
647 averSlope = (maxAmp-minAmp)/(maxCharge-minCharge);
648 if (slope > 10. * averSlope) {
649 ATH_MSG_WARNING( "AVERAGE slope and fit slope do not match "
650 << ros << "/" << drawer
651 << "/" << chan << "/" << gain
652 << " charge " << charge
653 << " amp " << mean
654 << " AVslope " << averSlope
655 << " fit " << slope
656 << " => Put zero slope");
657 slope = 0.;
658 }
659 }
660 }
661
662 m_nDigitalErrors[ros][drawer][chan][gain] = ndigerr;
663
664 // Set this bit if there aren't any digital errors
665 if (ndigerr == 0) {
666 setBit(digiErrorBit, m_qflag[ros][drawer][chan][gain]);
667 }
668
669 m_calib[ros][drawer][chan][gain] = slope;
670 if (fslope->GetNDF() == 0)
671 m_chi2[ros][drawer][chan][gain] = 0.0;
672 else
673 m_chi2[ros][drawer][chan][gain] = fslope->GetChisquare() / fslope->GetNDF();
674
675 // Set this bit if there is a good Chi2 probability
676 if (TMath::Prob(fslope->GetChisquare(), fslope->GetNDF()) > 2.e-6) {
677 setBit(probChi2Bit, m_qflag[ros][drawer][chan][gain]);
678 }
679
680 // update quality flag if calibration is successful
681 if (!badPts && fslope->GetNDF() > 0) setBit(calibratedBit, m_qflag[ros][drawer][chan][gain]);
682
683 // update quality flag if calibration is within 5% of nominal
684 // saved for legacy support
685 ratio = (slope / m_defaultCalib[gain_ind]);
686 if (ratio > 0.95 && ratio < 1.05) setBit(rangeBit, m_qflag[ros][drawer][chan][gain]);
687
688 // update quality flag if calibration if the probability of this calibration
689 // constant, given a 1.6% gaussian-sigma of the calibration constants, is greater
690 // than 1/10000 (number of channels)
691 //
692 // Mathemica code: NSolve[Erf[x/(1.6*Sqrt[2])] == 0.9999, x]
693 // x -> 6.22495
694 ratio = (slope / meanCalib[gain_ind]);
695 if (ratio > 0.9378 && ratio < 1.0623) setBit(probBit, m_qflag[ros][drawer][chan][gain]);
696
697 // If the maximum response in the fit range is less than 600 ADC counts, then
698 // all the response in most likely noise
699 if (maxPointInFitRange > 600) {
700 setBit(noiseBit, m_qflag[ros][drawer][chan][gain]);
701 }
702
703 // RMS criteria. If any collection of injections at a fixed-charge has
704 // an RMS less than 5 ADC counts, then set this bit.
705 if (maxRMS < 5.0) {
706 setBit(injRMSBit, m_qflag[ros][drawer][chan][gain]);
707 }
708
709 // set the sample check bits
710
711 // this bit is set if there were no events found in the fit range
712 // with the maximum sample value in the first or last sample
713
714 if (m_edgeSample[ros][drawer][chan][gain] == 0) {
715 setBit(edgeSamp, m_qflag[ros][drawer][chan][gain]);
716 }
717 // this bit is set if there were no events found in the fit range
718 // with the maximum sample value in the second or sixth sample
719 if (m_nextToEdgeSample[ros][drawer][chan][gain] == 0) {
720 setBit(nextToEdgeSamp, m_qflag[ros][drawer][chan][gain]);
721 }
722
723 // Determine failure/passing of StuckBit quality flag
724 // And store information about bits in an array
725 // which will be written to the ntuple
726 int NoStuckBit = 1;
727 for(int i = 0; i < NBITS; i++) {
728 // If a bit is stuck at zero...
729 if(m_sampleBit[ros][drawer][chan][gain][i] == 0 && (m_numSamp[ros][drawer][chan][gain] != 0)) {
730 // write information to m_bitStatus array of shorts
731 // each bit in short corresponds to a bit in an adc
732 // with 6 short bits left over
733 m_bitStatus[ros][drawer][chan][gain][0] += (1<<i);
734 NoStuckBit = 0;
735 ATH_MSG_DEBUG( "\n\nBIT STUCK AT ZERO: "
736 << ros << " " << drawer << " " << chan << " " << gain << " " << i << "\n");
737
738 }
739 // Same for a bit stuck at one
740 else if (m_sampleBit[ros][drawer][chan][gain][i] == m_numSamp[ros][drawer][chan][gain] && (m_numSamp[ros][drawer][chan][gain] != 0)) {
741 m_bitStatus[ros][drawer][chan][gain][1] += (1<<i);
742 NoStuckBit = 0;
743 ATH_MSG_DEBUG( "\n\nBIT STUCK AT ONE: "
744 << ros << " " << drawer << " " << chan << " " << gain << " " << i << "\n");
745 }
746 } //end bit loop
747
748 // If no stuck bits are found, this adc passes StuckBit m_qflag
749 if(NoStuckBit) {
750 setBit(stuckbitBit, m_qflag[ros][drawer][chan][gain]);
751 }
752
753 gr->SetName("scan_" + arrayString(ros, drawer, chan, gain));
754 grrms->SetName("scan_" + arrayString(ros, drawer, chan, gain));
755
756 m_scanMap->Add(new TObjString("scan" + arrayString(ros, drawer, chan, gain)), gr);
757 m_scanMapRMS->Add(new TObjString("scan" + arrayString(ros, drawer, chan, gain)), grrms);
758 }
759 }
760 return StatusCode::SUCCESS;
761}
#define ATH_MSG_WARNING(x,...)
#define ATH_MSG_VERBOSE(x,...)
#define gr
std::map< HWIdentifier, TDACDoubleMap * >::iterator TAdcDoubleMapIter
std::map< uint32_t, double >::iterator TDACDoubleMapIter
TString arrayString(int ros, int drawer, int chan, int gain)
void setBit(QualityType qb, int &bitflag)
void mean(std::vector< double > &bins, std::vector< double > &values, const std::vector< std::string > &files, const std::string &histname, const std::string &tplotname, const std::string &label="")
double R(const INavigable4Momentum *p1, const double v_eta, const double v_phi)

◆ initialize()

StatusCode TileCisDefaultCalibTool::initialize ( )
overridevirtual

Implements ITileCalibTool.

Definition at line 71 of file TileCisDefaultCalibTool.cxx.

71 {
72 ATH_MSG_INFO( "initialize()" );
73
74 // get TileHWID helper
75 CHECK( detStore()->retrieve(m_tileHWID) );
76
77 // get TileCabling Service
78 CHECK( m_cablingSvc.retrieve() );
79 m_cabling = m_cablingSvc->cablingService();
80 int runPeriod = m_cabling->runPeriod();
81
82 if (runPeriod==3) {
83 if ( m_fragIDsDemonstrators.empty()) {
84 m_fragIDsDemonstrators.value().push_back (0x10d); // LBA14 is demonstrator in RUN3
85 }
86 }
87
88 if ( not m_fragIDsDemonstrators.empty() ) {
89
90 std::sort(m_fragIDsDemonstrators.value().begin(),m_fragIDsDemonstrators.value().end());
91
92 std::ostringstream os;
93 for (int fragID : m_fragIDsDemonstrators) {
94 os << " 0x" << std::hex << fragID << std::dec;
95 }
96
97 ATH_MSG_INFO("Special settings in histograms for demonstrator modules (frag IDs):" << os.str());
98 }
99
100 CHECK( m_dqStatusKey.initialize() );
101
102 // get TileInfo
103 CHECK( detStore()->retrieve(m_tileInfo, m_infoName) );
104
105 // set important constants
106 m_dac2Charge[0] = 100.* 2.0 * 4.096 / double(m_tileInfo->ADCmax()); // 100 pF * 2 for legacy
107 m_dac2Charge[1] = 5.2 * 2.0 * 4.096 / double(m_tileInfo->ADCmax()); // effective 5.2 pF * 2 for 5 pF capacitor
108 m_dac2Charge[2] = 200.* 4.096 / double(m_tileInfo->ADCmax()); // 200 pF for demonstrator - similar to legacy
109 m_dac2Charge[3] = 5.2 * 4.096 / double(m_tileInfo->ADCmax()); // effective value of small capacitor is twice smaller for demonstrator
110
111 // the same overflow limit for the moment, can be changed later
112 m_maxAmp[0] = m_tileInfo->ADCmax() - m_maxPed;
113 m_maxAmp[1] = m_tileInfo->ADCmax() - m_maxPed;
114 m_maxAmp[2] = m_tileInfo->ADCmax() - m_maxPed;
115 m_maxAmp[3] = m_tileInfo->ADCmax() - m_maxPed;
116
117 m_defaultCalib[0] = 1.29;
118 m_defaultCalib[1] = 81.8;
120 m_defaultCalib[3] = m_defaultCalib[1] / 2;
121
122 if (!m_useSmallCap) {
126 m_chargeMin[3] = m_chargeMinHi * 2;
127 }
128
132 m_chargeMax[3] = m_chargeMaxHi * 2; // high gain in demo is up to 25 pC istead of 12.5 pC
133
138
143
144 ATH_CHECK( m_rawChannelContainerKey.initialize() );
146
147 return StatusCode::SUCCESS;
148}
#define CHECK(...)
Evaluate an expression and check for errors.
const ServiceHandle< StoreGateSvc > & detStore() const
Gaudi::Property< double > m_chargeMinHi
Gaudi::Property< std::string > m_infoName
Gaudi::Property< double > m_chargeMinLo
Gaudi::Property< double > m_linfitMaxLo
Gaudi::Property< double > m_linfitMinLoDemo
Gaudi::Property< double > m_linfitMinHi
Gaudi::Property< double > m_linfitMinHiDemo
Gaudi::Property< double > m_linfitMaxHi
Gaudi::Property< double > m_chargeMaxHi
Gaudi::Property< double > m_chargeMaxLo
Gaudi::Property< double > m_maxPed
Gaudi::Property< double > m_linfitMinLo
Gaudi::Property< double > m_linfitMaxHiDemo
Gaudi::Property< double > m_linfitMaxLoDemo
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.

◆ initNtuple()

StatusCode TileCisDefaultCalibTool::initNtuple ( int runNumber,
int runType,
TFile * rootfile )
overridevirtual

Implements ITileCalibTool.

Definition at line 150 of file TileCisDefaultCalibTool.cxx.

150 {
151 ATH_MSG_INFO( "initialize(" << runNumber << "," << runType << "," << rootFile << ")" );
152
153 return StatusCode::SUCCESS;
154}

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ interfaceID()

const InterfaceID & ITileCalibTool::interfaceID ( )
inlinestaticinherited

Definition at line 21 of file ITileCalibTool.h.

21{ return IID_ITileCalibTool; }
static const InterfaceID IID_ITileCalibTool("ITileCalibTool", 1, 0)

◆ msg()

MsgStream & AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 368 of file AthCommonDataStore.h.

369 {
370 h.renounce();
372 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 352 of file AthCommonDataStore.h.

352 {
354 }

◆ setBit()

void TileCisDefaultCalibTool::setBit ( QualityType qb,
int & bitflag )
inlineprivate

Definition at line 189 of file TileCisDefaultCalibTool.h.

189 {
190 bitflag |= (1 << qb);
191 }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, and AthCheckedComponent<::AthAlgTool >.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ unsetBit()

void TileCisDefaultCalibTool::unsetBit ( QualityType qb,
int & bitflag )
inlineprivate

Definition at line 193 of file TileCisDefaultCalibTool.h.

193 {
194 bitflag &= ~(1 << qb);
195 }

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 298 of file AthCommonDataStore.h.

298 {
299 for (auto &a : m_vhka) {
301 for (auto k : keys) {
302 k->setOwner(this);
303 }
304 }
305 }
std::vector< SG::VarHandleKeyArray * > m_vhka

◆ writeNtuple()

StatusCode TileCisDefaultCalibTool::writeNtuple ( int runNumber,
int runType,
TFile * rootfile )
overridevirtual

Implements ITileCalibTool.

Definition at line 763 of file TileCisDefaultCalibTool.cxx.

763 {
764
765 ATH_MSG_INFO( "writeNtuple(" << runNumber << "," << runType << "," << rootFile << ")" );
766
767 TTree *t = new TTree(m_ntupleID.value().c_str(), "TileCalib-Ntuple");
768 t->Branch("RunNumber", &runNumber, "runNo/I");
769 t->Branch("calib", *m_calib, "calib[5][64][48][2]/F");
770 t->Branch("qflag", *m_qflag, "qflag[5][64][48][2]/I");
771 t->Branch("nDAC", *m_nDAC, "nDAC[5][64][48][2]/I");
772 t->Branch("nDigitalErrors", *m_nDigitalErrors, "nDigitalErrors[5][64][48][2]/I");
773 t->Branch("chi2", *m_chi2, "chi2[5][64][48][2]/F");
774 t->Branch("BitStatus", *m_bitStatus, "BitStatus[5][64][48][2][4]/s");
775
776 if (!m_stuckBitsProbs.empty()) {
777 if (m_stuckBitsProbs.retrieve().isFailure()) {
778 ATH_MSG_WARNING("Impossible to get ITileStuckBitsProbsTool and stuck bits probabilities!");
779 } else {
780 m_stuckBitsProbs->saveStuckBitsProbabilities(t);
781 }
782 }
783
784 // Fill with current values (i.e. tree will have only one entry for this whole run)
785 t->Fill();
786 t->Write();
787
788 // Save graphs for all calibrated adc channels
789 m_scanMap->Write("cisScans", TObject::kSingleKey);
790 m_scanMapRMS->Write("cisScansRMS", TObject::kSingleKey);
791
792 return StatusCode::SUCCESS;
793}
Gaudi::Property< std::string > m_ntupleID
ToolHandle< ITileStuckBitsProbsTool > m_stuckBitsProbs

Member Data Documentation

◆ m_bitStatus

unsigned short(* TileCisDefaultCalibTool::m_bitStatus)[Tile::MAX_DRAWER][Tile::MAX_CHAN][Tile::MAX_GAIN][NBSTATUS]
private

Definition at line 162 of file TileCisDefaultCalibTool.h.

◆ m_cabling

const TileCablingService* TileCisDefaultCalibTool::m_cabling {nullptr}
private

Definition at line 92 of file TileCisDefaultCalibTool.h.

92{nullptr};

◆ m_cablingSvc

ServiceHandle<TileCablingSvc> TileCisDefaultCalibTool::m_cablingSvc
private

Definition at line 93 of file TileCisDefaultCalibTool.h.

◆ m_calib

float(* TileCisDefaultCalibTool::m_calib)[Tile::MAX_DRAWER][Tile::MAX_CHAN][Tile::MAX_GAIN]
private

Definition at line 144 of file TileCisDefaultCalibTool.h.

◆ m_chargeMax

double TileCisDefaultCalibTool::m_chargeMax[4] = {0., 0., 0., 0.}
private

Definition at line 172 of file TileCisDefaultCalibTool.h.

172{0., 0., 0., 0.};

◆ m_chargeMaxHi

Gaudi::Property<double> TileCisDefaultCalibTool::m_chargeMaxHi {this, "chargeMaxHi", 12.5}
private

Definition at line 122 of file TileCisDefaultCalibTool.h.

122{this, "chargeMaxHi", 12.5};

◆ m_chargeMaxLo

Gaudi::Property<double> TileCisDefaultCalibTool::m_chargeMaxLo {this, "chargeMaxLo", 800.0}
private

Definition at line 124 of file TileCisDefaultCalibTool.h.

124{this, "chargeMaxLo", 800.0};

◆ m_chargeMin

double TileCisDefaultCalibTool::m_chargeMin[4] = {0., 0., 0., 0.}
private

Definition at line 171 of file TileCisDefaultCalibTool.h.

171{0., 0., 0., 0.};

◆ m_chargeMinHi

Gaudi::Property<double> TileCisDefaultCalibTool::m_chargeMinHi {this, "chargeMinHi", 0.5}
private

Definition at line 123 of file TileCisDefaultCalibTool.h.

123{this, "chargeMinHi", 0.5};

◆ m_chargeMinLo

Gaudi::Property<double> TileCisDefaultCalibTool::m_chargeMinLo {this, "chargeMinLo", 31.5}
private

Definition at line 125 of file TileCisDefaultCalibTool.h.

125{this, "chargeMinLo", 31.5};

◆ m_chi2

float(* TileCisDefaultCalibTool::m_chi2)[Tile::MAX_DRAWER][Tile::MAX_CHAN][Tile::MAX_GAIN]
private

Definition at line 148 of file TileCisDefaultCalibTool.h.

◆ m_dac2Charge

double TileCisDefaultCalibTool::m_dac2Charge[4] = {0., 0., 0., 0.}
private

Definition at line 170 of file TileCisDefaultCalibTool.h.

170{0., 0., 0., 0.};

◆ m_defaultCalib

double TileCisDefaultCalibTool::m_defaultCalib[4] = {0., 0., 0., 0.}
private

Definition at line 169 of file TileCisDefaultCalibTool.h.

169{0., 0., 0., 0.};

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default).

Definition at line 381 of file AthCommonDataStore.h.

◆ m_digitsContainerKey

SG::ReadHandleKey<TileDigitsContainer> TileCisDefaultCalibTool::m_digitsContainerKey
private
Initial value:
{this,
"TileDigitsContainer", "TileDigitsCnt", "Tile digits container"}

Definition at line 98 of file TileCisDefaultCalibTool.h.

98 {this,
99 "TileDigitsContainer", "TileDigitsCnt", "Tile digits container"};

◆ m_DigitsContainerName

std::string TileCisDefaultCalibTool::m_DigitsContainerName
private

Definition at line 105 of file TileCisDefaultCalibTool.h.

◆ m_doSampleChecking

Gaudi::Property<bool> TileCisDefaultCalibTool::m_doSampleChecking {this, "doSampleChecking", true}
private

Definition at line 140 of file TileCisDefaultCalibTool.h.

140{this, "doSampleChecking", true};

◆ m_dqStatusKey

SG::ReadHandleKey<TileDQstatus> TileCisDefaultCalibTool::m_dqStatusKey {this, "TileDQstatus", "TileDQstatus"}
private

Definition at line 97 of file TileCisDefaultCalibTool.h.

97{this, "TileDQstatus", "TileDQstatus"};

◆ m_edgeSample

int(* TileCisDefaultCalibTool::m_edgeSample)[Tile::MAX_DRAWER][Tile::MAX_CHAN][Tile::MAX_GAIN]
private

Definition at line 153 of file TileCisDefaultCalibTool.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default).

Definition at line 378 of file AthCommonDataStore.h.

◆ m_fragIDsDemonstrators

Gaudi::Property<std::vector<int> > TileCisDefaultCalibTool::m_fragIDsDemonstrators
private
Initial value:
{this, "FragIDsDemonstrators", {},
"List of Tile frag IDs of demonstrators, which have different CIS circuits than the legacy ones"}

Definition at line 176 of file TileCisDefaultCalibTool.h.

176 {this, "FragIDsDemonstrators", {},
177 "List of Tile frag IDs of demonstrators, which have different CIS circuits than the legacy ones"};

◆ m_infoName

Gaudi::Property<std::string> TileCisDefaultCalibTool::m_infoName {this, "TileInfoName", "TileInfo"}
private

Definition at line 180 of file TileCisDefaultCalibTool.h.

180{this, "TileInfoName", "TileInfo"};

◆ m_linfitMax

double TileCisDefaultCalibTool::m_linfitMax[4] = {0., 0., 0., 0.}
private

Definition at line 174 of file TileCisDefaultCalibTool.h.

174{0., 0., 0., 0.};

◆ m_linfitMaxHi

Gaudi::Property<double> TileCisDefaultCalibTool::m_linfitMaxHi {this, "linfitMaxHi", 10.0}
private

Definition at line 128 of file TileCisDefaultCalibTool.h.

128{this, "linfitMaxHi", 10.0};

◆ m_linfitMaxHiDemo

Gaudi::Property<double> TileCisDefaultCalibTool::m_linfitMaxHiDemo {this, "linfitMaxHiDemo", 20.0}
private

Definition at line 134 of file TileCisDefaultCalibTool.h.

134{this, "linfitMaxHiDemo", 20.0};

◆ m_linfitMaxLo

Gaudi::Property<double> TileCisDefaultCalibTool::m_linfitMaxLo {this, "linfitMaxLo", 700.0}
private

Definition at line 130 of file TileCisDefaultCalibTool.h.

130{this, "linfitMaxLo", 700.0};

◆ m_linfitMaxLoDemo

Gaudi::Property<double> TileCisDefaultCalibTool::m_linfitMaxLoDemo {this, "linfitMaxLoDemo", 700.0}
private

Definition at line 136 of file TileCisDefaultCalibTool.h.

136{this, "linfitMaxLoDemo", 700.0};

◆ m_linfitMin

double TileCisDefaultCalibTool::m_linfitMin[4] = {0., 0., 0., 0.}
private

Definition at line 173 of file TileCisDefaultCalibTool.h.

173{0., 0., 0., 0.};

◆ m_linfitMinHi

Gaudi::Property<double> TileCisDefaultCalibTool::m_linfitMinHi {this, "linfitMinHi", 3.0}
private

Definition at line 129 of file TileCisDefaultCalibTool.h.

129{this, "linfitMinHi", 3.0};

◆ m_linfitMinHiDemo

Gaudi::Property<double> TileCisDefaultCalibTool::m_linfitMinHiDemo {this, "linfitMinHiDemo", 6.0}
private

Definition at line 135 of file TileCisDefaultCalibTool.h.

135{this, "linfitMinHiDemo", 6.0};

◆ m_linfitMinLo

Gaudi::Property<double> TileCisDefaultCalibTool::m_linfitMinLo {this, "linfitMinLo", 300.0}
private

Definition at line 131 of file TileCisDefaultCalibTool.h.

131{this, "linfitMinLo", 300.0};

◆ m_linfitMinLoDemo

Gaudi::Property<double> TileCisDefaultCalibTool::m_linfitMinLoDemo {this, "linfitMinLoDemo", 300.0}
private

Definition at line 137 of file TileCisDefaultCalibTool.h.

137{this, "linfitMinLoDemo", 300.0};

◆ m_maxAmp

double TileCisDefaultCalibTool::m_maxAmp[4] = {0., 0., 0., 0.}
private

Definition at line 175 of file TileCisDefaultCalibTool.h.

175{0., 0., 0., 0.};

◆ m_maxPed

Gaudi::Property<double> TileCisDefaultCalibTool::m_maxPed {this, "maxPed", 45.}
private

Definition at line 114 of file TileCisDefaultCalibTool.h.

114{this, "maxPed", 45.};

◆ m_MeanMap

TAdcDoubleMap TileCisDefaultCalibTool::m_MeanMap
private

Definition at line 87 of file TileCisDefaultCalibTool.h.

◆ m_MeanSqMap

TAdcDoubleMap TileCisDefaultCalibTool::m_MeanSqMap
private

Definition at line 88 of file TileCisDefaultCalibTool.h.

◆ m_nDAC

int(* TileCisDefaultCalibTool::m_nDAC)[Tile::MAX_DRAWER][Tile::MAX_CHAN][Tile::MAX_GAIN]
private

Definition at line 146 of file TileCisDefaultCalibTool.h.

◆ m_nDigitalErrors

int(* TileCisDefaultCalibTool::m_nDigitalErrors)[Tile::MAX_DRAWER][Tile::MAX_CHAN][Tile::MAX_GAIN]
private

Definition at line 147 of file TileCisDefaultCalibTool.h.

◆ m_NDigitalErrorsMap

TAdcIntMap TileCisDefaultCalibTool::m_NDigitalErrorsMap
private

Definition at line 86 of file TileCisDefaultCalibTool.h.

◆ m_NEvtMap

TAdcIntMap TileCisDefaultCalibTool::m_NEvtMap
private

Definition at line 85 of file TileCisDefaultCalibTool.h.

◆ m_nextToEdgeSample

int(* TileCisDefaultCalibTool::m_nextToEdgeSample)[Tile::MAX_DRAWER][Tile::MAX_CHAN][Tile::MAX_GAIN]
private

Definition at line 154 of file TileCisDefaultCalibTool.h.

◆ m_ntupleID

Gaudi::Property<std::string> TileCisDefaultCalibTool::m_ntupleID {this, "NtupleID", "h3000"}
private

Definition at line 104 of file TileCisDefaultCalibTool.h.

104{this, "NtupleID", "h3000"};

◆ m_numSamp

int(* TileCisDefaultCalibTool::m_numSamp)[Tile::MAX_DRAWER][Tile::MAX_CHAN][Tile::MAX_GAIN]
private

Definition at line 164 of file TileCisDefaultCalibTool.h.

◆ m_phaseMax

Gaudi::Property<double> TileCisDefaultCalibTool::m_phaseMax {this, "phaseMax", 300}
private

Definition at line 118 of file TileCisDefaultCalibTool.h.

118{this, "phaseMax", 300};

◆ m_phaseMin

Gaudi::Property<double> TileCisDefaultCalibTool::m_phaseMin {this, "phaseMin", -10}
private

Definition at line 117 of file TileCisDefaultCalibTool.h.

117{this, "phaseMin", -10};

◆ m_qflag

int(* TileCisDefaultCalibTool::m_qflag)[Tile::MAX_DRAWER][Tile::MAX_CHAN][Tile::MAX_GAIN]
private

Definition at line 145 of file TileCisDefaultCalibTool.h.

◆ m_rawChannelContainerKey

SG::ReadHandleKey<TileRawChannelContainer> TileCisDefaultCalibTool::m_rawChannelContainerKey
private
Initial value:
{this,
"TileRawChannelContainer", "TileRawChannelFit", "Tile raw channel container"}

Definition at line 100 of file TileCisDefaultCalibTool.h.

100 {this,
101 "TileRawChannelContainer", "TileRawChannelFit", "Tile raw channel container"};

◆ m_rawChannelContainerName

std::string TileCisDefaultCalibTool::m_rawChannelContainerName
private

Definition at line 103 of file TileCisDefaultCalibTool.h.

◆ m_removePed

Gaudi::Property<bool> TileCisDefaultCalibTool::m_removePed {this, "removePed", true}
private

Definition at line 111 of file TileCisDefaultCalibTool.h.

111{this, "removePed", true};

◆ m_sampleBit

int(* TileCisDefaultCalibTool::m_sampleBit)[Tile::MAX_DRAWER][Tile::MAX_CHAN][Tile::MAX_GAIN][NBITS]
private

Definition at line 159 of file TileCisDefaultCalibTool.h.

◆ m_scanMap

TMap* TileCisDefaultCalibTool::m_scanMap {nullptr}
private

Definition at line 166 of file TileCisDefaultCalibTool.h.

166{nullptr};

◆ m_scanMapRMS

TMap* TileCisDefaultCalibTool::m_scanMapRMS {nullptr}
private

Definition at line 167 of file TileCisDefaultCalibTool.h.

167{nullptr};

◆ m_stuckBitsProbs

ToolHandle<ITileStuckBitsProbsTool> TileCisDefaultCalibTool::m_stuckBitsProbs
private
Initial value:
{this,
"StuckBitsProbsTool","","Tile stuck bits probabilities tool"}

Definition at line 94 of file TileCisDefaultCalibTool.h.

94 {this,
95 "StuckBitsProbsTool","","Tile stuck bits probabilities tool"};

◆ m_tileHWID

const TileHWID* TileCisDefaultCalibTool::m_tileHWID {nullptr}
private

Definition at line 91 of file TileCisDefaultCalibTool.h.

91{nullptr};

◆ m_tileInfo

const TileInfo* TileCisDefaultCalibTool::m_tileInfo {nullptr}
private

Definition at line 181 of file TileCisDefaultCalibTool.h.

181{nullptr};

◆ m_useSmallCap

Gaudi::Property<bool> TileCisDefaultCalibTool::m_useSmallCap {this, "useSmallCap", false}
private

Definition at line 107 of file TileCisDefaultCalibTool.h.

107{this, "useSmallCap", false};

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 387 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 386 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files: