Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
highe::HighEnergyAna Class Reference
Inheritance diagram for highe::HighEnergyAna:
art::EDAnalyzer art::EventObserverBase art::Consumer art::EngineCreator

Public Types

using WorkerType = WorkerT< EDAnalyzer >
 
using ModuleType = EDAnalyzer
 

Public Member Functions

 HighEnergyAna (fhicl::ParameterSet const &p)
 
virtual ~HighEnergyAna ()
 
void analyze (art::Event const &e) override
 
void beginJob () override
 
std::string workerType () const
 
bool modifiesEvent () const
 
void registerProducts (MasterProductRegistry &, ProductDescriptions &, ModuleDescription const &)
 
std::string const & processName () const
 
bool wantAllEvents () const
 
bool wantEvent (Event const &e)
 
fhicl::ParameterSetID selectorConfig () const
 
art::Handle< art::TriggerResultsgetTriggerResults (Event const &e) const
 
template<typename T , BranchType = InEvent>
ProductToken< Tconsumes (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< Tconsumes (InputTag const &it)
 
template<typename T , BranchType = InEvent>
void consumesMany ()
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > consumesView (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ViewToken< TconsumesView (InputTag const &it)
 
template<typename T , BranchType = InEvent>
ProductToken< TmayConsume (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< TmayConsume (InputTag const &it)
 
template<typename T , BranchType = InEvent>
void mayConsumeMany ()
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > mayConsumeView (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ViewToken< TmayConsumeView (InputTag const &it)
 
base_engine_tcreateEngine (seed_t seed)
 
base_engine_tcreateEngine (seed_t seed, std::string const &kind_of_engine_to_make)
 
base_engine_tcreateEngine (seed_t seed, std::string const &kind_of_engine_to_make, label_t const &engine_label)
 
seed_t get_seed_value (fhicl::ParameterSet const &pset, char const key[]="seed", seed_t const implicit_seed=-1)
 

Static Public Member Functions

static cet::exempt_ptr< Consumernon_module_context ()
 

Protected Member Functions

CurrentProcessingContext const * currentContext () const
 
detail::CachedProducts & cachedProducts ()
 
void validateConsumedProduct (BranchType const bt, ProductInfo const &pi)
 
void prepareForJob (fhicl::ParameterSet const &pset)
 
void showMissingConsumes () const
 

Private Types

typedef std::tuple< unsigned, double, double > Binning
 

Private Member Functions

void make_histo (std::string const name, std::string const title, Binning const &bin)
 

Private Attributes

std::string slice_label_
 
std::string slice_instance_
 
std::map< std::string, TH1 * > h_
 
std::map< std::string, TH2 * > h2_
 
art::ServiceHandle< art::TFileServicetfs_
 

Detailed Description

Definition at line 24 of file HighEnergyAna_module.cc.

Member Typedef Documentation

typedef std::tuple<unsigned, double, double> highe::HighEnergyAna::Binning
private

Definition at line 34 of file HighEnergyAna_module.cc.

Definition at line 39 of file EDAnalyzer.h.

Definition at line 38 of file EDAnalyzer.h.

Constructor & Destructor Documentation

highe::HighEnergyAna::HighEnergyAna ( fhicl::ParameterSet const &  p)
explicit

Definition at line 46 of file HighEnergyAna_module.cc.

46  :
47  EDAnalyzer(p),
48  slice_label_(p.get<std::string>("slice_label")),
49  slice_instance_(p.get<std::string>("slice_instance"))
50 {
51 }
const char * p
Definition: xmltok.h:285
EDAnalyzer(Table< Config > const &config)
Definition: EDAnalyzer.h:100
enum BeamMode string
highe::HighEnergyAna::~HighEnergyAna ( )
virtual

Definition at line 53 of file HighEnergyAna_module.cc.

54 {
55 }

Member Function Documentation

void highe::HighEnergyAna::analyze ( art::Event const &  e)
overridevirtual

Implements art::EDAnalyzer.

Definition at line 110 of file HighEnergyAna_module.cc.

References DEFINE_ART_MODULE(), art::Handle< T >::failedToGet(), Fill(), art::DataViewImpl::getByLabel(), h2_, h_, getGoodRuns4SAM::n, PandAna.Demos.demo1::range, slice_instance_, slice_label_, and submit_syst::y.

111 {
112  art::Handle<novaddt::HitList> sorted_hits;
113  e.getByLabel("tdcsort", "TDCSortedHits", sorted_hits);
114 
116  e.getByLabel(slice_label_, slice_instance_, slices);
117 
119  e.getByLabel("highetrigger", decisions);
120 
121  h_["counter"]->Fill("event", 1);
122 
123  int y;
124 
125  if (!decisions.failedToGet())
126  {
127  if (decisions->size() == 1)
128  h_["counter"]->Fill("HE triggered", 1);
129 
130  if (decisions->size() > 1)
131  h_["counter"]->Fill("multiple HE triggered", 1);
132  }
133 
134  for (auto const& hit : *sorted_hits)
135  h_["adc_all_hits_raw"]->Fill(hit.ADC().val);
136 
137 
138  for (auto const& slice : *slices)
139  {
140  // h_["counter"]->Fill("slice", 1);
141 
142  double adc_sum = 0.0;
143  double adc_sum_above_200 = 0.0;
144  std::map<unsigned, unsigned> n_hits =
145  {{0, 0}, {200, 0}, {700, 0}, {1000, 0}, {2000, 0}};
146 
147  for (auto const& hit : slice)
148  {
149  // h_["counter"]->Fill("hit", 1);
150 
151  h_["plane_all_hits"]->Fill(hit.Plane().val);
152  h_["cell_all_hits"]->Fill(hit.Cell().val);
153 
154  auto adc = hit.ADC().val;
155  h_["adc_all_hits"]->Fill(adc);
156  adc_sum += adc;
157 
158  if (adc >= 200)
159  adc_sum_above_200 += adc;
160 
161  // we are looking for hits that have an energy above the thresholds
162  // in n_hits
163  for (auto & n : n_hits)
164  if (adc >= n.first)
165  ++n.second;
166  }
167 
168  double adc_mean;
169  unsigned adc_min, adc_max;
170  if (slice.size() > 0)
171  {
172  adc_mean = adc_sum / double(slice.size());
173  auto range =
174  std::minmax_element(slice.begin(), slice.end(),
176  adc_min = range.first->ADC().val;
177  adc_max = range.second->ADC().val;
178  } else {
179  adc_mean = 0.0;
180  adc_min = 0;
181  adc_max = 0;
182  }
183 
184  h_["adc_mean"]->Fill(adc_mean);
185  h_["adc_min"]->Fill(adc_min);
186  h_["adc_max"]->Fill(adc_max);
187  h_["adc_sum"]->Fill(adc_sum);
188  h_["adc_sum_above_200"]->Fill(adc_sum_above_200);
189 
190  h_["n_hits_per_slice"]->Fill(n_hits[0]);
191  h_["n_hits_above_200"]->Fill(n_hits[200]);
192  h_["n_hits_above_700"]->Fill(n_hits[700]);
193  h_["n_hits_above_1000"]->Fill(n_hits[1000]);
194  h_["n_hits_above_2000"]->Fill(n_hits[2000]);
195 
196  h2_["trigger_rate_700"]->Fill(adc_mean, n_hits[700]);
197  h2_["trigger_rate_1000"]->Fill(adc_mean, n_hits[1000]);
198  h2_["trigger_rate_2000"]->Fill(adc_mean, n_hits[2000]);
199 
200  // if this slice is triggered
201  if (n_hits[1000] >= 15 &&
202  adc_mean >= 600)
203  h_["n_hits_per_triggered_slice"]->Fill(n_hits[0]);
204  }
205 }
std::map< std::string, TH1 * > h_
std::map< std::string, TH2 * > h2_
correl_yv Fill(-(dy[iP-1][iC-1]), hyv->GetBinContent(iP, iC))
Definition: structs.h:12
Float_t e
Definition: plot.C:35
bool failedToGet() const
Definition: Handle.h:196
void highe::HighEnergyAna::beginJob ( )
overridevirtual

Reimplemented from art::EDAnalyzer.

Definition at line 57 of file HighEnergyAna_module.cc.

References h2_, art::TFileDirectory::make(), make_histo(), and tfs_.

58 {
59  Binning adc_bin(4096, -0.5, 4095.5);
60  Binning nbin(2001, -0.5, 2000.5);
61  Binning plane_bin(1001, -0.5, 1000.5);
62  Binning cell_bin(401, -0.5, 400.5);
63 
64  make_histo("counter", "Counter", Binning(10, 0.5, 10.5));
65 
66  make_histo("adc_all_hits", "ADC Distribution of All Hits", adc_bin);
67  make_histo("adc_all_hits_raw", "Raw ADC Distribution of All Hits", adc_bin);
68  make_histo("adc_mean", "Mean ADC per Slice", adc_bin);
69  make_histo("adc_max", "Maximum ADC per Slice", adc_bin);
70  make_histo("adc_min", "Minimum ADC per Slice", adc_bin);
71  make_histo("adc_sum", "Summed ADC per Slice", Binning(1e4, 0, 1e8));
72  make_histo("adc_sum_above_200", "Summed ADC (ADC > 200) per Slice",
73  Binning(1e4, 0, 1e8));
74 
75  make_histo("n_hits_per_slice", "Number of Hits per Slice", nbin);
76  make_histo("n_hits_per_triggered_slice",
77  "Number of Hits per Triggered Slice", nbin);
78  make_histo("n_hits_above_200", "Number of Hits above 200 ADC", nbin);
79  make_histo("n_hits_above_700", "Number of Hits above 700 ADC", nbin);
80  make_histo("n_hits_above_1000", "Number of Hits above 1000 ADC", nbin);
81  make_histo("n_hits_above_2000", "Number of Hits above 2000 ADC", nbin);
82 
83  make_histo("plane_all_hits", "Plane of All Hits", plane_bin);
84  make_histo("cell_all_hits", "Cell of All Hits", cell_bin);
85 
86 
87  h2_["trigger_rate_700"] = tfs_->make<TH2F>
88  ("trigger_rate_700", "Trigger Rate",
89  5, 0, 1000,
90  6, 0, 30);
91  h2_["trigger_rate_1000"] = tfs_->make<TH2F>
92  ("trigger_rate_1000", "Trigger Rate",
93  5, 0, 1000,
94  6, 0, 30);
95  h2_["trigger_rate_2000"] = tfs_->make<TH2F>
96  ("trigger_rate_2000", "Trigger Rate",
97  5, 0, 1000,
98  6, 0, 30);
99 }
std::tuple< unsigned, double, double > Binning
art::ServiceHandle< art::TFileService > tfs_
std::map< std::string, TH2 * > h2_
void make_histo(std::string const name, std::string const title, Binning const &bin)
T * make(ARGS...args) const
detail::CachedProducts& art::EventObserverBase::cachedProducts ( )
inlineprotectedinherited

Definition at line 79 of file EventObserverBase.h.

References art::EventObserverBase::selectors_.

80  {
81  return selectors_;
82  }
detail::CachedProducts selectors_
template<typename T , BranchType = InEvent>
ProductToken<T> art::Consumer::consumes ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ProductToken<T> art::Consumer::consumes ( InputTag const &  it)
inherited

Definition at line 146 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

147 {
148  if (!moduleContext_)
149  return ProductToken<T>::invalid();
150 
151  consumables_[BT].emplace_back(ConsumableType::Product,
152  TypeID{typeid(T)},
153  it.label(),
154  it.instance(),
155  it.process());
156  return ProductToken<T>{it};
157 }
set< int >::iterator it
static ProductToken< T > invalid()
Definition: ProductToken.h:47
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename T , art::BranchType BT>
void art::Consumer::consumesMany ( )
inherited

Definition at line 161 of file Consumer.h.

References T.

162 {
163  if (!moduleContext_)
164  return;
165 
166  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
167 }
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::Consumer::consumesView ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ViewToken<T> art::Consumer::consumesView ( InputTag const &  it)
inherited

Definition at line 171 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

172 {
173  if (!moduleContext_)
174  return ViewToken<T>::invalid();
175 
176  consumables_[BT].emplace_back(ConsumableType::ViewElement,
177  TypeID{typeid(T)},
178  it.label(),
179  it.instance(),
180  it.process());
181  return ViewToken<T>{it};
182 }
set< int >::iterator it
static ViewToken< Element > invalid()
Definition: ProductToken.h:75
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed)
inherited
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed,
std::string const &  kind_of_engine_to_make 
)
inherited
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed,
std::string const &  kind_of_engine_to_make,
label_t const &  engine_label 
)
inherited
CurrentProcessingContext const* art::EDAnalyzer::currentContext ( ) const
protectedinherited
seed_t art::EngineCreator::get_seed_value ( fhicl::ParameterSet const &  pset,
char const  key[] = "seed",
seed_t const  implicit_seed = -1 
)
inherited
art::Handle<art::TriggerResults> art::EventObserverBase::getTriggerResults ( Event const &  e) const
inlineinherited

Definition at line 61 of file EventObserverBase.h.

References art::detail::CachedProducts::getOneTriggerResults(), and art::EventObserverBase::selectors_.

62  {
64  }
detail::CachedProducts selectors_
art::Handle< art::TriggerResults > getOneTriggerResults(Event const &) const
Float_t e
Definition: plot.C:35
void highe::HighEnergyAna::make_histo ( std::string const  name,
std::string const  title,
Binning const &  bin 
)
private

Definition at line 102 of file HighEnergyAna_module.cc.

References bin, h_, art::TFileDirectory::make(), and tfs_.

Referenced by beginJob().

103 {
104  h_[name] = tfs_->make<TH1F>
105  (name.c_str(), title.c_str(),
106  std::get<0>(bin), std::get<1>(bin), std::get<2>(bin));
107 }
const XML_Char * name
Definition: expat.h:151
art::ServiceHandle< art::TFileService > tfs_
std::map< std::string, TH1 * > h_
float bin[41]
Definition: plottest35.C:14
T * make(ARGS...args) const
template<typename T , BranchType = InEvent>
ProductToken<T> art::Consumer::mayConsume ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ProductToken<T> art::Consumer::mayConsume ( InputTag const &  it)
inherited

Definition at line 189 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

190 {
191  if (!moduleContext_)
192  return ProductToken<T>::invalid();
193 
194  consumables_[BT].emplace_back(ConsumableType::Product,
195  TypeID{typeid(T)},
196  it.label(),
197  it.instance(),
198  it.process());
199  return ProductToken<T>{it};
200 }
set< int >::iterator it
static ProductToken< T > invalid()
Definition: ProductToken.h:47
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename T , art::BranchType BT>
void art::Consumer::mayConsumeMany ( )
inherited

Definition at line 204 of file Consumer.h.

References T.

205 {
206  if (!moduleContext_)
207  return;
208 
209  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
210 }
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::Consumer::mayConsumeView ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ViewToken<T> art::Consumer::mayConsumeView ( InputTag const &  it)
inherited

Definition at line 214 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

215 {
216  if (!moduleContext_)
217  return ViewToken<T>::invalid();
218 
219  consumables_[BT].emplace_back(ConsumableType::ViewElement,
220  TypeID{typeid(T)},
221  it.label(),
222  it.instance(),
223  it.process());
224  return ViewToken<T>{it};
225 }
set< int >::iterator it
static ViewToken< Element > invalid()
Definition: ProductToken.h:75
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
bool art::EventObserverBase::modifiesEvent ( ) const
inlineinherited

Definition at line 25 of file EventObserverBase.h.

26  {
27  return false;
28  }
static cet::exempt_ptr<Consumer> art::Consumer::non_module_context ( )
staticinherited
void art::Consumer::prepareForJob ( fhicl::ParameterSet const &  pset)
protectedinherited
std::string const& art::EventObserverBase::processName ( ) const
inlineinherited
void art::EventObserverBase::registerProducts ( MasterProductRegistry ,
ProductDescriptions ,
ModuleDescription const &   
)
inlineinherited

Definition at line 33 of file EventObserverBase.h.

References string.

36  {}
fhicl::ParameterSetID art::EventObserverBase::selectorConfig ( ) const
inlineinherited

Definition at line 56 of file EventObserverBase.h.

References art::EventObserverBase::selector_config_id_.

57  {
58  return selector_config_id_;
59  }
fhicl::ParameterSetID selector_config_id_
void art::Consumer::showMissingConsumes ( ) const
protectedinherited

Referenced by art::RootOutput::endJob().

void art::Consumer::validateConsumedProduct ( BranchType const  bt,
ProductInfo const &  pi 
)
protectedinherited
bool art::EventObserverBase::wantAllEvents ( ) const
inlineinherited

Definition at line 46 of file EventObserverBase.h.

References art::EventObserverBase::wantAllEvents_.

Referenced by art::RootOutput::RootOutput().

47  {
48  return wantAllEvents_;
49  }
bool art::EventObserverBase::wantEvent ( Event const &  e)
inlineinherited

Definition at line 51 of file EventObserverBase.h.

References art::EventObserverBase::selectors_, and art::detail::CachedProducts::wantEvent().

52  {
53  return selectors_.wantEvent(e);
54  }
detail::CachedProducts selectors_
Float_t e
Definition: plot.C:35
bool wantEvent(Event const &)
std::string art::EDAnalyzer::workerType ( ) const
inlineinherited

Definition at line 109 of file EDAnalyzer.h.

References art::EDAnalyzer::currentContext().

110  {
111  return "WorkerT<EDAnalyzer>";
112  }

Member Data Documentation

std::map<std::string, TH2*> highe::HighEnergyAna::h2_
private

Definition at line 41 of file HighEnergyAna_module.cc.

Referenced by analyze(), and beginJob().

std::map<std::string, TH1*> highe::HighEnergyAna::h_
private

Definition at line 40 of file HighEnergyAna_module.cc.

Referenced by analyze(), and make_histo().

std::string highe::HighEnergyAna::slice_instance_
private

Definition at line 39 of file HighEnergyAna_module.cc.

Referenced by analyze().

std::string highe::HighEnergyAna::slice_label_
private

Definition at line 39 of file HighEnergyAna_module.cc.

Referenced by analyze().

art::ServiceHandle<art::TFileService> highe::HighEnergyAna::tfs_
private

Definition at line 42 of file HighEnergyAna_module.cc.

Referenced by beginJob(), and make_histo().


The documentation for this class was generated from the following file: