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

 DetRespDrift (fhicl::ParameterSet const &p)
 
virtual ~DetRespDrift ()
 
bool filter (art::Event &e) override
 
void reconfigure (fhicl::ParameterSet const &p)
 
void beginJob () override
 
void endJob () override
 
bool beginRun (art::Run &r) override
 
bool endRun (art::Run &r) 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 ()
 

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
 

Private Member Functions

double getPECorr (art::Event &e, caldp::PCHit const &pchit)
 

Private Attributes

TTree * fTree
 
int run
 
uint32_t EventTimeHigh
 
double path
 
double trueE
 
double PECorr
 
double pe
 
std::string pathQual
 
std::string fPCHitLabel
 
std::string fQualXYName
 
std::string fQualZName
 
std::string fQualAvgName
 
std::string fLabel
 

Detailed Description

Definition at line 51 of file DetRespDrift_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

calib::DetRespDrift::DetRespDrift ( fhicl::ParameterSet const &  p)
explicit

Definition at line 86 of file DetRespDrift_module.cc.

87  {
88  this->reconfigure(p);
89 
90  }
const char * p
Definition: xmltok.h:285
void reconfigure(fhicl::ParameterSet const &p)
calib::DetRespDrift::~DetRespDrift ( )
virtual

Definition at line 92 of file DetRespDrift_module.cc.

93  {
94  // Clean up dynamic memory and other resources here.
95  }

Member Function Documentation

void calib::DetRespDrift::beginJob ( )
overridevirtual

Reimplemented from art::EDFilter.

Definition at line 192 of file DetRespDrift_module.cc.

References art::TFileDirectory::make(), and path.

193  {
194  // histograms for output
196 
197  fTree = tfs->make<TTree>("fTree","tree to hold variables");
198  fTree->Branch("run",&run);
199  fTree->Branch("EventTimeHigh",&EventTimeHigh);
200  fTree->Branch("pe",&pe);
201  fTree->Branch("PECorr",&PECorr);
202  fTree->Branch("trueE",&trueE);
203  fTree->Branch("path",&path);
204  fTree->Branch("pathQual",&pathQual);
205 
206 
207  }
Definition: run.py:1
T * make(ARGS...args) const
bool calib::DetRespDrift::beginRun ( art::Run r)
overridevirtual

Reimplemented from art::EDFilter.

Definition at line 209 of file DetRespDrift_module.cc.

209  {
210  return true;
211  }
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
void calib::DetRespDrift::endJob ( )
overridevirtual

Reimplemented from art::EDFilter.

Definition at line 220 of file DetRespDrift_module.cc.

References DEFINE_ART_MODULE().

221  {
222 
223  }
bool calib::DetRespDrift::endRun ( art::Run r)
overridevirtual

Reimplemented from art::EDFilter.

Definition at line 213 of file DetRespDrift_module.cc.

213  {
214 
216 
217  return true;
218  }
bool calib::DetRespDrift::filter ( art::Event e)
overridevirtual

Get the reconstructed tracks

Implements art::EDFilter.

Definition at line 97 of file DetRespDrift_module.cc.

References art::DataViewImpl::getByLabel(), MECModelEnuComparisons::i, makeTrainCVSamples::int, calib::j, path, art::Event::run(), art::Event::time(), and art::Timestamp::timeHigh().

98  {
99  /// Get the reconstructed tracks
101  e.getByLabel(fLabel, tracks);
102  if( tracks->size() == 0 ) return true;
103 
104  run = (int)(e.run());
105  art::Timestamp ts = e.time();
106  EventTimeHigh = ts.timeHigh();
107 
111 
112  if( !PCHitAvgGetter.isValid() && !PCHitXYGetter.isValid() && !PCHitZGetter.isValid()) return false;
113 
114  // loop over stopping tracks in event
115  for( unsigned int i=0; i<tracks->size(); ++i ){
116 
117  // loop over PCHits associated to stopping track
118  std::vector<art::Ptr<caldp::PCHit> > hitsXY = PCHitXYGetter.at(i);
119  std::vector<art::Ptr<caldp::PCHit> > hitsZ = PCHitZGetter.at(i);
120  std::vector<art::Ptr<caldp::PCHit> > hitsAvg = PCHitAvgGetter.at(i);
121 
122  // XY hits
123  for( unsigned int j=0; j<hitsXY.size(); ++j ){
124 
125  path = hitsXY[j]->Path();
126  trueE = hitsXY[j]->TrueMeV();
127  PECorr = this->getPECorr(e,*hitsXY[j]);
128  pe = hitsXY[j]->PE();
129  pathQual = "XY";
130 
131  fTree->Fill(); //fill ttree
132  }
133 
134  // Z hits
135  for( unsigned int j=0; j<hitsZ.size(); ++j ){
136 
137  path = hitsZ[j]->Path();
138  trueE = hitsZ[j]->TrueMeV();
139  PECorr = this->getPECorr(e,*hitsZ[j]);
140  pe = hitsZ[j]->PE();
141  pathQual = "Z";
142 
143  fTree->Fill(); //fill ttree
144  }
145 
146  // Avg hits
147  for( unsigned int j=0; j<hitsAvg.size(); ++j ){
148 
149  path = hitsAvg[j]->Path();
150  trueE = hitsAvg[j]->TrueMeV();
151  PECorr = this->getPECorr(e,*hitsAvg[j]);
152  pe = hitsAvg[j]->PE();
153  pathQual = "Avg";
154 
155  fTree->Fill(); //fill ttree
156  }
157 
158  }
159 
160  return true;
161 
162  }
constexpr std::uint32_t timeHigh() const
Definition: Timestamp.h:35
const double j
Definition: BetheBloch.cxx:29
Definition: run.py:1
double getPECorr(art::Event &e, caldp::PCHit const &pchit)
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Definition: DataViewImpl.h:344
Timestamp time() const
Definition: Event.h:61
RunNumber_t run() const
Definition: Event.h:77
seed_t art::EngineCreator::get_seed_value ( fhicl::ParameterSet const &  pset,
char const  key[] = "seed",
seed_t const  implicit_seed = -1 
)
inherited
double calib::DetRespDrift::getPECorr ( art::Event e,
caldp::PCHit const &  pchit 
)
private

Definition at line 164 of file DetRespDrift_module.cc.

References caldp::PCHit::Cell(), calib::Calibrator::GetPECorr(), caldp::PCHit::GoodTime(), art::Event::isRealData(), caldp::PCHit::PE(), caldp::PCHit::Plane(), rb::CellHit::SetCell(), rawdata::RawDigit::SetMC(), rb::CellHit::SetPE(), rb::CellHit::SetPlane(), rb::CellHit::SetTNS(), rb::CellHit::SetView(), caldp::PCHit::TNS(), caldp::PCHit::View(), and caldp::PCHit::W().

164  {
165 
166  //Calibrator necessary to get Atten information
168 
169  //Make mock cellhit
170  rb::CellHit cellhit;
171  cellhit.SetPlane(pchit.Plane());
172  cellhit.SetCell(pchit.Cell());
173  cellhit.SetView(pchit.View());
174  cellhit.SetTNS(pchit.TNS(),pchit.GoodTime());
175  if(!e.isRealData())cellhit.SetMC(); // assume only filled for MC...
176  cellhit.SetPE(pchit.PE());
177 
178  double pecorr = calibrator->GetPECorr(cellhit, pchit.W());
179  return pecorr;
180  }
void SetTNS(float tns, bool good)
Definition: CellHit.h:56
bool isRealData() const
Definition: Event.h:83
void SetView(geo::View_t view)
Definition: CellHit.h:54
void SetPlane(unsigned short plane)
Definition: CellHit.h:53
void SetCell(unsigned short cell)
Definition: CellHit.h:52
void SetPE(float pe)
Definition: CellHit.h:55
void SetMC(bool isMC=true)
Definition: RawDigit.h:106
A rawdata::RawDigit with channel information decoded.
Definition: CellHit.h:27
double GetPECorr(rb::CellHit const &cellhit, double w)
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 calib::DetRespDrift::reconfigure ( fhicl::ParameterSet const &  p)

Definition at line 182 of file DetRespDrift_module.cc.

References fhicl::ParameterSet::get(), and string.

183  {
184  fPCHitLabel = pset.get< std::string >("PCHitLabel"); //Label of PCHitList module
185  fQualXYName = pset.get< std::string >("QualXYName"); //Instance label, "XY" quality hits
186  fQualZName = pset.get< std::string >("QualZName"); //Instance label, "Z" quality hits
187  fQualAvgName = pset.get< std::string >("QualAvgName"); //Instance label, "Avg" quality hits
188  fLabel = pset.get<std::string>("Label");
189 
190  }
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

uint32_t calib::DetRespDrift::EventTimeHigh
private

Definition at line 69 of file DetRespDrift_module.cc.

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

Definition at line 33 of file EDFilter.h.

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

std::string calib::DetRespDrift::fLabel
private

Definition at line 81 of file DetRespDrift_module.cc.

std::string calib::DetRespDrift::fPCHitLabel
private

Definition at line 77 of file DetRespDrift_module.cc.

std::string calib::DetRespDrift::fQualAvgName
private

Definition at line 80 of file DetRespDrift_module.cc.

std::string calib::DetRespDrift::fQualXYName
private

Definition at line 78 of file DetRespDrift_module.cc.

std::string calib::DetRespDrift::fQualZName
private

Definition at line 79 of file DetRespDrift_module.cc.

TTree* calib::DetRespDrift::fTree
private

Definition at line 66 of file DetRespDrift_module.cc.

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

Definition at line 32 of file EDFilter.h.

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

double calib::DetRespDrift::path
private
std::string calib::DetRespDrift::pathQual
private

Definition at line 74 of file DetRespDrift_module.cc.

double calib::DetRespDrift::pe
private

Definition at line 73 of file DetRespDrift_module.cc.

double calib::DetRespDrift::PECorr
private

Definition at line 72 of file DetRespDrift_module.cc.

int calib::DetRespDrift::run
private

Definition at line 68 of file DetRespDrift_module.cc.

Referenced by Metric.Metric::__repr__(), and fabricate.Builder::memoize().

double calib::DetRespDrift::trueE
private

Definition at line 71 of file DetRespDrift_module.cc.


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