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

Public Types

using WorkerType = WorkerT< EDAnalyzer >
 
using ModuleType = EDAnalyzer
 

Public Member Functions

 CloseInTime (const fhicl::ParameterSet &p)
 
virtual ~CloseInTime ()
 
virtual void analyze (const art::Event &e)
 
virtual void reconfigure (fhicl::ParameterSet const &p)
 
virtual void beginRun (art::Run const &r)
 
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 fHitModuleLabel
 label for module making the hits More...
 
TH1D * fTimeDiff
 histogram of the difference between the time of photon signals in the cell and a cell hit's time More...
 
TH1D * fTimeExtend
 same as TimeDiff, but with an extend range to see the behavior of the tails More...
 
novadaq::cnv::DetId fDetID
 detector id, used to decide histogram extent More...
 

Detailed Description

Definition at line 35 of file CloseInTime_module.cc.

Member Typedef Documentation

Definition at line 39 of file EDAnalyzer.h.

Definition at line 38 of file EDAnalyzer.h.

Constructor & Destructor Documentation

mcchk::CloseInTime::CloseInTime ( const fhicl::ParameterSet p)
explicit

Definition at line 55 of file CloseInTime_module.cc.

References reconfigure().

55  :
56  EDAnalyzer(p),
57  fTimeDiff(NULL),
58  fTimeExtend(NULL)
59  {
60  this->reconfigure(p);
61  }
TH1D * fTimeDiff
histogram of the difference between the time of photon signals in the cell and a cell hit&#39;s time ...
TH1D * fTimeExtend
same as TimeDiff, but with an extend range to see the behavior of the tails
virtual void reconfigure(fhicl::ParameterSet const &p)
EDAnalyzer(Table< Config > const &config)
Definition: EDAnalyzer.h:100
mcchk::CloseInTime::~CloseInTime ( )
virtual

Definition at line 64 of file CloseInTime_module.cc.

65  {
66  }

Member Function Documentation

void mcchk::CloseInTime::analyze ( const art::Event e)
virtual

Definition at line 69 of file CloseInTime_module.cc.

References cheat::BackTracker::CellToPhotonSignal(), fDetID, fHitModuleLabel, fTimeDiff, fTimeExtend, art::DataViewImpl::getByLabel(), make_syst_table_plots::h, cheat::BackTracker::HaveTruthInfo(), cheat::BackTracker::IsNoise(), calib::j, novadaq::cnv::kNDOS, art::PtrVector< T >::push_back(), and art::PtrVector< T >::size().

70  {
71  // check that this is MC, stop if it isn't
73  if(!bt->HaveTruthInfo()){
74  mf::LogWarning("CloseInTime") << "attempting to run MC truth check on "
75  << "things without truth, bail";
76  return;
77  }
78 
79  // get all hits in the event
81  e.getByLabel(fHitModuleLabel, hithdl);
82 
84  for(size_t h = 0; h < hithdl->size(); ++h){
85  art::Ptr<rb::CellHit> hit(hithdl, h);
86  allhits.push_back(hit);
87  }
88 
89  for(size_t s = 0; s < allhits.size(); ++s){
90  if(bt->IsNoise(allhits[s])) continue;
91 
92  //Only look at hits with proper timing fit for FD, ND. NDOS never has good timing enabled.
93  if (!(allhits[s]->GoodTiming()) && !(fDetID == novadaq::cnv::kNDOS)) continue;
94 
95  double hitTime = allhits[s]->TNS();
96 
97  const std::vector<sim::PhotonSignal> photVec = bt->CellToPhotonSignal(allhits[s]->Plane(),allhits[s]->Cell());
98 
99  for(size_t j = 0; j < photVec.size(); ++j){
100  double photTime = photVec[j].TimeMean();
101  fTimeDiff->Fill(photTime-hitTime);
102  fTimeExtend->Fill(photTime-hitTime);
103  }//End of loop over photon signals
104  }//End of loop over all hits
105 
106  }// end analyze
std::string fHitModuleLabel
label for module making the hits
TH1D * fTimeDiff
histogram of the difference between the time of photon signals in the cell and a cell hit&#39;s time ...
TH1D * fTimeExtend
same as TimeDiff, but with an extend range to see the behavior of the tails
bool IsNoise(const art::Ptr< rb::CellHit > &hit) const
Is this hit not associated with any particles?
novadaq::cnv::DetId fDetID
detector id, used to decide histogram extent
const XML_Char * s
Definition: expat.h:262
void push_back(Ptr< U > const &p)
Definition: PtrVector.h:441
Prototype Near Detector on the surface at FNAL.
const double j
Definition: BetheBloch.cxx:29
size_type size() const
Definition: PtrVector.h:308
const std::vector< sim::PhotonSignal > CellToPhotonSignal(unsigned int const &plane, unsigned int const &cell) const
Returns the PhotonSignals contributing the signal in the specified cell. WARNING: Use with extreme ca...
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Definition: DataViewImpl.h:344
Definition: structs.h:12
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
bool HaveTruthInfo() const
Is this a file with truth info in? (Is BackTracker going to be any use to you?)
Definition: BackTracker.h:133
void mcchk::CloseInTime::beginRun ( art::Run const &  r)
virtual

Reimplemented from art::EDAnalyzer.

Definition at line 116 of file CloseInTime_module.cc.

References DEFINE_ART_MODULE(), geo::GeometryBase::DetId(), fDetID, fTimeDiff, fTimeExtend, geom(), novadaq::cnv::kNDOS, and art::TFileDirectory::make().

117  {
118  if (!fTimeDiff){
121  fDetID = geom->DetId();
122 
123  if (fDetID == novadaq::cnv::kNDOS){fTimeDiff = tfs->make<TH1D>("TimeDiff",";Photon Time - Hit TNS;Hits",100, -800, 2000);}
124  else {fTimeDiff = tfs->make<TH1D>("TimeDiff",";Photon Time - Hit TNS;Hits",100, -750, 750);}
125 
126  fTimeExtend = tfs->make<TH1D>("TimeExtend",";Photon Time - Hit TNS;Hits",1000, -10000, 10000);
127  }//End of loop to only define histograms once per job
128  }
TH1D * fTimeDiff
histogram of the difference between the time of photon signals in the cell and a cell hit&#39;s time ...
TH1D * fTimeExtend
same as TimeDiff, but with an extend range to see the behavior of the tails
novadaq::cnv::DetId fDetID
detector id, used to decide histogram extent
Prototype Near Detector on the surface at FNAL.
novadaq::cnv::DetId DetId() const
Prefer ds::DetectorService::DetId() instead.
Definition: GeometryBase.h:243
T * make(ARGS...args) const
void geom(int which=0)
Definition: geom.C:163
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 mcchk::CloseInTime::reconfigure ( fhicl::ParameterSet const &  p)
virtual

Definition at line 109 of file CloseInTime_module.cc.

References fHitModuleLabel, fhicl::ParameterSet::get(), and string.

Referenced by CloseInTime().

110  {
111  fHitModuleLabel = p.get< std::string >("HitModuleLabel" );
112  }
std::string fHitModuleLabel
label for module making the hits
const char * p
Definition: xmltok.h:285
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

novadaq::cnv::DetId mcchk::CloseInTime::fDetID
private

detector id, used to decide histogram extent

Definition at line 50 of file CloseInTime_module.cc.

Referenced by analyze(), and beginRun().

std::string mcchk::CloseInTime::fHitModuleLabel
private

label for module making the hits

Definition at line 47 of file CloseInTime_module.cc.

Referenced by analyze(), and reconfigure().

TH1D* mcchk::CloseInTime::fTimeDiff
private

histogram of the difference between the time of photon signals in the cell and a cell hit's time

Definition at line 48 of file CloseInTime_module.cc.

Referenced by analyze(), and beginRun().

TH1D* mcchk::CloseInTime::fTimeExtend
private

same as TimeDiff, but with an extend range to see the behavior of the tails

Definition at line 49 of file CloseInTime_module.cc.

Referenced by analyze(), and beginRun().


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