Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ana::Prod4DQFailCheckBase Class Reference

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-11-30/CAFAna/Cuts/Prod4DQFailCheck.h"

Inheritance diagram for ana::Prod4DQFailCheckBase:
ana::Prod4DQFailCheck

Classes

struct  VectorHash
 

Public Member Functions

 Prod4DQFailCheckBase ()
 

Protected Member Functions

void InitialiseSets (const caf::SRSpillProxy *sp) const
 
bool GetCutResult (const caf::SRSpillProxy *sp) const
 

Protected Attributes

const int fNumiTrig = 0
 
const int fCosmTrig = 2
 
const int fFDId = 2
 
const int fIsMC = 1
 
int fFirstTrigger = -99
 
int fFirstIsMC = -99
 
std::unordered_set< std::vector< std::size_t >, VectorHashfSet_Spills_RS
 
std::unordered_set< std::vector< std::size_t >, VectorHashfSet_Spills_RSE
 

Detailed Description

Definition at line 10 of file Prod4DQFailCheck.h.

Constructor & Destructor Documentation

ana::Prod4DQFailCheckBase::Prod4DQFailCheckBase ( )
inline

Definition at line 13 of file Prod4DQFailCheck.h.

13 {}

Member Function Documentation

bool ana::Prod4DQFailCheckBase::GetCutResult ( const caf::SRSpillProxy sp) const
protected

Definition at line 75 of file Prod4DQFailCheck.cxx.

References febshutoff_auto::end, caf::Proxy< caf::SRSpill >::evt, fCosmTrig, fFirstTrigger, fSet_Spills_RS, fSet_Spills_RSE, InitialiseSets(), caf::Proxy< caf::SRSpill >::run, and caf::Proxy< caf::SRSpill >::subrun.

Referenced by ana::Prod4DQFailCheckBase::VectorHash::operator()(), and ana::Prod4DQFailCheck::operator()().

76  {
77  InitialiseSets(sp);
78 
79  bool isBad_RS = (fSet_Spills_RS .find({sp->run, sp->subrun})!=fSet_Spills_RS .end());
80  if(fFirstTrigger==fCosmTrig) return !(isBad_RS);
81  else{
82  bool isBad_RSE = (fSet_Spills_RSE.find({sp->run, sp->subrun, sp->evt})!=fSet_Spills_RSE.end());
83  return !(isBad_RS || isBad_RSE);
84  }
85  }
void InitialiseSets(const caf::SRSpillProxy *sp) const
caf::Proxy< unsigned int > evt
Definition: SRProxy.h:1367
std::unordered_set< std::vector< std::size_t >, VectorHash > fSet_Spills_RS
std::unordered_set< std::vector< std::size_t >, VectorHash > fSet_Spills_RSE
caf::Proxy< unsigned int > subrun
Definition: SRProxy.h:1410
caf::Proxy< unsigned int > run
Definition: SRProxy.h:1406
void ana::Prod4DQFailCheckBase::InitialiseSets ( const caf::SRSpillProxy sp) const
protected

Definition at line 11 of file Prod4DQFailCheck.cxx.

References om::cerr, confusionMatrixTree::count, om::cout, caf::Proxy< caf::SRSpill >::det, allTimeWatchdog::endl, fCosmTrig, fFDId, fFirstTrigger, fNumiTrig, fSet_Spills_RS, fSet_Spills_RSE, ana::run, string, ana::subrun, and caf::Proxy< caf::SRSpill >::trigger.

Referenced by GetCutResult(), and ana::Prod4DQFailCheckBase::VectorHash::operator()().

12  {
13  int thisTrig = sp->trigger;
14  int thisDet = sp->det;
15  if(fFirstTrigger==-99) fFirstTrigger = thisTrig;
16  if(fFirstTrigger!=thisTrig){
17  std::cerr << "TRIGGER STREAM SWITCH, SPILL CUTS WILL NO LONGER BE APPLIED CORRECTLY!" << std::endl;
18  std::abort();
19  }
20  if(fFDId!=thisDet){
21  std::cerr << "NEAR DETECTOR LABEL! THIS CUT ONLY APPLIES TO FD!" << std::endl;
22  std::abort();
23  }
24 
25  if(fSet_Spills_RS.size()>0) return;
26 
27  std::cout << "\n\n\nAPPLYING SPILL CUTS MOTIVATED BY PROD4 SPILL INFO\n\n\n" << std::endl;
28 
29  std::string s_BaseDir = "/cvmfs/nova.osgstorage.org/analysis/3flavor/Cuts/";
30  std::string s_FName_RS = "";
31  std::string s_FName_RSE = "";
32  if(thisTrig==fCosmTrig){
33  s_FName_RS = "SpillTreeFile_kFailsStandardDQCuts_full_WithPatch_ForCosmics_Including_dbmask_RunSubrun_NonDegen.txt";
34  }
35  else if(thisTrig==fNumiTrig){
36  s_FName_RS = "dbmask_RunSubrun_NonDegen.txt";
37  s_FName_RSE = "SpillTreeFile_kFailsStandardDQCuts_full_WithPatch.txt";
38  }
39  else{
40  std::cerr << "TRIGGER TYPE NOT RECOGNISED!" << std::endl;
41  std::abort();
42  }
43 
44  std::ifstream f_SpillList;
45  f_SpillList.open(s_BaseDir+s_FName_RS);
46  std::size_t event, isgoodspill, run, subrun;
47  std::size_t count = 0;
48  while(f_SpillList >> run >> subrun){
49  std::vector<std::size_t> vec_Spill;
50  vec_Spill = {run, subrun};
51  fSet_Spills_RS.insert(vec_Spill);
52  count++;
53  }
54  f_SpillList.close();
55 
56  //std::cout << "COMPARING RS CONTAINER SIZES: " << fSet_Spills_RS.size() << " " << count << std::endl;
57  if(fSet_Spills_RS.size() < count) std::cout << "\n\n\nWARNING!!! SET HAS FEWER LINES THAN INPUT FILE\n\n\n";
58 
59  if(s_FName_RSE!=""){
60  count = 0;
61  f_SpillList.open(s_BaseDir+s_FName_RSE);
62  while(f_SpillList >> event >> isgoodspill >> run >> subrun){
63  std::vector<std::size_t> vec_Spill;
64  vec_Spill = {run, subrun, event};
65  fSet_Spills_RSE.insert(vec_Spill);
66  count++;
67  }
68  //std::cout << "COMPARING RSE CONTAINER SIZES: " << fSet_Spills_RSE.size() << " " << count << std::endl;
69  if(fSet_Spills_RSE.size() < count) std::cout << "\n\n\nWARNING!!! SET HAS FEWER LINES THAN INPUT FILE\n\n\n";
70  }
71 
72  return;
73  }
OStream cerr
Definition: OStream.cxx:7
caf::Proxy< unsigned char > trigger
Definition: SRProxy.h:1411
std::unordered_set< std::vector< std::size_t >, VectorHash > fSet_Spills_RS
std::unordered_set< std::vector< std::size_t >, VectorHash > fSet_Spills_RSE
OStream cout
Definition: OStream.cxx:6
int run
Definition: NusVarsTemp.cxx:51
caf::Proxy< caf::Det_t > det
Definition: SRProxy.h:1361
int subrun
Definition: NusVarsTemp.cxx:52
enum BeamMode string

Member Data Documentation

const int ana::Prod4DQFailCheckBase::fCosmTrig = 2
protected

Definition at line 30 of file Prod4DQFailCheck.h.

Referenced by GetCutResult(), and InitialiseSets().

const int ana::Prod4DQFailCheckBase::fFDId = 2
protected

Definition at line 31 of file Prod4DQFailCheck.h.

Referenced by InitialiseSets().

int ana::Prod4DQFailCheckBase::fFirstIsMC = -99
mutableprotected

Definition at line 34 of file Prod4DQFailCheck.h.

Referenced by ana::Prod4DQFailCheck::operator()().

int ana::Prod4DQFailCheckBase::fFirstTrigger = -99
mutableprotected

Definition at line 33 of file Prod4DQFailCheck.h.

Referenced by GetCutResult(), and InitialiseSets().

const int ana::Prod4DQFailCheckBase::fIsMC = 1
protected

Definition at line 32 of file Prod4DQFailCheck.h.

Referenced by ana::Prod4DQFailCheck::operator()().

const int ana::Prod4DQFailCheckBase::fNumiTrig = 0
protected

Definition at line 29 of file Prod4DQFailCheck.h.

Referenced by InitialiseSets().

std::unordered_set<std::vector<std::size_t>,VectorHash> ana::Prod4DQFailCheckBase::fSet_Spills_RS
mutableprotected

Definition at line 35 of file Prod4DQFailCheck.h.

Referenced by GetCutResult(), and InitialiseSets().

std::unordered_set<std::vector<std::size_t>,VectorHash> ana::Prod4DQFailCheckBase::fSet_Spills_RSE
mutableprotected

Definition at line 36 of file Prod4DQFailCheck.h.

Referenced by GetCutResult(), and InitialiseSets().


The documentation for this class was generated from the following files: