ATLAS Offline Software
Loading...
Searching...
No Matches
LCE_CellList.cxx File Reference
#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"
#include <fstream>
#include <vector>
#include <string>
#include <set>
#include <iostream>

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 339 of file LCE_CellList.cxx.

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