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

Public Types

using WorkerType = WorkerT< EDAnalyzer >
 
using ModuleType = EDAnalyzer
 

Public Member Functions

 TOFTimingResolution (fhicl::ParameterSet const &p)
 
void analyze (art::Event const &e) override
 
void reconfigure (const fhicl::ParameterSet &p)
 
void beginJob () override
 
double * selectChannel (unsigned int digitizerChannel)
 
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

art::InputTag _ToFInputTag
 
art::InputTag _CherenkovInputTag
 
TTree * tof_tree
 
double Cherenkov [1024]
 
double Paddle_4 [1024]
 
double Paddle_3 [1024]
 
double Paddle_2 [1024]
 
double Paddle_1 [1024]
 
art::ServiceHandle< beamlineutil::BeamlineChannelMapfChannelMap
 

Detailed Description

Definition at line 45 of file TOFTimingResolution_module.cc.

Member Typedef Documentation

Definition at line 39 of file EDAnalyzer.h.

Definition at line 38 of file EDAnalyzer.h.

Constructor & Destructor Documentation

novatb::TOFTimingResolution::TOFTimingResolution ( fhicl::ParameterSet const &  p)
explicit

Definition at line 78 of file TOFTimingResolution_module.cc.

References reconfigure().

78  : EDAnalyzer(p) {
79  reconfigure(p);
80 }
void reconfigure(const fhicl::ParameterSet &p)
const char * p
Definition: xmltok.h:285
EDAnalyzer(Table< Config > const &config)
Definition: EDAnalyzer.h:100

Member Function Documentation

void novatb::TOFTimingResolution::analyze ( art::Event const &  e)
overridevirtual

Implements art::EDAnalyzer.

Definition at line 122 of file TOFTimingResolution_module.cc.

References _CherenkovInputTag, _ToFInputTag, fChannelMap, art::fill_ptr_vector(), art::DataViewImpl::getByLabel(), MECModelEnuComparisons::i, beamlineutil::BeamlineChannelMap::OnlineDigitChannel(), selectChannel(), and tof_tree.

122  {
124  std::vector<art::Ptr<rawdata::RawBeamlineDigit> > ToFs;
125  if (e.getByLabel(_ToFInputTag, ToFHandle)) art::fill_ptr_vector(ToFs, ToFHandle);
126 
128  std::vector<art::Ptr<rawdata::RawBeamlineDigit> > Cherenkovs;
129  if (e.getByLabel(_CherenkovInputTag, CherenkovHandle)) art::fill_ptr_vector(Cherenkovs, CherenkovHandle);
130 
131  // art::Handle<std::vector<rawdata::RawBeamlineWC> > WCHandle;
132  // std::vector<art::Ptr<rawdata::RawBeamlineWC> > WCs;
133  // if (e.getByLabel(_WCInputTag, WCHandle)) art::fill_ptr_vector(WCs, WCHandle);
134 
135  for (auto itr = ToFs.begin(); itr != ToFs.end(); itr++) {
136  unsigned int channel = fChannelMap->OnlineDigitChannel((*itr)->ChannelID());
137  double* chPointer = selectChannel(channel);
138  std::vector<uint16_t> waveform = (*itr)->ADCs();
139 
140  if (chPointer != NULL) {
141  for (unsigned int i = 0; i < 1024; i++) {
142  *(chPointer + i) = (double)waveform.at(i);
143  }
144  }
145  }
146 
147  for (auto itr = Cherenkovs.begin(); itr != Cherenkovs.end(); itr++) {
148  unsigned int channel = fChannelMap->OnlineDigitChannel((*itr)->ChannelID());
149  double* chPointer = selectChannel(channel);
150  std::vector<uint16_t> waveform = (*itr)->ADCs();
151 
152  if (chPointer != NULL) {
153  for (unsigned int i = 0; i < 1024; i++) {
154  *(chPointer + i) = (double)waveform.at(i);
155  }
156  }
157  }
158 
159  tof_tree->Fill();
160 }
art::ServiceHandle< beamlineutil::BeamlineChannelMap > fChannelMap
unsigned int OnlineDigitChannel(ChannelID channel) const
Online digiziter channel number for this offline ChannelID.
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
Definition: Ptr.h:464
Float_t e
Definition: plot.C:35
double * selectChannel(unsigned int digitizerChannel)
void novatb::TOFTimingResolution::beginJob ( )
overridevirtual

Reimplemented from art::EDAnalyzer.

Definition at line 82 of file TOFTimingResolution_module.cc.

References Cherenkov, art::TFileDirectory::make(), Paddle_1, Paddle_2, Paddle_3, Paddle_4, and tof_tree.

82  {
84  tof_tree = tfs->make<TTree>("tof_tree", "TOF Tree");
85  tof_tree->Branch("Paddle_1", Paddle_1, "Paddle_1[1024]/D");
86  tof_tree->Branch("Paddle_2", Paddle_2, "Paddle_2[1024]/D");
87  tof_tree->Branch("Paddle_3", Paddle_3, "Paddle_3[1024]/D");
88  tof_tree->Branch("Paddle_4", Paddle_4, "Paddle_4[1024]/D");
89  tof_tree->Branch("Cherenkov", Cherenkov, "Cherenkov[1024]/D");
90  // tof_tree->Branch("Channel_6", Channel_6, "Channel_6[1024]/D");
91  // tof_tree->Branch("Channel_7", Channel_7, "Channel_7[1024]/D");
92  // tof_tree->Branch("Channel_8", Channel_8, "Channel_8[1024]/D");
93 
94  // double samplingRateInGSPS = 5;
95  //
96  // paramSet[beamlinereco::kADCNBits] = 12;
97  // paramSet[beamlinereco::kADCDynamicRange] = 1;
98  // paramSet[beamlinereco::kADCOffset] = 0;
99  // paramSet[beamlinereco::kTimeSamplingInterval] = 1 / (samplingRateInGSPS);
100  // paramSet[beamlinereco::kNSamplingPoints] = 1024;
101  // paramSet[beamlinereco::kIsWaveformNegativePolarity] = 1;
102  // paramSet[beamlinereco::kCFDThreshold] = 0.4;
103  // paramSet[beamlinereco::kRawHitFinderThresholdInNoiseSigma] = 8;
104  // paramSet[beamlinereco::kShortRawHitIgnoringDurationInTicks] = 10;
105  // paramSet[beamlinereco::kConsecutiveHitSeperationDurationInTicks] = 5;
106  // paramSet[beamlinereco::kGSFilter] = 0;
107  // paramSet[beamlinereco::kGSFilterWindow] = 17;
108  // paramSet[beamlinereco::kGSFilterDegree] = 3;
109  // paramSet[beamlinereco::kIntergratedWindowFixed] = 0;
110  // paramSet[beamlinereco::kIntergratedWindowLowerLimitIndex] = 0;
111  // paramSet[beamlinereco::kIntergratedWindowUpperLimitIndex] = 1024;
112  //
113  // cfdHF = new beamlinereco::CFDHitFinder<double>();
114  // cfdHF->SetParams(paramSet);
115 }
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
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 novatb::TOFTimingResolution::reconfigure ( const fhicl::ParameterSet p)

Definition at line 117 of file TOFTimingResolution_module.cc.

References _CherenkovInputTag, and _ToFInputTag.

Referenced by TOFTimingResolution().

117  {
118  _ToFInputTag = "daq:ToF";
119  _CherenkovInputTag = "daq:Cherenkov";
120 }
void art::EventObserverBase::registerProducts ( MasterProductRegistry ,
ProductDescriptions ,
ModuleDescription const &   
)
inlineinherited

Definition at line 33 of file EventObserverBase.h.

36  {}
double * novatb::TOFTimingResolution::selectChannel ( unsigned int  digitizerChannel)

Definition at line 162 of file TOFTimingResolution_module.cc.

References Cherenkov, DEFINE_ART_MODULE(), Paddle_1, Paddle_2, Paddle_3, and Paddle_4.

Referenced by analyze().

162  {
163  double* chPointer;
164  switch (digitizerChannel) {
165  case (3): {chPointer = &Cherenkov[0]; break;}
166  case (4): {chPointer = &Paddle_1[0]; break;}
167  case (5): {chPointer = &Paddle_2[0]; break;}
168  case (6): {chPointer = &Paddle_3[0]; break;}
169  case (7): {chPointer = &Paddle_4[0]; break;}
170  // case (5): {chPointer = &Channel_5[0]; break;}
171  // case (6): {chPointer = &Channel_6[0]; break;}
172  // case (7): {chPointer = &Channel_7[0]; break;}
173  // case (8): {chPointer = &Channel_8[0]; break;}
174  default: {chPointer = NULL; break;}
175  }
176 
177  return chPointer;
178 }
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

art::InputTag novatb::TOFTimingResolution::_CherenkovInputTag
private

Definition at line 55 of file TOFTimingResolution_module.cc.

Referenced by analyze(), and reconfigure().

art::InputTag novatb::TOFTimingResolution::_ToFInputTag
private

Definition at line 54 of file TOFTimingResolution_module.cc.

Referenced by analyze(), and reconfigure().

double novatb::TOFTimingResolution::Cherenkov[1024]
private

Definition at line 66 of file TOFTimingResolution_module.cc.

Referenced by beginJob(), and selectChannel().

art::ServiceHandle<beamlineutil::BeamlineChannelMap> novatb::TOFTimingResolution::fChannelMap
private

Definition at line 73 of file TOFTimingResolution_module.cc.

Referenced by analyze().

double novatb::TOFTimingResolution::Paddle_1[1024]
private

Definition at line 70 of file TOFTimingResolution_module.cc.

Referenced by beginJob(), and selectChannel().

double novatb::TOFTimingResolution::Paddle_2[1024]
private

Definition at line 69 of file TOFTimingResolution_module.cc.

Referenced by beginJob(), and selectChannel().

double novatb::TOFTimingResolution::Paddle_3[1024]
private

Definition at line 68 of file TOFTimingResolution_module.cc.

Referenced by beginJob(), and selectChannel().

double novatb::TOFTimingResolution::Paddle_4[1024]
private

Definition at line 67 of file TOFTimingResolution_module.cc.

Referenced by beginJob(), and selectChannel().

TTree* novatb::TOFTimingResolution::tof_tree
private

Definition at line 61 of file TOFTimingResolution_module.cc.

Referenced by analyze(), and beginJob().


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