30 std::vector<geo::AuxDetGeo const*>
setA;
31 std::vector<geo::AuxDetGeo const*>
setB;
83 auto const mclists = e.
getMany<std::vector<simb::MCTruth>>();
84 for (
unsigned int i = 0; i < mclists.size() ; i++){
85 for (
unsigned int j = 0; j < mclists[i]->size(); j++){
88 for (
int part = 0; part < mc_truth->
NParticles(); part++){
91 TVector3 particle_pos = particle.
Position().Vect();
92 TVector3 particle_dir = particle.
Momentum().Vect().Unit();
133 for (
unsigned int i = 0; i < geom->
NAuxDets(); i++){
136 if (i >=6 && i <= 15) EWCounterSetPair.
setA.push_back(counter);
137 else if (i >= 28 && i <=37) EWCounterSetPair.
setB.push_back(counter);
139 else if (i >= 22 && i <= 27) NupSdownCounterSetPair.
setA.push_back(counter);
140 else if (i <= 5) NupSdownCounterSetPair.
setB.push_back(counter);
142 else if (i >= 16 && i <= 21) NdownSupCounterSetPair.
setA.push_back(counter);
143 else if (i >= 38 && i <= 43) NdownSupCounterSetPair.
setB.push_back(counter);
152 NupSdownCounterSetPair.
normalVec[0] = 1.;
153 NupSdownCounterSetPair.
normalVec[1] = 0.;
154 NupSdownCounterSetPair.
normalVec[2] = 0.;
158 NdownSupCounterSetPair.
normalVec[0] = 1.;
159 NdownSupCounterSetPair.
normalVec[1] = 0.;
160 NdownSupCounterSetPair.
normalVec[2] = 0.;
165 std::cout<<
"Counter set pair: "<<i<<
std::endl;
180 TLorentzVector mom4 = particle.
Momentum();
207 for (
unsigned int i = 0; i < counters.size(); i++){
211 double counter_pos_array[3];
214 TVector3 counter_pos(counter_pos_array[0], counter_pos_array[1], counter_pos_array[2]);
215 TVector3 particle_pos = particle.
Position().Vect();
216 TVector3 particle_dir = particle.
Momentum().Vect().Unit();
225 double scale_factor = counter_norm.Dot(counter_pos - particle_pos)/(counter_norm.Dot(particle_dir));
227 TVector3 particle_pos_in_plane = particle_pos + scale_factor * particle_dir;
233 TVector3 pos_corner, neg_corner;
240 double counter_top_norm_array[3];
243 TVector3 counter_top_norm;
244 counter_top_norm.SetX(counter_top_norm_array[0]);
245 counter_top_norm.SetY(counter_top_norm_array[1]);
246 counter_top_norm.SetZ(counter_top_norm_array[2]);
253 TVector3 counter_side_norm = counter_norm.Cross(counter_top_norm);
261 particle_pos_in_plane += -1.*counter_pos;
283 if (particle_pos_in_plane.X() >
std::min(pos_corner.X(), neg_corner.X()) && particle_pos_in_plane.X() <
std::max(pos_corner.X(),neg_corner.X()) && particle_pos_in_plane.Y() >
std::min(pos_corner.Y(), neg_corner.Y()) && particle_pos_in_plane.Y() <
std::max(pos_corner.Y(),neg_corner.Y()) && particle_pos_in_plane.Z() >
std::min(pos_corner.Z(), neg_corner.Z()) && particle_pos_in_plane.Z() <
std::max(pos_corner.Z(),neg_corner.Z())){
284 std::cout<<
"Particle uses counter in set"<<
std::endl;
bool IsInterestingParticle(const simb::MCParticle &particle)
const TLorentzVector & Position(const int i=0) const
double fParticleMinEnergy
bool fUseNupSdownCounterPair
art framework interface to geometry description
std::vector< geo::AuxDetGeo const * > setB
GenFilter(fhicl::ParameterSet const &pset)
bool ParticleHitsCounterSetPairs(const simb::MCParticle &particle, const CounterSetPair &CSP)
#define DEFINE_ART_MODULE(klass)
double HalfHeight() const
bool ParticleHitsCounterSet(const simb::MCParticle &particle, const std::vector< geo::AuxDetGeo const * > &counters, const TVector3 &counter_norm)
std::vector< Handle< PROD > > getMany(SelectorBase const &selector=MatchAllSelector{}) const
T get(std::string const &key) const
std::vector< int > fInterestingPDGs
geo::Vector_t GetNormalVector() const
Returns the unit normal vector to the detector.
static int max(int a, int b)
AuxDetGeo const & AuxDet(unsigned int const ad=0) const
Returns the specified auxiliary detector.
const simb::MCParticle & GetParticle(int i) const
virtual bool filter(art::Event &e)
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
std::vector< CounterSetPair > fCounterSetPairs
double fCounterSizeScaleFactor
const TLorentzVector & Momentum(const int i=0) const
EDFilter(fhicl::ParameterSet const &pset)
Declaration of basic channel signal object.
std::vector< geo::AuxDetGeo const * > setA
double HalfWidth1() const
bool fUseNdownSupCounterPair
void reconfigure(fhicl::ParameterSet const &pset)
double fParticleMaxEnergy
QTextStream & endl(QTextStream &s)
unsigned int NAuxDets() const
Returns the number of auxiliary detectors.
void GetCenter(double *xyz, double localz=0.0) const
Return the center position of an AuxDet.