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