LArSoft  v06_85_00
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 75 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 231 of file CellTree_module.cc.

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

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

Definition at line 243 of file CellTree_module.cc.

244 {
245 }

Member Function Documentation

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

Definition at line 407 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().

408 {
409  reset();
410  fEvent = event.id().event();
411  fRun = event.run();
412  fSubRun = event.subRun();
413  art::Timestamp ts = event.time();
414  TTimeStamp tts(ts.timeHigh(), ts.timeLow());
415  fEventTime = tts.AsDouble();
416 
417  if (fSaveRaw) processRaw(event);
422  if (fSaveMC) processMC(event);
424 
425  if (fSaveJSON) {
426  gSystem->MakeDirectory(TString::Format("data/%i", entryNo).Data());
427  int nSp = fSpacePointLabels.size();
428  for (int i=0; i<nSp; i++) {
429  TString jsonfile;
430  jsonfile.Form("data/%i/%i-%s.json", entryNo, entryNo, fSpacePointLabels[i].c_str());
431  std::ofstream out(jsonfile.Data());
433  out.close();
434  }
435 
436  if(fSaveMC) {
437  processMCTracks();
438  TString jsonfile;
439  jsonfile.Form("data/%i/%i-mc.json", entryNo, entryNo);
440  std::ofstream out(jsonfile.Data());
441  DumpMCJSON(out);
442  out.close();
443  }
444  }
445 
446  // printEvent();
447  fEventTree->Fill();
448 
449  entryNo++;
450 }
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 374 of file CellTree_module.cc.

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

Definition at line 401 of file CellTree_module.cc.

402 {
403  mf::LogInfo("CellTree") << "begin run";
404 }
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 950 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().

951 {
952  int i = trackIndex[id];
953  if (!KeepMC(i)) return false;
954 
955  int e = KE(mc_startMomentum[i])*1000;
956 
957  int nDaughter = mc_daughters.at(i).size();
958  vector<int> saved_daughters;
959  for (int j=0; j<nDaughter; j++) {
960  int daughter_id = mc_daughters.at(i).at(j);
961  // int e_daughter = KE(mc_startMomentum[ trackIndex[daughter_id] ])*1000;
962  // if (e_daughter >= thresh_KE) {
963  if ( KeepMC(trackIndex[daughter_id]) ) {
964  saved_daughters.push_back(daughter_id);
965  }
966  }
967 
968  out << fixed << setprecision(1);
969  out << "{";
970 
971  out << "\"id\":" << id << ",";
972  out << "\"text\":" << "\"" << PDGName(mc_pdg[i]) << " " << e << " MeV\",";
973  out << "\"data\":{";
974  out << "\"start\":[" << mc_startXYZT[i][0] << ", " << mc_startXYZT[i][1] << ", " << mc_startXYZT[i][2] << "],";
975  out << "\"end\":[" << mc_endXYZT[i][0] << ", " << mc_endXYZT[i][1] << ", " << mc_endXYZT[i][2] << "]";
976  out << "},";
977  out << "\"children\":[";
978  int nSavedDaughter = saved_daughters.size();
979  if (nSavedDaughter == 0) {
980  out << "],";
981  out << "\"icon\":" << "\"jstree-file\"";
982  out << "}";
983  return true;
984  }
985  else {
986  for (int j=0; j<nSavedDaughter; j++) {
987  DumpMCJSON(saved_daughters.at(j), out);
988  if (j!=nSavedDaughter-1) {
989  out << ",";
990  }
991  }
992  out << "]";
993  out << "}";
994  return true;
995  }
996 }
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 999 of file CellTree_module.cc.

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

1000 {
1001  out << "[";
1002  vector<int> primaries;
1003  for (int i=0; i<mc_Ntrack; i++) {
1004  if (IsPrimary(i)) {
1005  // int e = KE(mc_startMomentum[i])*1000;
1006  // if (e<thresh_KE) continue;
1007  if (KeepMC(i)) {
1008  primaries.push_back(i);
1009  }
1010  }
1011  }
1012  int size = primaries.size();
1013  // cout << size << endl;
1014  for (int i=0; i<size; i++) {
1015  if (DumpMCJSON(mc_id[primaries[i]], out) && i!=size-1) {
1016  out << ", ";
1017  }
1018  }
1019 
1020  out << "]";
1021 }
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 382 of file CellTree_module.cc.

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

383 {
384  // Write fEventTree to file
385  TDirectory* tmpDir = gDirectory;
386  fOutFile->cd("/Event");
387 
388  fEventTree->Write();
389 
390  gDirectory = tmpDir;
391 
392  fOutFile->Close();
393 
394  if (fSaveJSON) {
395  system("zip -r bee_upload data");
396  gSystem->ChangeDirectory("..");
397  }
398 }
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 271 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().

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

References DEFINE_ART_MODULE, and processMap.

Referenced by CellTree().

1098 {
1099  processMap["unknown"] = 0;
1100  processMap["primary"] = 1;
1101  processMap["compt"] = 2;
1102  processMap["phot"] = 3;
1103  processMap["annihil"] = 4;
1104  processMap["eIoni"] = 5;
1105  processMap["eBrem"] = 6;
1106  processMap["conv"] = 7;
1107  processMap["muIoni"] = 8;
1108  processMap["muMinusCaptureAtRest"] = 9;
1109  processMap["NeutronInelastic"] = 10;
1110  processMap["nCapture"] = 11;
1111  processMap["hadElastic"] = 12;
1112  processMap["Decay"] = 13;
1113  processMap["CoulombScat"] = 14;
1114  processMap["muPairProd"] = 15;
1115  processMap["muBrems"] = 16;
1116  processMap["muPairProd"] = 17;
1117  processMap["PhotonInelastic"] = 18;
1118  processMap["hIoni"] = 19;
1119  processMap["ProtonInelastic"] = 20;
1120  processMap["PionPlusInelastic"] = 21;
1121  processMap["CHIPSNuclearCaptureAtRest"] = 22;
1122  processMap["PionMinusInelastic"] = 23;
1123 }
std::map< std::string, int > processMap
bool wc::CellTree::IsPrimary ( int  i)
inline

Definition at line 104 of file CellTree_module.cc.

Referenced by DumpMCJSON(), and processMCTracks().

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

Definition at line 1024 of file CellTree_module.cc.

Referenced by DumpMCJSON(), and KeepMC().

1025 {
1026  TLorentzVector particle(momentum);
1027  return particle.E()-particle.M();
1028 }
bool wc::CellTree::KeepMC ( int  i)

Definition at line 1031 of file CellTree_module.cc.

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

Referenced by DumpMCJSON().

1032 {
1033  double e = KE(mc_startMomentum[i])*1000;
1034  double thresh_KE_em = 5.; // MeV
1035  double thresh_KE_np = 10; // MeV
1036  if (mc_pdg[i]==22 || mc_pdg[i]==11 || mc_pdg[i]==-11) {
1037  if (e>=thresh_KE_em) return true;
1038  else return false;
1039  }
1040  else if (mc_pdg[i]==2112 || mc_pdg[i]==2212 || mc_pdg[i]>1e9) {
1041  if (e>=thresh_KE_np) return true;
1042  else return false;
1043  }
1044  return true;
1045 }
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 1048 of file CellTree_module.cc.

References dbPDG, and z.

Referenced by DumpMCJSON().

1049 {
1050  TParticlePDG *p = dbPDG->GetParticle(pdg);
1051  if (p == 0) {
1052  if (pdg>1e9) {
1053  int z = (pdg - 1e9) / 10000;
1054  int a = (pdg - 1e9 - z*1e4) / 10;
1055  TString name;
1056  if (z == 18) name = "Ar";
1057 
1058  else if (z == 17) name = "Cl";
1059  else if (z == 19) name = "Ca";
1060  else if (z == 16) name = "S";
1061  else if (z == 15) name = "P";
1062  else if (z == 14) name = "Si";
1063  else if (z == 1) name = "H";
1064  else if (z == 2) name = "He";
1065 
1066  else return Form("%i", pdg);
1067  return Form("%s-%i", name.Data(), a);
1068  }
1069  return Form("%i", pdg);
1070  }
1071  else {
1072  return p->GetName();
1073  }
1074 }
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 858 of file CellTree_module.cc.

Referenced by processSpacePoint().

859 {
860  int N = v.size();
861 
862  out << '"' << desc << '"' << ":[";
863  for (int i=0; i<N; i++) {
864  out << v[i];
865  if (i!=N-1) {
866  out << ",";
867  }
868  }
869  out << "]";
870  if (!end) out << ",";
871  out << endl;
872 }
std::vector< evd::details::RawDigitInfo_t >::const_iterator end(RawDigitCacheDataClass const &cache)
void wc::CellTree::printEvent ( )

Definition at line 1077 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.

1078 {
1079  cout << " Run/SubRun/Event: " << fRun << "/" << fSubRun << "/" << fEvent << endl;
1080  cout << " Ntracks:" << mc_Ntrack << endl;
1081 
1082  for (int i=0; i<mc_Ntrack; i++) {
1083  cout << "\n id: " << mc_id[i];
1084  cout << "\n pdg: " << mc_pdg[i];
1085  cout << "\n mother: " << mc_mother[i];
1086  cout << "\n Ndaughters: " << mc_daughters.at(i).size();
1087  cout << "\n start XYZT: (" << mc_startXYZT[i][0] << ", " << mc_startXYZT[i][1] << ", " << mc_startXYZT[i][2] << ", " << mc_startXYZT[i][3] << ")";
1088  cout << "\n end XYZT: (" << mc_endXYZT[i][0] << ", " << mc_endXYZT[i][1] << ", " << mc_endXYZT[i][2] << ", " << mc_endXYZT[i][3] << ")";
1089  cout << "\n start momentum: (" << mc_startMomentum[i][0] << ", " << mc_startMomentum[i][1] << ", " << mc_startMomentum[i][2] << ", " << mc_startMomentum[i][3] << ")";
1090  cout << "\n end momentum: (" << mc_endMomentum[i][0] << ", " << mc_endMomentum[i][1] << ", " << mc_endMomentum[i][2] << ", " << mc_endMomentum[i][3] << ")";
1091 
1092  cout << endl;
1093  }
1094 }
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 558 of file CellTree_module.cc.

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

Referenced by analyze().

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

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

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

Referenced by analyze().

876 {
877  // map track id to track index in the array
878  for (int i=0; i<mc_Ntrack; i++) {
879  trackIndex[mc_id[i]] = i;
880  }
881 
882  // in trackParents, trackChildren, trackSiblings vectors, store track index (not track id)
883  for (int i=0; i<mc_Ntrack; i++) {
884  // currently, parent size == 1;
885  // for primary particle, parent id = 0;
886  vector<int> parents;
887  if ( !IsPrimary(i) ) {
888  parents.push_back(trackIndex[mc_mother[i]]);
889  }
890  trackParents.push_back(parents); // primary track will have 0 parents
891 
892  vector<int> children;
893  int nChildren = mc_daughters.at(i).size();
894  for (int j=0; j<nChildren; j++) {
895  children.push_back(trackIndex[mc_daughters.at(i).at(j)]);
896  }
897  trackChildren.push_back(children);
898 
899  }
900 
901  // siblings
902  for (int i=0; i<mc_Ntrack; i++) {
903  vector<int> siblings;
904  if ( IsPrimary(i) ) {
905  for (int j=0; j<mc_Ntrack; j++) {
906  if( IsPrimary(j) ) {
907  siblings.push_back(j);
908  }
909  }
910  }
911  else {
912  // siblings are simply children of the mother
913  int mother = trackIndex[mc_mother[i]];
914  int nSiblings = trackChildren.at(mother).size();
915  for (int j=0; j<nSiblings; j++) {
916  siblings.push_back(trackChildren.at(mother).at(j));
917  }
918  }
919  trackSiblings.push_back(siblings);
920  }
921 
922 }
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 611 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().

612  {
614  if(! event.getByLabel(fOpFlashLabel, flash_handle)){
615  cout << "WARNING: no label " << fOpFlashLabel << endl;
616  return;
617  }
618  std::vector<art::Ptr<recob::OpFlash> > flashes;
619  art::fill_ptr_vector(flashes, flash_handle);
620  of_nFlash = (int)flashes.size();
621 
622  int a=0;
623  int nOpDet = fGeometry->NOpDets();
624 
625  for(auto const& flash: flashes){
626  of_t.push_back(flash->Time());
627  of_peTotal.push_back(flash->TotalPE());
628  TH1F *h = new ((*fPEperOpDet)[a]) TH1F("","",nOpDet,0,nOpDet);
629 
630  int mult = 0;
631  for(int i=0; i<nOpDet; ++i){
632  if(flash->PE(i) >= opMultPEThresh){
633  mult++;
634  }
635  h->SetBinContent(i, flash->PE(i));
636  }
637  of_multiplicity.push_back(mult);
638  a++;
639  }
640  }
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 590 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().

591 {
593  if(! event.getByLabel(fOpHitLabel, ophit_handle)){
594  cout << "WARNING: no label " << fOpHitLabel << endl;
595  return;
596  }
597  std::vector<art::Ptr<recob::OpHit> > ophits;
598  art::fill_ptr_vector(ophits, ophit_handle);
599  oh_nHits = (int)ophits.size();
600 
601  for(auto const& oh : ophits){
602  oh_channel.push_back(oh->OpChannel());
603  oh_bgtime.push_back(oh->PeakTime());
604  oh_trigtime.push_back(oh->PeakTimeAbs());
605  oh_pe.push_back(oh->PE());
606  }
607 
608 }
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 524 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().

525 {
527  if (! event.getByLabel(fRawDigitLabel, rawdigit)) {
528  cout << "WARNING: no label " << fRawDigitLabel << endl;
529  return;
530  }
531  std::vector< art::Ptr<raw::RawDigit> > wires;
532  art::fill_ptr_vector(wires, rawdigit);
533 
534  fRaw_nChannel = wires.size();
535 
536  int i=0;
537  for (auto const& wire: wires) {
538  int chanId = wire->Channel();
539  fRaw_channelId.push_back(chanId);
540 
541  int nSamples = wire->Samples();
542  std::vector<short> uncompressed(nSamples);
543  raw::Uncompress(wire->ADCs(), uncompressed, wire->Compression());
544 
545  TH1F *h = new((*fRaw_wf)[i]) TH1F("", "", nRawSamples, 0, nRawSamples);
546  for (int j=1; j<=nSamples; j++) {
547  h->SetBinContent(j, uncompressed[j-1]);
548  }
549  i++;
550  if (i==1) {
551  cout << nSamples << " samples expanding to " << nRawSamples << endl;
552  }
553  }
554 
555 }
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 643 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().

644 {
646  event.getByLabel("largeant", simChannelHandle);
647  // cout << "total simChannel: " << (*simChannelHandle).size() << endl;
648  fSIMIDE_size = 0;
649  for ( auto const& channel : (*simChannelHandle) ) {
650  auto channelNumber = channel.Channel();
651  // cout << channelNumber << endl;
652  // if (! (fGeometry->SignalType( channelNumber ) == geo::kCollection) ) {
653  // continue;
654  // }
655  auto const& timeSlices = channel.TDCIDEMap();
656  for ( auto const& timeSlice : timeSlices ) {
657  auto const& energyDeposits = timeSlice.second;
658  for ( auto const& energyDeposit : energyDeposits ) {
659  fSIMIDE_size++;
660  fSIMIDE_channelIdY.push_back(channelNumber);
661  fSIMIDE_tdc.push_back(timeSlice.first);
662  fSIMIDE_trackId.push_back(energyDeposit.trackID);
663  fSIMIDE_x.push_back(energyDeposit.x);
664  fSIMIDE_y.push_back(energyDeposit.y);
665  fSIMIDE_z.push_back(energyDeposit.z);
666  fSIMIDE_numElectrons.push_back(energyDeposit.numElectrons);
667  // cout << channelNumber << ": " << energyDeposit.trackID << ": " << timeSlice.first << ": "
668  // << energyDeposit.x << ", " << energyDeposit.y << ", " << energyDeposit.z << ", "
669  // << energyDeposit.numElectrons << endl;
670  }
671  }
672 
673  }
674  cout << "total IDEs: " << fSIMIDE_size << endl;
675 
676 
677 }
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 804 of file CellTree_module.cc.

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

Referenced by analyze().

805 {
806 
808  if (! event.getByLabel(option.Data(), handle)) {
809  cout << "WARNING: no label " << option << endl;
810  return;
811  }
812  std::vector< art::Ptr<recob::SpacePoint> > sps;
813  art::fill_ptr_vector(sps, handle);
814 
815  double x=0, y=0, z=0, q=0, nq=1;
816  vector<double> vx, vy, vz, vq, vnq;
817 
818  for (auto const& sp: sps ) {
819  // cout << sp->XYZ()[0] << ", " << sp->XYZ()[1] << ", " << sp->XYZ()[2] << endl;
820  x = sp->XYZ()[0];
821  y = sp->XYZ()[1];
822  z = sp->XYZ()[2];
823  vx.push_back(x);
824  vy.push_back(y);
825  vz.push_back(z);
826  vq.push_back(q);
827  vnq.push_back(nq);
828  }
829 
830  out << fixed << setprecision(1);
831  out << "{" << endl;
832 
833  out << '"' << "runNo" << '"' << ":" << '"' << fRun << '"' << "," << endl;
834  out << '"' << "subRunNo" << '"' << ":" << '"' << fSubRun << '"' << "," << endl;
835  out << '"' << "eventNo" << '"' << ":" << '"' << fEvent << '"' << "," << endl;
836 
837  TString geomName(fGeometry->DetectorName().c_str());
838  if (geomName.Contains("35t")) { geomName = "dune35t"; }
839  else if (geomName.Contains("protodune")) { geomName = "protodune"; }
840  else if (geomName.Contains("workspace")) { geomName = "dune10kt_workspace"; }
841  else { geomName = "uboone"; } // use uboone as default
842  out << '"' << "geom" << '"' << ":" << '"' << geomName << '"' << "," << endl;
843 
844 
845  print_vector(out, vx, "x");
846  print_vector(out, vy, "y");
847  print_vector(out, vz, "z");
848 
849  out << fixed << setprecision(0);
850  print_vector(out, vq, "q");
851  print_vector(out, vnq, "nq");
852 
853  out << '"' << "type" << '"' << ":" << '"' << option << '"' << endl;
854  out << "}" << endl;
855 }
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
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 wc::CellTree::processTrigger ( const art::Event evt)

Definition at line 925 of file CellTree_module.cc.

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

Referenced by analyze().

926 {
927  art::Handle< std::vector<raw::Trigger>> triggerListHandle;
928  std::vector<art::Ptr<raw::Trigger>> triggerlist;
929  if (event.getByLabel(fTriggerLabel, triggerListHandle)) {
930  art::fill_ptr_vector(triggerlist, triggerListHandle);
931  }
932  else {
933  cout << "WARNING: no label " << fTriggerLabel << endl;
934  }
935  if (triggerlist.size()){
936  fTriggernumber = triggerlist[0]->TriggerNumber();
937  fTriggertime = triggerlist[0]->TriggerTime();
938  fBeamgatetime = triggerlist[0]->BeamGateTime();
939  fTriggerbits = triggerlist[0]->TriggerBits();
940  }
941  else {
942  fTriggernumber = 0;
943  fTriggertime = 0;
944  fBeamgatetime = 0;
945  fTriggerbits = 0;
946  }
947 }
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 248 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().

248  {
249  fRawDigitLabel = p.get<std::string>("RawDigitLabel");
250  fCalibLabel = p.get<std::string>("CalibLabel");
251  fOpHitLabel = p.get<std::string>("OpHitLabel");
252  fOpFlashLabel = p.get<std::string>("OpFlashLabel");
253  fTriggerLabel = p.get<std::string>("TriggerLabel");
254  fSpacePointLabels= p.get<std::vector<std::string> >("SpacePointLabels");
255  fOutFileName = p.get<std::string>("outFile");
256  mcOption = p.get<std::string>("mcOption");
257  fSaveMCTrackPoints = p.get<bool>("saveMCTrackPoints");
258  fSaveRaw = p.get<bool>("saveRaw");
259  fSaveCalib = p.get<bool>("saveCalib");
260  fSaveOpHit = p.get<bool>("saveOpHit");
261  fSaveOpFlash = p.get<bool>("saveOpFlash");
262  fSaveMC = p.get<bool>("saveMC");
263  fSaveSimChannel = p.get<bool>("saveSimChannel");
264  fSaveTrigger = p.get<bool>("saveTrigger");
265  fSaveJSON = p.get<bool>("saveJSON");
266  opMultPEThresh = p.get<float>("opMultPEThresh");
267  nRawSamples = p.get<int>("nRawSamples");
268 }
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 453 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().

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

Referenced by CellTree(), and PDGName().

int wc::CellTree::entryNo
private

Definition at line 144 of file CellTree_module.cc.

Referenced by analyze(), and CellTree().

double wc::CellTree::fBeamgatetime
private

Definition at line 154 of file CellTree_module.cc.

Referenced by initOutput(), and processTrigger().

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

Definition at line 160 of file CellTree_module.cc.

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

int wc::CellTree::fCalib_nChannel
private

Definition at line 157 of file CellTree_module.cc.

Referenced by initOutput(), and processCalib().

TClonesArray* wc::CellTree::fCalib_wf
private

Definition at line 162 of file CellTree_module.cc.

Referenced by initOutput(), and reset().

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

Definition at line 116 of file CellTree_module.cc.

Referenced by processCalib(), and reconfigure().

int wc::CellTree::fEvent
private

Definition at line 147 of file CellTree_module.cc.

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

double wc::CellTree::fEventTime
private

Definition at line 150 of file CellTree_module.cc.

Referenced by analyze(), and initOutput().

TTree* wc::CellTree::fEventTree
private

Definition at line 140 of file CellTree_module.cc.

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

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

Definition at line 134 of file CellTree_module.cc.

Referenced by processOpFlash(), and processSpacePoint().

TObjArray* wc::CellTree::fMC_trackPosition
private

Definition at line 200 of file CellTree_module.cc.

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

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

Definition at line 118 of file CellTree_module.cc.

Referenced by processOpFlash(), and reconfigure().

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

Definition at line 117 of file CellTree_module.cc.

Referenced by processOpHit(), and reconfigure().

TFile* wc::CellTree::fOutFile
private

Definition at line 139 of file CellTree_module.cc.

Referenced by endJob(), and initOutput().

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

Definition at line 121 of file CellTree_module.cc.

Referenced by initOutput(), and reconfigure().

TClonesArray* wc::CellTree::fPEperOpDet
private

Definition at line 175 of file CellTree_module.cc.

Referenced by initOutput(), and reset().

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

Definition at line 178 of file CellTree_module.cc.

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

int wc::CellTree::fRaw_nChannel
private

Definition at line 177 of file CellTree_module.cc.

Referenced by initOutput(), and processRaw().

TClonesArray* wc::CellTree::fRaw_wf
private

Definition at line 179 of file CellTree_module.cc.

Referenced by initOutput(), and reset().

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

Definition at line 115 of file CellTree_module.cc.

Referenced by processRaw(), and reconfigure().

int wc::CellTree::fRun
private

Definition at line 148 of file CellTree_module.cc.

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

bool wc::CellTree::fSaveCalib
private

Definition at line 128 of file CellTree_module.cc.

Referenced by analyze(), and reconfigure().

bool wc::CellTree::fSaveJSON
private

Definition at line 133 of file CellTree_module.cc.

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

bool wc::CellTree::fSaveMC
private

Definition at line 131 of file CellTree_module.cc.

Referenced by analyze(), and reconfigure().

bool wc::CellTree::fSaveMCTrackPoints
private

Definition at line 125 of file CellTree_module.cc.

Referenced by processMC(), and reconfigure().

bool wc::CellTree::fSaveOpFlash
private

Definition at line 130 of file CellTree_module.cc.

Referenced by analyze(), and reconfigure().

bool wc::CellTree::fSaveOpHit
private

Definition at line 129 of file CellTree_module.cc.

Referenced by analyze(), and reconfigure().

bool wc::CellTree::fSaveRaw
private

Definition at line 127 of file CellTree_module.cc.

Referenced by analyze(), and reconfigure().

bool wc::CellTree::fSaveSimChannel
private

Definition at line 126 of file CellTree_module.cc.

Referenced by analyze(), and reconfigure().

bool wc::CellTree::fSaveTrigger
private

Definition at line 132 of file CellTree_module.cc.

Referenced by analyze(), and reconfigure().

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

Definition at line 182 of file CellTree_module.cc.

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

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

Definition at line 188 of file CellTree_module.cc.

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

int wc::CellTree::fSIMIDE_size
private

Definition at line 181 of file CellTree_module.cc.

Referenced by initOutput(), and processSimChannel().

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

Definition at line 184 of file CellTree_module.cc.

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

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

Definition at line 183 of file CellTree_module.cc.

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

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

Definition at line 185 of file CellTree_module.cc.

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

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

Definition at line 186 of file CellTree_module.cc.

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

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

Definition at line 187 of file CellTree_module.cc.

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

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

Definition at line 120 of file CellTree_module.cc.

Referenced by analyze(), and reconfigure().

int wc::CellTree::fSubRun
private

Definition at line 149 of file CellTree_module.cc.

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

unsigned int wc::CellTree::fTriggerbits
private

Definition at line 155 of file CellTree_module.cc.

Referenced by initOutput(), and processTrigger().

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

Definition at line 119 of file CellTree_module.cc.

Referenced by processTrigger(), and reconfigure().

unsigned int wc::CellTree::fTriggernumber
private

Definition at line 152 of file CellTree_module.cc.

Referenced by initOutput(), and processTrigger().

double wc::CellTree::fTriggertime
private

Definition at line 153 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 198 of file CellTree_module.cc.

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

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

Definition at line 196 of file CellTree_module.cc.

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

int wc::CellTree::mc_hitnuc
private

Definition at line 209 of file CellTree_module.cc.

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

int wc::CellTree::mc_hitquark
private

Definition at line 210 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 202 of file CellTree_module.cc.

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

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

Definition at line 194 of file CellTree_module.cc.

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

int wc::CellTree::mc_nGeniePrimaries
private

Definition at line 203 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 205 of file CellTree_module.cc.

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

int wc::CellTree::mc_nu_intType
private

Definition at line 207 of file CellTree_module.cc.

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

int wc::CellTree::mc_nu_mode
private

Definition at line 206 of file CellTree_module.cc.

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

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

Definition at line 218 of file CellTree_module.cc.

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

int wc::CellTree::mc_nu_pdg
private

Definition at line 204 of file CellTree_module.cc.

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

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

Definition at line 217 of file CellTree_module.cc.

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

double wc::CellTree::mc_nu_Pt
private

Definition at line 215 of file CellTree_module.cc.

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

double wc::CellTree::mc_nu_Q2
private

Definition at line 211 of file CellTree_module.cc.

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

int wc::CellTree::mc_nu_target
private

Definition at line 208 of file CellTree_module.cc.

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

double wc::CellTree::mc_nu_Theta
private

Definition at line 216 of file CellTree_module.cc.

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

double wc::CellTree::mc_nu_W
private

Definition at line 212 of file CellTree_module.cc.

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

double wc::CellTree::mc_nu_X
private

Definition at line 213 of file CellTree_module.cc.

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

double wc::CellTree::mc_nu_Y
private

Definition at line 214 of file CellTree_module.cc.

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

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

Definition at line 192 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 193 of file CellTree_module.cc.

Referenced by initOutput(), and processMC().

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

Definition at line 197 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 195 of file CellTree_module.cc.

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

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

Definition at line 122 of file CellTree_module.cc.

Referenced by processMC(), and reconfigure().

int wc::CellTree::nRawSamples
private

Definition at line 123 of file CellTree_module.cc.

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

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

Definition at line 174 of file CellTree_module.cc.

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

int wc::CellTree::of_nFlash
private

Definition at line 171 of file CellTree_module.cc.

Referenced by initOutput(), and processOpFlash().

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

Definition at line 173 of file CellTree_module.cc.

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

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

Definition at line 172 of file CellTree_module.cc.

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

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

Definition at line 167 of file CellTree_module.cc.

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

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

Definition at line 166 of file CellTree_module.cc.

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

int wc::CellTree::oh_nHits
private

Definition at line 165 of file CellTree_module.cc.

Referenced by initOutput(), and processOpHit().

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

Definition at line 169 of file CellTree_module.cc.

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

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

Definition at line 168 of file CellTree_module.cc.

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

float wc::CellTree::opMultPEThresh
private

Definition at line 124 of file CellTree_module.cc.

Referenced by processOpFlash(), and reconfigure().

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

Definition at line 141 of file CellTree_module.cc.

Referenced by InitProcessMap(), and processMC().

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

Definition at line 142 of file CellTree_module.cc.

Referenced by processMC(), and reset().

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

Definition at line 223 of file CellTree_module.cc.

Referenced by processMCTracks(), and reset().

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

Definition at line 221 of file CellTree_module.cc.

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

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

Definition at line 222 of file CellTree_module.cc.

Referenced by processMCTracks(), and reset().

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

Definition at line 224 of file CellTree_module.cc.

Referenced by processMCTracks(), and reset().


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