9 #include "art/Framework/Core/EDAnalyzer.h"
10 #include "art/Framework/Principal/Event.h"
11 #include "art/Framework/Principal/Handle.h"
12 #include "art/Framework/Core/ModuleMacros.h"
13 #include "art/Framework/Principal/Run.h"
14 #include "art_root_io/TFileDirectory.h"
15 #include "art_root_io/TFileService.h"
16 #include "art/Framework/Services/Registry/ServiceHandle.h"
17 #include "art/Framework/Principal/Provenance.h"
18 #include "nusimdata/SimulationBase/MCParticle.h"
24 #include "TDirectory.h"
27 #include "CLHEP/Units/SystemOfUnits.h"
39 void beginJob()
override;
40 void analyze(
const art::Event& event)
override;
43 TH1F* _hnParts{
nullptr};
48 _myName(p.
get<
std::string>(
"name",
"CheckMCParticle"))
53 art::ServiceHandle<art::TFileService const>
tfs;
54 _hnParts = tfs->make<TH1F>(
"hnParts",
"Number of generated Particles", 100, 0., 2000.);
61 auto allDropped =
event.getMany<std::map<int,std::set<int>>>();
63 for (
auto const& maps : allDropped ) {
64 for (
auto const&
element : *maps ) {
66 std::set<int> droppedset=
element.second;
67 std::cout<<
" droppedid size: "<< droppedset.size()<<std::endl;
68 for(
auto const& droppedid : droppedset )
77 auto allGens =
event.getMany<std::vector<simb::MCParticle>>();
78 for (
auto const& gens : allGens) {
79 _hnParts->Fill(gens->size());
81 for (
auto const& genpart : *gens) {
82 if (genpart.Mother()==0) {
83 cout <<
"Primary momentum: " << genpart.P();
84 cout <<
" position: " << genpart.Vx()<<
" "<< genpart.Vy()<<
" "<< genpart.Vz() << endl;
86 cout <<
"Part id: " << genpart.TrackId();
87 cout <<
" PDG id: " << genpart.PdgCode();
88 cout <<
" Status Code: " << genpart.StatusCode();
89 cout <<
" Mother: " << genpart.Mother();
90 cout <<
" Creation Process: "<<genpart.Process();
91 cout <<
" End Process: "<<genpart.EndProcess();
96 cout <<
" Nr. of Daughters: " << genpart.NumberDaughters();
97 cout <<
" FirstDaughter:" << genpart.FirstDaughter()<<endl;
99 for (
int i=0;i<genpart.NumberDaughters();i++)
101 cout << genpart.Daughter(i)<<
",";
process_name opflashCryo1 flashfilter analyze
double std(const std::vector< short > &wf, const double ped_mean, size_t start, size_t nsample)
standard_singlep gaussian distribution ie ie ie gaussian gaussian gaussian larg4Main CheckMCParticle
CheckMCParticle(fhicl::ParameterSet const &p)
void analyze(const art::Event &event) override
art::ServiceHandle< art::TFileService > tfs
std::string const _myName
BEGIN_PROLOG could also be cout