ATLAS Offline Software
Classes | Functions
LCE_CellList.cxx File Reference
#include <vector>
#include <string>
#include <set>
#include <iostream>
#include "LArSamplesMon/Data.h"
#include "LArSamplesMon/Interface.h"
#include "LArSamplesMon/HistoryIterator.h"
#include "LArSamplesMon/History.h"
#include "LArSamplesMon/LArCellsEmptyMonitoring.h"
#include "LArCafJobs/CellInfo.h"
#include "LArCafJobs/ShapeInfo.h"
#include "LArCafJobs/EventData.h"
#include "LArCafJobs/CaloId.h"
#include "CxxUtils/checker_macros.h"
#include "TROOT.h"
#include "TApplication.h"
#include "TSystem.h"

Go to the source code of this file.

Classes

class  LCE_CellList
 
struct  LCE_CellList::thrCounter_t
 

Functions

int main ATLAS_NOT_THREAD_SAFE (int argc, char **argv)
 

Function Documentation

◆ ATLAS_NOT_THREAD_SAFE()

int main ATLAS_NOT_THREAD_SAFE ( int  argc,
char **  argv 
)

Definition at line 335 of file LCE_CellList.cxx.

335  {
336 
337  if (argc<3 || (argc>1 && (!strcmp(argv[1],"-h") || !strcmp(argv[1],"--help")))) {
338  std::cout << "Syntax:" << std::endl;
339  std::cout << "RunLCE.exe inFile outFile <defectLBfile>" << std::endl;
340  return -1;
341  }
342 
343  const char* inputFile=argv[1];
344  const char* outputFile=argv[2];
345 
346  char* defectsLBFileName=nullptr;
347  if (argc>3)
348  defectsLBFileName=argv[3];
349 
350  TROOT root ("root", "root");
351 #if ROOT_VERSION_CODE < ROOT_VERSION(6,0,0)
352  ROOT::Cintex::Cintex::Enable();
353  #endif
354 
355  gSystem->Load("libLArCafJobsDict.so");
356  gSystem->Load("libLArSamplesMonDict.so");
357 
358 
359  if (gSystem->AccessPathName(inputFile)) {
360  printf("Cannot access file %s.\n",inputFile);
361  return -1;
362  }
363 
364 
365  LCE_CellList lceList;
366 
367  if (defectsLBFileName) {
368  lceList.readDefectLBList(defectsLBFileName);
369  }
370 
371  const float Ethr=1000.0; //1GeV
372  const float nSigma=10.0;
373  const float Qthr=4000;
374  unsigned nLBsSeen=0;
375 
376  printf("Thresholds:\n");
377  printf("\tAbsolute Energy: %.2f MeV\n",Ethr);
378  printf("\tSigma Noise: %.2f\n",nSigma);
379  printf("\tQuality Factor: %.2f\n\n",Qthr);
380 
381  lceList.printThresholds();
382 
383  std::vector<LCE_CellList::thrCounter_t> celllist=lceList.buildList(inputFile, nSigma, Ethr, Qthr, nLBsSeen);
384  printf("Total number of cells read from LCE ntuple: %zu\n",celllist.size());
385  lceList.addFlags(celllist, nLBsSeen);
386  lceList.writeList(outputFile,celllist);
387 
388  return 0;
389 }
LCE_CellList::addFlags
void addFlags(std::vector< LCE_CellList::thrCounter_t > &celllist, const unsigned nLBsSeen) const
Definition: LCE_CellList.cxx:220
LCE_CellList::readDefectLBList
void readDefectLBList(const char *LBfile)
Definition: LCE_CellList.cxx:134
sendEI_SPB.root
root
Definition: sendEI_SPB.py:34
LArCellConditions.argv
argv
Definition: LArCellConditions.py:112
compareGeometries.outputFile
string outputFile
Definition: compareGeometries.py:25
PUfitVar::nSigma
constexpr float nSigma
Definition: GepMETPufitAlg.cxx:16
CaloCondBlobAlgs_fillNoiseFromASCII.inputFile
string inputFile
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:17
LCE_CellList::printThresholds
void printThresholds() const
Definition: LCE_CellList.cxx:120
LCE_CellList
Definition: LCE_CellList.cxx:35
DQHistogramMergeRegExp.argc
argc
Definition: DQHistogramMergeRegExp.py:20
LCE_CellList::buildList
std::vector< LCE_CellList::thrCounter_t > buildList(const char *inputfile, const float nSigma, const float Ethr, const float QThr, unsigned &nLBsSeen) const
Definition: LCE_CellList.cxx:163
LCE_CellList::writeList
void writeList(const char *filename, const std::vector< LCE_CellList::thrCounter_t > &celllist) const
Definition: LCE_CellList.cxx:237