CheckRawDigit_module.cc
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 // Class: CheckRawDigit
3 // Module Type: analyzer
4 // File: CheckRawDigit_module.cc
5 //
6 // Generated at Wed Jun 1 11:04:07 2016 by Tingjun Yang using artmod
7 // from cetpkgsupport v1_10_01.
8 ////////////////////////////////////////////////////////////////////////
9 
17 #include "fhiclcpp/ParameterSet.h"
19 #include "TH1D.h"
20 #include "lbne-raw-data/Services/ChannelMap/ChannelMapService.h"
21 #include "art_root_io/TFileService.h"
23 
24 namespace dune {
25  class CheckRawDigit;
26 }
27 
29 public:
30  explicit CheckRawDigit(fhicl::ParameterSet const & p);
31  // The destructor generated by the compiler is fine for classes
32  // without bare pointers or other resource use.
33 
34  // Plugins should not be copied or assigned.
35  CheckRawDigit(CheckRawDigit const &) = delete;
36  CheckRawDigit(CheckRawDigit &&) = delete;
37  CheckRawDigit & operator = (CheckRawDigit const &) = delete;
39 
40  // Required functions.
41  void analyze(art::Event const & e) override;
42 
43  // Selected optional functions.
44  void beginJob() override;
45 
46 private:
47 
48  // Declare member data here.
50  TH1D *sig[3][32][28];
52 
53 
54 };
55 
56 
58  :
59  EDAnalyzer(p) // ,
60  // More initializers here.
61 {
62  fRawDigitModuleLabel = p.get<std::string>("RawDigitModuleLabel");
63  fRawDigitModuleInstance = p.get<std::string>("RawDigitModuleInstance");
64 }
65 
67 {
68  // Implementation of required member function here.
71  std::vector<raw::RawDigit> const& rawDigitVector(*rawDigitHandle);
72  //const unsigned int n_channels = fGeom->Nchannels();
73 
74  int count[3][32];
75  for (int i = 0; i<3; ++i){
76  for (int j = 0; j<32; ++j){
77  count[i][j] = 0;
78  }
79  }
80  for (std::vector<raw::RawDigit>::const_iterator digitIt = rawDigitVector.begin(); digitIt != rawDigitVector.end(); ++digitIt) {
81  unsigned int ch = digitIt->Channel(); //offline
82  unsigned int plane = fChannelMap->PlaneFromOfflineChannel(ch);
83  unsigned int rce = fChannelMap->RCEFromOfflineChannel(ch);
84  unsigned int regulator = fChannelMap->RegulatorFromOfflineChannel(ch);
85  float ped = digitIt->GetPedestal();
86  for (unsigned s = 0; s< 15000; ++s){
87  sig[plane][rce*2+regulator][count[plane][rce*2+regulator]]->SetBinContent(s+1,digitIt->ADC(s)-ped);
88  }
89  ++count[plane][rce*2+regulator];
90  }
91 }
92 
94 {
95  // Implementation of optional member function here.
97  for (int i = 0; i<3; ++i){
98  for (int j = 0; j<32; ++j){
99  for (int k = 0; k<28; ++k){
100  sig[i][j][k] = tfs->make<TH1D>(Form("sig_%d_%d_%d",i,j,k),Form("Plane=%d Regulator=%d Channel=%d",i,j,k),15000,0,15000);
101  }
102  }
103  }
104 }
105 
Pedestal provider class for DUNE.
CheckRawDigit & operator=(CheckRawDigit const &)=delete
std::string string
Definition: nybbler.cc:12
Definition of basic raw digits.
intermediate_table::const_iterator const_iterator
void CheckRawDigit(raw::RawDigit const &digits, raw::ChannelID_t channel, unsigned short samples, raw::RawDigit::ADCvector_t const &uncompressed_adclist, raw::Compress_t compression)
EDAnalyzer(fhicl::ParameterSet const &pset)
Definition: EDAnalyzer.h:27
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
Definition: DataViewImpl.h:446
const double e
#define DEFINE_ART_MODULE(klass)
Definition: ModuleMacros.h:69
T get(std::string const &key) const
Definition: ParameterSet.h:231
std::string fRawDigitModuleInstance
CheckRawDigit(fhicl::ParameterSet const &p)
p
Definition: test.py:223
art::ServiceHandle< lbne::ChannelMapService > fChannelMap
void analyze(art::Event const &e) override
static QCString * s
Definition: config.cpp:1042