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

Public Types

using WorkerType = WorkerT< EDAnalyzer >
 
using ModuleType = EDAnalyzer
 

Public Member Functions

 DBclusterAna (fhicl::ParameterSet const &pset)
 
virtual ~DBclusterAna ()
 
void analyze (const art::Event &evt)
 read access to event More...
 
void beginJob ()
 
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

TH1F * fNoParticles_pdg
 
TH1F * fNoParticles_trackid
 
TH1F * fNoParticles_trackid_mother
 
TH1F * fNoParticles_trackid_per_event
 
TH1F * fNoParticles_pdg_per_event
 
TH1F * fCl_for_Muon
 
TH1F * fNoClustersInEvent
 
TH1F * fPercentNoise
 
TH1F * fno_of_clusters_per_track
 
TH1F * fPercent_lost_muon_hits
 
TH1F * fPercent_lost_electron_hits
 
TH1F * fPercent_lost_positron_hits
 
TH1F * fPercent_lost_111_hits
 
TH1F * fPercent_lost_211_hits
 
TH1F * fPercent_lost_m211_hits
 
TH1F * fPercent_lost_2212_hits
 
TH1F * fPercent_lost_2112_hits
 
TH1F * fPercent_lost_muon_energy
 
TH1F * fPercent_lost_electron_energy
 
TH1F * fPercent_lost_positron_energy
 
TH1F * fPercent_lost_111_energy
 
TH1F * fPercent_lost_211_energy
 
TH1F * fPercent_lost_m211_energy
 
TH1F * fPercent_lost_2212_energy
 
TH1F * fPercent_lost_2112_energy
 
TH1F * fEnergy
 
TH2F * fbrian_in
 
TH2F * fbrian_coll
 
std::string fDigitModuleLabel
 
std::string fHitsModuleLabel
 
std::string fLArG4ModuleLabel
 
std::string fClusterFinderModuleLabel
 
std::string fCalDataModuleLabel
 
std::string fGenieGenModuleLabel
 

Detailed Description

Definition at line 63 of file DBclusterAna_module.cc.

Member Typedef Documentation

Definition at line 39 of file EDAnalyzer.h.

Definition at line 38 of file EDAnalyzer.h.

Constructor & Destructor Documentation

cluster::DBclusterAna::DBclusterAna ( fhicl::ParameterSet const &  pset)
explicit

Definition at line 129 of file DBclusterAna_module.cc.

130  : EDAnalyzer(pset)
131  , fDigitModuleLabel (pset.get< std::string >("DigitModuleLabel") )
132  , fHitsModuleLabel (pset.get< std::string >("HitsModuleLabel") )
133  , fLArG4ModuleLabel (pset.get< std::string >("LArGeantModuleLabel") )
134  , fClusterFinderModuleLabel (pset.get< std::string >("ClusterFinderModuleLabel"))
135  , fCalDataModuleLabel (pset.get< std::string >("CalDataModuleLabel") )
136  , fGenieGenModuleLabel (pset.get< std::string >("GenieGenModuleLabel") )
137  {
138 
139 
140  }
EDAnalyzer(Table< Config > const &config)
Definition: EDAnalyzer.h:100
cluster::DBclusterAna::~DBclusterAna ( )
virtual

Definition at line 143 of file DBclusterAna_module.cc.

144  {
145 
146  }

Member Function Documentation

void cluster::DBclusterAna::analyze ( const art::Event evt)

read access to event

Definition at line 200 of file DBclusterAna_module.cc.

References sim::ParticleList::at(), sim::ParticleList::begin(), DEFINE_ART_MODULE, sim::ParticleList::end(), art::EventID::event(), fCalDataModuleLabel, fCl_for_Muon, fClusterFinderModuleLabel, fDigitModuleLabel, fGenieGenModuleLabel, fHitsModuleLabel, art::fill_ptr_vector(), fno_of_clusters_per_track, fNoClustersInEvent, fNoParticles_pdg, fNoParticles_pdg_per_event, fNoParticles_trackid, fNoParticles_trackid_mother, fNoParticles_trackid_per_event, fPercent_lost_111_energy, fPercent_lost_111_hits, fPercent_lost_2112_energy, fPercent_lost_2112_hits, fPercent_lost_211_energy, fPercent_lost_211_hits, fPercent_lost_2212_energy, fPercent_lost_2212_hits, fPercent_lost_electron_energy, fPercent_lost_electron_hits, fPercent_lost_m211_energy, fPercent_lost_m211_hits, fPercent_lost_muon_energy, fPercent_lost_muon_hits, fPercent_lost_positron_energy, fPercent_lost_positron_hits, fPercentNoise, art::DataViewImpl::getByLabel(), simb::MCTruth::GetParticle(), hits(), cheat::BackTrackerService::HitToEveTrackIDEs(), cheat::BackTrackerService::HitToTrackIDEs(), art::Event::id(), art::Event::isRealData(), simb::MCTruth::NParticles(), geo::GeometryCore::Nplanes(), part, cheat::ParticleInventoryService::ParticleList(), simb::MCParticle::PdgCode(), geo::GeometryCore::Plane(), art::PtrVector< T >::push_back(), art::Event::run(), cheat::ParticleInventoryService::SetEveIdCalculator(), art::PtrVector< T >::size(), and geo::PlaneGeo::View().

201  {
202 
203  std::cout << "run : " << evt.run() << std::endl;
204  //std::cout << "subrun : " << evt.subRun() << std::endl; // Doesn't compile w. or w.o. id().
205  std::cout << "event : " << evt.id().event() << std::endl;
206  //----------------------------------------------------------------
207 
208  /* This is basically a module for studying MC efficiency/purity. Kick out now if not MC. EC, 8-Oct-2010 */
209  if (evt.isRealData())
210  {
211  std::cout<<"**** DBclusterAna: Bailing. Don't call this module if you're not MC. "<<std::endl;
212  exit (1);
213  }
214 
218 
220  evt.getByLabel(fDigitModuleLabel,rdListHandle);
221  art::Handle< std::vector<recob::Hit> > hitListHandle;
222  evt.getByLabel(fHitsModuleLabel,hitListHandle);
223  art::Handle< std::vector<simb::MCTruth> > mctruthListHandle;
224  evt.getByLabel(fGenieGenModuleLabel,mctruthListHandle);
225  art::Handle< std::vector<recob::Cluster> > clusterListHandle;
226  evt.getByLabel(fClusterFinderModuleLabel,clusterListHandle);
227  art::Handle< std::vector<recob::Wire> > wireListHandle;
228  evt.getByLabel(fCalDataModuleLabel,wireListHandle);
229 
230  art::FindManyP<recob::Hit> fmh(clusterListHandle, evt, fClusterFinderModuleLabel);
231 
232  //----------------------------------------------------------------
233 
234  //----------------------------------------------------------------
235 
237 
238  for (size_t ii = 0; ii < rdListHandle->size(); ++ii){
239  art::Ptr<raw::RawDigit> rawdigit(rdListHandle,ii);
240  rawdigits.push_back(rawdigit);
241  }
242 
243  //get the simb::MCParticle collection from the art::Event and then use the
244  //Simulation/SimListUtils object to create a sim::ParticleList from the art::Event.
246 
247  sim::ParticleList const& _particleList = pi_serv->ParticleList();
248 
249  std::vector<int> mc_trackids;
250 
251  //check_particleList(_particleList[0]);
252  //std::cout<<"checking trackID: ";
253  for ( auto i = _particleList.begin(); i != _particleList.end(); ++i ){
254  int trackID = (*i).first;
255  mc_trackids.push_back(trackID);
256  }
257 
258  // std::cout<<std::endl;
259  // std::cout<<" Track ID list from MC: "<<std::endl;
260  // for(unsigned int i=0;i<mc_trackids.size();++i){
261 
262  // std::cout<<mc_trackids[i]<<" ";
263 
264  // }
265  // std::cout<<"I have in total "<<mc_trackids.size()<<" different tracks"<<std::endl;
266 
267 
268  //----------------------------------------------------------------
270  for (size_t ii = 0; ii < mctruthListHandle->size(); ++ii){
271  art::Ptr<simb::MCTruth> mctparticle(mctruthListHandle,ii);
272  mclist.push_back(mctparticle);
273  }
274 
275  // art::PtrVector<recob::Hit> hits;
276  // for (unsigned int ii = 0; ii < hitListHandle->size(); ++ii)
277  // {
278  // art::Ptr<recob::Hit> hitHolder(hitListHandle,ii);
279  // hits.push_back(hitHolder);
280  // }
281  //--------------------------------------------------
282  std::vector< art::Ptr<recob::Hit> > hits_vec;
283 
284  //--------------------------------------------------
285  std::vector< art::Ptr<recob::Hit> > hits;
286  art::fill_ptr_vector(hits, hitListHandle);
287  //---------------------------------------------------
288 
290  for (unsigned int ii = 0; ii < clusterListHandle->size(); ++ii){
291  art::Ptr<recob::Cluster> clusterHolder(clusterListHandle,ii);
292  clusters.push_back(clusterHolder);
293  }
294 
295  std::cout<<"in Efficiency, clusters.size()= "<<clusters.size()<<std::endl;
296 
297  //---------------------------------------------------------------
299 
300  for (size_t ii = 0; ii < wireListHandle->size(); ++ii){
301  art::Ptr<recob::Wire> wireHolder(wireListHandle,ii);
302 
303  wirelist.push_back(wireHolder);
304 
305  }
306 
307 
308 
309  //...........................................................................
310  // How many different particles do we have in a cluster???
311  // -- I will answer that by 3 methods
312  // 1) count different TrackIDs in each cluster
313  // 2) count different TrackIDs in each cluster with the use of "Mother" to get rid of the ones that just randomly got their TrackIDs changed by Geant4
314  // 3) count different pdg codes in each cluster <--probably not very good b/c if you have 2 "different" electrons in a cluster it's going to count them as one.
315  //..........................................................................
316  // How many clusters it takes to contain a particle???
317  // take each TrackID and count in how many clusters it appears
318  //.........................................................................
319 
320  double no_of_particles_in_cluster=0;
321  double sum_vec_trackid=0;
322  double no_of_clusters=0;
323  double total_no_hits_in_clusters=0;
324  //unsigned int plane=0;
325  art::Ptr<raw::RawDigit > _rawdigit;
326  art::Ptr<raw::RawDigit > _rawdigit2;
327  std::vector<int> vec_pdg;
328  std::vector<int> vec_trackid,vec_trackid_mother, vec_trackid_mother_en;
329  std::vector<int> all_trackids;
330  std::vector<int> ids;
331  std::vector<int>::iterator it,it2,it3,it4,it5,it6,it7,it8;
332  int no_cl_for_muon=0;
333  int no_cl_for_electron=0;
334  int no_cl_for_positron=0;
335  int no_cl_for_pion_111=0;
336  int no_cl_for_pion_211=0;
337  int no_cl_for_pion_m211=0;
338  int no_cl_for_proton=0;
339  double noCluster=0;
340  // int muon=0,electron=0,positron=0,pion=0;
341  double _hit_13=0,_hit_11=0,_hit_m_11=0,_hit_111=0,_hit_211=0,_hit_m211=0,_hit_2212=0,_hit_2112=0;
342  double _en_13=0,_en_11=0,_en_m11=0,_en_111=0,_en_211=0,_en_m211=0,_en_2212=0,_en_2112=0;
343  std::vector<double> diff_vec;
344 
345  double hit_energy=0;
346  double total_Q_cluster_hits=0;
347 
348 
349  /*
350  for(unsigned int i = 0; i < hits.size(); ++i) {
351  std::cout<<"channel: "<<hits[i]->Wire()->RawDigit()->Channel()<<" time= "<<(hits[i]->StartTime()+hits[i]->EndTime())/2.<<" X time= "<<hits[i]-> CrossingTime()<<std::endl;
352  }
353  */
354 
355  if(clusters.size()!=0 && hits.size()!=0){
356  for(unsigned int plane=0;plane<geom->Nplanes();++plane){
357  geo::View_t view = geom->Plane(plane).View();
358  //art::PtrVector<recob::Cluster>::const_iterator clusterIter = clusters.begin();
359  for(size_t j = 0; j < clusters.size(); ++j){
360 
361  // std::cout<<"I AM ON PLANE #"<<plane<<std::endl;
362  if( clusters[j]->View() == view){
363 
364  //std::cout<<"working on cluster # "<<j<<std::endl;
365  std::vector< art::Ptr<recob::Hit> > _hits = fmh.at(j);
366  art::Ptr<recob::Hit> _hits_ptr; //
367 
368  //delete
369  //std::cout<<"_hits.size()= "<<_hits.size()<<std::endl;
370  for(size_t p = 0; p<_hits.size(); ++p){
371  _hits_ptr=_hits[p];
372  hits_vec.push_back(_hits_ptr);
373  //std::cout<<"hit # "<<p<<" charge= "<<_hits[p]->Integral()<<std::endl;
374  total_Q_cluster_hits += _hits[p]->Integral();
375  }
376 
377 
378  std::vector< art::Ptr<recob::Hit> >::iterator itr = hits_vec.begin();
379 
380 
381  //std::cout<<"hits_vec.size()= "<<hits_vec.size()<<std::endl;
382  while(itr != hits_vec.end()) {
383  //std::cout<<"working on hit # "<<itr-hits_vec.begin()<<" charge= "<<_hits[itr-hits_vec.begin()]->Integral()<<std::endl;
384  diff_vec.clear();
385  //std::cout<<"same?, q= "<<hits_vec[itr-hits_vec.begin()]->Integral()<<std::endl;
386 
387  hit_energy=_hits[itr-hits_vec.begin()]->Integral();
388 
389  std::vector<sim::TrackIDE> trackides = bt_serv->HitToTrackIDEs(*itr);
390 
391  std::vector<sim::TrackIDE> eveides = bt_serv->HitToEveTrackIDEs(*itr);
392 
393  std::vector<sim::TrackIDE>::iterator idesitr = trackides.begin();
394 
395  while( idesitr != trackides.end() ){
396 
397  //int eveID = _particleList.EveId( (*idesitr).trackID );
398 
399  // std::cout<<"track id: " << (*idesitr).trackID<<" contributed " << (*idesitr).energyFrac<< " to the current hit and has eveID: " << eveID<<std::endl;
400 
401  // double energy=voxelData.Energy(i);
402  // std::cout<<"check4-3"<<std::endl;
403  // std::cout<<"energy= "<<energy<<std::endl;
404  // fEnergy->Fill(energy);
405 
406  vec_trackid.push_back((*idesitr).trackID);
407 
408  //for( unsigned int i=0; i<_particleList.size(); ++i )
409  // {
410  // // const sim::ParticleList* particleList = _particleList[i];
411  // //particleList = _particleList[i];
412  //
413  //
414  // // double energyTrackID=voxelData.Energy[trackID];
415  // // std::cout<<"ENERGY OF PRIMARY TRACKID= "<<energyTrackID<<std::endl;
416  const simb::MCParticle* particle = _particleList.at( (*idesitr).trackID);
417  //
418  int pdg = particle->PdgCode();
419  // std::cout<<"pdg= "<<pdg<<std::endl;
420  //
421  // double energy2=voxelData.Energy(i);
422  // // std::cout<<"energy2= "<<energy2<<std::endl;
423  //
424  // // std::cout<<"part eng= "<<particle->E()<<std::endl;
425  if(pdg==13 || pdg==-13){
426  _hit_13++;
427  _en_13+=hit_energy*((*idesitr).energyFrac);
428  // std::cout<<"_en_13= "<<_en_13<<std::endl;
429  }
430  // if(pdg==11){_hit_11++;
431  // _en_11+=energy2;
432  // // std::cout<<"in clus: _en_11="<<_en_11<<std::endl;
433  // }
434  // if(pdg==-11){_hit_m_11++;
435  // _en_m11+=energy2;}
436  // if(pdg==111){_hit_111++;
437  // _en_111+=energy2;}
438  // if(pdg==22){_hit_22++;
439  // _en_22+=energy2;}
440  // if(pdg==211){_hit_211++;
441  // _en_211+=energy2;}
442  // if(pdg==-211){_hit_m211++;
443  // _en_m211+=energy2;}
444  // if(pdg==2212){_hit_2212++;
445  // _en_2212+=energy2;}
446  // if(pdg==2112){_hit_2112++;
447  // _en_2112+=energy2;}
448  //
449  // //std::cout<<"True PDG= "<<pdg<<std::endl;
450  // vec_pdg.push_back(pdg);
451  // // std::cout<<"_en_11= "<<_en_11<<std::endl;
452  // //while particle is not a primary particle and going up in a chain of trackIDs is not going to change its pdg code, go up the chain.
453  // while ( (! _particleList.IsPrimary( trackID )) && (((_particleList.at(particle->Mother()))->PdgCode())==pdg))
454  // {
455  // trackID = particle->Mother();
456  // //std::cout<<"((NOt a PRIMARY ORIGINALLY!!! ) trackID= "<<trackID<<std::endl;
457  // particle = _particleList.at( trackID );
458  // pdg= particle->PdgCode();
459  // // std::cout<<"(NOt a PRIMARY ORIGINALLY!!! ) The PDG from HIT is: "<<pdg<<std::endl;
460  //
461  // }
462  //
463  // // std::cout<<"The PDG from HIT is: "<<pdg<<std::endl;
464  // //std::cout<<"after mother trackid= "<<trackID<<std::endl;
465  // vec_trackid_mother.push_back(trackID);
466  // if(energy>(7e-5)){ vec_trackid_mother_en.push_back(trackID);}
467  // }
468 
469 
470 
471  idesitr++;
472 
473  }
474 
476 
477  // int numberPrimaries = particleList->NumberOfPrimaries();
478  // std::cout<<"no of PRIMARIES: "<<numberPrimaries<<std::endl;
479  // for ( int i = 0; i != numberPrimaries; ++i )
480  // {
481  // const simb::MCParticle* primaryParticle = particleList->Primary(i);
482  // int trackID = primaryParticle->TrackId();
483  // std::cout<<"from PRIMARY trackID= "<<trackID<<std::endl;
484  // double energy=voxelData.Energy[trackID];
485  // std::cout<<"ENERGY OF PRIMARY TRACKID= "<<energy<<std::endl;
486  // }
487 
489 
490  // std::cout<<"check--3"<<std::endl;
491 
492  itr++;
493 
494  }//loop thru hits
495  //std::cout<<"check--4"<<std::endl;
496 
497  // std::cout<<"vec_pdg("<<vec_pdg.size()<<")= " ;
498  for(unsigned int i=0;i<vec_pdg.size();++i){
499 
500  // std::cout<<vec_pdg[i]<<" ";
501 
502  }
503  //std::cout<<std::endl;
504  // std::cout<<"vec_trackid("<<vec_trackid.size()<<")= ";
505  // for(unsigned int ii=0;ii<vec_trackid.size();++ii){
506 
507  // std::cout<<vec_trackid[ii]<<" ";
508 
509  // }
510 
511  // std::cout<<"vec_trackid_mother("<<vec_trackid_mother.size()<<")= ";
512  // for(unsigned int ii=0;ii<vec_trackid_mother.size();++ii){
513 
514  // std::cout<<vec_trackid_mother[ii]<<" ";
515 
516  // }
517 
518 
519  it=find(vec_pdg.begin(),vec_pdg.end(),13);
520  if(it!=vec_pdg.end()){
521  // std::cout<<"matched found at position="<<int(it-vec_pdg.begin())<<std::endl;
522  no_cl_for_muon++;
523  }
524  else{
525  // std::cout<<"no match!"<<std::endl;
526  }
527 
528  it2=find(vec_pdg.begin(),vec_pdg.end(),11);
529  if(it2!=vec_pdg.end()){
530  no_cl_for_electron++;
531  }
532 
533  it3=find(vec_pdg.begin(),vec_pdg.end(),-11);
534  if(it3!=vec_pdg.end()){
535  no_cl_for_positron++;
536  }
537 
538  it4=find(vec_pdg.begin(),vec_pdg.end(),111);
539  if(it4!=vec_pdg.end()){
540  no_cl_for_pion_111++;
541  }
542  it6=find(vec_pdg.begin(),vec_pdg.end(),211);
543  if(it6!=vec_pdg.end()){
544  no_cl_for_pion_211++;
545  }
546  it7=find(vec_pdg.begin(),vec_pdg.end(),-211);
547  if(it7!=vec_pdg.end()){
548  no_cl_for_pion_m211++;
549  }
550  it8=find(vec_pdg.begin(),vec_pdg.end(),2212);
551  if(it8!=vec_pdg.end()){
552  no_cl_for_proton++;
553  }
554 
555  // std::cout<<std::endl;
556  //std::cout<<"numberParticles= "<<numberParticles<<std::endl;
557  // std::cout<<"size of vec_pdg= "<<vec_pdg.size()<<std::endl;
558  sort( vec_pdg.begin(), vec_pdg.end() );
559  vec_pdg.erase( unique( vec_pdg.begin(), vec_pdg.end() ), vec_pdg.end() );
560  // std::cout<<" NO OF PARTICLES IN THIS CLUSTER IS: "<<vec_pdg.size()<<std::endl;
561  // std::cout<<"They are: ";
562  // for(unsigned int ii=0;ii<vec_pdg.size();++ii){
563  // std::cout<<vec_pdg[ii]<<" ";
564  // }
565  // std::cout<<std::endl;
566 
567  //same for vec_trackid:
568 
569  sort( vec_trackid.begin(), vec_trackid.end() );
570  vec_trackid.erase( unique( vec_trackid.begin(), vec_trackid.end() ), vec_trackid.end() );
571  // std::cout<<" NO OF DIFFERENT TRACKIDS IN THIS CLUSTER IS: "<<vec_trackid.size()<<std::endl;
572  // std::cout<<"They are: ";
573  for(unsigned int ii=0;ii<vec_trackid.size();++ii){
574  // std::cout<<vec_trackid[ii]<<" ";
575  all_trackids.push_back(vec_trackid[ii]);
576  //mytracklist.push_back(vec_trackid[i]);
577  }
578  // std::cout<<std::endl;
579  //...............................................................
580  //Also Make vec_trackid_mother unique:
581 
582  sort( vec_trackid_mother.begin(), vec_trackid_mother.end() );
583  vec_trackid_mother.erase( unique( vec_trackid_mother.begin(), vec_trackid_mother.end() ), vec_trackid_mother.end() );
584  // std::cout<<" NO OF DIFFERENT TRACKIDS_MOTHER IN THIS CLUSTER IS: "<<vec_trackid_mother.size()<<std::endl;
585  // std::cout<<"They are: ";
586  /*
587  for(unsigned int ii=0;ii<vec_trackid_mother.size();++ii){
588  std::cout<<vec_trackid_mother[ii]<<" ";
589 
590  }
591  */
592  // std::cout<<std::endl;
593 
594  //........................................................................
595 
596  //Also Make vec_trackid_mother_en unique:
597 
598  sort( vec_trackid_mother_en.begin(), vec_trackid_mother_en.end() );
599  vec_trackid_mother_en.erase( unique( vec_trackid_mother_en.begin(), vec_trackid_mother_en.end() ), vec_trackid_mother_en.end() );
600  // std::cout<<" NO OF DIFFERENT TRACKIDS_MOTHER_en IN THIS CLUSTER IS: "<<vec_trackid_mother_en.size()<<std::endl;
601  // std::cout<<"They are: ";
602  /*
603  for(unsigned int ii=0;ii<vec_trackid_mother_en.size();++ii){
604  std::cout<<vec_trackid_mother_en[ii]<<" ";
605 
606  }
607  */
608  // std::cout<<std::endl;
609 
610  //........................................................................
611 
612 
613  // Q: How many clusters it takes to contain a certain particle?
614  for(unsigned int ii=0;ii<mc_trackids.size();++ii){
615  it5=find(vec_trackid.begin(),vec_trackid.end(),mc_trackids[ii]);
616  if(it5!=vec_trackid.end()){
617  // std::cout<<"found match for: "<<mc_trackids[ii]<<" at position: "<<it5-vec_trackid.begin()<<std::endl;
618  ids.push_back(mc_trackids[ii]);//then make it unique
619  noCluster++;
620  }
621  }
622 
623  // std::cout<<"noCluster = "<< noCluster<<std::endl;
624 
625 
626 
627 
628  fNoParticles_pdg->Fill(vec_pdg.size());
629 
630  // std::cout<<"LOOK ->> vec_trackid.size()= "<<vec_trackid.size()<<std::endl;
631  fNoParticles_trackid->Fill(vec_trackid.size());
632 
633  fNoParticles_trackid_mother->Fill(vec_trackid_mother.size());
634 
635  no_of_clusters++;
636  // std::cout<<"MUON IS CONTAINED IN "<<no_cl_for_muon<<" CLUSTERS"<<std::endl;
637 
638  no_of_particles_in_cluster+=vec_pdg.size();
639  sum_vec_trackid+=vec_trackid_mother.size();
640  total_no_hits_in_clusters+=_hits.size();
641 
642  vec_pdg.clear();
643 
644  vec_trackid.clear();
645 
646  vec_trackid_mother.clear();
647 
648  vec_trackid_mother_en.clear();
649 
650 
651  }//end if cluster is in correct view
652  //clusterIter++;
653 
654  hits_vec.clear();
655  }//for each cluster
656 
657  // std::cout<<"sum_vec_trackid= "<<sum_vec_trackid<<std::endl;
658 
659  sort( all_trackids.begin(), all_trackids.end() );
660  all_trackids.erase( unique( all_trackids.begin(), all_trackids.end() ), all_trackids.end() );
661  // std::cout<<" NO OF DIFFERENT TRACKIDS IN THIS EVENT IS: "<<all_trackids.size()<<std::endl;
662  // std::cout<<"They are: ";
663  for(unsigned int ii=0;ii<all_trackids.size();++ii){
664  // std::cout<<all_trackids[ii]<<" ";
665 
666  }
667  // std::cout<<std::endl;
668 
669  //now I have a vector(all_trackids) that only contains unique trackids
670  //go to it and search for each trackid in every cluster
671 
672 
673 
674  sort(ids.begin(),ids.end() );
675  ids.erase( unique( ids.begin(), ids.end() ), ids.end() );
676  // std::cout<<"**NEW** NO OF USED TRACKIDS IN THIS EVENT IS: "<<ids.size()<<std::endl;
677  double no_of_clusters_per_track=noCluster/ids.size();
678  // std::cout<<"alright so i have no_of_clusters_per_track= "<<no_of_clusters_per_track<<std::endl;
679 
680 
681 
682  //Filling Histograms:
683 
684  if(no_cl_for_muon!=0){
685  fCl_for_Muon->Fill(no_cl_for_muon);}
686  // if(no_cl_for_electron!=0){
687  // fCl_for_Electron->Fill(no_cl_for_electron);}
688  // if(no_cl_for_positron!=0){
689  // fCl_for_Positron->Fill(no_cl_for_positron);}
690  // if(no_cl_for_pion_111!=0){
691  // fCl_for_Pion_111->Fill(no_cl_for_pion_111);}
692  // if(no_cl_for_pion_211!=0){
693  // fCl_for_Pion_211->Fill(no_cl_for_pion_211);}
694  // if(no_cl_for_pion_m211!=0){
695  // fCl_for_Pion_m211->Fill(no_cl_for_pion_m211);}
696  // if(no_cl_for_proton!=0){
697  // fCl_for_Proton->Fill(no_cl_for_proton);}
698 
699  fno_of_clusters_per_track->Fill(no_of_clusters_per_track);
700 
701  no_cl_for_muon=0;
702  no_cl_for_electron=0;
703  no_cl_for_positron=0;
704  no_cl_for_pion_111=0;
705  no_cl_for_pion_211=0;
706  no_cl_for_pion_m211=0;
707  no_cl_for_proton=0;
708  noCluster=0;
709  // std::cout<<"*************************************************"<<std::endl;
710  // std::cout<<"*************************************************"<<std::endl;
711  // std::cout<<" NEW PLANE "<<std::endl;
712  // std::cout<<"*************************************************"<<std::endl;
713  // std::cout<<"*************************************************"<<std::endl;
714  ids.clear();
715 
716  }//for each plane
717  //std::cout<<"no_of_particles_in_cluster= "<<no_of_particles_in_cluster<<std::endl;
718  //std::cout<<" no_of_clusters (with hits that are non-zero)= "<< no_of_clusters<<std::endl;
719  double result=no_of_particles_in_cluster/no_of_clusters;
720 
721  // std::cout<<"FINALLY NO OF PARTICLES PER CLUSTER IS: "<<result<<std::endl;
722  // std::cout<<"Sum of all hits in clusters= "<<total_no_hits_in_clusters<<std::endl;
723  double no_noise_hits=hits.size()-total_no_hits_in_clusters;
724  // std::cout<<"No of hits marked as noise= "<< no_noise_hits<<std::endl;
725  double percent_noise=double(no_noise_hits/hits.size())*100;
726  // std::cout<<"%%%%%%%%% NOISE IS: "<< percent_noise<<std::endl;
727 
728 
729 
730  double no_trackid_per_cl_per_event = sum_vec_trackid/no_of_clusters;
731  // std::cout<<"sum_vec_trackid= "<<sum_vec_trackid<<" no_of_clusters: "<<no_of_clusters<<" no_trackid_per_cl_per_event= "<<no_trackid_per_cl_per_event<<std::endl;
732  fNoParticles_trackid_per_event->Fill(no_trackid_per_cl_per_event);
733  fNoParticles_pdg_per_event->Fill(result);
734  fNoClustersInEvent->Fill(clusters.size());
735 
736  fPercentNoise->Fill(percent_noise);
737 
738  //????????here clean sum_vec_trackid
739 
741  //-----------------------------------------------------------------
742 
743 
744 
745 
746 
747  //-----------------------------------------------------------------------
748  for( unsigned int i = 0; i < mclist.size(); ++i ){
749  //art::Ptr<const simb::MCTruth> mc(mctruthListHandle,i);
750  art::Ptr<simb::MCTruth> mc(mclist[i]);
751  // simb::MCTruth mcp(*(mclist[i]));// We don't ever use this. EC, 6-Oct-2010.
752  // std::cout<<"Number of particles is : "<<mc->NParticles()<<std::endl;
753  // std::cout<<" mc->NParticles()="<< mc->NParticles()<<std::endl;
754  // TParticle part(mc->GetParticle(1));
755  // std::cout<<"part.Gte<PDG()->PdgCode()= "<<part.GetPDG()->PdgCode()<<std::endl;
756 
757  for(int ii = 0; ii < mc->NParticles(); ++ii){
758  simb::MCParticle part(mc->GetParticle(ii));
759  std::cout<<"FROM MC TRUTH,the particle's pdg code is: "<<part.PdgCode()<<std::endl;
760  std::cout<<"with energy= "<<part.E();
761  if(abs(part.PdgCode()) == 13){std::cout<<" I have a muon!!!"<<std::endl;
762  // std::cout<<"with energy= "<<part.Energy();
763  }
764  if(abs(part.PdgCode()) == 111){std::cout<<" I have a pi zero!!!"<<std::endl;}
765 
766  }
767 
768  }
769 
770  //-----------------------------------------------------------------------
771 
772 
773 
774 
775 
776  }
777 
778  // std::cout<<std::endl;
779  // std::cout<<" ********************************************************"<<std::endl;
780  // std::cout<<" ************* HITS ONLY *****************************"<<std::endl;
781  // std::cout<<" 88888888888888888888888888888888888888888888888888888888"<<std::endl;
782  //......................................................................
783  //......................................................................
784  //......................................................................
785  // *** ***************** *** *****************
786 
787  // Now I can load just hits (not clusters) and see how many of what kind are lost due to dbscan marking them as noise:
788 
789  //Load hits and copy most of the code from above:
790 
791  // std::cout<<"Take care of "<<hits.size()<<" hits"<<std::endl;
792  // std::cout<<"_en_11= "<<_en_11<<" _en_13= "<<_en_13<<std::endl;
793  double hit_13=0,hit_11=0,hit_m_11=0,hit_111=0,hit_211=0,hit_m211=0,hit_2212=0,hit_2112=0;
794  double en_13=0,en_11=0,en_m11=0,en_111=0,en_211=0,en_m211=0,en_2212=0,en_2112=0;
795  //int no_hits=0;
796  //unsigned int plane_k=0;
797  //double total_eng_hits_p0=0;
798  //double total_eng_hits_p1=0;
799 
800  // geo::View_t view_ind = geom->Plane(0).View();
801  // geo::View_t view_coll = geom->Plane(1).View();
802 
803  std::vector< art::Ptr<recob::Hit> >::iterator itr = hits.begin();
804  while(itr != hits.end()) {
805 
806  std::vector<sim::TrackIDE> trackides = bt_serv->HitToTrackIDEs(*itr);
807  std::vector<sim::TrackIDE> eveides = bt_serv->HitToEveTrackIDEs(*itr);
808 
809  std::vector<sim::TrackIDE>::iterator idesitr = trackides.begin();
810 
811  hit_energy=hits[itr-hits.begin()]->Integral();
812 
813  while( idesitr != trackides.end() ){
814 
815  //std::cout<<"0:TOTAL ENERGY FROM HITS for P=0 = "<<total_eng_hits_p0<<std::endl;
816  //std::cout<<"0:TOTAL ENERGY FROM HITS for P=1 = "<<total_eng_hits_p1<<std::endl;
817 
818 
819  const simb::MCParticle* particle = _particleList.at( (*idesitr).trackID);
820 
821  int pdg = particle->PdgCode();
822  //std::cout<<"pdg= "<<pdg<<std::endl;
823 
824 
825 
826 
827  diff_vec.clear();
828 
829 
830 
831 
832 
833  // double energy3=voxelData.Energy(i);
834  // //std::cout<<"plane= "<<plane_k<<std::endl;
835  // if(plane_k==0){total_eng_hits_p0+=energy3;}
836  // if(plane_k==1){total_eng_hits_p1+=energy3;}
837 
838 
839  if(pdg==13 || pdg==-13){hit_13++;
840  en_13+=hit_energy*((*idesitr).energyFrac);}
841  // if(pdg==11){hit_11++;
842  // en_11+=energy3;
843  // // std::cout<<"in hits: en_11="<<en_11<<std::endl;
844  // }
845  // if(pdg==-11){hit_m_11++;
846  // en_m11+=energy3;}
847  // if(pdg==111){hit_111++;
848  // en_111+=energy3;}
849  // if(pdg==22){hit_22++;
850  // en_22+=energy3;}
851  // if(pdg==211){hit_211++;
852  // en_211+=energy3;}
853  // if(pdg==-211){hit_m211++;
854  // en_m211+=energy3;}
855  // if(pdg==2212){hit_2212++;
856  // en_2212+=energy3;}
857  // if(pdg==2112){hit_2112++;
858  // en_2112+=energy3;}
859  // if(pdg !=22 && pdg!=111 && pdg!=-11 && pdg !=11 && pdg!=13 && pdg!=211 && pdg!=-211 && pdg!=2212 && pdg!=2112){
860  //
861  // std::cout<<"SOMETHING ELSE!!! PDG= "<<pdg<<std::endl;
862  // }
863 
864  idesitr++;
865 
866  } //trackIDs
867 
868  itr++;
869  } //hits
870  // std::cout<<"True PDG= "<<pdg<<std::endl;
871 
872 
873 
874  // std::cout<<"hit_13= "<<hit_13<<" "<<"hit_11= "<<hit_11<<" "<<"hit_m_11= "<<hit_m_11<<" "<<"hit_111= "<<hit_111<<" "<<"hit_22= "<<hit_22<<" ";
875 
876  // int sum=hit_13+hit_11+hit_m_11+hit_111+hit_22;
877  // std::cout<<"sum= "<<sum<<" no_hits= "<<no_hits<<" DIFF= "<<sum-no_hits<<std::endl;
878 
879 
880 
881 
882  // std::cout<<"PLANE_K= "<<plane_k<<std::endl;
883 
884 
885 
886  //std::cout<<"TOTAL ENERGY FROM HITS for P=0 = "<<total_eng_hits_p0<<std::endl;
887  //std::cout<<"TOTAL ENERGY FROM HITS for P=1 = "<<total_eng_hits_p1<<std::endl;
888 
889 
890 
891 
892  // std::cout<<"After hits,PLANE_K= "<<plane_k<<std::endl;
893  // }//plane
894  // }//non-zero hits
895  // std::cout<<"no_hits= "<<no_hits<<std::endl;
896  // std::cout<<"TOTAL # of muon hits= "<<hit_13<<std::endl;
897  // std::cout<<"TOTAL # of electron hits= "<<hit_11<<std::endl;
898  // std::cout<<"TOTAL # of positron hits= "<<hit_m_11<<std::endl;
899  // std::cout<<"TOTAL # of 111 hits= "<<hit_111<<std::endl;
900  // std::cout<<"TOTAL # of 211 hits= "<<hit_211<<std::endl;
901  // std::cout<<"TOTAL # of -211 hits= "<<hit_m211<<std::endl;
902  // std::cout<<"TOTAL # of 2212 hits= "<<hit_2212<<std::endl;
903  // std::cout<<"IN CLUSTERS # of muon hits= "<<_hit_13<<std::endl;
904  // std::cout<<"IN CLUSTERS # of electron hits= "<<_hit_11<<std::endl;
905  // std::cout<<"IN CLUSTERS # of positron hits= "<<_hit_m_11<<std::endl;
906  // std::cout<<"IN CLUSTERS # of 111 hits= "<<_hit_111<<std::endl;
907  // std::cout<<"IN CLUSTERS # of 211 hits= "<<_hit_211<<std::endl;
908  // std::cout<<"IN CLUSTERS # of -211 hits= "<<_hit_m211<<std::endl;
909  // std::cout<<"IN CLUSTERS # of 2212 hits= "<<_hit_2212<<std::endl;
910 
911  // std::cout<<"WE MISSED % of muon hits= "<<100-((_hit_13/hit_13)*100)<<"%"<<std::endl;
912 
913  // std::cout<<"WE MISSED % of electron hits= "<<100-((_hit_11/hit_11)*100)<<"%"<<std::endl;
914  // std::cout<<"WE MISSED % of positron hits= "<<100-((_hit_m_11/hit_m_11)*100)<<"%"<<std::endl;
915  // std::cout<<"WE MISSED % of 111 hits= "<<100-((_hit_111/hit_111)*100)<<"%"<<std::endl;
916  // std::cout<<"WE MISSED % of 211 hits= "<<100-((_hit_211/hit_211)*100)<<"%"<<std::endl;
917  // std::cout<<"WE MISSED % of -211 hits= "<<100-((_hit_m211/hit_m211)*100)<<"%"<<std::endl;
918  // std::cout<<"WE MISSED % of 2212 hits= "<<100-((_hit_2212/hit_2212)*100)<<"%"<<std::endl;
919 
920  if(hit_13!=0){ fPercent_lost_muon_hits->Fill(100-((_hit_13/hit_13)*100));}
921  if(hit_11!=0){ fPercent_lost_electron_hits->Fill(100-((_hit_11/hit_11)*100));}
922  if(hit_m_11!=0){ fPercent_lost_positron_hits->Fill(100-((_hit_m_11/hit_m_11)*100));}
923  if(hit_111!=0){ fPercent_lost_111_hits->Fill(100-((_hit_111/hit_111)*100));}
924 
925  if(hit_211!=0){ fPercent_lost_211_hits->Fill(100-((_hit_211/hit_211)*100));}
926 
927  if(hit_m211!=0){ fPercent_lost_m211_hits->Fill(100-((_hit_m211/hit_m211)*100));}
928  if(hit_2212!=0){ fPercent_lost_2212_hits->Fill(100-((_hit_2212/hit_2212)*100));}
929  if(hit_2112!=0){ fPercent_lost_2112_hits->Fill(100-((_hit_2112/hit_2112)*100));}
930 
931  // std::cout<<"*** _en_11= "<<_en_11<<" en_11= "<<en_11<<std::endl;
932  // std::cout<<"WE MISSED % of muon energy= "<<100-((_en_13/en_13)*100)<<"%"<<std::endl;
933 
934  // std::cout<<"WE MISSED % of electron energy= "<<100-((_en_11/en_11)*100)<<"%"<<std::endl;
935  // std::cout<<"WE MISSED % of positron energy= "<<100-((_en_m11/en_m11)*100)<<"%"<<std::endl;
936  // std::cout<<"WE MISSED % of 111 energy= "<<100-((_en_111/en_111)*100)<<"%"<<std::endl;
937  // std::cout<<"WE MISSED % of 211 energy= "<<100-((_en_211/en_211)*100)<<"%"<<std::endl;
938  // std::cout<<"WE MISSED % of -211 energy= "<<100-((_en_m211/en_m211)*100)<<"%"<<std::endl;
939  // std::cout<<"WE MISSED % of 2212 energy= "<<100-((_en_2212/en_2212)*100)<<"%"<<std::endl;
940  // std::cout<<"WE MISSED % of 2112 energy= "<<100-((_en_2112/en_2112)*100)<<"%"<<std::endl;
941  // if(en_13==0){std::cout<<"NO MU IN THIS EVENT (en) $$$$$$$$$$$$$$$$$"<<std::endl;}
942  //if(hit_13==0){std::cout<<"NO MU IN THIS EVENT (hit)$$$$$$$$$$$$$$$$$"<<std::endl;}
943  std::cout<<"****** mu E from clusters = "<<_en_13<<std::endl;
944  std::cout<<"****** mu E from hits = "<<en_13<<std::endl;
945 
946  if(en_13!=0){ fPercent_lost_muon_energy->Fill(100-((_en_13/en_13)*100));}
947  if(en_11!=0){ fPercent_lost_electron_energy->Fill(100-((_en_11/en_11)*100));}
948  if(en_m11!=0){ fPercent_lost_positron_energy->Fill(100-((_en_m11/en_m11)*100));
949  // std::cout<<"POSITRON E= "<<100-((_en_m11/en_m11)*100)<<std::endl;
950  }
951  if(en_111!=0){ fPercent_lost_111_energy->Fill(100-((_en_111/en_111)*100));}
952  if(en_211!=0){ fPercent_lost_211_energy->Fill(100-((_en_211/en_211)*100));}
953  if(en_m211!=0){ fPercent_lost_m211_energy->Fill(100-((_en_m211/en_m211)*100));}
954  if(en_2212!=0){ fPercent_lost_2212_energy->Fill(100-((_en_2212/en_2212)*100));}
955  if(en_2112!=0){ fPercent_lost_2112_energy->Fill(100-((_en_2112/en_2112)*100));}
956 
957 
958 
959 
960 
962  //-----------------------------------------------------------------------
963 
964  // FOR BRIAN:
965 
966 
967  //-------------------------------------------------------------------
968 
969  //std::cout<<"hello for Brian-->>>"<<std::endl;
970  //------------------------------------------------------------
971  // std::vector<const recob::Wire*> wirelist;
972  // try{
973  // evt.Reco().Get(fInputFolder.c_str(),wirelist);
974  // }
975  // catch(art::Exception e){
976  // std::cerr << "Error retrieving wire list, while looking for wires "
977  // << "in hit::FFTHitFinder::Ana(), "<< "directory : "
978  // << fInputFolder.c_str() << std::endl;
979  // return jobc::kFailed;
980  // }
981  // _electrons=0;
982  // electrons=0;
983  // int Total_Elec_p0=0;
984  // int Total_Elec_p1=0;
985  // int wire;
986  // int pl=0,t;
987  // unsigned int channel;
988  // //loop through all wires:
989 
990  // for(std::vector<const recob::Wire*>::iterator wireIter = wirelist.begin();
991  // wireIter != wirelist.end(); wireIter++) {
992 
993 
994 
995  // _rawdigit2 = (*wireIter)->RawDigit();
996  // sim::SimDigit* simdigit = dynamic_cast< sim::SimDigit*>(_rawdigit2);
997  // int numberOfElectrons = simdigit->NumberOfElectrons();
998 
999  // if(numberOfElectrons==0){std::cout<<" ZERO ELEC!!!"<<std::endl;}
1000  // //std::cout<<"# of elec: "<<numberOfElectrons<<" ";
1001  // if(simdigit==0){std::cout<<"simdigit=0 !!!!!!!!!!"<<std::endl;}
1002 
1003  // if(pl==0) {
1004  // Total_Elec_p0 += numberOfElectrons;}
1005  // if(pl==1) {
1006  // Total_Elec_p1 += numberOfElectrons;}
1007 
1008 
1009 
1010  // }//loop wires
1011 
1012 
1013  // std::cout<<"NO OF ELECTRONS, p0 = "<< Total_Elec_p0<<std::endl;
1014  // std::cout<<"NO OF ELECTRONS, p1 = "<< Total_Elec_p1<<std::endl;
1015 
1016  //now determine number of electrons for hits
1017 
1018 
1019  //----------------------------------------------------------------------------------------
1020  // Now, do the same thing for the found hits and compare the number of ionization electrons.
1021 
1022  //----------------------------------------------------------------------------------------
1023 
1024 
1025  // _electrons=0;
1026  // electrons=0;
1027  //
1028  // double sum=0;
1029  // double sum0=0;
1030  //
1031  //
1032  //
1033  // double no_ele_p0=0;
1034  // double no_ele_p1=0;
1035  // unsigned int plane=0;
1036  // double Tno_ele_p0=0;
1037  // double Tno_ele_p1=0;
1038 
1039 
1040  //for(unsigned int j = 0; j < hits.size(); ++j) // {
1041  //
1042  //
1043  // unsigned int channel = hits[j]->Wire()->RawDigit()->Channel();
1044  //
1045  // // std::cout<<"channel= "<<w_<<std::endl;
1046  // double XTime=hits[j]->PeakTime();
1047  //
1048  // // loop over the SimChannels to find this one
1049  // art::Ptr<sim::SimChannel> sc2;
1050  // for(unsigned int scs = 0; scs < simchans.size(); ++scs)
1051  // if(simchans[scs]->Channel() == channel) sc2 = simchans[scs];
1052  //
1053  // unsigned int numberOfElectrons = sc2->NumberOfElectrons();
1054  //
1055  // // if(numberOfElectrons==0){std::cout<<" ZERO ELEC!!!"<<std::endl;}
1056  // // std::cout<<"# of elec: "<<"for plane: "<<plane<<" is: "<<numberOfElectrons<<std::endl;
1057  // // std::cout<<"simdigit is: "<<simdigit<<std::endl;
1058  // for (size_t i = 0; i != numberOfElectrons; ++i )
1059  // {
1060  //
1061  // _electrons = sc2->GetElectrons(i);
1062  //
1063  // double ArrivalTime=(_electrons->ArrivalT())/200;
1064  //
1065  // double diff=XTime-ArrivalTime;
1066  // // std::cout<<"e's ArrivalT = "<<ArrivalTime<<" diff= "<<diff<<std::endl;
1067  //
1068  // if(plane==0) {
1069  // if((diff<22)&&(diff>13))
1070  // {
1071  //
1072  // electrons = sc2->GetElectrons(i);
1073  //
1074  // no_ele_p0= electrons-> NumElectrons();
1075  // // std::cout<<"p0,channel= "<<w_<<" e= "<<no_ele_p0<<" Hits "<<std::endl;
1076  // Tno_ele_p0+= no_ele_p0;
1077  // sum0=Tno_ele_p0;
1078  //
1079  // //std::cout<<"sum= "<<sum0<<std::endl;
1080  //
1081  // }
1082  // //std::cout<<" no_ele_p0= "<< no_ele_p0<<std::endl;
1083  // }
1084  //
1085  //
1086  //
1087  // if(plane==1) {
1088  // if((diff<36)&&(diff>27))
1089  // {
1090  // electrons = sc2->GetElectrons(i);
1091  // no_ele_p1= electrons-> NumElectrons();
1092  // //double _ArrivalTime=(electrons->ArrivalT())/200;
1093  // //double _diff=XTime-_ArrivalTime;
1094  // // std::cout<<"p1,channel= "<<w_<<" e= "<<no_ele_p1<<" Hits"<<std::endl;
1095  // Tno_ele_p1+= no_ele_p1;
1096  // sum=Tno_ele_p1;
1097  //
1098  // //std::cout<<"sum= "<<sum<<std::endl;
1099  // }
1100  // //std::cout<<" no_ele_p1= "<< no_ele_p1<<std::endl;
1101  // }
1102  //
1103  //
1104  //
1105  // }//numberofElectrons
1106  // // std::cout<<"TOTAL for p0 is: "<< Tno_ele_p0<<std::endl;
1107  // // std::cout<<"TOTAL for p1 is: "<< Tno_ele_p1<<std::endl;
1108  // sum=0;
1109  // sum0=0;
1110  // }//hits
1111 
1112 
1113  // std::cout<<"***TOTAL for p0 is: "<< Tno_ele_p0<<std::endl;
1114  // std::cout<<"***TOTAL for p1 is: "<< Tno_ele_p1<<std::endl;
1115 
1116 
1117  //-------------------first part FOR BRIAN done---------------------------
1118 
1119  //------------------------------------------------------------
1120  // no_ele_p0=0;
1121  // no_ele_p1=0;
1122  // double Tno_ele_p0_w=0;
1123  // double Tno_ele_p1_w=0;
1124  // sum=0;
1125  // sum0=0;
1126  // std::cout<<"hi"<<std::endl;
1127  // _electrons=0;
1128  // electrons=0;
1129  // // int Total_Elec_p0=0;
1130  // // int Total_Elec_p1=0;
1131  // unsigned int wire=0;
1132  // unsigned int pl=0;
1133  // unsigned int channel=0;
1134  //
1135  // //loop through all wires:
1136  //
1137  // for(art::PtrVector<recob::Wire>::const_iterator wireIter2 = wirelist.begin();
1138  // wireIter2 != wirelist.end(); wireIter2++) // {
1139  // //
1140  //
1141  //
1142  // // std::cout<<"channel: "<<wire<<std::endl;
1143  //
1144  // // loop over the SimChannels to find this one
1145  // art::Ptr<sim::SimChannel> sc;
1146  // for(unsigned int scs = 0; scs < simchans.size(); ++scs)
1147  // if(simchans[scs]->Channel() == channel) sc = simchans[scs];
1148  //
1149  // unsigned int numberOfElectrons = sc->NumberOfElectrons();
1150  //
1151  // // if(numberOfElectrons==0){std::cout<<" ZERO ELEC!!!"<<std::endl;}
1152  // //std::cout<<"# of elec: "<<numberOfElectrons<<" ";
1153  //
1154  // for (size_t i = 0; i!=numberOfElectrons; ++i )
1155  // {
1156  //
1157  // _electrons = sc->GetElectrons(i);
1158  //
1159  //
1160  // if(pl==0) {
1161  //
1162  //
1163  // electrons = sc->GetElectrons(i);
1164  //
1165  // no_ele_p0= electrons-> NumElectrons();
1166  // // std::cout<<"p0,channel= "<<wire<<" e= "<<no_ele_p0<<" Wires"<<std::endl;
1167  //
1168  // //std::cout<<" no_ele_p0= "<< no_ele_p0<<std::endl;
1169  // Tno_ele_p0_w+= no_ele_p0;
1170  // sum0=Tno_ele_p0;
1171  //
1172  // // std::cout<<"sum= "<<sum0<<std::endl;
1173  // }
1174  //
1175  //
1176  //
1177  // // std::cout<<"sum= "<< Tno_ele_p0<<std::endl;
1178  //
1179  //
1180  //
1181  // if(pl==1) {
1182  //
1183  //
1184  // electrons = sc->GetElectrons(i);
1185  // no_ele_p1= electrons-> NumElectrons();
1186  //
1187  // //std::cout<<"p1,channel= "<<wire<<" e= "<<no_ele_p1<<" Wires"<<std::endl;
1188  //
1189  // //std::cout<<" no_ele_p1= "<< no_ele_p1<<std::endl;
1190  // Tno_ele_p1_w+= no_ele_p1;
1191  // sum=Tno_ele_p1;
1192  //
1193  // //std::cout<<"sum= "<<sum<<std::endl;
1194  //
1195  // }
1196  //
1197  //
1198  // }//numberofElectrons
1199  // // std::cout<<"TOTAL for p0 is: "<< Tno_ele_p0_w<<std::endl;
1200  // // std::cout<<"TOTAL for p1 is: "<< Tno_ele_p1_w<<std::endl;
1201  //
1202  // no_ele_p0=0;
1203  // no_ele_p1=0;
1204  //
1205  //
1206  //
1207  //
1208  //
1209  // //--------------------------------------
1210  // // if(pl==0) {
1211  // // Total_Elec_p0 += numberOfElectrons;}
1212  // // if(pl==1) {
1213  // // Total_Elec_p1 += numberOfElectrons;}
1214  // // //------------------------------------
1215  //
1216  // sum=0;
1217  // sum0=0;
1218  // }//loop wires
1219 
1220  // std::cout<<"(wires)TOTAL for p0 is: "<< Tno_ele_p0_w<<std::endl;
1221  // std::cout<<"(wires)TOTAL for p1 is: "<< Tno_ele_p1_w<<std::endl;
1222  // fbrian_in->Fill(Tno_ele_p0_w, Tno_ele_p0 );
1223  // fbrian_coll->Fill(Tno_ele_p1_w, Tno_ele_p1 );
1224 
1225 
1226  }
int PdgCode() const
Definition: MCParticle.h:216
PlaneGeo const & Plane(unsigned int const p, unsigned int const tpc=0, unsigned int const cstat=0) const
Returns the specified wire.
intermediate_table::iterator iterator
const std::vector< sim::TrackIDE > HitToTrackIDEs(recob::Hit const &hit)
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
void SetEveIdCalculator(sim::EveIdCalculator *ec)
mapped_type at(const key_type &key)
Definition: ParticleList.h:330
bool isRealData() const
Definition: Event.h:83
View_t View() const
Which coordinate does this plane measure.
Definition: PlaneGeo.h:171
unsigned int Nplanes(unsigned int tpc=0, unsigned int cstat=0) const
Returns the total number of wire planes in the specified TPC.
void hits()
Definition: readHits.C:15
void push_back(Ptr< U > const &p)
Definition: PtrVector.h:441
TString part[npart]
Definition: Style.C:32
iterator begin()
Definition: ParticleList.h:305
size_type size() const
Definition: PtrVector.h:308
const std::vector< sim::TrackIDE > HitToEveTrackIDEs(recob::Hit const &hit)
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Definition: DataViewImpl.h:344
EventNumber_t event() const
Definition: EventID.h:117
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
Definition: Ptr.h:464
RunNumber_t run() const
Definition: Event.h:77
EventID id() const
Definition: Event.h:56
void cluster::DBclusterAna::beginJob ( )
virtual

Reimplemented from art::EDAnalyzer.

Definition at line 148 of file DBclusterAna_module.cc.

References fbrian_coll, fbrian_in, fCl_for_Muon, fEnergy, fno_of_clusters_per_track, fNoClustersInEvent, fNoParticles_pdg, fNoParticles_pdg_per_event, fNoParticles_trackid, fNoParticles_trackid_mother, fNoParticles_trackid_per_event, fPercent_lost_111_energy, fPercent_lost_111_hits, fPercent_lost_2112_energy, fPercent_lost_2112_hits, fPercent_lost_211_energy, fPercent_lost_211_hits, fPercent_lost_2212_energy, fPercent_lost_2212_hits, fPercent_lost_electron_energy, fPercent_lost_electron_hits, fPercent_lost_m211_energy, fPercent_lost_m211_hits, fPercent_lost_muon_energy, fPercent_lost_muon_hits, fPercent_lost_positron_energy, fPercent_lost_positron_hits, fPercentNoise, and art::TFileDirectory::make().

149  {
150 
151  // get access to the TFile service
153 
154  fNoParticles_pdg_per_event = tfs->make<TH1F>("fNoParticles_pdg_per_event","Average # of Particles per cluster for each event", 500,0 ,5);
155  fNoParticles_pdg=tfs->make<TH1F>("fNoParticles_pdg","Number of Particles in a Cluster for each cluster", 500,0 ,5);
156  fNoParticles_trackid=tfs->make<TH1F>("fNoParticles_trackid","Number of different TrackIDs in a Cluster", 300,0 ,30);
157 
158  fNoParticles_trackid_mother=tfs->make<TH1F>("fNoParticles_trackid_mother","Number of different TrackIDs in a Cluster(using mother)for each cluster", 300,0 ,30);
159 
160  fNoParticles_trackid_per_event=tfs->make<TH1F>("fNoParticles_trackid_per_event","Avg Number of different TrackIDs per Cluster per event", 300,0 ,30);
161  fCl_for_Muon=tfs->make<TH1F>("fCl_for_Muon","Number of Clusters for Muon per plane (pdg)", 1500,0 ,15);
162  // fCl_for_Electron=tfs->make<TH1F>("fCl_for_Electron","Number of Clusters for Electron (pdg)", 1500,0 ,15);
163  // fCl_for_Positron=tfs->make<TH1F>("fCl_for_Positron","Number of Clusters for Positron", 1500,0 ,15);
164  // fCl_for_Pion_111=tfs->make<TH1F>("fCl_for_Pion_111","Number of Clusters for Pion (111)", 1500,0 ,15);
165  // fCl_for_Pion_211=tfs->make<TH1F>("fCl_for_Pion_211","Number of Clusters for Pion (211)", 1500,0 ,15);
166  // fCl_for_Pion_m211=tfs->make<TH1F>("fCl_for_Pion_m211","Number of Clusters for Pion (-211)", 1500,0 ,15);
167  // fCl_for_Proton=tfs->make<TH1F>("fCl_for_Proton","Number of Clusters for Proton", 1500,0 ,15);
168 
169  fNoClustersInEvent=tfs->make<TH1F>("fNoClustersInEvent","Number of Clusters in an Event", 50,0 ,50);
170 
171  fPercentNoise=tfs->make<TH1F>("fPercentNoise","% of hits that were marked as Noise by DBSCAN",250,0 ,25);
172 
173  fno_of_clusters_per_track=tfs->make<TH1F>("fno_of_clusters_per_track","Number of Clusters per TrackID per plane", 1500,0 ,15);
174 
175  fPercent_lost_muon_hits=tfs->make<TH1F>("fPercent_lost_muon_hits","Number of muon hits excluded by dbscan in % (per Event)", 10000,0 ,100);
176  fPercent_lost_electron_hits=tfs->make<TH1F>("fPercent_lost_electron_hits","Number of electron hits excluded by dbscan in % (per Event)", 10000,0 ,100);
177  fPercent_lost_positron_hits=tfs->make<TH1F>("fPercent_lost_positron_hits","Number of positron hits excluded by dbscan in % (per Event)", 10000,0 ,100);
178  fPercent_lost_111_hits=tfs->make<TH1F>("fPercent_lost_111_hits","Number of pion(111) hits excluded by dbscan in % (per Event)", 10000,0 ,100);
179  fPercent_lost_211_hits=tfs->make<TH1F>("fPercent_lost_211_hits","Number of pion(211) hits excluded by dbscan in % (per Event)", 10000,0 ,100);
180  fPercent_lost_m211_hits=tfs->make<TH1F>("fPercent_lost_m211_hits","Number of pion(-211) hits excluded by dbscan in % (per Event)", 10000,0 ,100);
181  fPercent_lost_2212_hits=tfs->make<TH1F>("fPercent_lost_2212_hits","Number of proton hits excluded by dbscan in % (per Event)", 10000,0 ,100);
182  fPercent_lost_2112_hits=tfs->make<TH1F>("fPercent_lost_2112_hits","Number of neutron hits excluded by dbscan in % (per Event)", 10000,0 ,100);
183 
184  fPercent_lost_muon_energy=tfs->make<TH1F>("fPercent_lost_muon_energy"," muon energy excluded by dbscan in % (per Event)", 10000,0 ,100);
185  fPercent_lost_electron_energy=tfs->make<TH1F>("fPercent_lost_electron_energy","electron energy excluded by dbscan in % (per Event)", 10000,0 ,100);
186  fPercent_lost_positron_energy=tfs->make<TH1F>("fPercent_lost_positron_energy"," positron energy excluded by dbscan in % (per Event)", 10000,0 ,100);
187  fPercent_lost_111_energy=tfs->make<TH1F>("fPercent_lost_111_energy","pion(111) energy excluded by dbscan in % (per Event)", 10000,0 ,100);
188  fPercent_lost_211_energy=tfs->make<TH1F>("fPercent_lost_211_energy","pion(211) energy excluded by dbscan in % (per Event)", 10000,0 ,100);
189  fPercent_lost_m211_energy=tfs->make<TH1F>("fPercent_lost_m211_energy"," pion(-211) energy excluded by dbscan in % (per Event)", 10000,0 ,100);
190  fPercent_lost_2212_energy=tfs->make<TH1F>("fPercent_lost_2212_energy","proton energy excluded by dbscan in % (per Event)", 10000,0 ,100);
191  fPercent_lost_2112_energy=tfs->make<TH1F>("fPercent_lost_2112_energy","neutron energy excluded by dbscan in % (per Event)", 10000,0 ,100);
192 
193  fEnergy=tfs->make<TH1F>("fEnergy","energy for each voxel", 100000,0 ,0.0005);
194 
195  fbrian_in = tfs->make<TH2F>("fbrian_in", ";# Electrons deposited; # Electrons detected by hitfinder", 1000, 0, 10000000, 1000, 0, 10000000);
196  fbrian_coll = tfs->make<TH2F>("fbrian_coll", ";# Electrons deposited; # Electrons detected by hitfinder", 1000, 0, 10000000, 1000, 0, 10000000);
197 
198  }
T * make(ARGS...args) const
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
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
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  }
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
std::string const& art::EventObserverBase::processName ( ) const
inlineinherited
void art::EventObserverBase::registerProducts ( MasterProductRegistry ,
ProductDescriptions ,
ModuleDescription const &   
)
inlineinherited

Definition at line 33 of file EventObserverBase.h.

36  {}
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

TH2F* cluster::DBclusterAna::fbrian_coll
private

Definition at line 109 of file DBclusterAna_module.cc.

Referenced by beginJob().

TH2F* cluster::DBclusterAna::fbrian_in
private

Definition at line 108 of file DBclusterAna_module.cc.

Referenced by beginJob().

std::string cluster::DBclusterAna::fCalDataModuleLabel
private

Definition at line 115 of file DBclusterAna_module.cc.

Referenced by analyze().

TH1F* cluster::DBclusterAna::fCl_for_Muon
private

Definition at line 80 of file DBclusterAna_module.cc.

Referenced by analyze(), and beginJob().

std::string cluster::DBclusterAna::fClusterFinderModuleLabel
private

Definition at line 114 of file DBclusterAna_module.cc.

Referenced by analyze().

std::string cluster::DBclusterAna::fDigitModuleLabel
private

Definition at line 111 of file DBclusterAna_module.cc.

Referenced by analyze().

TH1F* cluster::DBclusterAna::fEnergy
private

Definition at line 107 of file DBclusterAna_module.cc.

Referenced by beginJob().

std::string cluster::DBclusterAna::fGenieGenModuleLabel
private

Definition at line 116 of file DBclusterAna_module.cc.

Referenced by analyze().

std::string cluster::DBclusterAna::fHitsModuleLabel
private

Definition at line 112 of file DBclusterAna_module.cc.

Referenced by analyze().

std::string cluster::DBclusterAna::fLArG4ModuleLabel
private

Definition at line 113 of file DBclusterAna_module.cc.

TH1F* cluster::DBclusterAna::fno_of_clusters_per_track
private

Definition at line 89 of file DBclusterAna_module.cc.

Referenced by analyze(), and beginJob().

TH1F* cluster::DBclusterAna::fNoClustersInEvent
private

Definition at line 87 of file DBclusterAna_module.cc.

Referenced by analyze(), and beginJob().

TH1F* cluster::DBclusterAna::fNoParticles_pdg
private

Definition at line 75 of file DBclusterAna_module.cc.

Referenced by analyze(), and beginJob().

TH1F* cluster::DBclusterAna::fNoParticles_pdg_per_event
private

Definition at line 79 of file DBclusterAna_module.cc.

Referenced by analyze(), and beginJob().

TH1F* cluster::DBclusterAna::fNoParticles_trackid
private

Definition at line 76 of file DBclusterAna_module.cc.

Referenced by analyze(), and beginJob().

TH1F* cluster::DBclusterAna::fNoParticles_trackid_mother
private

Definition at line 77 of file DBclusterAna_module.cc.

Referenced by analyze(), and beginJob().

TH1F* cluster::DBclusterAna::fNoParticles_trackid_per_event
private

Definition at line 78 of file DBclusterAna_module.cc.

Referenced by analyze(), and beginJob().

TH1F* cluster::DBclusterAna::fPercent_lost_111_energy
private

Definition at line 102 of file DBclusterAna_module.cc.

Referenced by analyze(), and beginJob().

TH1F* cluster::DBclusterAna::fPercent_lost_111_hits
private

Definition at line 93 of file DBclusterAna_module.cc.

Referenced by analyze(), and beginJob().

TH1F* cluster::DBclusterAna::fPercent_lost_2112_energy
private

Definition at line 106 of file DBclusterAna_module.cc.

Referenced by analyze(), and beginJob().

TH1F* cluster::DBclusterAna::fPercent_lost_2112_hits
private

Definition at line 97 of file DBclusterAna_module.cc.

Referenced by analyze(), and beginJob().

TH1F* cluster::DBclusterAna::fPercent_lost_211_energy
private

Definition at line 103 of file DBclusterAna_module.cc.

Referenced by analyze(), and beginJob().

TH1F* cluster::DBclusterAna::fPercent_lost_211_hits
private

Definition at line 94 of file DBclusterAna_module.cc.

Referenced by analyze(), and beginJob().

TH1F* cluster::DBclusterAna::fPercent_lost_2212_energy
private

Definition at line 105 of file DBclusterAna_module.cc.

Referenced by analyze(), and beginJob().

TH1F* cluster::DBclusterAna::fPercent_lost_2212_hits
private

Definition at line 96 of file DBclusterAna_module.cc.

Referenced by analyze(), and beginJob().

TH1F* cluster::DBclusterAna::fPercent_lost_electron_energy
private

Definition at line 100 of file DBclusterAna_module.cc.

Referenced by analyze(), and beginJob().

TH1F* cluster::DBclusterAna::fPercent_lost_electron_hits
private

Definition at line 91 of file DBclusterAna_module.cc.

Referenced by analyze(), and beginJob().

TH1F* cluster::DBclusterAna::fPercent_lost_m211_energy
private

Definition at line 104 of file DBclusterAna_module.cc.

Referenced by analyze(), and beginJob().

TH1F* cluster::DBclusterAna::fPercent_lost_m211_hits
private

Definition at line 95 of file DBclusterAna_module.cc.

Referenced by analyze(), and beginJob().

TH1F* cluster::DBclusterAna::fPercent_lost_muon_energy
private

Definition at line 99 of file DBclusterAna_module.cc.

Referenced by analyze(), and beginJob().

TH1F* cluster::DBclusterAna::fPercent_lost_muon_hits
private

Definition at line 90 of file DBclusterAna_module.cc.

Referenced by analyze(), and beginJob().

TH1F* cluster::DBclusterAna::fPercent_lost_positron_energy
private

Definition at line 101 of file DBclusterAna_module.cc.

Referenced by analyze(), and beginJob().

TH1F* cluster::DBclusterAna::fPercent_lost_positron_hits
private

Definition at line 92 of file DBclusterAna_module.cc.

Referenced by analyze(), and beginJob().

TH1F* cluster::DBclusterAna::fPercentNoise
private

Definition at line 88 of file DBclusterAna_module.cc.

Referenced by analyze(), and beginJob().


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