Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
ncid::MakeNCCosRej Class Reference
Inheritance diagram for ncid::MakeNCCosRej:
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

 MakeNCCosRej (fhicl::ParameterSet const &p)
 
 ~MakeNCCosRej ()
 
void beginRun (art::Run &evt) override
 
void reconfigure (const fhicl::ParameterSet &p)
 
void produce (art::Event &e) override
 
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 ()
 

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 Member Functions

double TransMomFraction (const std::vector< art::Ptr< rb::Prong > > &prongs) const
 

Private Attributes

std::string fSliceLabel
 
std::string fProngLabel
 
std::string fProngInstance
 
std::string fCVNLabel
 
std::string fShowerLIDLabel
 
std::string fShowerLabel
 
std::string fCosmicTrackLabel
 
std::string fCellHitLabel
 
std::string fCosRejLabel
 
std::string fPIDLibPath
 
std::string fNCCosRejPIDFile
 
std::string fNCCosRejPIDGFile
 
TMVA::Reader * fReaderDT
 
TMVA::Reader * fReaderGBDT
 
float TMVAvars [13]
 
fhicl::ParameterSet fParticleIDAlgPSet
 Particle ID alorithm (loglikelihoods and dE/dx) More...
 

Detailed Description

Definition at line 53 of file MakeNCCosRej_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

ncid::MakeNCCosRej::MakeNCCosRej ( fhicl::ParameterSet const &  p)
explicit

Definition at line 104 of file MakeNCCosRej_module.cc.

References reconfigure().

104  :
105  fReaderDT(nullptr),
106  fReaderGBDT(nullptr),
107  //fParticleIDAlg(0),
108  fParticleIDAlgPSet(p.get< fhicl::ParameterSet >("ParticleIDAlgPSet"))
109  {
110  produces< std::vector<ncid::NCCosRej> > ();
111  produces< art::Assns<ncid::NCCosRej, rb::Cluster> > ();
112  this->reconfigure(p);
113  }
const char * p
Definition: xmltok.h:285
void reconfigure(const fhicl::ParameterSet &p)
TMVA::Reader * fReaderGBDT
TMVA::Reader * fReaderDT
fhicl::ParameterSet fParticleIDAlgPSet
Particle ID alorithm (loglikelihoods and dE/dx)
ncid::MakeNCCosRej::~MakeNCCosRej ( )

Definition at line 115 of file MakeNCCosRej_module.cc.

References fReaderDT, and fReaderGBDT.

116  {
117  if(fReaderDT) delete fReaderDT;
118  if(fReaderGBDT) delete fReaderGBDT;
119  }
TMVA::Reader * fReaderGBDT
TMVA::Reader * fReaderDT

Member Function Documentation

void ncid::MakeNCCosRej::beginRun ( art::Run evt)
overridevirtual

Reimplemented from art::EDProducer.

Definition at line 121 of file MakeNCCosRej_module.cc.

References allTimeWatchdog::endl, util::EnvExpansion(), cet::file_exists(), fNCCosRejPIDFile, fNCCosRejPIDGFile, fPIDLibPath, fReaderDT, fReaderGBDT, geom(), string, and TMVAvars.

122  {
124 
125  // Make sure we can find the Real Adaptive Boosted Decision Trees weight file before we set up MVA
126  if(!cet::file_exists(pidlibpath+fNCCosRejPIDFile)){
127  throw cet::exception("MakeNCCosRej")
128  << "Couldn't find file " << pidlibpath+fNCCosRejPIDFile <<std::endl;
129  }
130  // Make sure we can find the Gradient Boosted Decision Trees weight file before we set up MVA
131  if(!cet::file_exists(pidlibpath+fNCCosRejPIDGFile)){
132  throw cet::exception("MakeNCCosRej")
133  << "Couldn't find file " << pidlibpath+fNCCosRejPIDGFile <<std::endl;
134  }
135 
137 
138  fReaderDT = new TMVA::Reader;
139  fReaderDT->AddVariable("cosmicid", &TMVAvars[0]); //cosmicid
140  fReaderDT->AddVariable("partptp", &TMVAvars[1]); //partptp
141  fReaderDT->AddVariable("shwnhit", &TMVAvars[2]); //shwnhit
142  fReaderDT->AddVariable("shwxminusy", &TMVAvars[3]); //shwminusy
143  fReaderDT->AddVariable("shwxplusy", &TMVAvars[4]); //shwxplusy
144  fReaderDT->AddVariable("shwxovery", &TMVAvars[5]); //shwxpvery
145  fReaderDT->AddVariable("shwcalE", &TMVAvars[6]); //shwcalE
146  fReaderDT->AddVariable("shwdirY", &TMVAvars[7]); //shwdirY
147  fReaderDT->AddVariable("shwlen", &TMVAvars[8]); //shwlen
148  fReaderDT->AddVariable("shwwwidth", &TMVAvars[9]); //shwwwidth
149  fReaderDT->AddVariable("shwGap", &TMVAvars[10]); //shwGap
150  fReaderDT->AddVariable("nshwlid", &TMVAvars[11]); //nshwlid
151  fReaderDT->AddVariable("nmiphit", &TMVAvars[12]); //nmiphit
152  fReaderDT->BookMVA("BDTA",pidlibpath+fNCCosRejPIDFile);
153 
154  fReaderGBDT = new TMVA::Reader;
155  fReaderGBDT->AddVariable("cosmicid", &TMVAvars[0]); //cosmicid
156  fReaderGBDT->AddVariable("partptp", &TMVAvars[1]); //partptp
157  fReaderGBDT->AddVariable("shwnhit", &TMVAvars[2]); //shwnhit
158  fReaderGBDT->AddVariable("shwxminusy", &TMVAvars[3]); //shwminusy
159  fReaderGBDT->AddVariable("shwxplusy", &TMVAvars[4]); //shwxplusy
160  fReaderGBDT->AddVariable("shwxovery", &TMVAvars[5]); //shwxpvery
161  fReaderGBDT->AddVariable("shwcalE", &TMVAvars[6]); //shwcalE
162  fReaderGBDT->AddVariable("shwdirY", &TMVAvars[7]); //shwdirY
163  fReaderGBDT->AddVariable("shwlen", &TMVAvars[8]); //shwlen
164  fReaderGBDT->AddVariable("shwwwidth", &TMVAvars[9]); //shwwwidth
165  fReaderGBDT->AddVariable("shwGap", &TMVAvars[10]); //shwGap
166  fReaderGBDT->AddVariable("nshwlid", &TMVAvars[11]); //nshwlid
167  fReaderGBDT->AddVariable("nmiphit", &TMVAvars[12]); //nmiphit
168  fReaderGBDT->BookMVA("BDTG", pidlibpath+fNCCosRejPIDGFile);
169 }
std::string EnvExpansion(const std::string &inString)
Function to expand environment variables.
Definition: EnvExpand.cxx:8
::xsd::cxx::tree::exception< char > exception
Definition: Database.h:225
TMVA::Reader * fReaderGBDT
void geom(int which=0)
Definition: geom.C:163
bool file_exists(std::string const &qualified_filename)
TMVA::Reader * fReaderDT
enum BeamMode string
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::EDProducer::currentContext ( ) const
protectedinherited
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::EDProducer::getProductID ( std::string const &  instanceName = {}) const
inlineinherited

Definition at line 123 of file EDProducer.h.

References art::EDProducer::moduleDescription_.

Referenced by skim::NueSkimmer::CopyMichelSlice(), and skim::NueSkimmer::CopyMichelTrack().

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 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 ncid::MakeNCCosRej::produce ( art::Event e)
overridevirtual

Implements art::EDProducer.

Definition at line 189 of file MakeNCCosRej_module.cc.

References rb::CellHit::Cell(), slid::CompareByEnergy(), ana::cosmicid, util::CreateAssn(), fCellHitLabel, fCosRejLabel, fCVNLabel, art::fill_ptr_vector(), check_time_usage::float, fProngInstance, fProngLabel, fReaderDT, fReaderGBDT, fShowerLIDLabel, fSliceLabel, geom(), art::DataViewImpl::getByLabel(), rb::RecoHit::IsCalibrated(), rb::Cluster::IsNoise(), m, ana::nmiphit, ana::nshwlid, partptp, rb::RecoHit::PECorr(), art::PtrVector< T >::push_back(), art::Event::put(), rb::RecoHit::RecoHit(), ncid::NCCosRej::SetCosPIDDT(), ncid::NCCosRej::SetCosPIDDTG(), ncid::NCCosRej::SetProngTransMom(), ana::shwcalE, ana::shwdirY, ana::shwGap, ana::shwlen, ana::shwnhit, ana::shwnhitx, ana::shwnhity, ana::shwxminusy, ana::shwxovery, ana::shwxplusy, TMVAvars, and TransMomFraction().

190  {
193 
194  std::unique_ptr< std::vector<ncid::NCCosRej> >
195  ncCosRejjies(new std::vector< ncid::NCCosRej >);
196  std::unique_ptr< art::Assns<ncid::NCCosRej, rb::Cluster> >
198  // Get the slices in the event
200  evt.getByLabel( fSliceLabel, sliceHandle);
201 
202  std::vector< art::Ptr<rb::Cluster> > slices;
203  art::fill_ptr_vector(slices, sliceHandle);
204 
206  evt.getByLabel(fCellHitLabel, htHandle);
207 
209 
210  for(unsigned int m = 0; m < htHandle->size(); ++m){
211  allHits.push_back(art::Ptr<rb::CellHit>(htHandle,m));
212  }
213  // Get things associated with slices
215  art::FindMany<slid::ShowerLID> showerLidAssn(sliceHandle, evt, fShowerLIDLabel);
217 
218  const int nslices = slices.size();
219  for(int isli = 0; isli < nslices; ++isli){
220  // Loop over slices
221  art::Ptr<rb::Cluster> thisSlice = slices.at(isli);
222 
223  if(thisSlice->IsNoise()) continue;
224  if(!prongAssn.isValid()) continue;
225 
226  ncid::NCCosRej nccosrej;
227  std::vector< art::Ptr<rb::Prong> > prongs = prongAssn.at(isli);
228 
229  if(prongs.empty()) continue;
230 
231  nccosrej.SetProngTransMom(TransMomFraction(prongs));
232  std::vector< art::Ptr<cosrej::NueCosRej> > cosrejs = fmcr.at(isli);
233 
234  if(cosrejs.empty()) continue;
235 
236  // Need CVN, input to Real Adaptive BDT
237  art::FindManyP<cvn::Result> fmCVN(slices, evt, fCVNLabel);
238 
239  if(!fmCVN.isValid()) continue;
240 
241  std::vector< art::Ptr<cvn::Result> > cvns = fmCVN.at(isli);
242  // CVN values
243  float cosmicid = 0.;
244  if(!cvns.empty()) cosmicid = cvns[0]->fOutput[14];
245 
246  // LIDShower values
247  float shwGap = -5.;
248  float shwnhit = -5.;
249  float shwnhitx = -5.;
250  float shwnhity = -5.;
251  float shwwwidth = -5.;
252  float shwcalE = -5.;
253  float shwdirY = -5.;
254  float shwlen = -5.;
255  float partptp = -5.;
256  /////////////////////// Fill the PIDs ////////////////////////////
257  // Only execute when there are showers associated with the shwlids
258  if(!showerLidAssn.isValid()) continue;
259 
260  std::vector<const slid::ShowerLID*> shwlids = showerLidAssn.at(isli);
261  if(shwlids.empty()) continue;
262 
263  sort(shwlids.begin(), shwlids.end(), slid::CompareByEnergy);
265  float nshwlid = shwlids.size();
266 
267  if(!foSh.isValid()) continue;
268 
269  cet::maybe_ref< art::Ptr<rb::Shower> const > roSh(foSh.at(0));
270  art::Ptr<rb::Shower> shower = roSh.ref();
271  std::vector< art::Ptr<rb::Shower> > showers;
272  showers.push_back(shower);
274 
275  if(!foShLID.isValid()) continue;
276 
277  cet::maybe_ref<art::Ptr<slid::ShowerLID> const> roShLID(foShLID.at(0));
278  art::Ptr<slid::ShowerLID> showerLID = roShLID.ref();
279 
280  int nMipHit = 0;
281  for(size_t hitIdx = 0; hitIdx < slices[isli]->NCell(); ++hitIdx){
282  const art::Ptr<rb::CellHit>& chptr = slices[isli]->Cell(hitIdx);
283  const rb::RecoHit rhit = slices[isli]->RecoHit(chptr);
284  if(!rhit.IsCalibrated()) continue;
285  if((rhit.PECorr() > 100.0) && (rhit.PECorr() < 245.0)) nMipHit++;
286  } // end of hits loop
287 
288  shwGap = showerLID->Gap();
289  shwnhit = shower->NCell();
290  shwwwidth = showerLID->Radius();
291  shwcalE = showerLID->ShowerEnergy();
292  shwnhitx = shower->NXCell();
293  shwdirY = (float)shower->Dir().Y();
294  shwnhity = shower->NYCell();
295  shwlen = shower->TotalLength();
296  partptp = cosrejs[0]->ParticleShowerTransMom();
297  float shwxminusy = shwnhitx - shwnhity;
298  float shwxplusy = shwnhitx + shwnhity;
299  float shwxovery = shwxminusy/shwxplusy;
300  float nmiphit = nMipHit;
301 
302 
303  TMVAvars[0] = cosmicid; //ncid
304  TMVAvars[1] = partptp; //partptp
305  //TMVAvars[1] = nccosrej.ProngTransMom(); //partptp
306  TMVAvars[2] = shwnhit; //shwnhit;
307  TMVAvars[3] = shwxminusy;
308  TMVAvars[4] = shwxplusy;
309  TMVAvars[5] = shwxovery;
310  TMVAvars[6] = shwcalE; //shwcalE
311  TMVAvars[7] = shwdirY; //shwdirY
312  TMVAvars[8] = shwlen; //shwlen
313  TMVAvars[9] = shwwwidth; //shwwidth
314  TMVAvars[10] = shwGap; //shwgap
315  TMVAvars[11] = nshwlid;
316  TMVAvars[12] = nmiphit; //nmiphit;
317 
318  nccosrej.SetCosPIDDT(fReaderDT->EvaluateMVA("BDTA"));
319  nccosrej.SetCosPIDDTG(fReaderGBDT->EvaluateMVA("BDTG"));
320  ncCosRejjies->push_back(nccosrej);
321  util::CreateAssn(*this, evt, *ncCosRejjies, thisSlice ,*sliceAssn);
322  } // end loop over slices
323 
324  evt.put(std::move(sliceAssn));
325  evt.put(std::move(ncCosRejjies));
326  } // end of producer
float nshwlid
static bool CreateAssn(art::EDProducer const &prod, art::Event &evt, std::vector< T > &a, art::Ptr< U > b, art::Assns< T, U > &assn, size_t indx=UINT_MAX, std::string const &instance=std::string())
Create a 1 to 1 association between a new product and one already in the event.
float shwnhity
float shwGap
float shwxplusy
void SetProngTransMom(double input)
Definition: NCCosRej.h:28
float shwnhitx
bool CompareByEnergy(const slid::ShowerLID *a, const slid::ShowerLID *b)
Definition: ShowerLID.cxx:51
float shwcalE
Calibrated quantities relying on position in the orthogonal view. To generate a rb::CellHit from a rb...
Definition: RecoHit.h:19
float cosmicid
unsigned short Cell() const
Definition: CellHit.h:40
double TransMomFraction(const std::vector< art::Ptr< rb::Prong > > &prongs) const
float shwlen
float nmiphit
float partptp
void push_back(Ptr< U > const &p)
Definition: PtrVector.h:441
TMVA::Reader * fReaderGBDT
int evt
bool IsCalibrated() const
You MUST check here before accessing PECorr, MIP or GeV.
Definition: RecoHit.cxx:35
void SetCosPIDDTG(double input)
Definition: NCCosRej.h:34
float shwdirY
float shwxovery
float shwxminusy
void geom(int which=0)
Definition: geom.C:163
void SetCosPIDDT(double input)
Definition: NCCosRej.h:31
float shwnhit
float PECorr() const
Definition: RecoHit.cxx:47
bool IsNoise() const
Is the noise flag set?
Definition: Cluster.h:163
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
Definition: Ptr.h:464
TMVA::Reader * fReaderDT
void ncid::MakeNCCosRej::reconfigure ( const fhicl::ParameterSet p)

Definition at line 171 of file MakeNCCosRej_module.cc.

References fCellHitLabel, fCosRejLabel, fCVNLabel, fNCCosRejPIDFile, fNCCosRejPIDGFile, fParticleIDAlgPSet, fPIDLibPath, fProngInstance, fProngLabel, fShowerLabel, fShowerLIDLabel, fSliceLabel, fhicl::ParameterSet::get(), and string.

Referenced by MakeNCCosRej().

172  {
173  //fMCTruthModuleLabel = p.get< std::string >("MCTruthModuleLabel");
174  fSliceLabel = p.get< std::string >("SliceLabel");
175  fCellHitLabel = p.get< std::string >("CellHitLabel");
176  fProngLabel = p.get< std::string >("ProngLabel");
177  fProngInstance = p.get< std::string >("ProngInstance");
178  fCVNLabel = p.get< std::string >("CVNLabel");
179  fShowerLabel = p.get< std::string >("ShowerLabel");
180  fShowerLIDLabel = p.get< std::string >("ShowerLIDLabel");
181  fPIDLibPath = p.get< std::string >("PIDLibPath");
182  fCosRejLabel = p.get< std::string >("CosRejLabel");
183  fNCCosRejPIDFile = p.get< std::string >("NCCosRejPIDFile");
184  fNCCosRejPIDGFile = p.get< std::string >("NCCosRejPIDGFile");
185  fParticleIDAlgPSet = p.get< fhicl::ParameterSet >("ParticleIDAlgPSet");
186  }
T get(std::string const &key) const
Definition: ParameterSet.h:231
fhicl::ParameterSet fParticleIDAlgPSet
Particle ID alorithm (loglikelihoods and dE/dx)
enum BeamMode string
void art::Consumer::showMissingConsumes ( ) const
protectedinherited

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

double ncid::MakeNCCosRej::TransMomFraction ( const std::vector< art::Ptr< rb::Prong > > &  prongs) const
private

Return transverse momentum fraction of the event. Calculation based on reconstructed prongs.

Definition at line 329 of file MakeNCCosRej_module.cc.

References geom(), geo::GeometryBase::NuMIBeamDirection(), runNovaSAM::ret, and w.

Referenced by produce().

330  {
331  if(prongs.empty()) return 0;
332 
333  TVector3 ret;
334  for(const art::Ptr<rb::Prong>& prong: prongs){
335  if(!prong->Is3D()) continue;
336  const double w = prong->CalorimetricEnergy();
337  ret += w*prong->Dir();
338  }
339 
340  ret = ret.Unit();
341 
343  const TVector3 beamDir = geom->NuMIBeamDirection();
344  const double beamProj = ret.Dot(beamDir);
345 
346  return (ret-beamProj*beamDir).Mag();
347  }
TVector3 NuMIBeamDirection() const
Direction of neutrinos from the NuMI beam (unit vector)
void geom(int which=0)
Definition: geom.C:163
Float_t w
Definition: plot.C:20
Definition: fwd.h:28
void art::Consumer::validateConsumedProduct ( BranchType const  bt,
ProductInfo const &  pi 
)
protectedinherited

Member Data Documentation

std::string ncid::MakeNCCosRej::fCellHitLabel
private

Definition at line 73 of file MakeNCCosRej_module.cc.

Referenced by produce(), and reconfigure().

std::string ncid::MakeNCCosRej::fCosmicTrackLabel
private

Definition at line 72 of file MakeNCCosRej_module.cc.

std::string ncid::MakeNCCosRej::fCosRejLabel
private

Definition at line 74 of file MakeNCCosRej_module.cc.

Referenced by produce(), and reconfigure().

std::string ncid::MakeNCCosRej::fCVNLabel
private

Definition at line 69 of file MakeNCCosRej_module.cc.

Referenced by produce(), and reconfigure().

std::string ncid::MakeNCCosRej::fNCCosRejPIDFile
private

Definition at line 76 of file MakeNCCosRej_module.cc.

Referenced by beginRun(), and reconfigure().

std::string ncid::MakeNCCosRej::fNCCosRejPIDGFile
private

Definition at line 77 of file MakeNCCosRej_module.cc.

Referenced by beginRun(), and reconfigure().

fhicl::ParameterSet ncid::MakeNCCosRej::fParticleIDAlgPSet
private

Particle ID alorithm (loglikelihoods and dE/dx)

FCL parameters for particle ID alorithm (loglikelihoods and dE/dx)

Definition at line 88 of file MakeNCCosRej_module.cc.

Referenced by reconfigure().

std::string ncid::MakeNCCosRej::fPIDLibPath
private

Definition at line 75 of file MakeNCCosRej_module.cc.

Referenced by beginRun(), and reconfigure().

std::string ncid::MakeNCCosRej::fProngInstance
private

Definition at line 68 of file MakeNCCosRej_module.cc.

Referenced by produce(), and reconfigure().

std::string ncid::MakeNCCosRej::fProngLabel
private

Definition at line 67 of file MakeNCCosRej_module.cc.

Referenced by produce(), and reconfigure().

TMVA::Reader* ncid::MakeNCCosRej::fReaderDT
private

Definition at line 79 of file MakeNCCosRej_module.cc.

Referenced by beginRun(), produce(), and ~MakeNCCosRej().

TMVA::Reader* ncid::MakeNCCosRej::fReaderGBDT
private

Definition at line 80 of file MakeNCCosRej_module.cc.

Referenced by beginRun(), produce(), and ~MakeNCCosRej().

std::string ncid::MakeNCCosRej::fShowerLabel
private

Definition at line 71 of file MakeNCCosRej_module.cc.

Referenced by reconfigure().

std::string ncid::MakeNCCosRej::fShowerLIDLabel
private

Definition at line 70 of file MakeNCCosRej_module.cc.

Referenced by produce(), and reconfigure().

std::string ncid::MakeNCCosRej::fSliceLabel
private

Definition at line 66 of file MakeNCCosRej_module.cc.

Referenced by produce(), and reconfigure().

float ncid::MakeNCCosRej::TMVAvars[13]
private

Definition at line 83 of file MakeNCCosRej_module.cc.

Referenced by beginRun(), and produce().


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