Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Private Attributes | List of all members
beamlinesim::BeamlineSimInput Class Reference
Inheritance diagram for beamlinesim::BeamlineSimInput:
art::EDProducer art::ProducerBase art::Consumer art::EngineCreator art::ProductRegistryHelper

Public Types

using ModuleType = EDProducer
 
using WorkerType = WorkerT< EDProducer >
 
template<typename UserConfig , typename KeysToIgnore = void>
using Table = ProducerBase::Table< UserConfig, KeysToIgnore >
 

Public Member Functions

 BeamlineSimInput (const fhicl::ParameterSet &pset)
 
void reconfigure (const fhicl::ParameterSet &pset)
 
void produce (art::Event &evt)
 
void beginJob ()
 
float_t bltof (float_t tof_us, float_t tof_ds, int presenttofus, int presenttofds)
 
template<typename PROD , BranchType B = InEvent>
ProductID getProductID (std::string const &instanceName={}) const
 
template<typename PROD , BranchType B>
ProductID getProductID (ModuleDescription const &moduleDescription, std::string const &instanceName) const
 
bool modifiesEvent () 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 ()
 

Public Attributes

TTreeReader reader
 
TTree * tree
 
int particle_no
 
int event_no
 
int final_index
 
int total_particles
 

Protected Member Functions

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

Private Attributes

art::InputTag fRawToFDataLabel
 
TFile * fBeamlineSimFile
 
TTree * fBeamlineSimTree
 
int fBeamlineTreeIndex
 
std::vector< unsigned intvPresentWire_Chamber1
 
std::vector< unsigned intvPresentWire_Chamber2
 
std::vector< unsigned intvPresentWire_Chamber3
 
std::vector< unsigned intvPresentWire_Chamber4
 
std::vector< unsigned intvPresenttofus
 
std::vector< unsigned intvPresenttofds
 
std::vector< unsigned intvPresentcherenkov
 
std::vector< float_t > vXWire_Chamber1
 
std::vector< float_t > vYWire_Chamber1
 
std::vector< float_t > vZWire_Chamber1
 
std::vector< float_t > vTWire_Chamber1
 
std::vector< float_t > vXWire_Chamber2
 
std::vector< float_t > vYWire_Chamber2
 
std::vector< float_t > vZWire_Chamber2
 
std::vector< float_t > vTWire_Chamber2
 
std::vector< float_t > vXWire_Chamber3
 
std::vector< float_t > vYWire_Chamber3
 
std::vector< float_t > vZWire_Chamber3
 
std::vector< float_t > vTWire_Chamber3
 
std::vector< float_t > vXWire_Chamber4
 
std::vector< float_t > vYWire_Chamber4
 
std::vector< float_t > vZWire_Chamber4
 
std::vector< float_t > vTWire_Chamber4
 
std::vector< float_t > vttof_us
 
std::vector< float_t > vttof_ds
 
std::vector< float_t > vtcherenkov
 
std::vector< float_t > vxnova
 
std::vector< float_t > vynova
 
std::vector< float_t > vznova
 
std::vector< float_t > vtnova
 
int fPresentWire_Chamber1
 
int fPresentWire_Chamber2
 
int fPresentWire_Chamber3
 
int fPresentWire_Chamber4
 
int fPresenttofus
 
int fPresenttofds
 
int fPresentcherenkov
 
float_t fXWire_Chamber1
 
float_t fYWire_Chamber1
 
float_t fZWire_Chamber1
 
float_t fTWire_Chamber1
 
float_t fXWire_Chamber2
 
float_t fYWire_Chamber2
 
float_t fZWire_Chamber2
 
float_t fTWire_Chamber2
 
float_t fXWire_Chamber3
 
float_t fYWire_Chamber3
 
float_t fZWire_Chamber3
 
float_t fTWire_Chamber3
 
float_t fXWire_Chamber4
 
float_t fYWire_Chamber4
 
float_t fZWire_Chamber4
 
float_t fTWire_Chamber4
 
float_t fttof_us
 
float_t fttof_ds
 
float_t ftcherenkov
 

Detailed Description

Definition at line 73 of file BeamlineSimInput_module.cc.

Member Typedef Documentation

using art::EDProducer::ModuleType = EDProducer
inherited

Definition at line 34 of file EDProducer.h.

template<typename UserConfig , typename KeysToIgnore = void>
using art::EDProducer::Table = ProducerBase::Table<UserConfig, KeysToIgnore>
inherited

Definition at line 43 of file EDProducer.h.

using art::EDProducer::WorkerType = WorkerT<EDProducer>
inherited

Definition at line 35 of file EDProducer.h.

Constructor & Destructor Documentation

beamlinesim::BeamlineSimInput::BeamlineSimInput ( const fhicl::ParameterSet pset)

Definition at line 315 of file BeamlineSimInput_module.cc.

References final_index, reconfigure(), and total_particles.

315  {
316  produces<std::vector<brb::ToF> >();
317  produces<std::vector<brb::Cherenkov> >();
318  produces<std::vector<rawdata::RawBeamlineWC> >();
319  total_particles = 0;
320  final_index = 0;
321  this->reconfigure(pset);
322 }
void reconfigure(const fhicl::ParameterSet &pset)

Member Function Documentation

void beamlinesim::BeamlineSimInput::beginJob ( )
virtual

Reimplemented from art::EDProducer.

Definition at line 204 of file BeamlineSimInput_module.cc.

References fBeamlineSimFile, fPresentcherenkov, fPresenttofds, fPresenttofus, fPresentWire_Chamber1, fPresentWire_Chamber2, fPresentWire_Chamber3, fPresentWire_Chamber4, ftcherenkov, fttof_ds, fttof_us, fTWire_Chamber1, fTWire_Chamber2, fTWire_Chamber3, fTWire_Chamber4, fXWire_Chamber1, fXWire_Chamber2, fXWire_Chamber3, fXWire_Chamber4, fYWire_Chamber1, fYWire_Chamber2, fYWire_Chamber3, fYWire_Chamber4, fZWire_Chamber1, fZWire_Chamber2, fZWire_Chamber3, fZWire_Chamber4, reader, vPresentcherenkov, vPresenttofds, vPresenttofus, vPresentWire_Chamber1, vPresentWire_Chamber2, vPresentWire_Chamber3, vPresentWire_Chamber4, vtcherenkov, vttof_ds, vttof_us, vTWire_Chamber1, vTWire_Chamber2, vTWire_Chamber3, vTWire_Chamber4, vXWire_Chamber1, vXWire_Chamber2, vXWire_Chamber3, vXWire_Chamber4, vYWire_Chamber1, vYWire_Chamber2, vYWire_Chamber3, vYWire_Chamber4, vZWire_Chamber1, vZWire_Chamber2, vZWire_Chamber3, and vZWire_Chamber4.

205 {
206  //beamlinesim::BeamlineSimInput::fBeamlineSimFile = new TFile("/nova/app/users/ayallapp/testbeam/test_testbeam/TestBeam/beamlineinput_new.root","READ");
207  //beamlinesim::BeamlineSimInput::fBeamlineSimFile = new TFile("/nova/app/users/ayallapp/testbeam/test_testbeam/junting/beamlinesimulation_wohoo.root","READ");
208  beamlinesim::BeamlineSimInput::fBeamlineSimFile = new TFile("/nova/app/users/ayallapp/testbeam/test_testbeam/junting/beamlinesimulation_wohoo.root","READ");
209  TTreeReader reader("tree", fBeamlineSimFile);
210  //TTreeReaderValue<int> feventid(reader, "event_id");
211  //TTreeReaderValue<float_t> fx(reader, "x");
212  //TTreeReaderValue<int> fisnoise(reader, "is_noise");
213  TTreeReaderValue<unsigned int> fPresentWire_Chamber1(reader, "present_wire_chamber_1");
214  TTreeReaderValue<unsigned int> fPresentWire_Chamber2(reader, "present_wire_chamber_2");
215  TTreeReaderValue<unsigned int> fPresentWire_Chamber3(reader, "present_wire_chamber_3");
216  TTreeReaderValue<unsigned int> fPresentWire_Chamber4(reader, "present_wire_chamber_4");
217  TTreeReaderValue<unsigned int> fPresenttofus(reader, "present_tof_us");
218  TTreeReaderValue<unsigned int> fPresenttofds(reader, "present_tof_ds");
219  TTreeReaderValue<unsigned int> fPresentcherenkov(reader, "present_cerenkov");
220  TTreeReaderValue<float> fXWire_Chamber1(reader, "x_wire_chamber_1");
221  TTreeReaderValue<float> fYWire_Chamber1(reader, "y_wire_chamber_1");
222  TTreeReaderValue<float> fZWire_Chamber1(reader, "z_wire_chamber_1");
223  TTreeReaderValue<float> fTWire_Chamber1(reader, "t_wire_chamber_1");
224  TTreeReaderValue<float> fXWire_Chamber2(reader, "x_wire_chamber_2");
225  TTreeReaderValue<float> fYWire_Chamber2(reader, "y_wire_chamber_2");
226  TTreeReaderValue<float> fZWire_Chamber2(reader, "z_wire_chamber_2");
227  TTreeReaderValue<float> fTWire_Chamber2(reader, "t_wire_chamber_2");
228  TTreeReaderValue<float> fXWire_Chamber3(reader, "x_wire_chamber_3");
229  TTreeReaderValue<float> fYWire_Chamber3(reader, "y_wire_chamber_3");
230  TTreeReaderValue<float> fZWire_Chamber3(reader, "z_wire_chamber_3");
231  TTreeReaderValue<float> fTWire_Chamber3(reader, "t_wire_chamber_3");
232  TTreeReaderValue<float> fXWire_Chamber4(reader, "x_wire_chamber_4");
233  TTreeReaderValue<float> fYWire_Chamber4(reader, "y_wire_chamber_4");
234  TTreeReaderValue<float> fZWire_Chamber4(reader, "z_wire_chamber_4");
235  TTreeReaderValue<float> fTWire_Chamber4(reader, "t_wire_chamber_4");
236 // TTreeReaderValue<float> fPxWire_Chamber1(reader, "px_wire_chamber_1");
237 // TTreeReaderValue<float> fPyWire_Chamber1(reader, "py_wire_chamber_1");
238 // TTreeReaderValue<float> fPzWire_Chamber1(reader, "pz_wire_chamber_1");
239 // TTreeReaderValue<float> fPxWire_Chamber2(reader, "px_wire_chamber_2");
240 // TTreeReaderValue<float> fPyWire_Chamber2(reader, "py_wire_chamber_2");
241 // TTreeReaderValue<float> fPzWire_Chamber2(reader, "pz_wire_chamber_2");
242 // TTreeReaderValue<float> fPxWire_Chamber3(reader, "px_wire_chamber_3");
243 // TTreeReaderValue<float> fPyWire_Chamber3(reader, "py_wire_chamber_3");
244 // TTreeReaderValue<float> fPzWire_Chamber3(reader, "pz_wire_chamber_3");
245 // TTreeReaderValue<float> fPxWire_Chamber4(reader, "px_wire_chamber_4");
246 // TTreeReaderValue<float> fPyWire_Chamber4(reader, "py_wire_chamber_4");
247 // TTreeReaderValue<float> fPzWire_Chamber4(reader, "pz_wire_chamber_4");
248  TTreeReaderValue<float> fttof_us(reader, "t_tof_us");
249  TTreeReaderValue<float> fttof_ds(reader, "t_tof_ds");
250  TTreeReaderValue<float> ftcherenkov(reader, "t_cerenkov");
251 // TTreeReaderValue<float> fxnova(reader, "x");
252 // TTreeReaderValue<float> fynova(reader, "y");
253 // TTreeReaderValue<float> fznova(reader, "z");
254 // TTreeReaderValue<float> ftnova(reader, "t");
255  //TTreeReaderValue<int> fspill_number(reader, "spill_number");
256 
257  while (reader.Next())
258  {
259  //veventid.push_back(*feventid);
260  //vx.push_back(*fx);
261 
262  //visnoise.push_back(*fisnoise);
267  vPresenttofus.push_back(*fPresenttofus);
268  vPresenttofds.push_back(*fPresenttofds);
270  vXWire_Chamber1.push_back(*fXWire_Chamber1);
271  vYWire_Chamber1.push_back(*fYWire_Chamber1);
272  vZWire_Chamber1.push_back(*fZWire_Chamber1);
273  vTWire_Chamber1.push_back(*fTWire_Chamber1);
274  vXWire_Chamber2.push_back(*fXWire_Chamber2);
275  vYWire_Chamber2.push_back(*fYWire_Chamber2);
276  vZWire_Chamber2.push_back(*fZWire_Chamber2);
277  vTWire_Chamber2.push_back(*fTWire_Chamber2);
278  vXWire_Chamber3.push_back(*fXWire_Chamber3);
279  vYWire_Chamber3.push_back(*fYWire_Chamber3);
280  vZWire_Chamber3.push_back(*fZWire_Chamber3);
281  vTWire_Chamber3.push_back(*fTWire_Chamber3);
282  vXWire_Chamber4.push_back(*fXWire_Chamber4);
283  vYWire_Chamber4.push_back(*fYWire_Chamber4);
284  vZWire_Chamber4.push_back(*fZWire_Chamber4);
285  vTWire_Chamber4.push_back(*fTWire_Chamber4);
286 // vPxWire_Chamber1.push_back(*fPxWire_Chamber1);
287 // vPyWire_Chamber1.push_back(*fPyWire_Chamber1);
288 // vPzWire_Chamber1.push_back(*fPzWire_Chamber1);
289 // vPxWire_Chamber2.push_back(*fPxWire_Chamber2);
290 // vPyWire_Chamber2.push_back(*fPyWire_Chamber2);
291 // vPzWire_Chamber2.push_back(*fPzWire_Chamber2);
292 // vPxWire_Chamber3.push_back(*fPxWire_Chamber3);
293 // vPyWire_Chamber3.push_back(*fPyWire_Chamber3);
294 // vPzWire_Chamber3.push_back(*fPzWire_Chamber3);
295 // vPxWire_Chamber4.push_back(*fPxWire_Chamber4);
296 // vPyWire_Chamber4.push_back(*fPyWire_Chamber4);
297 // vPzWire_Chamber4.push_back(*fPzWire_Chamber4);
298  vttof_us.push_back(*fttof_us);
299  vttof_ds.push_back(*fttof_ds);
300  vtcherenkov.push_back(*ftcherenkov);
301 // vxnova.push_back(*fxnova);
302 // vynova.push_back(*fynova);
303 // vznova.push_back(*fznova);
304 // vtnova.push_back(*ftnova);
305  //vspill_number.push_back(*fspill_number);
306  }
307 
308  //std::cout<<"eventid (1) " << veventid[1]<<std::endl;
309  //std::cout<<"eventid (2) " << veventid[2]<<std::endl;
310  //std::cout<<"x (1) " << vx[1]<<std::endl;
311  //std::cout<<"x (2) " << vx[2]<<std::endl;
312  return;
313 }
std::vector< unsigned int > vPresentcherenkov
std::vector< unsigned int > vPresentWire_Chamber2
std::vector< unsigned int > vPresentWire_Chamber3
std::vector< unsigned int > vPresentWire_Chamber1
std::vector< unsigned int > vPresentWire_Chamber4
std::vector< unsigned int > vPresenttofds
std::vector< unsigned int > vPresenttofus
float_t beamlinesim::BeamlineSimInput::bltof ( float_t  tof_us,
float_t  tof_ds,
int  presenttofus,
int  presenttofds 
)
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::EDProducer::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
template<typename PROD , BranchType B>
ProductID art::EDProducer::getProductID ( std::string const &  instanceName = {}) const
inlineinherited

Definition at line 123 of file EDProducer.h.

References art::EDProducer::moduleDescription_.

Referenced by skim::NueSkimmer::CopyMichelSlice(), and skim::NueSkimmer::CopyMichelTrack().

124  {
125  return ProducerBase::getProductID<PROD, B>(moduleDescription_,
126  instanceName);
127  }
ModuleDescription moduleDescription_
Definition: EDProducer.h:115
template<typename PROD , BranchType B>
ProductID art::ProducerBase::getProductID ( ModuleDescription const &  moduleDescription,
std::string const &  instanceName 
) const
inherited

Definition at line 56 of file ProducerBase.h.

References art::ModuleDescription::moduleLabel().

Referenced by art::ProducerBase::modifiesEvent().

58  {
59  auto const& pd =
60  get_ProductDescription<PROD>(B, md.moduleLabel(), instanceName);
61  return pd.productID();
62  }
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::ProducerBase::modifiesEvent ( ) const
inlineinherited

Definition at line 40 of file ProducerBase.h.

References art::ProducerBase::getProductID(), and string.

41  {
42  return true;
43  }
static cet::exempt_ptr<Consumer> art::Consumer::non_module_context ( )
staticinherited
void art::Consumer::prepareForJob ( fhicl::ParameterSet const &  pset)
protectedinherited
void beamlinesim::BeamlineSimInput::produce ( art::Event evt)
virtual

Implements art::EDProducer.

Definition at line 329 of file BeamlineSimInput_module.cc.

References rawdata::RawBeamlineWC::AddXPulse(), rawdata::RawBeamlineWC::AddYPulse(), om::cout, DEFINE_ART_MODULE(), allTimeWatchdog::endl, art::Event::event(), event_no, art::fill_ptr_vector(), final_index, art::DataViewImpl::getByLabel(), MECModelEnuComparisons::i, particle_no, art::Event::put(), stan::math::round(), brb::Cherenkov::SetTime(), brb::ToF::SetTime(), brb::ToF::SetTimestamps(), total_particles, vPresentcherenkov, vPresenttofds, vPresenttofus, vPresentWire_Chamber1, vPresentWire_Chamber2, vPresentWire_Chamber3, vPresentWire_Chamber4, vtcherenkov, vttof_ds, vttof_us, vTWire_Chamber1, vTWire_Chamber2, vTWire_Chamber3, vTWire_Chamber4, vXWire_Chamber1, vXWire_Chamber2, vXWire_Chamber3, vXWire_Chamber4, vYWire_Chamber1, vYWire_Chamber2, vYWire_Chamber3, vYWire_Chamber4, and beamlinegeo::WC.

329  {
330 
332  std::vector<art::Ptr<simb::MCTruth> > mcTruths;
333  if (evt.getByLabel("generator", mcTruthHandle))
334  art::fill_ptr_vector(mcTruths, mcTruthHandle);
335 
336  std::cout << "There are " << mcTruths.size() << " mc truths in event " << evt.event() << std::endl;
337  particle_no=0;
338  event_no=evt.event();
339  std::cout<<"event number "<<event_no<<std::endl;
340  for (std::vector<art::Ptr<simb::MCTruth> >::const_iterator mcTruthIt = mcTruths.begin(); mcTruthIt != mcTruths.end(); ++mcTruthIt)
341  {
342  std::cout << " There are " << (*mcTruthIt)->NParticles() << " particles in this MCTruth." << std::endl;
343  particle_no=(*mcTruthIt)->NParticles();
344  }
345 
346  std::unique_ptr<std::vector<brb::ToF> > TOFptr(new std::vector<brb::ToF>);
347  std::unique_ptr<std::vector<brb::Cherenkov> > CHKVptr(new std::vector<brb::Cherenkov>);
348  std::unique_ptr<std::vector<rawdata::RawBeamlineWC> > WCptr(new std::vector<rawdata::RawBeamlineWC>);
349 
350  if(evt.event()!=6964)
351  {
352 
353  for (int i=0;i<particle_no;i++)
354  {
355  final_index = total_particles ;//+ i;
356  //total_particles=final_index;
357 // std::cout<<"putting particle number "<<i+1 <<" in the event"<<std::endl;
358 // std::cout<<"totalparticles is "<<total_particles<<std::endl;
359 // std::cout<<"final index is "<<final_index<<std::endl;
360  // reformat into novasoft data types
361  //Time of flight
362  brb::ToF tofobject;
363  std::pair <float,float> tofpair;
364  if (vPresenttofus[final_index]==1)
365  {
366  tofpair.first=vttof_us[final_index];
367  }
368  if ( vPresenttofds[final_index]==1)
369  {
370  tofpair.second=vttof_ds[final_index];
371  }
373  {
375  tofobject.SetTimestamps(tofpair);
376  TOFptr->push_back(tofobject);
377  std::cout<<"the tof_us added to the event is "<< vttof_us[final_index] <<std::endl;
378  std::cout<<"the tof_ds added to the event is "<< vttof_ds[final_index] <<std::endl;
379  std::cout<<"the tof added to the event is "<< vttof_us[final_index]-vttof_ds[final_index] <<std::endl;
380  }
381  else
382  {
383  //std::cout<<"------------------------ didn't pass through both tof ------------------------------------------------------------------"<<std::endl;
384  }
385  //bool tofp=bool(vPresenttofus[final_index]) && bool(vPresenttofds[final_index]);
386  //std::cout<<"tof present up = "<< vPresenttofus[final_index] <<std::endl;
387  //std::cout<<"tof present up = "<< vPresenttofds[final_index] <<std::endl;
388 
389  //cherenkov
390 
391  brb::Cherenkov cherenkov_object;
392  if(vPresentcherenkov[final_index]==1){
393  cherenkov_object.SetTime(vtcherenkov[final_index]);
394  CHKVptr->push_back(cherenkov_object);
395  //std::cout<<"the cherenkov timestamp added to the event is "<< vtcherenkov[final_index] <<std::endl;
396  }
397  else
398  {
399  //std::cout<<"-------------------------- didn't pass through cherenkov-----------------------------------------------------------------"<<std::endl;
400  }
401 
402  //std::cout<<"cherenkov present = "<< vPresentcherenkov[final_index] <<std::endl;
403 
404  //wirechambers
405 
406  std::vector<rawdata::RawBeamlineWC> WCobject;
407 
408  std::vector<double> fchannelx;
409  std::vector<double> fchannely;
410  std::vector<uint64_t> fWCtime;
411  std::vector<unsigned int> fWCpresent;
412  std::vector<double> xWC;
413  std::vector<double> yWC;
414 
415  fchannelx.push_back(round((-(-491.51-vXWire_Chamber1[final_index])+64)/(TMath::Cos(16*TMath::Pi()/180))));
416  fchannelx.push_back(round((-(-910.57-vXWire_Chamber2[final_index])+64)/(TMath::Cos(16*TMath::Pi()/180))));
417  fchannelx.push_back(round(-(-1354.35-vXWire_Chamber3[final_index])+64));
418  fchannelx.push_back(round(-(-1354.35-vXWire_Chamber4[final_index])+64));
419 
420  fchannely.push_back(round(vYWire_Chamber1[final_index]+64));
421  fchannely.push_back(round(vYWire_Chamber2[final_index]+64));
422  fchannely.push_back(round(vYWire_Chamber3[final_index]+64));
423  fchannely.push_back(round(vYWire_Chamber4[final_index]+64));
424 
425  fWCtime.push_back(vTWire_Chamber1[final_index]);
426  fWCtime.push_back(vTWire_Chamber2[final_index]);
427  fWCtime.push_back(vTWire_Chamber3[final_index]);
428  fWCtime.push_back(vTWire_Chamber4[final_index]);
429 
430  fWCpresent.push_back(vPresentWire_Chamber1[final_index]);
431  fWCpresent.push_back(vPresentWire_Chamber2[final_index]);
432  fWCpresent.push_back(vPresentWire_Chamber3[final_index]);
433  fWCpresent.push_back(vPresentWire_Chamber4[final_index]);
434 
435  //just for debugging--------------------------------------------------
436  xWC.push_back(vXWire_Chamber1[final_index]);
437  xWC.push_back(vXWire_Chamber2[final_index]);
438  xWC.push_back(vXWire_Chamber3[final_index]);
439  xWC.push_back(vXWire_Chamber4[final_index]);
440 
441  yWC.push_back(vYWire_Chamber1[final_index]);
442  yWC.push_back(vYWire_Chamber2[final_index]);
443  yWC.push_back(vYWire_Chamber3[final_index]);
444  yWC.push_back(vYWire_Chamber4[final_index]);
445  //--mike helping me debug----------
446 // for (unsigned int wcNum = 0; wcNum < 4; ++wcNum) {
447 //
448 // rawdata::RawBeamlineWC::WCPulse xpulse(fchannelx[wcNum], fWCtime[wcNum]);
449 // rawdata::RawBeamlineWC::WCPulse ypulse(fchannely[wcNum], fWCtime[wcNum]);
450 //
451 // rawdata::RawBeamlineWC wc;//(wcNum, Form("WC%d", wcNum));
452 // wc.SetWCNumber(wcNum+1);
453 // //if (fWCpresent[wcNum]) {
454 // wc.AddXPulse(xpulse);
455 // wc.AddYPulse(ypulse);
456 // //}
457 //
458 // WCptr->push_back(wc);
459 //
460 // }
461  //------------------------------------
462 
463  for(unsigned int k=0;k<4;k++)
464  {
465  // Detector ID for this wire chamber
467 
468  rawdata::RawBeamlineWC::WCPulse xpulse(fchannelx[k],fWCtime[k]);
469  rawdata::RawBeamlineWC::WCPulse ypulse(fchannely[k],fWCtime[k]);
470  rawdata::RawBeamlineWC WCobject(detectorID);
471  WCobject.AddXPulse(xpulse);
472  WCobject.AddYPulse(ypulse);
473 
474  if (fWCpresent[k]==1) {
475 
476  std::cout<<"the x wire number for WC "<< k+1 <<" added to the event is "<< fchannelx[k]<<" and the x wire coordinate is "<<xWC[k] <<std::endl;
477  std::cout<<"the y wire number for WC "<< k+1 <<" added to the event is "<< fchannely[k] <<" and the y wire coordinate is "<<yWC[k] <<std::endl;
478  WCptr->push_back(WCobject);
479  }
480  else{
481  std::cout<<"-------------------- No WC "<<k+1<<" objects added ---------------------------"<<std::endl;
482  }
483 // std::cout<<"the x wire number for WC "<< k+1 <<" added to the event is "<< fchannelx[k] <<std::endl;
484 // std::cout<<"the x wire coordinate for WC "<<k+1<<" added to the event is "<<xWC[k] << std::endl;
485 // std::cout<<"the y wire number for WC "<< k+1 <<" added to the event is "<< fchannely[k] <<std::endl;
486 // std::cout<<"the y wire coordinate for WC "<<k+1<<" added to the event is "<<yWC[k] << std::endl;
487 // std::cout<<"wire chamber "<<k+1<<" present "<<fWCpresent[k] << std::endl;
488 
489  }
490 
491 
492  fchannelx.clear();
493  fchannely.clear();
494  fWCtime.clear();
495  fWCpresent.clear();
496  xWC.clear();
497  yWC.clear();
498  total_particles++;
499 
500  }
501 
502  evt.put(std::move(TOFptr));
503  evt.put(std::move(CHKVptr));
504  evt.put(std::move(WCptr));
505 
506  }
507  return;
508 
509 }
void SetTimestamps(std::pair< float, float > timestamps)
Definition: ToF.cxx:47
void SetTime(float time)
Definition: ToF.cxx:41
std::vector< unsigned int > vPresentcherenkov
std::vector< unsigned int > vPresentWire_Chamber2
std::vector< unsigned int > vPresentWire_Chamber3
void SetTime(float time)
Definition: Cherenkov.cxx:32
std::vector< unsigned int > vPresentWire_Chamber1
fvar< T > round(const fvar< T > &x)
Definition: round.hpp:23
ProductID put(std::unique_ptr< PROD > &&product)
Definition: Event.h:102
Definition: ToF.h:25
std::vector< unsigned int > vPresentWire_Chamber4
EventNumber_t event() const
Definition: Event.h:67
OStream cout
Definition: OStream.cxx:6
std::vector< unsigned int > vPresenttofds
std::vector< unsigned int > vPresenttofus
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Definition: DataViewImpl.h:344
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
Definition: Ptr.h:464
void beamlinesim::BeamlineSimInput::reconfigure ( const fhicl::ParameterSet pset)

Definition at line 325 of file BeamlineSimInput_module.cc.

Referenced by BeamlineSimInput().

325  {
326 }
void art::Consumer::showMissingConsumes ( ) const
protectedinherited

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

void art::Consumer::validateConsumedProduct ( BranchType const  bt,
ProductInfo const &  pi 
)
protectedinherited

Member Data Documentation

int beamlinesim::BeamlineSimInput::event_no

Definition at line 88 of file BeamlineSimInput_module.cc.

Referenced by produce().

TFile* beamlinesim::BeamlineSimInput::fBeamlineSimFile
private

Definition at line 97 of file BeamlineSimInput_module.cc.

Referenced by beginJob().

TTree* beamlinesim::BeamlineSimInput::fBeamlineSimTree
private

Definition at line 98 of file BeamlineSimInput_module.cc.

int beamlinesim::BeamlineSimInput::fBeamlineTreeIndex
private

Definition at line 102 of file BeamlineSimInput_module.cc.

int beamlinesim::BeamlineSimInput::final_index

Definition at line 89 of file BeamlineSimInput_module.cc.

Referenced by BeamlineSimInput(), and produce().

int beamlinesim::BeamlineSimInput::fPresentcherenkov
private

Definition at line 163 of file BeamlineSimInput_module.cc.

Referenced by beginJob().

int beamlinesim::BeamlineSimInput::fPresenttofds
private

Definition at line 162 of file BeamlineSimInput_module.cc.

Referenced by beginJob().

int beamlinesim::BeamlineSimInput::fPresenttofus
private

Definition at line 161 of file BeamlineSimInput_module.cc.

Referenced by beginJob().

int beamlinesim::BeamlineSimInput::fPresentWire_Chamber1
private

Definition at line 157 of file BeamlineSimInput_module.cc.

Referenced by beginJob().

int beamlinesim::BeamlineSimInput::fPresentWire_Chamber2
private

Definition at line 158 of file BeamlineSimInput_module.cc.

Referenced by beginJob().

int beamlinesim::BeamlineSimInput::fPresentWire_Chamber3
private

Definition at line 159 of file BeamlineSimInput_module.cc.

Referenced by beginJob().

int beamlinesim::BeamlineSimInput::fPresentWire_Chamber4
private

Definition at line 160 of file BeamlineSimInput_module.cc.

Referenced by beginJob().

art::InputTag beamlinesim::BeamlineSimInput::fRawToFDataLabel
private

Definition at line 94 of file BeamlineSimInput_module.cc.

float_t beamlinesim::BeamlineSimInput::ftcherenkov
private

Definition at line 194 of file BeamlineSimInput_module.cc.

Referenced by beginJob().

float_t beamlinesim::BeamlineSimInput::fttof_ds
private

Definition at line 193 of file BeamlineSimInput_module.cc.

Referenced by beginJob().

float_t beamlinesim::BeamlineSimInput::fttof_us
private

Definition at line 192 of file BeamlineSimInput_module.cc.

Referenced by beginJob().

float_t beamlinesim::BeamlineSimInput::fTWire_Chamber1
private

Definition at line 167 of file BeamlineSimInput_module.cc.

Referenced by beginJob().

float_t beamlinesim::BeamlineSimInput::fTWire_Chamber2
private

Definition at line 171 of file BeamlineSimInput_module.cc.

Referenced by beginJob().

float_t beamlinesim::BeamlineSimInput::fTWire_Chamber3
private

Definition at line 175 of file BeamlineSimInput_module.cc.

Referenced by beginJob().

float_t beamlinesim::BeamlineSimInput::fTWire_Chamber4
private

Definition at line 179 of file BeamlineSimInput_module.cc.

Referenced by beginJob().

float_t beamlinesim::BeamlineSimInput::fXWire_Chamber1
private

Definition at line 164 of file BeamlineSimInput_module.cc.

Referenced by beginJob().

float_t beamlinesim::BeamlineSimInput::fXWire_Chamber2
private

Definition at line 168 of file BeamlineSimInput_module.cc.

Referenced by beginJob().

float_t beamlinesim::BeamlineSimInput::fXWire_Chamber3
private

Definition at line 172 of file BeamlineSimInput_module.cc.

Referenced by beginJob().

float_t beamlinesim::BeamlineSimInput::fXWire_Chamber4
private

Definition at line 176 of file BeamlineSimInput_module.cc.

Referenced by beginJob().

float_t beamlinesim::BeamlineSimInput::fYWire_Chamber1
private

Definition at line 165 of file BeamlineSimInput_module.cc.

Referenced by beginJob().

float_t beamlinesim::BeamlineSimInput::fYWire_Chamber2
private

Definition at line 169 of file BeamlineSimInput_module.cc.

Referenced by beginJob().

float_t beamlinesim::BeamlineSimInput::fYWire_Chamber3
private

Definition at line 173 of file BeamlineSimInput_module.cc.

Referenced by beginJob().

float_t beamlinesim::BeamlineSimInput::fYWire_Chamber4
private

Definition at line 177 of file BeamlineSimInput_module.cc.

Referenced by beginJob().

float_t beamlinesim::BeamlineSimInput::fZWire_Chamber1
private

Definition at line 166 of file BeamlineSimInput_module.cc.

Referenced by beginJob().

float_t beamlinesim::BeamlineSimInput::fZWire_Chamber2
private

Definition at line 170 of file BeamlineSimInput_module.cc.

Referenced by beginJob().

float_t beamlinesim::BeamlineSimInput::fZWire_Chamber3
private

Definition at line 174 of file BeamlineSimInput_module.cc.

Referenced by beginJob().

float_t beamlinesim::BeamlineSimInput::fZWire_Chamber4
private

Definition at line 178 of file BeamlineSimInput_module.cc.

Referenced by beginJob().

int beamlinesim::BeamlineSimInput::particle_no

Definition at line 87 of file BeamlineSimInput_module.cc.

Referenced by produce().

TTreeReader beamlinesim::BeamlineSimInput::reader

Definition at line 85 of file BeamlineSimInput_module.cc.

Referenced by beginJob().

int beamlinesim::BeamlineSimInput::total_particles

Definition at line 90 of file BeamlineSimInput_module.cc.

Referenced by BeamlineSimInput(), and produce().

TTree* beamlinesim::BeamlineSimInput::tree

Definition at line 86 of file BeamlineSimInput_module.cc.

std::vector<unsigned int> beamlinesim::BeamlineSimInput::vPresentcherenkov
private

Definition at line 117 of file BeamlineSimInput_module.cc.

Referenced by beginJob(), and produce().

std::vector<unsigned int> beamlinesim::BeamlineSimInput::vPresenttofds
private

Definition at line 116 of file BeamlineSimInput_module.cc.

Referenced by beginJob(), and produce().

std::vector<unsigned int> beamlinesim::BeamlineSimInput::vPresenttofus
private

Definition at line 115 of file BeamlineSimInput_module.cc.

Referenced by beginJob(), and produce().

std::vector<unsigned int> beamlinesim::BeamlineSimInput::vPresentWire_Chamber1
private

Definition at line 111 of file BeamlineSimInput_module.cc.

Referenced by beginJob(), and produce().

std::vector<unsigned int> beamlinesim::BeamlineSimInput::vPresentWire_Chamber2
private

Definition at line 112 of file BeamlineSimInput_module.cc.

Referenced by beginJob(), and produce().

std::vector<unsigned int> beamlinesim::BeamlineSimInput::vPresentWire_Chamber3
private

Definition at line 113 of file BeamlineSimInput_module.cc.

Referenced by beginJob(), and produce().

std::vector<unsigned int> beamlinesim::BeamlineSimInput::vPresentWire_Chamber4
private

Definition at line 114 of file BeamlineSimInput_module.cc.

Referenced by beginJob(), and produce().

std::vector<float_t> beamlinesim::BeamlineSimInput::vtcherenkov
private

Definition at line 148 of file BeamlineSimInput_module.cc.

Referenced by beginJob(), and produce().

std::vector<float_t> beamlinesim::BeamlineSimInput::vtnova
private

Definition at line 152 of file BeamlineSimInput_module.cc.

std::vector<float_t> beamlinesim::BeamlineSimInput::vttof_ds
private

Definition at line 147 of file BeamlineSimInput_module.cc.

Referenced by beginJob(), and produce().

std::vector<float_t> beamlinesim::BeamlineSimInput::vttof_us
private

Definition at line 146 of file BeamlineSimInput_module.cc.

Referenced by beginJob(), and produce().

std::vector<float_t> beamlinesim::BeamlineSimInput::vTWire_Chamber1
private

Definition at line 121 of file BeamlineSimInput_module.cc.

Referenced by beginJob(), and produce().

std::vector<float_t> beamlinesim::BeamlineSimInput::vTWire_Chamber2
private

Definition at line 125 of file BeamlineSimInput_module.cc.

Referenced by beginJob(), and produce().

std::vector<float_t> beamlinesim::BeamlineSimInput::vTWire_Chamber3
private

Definition at line 129 of file BeamlineSimInput_module.cc.

Referenced by beginJob(), and produce().

std::vector<float_t> beamlinesim::BeamlineSimInput::vTWire_Chamber4
private

Definition at line 133 of file BeamlineSimInput_module.cc.

Referenced by beginJob(), and produce().

std::vector<float_t> beamlinesim::BeamlineSimInput::vxnova
private

Definition at line 149 of file BeamlineSimInput_module.cc.

std::vector<float_t> beamlinesim::BeamlineSimInput::vXWire_Chamber1
private

Definition at line 118 of file BeamlineSimInput_module.cc.

Referenced by beginJob(), and produce().

std::vector<float_t> beamlinesim::BeamlineSimInput::vXWire_Chamber2
private

Definition at line 122 of file BeamlineSimInput_module.cc.

Referenced by beginJob(), and produce().

std::vector<float_t> beamlinesim::BeamlineSimInput::vXWire_Chamber3
private

Definition at line 126 of file BeamlineSimInput_module.cc.

Referenced by beginJob(), and produce().

std::vector<float_t> beamlinesim::BeamlineSimInput::vXWire_Chamber4
private

Definition at line 130 of file BeamlineSimInput_module.cc.

Referenced by beginJob(), and produce().

std::vector<float_t> beamlinesim::BeamlineSimInput::vynova
private

Definition at line 150 of file BeamlineSimInput_module.cc.

std::vector<float_t> beamlinesim::BeamlineSimInput::vYWire_Chamber1
private

Definition at line 119 of file BeamlineSimInput_module.cc.

Referenced by beginJob(), and produce().

std::vector<float_t> beamlinesim::BeamlineSimInput::vYWire_Chamber2
private

Definition at line 123 of file BeamlineSimInput_module.cc.

Referenced by beginJob(), and produce().

std::vector<float_t> beamlinesim::BeamlineSimInput::vYWire_Chamber3
private

Definition at line 127 of file BeamlineSimInput_module.cc.

Referenced by beginJob(), and produce().

std::vector<float_t> beamlinesim::BeamlineSimInput::vYWire_Chamber4
private

Definition at line 131 of file BeamlineSimInput_module.cc.

Referenced by beginJob(), and produce().

std::vector<float_t> beamlinesim::BeamlineSimInput::vznova
private

Definition at line 151 of file BeamlineSimInput_module.cc.

std::vector<float_t> beamlinesim::BeamlineSimInput::vZWire_Chamber1
private

Definition at line 120 of file BeamlineSimInput_module.cc.

Referenced by beginJob().

std::vector<float_t> beamlinesim::BeamlineSimInput::vZWire_Chamber2
private

Definition at line 124 of file BeamlineSimInput_module.cc.

Referenced by beginJob().

std::vector<float_t> beamlinesim::BeamlineSimInput::vZWire_Chamber3
private

Definition at line 128 of file BeamlineSimInput_module.cc.

Referenced by beginJob().

std::vector<float_t> beamlinesim::BeamlineSimInput::vZWire_Chamber4
private

Definition at line 132 of file BeamlineSimInput_module.cc.

Referenced by beginJob().


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