Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | List of all members
jmshower::RecoJMShowerFilter Class Reference
Inheritance diagram for jmshower::RecoJMShowerFilter:
art::EDFilter art::ProducerBase art::Consumer art::EngineCreator art::ProductRegistryHelper

Public Types

using ModuleType = EDFilter
 
using WorkerType = WorkerT< EDFilter >
 
template<typename UserConfig >
using Table = ProducerBase::Table< UserConfig >
 

Public Member Functions

 RecoJMShowerFilter (fhicl::ParameterSet const &pset)
 
virtual ~RecoJMShowerFilter ()
 
virtual bool filter (art::Event &evt)
 
void beginJob ()
 
bool beginSubRun (art::SubRun &sr)
 
void reconfigure (const fhicl::ParameterSet &pset)
 
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< Tconsumes (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< Tconsumes (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< TconsumesView (InputTag const &it)
 
template<typename T , BranchType = InEvent>
ProductToken< TmayConsume (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< TmayConsume (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< TmayConsumeView (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 ()
 

Public Attributes

std::string fPotLabel
 Module that produced the POTSum object. More...
 
int fNJMShower
 
int fEvtNuPdg
 
int fEvtCCNC
 

Static Public Attributes

static constexpr bool Pass {true}
 
static constexpr bool Fail {false}
 

Protected Member Functions

CurrentProcessingContext const * currentContext () const
 
void validateConsumedProduct (BranchType const bt, ProductInfo const &pi)
 
void prepareForJob (fhicl::ParameterSet const &pset)
 
void showMissingConsumes () const
 

Detailed Description

Definition at line 35 of file RecoJMShowerFilter_module.cc.

Member Typedef Documentation

using art::EDFilter::ModuleType = EDFilter
inherited

Definition at line 37 of file EDFilter.h.

template<typename UserConfig >
using art::EDFilter::Table = ProducerBase::Table<UserConfig>
inherited

Definition at line 46 of file EDFilter.h.

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

Definition at line 38 of file EDFilter.h.

Constructor & Destructor Documentation

jmshower::RecoJMShowerFilter::RecoJMShowerFilter ( fhicl::ParameterSet const &  pset)
explicit

Definition at line 58 of file RecoJMShowerFilter_module.cc.

References reconfigure().

59  {
60  reconfigure(pset);
61  }
void reconfigure(const fhicl::ParameterSet &pset)
jmshower::RecoJMShowerFilter::~RecoJMShowerFilter ( )
virtual

Definition at line 75 of file RecoJMShowerFilter_module.cc.

76  {
77  }

Member Function Documentation

void jmshower::RecoJMShowerFilter::beginJob ( )
virtual

Reimplemented from art::EDFilter.

Definition at line 81 of file RecoJMShowerFilter_module.cc.

82  {
83  }
bool jmshower::RecoJMShowerFilter::beginSubRun ( art::SubRun sr)
virtual

Reimplemented from art::EDFilter.

Definition at line 84 of file RecoJMShowerFilter_module.cc.

84  {
85  // art::Handle< sumdata::POTSum > p;
86  // sr.getByLabel(fPotLabel,p);
87  // std::cout<<"pot = "<<p->totgoodpot<<std::endl;
88  return true;
89  }
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 146 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

147 {
148  if (!moduleContext_)
149  return ProductToken<T>::invalid();
150 
151  consumables_[BT].emplace_back(ConsumableType::Product,
152  TypeID{typeid(T)},
153  it.label(),
154  it.instance(),
155  it.process());
156  return ProductToken<T>{it};
157 }
set< int >::iterator it
static ProductToken< T > invalid()
Definition: ProductToken.h:47
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename T , art::BranchType BT>
void art::Consumer::consumesMany ( )
inherited

Definition at line 161 of file Consumer.h.

References T.

162 {
163  if (!moduleContext_)
164  return;
165 
166  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
167 }
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
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 171 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

172 {
173  if (!moduleContext_)
174  return ViewToken<T>::invalid();
175 
176  consumables_[BT].emplace_back(ConsumableType::ViewElement,
177  TypeID{typeid(T)},
178  it.label(),
179  it.instance(),
180  it.process());
181  return ViewToken<T>{it};
182 }
set< int >::iterator it
static ViewToken< Element > invalid()
Definition: ProductToken.h:75
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed)
inherited
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed,
std::string const &  kind_of_engine_to_make 
)
inherited
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed,
std::string const &  kind_of_engine_to_make,
label_t const &  engine_label 
)
inherited
CurrentProcessingContext const* art::EDFilter::currentContext ( ) const
protectedinherited
bool jmshower::RecoJMShowerFilter::filter ( art::Event evt)
virtual

Implements art::EDFilter.

Definition at line 91 of file RecoJMShowerFilter_module.cc.

References simb::MCNeutrino::CCNC(), om::cout, DEFINE_ART_MODULE(), allTimeWatchdog::endl, simb::MCParticle::EndX(), simb::MCParticle::EndY(), simb::MCParticle::EndZ(), fEvtCCNC, fEvtNuPdg, geom(), art::DataViewImpl::getByLabel(), MECModelEnuComparisons::i, art::Event::isRealData(), jmshower::kElectron, jmshower::kMuon, jmshower::kPion, jmshower::kProton, mc, simb::MCNeutrino::Mode(), simb::MCParticle::Momentum(), simb::MCNeutrino::Nu(), and simb::MCParticle::PdgCode().

92  {
93  //----------------------------------------------------
94  // Run, subrun and event information
95  //----------------------------------------------------
96  // int run = evt.run();
97  // int srun = evt.subRun();
98  // int event = evt.id().event();
100  //------------------------------------------------------------------------
101  // MC true information
102  //----------------------------------------------------------------------
103 
104 
105  //Neutrino MC truth
106 
107  TLorentzVector evtTrueNuP4(0,0,0,0);
108  TVector3 evtTrueNuVtx(0,0,-100);
109  int evtTrueNuCCNC = -1;
110  // int evtTrueNuMode = -1;
111  int evtTrueNuPdg = 0;
112 
113 
114  if(!evt.isRealData()){
116  try {
117  evt.getByLabel("generator", mc);
118  if (mc->size()!=1) return false;
119  }
120  catch (...) {
121  return false;
122  }
123  if ((*mc)[0].NeutrinoSet()) {
124  const simb::MCNeutrino& gen = (*mc)[0].GetNeutrino();
125  const simb::MCParticle& nu = gen.Nu();
126  evtTrueNuP4 = nu.Momentum();
127  evtTrueNuVtx.SetXYZ(nu.EndX(),nu.EndY(),nu.EndZ());
128  evtTrueNuCCNC = gen.CCNC() ;
129  // evtTrueNuMode = gen.Mode() ;
130  evtTrueNuPdg = nu.PdgCode() ;
131  std::cout<<"Nuetrino, Energy "<<nu.PdgCode()<<" "<<evtTrueNuP4.E()<<std::endl;
132  std::cout<<"CCNC, Mode "<<gen.CCNC()<<" "<<gen.Mode()<<std::endl;
133  enum simb::int_type_ outMode = (enum simb::int_type_) gen.Mode();
134 // enum simb::int_type_ outMode1 = (enum simb::int_type_) InteractionType();
135  std::cout<<"Mode enum "<<outMode<<std::endl;
136 // std::cout<<"Type enum "<<outMode1<<std::endl;
137  }
138  if(evtTrueNuPdg!=fEvtNuPdg) return false;
139  if(evtTrueNuCCNC!=fEvtCCNC) return false;
140  }
141 
142  std::cout<<"before veto evtTrueNuPdg,evtTrueNuCCNC,recoshowercol.size "<<evtTrueNuPdg<<" "<<evtTrueNuCCNC<<" "<<std::endl;
143 
144 
145 // if(evtTrueNuMode!=3) return false;
146 
148  evt.getByLabel("recojmshower", showerhandle);
149  std::vector<art::Ptr<jmshower::JMShower> > svcshowercol;
150  for(unsigned int i = 0; i < showerhandle->size(); i++){
151  art::Ptr<jmshower::JMShower> p(showerhandle, i);
152  svcshowercol.push_back(p);
153  }
154 
155  std::cout<<"Pdg, CCNC, size "<<evtTrueNuPdg<<" "<<evtTrueNuCCNC<<" "<<svcshowercol.size()<<std::endl;
156  bool /*seltag0=false,seltag1=false,seltag2=false, seltag3=false,*/seltag4=false;
157  if(svcshowercol.size()>0){
158 
159 
160  double llemu = svcshowercol[0]->DedxLongLL(int(jmshower::kElectron)) - svcshowercol[0]->DedxLongLL(int(jmshower::kMuon));
161  double ltemu = svcshowercol[0]->DedxTransLL(int(jmshower::kElectron)) - svcshowercol[0]->DedxTransLL(int(jmshower::kMuon));
162 
163  double lleproton = svcshowercol[0]->DedxLongLL(int(jmshower::kElectron)) - svcshowercol[0]->DedxLongLL(int(jmshower::kProton));
164  // double lteproton = svcshowercol[0]->DedxTransLL(int(jmshower::kElectron)) - svcshowercol[0]->DedxTransLL(int(jmshower::kProton));
165 
166  double llepion = svcshowercol[0]->DedxLongLL(int(jmshower::kElectron)) - svcshowercol[0]->DedxLongLL(int(jmshower::kPion));
167  // double ltepion = svcshowercol[0]->DedxTransLL(int(jmshower::kElectron)) - svcshowercol[0]->DedxTransLL(int(jmshower::kPion));
168 
169  // double llepi0 = svcshowercol[0]->DedxLongLL(int(jmshower::kElectron)) - svcshowercol[0]->DedxLongLL(int(jmshower::kPi0));
170  // double ltepi0 = svcshowercol[0]->DedxTransLL(int(jmshower::kElectron)) - svcshowercol[0]->DedxTransLL(int(jmshower::kPi0));
171 
172 
173 
174  // if(svcshowercol.size()==1 && lleproton<0 && lteproton<0) seltag1 = true;
175  // if(svcshowercol.size()==1 && llepion<0 && ltepion<0) seltag2 = true;
176  // if(svcshowercol.size()==1 && llepi0<0 && ltepi0<0) seltag3 = true;
177  if(svcshowercol.size()==1 && llemu<0 && ltemu<0) seltag4 = true;
178  std::cout<<"llemu, lleproton, llepion "<<llemu<<" "<<lleproton<<" "<<llepion<<std::endl;
179  }
180  // if(svcshowercol.size()==0) seltag0 = true;
181  return seltag4;
182  }
int PdgCode() const
Definition: MCParticle.h:211
int CCNC() const
Definition: MCNeutrino.h:148
double EndZ() const
Definition: MCParticle.h:227
const char * p
Definition: xmltok.h:285
const simb::MCParticle & Nu() const
Definition: MCNeutrino.h:146
bool isRealData() const
Definition: Event.h:83
double EndY() const
Definition: MCParticle.h:226
OStream cout
Definition: OStream.cxx:6
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Definition: DataViewImpl.h:344
int_type_
Neutrino interaction categories.
Definition: MCNeutrino.h:79
const TLorentzVector & Momentum(const int i=0) const
Definition: MCParticle.h:219
void geom(int which=0)
Definition: geom.C:163
double EndX() const
Definition: MCParticle.h:225
Event generator information.
Definition: MCNeutrino.h:18
int Mode() const
Definition: MCNeutrino.h:149
Definition: fwd.h:28
seed_t art::EngineCreator::get_seed_value ( fhicl::ParameterSet const &  pset,
char const  key[] = "seed",
seed_t const  implicit_seed = -1 
)
inherited
template<typename PROD , BranchType B>
ProductID art::EDFilter::getProductID ( std::string const &  instanceName = {}) const
inlineinherited

Definition at line 131 of file EDFilter.h.

References art::EDFilter::moduleDescription_.

Referenced by novaddt::HoughTrackMaker::create_associations().

132  {
133  return ProducerBase::getProductID<PROD, B>(moduleDescription_,
134  instanceName);
135  }
ModuleDescription moduleDescription_
Definition: EDFilter.h:124
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 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  }
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 189 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

190 {
191  if (!moduleContext_)
192  return ProductToken<T>::invalid();
193 
194  consumables_[BT].emplace_back(ConsumableType::Product,
195  TypeID{typeid(T)},
196  it.label(),
197  it.instance(),
198  it.process());
199  return ProductToken<T>{it};
200 }
set< int >::iterator it
static ProductToken< T > invalid()
Definition: ProductToken.h:47
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename T , art::BranchType BT>
void art::Consumer::mayConsumeMany ( )
inherited

Definition at line 204 of file Consumer.h.

References T.

205 {
206  if (!moduleContext_)
207  return;
208 
209  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
210 }
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
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 214 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

215 {
216  if (!moduleContext_)
217  return ViewToken<T>::invalid();
218 
219  consumables_[BT].emplace_back(ConsumableType::ViewElement,
220  TypeID{typeid(T)},
221  it.label(),
222  it.instance(),
223  it.process());
224  return ViewToken<T>{it};
225 }
set< int >::iterator it
static ViewToken< Element > invalid()
Definition: ProductToken.h:75
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
bool art::ProducerBase::modifiesEvent ( ) const
inlineinherited

Definition at line 40 of file ProducerBase.h.

References art::ProducerBase::getProductID(), and string.

41  {
42  return true;
43  }
static cet::exempt_ptr<Consumer> art::Consumer::non_module_context ( )
staticinherited
void art::Consumer::prepareForJob ( fhicl::ParameterSet const &  pset)
protectedinherited
void jmshower::RecoJMShowerFilter::reconfigure ( const fhicl::ParameterSet pset)

Definition at line 65 of file RecoJMShowerFilter_module.cc.

References fEvtCCNC, fEvtNuPdg, fNJMShower, fPotLabel, fhicl::ParameterSet::get(), and string.

Referenced by RecoJMShowerFilter().

66  {
67  fPotLabel = pset.get< std::string>("PotLabel");
68  fNJMShower = pset.get<int>("NJMShower");
69  fEvtNuPdg = pset.get<int>("EvtNuPdg");
70  fEvtCCNC = pset.get<int>("EvtCCNC");
71  }
std::string fPotLabel
Module that produced the POTSum object.
T get(std::string const &key) const
Definition: ParameterSet.h:231
enum BeamMode string
void art::Consumer::showMissingConsumes ( ) const
protectedinherited

Referenced by art::RootOutput::endJob().

void art::Consumer::validateConsumedProduct ( BranchType const  bt,
ProductInfo const &  pi 
)
protectedinherited

Member Data Documentation

constexpr bool art::EDFilter::Fail {false}
staticinherited

Definition at line 33 of file EDFilter.h.

Referenced by evgen::GENIEFilter::filter().

int jmshower::RecoJMShowerFilter::fEvtCCNC

Definition at line 49 of file RecoJMShowerFilter_module.cc.

Referenced by filter(), and reconfigure().

int jmshower::RecoJMShowerFilter::fEvtNuPdg

Definition at line 48 of file RecoJMShowerFilter_module.cc.

Referenced by filter(), and reconfigure().

int jmshower::RecoJMShowerFilter::fNJMShower

Definition at line 47 of file RecoJMShowerFilter_module.cc.

Referenced by reconfigure().

std::string jmshower::RecoJMShowerFilter::fPotLabel

Module that produced the POTSum object.

Definition at line 45 of file RecoJMShowerFilter_module.cc.

Referenced by reconfigure().

constexpr bool art::EDFilter::Pass {true}
staticinherited

Definition at line 32 of file EDFilter.h.

Referenced by evgen::GENIEFilter::filter().


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