LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
wc::MergeWireCell Class Reference
Inheritance diagram for wc::MergeWireCell:
art::EDProducer art::ProducerBase art::Consumer art::EngineCreator art::ProductRegistryHelper

Public Types

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

Public Member Functions

 MergeWireCell (fhicl::ParameterSet const &p)
 
 MergeWireCell (MergeWireCell const &)=delete
 
 MergeWireCell (MergeWireCell &&)=delete
 
MergeWireCelloperator= (MergeWireCell const &)=delete
 
MergeWireCelloperator= (MergeWireCell &&)=delete
 
void produce (art::Event &e) override
 
void beginJob () override
 
void reconfigure (fhicl::ParameterSet const &p)
 
void MakeTracks (art::Event &evt, std::unique_ptr< std::vector< recob::Track >> &trk_coll, std::unique_ptr< art::Assns< recob::Track, recob::Hit >> &trkhassn, std::unique_ptr< art::Assns< recob::Track, recob::SpacePoint >> &trksassn, std::unique_ptr< std::vector< recob::Hit >> &hit_coll, std::unique_ptr< std::vector< recob::SpacePoint >> &spt_coll, std::vector< int > &index, TTree *tree)
 
void MakeShowers (art::Event &evt, std::unique_ptr< std::vector< recob::Shower >> &shw_coll, std::unique_ptr< art::Assns< recob::Shower, recob::Hit >> &shwhassn, std::unique_ptr< art::Assns< recob::Shower, recob::SpacePoint >> &shwsassn, std::unique_ptr< std::vector< recob::Hit >> &hit_coll, std::unique_ptr< std::vector< recob::SpacePoint >> &spt_coll, std::vector< int > &index, TTree *tree)
 
template<typename PROD , BranchType B = InEvent>
ProductID getProductID (std::string const &instanceName={}) const
 
template<typename PROD , BranchType B>
ProductID getProductID (ModuleDescription const &moduleDescription, std::string const &instanceName) const
 
bool modifiesEvent () const
 
template<typename T , BranchType = InEvent>
ProductToken< 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
 
void validateConsumedProduct (BranchType const bt, ProductInfo const &pi)
 
void prepareForJob (fhicl::ParameterSet const &pset)
 
void showMissingConsumes () const
 

Private Attributes

std::string fInput
 

Static Private Attributes

static constexpr float Sqrt2Pi = 2.5066
 
static constexpr float SqrtPi = 1.7725
 

Detailed Description

Definition at line 41 of file MergeWireCell_module.cc.

Member Typedef Documentation

using art::EDProducer::ModuleType = EDProducer
inherited

Definition at line 34 of file EDProducer.h.

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

Definition at line 43 of file EDProducer.h.

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

Definition at line 35 of file EDProducer.h.

Constructor & Destructor Documentation

wc::MergeWireCell::MergeWireCell ( fhicl::ParameterSet const &  p)
explicit

Definition at line 91 of file MergeWireCell_module.cc.

91  :
92  fInput(p.get<std::string>("WireCellInput"))
93 {
94  // Call appropriate produces<>() functions here.
95  produces<std::vector<recob::Hit> >();
96  produces<std::vector<recob::SpacePoint> >();
97  produces<art::Assns<recob::Hit, recob::SpacePoint> >();
98  produces<std::vector<recob::Track> >();
99  produces<std::vector<recob::Shower> >();
100  produces<art::Assns<recob::Track, recob::Hit> >();
101  produces<art::Assns<recob::Track, recob::SpacePoint> >();
102  produces<art::Assns<recob::Shower, recob::Hit> >();
103  produces<art::Assns<recob::Shower, recob::SpacePoint> >();
104 }
wc::MergeWireCell::MergeWireCell ( MergeWireCell const &  )
delete
wc::MergeWireCell::MergeWireCell ( MergeWireCell &&  )
delete

Member Function Documentation

void wc::MergeWireCell::beginJob ( )
overridevirtual

Reimplemented from art::EDProducer.

Definition at line 420 of file MergeWireCell_module.cc.

421 {
422  // Implementation of optional member function here.
423 }
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::EDProducer::currentContext ( ) const
protectedinherited

Definition at line 120 of file EDProducer.cc.

References art::EDProducer::current_context_.

121  {
122  return current_context_.get();
123  }
CPC_exempt_ptr current_context_
Definition: EDProducer.h:116
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 }
template<typename PROD , BranchType B>
ProductID art::EDProducer::getProductID ( std::string const &  instanceName = {}) const
inlineinherited

Definition at line 123 of file EDProducer.h.

References art::EDProducer::moduleDescription_.

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

Definition at line 56 of file ProducerBase.h.

References B, and art::ModuleDescription::moduleLabel().

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

58  {
59  auto const& pd =
60  get_ProductDescription<PROD>(B, md.moduleLabel(), instanceName);
61  return pd.productID();
62  }
Int_t B
Definition: plot.C:25
void wc::MergeWireCell::MakeShowers ( art::Event evt,
std::unique_ptr< std::vector< recob::Shower >> &  shw_coll,
std::unique_ptr< art::Assns< recob::Shower, recob::Hit >> &  shwhassn,
std::unique_ptr< art::Assns< recob::Shower, recob::SpacePoint >> &  shwsassn,
std::unique_ptr< std::vector< recob::Hit >> &  hit_coll,
std::unique_ptr< std::vector< recob::SpacePoint >> &  spt_coll,
std::vector< int > &  index,
TTree *  tree 
)

Definition at line 377 of file MergeWireCell_module.cc.

References util::CreateAssn(), hits(), util::kBogusD, nentries, and tmp.

384  {
385  Int_t npoints;
386  Int_t showerid;
387  Int_t msc_id[1000]; //[npoints]
388 
389  tree->SetBranchAddress("npoints", &npoints);
390  tree->SetBranchAddress("showerid", &showerid);
391  tree->SetBranchAddress("msc_id", msc_id);
392 
393  Long64_t nentries = tree->GetEntriesFast();
394 
395  for (Long64_t i=0; i<nentries; ++i) {
396  tree->GetEntry(i);
397  TVector3 v1(0,0,0);
398  std::vector< double > tmp(2, util::kBogusD);
399  int bestplane = -1;
400  std::vector<size_t> hits;
401  std::vector<size_t> spts;
402  for (int i = 0; i<npoints; ++i){
403  for (size_t j = 0; j<index.size(); ++j){
404  if (index[j]==msc_id[i]){
405  spts.push_back(j);
406  hits.push_back(3*j);
407  hits.push_back(3*j+1);
408  hits.push_back(3*j+2);
409  }
410  }
411  }
412  shw_coll->push_back(recob::Shower(v1, v1, v1, v1, tmp, tmp, tmp, tmp, bestplane, showerid));
413  // make associations between the track and space points
414  util::CreateAssn(*this, evt, *shw_coll, *spt_coll, *shwsassn, spts);
415  // make associations between the track and hits
416  util::CreateAssn(*this, evt, *shw_coll, *hit_coll, *shwhassn, hits);
417  }
418 }
Float_t tmp
Definition: plot.C:37
void hits()
Definition: readHits.C:15
bool CreateAssn(PRODUCER const &prod, art::Event &evt, std::vector< T > const &a, art::Ptr< U > const &b, art::Assns< U, T > &assn, std::string a_instance, size_t indx=UINT_MAX)
Creates a single one-to-one association.
Int_t nentries
Definition: comparison.C:29
constexpr double kBogusD
obviously bogus double value
void wc::MergeWireCell::MakeTracks ( art::Event evt,
std::unique_ptr< std::vector< recob::Track >> &  trk_coll,
std::unique_ptr< art::Assns< recob::Track, recob::Hit >> &  trkhassn,
std::unique_ptr< art::Assns< recob::Track, recob::SpacePoint >> &  trksassn,
std::unique_ptr< std::vector< recob::Hit >> &  hit_coll,
std::unique_ptr< std::vector< recob::SpacePoint >> &  spt_coll,
std::vector< int > &  index,
TTree *  tree 
)

Definition at line 321 of file MergeWireCell_module.cc.

References util::CreateAssn(), hits(), util::kBogusD, nentries, x, y, and z.

328  {
329  Int_t npoints;
330  Int_t trackid;
331  Int_t msc_id[1000]; //[npoints]
332  Double_t x[1000]; //[npoints]
333  Double_t y[1000]; //[npoints]
334  Double_t z[1000]; //[npoints]
335  Double_t theta[1000]; //[npoints]
336  Double_t phi[1000]; //[npoints]
337 
338  tree->SetBranchAddress("npoints", &npoints);
339  tree->SetBranchAddress("trackid", &trackid);
340  tree->SetBranchAddress("msc_id", msc_id);
341  tree->SetBranchAddress("x", x);
342  tree->SetBranchAddress("y", y);
343  tree->SetBranchAddress("z", z);
344  tree->SetBranchAddress("theta", theta);
345  tree->SetBranchAddress("phi", phi);
346 
347  Long64_t nentries = tree->GetEntriesFast();
348 
349  for (Long64_t i=0; i<nentries; ++i) {
350  tree->GetEntry(i);
351  std::vector<TVector3> xyz;
352  std::vector<TVector3> dircos;
353  std::vector< std::vector<double> > dQdx;
354  std::vector<double> mom(2, util::kBogusD);
355  std::vector<size_t> hits;
356  std::vector<size_t> spts;
357  for (int i = 0; i<npoints; ++i){
358  xyz.push_back(TVector3(x[i],y[i],z[i]));
359  dircos.push_back(TVector3(sin(theta[i])*cos(phi[i]),sin(theta[i])*sin(phi[i]),cos(theta[i])));
360  for (size_t j = 0; j<index.size(); ++j){
361  if (index[j]==msc_id[i]){
362  spts.push_back(j);
363  hits.push_back(3*j);
364  hits.push_back(3*j+1);
365  hits.push_back(3*j+2);
366  }
367  }
368  }
369  trk_coll->push_back(recob::Track(xyz, dircos, dQdx, mom, trackid));
370  // make associations between the track and space points
371  util::CreateAssn(*this, evt, *trk_coll, *spt_coll, *trksassn, spts);
372  // make associations between the track and hits
373  util::CreateAssn(*this, evt, *trk_coll, *hit_coll, *trkhassn, hits);
374  }
375 }
Float_t x
Definition: compare.C:6
Float_t y
Definition: compare.C:6
Double_t z
Definition: plot.C:279
void hits()
Definition: readHits.C:15
bool CreateAssn(PRODUCER const &prod, art::Event &evt, std::vector< T > const &a, art::Ptr< U > const &b, art::Assns< U, T > &assn, std::string a_instance, size_t indx=UINT_MAX)
Creates a single one-to-one association.
Int_t nentries
Definition: comparison.C:29
constexpr double kBogusD
obviously bogus double value
Track from a non-cascading particle.A recob::Track consists of a recob::TrackTrajectory, plus additional members relevant for a "fitted" track:
Definition: Track.h:51
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::ProducerBase::modifiesEvent ( ) const
inlineinherited

Definition at line 40 of file ProducerBase.h.

References art::ProducerBase::getProductID().

41  {
42  return true;
43  }
MergeWireCell& wc::MergeWireCell::operator= ( MergeWireCell const &  )
delete
MergeWireCell& wc::MergeWireCell::operator= ( MergeWireCell &&  )
delete
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::MergeWireCell::produce ( art::Event e)
overridevirtual

Implements art::EDProducer.

Definition at line 106 of file MergeWireCell_module.cc.

References util::CreateAssn(), art::EventID::event(), f, file, fInput, art::Event::id(), geo::GeometryCore::PlaneWireToChannel(), art::Event::put(), art::Event::run(), geo::GeometryCore::SignalType(), Sqrt2Pi, art::Event::subRun(), geo::GeometryCore::View(), xx, and zz.

106  {
107 
109 
110  int run = evt.run();
111  int subrun = evt.subRun();
112  int event = evt.id().event();
113 
114  std::unique_ptr<std::vector<recob::Hit>> hit_coll(new std::vector<recob::Hit>);
115  std::unique_ptr<std::vector<recob::SpacePoint>> spt_coll(new std::vector<recob::SpacePoint>);
116  std::unique_ptr<art::Assns<recob::SpacePoint, recob::Hit> > shassn(new art::Assns<recob::SpacePoint, recob::Hit>);
117  std::unique_ptr<std::vector<recob::Track>> trk_coll(new std::vector<recob::Track>);
118  std::unique_ptr<art::Assns<recob::Track, recob::Hit>> trkhassn(new art::Assns<recob::Track, recob::Hit>);
119  std::unique_ptr<art::Assns<recob::Track, recob::SpacePoint>> trksassn(new art::Assns<recob::Track, recob::SpacePoint>);
120  std::unique_ptr<std::vector<recob::Shower>> shw_coll(new std::vector<recob::Shower>);
121  std::unique_ptr<art::Assns<recob::Shower, recob::Hit>> shwhassn(new art::Assns<recob::Shower, recob::Hit>);
122  std::unique_ptr<art::Assns<recob::Shower, recob::SpacePoint>> shwsassn(new art::Assns<recob::Shower, recob::SpacePoint>);
123 
124  std::string path(fInput);
125  path=(path+"/");
126 
127  DIR *pDIR;
128  struct dirent *entry;
129  if( (pDIR=opendir(path.c_str())) != NULL ){
130 
131  while((entry = readdir(pDIR)) != NULL){
132 
133  if( strcmp(entry->d_name, ".")==0 || strcmp(entry->d_name, "..")==00) continue;
134 
135  std::string filename(entry->d_name);
136  if((int)filename.find(".root")==-1)
137  continue;
138 
139  std::string file = (path + entry->d_name);
140  TFile *f = new TFile(file.c_str());
141  TTree *Trun = (TTree*)f->Get("Trun");
142  int eventNo, runNo, subRunNo;
143  Trun->SetBranchAddress("eventNo",&eventNo);
144  Trun->SetBranchAddress("runNo",&runNo);
145  Trun->SetBranchAddress("subRunNo",&subRunNo);
146  if (!Trun->GetEntries()) continue;
147  Trun->GetEntry(0);
148  //std::cout<<run<<" "<<subrun<<" "<<event<<" "<<runNo<<" "<<subRunNo<<" "<<eventNo<<std::endl;
149  if (runNo!=run||eventNo!=event||subRunNo!=subrun) {
150  f->Close();
151  continue;
152  }
153  TTree *TC = (TTree*)f->Get("TC");
154  Int_t time_slice;
155  Double_t charge;
156  Double_t xx;
157  Double_t yy;
158  Double_t zz;
159  Int_t u_index;
160  Int_t v_index;
161  Int_t w_index;
162  Double_t u_charge;
163  Double_t v_charge;
164  Double_t w_charge;
165  Double_t u_charge_err;
166  Double_t v_charge_err;
167  Double_t w_charge_err;
168  Int_t tpc_no;
169  Int_t cryostat_no;
170  Int_t mcell_id;
171 
172  TC->SetBranchAddress("time_slice", &time_slice);
173  TC->SetBranchAddress("charge", &charge);
174  TC->SetBranchAddress("xx", &xx);
175  TC->SetBranchAddress("yy", &yy);
176  TC->SetBranchAddress("zz", &zz);
177  TC->SetBranchAddress("u_index", &u_index);
178  TC->SetBranchAddress("v_index", &v_index);
179  TC->SetBranchAddress("w_index", &w_index);
180  TC->SetBranchAddress("u_charge", &u_charge);
181  TC->SetBranchAddress("v_charge", &v_charge);
182  TC->SetBranchAddress("w_charge", &w_charge);
183  TC->SetBranchAddress("u_charge_err", &u_charge_err);
184  TC->SetBranchAddress("v_charge_err", &v_charge_err);
185  TC->SetBranchAddress("w_charge_err", &w_charge_err);
186  TC->SetBranchAddress("cryostat_no", &cryostat_no);
187  TC->SetBranchAddress("mcell_id",&mcell_id);
188 
189  TC->GetDirectory()->Print();
190 
191 // TC->SetBranchAddress("cell.tpc_no", &tpc_no);
192 
193  TObjArray* leafList = TC->GetListOfLeaves();
194 
195  for(int idx = 0; idx < leafList->GetEntries(); idx++)
196  {
197  leafList->At(idx)->Print();
198  }
199 
200  TObject* candObj = leafList->FindObject("tpc_no");
201 
202  std::cout << "candObj: " << candObj << std::endl;
203 
204  TLeaf* candLeaf = (TLeaf*)candObj;
205  candLeaf->Print();
206  candLeaf->SetAddress(&tpc_no);
207 
208  std::vector<int> vcell_id;
209 
210  for (int i = 0; i<TC->GetEntries(); ++i){
211  TC->GetEntry(i);
212 
213  tpc_no = candLeaf->GetTypedValue<Int_t>(i) - 1;
214 
215  vcell_id.push_back(mcell_id);
216  double xyz[3] = {xx,yy,zz};
217  double err[3] = {0,0,0};
218  spt_coll->push_back(recob::SpacePoint(xyz,err,charge));
219  geo::WireID wireu(cryostat_no,tpc_no,0,u_index);
220  raw::ChannelID_t chanu = geom->PlaneWireToChannel(wireu);
221  geo::WireID wirev(cryostat_no,tpc_no,1,v_index);
222  raw::ChannelID_t chanv = geom->PlaneWireToChannel(wirev);
223  geo::WireID wirew(cryostat_no,tpc_no,2,w_index);
224  raw::ChannelID_t chanw = geom->PlaneWireToChannel(wirew);
225  size_t hitStart = hit_coll->size();
226 // raw::TDCtick_t start_tick = time_slice*4;
227 // raw::TDCtick_t end_tick = (time_slice+1)*4;
228 // float peak_time = (time_slice+0.5)*4;
229 // float sigma_peak = 2.0;
230 // float rms = 2.0;
231 // float peak_ampu = u_charge/(Sqrt2Pi*2);
232 // float sigma_peak_a
233  hit_coll->push_back(recob::Hit(chanu,
234  time_slice*4,
235  (time_slice+1)*4,
236  (time_slice+0.5)*4,
237  2.,
238  2.,
239  u_charge/(Sqrt2Pi*2),
240  u_charge_err/(Sqrt2Pi*2),
241  u_charge,
242  u_charge,
243  u_charge_err,
244  1,
245  0,
246  0,
247  0,
248  geom->View(chanu),
249  geom->SignalType(chanu),
250  wireu));
251  hit_coll->push_back(recob::Hit(chanv,
252  time_slice*4,
253  (time_slice+1)*4,
254  (time_slice+0.5)*4,
255  2.,
256  2.,
257  v_charge/(Sqrt2Pi*2),
258  v_charge_err/(Sqrt2Pi*2),
259  v_charge,
260  v_charge,
261  v_charge_err,
262  1,
263  0,
264  0,
265  0,
266  geom->View(chanv),
267  geom->SignalType(chanv),
268  wirev));
269  hit_coll->push_back(recob::Hit(chanw,
270  time_slice*4,
271  (time_slice+1)*4,
272  (time_slice+0.5)*4,
273  2.,
274  2.,
275  w_charge/(Sqrt2Pi*2),
276  w_charge_err/(Sqrt2Pi*2),
277  w_charge,
278  w_charge,
279  w_charge_err,
280  1,
281  0,
282  0,
283  0,
284  geom->View(chanw),
285  geom->SignalType(chanw),
286  wirew));
287  size_t hitEnd = hit_coll->size();
288  util::CreateAssn(*this, evt, *spt_coll, *hit_coll, *shassn, hitStart, hitEnd);
289  }//Loop over TC
290 /*
291  TTree *T_goodtrack = (TTree*)f->Get("T_goodtrack");
292  MakeTracks(evt, trk_coll, trkhassn, trksassn, hit_coll, spt_coll, vcell_id, T_goodtrack);
293  TTree *T_shorttrack = (TTree*)f->Get("T_shorttrack");
294  MakeTracks(evt, trk_coll, trkhassn, trksassn, hit_coll, spt_coll, vcell_id, T_shorttrack);
295  TTree *T_paratrack = (TTree*)f->Get("T_paratrack");
296  MakeTracks(evt, trk_coll, trkhassn, trksassn, hit_coll, spt_coll, vcell_id, T_paratrack);
297 
298  TTree *T_shower = (TTree*)f->Get("T_shower");
299  MakeShowers(evt, shw_coll, shwhassn, shwsassn, hit_coll, spt_coll, vcell_id, T_shower);
300 */
301  f->Close();
302  break;
303  }
304  closedir(pDIR);
305 
306  }
307 
308  std::cout << "space point size: " << spt_coll->size() << ", hit coll size: " << hit_coll->size() << std::endl;
309 
310  evt.put(std::move(spt_coll));
311  evt.put(std::move(hit_coll));
312  evt.put(std::move(shassn));
313  evt.put(std::move(trk_coll));
314  evt.put(std::move(trkhassn));
315  evt.put(std::move(trksassn));
316  evt.put(std::move(shw_coll));
317  evt.put(std::move(shwhassn));
318  evt.put(std::move(shwsassn));
319 }
Double_t xx
Definition: macro.C:12
Double_t zz
Definition: plot.C:279
SigType_t SignalType(geo::PlaneID const &pid) const
Returns the type of signal on the channels of specified TPC plane.
TFile f
Definition: plotHisto.C:6
bool CreateAssn(PRODUCER const &prod, art::Event &evt, std::vector< T > const &a, art::Ptr< U > const &b, art::Assns< U, T > &assn, std::string a_instance, size_t indx=UINT_MAX)
Creates a single one-to-one association.
View_t View(geo::PlaneID const &pid) const
Returns the view (wire orientation) on the channels of specified TPC plane.
raw::ChannelID_t PlaneWireToChannel(WireID const &wireid) const
Returns the ID of the TPC channel connected to the specified wire.
TFile * file
2D representation of charge deposited in the TDC/wire plane
Definition: Hit.h:49
unsigned int ChannelID_t
Type representing the ID of a readout channel.
Definition: RawTypes.h:27
static constexpr float Sqrt2Pi
Event finding and building.
void wc::MergeWireCell::reconfigure ( fhicl::ParameterSet const &  p)

Definition at line 425 of file MergeWireCell_module.cc.

References DEFINE_ART_MODULE.

426 {
427  // Implementation of optional member function here.
428 }
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

Member Data Documentation

std::string wc::MergeWireCell::fInput
private

Definition at line 83 of file MergeWireCell_module.cc.

Referenced by produce().

constexpr float wc::MergeWireCell::Sqrt2Pi = 2.5066
staticprivate

Definition at line 85 of file MergeWireCell_module.cc.

Referenced by produce().

constexpr float wc::MergeWireCell::SqrtPi = 1.7725
staticprivate

Definition at line 86 of file MergeWireCell_module.cc.


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