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

Public Types

using WorkerType = WorkerT< EDAnalyzer >
 
using ModuleType = EDAnalyzer
 

Public Member Functions

 IdenticalSlicerAna (fhicl::ParameterSet const &pset)
 
 ~IdenticalSlicerAna ()
 
void analyze (const art::Event &evt)
 
void reconfigure (const fhicl::ParameterSet &pset)
 
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 Attributes

std::string fCellHitInput
 
std::string fOldSlicerLabel
 
std::string fNewSlicerLabel
 

Detailed Description

Definition at line 44 of file IdenticalSlicerAna_module.cc.

Member Typedef Documentation

Definition at line 39 of file EDAnalyzer.h.

Definition at line 38 of file EDAnalyzer.h.

Constructor & Destructor Documentation

slicer::IdenticalSlicerAna::IdenticalSlicerAna ( fhicl::ParameterSet const &  pset)
explicit

Definition at line 66 of file IdenticalSlicerAna_module.cc.

References reconfigure().

67  : EDAnalyzer(pset)
68  {
69  this->reconfigure(pset);
70  }
EDAnalyzer(Table< Config > const &config)
Definition: EDAnalyzer.h:100
void reconfigure(const fhicl::ParameterSet &pset)
slicer::IdenticalSlicerAna::~IdenticalSlicerAna ( )

Definition at line 73 of file IdenticalSlicerAna_module.cc.

74  {
75  //======================================================================
76  // Clean up any memory allocated by your module
77  //======================================================================
78  }

Member Function Documentation

void slicer::IdenticalSlicerAna::analyze ( const art::Event evt)

Definition at line 91 of file IdenticalSlicerAna_module.cc.

References ana::assert(), om::cout, DEFINE_ART_MODULE(), allTimeWatchdog::endl, fCellHitInput, fNewSlicerLabel, fOldSlicerLabel, art::DataViewImpl::getByLabel(), MECModelEnuComparisons::i, it, calib::j, and art::PtrVector< T >::size().

92  {
93 
94  // Get the hits from calhit
96  evt.getByLabel(fCellHitInput, hitcol);
97 
98  // make a vector
99  std::vector<art::Ptr<rb::CellHit > > hitlist;
100  for(unsigned int i = 0; i < hitcol->size(); ++i){
101  art::Ptr<rb::CellHit> hit(hitcol, i);
102  hitlist.push_back(hit);
103  }
104 
105  // get the old slices
106  art::Handle< std::vector< rb::Cluster > > oldSlicesHandle;
107  evt.getByLabel(fOldSlicerLabel, oldSlicesHandle);
108  std::vector< rb::Cluster > oldSlices = *oldSlicesHandle;
109 
110  art::Handle< std::vector< rb::Cluster > > newSlicesHandle;
111  evt.getByLabel(fNewSlicerLabel, newSlicesHandle);
112  std::vector< rb::Cluster > newSlices = *newSlicesHandle;
113 
114  // make sure both have
115  assert(newSlices.size() == oldSlices.size());
116 
117  for(size_t iSlc = 0; iSlc < oldSlices.size(); ++iSlc){
118  if(!newSlices[iSlc].IsNoise())
119  {
120  assert(newSlices[iSlc].NCell() == oldSlices[iSlc].NCell());
121 
122  for(size_t iHit = 0; iHit < oldSlices[iSlc].NCell(); ++iHit){
123  assert(*oldSlices[iSlc].Cell(iHit) == *newSlices[iSlc].Cell(iHit));
124  }
125 
126 
127  }
128  }
129 
130 
131 
132  // make sure that all cell hits in the new slices are unique
133  // first check output from calhit
134  for(size_t i = 0; i< hitlist.size(); ++i)
135  {
136  for(size_t j = 0; j< hitlist.size(); ++j)
137  {
138  if(i != j){
139  assert(!(*(hitlist[i]) == *(hitlist[j])) && " CalHits are not unique!");
140  }
141  }
142  }
143 
144 
145  for (auto it = newSlices.begin(); it != newSlices.end(); ++it)
146  {
147 
148  art::PtrVector< rb::CellHit > cells = it->AllCells();
149  for(size_t i = 0; i < cells.size(); ++i)
150  {
151  for(size_t j = 0; j < cells.size(); ++j)
152  {
153  if(i != j){
154  if(*(cells[i]) == *(cells[j]))
155  {
156  std::cout << i << " " << cells[i]->Cell() << " " << cells[i]->Plane() << " " <<
157  cells[i]->PE() << " " << cells[i]->TDC() << std::endl;
158 
159  std::cout << j << " " << cells[j]->Cell() << " " << cells[j]->Plane() << " " <<
160  cells[j]->PE() << " " << cells[j]->TDC() << std::endl;
161 
162  }
163  assert(!(*(cells[i]) == *(cells[j])) && " Cells are not unique");
164  }
165  }
166 
167  }
168 
169 
170  }
171 
172  std::cout << " slices are idential " << std::endl;
173 
174  return;
175  }
set< int >::iterator it
const double j
Definition: BetheBloch.cxx:29
size_type size() const
Definition: PtrVector.h:308
OStream cout
Definition: OStream.cxx:6
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Definition: DataViewImpl.h:344
Definition: structs.h:12
assert(nhit_max >=nhit_nbins)
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
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 slicer::IdenticalSlicerAna::reconfigure ( const fhicl::ParameterSet pset)

Definition at line 81 of file IdenticalSlicerAna_module.cc.

References fCellHitInput, fNewSlicerLabel, fOldSlicerLabel, fhicl::ParameterSet::get(), and string.

Referenced by IdenticalSlicerAna().

82  {
83  fCellHitInput = pset.get< std::string> ("CellHitInput");
84  fOldSlicerLabel = pset.get<std::string> ("OldSlicerLabel");
85  fNewSlicerLabel = pset.get<std::string> ("NewSlicerLabel");
86  }
T get(std::string const &key) const
Definition: ParameterSet.h:231
enum BeamMode string
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::string slicer::IdenticalSlicerAna::fCellHitInput
private

Definition at line 53 of file IdenticalSlicerAna_module.cc.

Referenced by analyze(), and reconfigure().

std::string slicer::IdenticalSlicerAna::fNewSlicerLabel
private

Definition at line 55 of file IdenticalSlicerAna_module.cc.

Referenced by analyze(), and reconfigure().

std::string slicer::IdenticalSlicerAna::fOldSlicerLabel
private

Definition at line 54 of file IdenticalSlicerAna_module.cc.

Referenced by analyze(), and reconfigure().


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