Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes | List of all members
mcchk::ShowerAnaCheck Class Reference

check the results from the Monte Carlo generator More...

Inheritance diagram for mcchk::ShowerAnaCheck:
art::EDAnalyzer art::EventObserverBase art::Consumer art::EngineCreator

Public Types

using WorkerType = WorkerT< EDAnalyzer >
 
using ModuleType = EDAnalyzer
 

Public Member Functions

 ShowerAnaCheck (fhicl::ParameterSet const &pset)
 
virtual ~ShowerAnaCheck ()
 
void analyze (const art::Event &evt)
 
void reconfigure (const fhicl::ParameterSet &pset)
 
void beginJob ()
 
void EMShowerWidth (float &Event_distance, int MomsID, const sim::Particle *part, const std::vector< sim::FLSHit > &hits)
 When this function is run, it finds the average distance, weighted by energy, to flshits over the shower. More...
 
void EMMoliereRadius (float &Moliere_radius, int MomsID, const sim::Particle *part, const std::vector< sim::FLSHit > &hits)
 This function calculates the Moliere Radius. More...
 
float PointLineDistance (float x, float y, float z, float x1, float y1, float z1, float x2, float y2, float z2)
 
std::string workerType () const
 
bool modifiesEvent () const
 
void registerProducts (MasterProductRegistry &, ProductDescriptions &, ModuleDescription const &)
 
std::string const & processName () const
 
bool wantAllEvents () const
 
bool wantEvent (Event const &e)
 
fhicl::ParameterSetID selectorConfig () const
 
art::Handle< art::TriggerResultsgetTriggerResults (Event const &e) 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
 
detail::CachedProducts & cachedProducts ()
 
void validateConsumedProduct (BranchType const bt, ProductInfo const &pi)
 
void prepareForJob (fhicl::ParameterSet const &pset)
 
void showMissingConsumes () const
 

Private Attributes

std::string fFLSHitListLabel
 
std::vector< float > Half_Width_of_Detector
 
std::vector< float > Half_Height_of_Detector
 
std::vector< float > Begin_of_Detector_in_Z
 
std::vector< float > End_of_Detector_in_Z
 
std::vector< float > Energy_Percent
 
std::vector< float > Min_Energy
 
double XYZ [3]
 
double XYZWorld [3]
 
TH1F * fShowerMotherPDG
 
TH1F * fVx
 
TH1F * fVy
 
TH1F * fVz
 
TH1F * fTruthEnergy
 
TH1F * fCosTheta
 
TH1F * fNumberPerEvent
 
TH1F * fEnergyofShower
 
TH1F * fEventWidth
 
TH1F * fMoliereRadius
 

Detailed Description

check the results from the Monte Carlo generator

Definition at line 39 of file ShowerAnaCheck_module.cc.

Member Typedef Documentation

Definition at line 39 of file EDAnalyzer.h.

Definition at line 38 of file EDAnalyzer.h.

Constructor & Destructor Documentation

mcchk::ShowerAnaCheck::ShowerAnaCheck ( fhicl::ParameterSet const &  pset)
explicit

Definition at line 84 of file ShowerAnaCheck_module.cc.

References reconfigure().

85  : EDAnalyzer(pset)
86  {
87  this->reconfigure(pset);
88  }
void reconfigure(const fhicl::ParameterSet &pset)
EDAnalyzer(Table< Config > const &config)
Definition: EDAnalyzer.h:100
mcchk::ShowerAnaCheck::~ShowerAnaCheck ( )
virtual

Definition at line 92 of file ShowerAnaCheck_module.cc.

92 { }

Member Function Documentation

void mcchk::ShowerAnaCheck::analyze ( const art::Event evt)

Definition at line 126 of file ShowerAnaCheck_module.cc.

References abs(), sim::ParticleNavigator::begin(), Begin_of_Detector_in_Z, om::cerr, simb::MCParticle::E(), EMMoliereRadius(), EMShowerWidth(), sim::ParticleNavigator::end(), End_of_Detector_in_Z, allTimeWatchdog::endl, Energy_Percent, fCosTheta, fEnergyofShower, fEventWidth, fFLSHitListLabel, sim::FLSHitList::fHits, fMoliereRadius, fNumberPerEvent, fShowerMotherPDG, fTruthEnergy, fVx, fVy, fVz, art::DataViewImpl::getByLabel(), Half_Height_of_Detector, Half_Width_of_Detector, hits(), calib::j, Min_Energy, simb::MCParticle::P(), part, cheat::BackTracker::ParticleNavigator(), simb::MCParticle::PdgCode(), simb::MCParticle::Pz(), simb::MCParticle::TrackId(), simb::MCParticle::Vx(), simb::MCParticle::Vy(), and simb::MCParticle::Vz().

127  {
128 
129  mf::LogInfo("ShowerAnaCheck") << "Calculating Shower Parameters";
130 
131  // Get the FLS list information out of the event
133  evt.getByLabel(fFLSHitListLabel, hitlist);
134  if (hitlist->empty()){
135  std::cerr << "no flshit list for this event" << std::endl;
136  return;
137  }
138 
139  art::Ptr<sim::FLSHitList> hlist(hitlist, 0);
140  const std::vector<sim::FLSHit>& hits = hlist->fHits;
141 
142  int Number_of_showers_per_event = 0;
143 
145  const sim::ParticleNavigator& pnav = bt->ParticleNavigator();
146 
147  // loop over particles, we test if each makes the cuts, then fill histograms
148  for (sim::ParticleNavigator::const_iterator k = pnav.begin(); k != pnav.end(); ++k){
149 
150  const sim::Particle* part = (*k).second;
151 
152  // Yay! Cuts!
153  bool isElectronorPhoton = 0;
154  bool isVertexContained = 0;
155  bool isEnergyContained = 0;
156  bool isEnergeticEnough = 0;
157  float Energy_of_shower = 0;
158  for (unsigned int j=0; j<hits.size(); ++j) if(hits[j].GetTrackID() == part->TrackId()) Energy_of_shower += hits[j].GetEdep();
159  // run a cut on particle type +-11 = electron/positron, 22 = photon
160  if (abs(part->PdgCode()) == 11 || part->PdgCode() == 22)
161  isElectronorPhoton = 1;
162  // run a cut on the vertex, require it to be in the interior of the detector
163  if (abs(part->Vx()) < Half_Width_of_Detector[0] &&
164  abs(part->Vy()) < Half_Height_of_Detector[0] &&
165  part->Vz() < End_of_Detector_in_Z[0] &&
166  part->Vz() > Begin_of_Detector_in_Z[0])
167  isVertexContained = 1;
168  // run a cut on how much energy is deposited by flshits, a measure of containment
169  // the detector is 70% active, so if we have ~70% deposited, the shower is essentially contained
170  if (Energy_of_shower/part->E() > Energy_Percent[0])
171  isEnergyContained = 1;
172  // cut on energy, don't want particles without enough energy to develope a shower
173  if (part->E() > Min_Energy[0])
174  isEnergeticEnough = 1;
175 
176  // If the particle passes the cuts, run this so that we can fill histograms
177  if (isElectronorPhoton && isVertexContained && isEnergyContained && isEnergeticEnough){
178  ++ Number_of_showers_per_event;
179  float Event_distance = 0;
180  float Moliere_radius = 0;
181  for (unsigned int j=0; j<hits.size(); ++j)
182  if(hits[j].GetTrackID() == part->TrackId()) Energy_of_shower += hits[j].GetEdep();
183  // Fill hists with quick MCParticle variables for MC validation
184  fShowerMotherPDG->Fill(part->PdgCode());
185  fVx->Fill(part->Vx());
186  fVy->Fill(part->Vy());
187  fVz->Fill(part->Vz());
188  fTruthEnergy->Fill(part->E());
189  fCosTheta->Fill(part->Pz()/part->P());
190  fEnergyofShower->Fill(Energy_of_shower);
191  // Call the shower width function to calculate the average distance to FLS Hits
192  EMShowerWidth(Event_distance, part->TrackId(), part, hits);
193  // Fill histogram with average distance for event
194  fEventWidth->Fill(Event_distance);
195  // Call the Moliere Radius function to calculate Moliere Radius
196  EMMoliereRadius(Moliere_radius, part->TrackId(), part, hits);
197  // Fill histogram with Moliere radius for event
198  fMoliereRadius->Fill(Moliere_radius);
199  }
200 
201  } // end loop over particles
202 
203  // After running through all particles, we want to fill the number of showers in the event here
204  if (Number_of_showers_per_event > 0) fNumberPerEvent->Fill(Number_of_showers_per_event);
205 
206  } // end of main analyze function
double E(const int i=0) const
Definition: MCParticle.h:232
int PdgCode() const
Definition: MCParticle.h:211
const sim::ParticleNavigator & ParticleNavigator() const
Get a reference to the ParticleNavigator.
Definition: BackTracker.h:744
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
std::vector< float > Half_Height_of_Detector
list_type::const_iterator const_iterator
std::vector< float > Half_Width_of_Detector
OStream cerr
Definition: OStream.cxx:7
void abs(TH1 *hist)
int TrackId() const
Definition: MCParticle.h:209
TString part[npart]
Definition: Style.C:32
void hits()
Definition: readHits.C:15
std::vector< float > End_of_Detector_in_Z
std::vector< float > Energy_Percent
double P(const int i=0) const
Definition: MCParticle.h:233
std::vector< float > Min_Energy
const double j
Definition: BetheBloch.cxx:29
void EMShowerWidth(float &Event_distance, int MomsID, const sim::Particle *part, const std::vector< sim::FLSHit > &hits)
When this function is run, it finds the average distance, weighted by energy, to flshits over the sho...
void EMMoliereRadius(float &Moliere_radius, int MomsID, const sim::Particle *part, const std::vector< sim::FLSHit > &hits)
This function calculates the Moliere Radius.
std::vector< float > Begin_of_Detector_in_Z
double Vx(const int i=0) const
Definition: MCParticle.h:220
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Definition: DataViewImpl.h:344
double Pz(const int i=0) const
Definition: MCParticle.h:231
double Vz(const int i=0) const
Definition: MCParticle.h:222
Definition: fwd.h:28
double Vy(const int i=0) const
Definition: MCParticle.h:221
void mcchk::ShowerAnaCheck::beginJob ( )
virtual

Reimplemented from art::EDAnalyzer.

Definition at line 107 of file ShowerAnaCheck_module.cc.

References fCosTheta, fEnergyofShower, fEventWidth, fMoliereRadius, fNumberPerEvent, fShowerMotherPDG, fTruthEnergy, fVx, fVy, fVz, and art::TFileDirectory::make().

108  {
110 
111  fShowerMotherPDG = tfs->make<TH1F>("fFirstPDG","Plot of PDG Code of Shower Mother; PDG Code; Entries",120,0,120);
112  fVx = tfs->make<TH1F>("fVx","X Coordinate of Shower Mother Vertex; X (cm); Entries",30,-150,150);
113  fVy = tfs->make<TH1F>("fVy","Y Coordinate of Shower Mother Vertex; Y (cm); Entries",40,-200,200);
114  fVz = tfs->make<TH1F>("fVz","Z Coordinate of Shower Mother Vertex; Z (cm); Entries",100,0,1000);
115  fTruthEnergy = tfs->make<TH1F>("fTruthEnergy","MC Truth Energy of Shower Mother; Energy (GeV); Entries",40,0,8);
116  fCosTheta = tfs->make<TH1F>("fCosTheta","Cosine of Angle Between the Shower Mother Momentum and Z Axis; radians;Entries",100,-1,1);
117  fNumberPerEvent = tfs->make<TH1F>("fNumberPerEvent","Number of Particles in Each Event; Number in Event; Entries",15,0,15);
118  fEnergyofShower = tfs->make<TH1F>("fEnergyofShower","Energy of All FLSHITS; Energy (GeV); Entries",100,0,12);
119  fEventWidth = tfs->make<TH1F>("fEventWidth","Average Distance to FLSHit per Event; Distance (cm); Entries",50,0,15);
120  fMoliereRadius = tfs->make<TH1F>("fMoliereRadius","Plot of the Moliere Radius of Each Event, 10-11 cm for NOvA; R_{Moliere}; Entries",25,0,20);
121 
122  }
T * make(ARGS...args) const
detail::CachedProducts& art::EventObserverBase::cachedProducts ( )
inlineprotectedinherited

Definition at line 79 of file EventObserverBase.h.

References art::EventObserverBase::selectors_.

80  {
81  return selectors_;
82  }
detail::CachedProducts selectors_
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::EDAnalyzer::currentContext ( ) const
protectedinherited
void mcchk::ShowerAnaCheck::EMMoliereRadius ( float &  Moliere_radius,
int  MomsID,
const sim::Particle part,
const std::vector< sim::FLSHit > &  hits 
)

This function calculates the Moliere Radius.

Definition at line 270 of file ShowerAnaCheck_module.cc.

References geo::PlaneGeo::Cell(), geom(), calib::j, geo::CellGeo::LocalToWorld(), geo::GeometryBase::Plane(), PointLineDistance(), simb::MCParticle::Vx(), simb::MCParticle::Vy(), simb::MCParticle::Vz(), XYZ, and XYZWorld.

Referenced by analyze().

270  {
271 
273 
274  float Energy_of_shower = 0;
275  float X_cent = 0;
276  float Y_cent = 0;
277  float Z_cent = 0;
278 
279  // Again, calculate the centroid of the showewr
280  for (unsigned int index1=0; index1<hits.size(); ++index1){
281  if (hits[index1].GetTrackID() == MomsID){
282  // here XYZ is the average of where the hit enters and where it exits in the cell's frame
283  // XYZ is the global position
284  XYZ[0] = 0.5*(hits[index1].GetEntryX() + hits[index1].GetExitX());
285  XYZ[1] = 0.5*(hits[index1].GetEntryY() + hits[index1].GetExitY());
286  XYZ[2] = 0.5*(hits[index1].GetEntryZ() + hits[index1].GetExitZ());
287  geom->Plane(hits[index1].GetPlaneID())->Cell(hits[index1].GetCellID())->LocalToWorld(XYZ,XYZWorld);
288  // recursively add the coordinates of the hit
289  X_cent += hits[index1].GetEdep()*XYZWorld[0];
290  Y_cent += hits[index1].GetEdep()*XYZWorld[1];
291  Z_cent += hits[index1].GetEdep()*XYZWorld[2];
292  Energy_of_shower += hits[index1].GetEdep();
293  }
294  }
295  // Normalize the centroid of the shower by the overall energy
296  X_cent = X_cent/Energy_of_shower;
297  Y_cent = Y_cent/Energy_of_shower;
298  Z_cent = Z_cent/Energy_of_shower;
299 
300  // Here we have a crude way to find the Moliere radius by counting the energy deposited in a cylinder
301  // around the shower axis. The first for loop slowly increases the radius, and the second goes over
302  // all hits and finds how much energy is deposited within the shell
303  for (float Moliere_parameter = 0; Moliere_parameter < 100; Moliere_parameter += .1){
304  float Energy_contained = 0;
305  for (unsigned int j = 0; j<hits.size(); ++j){
306  // here XYZ is the average of where the hit enters and where it exits in the cell's frame
307  // XYZ is the global position
308  XYZ[0] = 0.5*(hits[j].GetEntryX() + hits[j].GetExitX());
309  XYZ[1] = 0.5*(hits[j].GetEntryY() + hits[j].GetExitY());
310  XYZ[2] = 0.5*(hits[j].GetEntryZ() + hits[j].GetExitZ());
311  geom->Plane(hits[j].GetPlaneID())->Cell(hits[j].GetCellID())->LocalToWorld(XYZ,XYZWorld);
312  // if the hit is within a cylinder of radius moliere_parameter,
313  if (hits[j].GetTrackID() == MomsID && PointLineDistance(XYZWorld[0],XYZWorld[1],XYZWorld[2],
314  part->Vx(),part->Vy(),part->Vz(),X_cent,Y_cent,Z_cent) < Moliere_parameter)
315  Energy_contained += hits[j].GetEdep();
316  }
317  // Set Moliere_radius to the iterative constant above if <90% of energy is contained, else break
318  if (Energy_contained/Energy_of_shower <= .9) Moliere_radius = Moliere_parameter;
319  else break;
320  }
321 
322  }
void LocalToWorld(const double *local, double *world) const
Definition: CellGeo.cxx:80
const CellGeo * Cell(int icell) const
Definition: PlaneGeo.h:48
const PlaneGeo * Plane(unsigned int i) const
void hits()
Definition: readHits.C:15
const double j
Definition: BetheBloch.cxx:29
double Vx(const int i=0) const
Definition: MCParticle.h:220
void geom(int which=0)
Definition: geom.C:163
double Vz(const int i=0) const
Definition: MCParticle.h:222
float PointLineDistance(float x, float y, float z, float x1, float y1, float z1, float x2, float y2, float z2)
double Vy(const int i=0) const
Definition: MCParticle.h:221
void mcchk::ShowerAnaCheck::EMShowerWidth ( float &  Event_distance,
int  MomsID,
const sim::Particle part,
const std::vector< sim::FLSHit > &  hits 
)

When this function is run, it finds the average distance, weighted by energy, to flshits over the shower.

Definition at line 213 of file ShowerAnaCheck_module.cc.

References geo::PlaneGeo::Cell(), geom(), calib::j, geo::CellGeo::LocalToWorld(), geo::GeometryBase::Plane(), PointLineDistance(), simb::MCParticle::Vx(), simb::MCParticle::Vy(), simb::MCParticle::Vz(), XYZ, and XYZWorld.

Referenced by analyze().

213  {
214 
216 
217  float Energy_of_shower = 0;
218  float X_cent = 0;
219  float Y_cent = 0;
220  float Z_cent = 0;
221 
222  // this for loop calculates the centroid of the shower, weights by energy
223  for (unsigned int index1=0; index1<hits.size(); ++index1){
224 
225  if (hits[index1].GetTrackID() == MomsID){
226  // here XYZ is the average of where the hit enters and where it exits in the cell's frame
227  // XYZ is the global position
228  XYZ[0] = 0.5*(hits[index1].GetEntryX() + hits[index1].GetExitX());
229  XYZ[1] = 0.5*(hits[index1].GetEntryY() + hits[index1].GetExitY());
230  XYZ[2] = 0.5*(hits[index1].GetEntryZ() + hits[index1].GetExitZ());
231  geom->Plane(hits[index1].GetPlaneID())->Cell(hits[index1].GetCellID())->LocalToWorld(XYZ,XYZWorld);
232  // recursively add the coordinates of the hit
233  X_cent += hits[index1].GetEdep()*XYZWorld[0];
234  Y_cent += hits[index1].GetEdep()*XYZWorld[1];
235  Z_cent += hits[index1].GetEdep()*XYZWorld[2];
236  Energy_of_shower += hits[index1].GetEdep();
237  }
238 
239  }
240 
241  // normalize the centroid by the overall shower Energy
242  X_cent = X_cent/Energy_of_shower;
243  Y_cent = Y_cent/Energy_of_shower;
244  Z_cent = Z_cent/Energy_of_shower;
245 
246  // here we find the average distance to the fls hits, weighted by energy
247  for (unsigned int j=0; j<hits.size(); ++j)
248  {
249  if (hits[j].GetTrackID() == MomsID){
250  // here XYZ is the average of where the hit enters and where it exits in the cell's frame
251  // XYZ is the global position
252  XYZ[0] = 0.5*(hits[j].GetEntryX() + hits[j].GetExitX());
253  XYZ[1] = 0.5*(hits[j].GetEntryY() + hits[j].GetExitY());
254  XYZ[2] = 0.5*(hits[j].GetEntryZ() + hits[j].GetExitZ());
255  geom->Plane(hits[j].GetPlaneID())->Cell(hits[j].GetCellID())->LocalToWorld(XYZ,XYZWorld);
256  // Add the distance to each hit * energy in that hit / total energy = energy weighting scheme
257  Event_distance = Event_distance + hits[j].GetEdep()*PointLineDistance(XYZWorld[0],XYZWorld[1],XYZWorld[2],
258  part->Vx(),part->Vy(),part->Vz(),
259  X_cent,Y_cent,Z_cent)/Energy_of_shower;
260  }
261 
262  } // end of FLSHit hits loop
263 
264  } // end of EMShowerWidth()
void LocalToWorld(const double *local, double *world) const
Definition: CellGeo.cxx:80
const CellGeo * Cell(int icell) const
Definition: PlaneGeo.h:48
const PlaneGeo * Plane(unsigned int i) const
void hits()
Definition: readHits.C:15
const double j
Definition: BetheBloch.cxx:29
double Vx(const int i=0) const
Definition: MCParticle.h:220
void geom(int which=0)
Definition: geom.C:163
double Vz(const int i=0) const
Definition: MCParticle.h:222
float PointLineDistance(float x, float y, float z, float x1, float y1, float z1, float x2, float y2, float z2)
double Vy(const int i=0) const
Definition: MCParticle.h:221
seed_t art::EngineCreator::get_seed_value ( fhicl::ParameterSet const &  pset,
char const  key[] = "seed",
seed_t const  implicit_seed = -1 
)
inherited
art::Handle<art::TriggerResults> art::EventObserverBase::getTriggerResults ( Event const &  e) const
inlineinherited

Definition at line 61 of file EventObserverBase.h.

References art::detail::CachedProducts::getOneTriggerResults(), and art::EventObserverBase::selectors_.

62  {
64  }
detail::CachedProducts selectors_
art::Handle< art::TriggerResults > getOneTriggerResults(Event const &) const
Float_t e
Definition: plot.C:35
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::EventObserverBase::modifiesEvent ( ) const
inlineinherited

Definition at line 25 of file EventObserverBase.h.

26  {
27  return false;
28  }
static cet::exempt_ptr<Consumer> art::Consumer::non_module_context ( )
staticinherited
float mcchk::ShowerAnaCheck::PointLineDistance ( float  x,
float  y,
float  z,
float  x1,
float  y1,
float  z1,
float  x2,
float  y2,
float  z2 
)

This function calculates the distance between any point and a line. The point is the first three arguments (x,y,z), then the line is the line passing through the other two points, (x1,y1,z1) and (x2,y2,z2)

Definition at line 329 of file ShowerAnaCheck_module.cc.

References DEFINE_ART_MODULE(), util::pythag(), util::sqr(), std::sqrt(), x1, and y1.

Referenced by EMMoliereRadius(), and EMShowerWidth().

329  {
330  float Lineone_point[3];
331  float Lineone_linetwo[3];
332  float Distance_one = 0;
333  float Distance_two = 0;
334  float Cosine = 0;
335  float Dot_product = 0;
336  Lineone_point[0]=x-x1;
337  Lineone_point[1]=y-y1;
338  Lineone_point[2]=z-z1;
339  Lineone_linetwo[0]=x2-x1;
340  Lineone_linetwo[1]=y2-y1;
341  Lineone_linetwo[2]=z2-z1;
342  Distance_one = util::pythag(Lineone_point[0], Lineone_point[1], Lineone_point[2]);
343  Distance_two = util::pythag(Lineone_linetwo[0], Lineone_linetwo[1], Lineone_linetwo[2]);
344  Dot_product = Lineone_point[0]*Lineone_linetwo[0]+Lineone_point[1]*Lineone_linetwo[1]+Lineone_point[2]*Lineone_linetwo[2];
345  Cosine = Dot_product/Distance_one/Distance_two;
346  return Distance_one*sqrt(1-util::sqr(Cosine));
347  }
Float_t y1[n_points_granero]
Definition: compare.C:5
Float_t x1[n_points_granero]
Definition: compare.C:5
T sqrt(T number)
Definition: d0nt_math.hpp:156
T sqr(T x)
More efficient square function than pow(x,2)
Definition: MathUtil.h:23
z
Definition: test.py:28
double pythag(double x, double y)
2D Euclidean distance
Definition: MathUtil.h:29
void art::Consumer::prepareForJob ( fhicl::ParameterSet const &  pset)
protectedinherited
std::string const& art::EventObserverBase::processName ( ) const
inlineinherited
void mcchk::ShowerAnaCheck::reconfigure ( const fhicl::ParameterSet pset)

Definition at line 96 of file ShowerAnaCheck_module.cc.

References Begin_of_Detector_in_Z, End_of_Detector_in_Z, Energy_Percent, fFLSHitListLabel, fhicl::ParameterSet::get(), Half_Height_of_Detector, Half_Width_of_Detector, Min_Energy, and string.

Referenced by ShowerAnaCheck().

97  {
98  fFLSHitListLabel = pset.get< std::string >("FLSHitListLabel");
99  Half_Width_of_Detector = pset.get<std::vector<float> >("sHalf_Width_of_Detector");
100  Half_Height_of_Detector = pset.get<std::vector<float> >("sHalf_Height_of_Detector");
101  Begin_of_Detector_in_Z = pset.get<std::vector<float> >("sBegin_of_Detector_in_Z");
102  End_of_Detector_in_Z = pset.get<std::vector<float> >("sEnd_of_Detector_in_Z");
103  Energy_Percent = pset.get<std::vector<float> >("sEnergy_Percent");
104  Min_Energy = pset.get<std::vector<float> >("sMin_Energy");
105  }
std::vector< float > Half_Height_of_Detector
std::vector< float > Half_Width_of_Detector
std::vector< float > End_of_Detector_in_Z
std::vector< float > Energy_Percent
T get(std::string const &key) const
Definition: ParameterSet.h:231
std::vector< float > Min_Energy
std::vector< float > Begin_of_Detector_in_Z
enum BeamMode string
void art::EventObserverBase::registerProducts ( MasterProductRegistry ,
ProductDescriptions ,
ModuleDescription const &   
)
inlineinherited

Definition at line 33 of file EventObserverBase.h.

References string.

36  {}
fhicl::ParameterSetID art::EventObserverBase::selectorConfig ( ) const
inlineinherited

Definition at line 56 of file EventObserverBase.h.

References art::EventObserverBase::selector_config_id_.

57  {
58  return selector_config_id_;
59  }
fhicl::ParameterSetID selector_config_id_
void art::Consumer::showMissingConsumes ( ) const
protectedinherited

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

void art::Consumer::validateConsumedProduct ( BranchType const  bt,
ProductInfo const &  pi 
)
protectedinherited
bool art::EventObserverBase::wantAllEvents ( ) const
inlineinherited

Definition at line 46 of file EventObserverBase.h.

References art::EventObserverBase::wantAllEvents_.

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

47  {
48  return wantAllEvents_;
49  }
bool art::EventObserverBase::wantEvent ( Event const &  e)
inlineinherited

Definition at line 51 of file EventObserverBase.h.

References art::EventObserverBase::selectors_, and art::detail::CachedProducts::wantEvent().

52  {
53  return selectors_.wantEvent(e);
54  }
detail::CachedProducts selectors_
Float_t e
Definition: plot.C:35
bool wantEvent(Event const &)
std::string art::EDAnalyzer::workerType ( ) const
inlineinherited

Definition at line 109 of file EDAnalyzer.h.

References art::EDAnalyzer::currentContext().

110  {
111  return "WorkerT<EDAnalyzer>";
112  }

Member Data Documentation

std::vector<float> mcchk::ShowerAnaCheck::Begin_of_Detector_in_Z
private

Definition at line 57 of file ShowerAnaCheck_module.cc.

Referenced by analyze(), and reconfigure().

std::vector<float> mcchk::ShowerAnaCheck::End_of_Detector_in_Z
private

Definition at line 58 of file ShowerAnaCheck_module.cc.

Referenced by analyze(), and reconfigure().

std::vector<float> mcchk::ShowerAnaCheck::Energy_Percent
private

Definition at line 59 of file ShowerAnaCheck_module.cc.

Referenced by analyze(), and reconfigure().

TH1F* mcchk::ShowerAnaCheck::fCosTheta
private

Definition at line 71 of file ShowerAnaCheck_module.cc.

Referenced by analyze(), and beginJob().

TH1F* mcchk::ShowerAnaCheck::fEnergyofShower
private

Definition at line 73 of file ShowerAnaCheck_module.cc.

Referenced by analyze(), and beginJob().

TH1F* mcchk::ShowerAnaCheck::fEventWidth
private

Definition at line 74 of file ShowerAnaCheck_module.cc.

Referenced by analyze(), and beginJob().

std::string mcchk::ShowerAnaCheck::fFLSHitListLabel
private

Definition at line 54 of file ShowerAnaCheck_module.cc.

Referenced by analyze(), and reconfigure().

TH1F* mcchk::ShowerAnaCheck::fMoliereRadius
private

Definition at line 75 of file ShowerAnaCheck_module.cc.

Referenced by analyze(), and beginJob().

TH1F* mcchk::ShowerAnaCheck::fNumberPerEvent
private

Definition at line 72 of file ShowerAnaCheck_module.cc.

Referenced by analyze(), and beginJob().

TH1F* mcchk::ShowerAnaCheck::fShowerMotherPDG
private

Definition at line 66 of file ShowerAnaCheck_module.cc.

Referenced by analyze(), and beginJob().

TH1F* mcchk::ShowerAnaCheck::fTruthEnergy
private

Definition at line 70 of file ShowerAnaCheck_module.cc.

Referenced by analyze(), and beginJob().

TH1F* mcchk::ShowerAnaCheck::fVx
private

Definition at line 67 of file ShowerAnaCheck_module.cc.

Referenced by analyze(), and beginJob().

TH1F* mcchk::ShowerAnaCheck::fVy
private

Definition at line 68 of file ShowerAnaCheck_module.cc.

Referenced by analyze(), and beginJob().

TH1F* mcchk::ShowerAnaCheck::fVz
private

Definition at line 69 of file ShowerAnaCheck_module.cc.

Referenced by analyze(), and beginJob().

std::vector<float> mcchk::ShowerAnaCheck::Half_Height_of_Detector
private

Definition at line 56 of file ShowerAnaCheck_module.cc.

Referenced by analyze(), and reconfigure().

std::vector<float> mcchk::ShowerAnaCheck::Half_Width_of_Detector
private

Definition at line 55 of file ShowerAnaCheck_module.cc.

Referenced by analyze(), and reconfigure().

std::vector<float> mcchk::ShowerAnaCheck::Min_Energy
private

Definition at line 60 of file ShowerAnaCheck_module.cc.

Referenced by analyze(), and reconfigure().

double mcchk::ShowerAnaCheck::XYZ[3]
private

Definition at line 62 of file ShowerAnaCheck_module.cc.

Referenced by EMMoliereRadius(), and EMShowerWidth().

double mcchk::ShowerAnaCheck::XYZWorld[3]
private

Definition at line 63 of file ShowerAnaCheck_module.cc.

Referenced by EMMoliereRadius(), and EMShowerWidth().


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