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