SpillVars.cxx
Go to the documentation of this file.
2 
3 #include <bitset>
4 
6 
7 namespace ana
8 {
10  [](const caf::SRSpillProxy* spill)
11  {
12  std::bitset<14> binary(spill->dibmask);
13  int totalDB = 0;
14  int countDB = 1;
15  int tmpDB = 0;
16  for (int i=0; i<14; ++i){
17  if (countDB >= spill->dibfirst &&
18  countDB <= spill->diblast && binary[i]) tmpDB++;
19  else if (countDB >= spill->dibfirst &&
20  countDB <= spill->diblast && !binary[i]){
21  if (tmpDB >= 4) totalDB += tmpDB;
22  tmpDB = 0;
23  }
24  countDB++;
25  }
26  if (tmpDB >= 4) totalDB += tmpDB;
27  return totalDB;
28 
29  });
30 
31 
32  ///Return the POT for the spill
33  const Var kSpillPOT = SIMPLEVAR(spill.spillpot);
34 
35  /// Return the Livetime for the spill
37 }
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
caf::Proxy< float > spillpot
Definition: SRProxy.h:1407
caf::Proxy< short unsigned int > dibfirst
Definition: SRProxy.h:1362
#define SIMPLEVAR(CAFNAME)
For Vars where literally all you need is a single CAF variable.
Definition: Var.h:88
caf::Proxy< float > livetime
Definition: SRProxy.h:1379
_Var< caf::SRSpillProxy > SpillVar
Equivalent of Var acting on caf::SRSpill. For use in making plots of POT per run etc.
Definition: Var.h:78
const Var kSpillPOT
Return the POT for the spill.
Definition: SpillVars.cxx:33
Proxy for caf::SRSpill.
Definition: SRProxy.h:1346
caf::Proxy< short unsigned int > dibmask
Definition: SRProxy.h:1364
const SpillVar kAnalysisDiblocks([](const caf::SRSpillProxy *spill){std::bitset< 14 > binary(spill->dibmask);int totalDB=0;int countDB=1;int tmpDB=0;for(int i=0;i< 14;++i){if(countDB >=spill->dibfirst && countDB<=spill->diblast &&binary[i]) tmpDB++;else if(countDB >=spill->dibfirst && countDB<=spill->diblast &&!binary[i]){if(tmpDB >=4) totalDB+=tmpDB;tmpDB=0;}countDB++;}if(tmpDB >=4) totalDB+=tmpDB;return totalDB;})
Return number of analyzable diblocks, taking into account gaps when appropriate.
Definition: SpillVars.h:9
const Var kSpillLivetime
Return the Livetime for the spill.
Definition: SpillVars.cxx:36