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

Public Types

using WorkerType = WorkerT< EDAnalyzer >
 
using ModuleType = EDAnalyzer
 

Public Member Functions

 DDTEvd (fhicl::ParameterSet const &p)
 
virtual ~DDTEvd ()
 
void analyze (art::Event const &e) override
 
void endJob () 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 Member Functions

int GetX (DAQHit &h, TVector3 start, TVector3 end)
 
int GetY (DAQHit &h, TVector3 start, TVector3 end)
 
void WriteEventInfo (const art::Event &event)
 
void WriteTrackInfo (const Track3D &track, long timeStart, const HitList &hitlist)
 
void WriteHitListInfo (const HitList &hitlist, long timeStart, TVector3 start, TVector3 end)
 

Private Attributes

std::string fTrack3DLabel
 
std::string fInputHitLabel
 
std::string fInputHitInstance
 
ofstream fOutputEvd
 

Detailed Description

Definition at line 47 of file DDTEvd_module.cc.

Member Typedef Documentation

Definition at line 39 of file EDAnalyzer.h.

Definition at line 38 of file EDAnalyzer.h.

Constructor & Destructor Documentation

novaddt::DDTEvd::DDTEvd ( fhicl::ParameterSet const &  p)
explicit

Definition at line 71 of file DDTEvd_module.cc.

References om::cout, allTimeWatchdog::endl, and fOutputEvd.

72  : EDAnalyzer(p),
73  fTrack3DLabel(p.get<std::string>("Track3DLabel")),
74  fInputHitLabel(p.get<std::string>("InputHitLabel")),
75  fInputHitInstance(p.get<std::string>("InputHitInstance"))
76 {
77  std::cout << "--- novaddt::DDTEvd instantiate" << std::endl;
78  fOutputEvd.open("DDTEvd_Data.txt");
79 }
const char * p
Definition: xmltok.h:285
EDAnalyzer(Table< Config > const &config)
Definition: EDAnalyzer.h:100
OStream cout
Definition: OStream.cxx:6
std::string fInputHitInstance
std::string fInputHitLabel
ofstream fOutputEvd
std::string fTrack3DLabel
enum BeamMode string
novaddt::DDTEvd::~DDTEvd ( )
virtual

Definition at line 81 of file DDTEvd_module.cc.

82 {
83  // Clean up dynamic memory and other resources here.
84 }

Member Function Documentation

void novaddt::DDTEvd::analyze ( art::Event const &  e)
overridevirtual

Implements art::EDAnalyzer.

Definition at line 186 of file DDTEvd_module.cc.

References WriteEventInfo().

187 {
188  WriteEventInfo(event);
189 }
void WriteEventInfo(const art::Event &event)
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
void novaddt::DDTEvd::endJob ( )
overridevirtual

Reimplemented from art::EDAnalyzer.

Definition at line 191 of file DDTEvd_module.cc.

References om::cout, DEFINE_ART_MODULE(), allTimeWatchdog::endl, and fOutputEvd.

192 {
193  std::cout << "=== novaddt::DDTEvd endJob " << std::endl;
194  fOutputEvd.close();
195 }
OStream cout
Definition: OStream.cxx:6
ofstream fOutputEvd
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
int novaddt::DDTEvd::GetX ( DAQHit h,
TVector3  start,
TVector3  end 
)
private

Definition at line 158 of file DDTEvd_module.cc.

References novaddt::DAQHit::Plane(), stan::math::round(), novaddt::Plane::val, submit_syst::x, and test::z.

Referenced by WriteHitListInfo().

159 {
160  int z = h.Plane().val;
161 
162  double xSpread = end.X() - start.X();
163  double zSpread = end.Z() - start.Z();
164 
165  double zSpreadLoc = z - start.Z();
166 
167  double x = start.X() + xSpread * zSpreadLoc/zSpread;
168 
169  return round(x);
170 }
fvar< T > round(const fvar< T > &x)
Definition: round.hpp:23
z
Definition: test.py:28
int novaddt::DDTEvd::GetY ( DAQHit h,
TVector3  start,
TVector3  end 
)
private

Definition at line 171 of file DDTEvd_module.cc.

References novaddt::DAQHit::Plane(), stan::math::round(), novaddt::Plane::val, submit_syst::y, and test::z.

Referenced by WriteHitListInfo().

172 {
173  int z = h.Plane().val;
174 
175  double ySpread = end.Y() - start.Y();
176  double zSpread = end.Z() - start.Z();
177 
178  double zSpreadLoc = z - start.Z();
179 
180  double y = start.Y() + ySpread * zSpreadLoc/zSpread;
181 
182  return round(y);
183 }
fvar< T > round(const fvar< T > &x)
Definition: round.hpp:23
z
Definition: test.py:28
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  }
void novaddt::DDTEvd::WriteEventInfo ( const art::Event event)
private

Definition at line 87 of file DDTEvd_module.cc.

References allTimeWatchdog::endl, novaddt::EventHeader::eventNumber, fInputHitInstance, fInputHitLabel, fOutputEvd, fTrack3DLabel, submit_syst::header, MECModelEnuComparisons::i, novadaq::timeutils::NOVA_EPOCH, novadaq::timeutils::NOVA_TIME_FACTOR, novaddt::EventHeader::timeStart, and WriteTrackInfo().

Referenced by analyze().

88 {
89  // Event info
91  event.getByLabel(fInputHitLabel, fInputHitInstance, header);
92  fOutputEvd << "E " << header->eventNumber << " ";
94 
95  // Tracks
97  event.getByLabel(fTrack3DLabel, tracks);
98 
99  // We need the hitlist just so we can get the times for the trigger
100  art::FindOneP<HitList> hls(tracks, event, fTrack3DLabel);
101 
102  int i = 0;
103 
104  // Write info for this event to file
105 
106 
107  for(const Track3D& track: *tracks)
108  {
109  const HitList& hlist = *hls.at(i);
110  i++;
111 
112  WriteTrackInfo(track, header->timeStart, hlist);
113  }
114 }
void WriteTrackInfo(const Track3D &track, long timeStart, const HitList &hitlist)
const uint32_t NOVA_EPOCH
std::vector< DAQHit > HitList
Definition: HitList.h:15
Definition: event.h:19
const uint64_t NOVA_TIME_FACTOR
std::string fInputHitInstance
std::string fInputHitLabel
ofstream fOutputEvd
std::string fTrack3DLabel
void novaddt::DDTEvd::WriteHitListInfo ( const HitList hitlist,
long  timeStart,
TVector3  start,
TVector3  end 
)
private

Definition at line 140 of file DDTEvd_module.cc.

References novaddt::DAQHit::Cell(), allTimeWatchdog::endl, fOutputEvd, GetX(), GetY(), make_syst_table_plots::h, makeTrainCVSamples::int, calib::j, novaddt::DAQHit::Plane(), novaddt::DAQHit::TDC(), novaddt::TDC::val, novaddt::Plane::val, novaddt::Cell::val, novaddt::View::val, POTSpillRate::view, and novaddt::DAQHit::View().

Referenced by WriteTrackInfo().

141 {
142  for(uint j = 0; j < hitlist.size(); j++)
143  {
144  if(j != 0)
145  fOutputEvd << ",";
146 
147  DAQHit h = hitlist.at(j);
148  int view = (int)h.View().val;
149  fOutputEvd << ((long)h.TDC().val - timeStart)/64 << "/";
150  fOutputEvd << (view == 1 ? (int)h.Cell().val : GetX(h, start, end)) << "/";
151  fOutputEvd << (view == 2 ? (int)h.Cell().val : GetY(h, start, end)) << "/";
152  fOutputEvd << (int)h.Plane().val << "/";
153  fOutputEvd << view;
154  }
155 
157 }
int GetX(DAQHit &h, TVector3 start, TVector3 end)
const double j
Definition: BetheBloch.cxx:29
ofstream fOutputEvd
int GetY(DAQHit &h, TVector3 start, TVector3 end)
unsigned int uint
void novaddt::DDTEvd::WriteTrackInfo ( const Track3D track,
long  timeStart,
const HitList hitlist 
)
private

Definition at line 116 of file DDTEvd_module.cc.

References novaddt::Track3D::End(), febshutoff_auto::end, allTimeWatchdog::endl, fOutputEvd, novaddt::Track3D::Is3D(), novaddt::Track3D::Start(), febshutoff_auto::start, std::swap(), and WriteHitListInfo().

Referenced by WriteEventInfo().

117 {
118  TVector3 start = track.Start();
119  TVector3 end = track.End();
120  if(start.Y() < end.Y()) std::swap(start, end); // all tracks are down-going
121 
122  //Check whether 3D track vector makes sense
123  if(!track.Is3D() ||
124  (start.X() == 0 && end.X() == 0) ||
125  (start.Y() == 0 && end.Y() == 0) ||
126  (start.Z() == 0 && end.Z() == 0))
127  {
128  return;
129  }
130 
131  // Track info
132  fOutputEvd << "T ";
133  fOutputEvd << "(" << start.X() << "," << start.Y() << "," << start.Z() << ") ";
134  fOutputEvd << "(" << end.X() << "," << end.Y() << "," << end.Z() << ")";
136 
137  WriteHitListInfo(hitlist, timeStart, start, end);
138 
139 }
Definition: event.h:19
void swap(art::HLTGlobalStatus &lhs, art::HLTGlobalStatus &rhs)
ofstream fOutputEvd
void WriteHitListInfo(const HitList &hitlist, long timeStart, TVector3 start, TVector3 end)

Member Data Documentation

std::string novaddt::DDTEvd::fInputHitInstance
private

Definition at line 58 of file DDTEvd_module.cc.

Referenced by WriteEventInfo().

std::string novaddt::DDTEvd::fInputHitLabel
private

Definition at line 57 of file DDTEvd_module.cc.

Referenced by WriteEventInfo().

ofstream novaddt::DDTEvd::fOutputEvd
private

Definition at line 61 of file DDTEvd_module.cc.

Referenced by DDTEvd(), endJob(), WriteEventInfo(), WriteHitListInfo(), and WriteTrackInfo().

std::string novaddt::DDTEvd::fTrack3DLabel
private

Definition at line 56 of file DDTEvd_module.cc.

Referenced by WriteEventInfo().


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