ValidateChannelInfo_module.cc
Go to the documentation of this file.
1 //////////////////////////////////////////////////////////////////////////
2 /// \brief Class to run in order to validate ChannelInfo
3 ///
4 /// \author nowak@umn.edu
5 //////////////////////////////////////////////////////////////////////////
6 
7 #include <vector>
8 #include <iostream>
9 
10 #include "TH1F.h"
11 #include "TH2F.h"
12 
13 // Framework includes
17 
18 
19 // NOvA includes
20 #include "RawData/RawDigit.h"
21 #include "RecoBase/CellHit.h"
22 #include "RecoBase/Cluster.h"
23 
24 
25 namespace validation {
26 
28  public:
29  explicit ValidateChannelInfo(fhicl::ParameterSet const& pset);
30  virtual ~ValidateChannelInfo();
31 
32  void beginJob();
33  void analyze(art::Event const& evt);
34  void reconfigure(const fhicl::ParameterSet& p);
35  void endJob();
36 
37 
38  private:
39 
40  //TH1F* fOccupancy;
41  //TH2F* fPlaneVCell;
42 
43 
44  //int fRun;
45  //int fSubRun;
46  //unsigned int fTriggerType;
47  //int fNevents;
48  //float fTime; ///< Count the time
50  int fCalHits;
51 
52  private:
53  std::string fCalHitModule; ///< Label of the calhit module in the fcl file used
55  };
56 }
57 
58 
59 ////////////////////////////////////////////////////////////////////////
60 
61 namespace validation
62 {
63  //......................................................................
65  EDAnalyzer(p),
66  fRawDigits(0),
67  fCalHits(0)
68  // fTime(0),
69  // fSubRun(-999),
70  // fTriggerType(-999)//, fRawDataLabel(p.get<std::string>("RawDataLabel", "daq"))
71  {
72  this->reconfigure(p);
73  }
74 
75  //......................................................................
77  {
78  //art::ServiceHandle<art::TFileService> f;
79 
80  // Some event-level histograms
81  // fPlaneVCell = f->make<TH2F>("fPlaneVCell",";Plane Number;Cell Number",199,-0.5,198.5,96,-0.5,95.5);
82  // fOccupancy = f->make<TH1F>("fOccupancy",";log of Occupancy;Channels",200,-3.0,0.0);
83 
84  } //End of beginJob
85 
86  //......................................................................
88  {
89  }
90 
91  //........................................................................
93  {
94 
95 
96  // get the RawDigit list
98  evt.getByLabel(fRawDataLabel, digitcol);
99  fRawDigits+= digitcol->size();
100 
101 
103  evt.getByLabel(fCalHitModule, hitcol);
104  fCalHits+=hitcol->size();
105 
106  } //End of analyze
107 
108  //......................................................................
110  {
111 
113  if (fRawDigits == fCalHits) {
114  std::cout<<"Remove this files"<<std::endl;
115 
116  }
117 
118  /*
119  fPlaneVCell->Scale(1.0/(float)fNevents);
120 
121 
122 
123  for (int xbin = 1; xbin <= fPlaneVCell->GetNbinsX(); xbin++) {
124  for (int ybin = 1; ybin <= fPlaneVCell->GetNbinsY(); ybin++) {
125 
126  double cellcontent = fPlaneVCell->GetBinContent(xbin,ybin);
127  double logcontent = -6;
128 
129  if (cellcontent > 0.0) {
130  logcontent = log10(cellcontent);
131  }//End of assigning log to cell content
132 
133  fOccupancy->Fill(logcontent);
134  std::cout<<"plane, cell, occu = ("<<xbin<<","<<ybin<<","<< logcontent<<")"<<std::endl;
135  }//End of loop over y cells
136  }//End of loop over x cells
137 
138 
139  */
140 
141 
142 
143  } //End of DataCheck::endJob
144 
145  //......................................................................
147  {
148  fCalHitModule = p.get<std::string>("CalHitModule");
149  fRawDataLabel = p.get<std::string>("RawDataLabel");
150  }
151 
152 } // end namespace validation
153 
154 
155 ////////////////////////////////////////////////////////////////////////
156 namespace validation
157 {
159 }
160 ////////////////////////////////////////////////////////////////////////
std::string fCalHitModule
Label of the calhit module in the fcl file used.
const char * p
Definition: xmltok.h:285
DEFINE_ART_MODULE(TestTMapFile)
void reconfigure(const fhicl::ParameterSet &p)
Class to run in order to validate ChannelInfo.
T get(std::string const &key) const
Definition: ParameterSet.h:231
int evt
EDAnalyzer(Table< Config > const &config)
Definition: EDAnalyzer.h:100
OStream cout
Definition: OStream.cxx:6
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Definition: DataViewImpl.h:344
ValidateChannelInfo(fhicl::ParameterSet const &pset)
enum BeamMode string