SingletonRejectionAna_module.cc
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 // Class: SingletonRejectionAna
3 // Module Type: analyzer
4 // File: SingletonRejectionAna_module.cc
5 //
6 // Generated at Tues June 26 2013 by Will Henderson
7 // Based on NuETriggerAna and MonopoleAna
8 ////////////////////////////////////////////////////////////////////////
9 
10 // Framework includes
15 
16 // NOvADDT includes
20 
21 // ROOT includes
22 #include "TH1F.h"
23 #include "TH2F.h"
24 
25 namespace novaddt {
26  class SingletonRejectionAna;
27 }
28 ///////////////////////////////////////////////////////////////////////
30 
31 public:
33  virtual ~SingletonRejectionAna();
34  void analyze(art::Event const & e) override;
35  void beginJob() override;
36  void endJob() override;
37 
38 private:
39  // Declare member data
42  TH1F* rawADC;
43  TH2F* HitsYZ; // hit locations in YZ view
44  TH2F* HitsXZ; // hit locations in XZ view
45 };
46 ///////////////////////////////////////////////////////////////////////
48  : EDAnalyzer(p),
49  _ModuleLabel(p.get<std::string>("ModuleLabel")),
50  _InstanceLabel(p.get<std::string>("InstanceLabel"))
51 {
52  //Initialize member data
53 }
54 ///////////////////////////////////////////////////////////////////////
56 {
57  // Clean up dynamic memory and other resources
58 }
59 ///////////////////////////////////////////////////////////////////////
61 {
62  // Implementation of member functions
63  mf::LogInfo("SingletonRejectionAna") << "=== novaddt::SingletonRejectionAna Event: " << e.id().event() << " ===" << std::endl;
64 
65  // Input grouped hitlists
67  e.getByLabel(_ModuleLabel, _InstanceLabel, hit_lists);
68 
69  /*
70  // Check for empty GroupedHitList, HitList, or Track
71  if(hit_lists->empty()){
72  mf::LogWarning ("No HitLists")<<"No HitLists in the input file";
73  return;
74  }
75  */
76 
77  for(unsigned int i=0; i < hit_lists->size(); ++i){ // Loop of hitlists
78 
79  HitList hits = hit_lists->at(i);
80 
81  // Loop over hits
82  for(unsigned int j=0; j < hits.size();++j){
83  rawADC -> Fill(hits[j].ADC().val);
84 
85  if (!(hits[j].View().val==daqchannelmap::Y_VIEW)){
86  //XZ projection
87  HitsXZ -> Fill(hits[j].Plane().val, hits[j].Cell().val);
88  } else{
89  //YZ projection
90  HitsYZ -> Fill(hits[j].Plane().val, hits[j].Cell().val);
91  }
92 
93  } //END j
94  } //END i
95 
96  /*
97  // hitProducer (unfiltered, unsliced hitlist example using pointers)
98  art::Handle<novaddt::HitList> hits;
99  evt.getByLabel(hits_label_, hits);
100  std::unique_ptr<HitList> product(new HitList(hits->begin(),hits->end()));
101 
102  auto begin = product->begin();
103  auto end = product->end();
104  for (auto i = begin; i!=end; ++i)
105  {
106  rawADC -> Fill(i->ADC().val);
107  */
108 
109  return;
110 }
111 ///////////////////////////////////////////////////////////////////////
113 {
115 
116  rawADC = f->make<TH1F>("rawADC","Raw ADC",4096,-0.5,4095.5);
117  HitsYZ = f->make<TH2F>("hitsYZ", ";z (cm); y (cm)", 1000, 0., 1000., 200, 0., 200.);
118  HitsXZ = f->make<TH2F>("hitsXZ", ";z (cm); x (cm)", 1000, 0., 1000., 200, 0., 200.);
119 }
120 ///////////////////////////////////////////////////////////////////////
122 {
123  // Implementation of optional member function
124 }
125 ///////////////////////////////////////////////////////////////////////
void analyze(art::Event const &e) override
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
std::vector< DAQHit > HitList
Definition: HitList.h:15
const char * p
Definition: xmltok.h:285
DEFINE_ART_MODULE(TestTMapFile)
Identifier for the Y measuring view of the detector (side)
SingletonRejectionAna(fhicl::ParameterSet const &p)
void hits()
Definition: readHits.C:15
correl_yv Fill(-(dy[iP-1][iC-1]), hyv->GetBinContent(iP, iC))
const double j
Definition: BetheBloch.cxx:29
EDAnalyzer(Table< Config > const &config)
Definition: EDAnalyzer.h:100
Definition: View.py:1
EventNumber_t event() const
Definition: EventID.h:116
T * make(ARGS...args) const
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Definition: DataViewImpl.h:344
Float_t e
Definition: plot.C:35
EventID id() const
Definition: Event.h:56
enum BeamMode string