2 using namespace TauSpinner;
10 std::vector<SimpleParticle> *daughters =
new std::vector<SimpleParticle>();
11 if(!x->end_vertex())
return daughters;
14 for(HepMC::GenVertex::particles_out_const_iterator
p = x->end_vertex()->particles_out_const_begin();
p!=x->end_vertex()->particles_out_const_end(); ++
p)
17 HepMC::FourVector mm = pp->momentum();
21 if( pp->end_vertex() && pp->pdg_id()!=111)
23 std::vector<SimpleParticle> *sub_daughters =
getDaughters(pp);
24 daughters->insert(daughters->end(),sub_daughters->begin(),sub_daughters->end());
29 else if(pp->pdg_id()!=x->pdg_id())
31 SimpleParticle tp( mm.px(), mm.py(), mm.pz(), mm.e(), pp->pdg_id() );
32 daughters->push_back(tp);
48 if(!x->end_vertex())
return x;
50 for(HepMC::GenVertex::particle_iterator
p = x->end_vertex()->particles_begin(HepMC::children);
p!=x->end_vertex()->particles_end(HepMC::children); ++
p)
59 for(HepMC::GenVertex::particle_iterator
p = x->production_vertex()->particles_begin(
HepMC::parents);
p!=x->production_vertex()->particles_end(
HepMC::parents); ++
p){
60 if(x->pdg_id()==(*p)->pdg_id())
return false;
87 int readParticlesFromHepMC(
const HepMC::GenEvent *
event, SimpleParticle &
X, SimpleParticle &
tau, SimpleParticle &tau2, std::vector<SimpleParticle> &tau_daughters, std::vector<SimpleParticle> &tau2_daughters)
89 if(event==
NULL)
return 1;
94 for(HepMC::GenEvent::particle_const_iterator it = event->particles_begin(); it!=
event->particles_end(); ++it)
96 int pdgid = (*it)->pdg_id();
104 (*it)->end_vertex() &&
105 (*it)->end_vertex()->particles_out_size()>=2
114 for(HepMC::GenVertex::particle_iterator it2 = LhX->end_vertex()->particles_begin(HepMC::children); it2!=LhX->end_vertex()->particles_end(HepMC::children); ++it2)
116 if (
abs( (*it2)->pdg_id() )==15 && (*it2)->end_vertex() ){
117 if(!hTau) hTau = *it2;
118 else if(!hTau2) hTau2 = *it2;
121 std::cout<<
"TauSpiner: three taus in one decay"<<std::endl;
125 if (
abs( (*it2)->pdg_id() )==16 )
127 if(!hTau2) hTau2 = *it2;
130 std::cout<<
"TauSpiner: two neutrinos or two taus and neutrino in one decay"<<std::endl;
135 if(hTau && hTau2)
break;
153 X.setPx(hX->momentum().px());
154 X.setPy(hX->momentum().py());
155 X.setPz(hX->momentum().pz());
156 X.setE (hX->momentum().e ());
157 X.setPdgid(hX->pdg_id());
159 tau.setPx(hTau->momentum().px());
160 tau.setPy(hTau->momentum().py());
161 tau.setPz(hTau->momentum().pz());
162 tau.setE (hTau->momentum().e ());
163 tau.setPdgid(hTau->pdg_id());
165 tau2.setPx(hTau2->momentum().px());
166 tau2.setPy(hTau2->momentum().py());
167 tau2.setPz(hTau2->momentum().pz());
168 tau2.setE (hTau2->momentum().e ());
169 tau2.setPdgid(hTau2->pdg_id());
173 tau_daughters.clear();
174 tau_daughters.insert(tau_daughters.end(),buf->begin(),buf->end());
181 tau2_daughters.clear();
182 tau2_daughters.insert(tau2_daughters.end(),buf->begin(),buf->end());
HepMC::GenParticle * findLastSelf(HepMC::GenParticle *x)
std::vector< TauSpinner::SimpleParticle > * getDaughters(HepMC::GenParticle *x)
Abs< T >::type abs(const T &t)
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
int readParticlesFromHepMC(const HepMC::GenEvent *event, TauSpinner::SimpleParticle &X, TauSpinner::SimpleParticle &tau, TauSpinner::SimpleParticle &tau2, std::vector< TauSpinner::SimpleParticle > &tau_daughters, std::vector< TauSpinner::SimpleParticle > &tau2_daughters)