|
| void | setFlaggingThresholds (const float hitsPerLB, const unsigned upperCountThr, const double lowerEThr, const unsigned lowerCountThr, const double upperEThr) |
| void | setListingThresholds (const unsigned minNSeen, const unsigned minAboveSigNoise) |
| void | readDefectLBList (const char *LBfile) |
| bool | checkBadLBList (const unsigned lumiBlock) const |
| std::vector< LCE_CellList::thrCounter_t > | buildList (const char *inputfile, const float nSigma, const float Ethr, const float QThr, unsigned &nLBsSeen) const |
| void | writeList (const char *filename, const std::vector< LCE_CellList::thrCounter_t > &celllist) const |
| void | addFlags (std::vector< LCE_CellList::thrCounter_t > &celllist, const unsigned nLBsSeen) const |
| bool | applySelection (const LCE_CellList::thrCounter_t &counter) const |
| std::string | partitionName (const short caloId, const short slot) const |
| void | printThresholds () const |
Definition at line 37 of file LCE_CellList.cxx.
◆ addFlags()
Definition at line 220 of file LCE_CellList.cxx.
220 {
225
226 }
227
228}
double m_UpperCellEnergyThreshold
double m_LowerCellEnergyThreshold
unsigned m_LowerCountThreshold
unsigned m_UpperCountThreshold
float m_hitCountPerLBThreshold
◆ applySelection()
◆ buildList()
| std::vector< LCE_CellList::thrCounter_t > LCE_CellList::buildList |
( |
const char * | inputfile, |
|
|
const float | nSigma, |
|
|
const float | Ethr, |
|
|
const float | QThr, |
|
|
unsigned & | nLBsSeen ) const |
Definition at line 165 of file LCE_CellList.cxx.
165 {
166
167 std::vector<thrCounter_t> retvec;
168
169 std::set<unsigned> nLBsSeenSet;
170
171 std::unique_ptr<LArSamples::Interface> tuple = Interface::open(inputfile);
172 const unsigned nchannels = tuple->nChannels();
173
174 retvec.reserve(nchannels);
175
176 for (
unsigned ichan=0;
ichan<nchannels;++
ichan) {
177 const LArSamples::History*
hist = tuple->cellHistory(ichan);
178 if (!hist) continue;
179 const LArSamples::CellInfo* cellInfo =
hist->cellInfo();
181
188
189 for (
int iEvent=0;iEvent<
nEvents;++iEvent) {
190 const LArSamples::Data*
data =
hist->data(iEvent);
191 const LArSamples::EventData& Evdata =
data->eventData();
194
195
198 const double quality =
data->quality();
199
201 if (energy > nSigma * noise)
cnt.nAboveSigNoise++;
202 if (energy > Ethr)
cnt.nAboveAbsE++;
203 if (quality > Qthr)
cnt.nAboveQ++;
204 if (!
cnt.bc_status)
cnt.bc_status=
data->status();
206 cnt.LBs.insert(lumiBlock);
207 nLBsSeenSet.insert(lumiBlock);
208 }
209
210 if (
cnt.nSeen>0) retvec.emplace_back(cnt);
211 }
212
213 nLBsSeen=nLBsSeenSet.size();
214 std::cout << "Evaluated a total of " << nLBsSeen << "LBs" << std::endl;
215
216 return retvec;
217
218}
char data[hepevt_bytes_allocation_ATLAS]
short feedThrough() const
unsigned int lumiBlock() const
bool checkBadLBList(const unsigned lumiBlock) const
◆ checkBadLBList()
| bool LCE_CellList::checkBadLBList |
( |
const unsigned | lumiBlock | ) |
const |
|
inline |
◆ partitionName()
| std::string LCE_CellList::partitionName |
( |
const short | caloId, |
|
|
const short | slot ) const |
Definition at line 271 of file LCE_CellList.cxx.
271 {
272
274 std::string slayer=std::to_string(layer);
276
277 switch (caloId) {
281 if (layer==0) slayer="P";
282 break;
286 if (layer==0) slayer="P";
287 break;
288
293 if (layer==0) slayer="P";
294 break;
295
300 if (layer==0) slayer="P";
301 break;
302
306 break;
307
311 break;
312
316 break;
317
321 break;
322
323 default:
325 slayer="";
326 }
327
329}
◆ printThresholds()
| void LCE_CellList::printThresholds |
( |
| ) |
const |
Definition at line 122 of file LCE_CellList.cxx.
122 {
123 printf ("Listing Thresholds:\n");
124 printf (
"\tMin number of appearences in LCE ntuple: %u\n",
m_minNSeen);
126 printf ("Flagging Thresholds:\n");
132}
◆ readDefectLBList()
| void LCE_CellList::readDefectLBList |
( |
const char * | LBfile | ) |
|
Definition at line 136 of file LCE_CellList.cxx.
136 {
137
139 printf(
"Appending to already-existing list of bad lumi-blocks of size %zu\n",
m_badLBs.size());
140
141
142 std::ifstream
infile(LBfile);
144
145
146 std::getline(infile,line,'\n');
148 printf("No bad LBs found in file %s\n" ,(const char*)LBfile);
149 return;
150 }
151
152 for (
size_t pos=0;
pos!=std::string::npos;
pos=
line.find(
',',pos)) {
154
155 unsigned LB=std::atoi(
line.c_str()+pos);
157 }
158
159 printf(
"Number of bad lumi-blocks: %d\n",(
int)
m_badLBs.size());
160
161 return;
162}
◆ setFlaggingThresholds()
| void LCE_CellList::setFlaggingThresholds |
( |
const float | hitsPerLB, |
|
|
const unsigned | upperCountThr, |
|
|
const double | lowerEThr, |
|
|
const unsigned | lowerCountThr, |
|
|
const double | upperEThr ) |
◆ setListingThresholds()
| void LCE_CellList::setListingThresholds |
( |
const unsigned | minNSeen, |
|
|
const unsigned | minAboveSigNoise ) |
◆ writeList()
Definition at line 237 of file LCE_CellList.cxx.
237 {
238 FILE* pFile = fopen (textfilename , "w");
239 if (!pFile) {
240 std::cerr << "Cannot open output file " << textfilename << "\n";
242 }
243
244 fprintf(pFile,"onlid // partition // FT // Slot // channel // nAboveSigNoise // nAboveAbsE // MeanE [GeV] // fracQ4k // nLBs // Algoflag\n");
245
246 for (const auto& cnt : cellList) {
249 if (
cnt.EventEnergyCut) {
251 if (
cnt.MeanCellHitCut)
flag=2;
252 }
253
254
255
256 fprintf(pFile,"0x%8.8x \t %7s \t %i \t %i \t %i \t %i \t %i \t %.3f \t %.3f \t %u \t %u",
259 cnt.Esum/(1000.0*
cnt.nSeen), (
float)
cnt.nAboveQ/
cnt.nSeen,
260 (
unsigned)
cnt.LBs.size(), flag );
261
262
263 fprintf(pFile,"\n");
264 }
265 }
266 fclose(pFile);
267 return;
268}
std::string partitionName(const short caloId, const short slot) const
bool applySelection(const LCE_CellList::thrCounter_t &counter) const
◆ m_badLBs
| std::set<unsigned> LCE_CellList::m_badLBs |
|
private |
◆ m_hitCountPerLBThreshold
| float LCE_CellList::m_hitCountPerLBThreshold =0.01 |
|
private |
◆ m_LowerCellEnergyThreshold
| double LCE_CellList::m_LowerCellEnergyThreshold =1000.0 |
|
private |
◆ m_LowerCountThreshold
| unsigned LCE_CellList::m_LowerCountThreshold =20 |
|
private |
◆ m_minAboveSigNoise
| unsigned LCE_CellList::m_minAboveSigNoise =1 |
|
private |
◆ m_minNSeen
| unsigned LCE_CellList::m_minNSeen =10 |
|
private |
◆ m_UpperCellEnergyThreshold
| double LCE_CellList::m_UpperCellEnergyThreshold =50000.0 |
|
private |
◆ m_UpperCountThreshold
| unsigned LCE_CellList::m_UpperCountThreshold =50 |
|
private |
The documentation for this class was generated from the following file: