ATLAS Offline Software
LArCellsEmptyMonitoring.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
11 #ifndef LArSamples_LArCellsEmptyMonitoring_H
12 #define LArSamples_LArCellsEmptyMonitoring_H
13 
15 #include "TString.h"
17 #include <vector>
18 #include <memory>
19 #include <string>
20 
21 namespace LArSamples {
22 
24  {
25 
26  public:
27 
31  LArCellsEmptyMonitoring& operator= (const LArCellsEmptyMonitoring&) = delete;
32  void Run(const TString& inputfile);
33  void Run(const char* inputfile){ TString str(inputfile); Run(str); } // wrapper
34  void TestRun(const TString& inputfile);
35  void TestRun(const char* inputfile){ TString str(inputfile); Run(str); } // wrapper
36 
37  void GetLimits_EqLB(const char* inputfile, int& lbmin, int& lbmax, int& emin, int& emax, int& qmin, int& qmax, int& runNumber, const std::vector<int, std::allocator<int> >& BadLBList);
38  std::vector<int, std::allocator<int> > ReadBadLBList(const TString& LBfile);
39  std::vector<int, std::allocator<int> > GetBadLBList(const char* inputfile, int lbmin, int lbmax, double nsigma, int nlb, const std::vector<int, std::allocator<int> >& DQLBList);
40  bool CheckBadLBList(int lumiBlock, const std::vector<int, std::allocator<int> >& BadLBList);
41  void GetMeanCellHits(const char* inputfile, int nlb, int lbmin, int lbmax, int nsigma, const std::vector<int, std::allocator<int> >& BadLBList, double& MeanHits, double& rmsHits, int& nlb_corr);
42  bool CheckEventSelectionCriteria(int lumiBlock, int nsigma, double energy, Float_t noise, int lbmin, int lbmax);
43  int CheckCellSelectionCriteria(int EventCount, int nsigmaHits, double MeanHits, double rmsHits, int nEvents_E_gt_ecut, double EventEnergySum, int nBadLBs, int nlb) const;
44  bool CheckForPresamplerCells(int index);
45  bool CheckPartition(int index) const;
46 
47 
48  // setters
49  void ReadDefectLBList(bool ReadList, const TString& LBfile);
50 
51  void SetSaveRootFile(bool flag=false){ m_SaveRootFile = flag; }
52  void SetSaveRootTree(bool flag=false){ m_SaveRootTree = flag; }
53  void SetSaveTextFile(bool flag=false){ m_SaveTextFile = flag; }
54  void SetSelectRecurringBadCells(bool flag=false){ m_SelectRecurringBadCells = flag; }
55  void SetAlgo(int algoindex = 2){ m_Algo = algoindex; }
56  void SetNsigmaHitsFromMean(double nsigmahits = 10.){ m_nsigmaHits = nsigmahits; }
57  void SetLumiblockRange(bool inputRange=false, int input_lbmin = 0, int input_lbmax = 0){
58  m_SetLumiblockRange = inputRange;
59  m_input_lbmin = input_lbmin;
60  m_input_lbmax = input_lbmax;
61  }
62  void SetBadLBRemovalOption(bool removeLB=true){ m_RemoveBadLB = removeLB; }
63  void SetQthreshold(int qvalue = 4000){ m_Qthreshold = qvalue; }
64  void SetNoiseNsigma(double nsig = 10.){ m_nsigma = nsig; }
65  void SetEnergyCountThresholds(double ecut = 1., int counts1 = 250, double enecell1 = 1.5, int counts2 = 25, double enecell2 = 30){
66  m_Ethreshold = ecut;
67  m_UpperCountThreshold = counts1;
68  m_LowerCountThreshold = counts2;
69  m_LowerCellEnergyThreshold = enecell1;
70  m_UpperCellEnergyThreshold = enecell2;
71  }
72  void SetPresamplerMask(bool PS = false){ m_MaskPresampler = PS; }
73  void SetCaloMask(bool calo = false){ m_MaskCalo = calo; }
74  void SetPartition(bool setpart, const std::string& partname );
75  std::string GetCryostat(int calo);
76 
77  // satellite functions that do not affect the main Run() functionalities
78  void ScanOnlids(const TString& inputfile);
79  void DoEtaPhiMonitoring(const char* inputfile,const char* optionplot,const char* optionsave);
80  void TriggerEfficiency(const char* inputfile,float fractionInPS=0.8);
81 
82  private:
83 
84  std::unique_ptr<LArIdTranslatorHelper> m_LarIdTranslator; // LArIdTranslator object
85 
87 
88  // int m_PrintLevel; // controls the level of printouts
89  bool m_SaveRootFile; // whether to save output root histos
90  bool m_SaveRootTree; // whether to save output root tree
91  bool m_SaveTextFile; // whether to save output text file
92  int m_Algo; // which algorithm to run
93  bool m_SetLumiblockRange; // allows user to input LB range
96  bool m_RemoveBadLB; // whether to remove bad LBs
98  double m_nsigma;
99  double m_nsigmaHits;
100  double m_Ethreshold;
105  bool m_MaskPresampler = false; // whether to mask the EMBPS
106  bool m_MaskCalo = false; // whether to mask everything but the EMBPS
107  bool m_SelectRecurringBadCells; // whether to only select channels flagged by both algorithms
109  int m_PartitionIndex = 0;
110  std::string m_PartitionName;
111  double m_Mean_checkBadLBs = 0.0;
112  double m_RMS_checkBadLBs = 0.0;
113  bool m_ReadDefectLBList = false;
114  TString m_LBfile;
115 
116  };
117 }
118 
119 #endif
120 
LArSamples::LArCellsEmptyMonitoring::m_LarIdTranslator
std::unique_ptr< LArIdTranslatorHelper > m_LarIdTranslator
Definition: LArCellsEmptyMonitoring.h:84
LArSamples::LArCellsEmptyMonitoring::m_UpperCountThreshold
int m_UpperCountThreshold
Definition: LArCellsEmptyMonitoring.h:101
LArSamples::LArCellsEmptyMonitoring::m_SaveRootFile
bool m_SaveRootFile
Definition: LArCellsEmptyMonitoring.h:89
LArSamples::LArCellsEmptyMonitoring::m_SetPartition
bool m_SetPartition
Definition: LArCellsEmptyMonitoring.h:108
LArSamples::LArCellsEmptyMonitoring::SetSaveRootFile
void SetSaveRootFile(bool flag=false)
Definition: LArCellsEmptyMonitoring.h:51
LArSamples::LArCellsEmptyMonitoring::m_Qthreshold
int m_Qthreshold
Definition: LArCellsEmptyMonitoring.h:97
ATLAS_NOT_THREAD_SAFE
#define ATLAS_NOT_THREAD_SAFE
getNoisyStrip() Find noisy strips from hitmaps and write out into xml/db formats
Definition: checker_macros.h:212
LArSamples::LArCellsEmptyMonitoring::m_nsigmaHits
double m_nsigmaHits
Definition: LArCellsEmptyMonitoring.h:99
LArSamples::LArCellsEmptyMonitoring::SetSaveTextFile
void SetSaveTextFile(bool flag=false)
Definition: LArCellsEmptyMonitoring.h:53
index
Definition: index.py:1
LArSamples::LArCellsEmptyMonitoring::m_input_lbmin
int m_input_lbmin
Definition: LArCellsEmptyMonitoring.h:94
LArSamples::LArCellsEmptyMonitoring::m_Ethreshold
double m_Ethreshold
Definition: LArCellsEmptyMonitoring.h:100
LArSamples::LArCellsEmptyMonitoring::SetSaveRootTree
void SetSaveRootTree(bool flag=false)
Definition: LArCellsEmptyMonitoring.h:52
LArSamples
Definition: AbsShape.h:24
LArSamples::LArCellsEmptyMonitoring::SetAlgo
void SetAlgo(int algoindex=2)
Definition: LArCellsEmptyMonitoring.h:55
LArSamples::LArCellsEmptyMonitoring::m_input_lbmax
int m_input_lbmax
Definition: LArCellsEmptyMonitoring.h:95
LArSamples::LArCellsEmptyMonitoring::SetBadLBRemovalOption
void SetBadLBRemovalOption(bool removeLB=true)
Definition: LArCellsEmptyMonitoring.h:62
LArSamples::LArCellsEmptyMonitoring::Run
void Run(const char *inputfile)
Definition: LArCellsEmptyMonitoring.h:33
LArSamples::LArCellsEmptyMonitoring::SetSelectRecurringBadCells
void SetSelectRecurringBadCells(bool flag=false)
Definition: LArCellsEmptyMonitoring.h:54
LArSamples::LArCellsEmptyMonitoring::m_SaveRootTree
bool m_SaveRootTree
Definition: LArCellsEmptyMonitoring.h:90
Ringer::PS
@ PS
Definition: CaloRingsDefs.h:46
LArSamples::LArCellsEmptyMonitoring::SetNoiseNsigma
void SetNoiseNsigma(double nsig=10.)
Definition: LArCellsEmptyMonitoring.h:64
LArSamples::LArCellsEmptyMonitoring::m_SaveTextFile
bool m_SaveTextFile
Definition: LArCellsEmptyMonitoring.h:91
LArSamples::LArCellsEmptyMonitoring::SetCaloMask
void SetCaloMask(bool calo=false)
Definition: LArCellsEmptyMonitoring.h:73
LArSamples::LArCellsEmptyMonitoring::SetNsigmaHitsFromMean
void SetNsigmaHitsFromMean(double nsigmahits=10.)
Definition: LArCellsEmptyMonitoring.h:56
ParticleGun_FastCalo_ChargeFlip_Config.energy
energy
Definition: ParticleGun_FastCalo_ChargeFlip_Config.py:78
LArIdTranslatorHelper.h
master.flag
bool flag
Definition: master.py:29
LArSamples::LArCellsEmptyMonitoring::m_PartitionName
std::string m_PartitionName
Definition: LArCellsEmptyMonitoring.h:110
LArSamples::LArCellsEmptyMonitoring::m_RemoveBadLB
bool m_RemoveBadLB
Definition: LArCellsEmptyMonitoring.h:96
LArSamples::LArCellsEmptyMonitoring::m_SelectRecurringBadCells
bool m_SelectRecurringBadCells
Definition: LArCellsEmptyMonitoring.h:107
LArSamples::LArCellsEmptyMonitoring::m_nexpected
int m_nexpected
Definition: LArCellsEmptyMonitoring.h:86
LArSamples::LArCellsEmptyMonitoring::m_LowerCountThreshold
int m_LowerCountThreshold
Definition: LArCellsEmptyMonitoring.h:102
LArSamples::LArCellsEmptyMonitoring::m_UpperCellEnergyThreshold
double m_UpperCellEnergyThreshold
Definition: LArCellsEmptyMonitoring.h:104
DeMoAtlasDataLoss.runNumber
string runNumber
Definition: DeMoAtlasDataLoss.py:64
python.CaloScaleNoiseConfig.str
str
Definition: CaloScaleNoiseConfig.py:78
LArSamples::LArCellsEmptyMonitoring::m_nsigma
double m_nsigma
Definition: LArCellsEmptyMonitoring.h:98
FullCPAlgorithmsTest_CA.inputfile
dictionary inputfile
Definition: FullCPAlgorithmsTest_CA.py:59
LArSamples::LArCellsEmptyMonitoring::m_SetLumiblockRange
bool m_SetLumiblockRange
Definition: LArCellsEmptyMonitoring.h:93
compute_lumi.lbmax
lbmax
Definition: compute_lumi.py:37
LArSamples::LArCellsEmptyMonitoring::LArCellsEmptyMonitoring
LArCellsEmptyMonitoring(const LArCellsEmptyMonitoring &)=delete
LArSamples::LArCellsEmptyMonitoring::SetPresamplerMask
void SetPresamplerMask(bool PS=false)
Definition: LArCellsEmptyMonitoring.h:72
LArSamples::LArCellsEmptyMonitoring::m_LowerCellEnergyThreshold
double m_LowerCellEnergyThreshold
Definition: LArCellsEmptyMonitoring.h:103
LArSamples::LArCellsEmptyMonitoring::SetEnergyCountThresholds
void SetEnergyCountThresholds(double ecut=1., int counts1=250, double enecell1=1.5, int counts2=25, double enecell2=30)
Definition: LArCellsEmptyMonitoring.h:65
LArSamples::LArCellsEmptyMonitoring::m_Algo
int m_Algo
Definition: LArCellsEmptyMonitoring.h:92
str
Definition: BTagTrackIpAccessor.cxx:11
LArSamples::LArCellsEmptyMonitoring::m_LBfile
TString m_LBfile
Definition: LArCellsEmptyMonitoring.h:114
LArSamples::LArCellsEmptyMonitoring::SetLumiblockRange
void SetLumiblockRange(bool inputRange=false, int input_lbmin=0, int input_lbmax=0)
Definition: LArCellsEmptyMonitoring.h:57
LArSamples::LArCellsEmptyMonitoring::SetQthreshold
void SetQthreshold(int qvalue=4000)
Definition: LArCellsEmptyMonitoring.h:63
xAOD::lumiBlock
setTeId lumiBlock
Definition: L2StandAloneMuon_v1.cxx:327
checker_macros.h
Define macros for attributes used to control the static checker.
PlotCalibFromCool.partname
partname
Definition: PlotCalibFromCool.py:80
CaloLCWConfig.Run
Run
Definition: CaloLCWConfig.py:39
LArSamples::LArCellsEmptyMonitoring::TestRun
void TestRun(const char *inputfile)
Definition: LArCellsEmptyMonitoring.h:35
WriteCellNoiseToCool.noise
noise
Definition: WriteCellNoiseToCool.py:380
LArSamples::LArCellsEmptyMonitoring
Definition: LArCellsEmptyMonitoring.h:24
compute_lumi.lbmin
lbmin
Definition: compute_lumi.py:37