All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Attributes | List of all members
FluxGeoFilter Class Reference
Inheritance diagram for FluxGeoFilter:

Public Member Functions

 FluxGeoFilter (fhicl::ParameterSet const &p)
 
 FluxGeoFilter (FluxGeoFilter const &)=delete
 
 FluxGeoFilter (FluxGeoFilter &&)=delete
 
FluxGeoFilteroperator= (FluxGeoFilter const &)=delete
 
FluxGeoFilteroperator= (FluxGeoFilter &&)=delete
 
bool filter (art::Event &e) override
 

Private Attributes

std::set< std::string > fVolFlux
 

Detailed Description

Definition at line 35 of file FluxGeoFilter_module.cc.

Constructor & Destructor Documentation

FluxGeoFilter::FluxGeoFilter ( fhicl::ParameterSet const &  p)
explicit

Definition at line 55 of file FluxGeoFilter_module.cc.

56  : EDFilter{p} // ,
57  // More initializers here.
58 {
59  std::cout<<"Configuring flux filter."<<std::endl;
60  std::vector<std::string> tmp=p.get<std::vector<std::string> >("volumes");
61  fVolFlux.insert(tmp.begin(),tmp.end());
62 
63  std::cout<<"Filtering flux through volumes: "<<std::endl;
64  for (auto s: fVolFlux) std::cout<<"\t"<<s<<std::endl;
65 }
pdgs p
Definition: selectors.fcl:22
std::set< std::string > fVolFlux
then echo File list $list not found else cat $list while read file do echo $file sed s
Definition: file_to_url.sh:60
BEGIN_PROLOG could also be cout
FluxGeoFilter::FluxGeoFilter ( FluxGeoFilter const &  )
delete
FluxGeoFilter::FluxGeoFilter ( FluxGeoFilter &&  )
delete

Member Function Documentation

bool FluxGeoFilter::filter ( art::Event &  e)
override

Definition at line 67 of file FluxGeoFilter_module.cc.

68 {
69 
70  // Implementation of required member function here.
71  bool result=false; //false filters out, true passes
72 
73  //check if neutrino goes through volTPCActive
74  geo::GeometryCore const* geom = lar::providerFrom<geo::Geometry>();
75  TGeoManager* rgeo=geom->ROOTGeoManager();
76 
77  // art::Handle< std::vector<simb::MCFlux> > mcFluxHandle;
78  // e.getByLabel("flux",mcFluxHandle);
79  // std::vector<simb::MCFlux> const& fluxlist = *mcFluxHandle;
80 
81  art::Handle< std::vector<simb::MCTruth> > mctruthHandle;
82  e.getByLabel("flux",mctruthHandle);
83  std::vector<simb::MCTruth> const& mclist = *mctruthHandle;
84 
85  for(unsigned int inu = 0; inu < mclist.size(); inu++){
86  simb::MCParticle nu = mclist[inu].GetNeutrino().Nu();
87  rgeo->SetCurrentPoint(nu.Vx(),nu.Vy(),nu.Vz());
88  rgeo->SetCurrentDirection(nu.Px(),nu.Py(),nu.Pz());
89  TGeoNode* node=rgeo->FindNode();
90  while (node) {
91  std::string volname=node->GetVolume()->GetName();
92  rgeo->FindNextBoundary();
93  node=gGeoManager->Step();
94  if (fVolFlux.find(volname)!=fVolFlux.end()) {
95  result=true;
96  break;
97  }
98  }
99  }
100  return result;
101 }
TGeoManager * ROOTGeoManager() const
Access to the ROOT geometry description manager.
std::set< std::string > fVolFlux
Description of geometry of one entire detector.
do i e
BEGIN_PROLOG SN nu
FluxGeoFilter& FluxGeoFilter::operator= ( FluxGeoFilter const &  )
delete
FluxGeoFilter& FluxGeoFilter::operator= ( FluxGeoFilter &&  )
delete

Member Data Documentation

std::set<std::string> FluxGeoFilter::fVolFlux
private

Definition at line 52 of file FluxGeoFilter_module.cc.


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