LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
wc::CellTree Class Reference
Inheritance diagram for wc::CellTree:
art::EDAnalyzer art::EventObserverBase art::Consumer art::EngineCreator

Public Types

using WorkerType = WorkerT< EDAnalyzer >
 
using ModuleType = EDAnalyzer
 

Public Member Functions

 CellTree (fhicl::ParameterSet const &pset)
 
virtual ~CellTree ()
 
void beginJob ()
 
void endJob ()
 
void beginRun (const art::Run &run)
 
void analyze (const art::Event &evt)
 
void reconfigure (fhicl::ParameterSet const &pset)
 
void initOutput ()
 
void printEvent ()
 
void print_vector (ostream &out, vector< double > &v, TString desc, bool end=false)
 
void processRaw (const art::Event &evt)
 
void processCalib (const art::Event &evt)
 
void processOpHit (const art::Event &evt)
 
void processOpFlash (const art::Event &evt)
 
void processSpacePoint (const art::Event &event, TString option, ostream &out=cout)
 
void processSimChannel (const art::Event &evt)
 
void processMC (const art::Event &evt)
 
void processMCTracks ()
 
void processTrigger (const art::Event &evt)
 
void reset ()
 
void InitProcessMap ()
 
bool IsPrimary (int i)
 
bool KeepMC (int i)
 
double KE (float *momentum)
 
TString PDGName (int pdg)
 
bool DumpMCJSON (int id, ostream &out)
 
void DumpMCJSON (ostream &out=cout)
 
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< T > consumes (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< T > consumes (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< T > consumesView (InputTag const &it)
 
template<typename T , BranchType = InEvent>
ProductToken< T > mayConsume (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< T > mayConsume (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< T > mayConsumeView (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 fRawDigitLabel
 
std::string fCalibLabel
 
std::string fOpHitLabel
 
std::string fOpFlashLabel
 
std::string fTriggerLabel
 
std::vector< std::string > fSpacePointLabels
 
std::string fOutFileName
 
std::string mcOption
 
int nRawSamples
 
float opMultPEThresh
 
bool fSaveMCTrackPoints
 
bool fSaveSimChannel
 
bool fSaveRaw
 
bool fSaveCalib
 
bool fSaveOpHit
 
bool fSaveOpFlash
 
bool fSaveMC
 
bool fSaveTrigger
 
bool fSaveJSON
 
art::ServiceHandle< geo::GeometryfGeometry
 
TFile * fOutFile
 
TTree * fEventTree
 
std::map< std::string, int > processMap
 
std::map< int, int > savedMCTrackIdMap
 
int entryNo
 
int fEvent
 
int fRun
 
int fSubRun
 
double fEventTime
 
unsigned int fTriggernumber
 
double fTriggertime
 
double fBeamgatetime
 
unsigned int fTriggerbits
 
int fCalib_nChannel
 
std::vector< int > fCalib_channelId
 
TClonesArray * fCalib_wf
 
int oh_nHits
 
vector< int > oh_channel
 
vector< double > oh_bgtime
 
vector< double > oh_trigtime
 
vector< double > oh_pe
 
int of_nFlash
 
vector< float > of_t
 
vector< float > of_peTotal
 
vector< int > of_multiplicity
 
TClonesArray * fPEperOpDet
 
int fRaw_nChannel
 
std::vector< int > fRaw_channelId
 
TClonesArray * fRaw_wf
 
int fSIMIDE_size
 
vector< int > fSIMIDE_channelIdY
 
vector< int > fSIMIDE_trackId
 
vector< unsigned short > fSIMIDE_tdc
 
vector< float > fSIMIDE_x
 
vector< float > fSIMIDE_y
 
vector< float > fSIMIDE_z
 
vector< float > fSIMIDE_numElectrons
 
int mc_Ntrack
 
int mc_id [MAX_TRACKS]
 
int mc_pdg [MAX_TRACKS]
 
int mc_process [MAX_TRACKS]
 
int mc_mother [MAX_TRACKS]
 
float mc_startXYZT [MAX_TRACKS][4]
 
float mc_endXYZT [MAX_TRACKS][4]
 
float mc_startMomentum [MAX_TRACKS][4]
 
float mc_endMomentum [MAX_TRACKS][4]
 
std::vector< std::vector< int > > mc_daughters
 
TObjArray * fMC_trackPosition
 
int mc_isnu
 
int mc_nGeniePrimaries
 
int mc_nu_pdg
 
int mc_nu_ccnc
 
int mc_nu_mode
 
int mc_nu_intType
 
int mc_nu_target
 
int mc_hitnuc
 
int mc_hitquark
 
double mc_nu_Q2
 
double mc_nu_W
 
double mc_nu_X
 
double mc_nu_Y
 
double mc_nu_Pt
 
double mc_nu_Theta
 
float mc_nu_pos [4]
 
float mc_nu_mom [4]
 
std::map< int, int > trackIndex
 
std::vector< std::vector< int > > trackParents
 
std::vector< std::vector< int > > trackChildren
 
std::vector< std::vector< int > > trackSiblings
 
TDatabasePDG * dbPDG
 

Detailed Description

Definition at line 76 of file CellTree_module.cc.

Member Typedef Documentation

Definition at line 39 of file EDAnalyzer.h.

Definition at line 38 of file EDAnalyzer.h.

Constructor & Destructor Documentation

wc::CellTree::CellTree ( fhicl::ParameterSet const &  pset)
explicit

Definition at line 232 of file CellTree_module.cc.

References dbPDG, entryNo, initOutput(), InitProcessMap(), and reconfigure().

233  : EDAnalyzer(parameterSet)
234 {
235  dbPDG = new TDatabasePDG();
236 
237  reconfigure(parameterSet);
238  InitProcessMap();
239  initOutput();
240  entryNo = 0;
241 }
void reconfigure(fhicl::ParameterSet const &pset)
TDatabasePDG * dbPDG
EDAnalyzer(Table< Config > const &config)
Definition: EDAnalyzer.h:100
wc::CellTree::~CellTree ( )
virtual

Definition at line 244 of file CellTree_module.cc.

245 {
246 }

Member Function Documentation

void wc::CellTree::analyze ( const art::Event evt)

Definition at line 408 of file CellTree_module.cc.

References DumpMCJSON(), entryNo, fEvent, fEventTime, fEventTree, fRun, fSaveCalib, fSaveJSON, fSaveMC, fSaveOpFlash, fSaveOpHit, fSaveRaw, fSaveSimChannel, fSaveTrigger, fSpacePointLabels, fSubRun, processCalib(), processMC(), processMCTracks(), processOpFlash(), processOpHit(), processRaw(), processSimChannel(), processSpacePoint(), processTrigger(), reset(), art::Timestamp::timeHigh(), and art::Timestamp::timeLow().

409 {
410  reset();
411  fEvent = event.id().event();
412  fRun = event.run();
413  fSubRun = event.subRun();
414  art::Timestamp ts = event.time();
415  TTimeStamp tts(ts.timeHigh(), ts.timeLow());
416  fEventTime = tts.AsDouble();
417 
418  if (fSaveRaw) processRaw(event);
423  if (fSaveMC) processMC(event);
425 
426  if (fSaveJSON) {
427  gSystem->MakeDirectory(TString::Format("data/%i", entryNo).Data());
428  int nSp = fSpacePointLabels.size();
429  for (int i=0; i<nSp; i++) {
430  TString jsonfile;
431  jsonfile.Form("data/%i/%i-%s.json", entryNo, entryNo, fSpacePointLabels[i].c_str());
432  std::ofstream out(jsonfile.Data());
434  out.close();
435  }
436 
437  if(fSaveMC) {
438  processMCTracks();
439  TString jsonfile;
440  jsonfile.Form("data/%i/%i-mc.json", entryNo, entryNo);
441  std::ofstream out(jsonfile.Data());
442  DumpMCJSON(out);
443  out.close();
444  }
445  }
446 
447  // printEvent();
448  fEventTree->Fill();
449 
450  entryNo++;
451 }
constexpr std::uint32_t timeLow() const
Definition: Timestamp.h:30
void processMCTracks()
void processRaw(const art::Event &evt)
constexpr std::uint32_t timeHigh() const
Definition: Timestamp.h:35
void processSimChannel(const art::Event &evt)
bool DumpMCJSON(int id, ostream &out)
void processOpFlash(const art::Event &evt)
void processOpHit(const art::Event &evt)
void processCalib(const art::Event &evt)
void processMC(const art::Event &evt)
std::vector< std::string > fSpacePointLabels
void processSpacePoint(const art::Event &event, TString option, ostream &out=cout)
Event finding and building.
void processTrigger(const art::Event &evt)
void wc::CellTree::beginJob ( )
virtual

Reimplemented from art::EDAnalyzer.

Definition at line 375 of file CellTree_module.cc.

376 {
377 
378 
379 }
void wc::CellTree::beginRun ( const art::Run run)

Definition at line 402 of file CellTree_module.cc.

403 {
404  mf::LogInfo("CellTree") << "begin run";
405 }
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
detail::CachedProducts& art::EventObserverBase::cachedProducts ( )
inlineprotectedinherited

Definition at line 79 of file EventObserverBase.h.

References art::EventObserverBase::selectors_.

Referenced by art::EDAnalyzer::doEvent(), and art::OutputModule::doWriteEvent().

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 147 of file Consumer.h.

References art::InputTag::instance(), art::InputTag::label(), and art::InputTag::process().

148 {
149  if (!moduleContext_)
150  return ProductToken<T>::invalid();
151 
152  consumables_[BT].emplace_back(ConsumableType::Product,
153  TypeID{typeid(T)},
154  it.label(),
155  it.instance(),
156  it.process());
157  return ProductToken<T>{it};
158 }
static ProductToken< T > invalid()
Definition: ProductToken.h:47
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
template<typename T , art::BranchType BT>
void art::Consumer::consumesMany ( )
inherited

Definition at line 162 of file Consumer.h.

163 {
164  if (!moduleContext_)
165  return;
166 
167  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
168 }
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
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 172 of file Consumer.h.

References art::InputTag::instance(), art::InputTag::label(), and art::InputTag::process().

173 {
174  if (!moduleContext_)
175  return ViewToken<T>::invalid();
176 
177  consumables_[BT].emplace_back(ConsumableType::ViewElement,
178  TypeID{typeid(T)},
179  it.label(),
180  it.instance(),
181  it.process());
182  return ViewToken<T>{it};
183 }
static ViewToken< Element > invalid()
Definition: ProductToken.h:75
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
EngineCreator::base_engine_t & EngineCreator::createEngine ( seed_t  seed,
std::string const &  kind_of_engine_to_make 
)
inherited

Definition at line 32 of file EngineCreator.cc.

References art::EngineCreator::rng().

34 {
35  return rng()->createEngine(
36  placeholder_schedule_id(), seed, kind_of_engine_to_make);
37 }
long seed
Definition: chem4.cc:68
static art::ServiceHandle< art::RandomNumberGenerator > & rng()
EngineCreator::base_engine_t & EngineCreator::createEngine ( seed_t  seed,
std::string const &  kind_of_engine_to_make,
label_t const &  engine_label 
)
inherited

Definition at line 40 of file EngineCreator.cc.

References art::EngineCreator::rng().

43 {
44  return rng()->createEngine(
45  placeholder_schedule_id(), seed, kind_of_engine_to_make, engine_label);
46 }
long seed
Definition: chem4.cc:68
static art::ServiceHandle< art::RandomNumberGenerator > & rng()
CurrentProcessingContext const * art::EDAnalyzer::currentContext ( ) const
protectedinherited

Definition at line 114 of file EDAnalyzer.cc.

References art::EDAnalyzer::current_context_.

Referenced by art::EDAnalyzer::workerType().

115  {
116  return current_context_.get();
117  }
CPC_exempt_ptr current_context_
Definition: EDAnalyzer.h:179
bool wc::CellTree::DumpMCJSON ( int  id,
ostream &  out 
)

Definition at line 966 of file CellTree_module.cc.

References e, KE(), KeepMC(), mc_daughters, mc_endXYZT, mc_pdg, mc_startMomentum, mc_startXYZT, PDGName(), and trackIndex.

Referenced by analyze(), and DumpMCJSON().

967 {
968  int i = trackIndex[id];
969  if (!KeepMC(i)) return false;
970 
971  int e = KE(mc_startMomentum[i])*1000;
972 
973  int nDaughter = mc_daughters.at(i).size();
974  vector<int> saved_daughters;
975  for (int j=0; j<nDaughter; j++) {
976  int daughter_id = mc_daughters.at(i).at(j);
977  // int e_daughter = KE(mc_startMomentum[ trackIndex[daughter_id] ])*1000;
978  // if (e_daughter >= thresh_KE) {
979  if ( KeepMC(trackIndex[daughter_id]) ) {
980  saved_daughters.push_back(daughter_id);
981  }
982  }
983 
984  out << fixed << setprecision(1);
985  out << "{";
986 
987  out << "\"id\":" << id << ",";
988  out << "\"text\":" << "\"" << PDGName(mc_pdg[i]) << " " << e << " MeV\",";
989  out << "\"data\":{";
990  out << "\"start\":[" << mc_startXYZT[i][0] << ", " << mc_startXYZT[i][1] << ", " << mc_startXYZT[i][2] << "],";
991  out << "\"end\":[" << mc_endXYZT[i][0] << ", " << mc_endXYZT[i][1] << ", " << mc_endXYZT[i][2] << "]";
992  out << "},";
993  out << "\"children\":[";
994  int nSavedDaughter = saved_daughters.size();
995  if (nSavedDaughter == 0) {
996  out << "],";
997  out << "\"icon\":" << "\"jstree-file\"";
998  out << "}";
999  return true;
1000  }
1001  else {
1002  for (int j=0; j<nSavedDaughter; j++) {
1003  DumpMCJSON(saved_daughters.at(j), out);
1004  if (j!=nSavedDaughter-1) {
1005  out << ",";
1006  }
1007  }
1008  out << "]";
1009  out << "}";
1010  return true;
1011  }
1012 }
float mc_startMomentum[MAX_TRACKS][4]
std::map< int, int > trackIndex
float mc_endXYZT[MAX_TRACKS][4]
TString PDGName(int pdg)
int mc_pdg[MAX_TRACKS]
bool DumpMCJSON(int id, ostream &out)
bool KeepMC(int i)
std::vector< std::vector< int > > mc_daughters
double KE(float *momentum)
float mc_startXYZT[MAX_TRACKS][4]
Float_t e
Definition: plot.C:34
void wc::CellTree::DumpMCJSON ( ostream &  out = cout)

Definition at line 1015 of file CellTree_module.cc.

References DumpMCJSON(), IsPrimary(), KeepMC(), mc_id, and mc_Ntrack.

1016 {
1017  out << "[";
1018  vector<int> primaries;
1019  for (int i=0; i<mc_Ntrack; i++) {
1020  if (IsPrimary(i)) {
1021  // int e = KE(mc_startMomentum[i])*1000;
1022  // if (e<thresh_KE) continue;
1023  if (KeepMC(i)) {
1024  primaries.push_back(i);
1025  }
1026  }
1027  }
1028  int size = primaries.size();
1029  // cout << size << endl;
1030  for (int i=0; i<size; i++) {
1031  if (DumpMCJSON(mc_id[primaries[i]], out) && i!=size-1) {
1032  out << ", ";
1033  }
1034  }
1035 
1036  out << "]";
1037 }
int mc_id[MAX_TRACKS]
bool DumpMCJSON(int id, ostream &out)
bool KeepMC(int i)
bool IsPrimary(int i)
void wc::CellTree::endJob ( )
virtual

Reimplemented from art::EDAnalyzer.

Definition at line 383 of file CellTree_module.cc.

References fEventTree, fOutFile, fSaveJSON, and system().

384 {
385  // Write fEventTree to file
386  TDirectory* tmpDir = gDirectory;
387  fOutFile->cd("/Event");
388 
389  fEventTree->Write();
390 
391  gDirectory = tmpDir;
392 
393  fOutFile->Close();
394 
395  if (fSaveJSON) {
396  system("zip -r bee_upload data");
397  gSystem->ChangeDirectory("..");
398  }
399 }
system("rm -rf microbeam.root")
EngineCreator::seed_t EngineCreator::get_seed_value ( fhicl::ParameterSet const &  pset,
char const  key[] = "seed",
seed_t const  implicit_seed = -1 
)
inherited

Definition at line 49 of file EngineCreator.cc.

References fhicl::ParameterSet::get().

Referenced by art::MixFilter< T >::initEngine_().

52 {
53  auto const& explicit_seeds = pset.get<std::vector<int>>(key, {});
54  return explicit_seeds.empty() ? implicit_seed : explicit_seeds.front();
55 }
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_.

Referenced by art::OutputModule::doWriteEvent().

62  {
64  }
detail::CachedProducts selectors_
art::Handle< art::TriggerResults > getOneTriggerResults(Event const &) const
Float_t e
Definition: plot.C:34
void wc::CellTree::initOutput ( )

Definition at line 272 of file CellTree_module.cc.

References fBeamgatetime, fCalib_channelId, fCalib_nChannel, fCalib_wf, fEvent, fEventTime, fEventTree, fMC_trackPosition, fOutFile, fOutFileName, fPEperOpDet, fRaw_channelId, fRaw_nChannel, fRaw_wf, fRun, fSaveJSON, fSIMIDE_channelIdY, fSIMIDE_numElectrons, fSIMIDE_size, fSIMIDE_tdc, fSIMIDE_trackId, fSIMIDE_x, fSIMIDE_y, fSIMIDE_z, fSubRun, fTriggerbits, fTriggernumber, fTriggertime, mc_daughters, mc_endMomentum, mc_endXYZT, mc_hitnuc, mc_hitquark, mc_id, mc_isnu, mc_mother, mc_nGeniePrimaries, mc_Ntrack, mc_nu_ccnc, mc_nu_intType, mc_nu_mode, mc_nu_mom, mc_nu_pdg, mc_nu_pos, mc_nu_Pt, mc_nu_Q2, mc_nu_target, mc_nu_Theta, mc_nu_W, mc_nu_X, mc_nu_Y, mc_pdg, mc_process, mc_startMomentum, mc_startXYZT, of_multiplicity, of_nFlash, of_peTotal, of_t, oh_bgtime, oh_channel, oh_nHits, oh_pe, oh_trigtime, and system().

Referenced by CellTree().

273 {
274  TDirectory* tmpDir = gDirectory;
275 
276  fOutFile = new TFile(fOutFileName.c_str(), "recreate");
277 
278  // 3.1: add mc_trackPosition
279  TNamed version("version", "4.0");
280  version.Write();
281 
282  // init Event TTree
283  TDirectory* subDir = fOutFile->mkdir("Event");
284  subDir->cd();
285  fEventTree = new TTree("Sim", "Event Tree from Simulation");
286  fEventTree->Branch("eventNo", &fEvent);
287  fEventTree->Branch("runNo", &fRun);
288  fEventTree->Branch("subRunNo", &fSubRun);
289  fEventTree->Branch("eventTime", &fEventTime); // timestamp
290 
291  fEventTree->Branch("triggerNo", &fTriggernumber); // timestamp
292  fEventTree->Branch("triggerTime", &fTriggertime); // timestamp
293  fEventTree->Branch("beamgateTime", &fBeamgatetime); // timestamp
294  fEventTree->Branch("triggerBits", &fTriggerbits); // timestamp
295 
296  fEventTree->Branch("raw_nChannel", &fRaw_nChannel); // number of hit channels above threshold
297  fEventTree->Branch("raw_channelId" , &fRaw_channelId); // hit channel id; size == raw_nChannel
298  fRaw_wf = new TClonesArray("TH1F");
299  fEventTree->Branch("raw_wf", &fRaw_wf, 256000, 0); // raw waveform adc of each channel
300 
301 
302  fEventTree->Branch("calib_nChannel", &fCalib_nChannel); // number of hit channels above threshold
303  fEventTree->Branch("calib_channelId" , &fCalib_channelId); // hit channel id; size == calib_Nhit
304  fCalib_wf = new TClonesArray("TH1F");
305  fEventTree->Branch("calib_wf", &fCalib_wf, 256000, 0); // calib waveform adc of each channel
306  // fCalib_wf->BypassStreamer();
307  // fEventTree->Branch("calib_wfTDC", &fCalib_wfTDC); // calib waveform tdc of each channel
308 
309  fEventTree->Branch("oh_nHits", &oh_nHits); // number of op hits
310  fEventTree->Branch("oh_channel", &oh_channel); //opchannel id; size == no ophits
311  fEventTree->Branch("oh_bgtime", &oh_bgtime); // optical pulse peak time w.r.t. start of beam gate
312  fEventTree->Branch("oh_trigtime", &oh_trigtime); // optical pulse peak time w.r.t. trigger
313  fEventTree->Branch("oh_pe", &oh_pe); // pulse PE
314 
315  fEventTree->Branch("of_nFlash", &of_nFlash);
316  fEventTree->Branch("of_t", &of_t); // time in us w.r.t. the trigger for each flash
317  fEventTree->Branch("of_peTotal", &of_peTotal); // total PE (sum of all PMTs) for each flash
318  fEventTree->Branch("of_multiplicity", &of_multiplicity); // total number of PMTs above threshold for each flash
319  fPEperOpDet = new TClonesArray("TH1F");
320  fEventTree->Branch("pe_opdet", &fPEperOpDet, 256000, 0);
321 
322  fEventTree->Branch("simide_size", &fSIMIDE_size); // size of stored sim:IDE
323  fEventTree->Branch("simide_channelIdY", &fSIMIDE_channelIdY);
324  fEventTree->Branch("simide_trackId", &fSIMIDE_trackId);
325  fEventTree->Branch("simide_tdc", &fSIMIDE_tdc);
326  fEventTree->Branch("simide_x", &fSIMIDE_x);
327  fEventTree->Branch("simide_y", &fSIMIDE_y);
328  fEventTree->Branch("simide_z", &fSIMIDE_z);
329  fEventTree->Branch("simide_numElectrons", &fSIMIDE_numElectrons);
330 
331  fEventTree->Branch("mc_Ntrack", &mc_Ntrack); // number of tracks in MC
332  fEventTree->Branch("mc_id", &mc_id, "mc_id[mc_Ntrack]/I"); // track id; size == mc_Ntrack
333  fEventTree->Branch("mc_pdg", &mc_pdg, "mc_pdg[mc_Ntrack]/I"); // track particle pdg; size == mc_Ntrack
334  fEventTree->Branch("mc_process", &mc_process, "mc_process[mc_Ntrack]/I"); // track generation process code; size == mc_Ntrack
335  fEventTree->Branch("mc_mother", &mc_mother, "mc_mother[mc_Ntrack]/I"); // mother id of this track; size == mc_Ntrack
336  fEventTree->Branch("mc_daughters", &mc_daughters); // daughters id of this track; vector
337  fEventTree->Branch("mc_startXYZT", &mc_startXYZT, "mc_startXYZT[mc_Ntrack][4]/F"); // start position of this track; size == mc_Ntrack
338  fEventTree->Branch("mc_endXYZT", &mc_endXYZT, "mc_endXYZT[mc_Ntrack][4]/F"); // start position of this track; size == mc_Ntrack
339  fEventTree->Branch("mc_startMomentum", &mc_startMomentum, "mc_startMomentum[mc_Ntrack][4]/F"); // start momentum of this track; size == mc_Ntrack
340  fEventTree->Branch("mc_endMomentum", &mc_endMomentum, "mc_endMomentum[mc_Ntrack][4]/F"); // start momentum of this track; size == mc_Ntrack
341  fMC_trackPosition = new TObjArray();
342  fMC_trackPosition->SetOwner(kTRUE);
343  fEventTree->Branch("mc_trackPosition", &fMC_trackPosition);
344 
345  fEventTree->Branch("mc_isnu", &mc_isnu);
346  fEventTree->Branch("mc_nGeniePrimaries", &mc_nGeniePrimaries);
347  fEventTree->Branch("mc_nu_pdg", &mc_nu_pdg);
348  fEventTree->Branch("mc_nu_ccnc", &mc_nu_ccnc);
349  fEventTree->Branch("mc_nu_mode", &mc_nu_mode);
350  fEventTree->Branch("mc_nu_intType", &mc_nu_intType);
351  fEventTree->Branch("mc_nu_target", &mc_nu_target);
352  fEventTree->Branch("mc_hitnuc", &mc_hitnuc);
353  fEventTree->Branch("mc_hitquark", &mc_hitquark);
354  fEventTree->Branch("mc_nu_Q2", &mc_nu_Q2);
355  fEventTree->Branch("mc_nu_W", &mc_nu_W);
356  fEventTree->Branch("mc_nu_X", &mc_nu_X);
357  fEventTree->Branch("mc_nu_Y", &mc_nu_Y);
358  fEventTree->Branch("mc_nu_Pt", &mc_nu_Pt);
359  fEventTree->Branch("mc_nu_Theta", &mc_nu_Theta);
360  fEventTree->Branch("mc_nu_pos", &mc_nu_pos, "mc_nu_pos[4]/F");
361  fEventTree->Branch("mc_nu_mom", &mc_nu_mom, "mc_nu_mom[4]/F");
362 
363  gDirectory = tmpDir;
364 
365  if (fSaveJSON) {
366  system("rm -rf bee");
367  gSystem->MakeDirectory("bee");
368  gSystem->ChangeDirectory("bee");
369  gSystem->MakeDirectory("data");
370  }
371 
372 }
float mc_startMomentum[MAX_TRACKS][4]
vector< double > oh_pe
vector< int > fSIMIDE_channelIdY
system("rm -rf microbeam.root")
vector< int > fSIMIDE_trackId
float mc_endXYZT[MAX_TRACKS][4]
int mc_id[MAX_TRACKS]
int mc_pdg[MAX_TRACKS]
vector< int > of_multiplicity
vector< float > fSIMIDE_y
std::string fOutFileName
vector< float > fSIMIDE_x
int mc_mother[MAX_TRACKS]
vector< unsigned short > fSIMIDE_tdc
float mc_endMomentum[MAX_TRACKS][4]
vector< int > oh_channel
int mc_process[MAX_TRACKS]
vector< double > oh_bgtime
vector< double > oh_trigtime
TClonesArray * fCalib_wf
TObjArray * fMC_trackPosition
std::vector< int > fRaw_channelId
vector< float > fSIMIDE_z
unsigned int fTriggerbits
std::vector< std::vector< int > > mc_daughters
TClonesArray * fRaw_wf
unsigned int fTriggernumber
std::vector< int > fCalib_channelId
float mc_nu_mom[4]
TClonesArray * fPEperOpDet
vector< float > fSIMIDE_numElectrons
float mc_startXYZT[MAX_TRACKS][4]
vector< float > of_peTotal
float mc_nu_pos[4]
vector< float > of_t
void wc::CellTree::InitProcessMap ( )

Definition at line 1113 of file CellTree_module.cc.

References DEFINE_ART_MODULE, and processMap.

Referenced by CellTree().

1114 {
1115  processMap["unknown"] = 0;
1116  processMap["primary"] = 1;
1117  processMap["compt"] = 2;
1118  processMap["phot"] = 3;
1119  processMap["annihil"] = 4;
1120  processMap["eIoni"] = 5;
1121  processMap["eBrem"] = 6;
1122  processMap["conv"] = 7;
1123  processMap["muIoni"] = 8;
1124  processMap["muMinusCaptureAtRest"] = 9;
1125  processMap["NeutronInelastic"] = 10;
1126  processMap["nCapture"] = 11;
1127  processMap["hadElastic"] = 12;
1128  processMap["Decay"] = 13;
1129  processMap["CoulombScat"] = 14;
1130  processMap["muPairProd"] = 15;
1131  processMap["muBrems"] = 16;
1132  processMap["muPairProd"] = 17;
1133  processMap["PhotonInelastic"] = 18;
1134  processMap["hIoni"] = 19;
1135  processMap["ProtonInelastic"] = 20;
1136  processMap["PionPlusInelastic"] = 21;
1137  processMap["CHIPSNuclearCaptureAtRest"] = 22;
1138  processMap["PionMinusInelastic"] = 23;
1139 }
std::map< std::string, int > processMap
bool wc::CellTree::IsPrimary ( int  i)
inline

Definition at line 105 of file CellTree_module.cc.

Referenced by DumpMCJSON(), and processMCTracks().

105 { return mc_mother[i] == 0 ; }
int mc_mother[MAX_TRACKS]
double wc::CellTree::KE ( float *  momentum)

Definition at line 1040 of file CellTree_module.cc.

Referenced by DumpMCJSON(), and KeepMC().

1041 {
1042  TLorentzVector particle(momentum);
1043  return particle.E()-particle.M();
1044 }
bool wc::CellTree::KeepMC ( int  i)

Definition at line 1047 of file CellTree_module.cc.

References e, KE(), mc_pdg, and mc_startMomentum.

Referenced by DumpMCJSON().

1048 {
1049  double e = KE(mc_startMomentum[i])*1000;
1050  double thresh_KE_em = 5.; // MeV
1051  double thresh_KE_np = 10; // MeV
1052  if (mc_pdg[i]==22 || mc_pdg[i]==11 || mc_pdg[i]==-11) {
1053  if (e>=thresh_KE_em) return true;
1054  else return false;
1055  }
1056  else if (mc_pdg[i]==2112 || mc_pdg[i]==2212 || mc_pdg[i]>1e9) {
1057  if (e>=thresh_KE_np) return true;
1058  else return false;
1059  }
1060  return true;
1061 }
float mc_startMomentum[MAX_TRACKS][4]
int mc_pdg[MAX_TRACKS]
double KE(float *momentum)
Float_t e
Definition: plot.C:34
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 190 of file Consumer.h.

References art::InputTag::instance(), art::InputTag::label(), and art::InputTag::process().

191 {
192  if (!moduleContext_)
193  return ProductToken<T>::invalid();
194 
195  consumables_[BT].emplace_back(ConsumableType::Product,
196  TypeID{typeid(T)},
197  it.label(),
198  it.instance(),
199  it.process());
200  return ProductToken<T>{it};
201 }
static ProductToken< T > invalid()
Definition: ProductToken.h:47
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
template<typename T , art::BranchType BT>
void art::Consumer::mayConsumeMany ( )
inherited

Definition at line 205 of file Consumer.h.

206 {
207  if (!moduleContext_)
208  return;
209 
210  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
211 }
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
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 215 of file Consumer.h.

References art::InputTag::instance(), art::InputTag::label(), and art::InputTag::process().

216 {
217  if (!moduleContext_)
218  return ViewToken<T>::invalid();
219 
220  consumables_[BT].emplace_back(ConsumableType::ViewElement,
221  TypeID{typeid(T)},
222  it.label(),
223  it.instance(),
224  it.process());
225  return ViewToken<T>{it};
226 }
static ViewToken< Element > invalid()
Definition: ProductToken.h:75
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
bool art::EventObserverBase::modifiesEvent ( ) const
inlineinherited

Definition at line 25 of file EventObserverBase.h.

26  {
27  return false;
28  }
TString wc::CellTree::PDGName ( int  pdg)

Definition at line 1064 of file CellTree_module.cc.

References dbPDG, and z.

Referenced by DumpMCJSON().

1065 {
1066  TParticlePDG *p = dbPDG->GetParticle(pdg);
1067  if (p == 0) {
1068  if (pdg>1e9) {
1069  int z = (pdg - 1e9) / 10000;
1070  int a = (pdg - 1e9 - z*1e4) / 10;
1071  TString name;
1072  if (z == 18) name = "Ar";
1073 
1074  else if (z == 17) name = "Cl";
1075  else if (z == 19) name = "Ca";
1076  else if (z == 16) name = "S";
1077  else if (z == 15) name = "P";
1078  else if (z == 14) name = "Si";
1079  else if (z == 1) name = "H";
1080  else if (z == 2) name = "He";
1081 
1082  else return Form("%i", pdg);
1083  return Form("%s-%i", name.Data(), a);
1084  }
1085  return Form("%i", pdg);
1086  }
1087  else {
1088  return p->GetName();
1089  }
1090 }
Double_t z
Definition: plot.C:279
TDatabasePDG * dbPDG
void art::Consumer::prepareForJob ( fhicl::ParameterSet const &  pset)
protectedinherited

Definition at line 89 of file Consumer.cc.

References fhicl::ParameterSet::get_if_present().

Referenced by art::EDProducer::doBeginJob(), art::EDFilter::doBeginJob(), and art::EDAnalyzer::doBeginJob().

90 {
91  if (!moduleContext_)
92  return;
93 
94  pset.get_if_present("errorOnMissingConsumes", requireConsumes_);
95  for (auto& consumablesPerBranch : consumables_) {
96  cet::sort_all(consumablesPerBranch);
97  }
98 }
bool requireConsumes_
Definition: Consumer.h:137
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
void wc::CellTree::print_vector ( ostream &  out,
vector< double > &  v,
TString  desc,
bool  end = false 
)

Definition at line 874 of file CellTree_module.cc.

Referenced by processSpacePoint().

875 {
876  int N = v.size();
877 
878  out << '"' << desc << '"' << ":[";
879  for (int i=0; i<N; i++) {
880  out << v[i];
881  if (i!=N-1) {
882  out << ",";
883  }
884  }
885  out << "]";
886  if (!end) out << ",";
887  out << endl;
888 }
std::vector< evd::details::RawDigitInfo_t >::const_iterator end(RawDigitCacheDataClass const &cache)
void wc::CellTree::printEvent ( )

Definition at line 1093 of file CellTree_module.cc.

References fEvent, fRun, fSubRun, mc_daughters, mc_endMomentum, mc_endXYZT, mc_id, mc_mother, mc_Ntrack, mc_pdg, mc_startMomentum, and mc_startXYZT.

1094 {
1095  cout << " Run/SubRun/Event: " << fRun << "/" << fSubRun << "/" << fEvent << endl;
1096  cout << " Ntracks:" << mc_Ntrack << endl;
1097 
1098  for (int i=0; i<mc_Ntrack; i++) {
1099  cout << "\n id: " << mc_id[i];
1100  cout << "\n pdg: " << mc_pdg[i];
1101  cout << "\n mother: " << mc_mother[i];
1102  cout << "\n Ndaughters: " << mc_daughters.at(i).size();
1103  cout << "\n start XYZT: (" << mc_startXYZT[i][0] << ", " << mc_startXYZT[i][1] << ", " << mc_startXYZT[i][2] << ", " << mc_startXYZT[i][3] << ")";
1104  cout << "\n end XYZT: (" << mc_endXYZT[i][0] << ", " << mc_endXYZT[i][1] << ", " << mc_endXYZT[i][2] << ", " << mc_endXYZT[i][3] << ")";
1105  cout << "\n start momentum: (" << mc_startMomentum[i][0] << ", " << mc_startMomentum[i][1] << ", " << mc_startMomentum[i][2] << ", " << mc_startMomentum[i][3] << ")";
1106  cout << "\n end momentum: (" << mc_endMomentum[i][0] << ", " << mc_endMomentum[i][1] << ", " << mc_endMomentum[i][2] << ", " << mc_endMomentum[i][3] << ")";
1107 
1108  cout << endl;
1109  }
1110 }
float mc_startMomentum[MAX_TRACKS][4]
float mc_endXYZT[MAX_TRACKS][4]
int mc_id[MAX_TRACKS]
int mc_pdg[MAX_TRACKS]
int mc_mother[MAX_TRACKS]
float mc_endMomentum[MAX_TRACKS][4]
std::vector< std::vector< int > > mc_daughters
float mc_startXYZT[MAX_TRACKS][4]
void wc::CellTree::processCalib ( const art::Event evt)

Definition at line 559 of file CellTree_module.cc.

References fCalib_channelId, fCalib_nChannel, fCalibLabel, art::fill_ptr_vector(), art::DataViewImpl::getByLabel(), and nRawSamples.

Referenced by analyze().

560 {
561 
563  if (! event.getByLabel(fCalibLabel, wires_handle)) {
564  cout << "WARNING: no label " << fCalibLabel << endl;
565  return;
566  }
567  std::vector< art::Ptr<recob::Wire> > wires;
568  art::fill_ptr_vector(wires, wires_handle);
569 
570  // wires size should == Nchannels == 1992; (no hit channel has a flat 0-waveform)
571  // cout << "\n wires size: " << wires.size() << endl;
572  fCalib_nChannel = wires.size();
573 
574  int i=0;
575  for (auto const& wire: wires) {
576  std::vector<float> calibwf = wire->Signal();
577  int chanId = wire->Channel();
578  fCalib_channelId.push_back(chanId);
579  TH1F *h = new((*fCalib_wf)[i]) TH1F("", "", nRawSamples, 0, nRawSamples);
580  for (int j=1; j<=nRawSamples; j++) {
581  h->SetBinContent(j, calibwf[j]);
582  }
583  // fCalib_wf.push_back(calibwf);
584  // cout << chanId << ", " << nSamples << endl;
585  i++;
586  }
587 
588 }
std::vector< int > fCalib_channelId
std::string fCalibLabel
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
Definition: Ptr.h:464
Event finding and building.
void wc::CellTree::processMC ( const art::Event evt)

Definition at line 681 of file CellTree_module.cc.

References simb::MCNeutrino::CCNC(), art::fill_ptr_vector(), fMC_trackPosition, fSaveMCTrackPoints, art::DataViewImpl::getByLabel(), simb::MCTruth::GetNeutrino(), simb::MCNeutrino::HitNuc(), simb::MCNeutrino::HitQuark(), simb::MCNeutrino::InteractionType(), MAX_TRACKS, mc_daughters, mc_endMomentum, mc_endXYZT, mc_hitnuc, mc_hitquark, mc_id, mc_isnu, mc_mother, mc_nGeniePrimaries, mc_Ntrack, mc_nu_ccnc, mc_nu_intType, mc_nu_mode, mc_nu_mom, mc_nu_pdg, mc_nu_pos, mc_nu_Pt, mc_nu_Q2, mc_nu_target, mc_nu_Theta, mc_nu_W, mc_nu_X, mc_nu_Y, mc_pdg, mc_process, mc_startMomentum, mc_startXYZT, mcOption, simb::MCNeutrino::Mode(), simb::MCParticle::Momentum(), simb::MCTruth::NeutrinoSet(), simb::MCTruth::NParticles(), simb::MCNeutrino::Nu(), simb::MCTruth::Origin(), simb::MCParticle::PdgCode(), simb::MCParticle::Position(), processMap, simb::MCNeutrino::Pt(), simb::MCNeutrino::QSqr(), savedMCTrackIdMap, simb::MCNeutrino::Target(), simb::MCNeutrino::Theta(), simb::MCNeutrino::W(), simb::MCNeutrino::X(), and simb::MCNeutrino::Y().

Referenced by analyze().

682 {
684  if (! event.getByLabel("largeant", particleHandle)) return;
685  std::vector< art::Ptr<simb::MCParticle> > particles;
686  art::fill_ptr_vector(particles, particleHandle);
687 
689  event.getByLabel("largeant", simChannelHandle);
690 
691  // art::ServiceHandle<cheat::BackTracker> bt;
692  art::FindOneP<simb::MCTruth> fo(particleHandle, event, "largeant");
693 
694  int i=0; // track index in saved MCParticles;
695  int i_all=0; // track index in all MCParticles;
696  for (auto const& particle: particles ) {
697  art::Ptr<simb::MCTruth> mctruth = fo.at(i_all);
698  i_all++;
699 
700  if (mcOption == "nuOnly") {
701  if ( !(mctruth->Origin() == 1 && particle->Mother() == 0) ) {
702  continue;
703  }
704  }
705 
706  // if (mctruth->Origin() == 1 || mc_mother[i] == 0) {
707  // cout << "process: " << particle->Process()
708  // << ", id: " << mc_id[i]
709  // << ", pdg: " << mc_pdg[i]
710  // << ", mother: " << mc_mother[i]
711  // << ", nDaughter: " << (particle->NumberDaughters())
712  // << ", truth: " << mctruth->Origin()
713  // << endl;
714  // }
715  // const art::Ptr<simb::MCTruth> mctruth = bt_serv->TrackIDToMCTruth(mc_id[i]);
716 
717  mc_process[i] = processMap[particle->Process()];
718  if (mc_process[i] == 0) cout << "unknown process: " << particle->Process() << endl;
719  mc_id[i] = particle->TrackId();
720  mc_pdg[i] = particle->PdgCode();
721  mc_mother[i] = particle->Mother();
722  savedMCTrackIdMap[mc_id[i]] = mc_pdg[i];
723 
724  int Ndaughters = particle->NumberDaughters();
725  vector<int> daughters;
726  for (int i=0; i<Ndaughters; i++) {
727  daughters.push_back(particle->Daughter(i));
728  }
729  mc_daughters.push_back(daughters);
730  size_t numberTrajectoryPoints = particle->NumberTrajectoryPoints();
731  int last = numberTrajectoryPoints - 1;
732  const TLorentzVector& positionStart = particle->Position(0);
733  const TLorentzVector& positionEnd = particle->Position(last);
734  const TLorentzVector& momentumStart = particle->Momentum(0);
735  const TLorentzVector& momentumEnd = particle->Momentum(last);
736  positionStart.GetXYZT(mc_startXYZT[i]);
737  positionEnd.GetXYZT(mc_endXYZT[i]);
738  momentumStart.GetXYZT(mc_startMomentum[i]);
739  momentumEnd.GetXYZT(mc_endMomentum[i]);
740 
741  if (fSaveMCTrackPoints) {
742  TClonesArray *Lposition = new TClonesArray("TLorentzVector", numberTrajectoryPoints);
743  // Read the position and momentum along this particle track
744  for(unsigned int j=0; j<numberTrajectoryPoints; j++) {
745  new ((*Lposition)[j]) TLorentzVector(particle->Position(j));
746  }
747  fMC_trackPosition->Add(Lposition);
748  }
749 
750  i++;
751  if (i==MAX_TRACKS) {
752  cout << "WARNING:: # tracks exceeded MAX_TRACKS " << MAX_TRACKS << endl;
753  break;
754  }
755  } // particle loop done
756  mc_Ntrack = i;
757  // cout << "MC_Ntracks:" << mc_Ntrack << endl;
758 
759  // Generator Info
760  art::Handle< std::vector<simb::MCTruth> > mctruthListHandle;
761  event.getByLabel("generator",mctruthListHandle);
762  std::vector<art::Ptr<simb::MCTruth> > mclist;
763  art::fill_ptr_vector(mclist, mctruthListHandle);
764  art::Ptr<simb::MCTruth> mctruth;
765 
766  if (mclist.size()>0) {
767  mctruth = mclist.at(0);
768  if (mctruth->NeutrinoSet()) {
769  simb::MCNeutrino nu = mctruth->GetNeutrino();
770  mc_isnu = 1;
771  mc_nGeniePrimaries = mctruth->NParticles();
772  mc_nu_pdg = nu.Nu().PdgCode();
773  mc_nu_ccnc = nu.CCNC();
774  mc_nu_mode = nu.Mode();
776  mc_nu_target = nu.Target();
777  mc_hitnuc = nu.HitNuc();
778  mc_hitquark = nu.HitQuark();
779  mc_nu_Q2 = nu.QSqr();
780  mc_nu_W = nu.W();
781  mc_nu_X = nu.X();
782  mc_nu_Y = nu.Y();
783  mc_nu_Pt = nu.Pt();
784  mc_nu_Theta = nu.Theta();
785 
786  const TLorentzVector& position = nu.Nu().Position(0);
787  const TLorentzVector& momentum = nu.Nu().Momentum(0);
788  position.GetXYZT(mc_nu_pos);
789  momentum.GetXYZT(mc_nu_mom);
790  // cout << "nu: " << mc_nu_pdg << ", nPrim: " << mc_nGeniePrimaries
791  // << ", ccnc: " << mc_nu_ccnc << endl;
792  // for (int i=0; i<mc_nGeniePrimaries; i++) {
793  // simb::MCParticle particle = mctruth->GetParticle(i);
794  // cout << "id: " << particle.TrackId()
795  // << ", pdg: " << particle.PdgCode()
796  // << endl;
797  // }
798  }
799  }
800 
801 }
float mc_startMomentum[MAX_TRACKS][4]
const TLorentzVector & Position(const int i=0) const
Definition: MCParticle.h:223
int PdgCode() const
Definition: MCParticle.h:216
int CCNC() const
Definition: MCNeutrino.h:152
double QSqr() const
Definition: MCNeutrino.h:161
double Theta() const
angle between incoming and outgoing leptons, in radians
Definition: MCNeutrino.cxx:63
const simb::MCNeutrino & GetNeutrino() const
Definition: MCTruth.h:74
int HitQuark() const
Definition: MCNeutrino.h:157
float mc_endXYZT[MAX_TRACKS][4]
int mc_id[MAX_TRACKS]
const simb::MCParticle & Nu() const
Definition: MCNeutrino.h:150
simb::Origin_t Origin() const
Definition: MCTruth.h:71
double Pt() const
transverse momentum of interaction, in GeV/c
Definition: MCNeutrino.cxx:74
int HitNuc() const
Definition: MCNeutrino.h:156
int mc_pdg[MAX_TRACKS]
int NParticles() const
Definition: MCTruth.h:72
int mc_mother[MAX_TRACKS]
std::map< int, int > savedMCTrackIdMap
float mc_endMomentum[MAX_TRACKS][4]
int InteractionType() const
Definition: MCNeutrino.h:154
int mc_process[MAX_TRACKS]
double W() const
Definition: MCNeutrino.h:158
double Y() const
Definition: MCNeutrino.h:160
TObjArray * fMC_trackPosition
double X() const
Definition: MCNeutrino.h:159
#define MAX_TRACKS
std::vector< std::vector< int > > mc_daughters
std::string mcOption
int Target() const
Definition: MCNeutrino.h:155
float mc_nu_mom[4]
const TLorentzVector & Momentum(const int i=0) const
Definition: MCParticle.h:224
std::map< std::string, int > processMap
float mc_startXYZT[MAX_TRACKS][4]
bool NeutrinoSet() const
Definition: MCTruth.h:75
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
Definition: Ptr.h:464
Event generator information.
Definition: MCNeutrino.h:18
int Mode() const
Definition: MCNeutrino.h:153
float mc_nu_pos[4]
Event finding and building.
void wc::CellTree::processMCTracks ( )

Definition at line 891 of file CellTree_module.cc.

References IsPrimary(), mc_daughters, mc_id, mc_mother, mc_Ntrack, trackChildren, trackIndex, trackParents, and trackSiblings.

Referenced by analyze().

892 {
893  // map track id to track index in the array
894  for (int i=0; i<mc_Ntrack; i++) {
895  trackIndex[mc_id[i]] = i;
896  }
897 
898  // in trackParents, trackChildren, trackSiblings vectors, store track index (not track id)
899  for (int i=0; i<mc_Ntrack; i++) {
900  // currently, parent size == 1;
901  // for primary particle, parent id = 0;
902  vector<int> parents;
903  if ( !IsPrimary(i) ) {
904  parents.push_back(trackIndex[mc_mother[i]]);
905  }
906  trackParents.push_back(parents); // primary track will have 0 parents
907 
908  vector<int> children;
909  int nChildren = mc_daughters.at(i).size();
910  for (int j=0; j<nChildren; j++) {
911  children.push_back(trackIndex[mc_daughters.at(i).at(j)]);
912  }
913  trackChildren.push_back(children);
914 
915  }
916 
917  // siblings
918  for (int i=0; i<mc_Ntrack; i++) {
919  vector<int> siblings;
920  if ( IsPrimary(i) ) {
921  for (int j=0; j<mc_Ntrack; j++) {
922  if( IsPrimary(j) ) {
923  siblings.push_back(j);
924  }
925  }
926  }
927  else {
928  // siblings are simply children of the mother
929  int mother = trackIndex[mc_mother[i]];
930  int nSiblings = trackChildren.at(mother).size();
931  for (int j=0; j<nSiblings; j++) {
932  siblings.push_back(trackChildren.at(mother).at(j));
933  }
934  }
935  trackSiblings.push_back(siblings);
936  }
937 
938 }
std::vector< std::vector< int > > trackChildren
std::map< int, int > trackIndex
int mc_id[MAX_TRACKS]
std::vector< std::vector< int > > trackSiblings
int mc_mother[MAX_TRACKS]
std::vector< std::vector< int > > mc_daughters
bool IsPrimary(int i)
std::vector< std::vector< int > > trackParents
std::string const& art::EventObserverBase::processName ( ) const
inlineinherited
void wc::CellTree::processOpFlash ( const art::Event evt)

Definition at line 612 of file CellTree_module.cc.

References fGeometry, art::fill_ptr_vector(), fOpFlashLabel, art::DataViewImpl::getByLabel(), geo::GeometryCore::NOpDets(), of_multiplicity, of_nFlash, of_peTotal, of_t, and opMultPEThresh.

Referenced by analyze().

613  {
615  if(! event.getByLabel(fOpFlashLabel, flash_handle)){
616  cout << "WARNING: no label " << fOpFlashLabel << endl;
617  return;
618  }
619  std::vector<art::Ptr<recob::OpFlash> > flashes;
620  art::fill_ptr_vector(flashes, flash_handle);
621  of_nFlash = (int)flashes.size();
622 
623  int a=0;
624  int nOpDet = fGeometry->NOpDets();
625 
626  for(auto const& flash: flashes){
627  of_t.push_back(flash->Time());
628  of_peTotal.push_back(flash->TotalPE());
629  TH1F *h = new ((*fPEperOpDet)[a]) TH1F("","",nOpDet,0,nOpDet);
630 
631  int mult = 0;
632  for(int i=0; i<nOpDet; ++i){
633  if(flash->PE(i) >= opMultPEThresh){
634  mult++;
635  }
636  h->SetBinContent(i, flash->PE(i));
637  }
638  of_multiplicity.push_back(mult);
639  a++;
640  }
641  }
vector< int > of_multiplicity
std::string fOpFlashLabel
unsigned int NOpDets() const
Number of OpDets in the whole detector.
art::ServiceHandle< geo::Geometry > fGeometry
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
Definition: Ptr.h:464
vector< float > of_peTotal
Event finding and building.
vector< float > of_t
void wc::CellTree::processOpHit ( const art::Event evt)

Definition at line 591 of file CellTree_module.cc.

References art::fill_ptr_vector(), fOpHitLabel, art::DataViewImpl::getByLabel(), oh_bgtime, oh_channel, oh_nHits, oh_pe, and oh_trigtime.

Referenced by analyze().

592 {
594  if(! event.getByLabel(fOpHitLabel, ophit_handle)){
595  cout << "WARNING: no label " << fOpHitLabel << endl;
596  return;
597  }
598  std::vector<art::Ptr<recob::OpHit> > ophits;
599  art::fill_ptr_vector(ophits, ophit_handle);
600  oh_nHits = (int)ophits.size();
601 
602  for(auto const& oh : ophits){
603  oh_channel.push_back(oh->OpChannel());
604  oh_bgtime.push_back(oh->PeakTime());
605  oh_trigtime.push_back(oh->PeakTimeAbs());
606  oh_pe.push_back(oh->PE());
607  }
608 
609 }
vector< double > oh_pe
vector< int > oh_channel
std::string fOpHitLabel
vector< double > oh_bgtime
vector< double > oh_trigtime
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
Definition: Ptr.h:464
Event finding and building.
void wc::CellTree::processRaw ( const art::Event evt)

Definition at line 525 of file CellTree_module.cc.

References art::fill_ptr_vector(), fRaw_channelId, fRaw_nChannel, fRawDigitLabel, art::DataViewImpl::getByLabel(), nRawSamples, and raw::Uncompress().

Referenced by analyze().

526 {
528  if (! event.getByLabel(fRawDigitLabel, rawdigit)) {
529  cout << "WARNING: no label " << fRawDigitLabel << endl;
530  return;
531  }
532  std::vector< art::Ptr<raw::RawDigit> > wires;
533  art::fill_ptr_vector(wires, rawdigit);
534 
535  fRaw_nChannel = wires.size();
536 
537  int i=0;
538  for (auto const& wire: wires) {
539  int chanId = wire->Channel();
540  fRaw_channelId.push_back(chanId);
541 
542  int nSamples = wire->Samples();
543  std::vector<short> uncompressed(nSamples);
544  raw::Uncompress(wire->ADCs(), uncompressed, wire->Compression());
545 
546  TH1F *h = new((*fRaw_wf)[i]) TH1F("", "", nRawSamples, 0, nRawSamples);
547  for (int j=1; j<=nSamples; j++) {
548  h->SetBinContent(j, uncompressed[j-1]);
549  }
550  i++;
551  if (i==1) {
552  cout << nSamples << " samples expanding to " << nRawSamples << endl;
553  }
554  }
555 
556 }
std::string fRawDigitLabel
std::vector< int > fRaw_channelId
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
Definition: Ptr.h:464
void Uncompress(const std::vector< short > &adc, std::vector< short > &uncompressed, raw::Compress_t compress)
Uncompresses a raw data buffer.
Definition: raw.cxx:756
Event finding and building.
void wc::CellTree::processSimChannel ( const art::Event evt)

Definition at line 644 of file CellTree_module.cc.

References fSIMIDE_channelIdY, fSIMIDE_numElectrons, fSIMIDE_size, fSIMIDE_tdc, fSIMIDE_trackId, fSIMIDE_x, fSIMIDE_y, and fSIMIDE_z.

Referenced by analyze().

645 {
647  event.getByLabel("largeant", simChannelHandle);
648  // cout << "total simChannel: " << (*simChannelHandle).size() << endl;
649  fSIMIDE_size = 0;
650  for ( auto const& channel : (*simChannelHandle) ) {
651  auto channelNumber = channel.Channel();
652  // cout << channelNumber << endl;
653  // if (! (fGeometry->SignalType( channelNumber ) == geo::kCollection) ) {
654  // continue;
655  // }
656  auto const& timeSlices = channel.TDCIDEMap();
657  for ( auto const& timeSlice : timeSlices ) {
658  auto const& energyDeposits = timeSlice.second;
659  for ( auto const& energyDeposit : energyDeposits ) {
660  fSIMIDE_size++;
661  fSIMIDE_channelIdY.push_back(channelNumber);
662  fSIMIDE_tdc.push_back(timeSlice.first);
663  fSIMIDE_trackId.push_back(energyDeposit.trackID);
664  fSIMIDE_x.push_back(energyDeposit.x);
665  fSIMIDE_y.push_back(energyDeposit.y);
666  fSIMIDE_z.push_back(energyDeposit.z);
667  fSIMIDE_numElectrons.push_back(energyDeposit.numElectrons);
668  // cout << channelNumber << ": " << energyDeposit.trackID << ": " << timeSlice.first << ": "
669  // << energyDeposit.x << ", " << energyDeposit.y << ", " << energyDeposit.z << ", "
670  // << energyDeposit.numElectrons << endl;
671  }
672  }
673 
674  }
675  cout << "total IDEs: " << fSIMIDE_size << endl;
676 
677 
678 }
vector< int > fSIMIDE_channelIdY
vector< int > fSIMIDE_trackId
vector< float > fSIMIDE_y
vector< float > fSIMIDE_x
vector< unsigned short > fSIMIDE_tdc
vector< float > fSIMIDE_z
vector< float > fSIMIDE_numElectrons
void wc::CellTree::processSpacePoint ( const art::Event event,
TString  option,
ostream &  out = cout 
)

Definition at line 805 of file CellTree_module.cc.

References geo::GeometryCore::DetectorName(), fEvent, fGeometry, art::fill_ptr_vector(), fRun, fSubRun, print_vector(), x, y, and z.

Referenced by analyze().

806 {
807 
810  bool sp_exists = event.getByLabel(option.Data(), sp_handle);
811  bool pc_exists = event.getByLabel(option.Data(), pc_handle);
812  if (! sp_exists) {
813  cout << "WARNING: no label " << option << endl;
814  return;
815  }
816  std::vector< art::Ptr<recob::SpacePoint> > sps;
817  std::vector< art::Ptr<recob::PointCharge> > pcs;
818  art::fill_ptr_vector(sps, sp_handle);
819  if (pc_exists) {
820  art::fill_ptr_vector(pcs, pc_handle);
821  if (sps.size() != pcs.size()) {
822  cout << "WARNING: SpacePoint and PointCharge length mismatch" << endl;
823  return;
824  }
825  }
826  double x=0, y=0, z=0, q=0, nq=1;
827  vector<double> vx, vy, vz, vq, vnq;
828 
829  for (uint i=0; i < sps.size(); i++ ) {
830  // cout << sp->XYZ()[0] << ", " << sp->XYZ()[1] << ", " << sp->XYZ()[2] << endl;
831  x = sps[i]->XYZ()[0];
832  y = sps[i]->XYZ()[1];
833  z = sps[i]->XYZ()[2];
834  if (pc_exists && pcs[i]->hasCharge()) {
835  q = pcs[i]->charge();
836  } else {
837  q = 0;
838  }
839  vx.push_back(x);
840  vy.push_back(y);
841  vz.push_back(z);
842  vq.push_back(q);
843  vnq.push_back(nq);
844  }
845 
846  out << fixed << setprecision(1);
847  out << "{" << endl;
848 
849  out << '"' << "runNo" << '"' << ":" << '"' << fRun << '"' << "," << endl;
850  out << '"' << "subRunNo" << '"' << ":" << '"' << fSubRun << '"' << "," << endl;
851  out << '"' << "eventNo" << '"' << ":" << '"' << fEvent << '"' << "," << endl;
852 
853  TString geomName(fGeometry->DetectorName().c_str());
854  if (geomName.Contains("35t")) { geomName = "dune35t"; }
855  else if (geomName.Contains("protodune")) { geomName = "protodune"; }
856  else if (geomName.Contains("workspace")) { geomName = "dune10kt_workspace"; }
857  else { geomName = "uboone"; } // use uboone as default
858  out << '"' << "geom" << '"' << ":" << '"' << geomName << '"' << "," << endl;
859 
860 
861  print_vector(out, vx, "x");
862  print_vector(out, vy, "y");
863  print_vector(out, vz, "z");
864 
865  out << fixed << setprecision(0);
866  print_vector(out, vq, "q");
867  print_vector(out, vnq, "nq");
868 
869  out << '"' << "type" << '"' << ":" << '"' << option << '"' << endl;
870  out << "}" << endl;
871 }
Float_t x
Definition: compare.C:6
Float_t y
Definition: compare.C:6
Double_t z
Definition: plot.C:279
void print_vector(ostream &out, vector< double > &v, TString desc, bool end=false)
std::string DetectorName() const
Returns a string with the name of the detector, as configured.
art::ServiceHandle< geo::Geometry > fGeometry
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
Definition: Ptr.h:464
void wc::CellTree::processTrigger ( const art::Event evt)

Definition at line 941 of file CellTree_module.cc.

References fBeamgatetime, art::fill_ptr_vector(), fTriggerbits, fTriggerLabel, fTriggernumber, fTriggertime, and art::DataViewImpl::getByLabel().

Referenced by analyze().

942 {
943  art::Handle< std::vector<raw::Trigger>> triggerListHandle;
944  std::vector<art::Ptr<raw::Trigger>> triggerlist;
945  if (event.getByLabel(fTriggerLabel, triggerListHandle)) {
946  art::fill_ptr_vector(triggerlist, triggerListHandle);
947  }
948  else {
949  cout << "WARNING: no label " << fTriggerLabel << endl;
950  }
951  if (triggerlist.size()){
952  fTriggernumber = triggerlist[0]->TriggerNumber();
953  fTriggertime = triggerlist[0]->TriggerTime();
954  fBeamgatetime = triggerlist[0]->BeamGateTime();
955  fTriggerbits = triggerlist[0]->TriggerBits();
956  }
957  else {
958  fTriggernumber = 0;
959  fTriggertime = 0;
960  fBeamgatetime = 0;
961  fTriggerbits = 0;
962  }
963 }
unsigned int fTriggerbits
unsigned int fTriggernumber
std::string fTriggerLabel
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
Definition: Ptr.h:464
Event finding and building.
void wc::CellTree::reconfigure ( fhicl::ParameterSet const &  pset)

Definition at line 249 of file CellTree_module.cc.

References fCalibLabel, fOpFlashLabel, fOpHitLabel, fOutFileName, fRawDigitLabel, fSaveCalib, fSaveJSON, fSaveMC, fSaveMCTrackPoints, fSaveOpFlash, fSaveOpHit, fSaveRaw, fSaveSimChannel, fSaveTrigger, fSpacePointLabels, fTriggerLabel, fhicl::ParameterSet::get(), mcOption, nRawSamples, and opMultPEThresh.

Referenced by CellTree().

249  {
250  fRawDigitLabel = p.get<std::string>("RawDigitLabel");
251  fCalibLabel = p.get<std::string>("CalibLabel");
252  fOpHitLabel = p.get<std::string>("OpHitLabel");
253  fOpFlashLabel = p.get<std::string>("OpFlashLabel");
254  fTriggerLabel = p.get<std::string>("TriggerLabel");
255  fSpacePointLabels= p.get<std::vector<std::string> >("SpacePointLabels");
256  fOutFileName = p.get<std::string>("outFile");
257  mcOption = p.get<std::string>("mcOption");
258  fSaveMCTrackPoints = p.get<bool>("saveMCTrackPoints");
259  fSaveRaw = p.get<bool>("saveRaw");
260  fSaveCalib = p.get<bool>("saveCalib");
261  fSaveOpHit = p.get<bool>("saveOpHit");
262  fSaveOpFlash = p.get<bool>("saveOpFlash");
263  fSaveMC = p.get<bool>("saveMC");
264  fSaveSimChannel = p.get<bool>("saveSimChannel");
265  fSaveTrigger = p.get<bool>("saveTrigger");
266  fSaveJSON = p.get<bool>("saveJSON");
267  opMultPEThresh = p.get<float>("opMultPEThresh");
268  nRawSamples = p.get<int>("nRawSamples");
269 }
std::string fOutFileName
std::string fRawDigitLabel
std::string fOpHitLabel
std::string fOpFlashLabel
std::string mcOption
std::string fCalibLabel
std::vector< std::string > fSpacePointLabels
std::string fTriggerLabel
void art::EventObserverBase::registerProducts ( MasterProductRegistry ,
ProductDescriptions ,
ModuleDescription const &   
)
inlineinherited

Definition at line 33 of file EventObserverBase.h.

36  {}
void wc::CellTree::reset ( void  )

Definition at line 454 of file CellTree_module.cc.

References fCalib_channelId, fCalib_wf, fMC_trackPosition, fPEperOpDet, fRaw_channelId, fRaw_wf, fSIMIDE_channelIdY, fSIMIDE_numElectrons, fSIMIDE_tdc, fSIMIDE_trackId, fSIMIDE_x, fSIMIDE_y, fSIMIDE_z, MAX_TRACKS, mc_daughters, mc_endMomentum, mc_endXYZT, mc_hitnuc, mc_hitquark, mc_id, mc_isnu, mc_mother, mc_nGeniePrimaries, mc_Ntrack, mc_nu_ccnc, mc_nu_intType, mc_nu_mode, mc_nu_mom, mc_nu_pdg, mc_nu_pos, mc_nu_Pt, mc_nu_Q2, mc_nu_target, mc_nu_Theta, mc_nu_W, mc_nu_X, mc_nu_Y, mc_pdg, mc_startMomentum, mc_startXYZT, of_multiplicity, of_peTotal, of_t, oh_bgtime, oh_channel, oh_pe, oh_trigtime, savedMCTrackIdMap, trackChildren, trackIndex, trackParents, and trackSiblings.

Referenced by analyze().

455 {
456 
457  fRaw_channelId.clear();
458  // fRaw_wf->Clear();
459  fRaw_wf->Delete();
460 
461  fCalib_channelId.clear();
462  fCalib_wf->Clear();
463 
464  oh_channel.clear();
465  oh_bgtime.clear();
466  oh_trigtime.clear();
467  oh_pe.clear();
468 
469  of_t.clear();
470  of_peTotal.clear();
471  of_multiplicity.clear();
472  fPEperOpDet->Delete();
473 
474  fSIMIDE_channelIdY.clear();
475  fSIMIDE_trackId.clear();
476  fSIMIDE_tdc.clear();
477  fSIMIDE_x.clear();
478  fSIMIDE_y.clear();
479  fSIMIDE_z.clear();
480  fSIMIDE_numElectrons.clear();
481 
482  mc_Ntrack = 0;
483  for (int i=0; i<MAX_TRACKS; i++) {
484  mc_id[i] = 0;
485  mc_pdg[i] = 0;
486  mc_mother[i] = 0;
487  for (int j=0; j<4; j++) {
488  mc_startXYZT[i][j] = 0;
489  mc_endXYZT[i][j] = 0;
490  mc_startMomentum[i][j] = 0;
491  mc_endMomentum[i][j] = 0;
492  }
493  }
494  mc_daughters.clear();
495  savedMCTrackIdMap.clear();
496  fMC_trackPosition->Clear();
497 
498  mc_isnu = 0;
499  mc_nGeniePrimaries = -1;
500  mc_nu_pdg = -1;
501  mc_nu_ccnc = -1;
502  mc_nu_mode = -1;
503  mc_nu_intType = -1;
504  mc_nu_target = -1;
505  mc_hitnuc = -1;
506  mc_hitquark = -1;
507  mc_nu_Q2 = -1;
508  mc_nu_W = -1;
509  mc_nu_X = -1;
510  mc_nu_Y = -1;
511  mc_nu_Pt = -1;
512  mc_nu_Theta = -1;
513  for (int i=0; i<4; i++) {
514  mc_nu_pos[i] = 0;
515  mc_nu_mom[i] = 0;
516  }
517 
518  trackIndex.clear();
519  trackParents.clear();
520  trackChildren.clear();
521  trackSiblings.clear();
522 }
float mc_startMomentum[MAX_TRACKS][4]
std::vector< std::vector< int > > trackChildren
vector< double > oh_pe
vector< int > fSIMIDE_channelIdY
std::map< int, int > trackIndex
vector< int > fSIMIDE_trackId
float mc_endXYZT[MAX_TRACKS][4]
int mc_id[MAX_TRACKS]
int mc_pdg[MAX_TRACKS]
std::vector< std::vector< int > > trackSiblings
vector< int > of_multiplicity
vector< float > fSIMIDE_y
vector< float > fSIMIDE_x
int mc_mother[MAX_TRACKS]
vector< unsigned short > fSIMIDE_tdc
std::map< int, int > savedMCTrackIdMap
float mc_endMomentum[MAX_TRACKS][4]
vector< int > oh_channel
vector< double > oh_bgtime
vector< double > oh_trigtime
TClonesArray * fCalib_wf
TObjArray * fMC_trackPosition
std::vector< int > fRaw_channelId
vector< float > fSIMIDE_z
#define MAX_TRACKS
std::vector< std::vector< int > > mc_daughters
TClonesArray * fRaw_wf
std::vector< int > fCalib_channelId
float mc_nu_mom[4]
TClonesArray * fPEperOpDet
vector< float > fSIMIDE_numElectrons
float mc_startXYZT[MAX_TRACKS][4]
vector< float > of_peTotal
float mc_nu_pos[4]
vector< float > of_t
std::vector< std::vector< int > > trackParents
fhicl::ParameterSetID art::EventObserverBase::selectorConfig ( ) const
inlineinherited

Definition at line 56 of file EventObserverBase.h.

References art::EventObserverBase::selector_config_id_.

Referenced by art::RootOutputFile::writeOne().

57  {
58  return selector_config_id_;
59  }
fhicl::ParameterSetID selector_config_id_
void art::Consumer::showMissingConsumes ( ) const
protectedinherited

Definition at line 125 of file Consumer.cc.

Referenced by art::EDProducer::doEndJob(), art::EDFilter::doEndJob(), art::EDAnalyzer::doEndJob(), and art::RootOutput::endJob().

126 {
127  if (!moduleContext_)
128  return;
129 
130  // If none of the branches have missing consumes statements, exit early.
131  if (std::all_of(cbegin(missingConsumes_),
132  cend(missingConsumes_),
133  [](auto const& perBranch) { return perBranch.empty(); }))
134  return;
135 
136  constexpr cet::HorizontalRule rule{60};
137  mf::LogPrint log{"MTdiagnostics"};
138  log << '\n'
139  << rule('=') << '\n'
140  << "The following consumes (or mayConsume) statements are missing from\n"
141  << module_context(moduleDescription_) << '\n'
142  << rule('-') << '\n';
143 
144  cet::for_all_with_index(
145  missingConsumes_, [&log](std::size_t const i, auto const& perBranch) {
146  for (auto const& pi : perBranch) {
147  log << " "
148  << assemble_consumes_statement(static_cast<BranchType>(i), pi)
149  << '\n';
150  }
151  });
152  log << rule('=');
153 }
cet::exempt_ptr< ModuleDescription const > moduleDescription_
Definition: Consumer.h:140
constexpr T pi()
Returns the constant pi (up to 35 decimal digits of precision)
bool moduleContext_
Definition: Consumer.h:136
ConsumableProductSets missingConsumes_
Definition: Consumer.h:139
void art::Consumer::validateConsumedProduct ( BranchType const  bt,
ProductInfo const &  pi 
)
protectedinherited

Definition at line 101 of file Consumer.cc.

References art::errors::ProductRegistrationFailure.

103 {
104  // Early exits if consumes tracking has been disabled or if the
105  // consumed product is an allowed consumable.
106  if (!moduleContext_)
107  return;
108 
109  if (cet::binary_search_all(consumables_[bt], pi))
110  return;
111 
112  if (requireConsumes_) {
114  "Consumer: an error occurred during validation of a "
115  "retrieved product\n\n")
116  << "The following consumes (or mayConsume) statement is missing from\n"
117  << module_context(moduleDescription_) << ":\n\n"
118  << " " << assemble_consumes_statement(bt, pi) << "\n\n";
119  }
120 
121  missingConsumes_[bt].insert(pi);
122 }
cet::exempt_ptr< ModuleDescription const > moduleDescription_
Definition: Consumer.h:140
bool requireConsumes_
Definition: Consumer.h:137
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
constexpr T pi()
Returns the constant pi (up to 35 decimal digits of precision)
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
ConsumableProductSets missingConsumes_
Definition: Consumer.h:139
bool art::EventObserverBase::wantAllEvents ( ) const
inlineinherited
bool art::EventObserverBase::wantEvent ( Event const &  e)
inlineinherited
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

TDatabasePDG* wc::CellTree::dbPDG
private

Definition at line 226 of file CellTree_module.cc.

Referenced by CellTree(), and PDGName().

int wc::CellTree::entryNo
private

Definition at line 145 of file CellTree_module.cc.

Referenced by analyze(), and CellTree().

double wc::CellTree::fBeamgatetime
private

Definition at line 155 of file CellTree_module.cc.

Referenced by initOutput(), and processTrigger().

std::vector<int> wc::CellTree::fCalib_channelId
private

Definition at line 161 of file CellTree_module.cc.

Referenced by initOutput(), processCalib(), and reset().

int wc::CellTree::fCalib_nChannel
private

Definition at line 158 of file CellTree_module.cc.

Referenced by initOutput(), and processCalib().

TClonesArray* wc::CellTree::fCalib_wf
private

Definition at line 163 of file CellTree_module.cc.

Referenced by initOutput(), and reset().

std::string wc::CellTree::fCalibLabel
private

Definition at line 117 of file CellTree_module.cc.

Referenced by processCalib(), and reconfigure().

int wc::CellTree::fEvent
private

Definition at line 148 of file CellTree_module.cc.

Referenced by analyze(), initOutput(), printEvent(), and processSpacePoint().

double wc::CellTree::fEventTime
private

Definition at line 151 of file CellTree_module.cc.

Referenced by analyze(), and initOutput().

TTree* wc::CellTree::fEventTree
private

Definition at line 141 of file CellTree_module.cc.

Referenced by analyze(), endJob(), and initOutput().

art::ServiceHandle<geo::Geometry> wc::CellTree::fGeometry
private

Definition at line 135 of file CellTree_module.cc.

Referenced by processOpFlash(), and processSpacePoint().

TObjArray* wc::CellTree::fMC_trackPosition
private

Definition at line 201 of file CellTree_module.cc.

Referenced by initOutput(), processMC(), and reset().

std::string wc::CellTree::fOpFlashLabel
private

Definition at line 119 of file CellTree_module.cc.

Referenced by processOpFlash(), and reconfigure().

std::string wc::CellTree::fOpHitLabel
private

Definition at line 118 of file CellTree_module.cc.

Referenced by processOpHit(), and reconfigure().

TFile* wc::CellTree::fOutFile
private

Definition at line 140 of file CellTree_module.cc.

Referenced by endJob(), and initOutput().

std::string wc::CellTree::fOutFileName
private

Definition at line 122 of file CellTree_module.cc.

Referenced by initOutput(), and reconfigure().

TClonesArray* wc::CellTree::fPEperOpDet
private

Definition at line 176 of file CellTree_module.cc.

Referenced by initOutput(), and reset().

std::vector<int> wc::CellTree::fRaw_channelId
private

Definition at line 179 of file CellTree_module.cc.

Referenced by initOutput(), processRaw(), and reset().

int wc::CellTree::fRaw_nChannel
private

Definition at line 178 of file CellTree_module.cc.

Referenced by initOutput(), and processRaw().

TClonesArray* wc::CellTree::fRaw_wf
private

Definition at line 180 of file CellTree_module.cc.

Referenced by initOutput(), and reset().

std::string wc::CellTree::fRawDigitLabel
private

Definition at line 116 of file CellTree_module.cc.

Referenced by processRaw(), and reconfigure().

int wc::CellTree::fRun
private

Definition at line 149 of file CellTree_module.cc.

Referenced by analyze(), initOutput(), printEvent(), and processSpacePoint().

bool wc::CellTree::fSaveCalib
private

Definition at line 129 of file CellTree_module.cc.

Referenced by analyze(), and reconfigure().

bool wc::CellTree::fSaveJSON
private

Definition at line 134 of file CellTree_module.cc.

Referenced by analyze(), endJob(), initOutput(), and reconfigure().

bool wc::CellTree::fSaveMC
private

Definition at line 132 of file CellTree_module.cc.

Referenced by analyze(), and reconfigure().

bool wc::CellTree::fSaveMCTrackPoints
private

Definition at line 126 of file CellTree_module.cc.

Referenced by processMC(), and reconfigure().

bool wc::CellTree::fSaveOpFlash
private

Definition at line 131 of file CellTree_module.cc.

Referenced by analyze(), and reconfigure().

bool wc::CellTree::fSaveOpHit
private

Definition at line 130 of file CellTree_module.cc.

Referenced by analyze(), and reconfigure().

bool wc::CellTree::fSaveRaw
private

Definition at line 128 of file CellTree_module.cc.

Referenced by analyze(), and reconfigure().

bool wc::CellTree::fSaveSimChannel
private

Definition at line 127 of file CellTree_module.cc.

Referenced by analyze(), and reconfigure().

bool wc::CellTree::fSaveTrigger
private

Definition at line 133 of file CellTree_module.cc.

Referenced by analyze(), and reconfigure().

vector<int> wc::CellTree::fSIMIDE_channelIdY
private

Definition at line 183 of file CellTree_module.cc.

Referenced by initOutput(), processSimChannel(), and reset().

vector<float> wc::CellTree::fSIMIDE_numElectrons
private

Definition at line 189 of file CellTree_module.cc.

Referenced by initOutput(), processSimChannel(), and reset().

int wc::CellTree::fSIMIDE_size
private

Definition at line 182 of file CellTree_module.cc.

Referenced by initOutput(), and processSimChannel().

vector<unsigned short> wc::CellTree::fSIMIDE_tdc
private

Definition at line 185 of file CellTree_module.cc.

Referenced by initOutput(), processSimChannel(), and reset().

vector<int> wc::CellTree::fSIMIDE_trackId
private

Definition at line 184 of file CellTree_module.cc.

Referenced by initOutput(), processSimChannel(), and reset().

vector<float> wc::CellTree::fSIMIDE_x
private

Definition at line 186 of file CellTree_module.cc.

Referenced by initOutput(), processSimChannel(), and reset().

vector<float> wc::CellTree::fSIMIDE_y
private

Definition at line 187 of file CellTree_module.cc.

Referenced by initOutput(), processSimChannel(), and reset().

vector<float> wc::CellTree::fSIMIDE_z
private

Definition at line 188 of file CellTree_module.cc.

Referenced by initOutput(), processSimChannel(), and reset().

std::vector<std::string> wc::CellTree::fSpacePointLabels
private

Definition at line 121 of file CellTree_module.cc.

Referenced by analyze(), and reconfigure().

int wc::CellTree::fSubRun
private

Definition at line 150 of file CellTree_module.cc.

Referenced by analyze(), initOutput(), printEvent(), and processSpacePoint().

unsigned int wc::CellTree::fTriggerbits
private

Definition at line 156 of file CellTree_module.cc.

Referenced by initOutput(), and processTrigger().

std::string wc::CellTree::fTriggerLabel
private

Definition at line 120 of file CellTree_module.cc.

Referenced by processTrigger(), and reconfigure().

unsigned int wc::CellTree::fTriggernumber
private

Definition at line 153 of file CellTree_module.cc.

Referenced by initOutput(), and processTrigger().

double wc::CellTree::fTriggertime
private

Definition at line 154 of file CellTree_module.cc.

Referenced by initOutput(), and processTrigger().

std::vector<std::vector<int> > wc::CellTree::mc_daughters
private
float wc::CellTree::mc_endMomentum[MAX_TRACKS][4]
private

Definition at line 199 of file CellTree_module.cc.

Referenced by initOutput(), printEvent(), processMC(), and reset().

float wc::CellTree::mc_endXYZT[MAX_TRACKS][4]
private

Definition at line 197 of file CellTree_module.cc.

Referenced by DumpMCJSON(), initOutput(), printEvent(), processMC(), and reset().

int wc::CellTree::mc_hitnuc
private

Definition at line 210 of file CellTree_module.cc.

Referenced by initOutput(), processMC(), and reset().

int wc::CellTree::mc_hitquark
private

Definition at line 211 of file CellTree_module.cc.

Referenced by initOutput(), processMC(), and reset().

int wc::CellTree::mc_id[MAX_TRACKS]
private
int wc::CellTree::mc_isnu
private

Definition at line 203 of file CellTree_module.cc.

Referenced by initOutput(), processMC(), and reset().

int wc::CellTree::mc_mother[MAX_TRACKS]
private

Definition at line 195 of file CellTree_module.cc.

Referenced by initOutput(), printEvent(), processMC(), processMCTracks(), and reset().

int wc::CellTree::mc_nGeniePrimaries
private

Definition at line 204 of file CellTree_module.cc.

Referenced by initOutput(), processMC(), and reset().

int wc::CellTree::mc_Ntrack
private
int wc::CellTree::mc_nu_ccnc
private

Definition at line 206 of file CellTree_module.cc.

Referenced by initOutput(), processMC(), and reset().

int wc::CellTree::mc_nu_intType
private

Definition at line 208 of file CellTree_module.cc.

Referenced by initOutput(), processMC(), and reset().

int wc::CellTree::mc_nu_mode
private

Definition at line 207 of file CellTree_module.cc.

Referenced by initOutput(), processMC(), and reset().

float wc::CellTree::mc_nu_mom[4]
private

Definition at line 219 of file CellTree_module.cc.

Referenced by initOutput(), processMC(), and reset().

int wc::CellTree::mc_nu_pdg
private

Definition at line 205 of file CellTree_module.cc.

Referenced by initOutput(), processMC(), and reset().

float wc::CellTree::mc_nu_pos[4]
private

Definition at line 218 of file CellTree_module.cc.

Referenced by initOutput(), processMC(), and reset().

double wc::CellTree::mc_nu_Pt
private

Definition at line 216 of file CellTree_module.cc.

Referenced by initOutput(), processMC(), and reset().

double wc::CellTree::mc_nu_Q2
private

Definition at line 212 of file CellTree_module.cc.

Referenced by initOutput(), processMC(), and reset().

int wc::CellTree::mc_nu_target
private

Definition at line 209 of file CellTree_module.cc.

Referenced by initOutput(), processMC(), and reset().

double wc::CellTree::mc_nu_Theta
private

Definition at line 217 of file CellTree_module.cc.

Referenced by initOutput(), processMC(), and reset().

double wc::CellTree::mc_nu_W
private

Definition at line 213 of file CellTree_module.cc.

Referenced by initOutput(), processMC(), and reset().

double wc::CellTree::mc_nu_X
private

Definition at line 214 of file CellTree_module.cc.

Referenced by initOutput(), processMC(), and reset().

double wc::CellTree::mc_nu_Y
private

Definition at line 215 of file CellTree_module.cc.

Referenced by initOutput(), processMC(), and reset().

int wc::CellTree::mc_pdg[MAX_TRACKS]
private

Definition at line 193 of file CellTree_module.cc.

Referenced by DumpMCJSON(), initOutput(), KeepMC(), printEvent(), processMC(), and reset().

int wc::CellTree::mc_process[MAX_TRACKS]
private

Definition at line 194 of file CellTree_module.cc.

Referenced by initOutput(), and processMC().

float wc::CellTree::mc_startMomentum[MAX_TRACKS][4]
private

Definition at line 198 of file CellTree_module.cc.

Referenced by DumpMCJSON(), initOutput(), KeepMC(), printEvent(), processMC(), and reset().

float wc::CellTree::mc_startXYZT[MAX_TRACKS][4]
private

Definition at line 196 of file CellTree_module.cc.

Referenced by DumpMCJSON(), initOutput(), printEvent(), processMC(), and reset().

std::string wc::CellTree::mcOption
private

Definition at line 123 of file CellTree_module.cc.

Referenced by processMC(), and reconfigure().

int wc::CellTree::nRawSamples
private

Definition at line 124 of file CellTree_module.cc.

Referenced by processCalib(), processRaw(), and reconfigure().

vector<int> wc::CellTree::of_multiplicity
private

Definition at line 175 of file CellTree_module.cc.

Referenced by initOutput(), processOpFlash(), and reset().

int wc::CellTree::of_nFlash
private

Definition at line 172 of file CellTree_module.cc.

Referenced by initOutput(), and processOpFlash().

vector<float> wc::CellTree::of_peTotal
private

Definition at line 174 of file CellTree_module.cc.

Referenced by initOutput(), processOpFlash(), and reset().

vector<float> wc::CellTree::of_t
private

Definition at line 173 of file CellTree_module.cc.

Referenced by initOutput(), processOpFlash(), and reset().

vector<double> wc::CellTree::oh_bgtime
private

Definition at line 168 of file CellTree_module.cc.

Referenced by initOutput(), processOpHit(), and reset().

vector<int> wc::CellTree::oh_channel
private

Definition at line 167 of file CellTree_module.cc.

Referenced by initOutput(), processOpHit(), and reset().

int wc::CellTree::oh_nHits
private

Definition at line 166 of file CellTree_module.cc.

Referenced by initOutput(), and processOpHit().

vector<double> wc::CellTree::oh_pe
private

Definition at line 170 of file CellTree_module.cc.

Referenced by initOutput(), processOpHit(), and reset().

vector<double> wc::CellTree::oh_trigtime
private

Definition at line 169 of file CellTree_module.cc.

Referenced by initOutput(), processOpHit(), and reset().

float wc::CellTree::opMultPEThresh
private

Definition at line 125 of file CellTree_module.cc.

Referenced by processOpFlash(), and reconfigure().

std::map<std::string, int> wc::CellTree::processMap
private

Definition at line 142 of file CellTree_module.cc.

Referenced by InitProcessMap(), and processMC().

std::map<int, int> wc::CellTree::savedMCTrackIdMap
private

Definition at line 143 of file CellTree_module.cc.

Referenced by processMC(), and reset().

std::vector<std::vector<int> > wc::CellTree::trackChildren
private

Definition at line 224 of file CellTree_module.cc.

Referenced by processMCTracks(), and reset().

std::map<int, int> wc::CellTree::trackIndex
private

Definition at line 222 of file CellTree_module.cc.

Referenced by DumpMCJSON(), processMCTracks(), and reset().

std::vector<std::vector<int> > wc::CellTree::trackParents
private

Definition at line 223 of file CellTree_module.cc.

Referenced by processMCTracks(), and reset().

std::vector<std::vector<int> > wc::CellTree::trackSiblings
private

Definition at line 225 of file CellTree_module.cc.

Referenced by processMCTracks(), and reset().


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