All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FluxReader.h
Go to the documentation of this file.
1 #include "fhiclcpp/ParameterSet.h"
2 #include "art/Framework/Core/ProductRegistryHelper.h"
3 #include "art/Framework/IO/Sources/SourceHelper.h"
4 #include "art/Framework/Core/FileBlock.h"
5 #include "art/Framework/Principal/RunPrincipal.h"
6 #include "art/Framework/Principal/SubRunPrincipal.h"
7 #include "art/Framework/Principal/EventPrincipal.h"
8 
9 #include <fstream>
10 #include <vector>
11 #include <map>
12 
13 #include "FluxInterface.h"
14 
15 class TH1D;
16 class TTree;
17 class TFile;
18 
19 namespace fluxr {
20  class FluxReader {
21  public:
22  // Required constructor
23  FluxReader(fhicl::ParameterSet const &pset,
24  art::ProductRegistryHelper &helper,
25  art::SourceHelper const &pm);
26 
27  // Required by FileReaderSource:
28  void closeCurrentFile();
29  void readFile(std::string const &name,
30  art::FileBlock* &fb);
31  bool readNext(art::RunPrincipal* const &inR,
32  art::SubRunPrincipal* const &inSR,
33  art::RunPrincipal* &outR,
34  art::SubRunPrincipal* &outSR,
35  art::EventPrincipal* &outE);
36 
37  private:
38  art::SourceHelper const &fSourceHelper;
39  art::SubRunID fSubRunID;
40 
41  uint32_t fEventCounter;
42  uint32_t fEntry;
43  int fMaxEvents; // fhicl parameter. Maximum number of events.
44  uint32_t fSkipEvents; // fhicl parameter. Number of events to skip.
45  std::string fInputType; // fhicl parameter. Maximum number of events.
46  float fPOT;
47  float fCurrentPOT;
48  bool fSelfIncrementRuns; // fhicl parameter. If true it increments run numbers sequentially
49  art::RunNumber_t fIncrement = 1;
50 
53  TH1D* fHFlux[4];
54  TH1D* fHFluxParent[4][4];
55  TH1D* fHFluxSec[4][5];
56 
57  fhicl::ParameterSet fConfigPS;
58 
59  art::TypeLabel fTLmctruth;
60  art::TypeLabel fTLmcflux;
61  art::TypeLabel fTLdk2nu;
62  art::TypeLabel fTLnuchoice;
63  }; // FluxReader
64 }
65 
66 
TH1D * fHFluxSec[4][5]
Definition: FluxReader.h:55
uint32_t fEntry
Definition: FluxReader.h:42
TH1D * fHFlux[4]
Definition: FluxReader.h:53
art::TypeLabel fTLdk2nu
Definition: FluxReader.h:61
std::string fInputType
Definition: FluxReader.h:45
art::SourceHelper const & fSourceHelper
Definition: FluxReader.h:38
TH1D * fHFluxParent[4][4]
Definition: FluxReader.h:54
art::SubRunID fSubRunID
Definition: FluxReader.h:39
TFile * fFluxInputFile
Definition: FluxReader.h:52
bool readNext(art::RunPrincipal *const &inR, art::SubRunPrincipal *const &inSR, art::RunPrincipal *&outR, art::SubRunPrincipal *&outSR, art::EventPrincipal *&outE)
Definition: FluxReader.cxx:172
void readFile(std::string const &name, art::FileBlock *&fb)
Definition: FluxReader.cxx:133
fhicl::ParameterSet fConfigPS
Definition: FluxReader.h:57
art::TypeLabel fTLnuchoice
Definition: FluxReader.h:62
uint32_t fSkipEvents
Definition: FluxReader.h:44
art::TypeLabel fTLmcflux
Definition: FluxReader.h:60
then echo fcl name
art::TypeLabel fTLmctruth
Definition: FluxReader.h:59
FluxInterface * fFluxDriver
Definition: FluxReader.h:51
uint32_t fEventCounter
Definition: FluxReader.h:41
FluxReader(fhicl::ParameterSet const &pset, art::ProductRegistryHelper &helper, art::SourceHelper const &pm)
Definition: FluxReader.cxx:47
art::RunNumber_t fIncrement
Definition: FluxReader.h:49
bool fSelfIncrementRuns
Definition: FluxReader.h:48